diff --git a/Godeps/Godeps.json b/Godeps/Godeps.json index 97d4bee1054c..3892fb7b1bb1 100644 --- a/Godeps/Godeps.json +++ b/Godeps/Godeps.json @@ -27,6 +27,10 @@ "ImportPath": "github.com/AdRoll/goamz/s3", "Rev": "cc210f45dcb9889c2769a274522be2bf70edfb99" }, + { + "ImportPath": "github.com/ClusterHQ/flocker-go", + "Rev": "3f33ece70f6571f0ec45bfae2f243ab11fab6c52" + }, { "ImportPath": "github.com/MakeNowJust/heredoc", "Rev": "1d91351acdc1cb2f2c995864674b754134b86ca7" @@ -48,6 +52,21 @@ "ImportPath": "github.com/abbot/go-http-auth", "Rev": "c0ef4539dfab4d21c8ef20ba2924f9fc6f186d35" }, + { + "ImportPath": "github.com/appc/cni/libcni", + "Comment": "v0.1.0-27-g2a58bd9", + "Rev": "2a58bd9379ca33579f0cf631945b717aa4fa373d" + }, + { + "ImportPath": "github.com/appc/cni/pkg/invoke", + "Comment": "v0.1.0-27-g2a58bd9", + "Rev": "2a58bd9379ca33579f0cf631945b717aa4fa373d" + }, + { + "ImportPath": "github.com/appc/cni/pkg/types", + "Comment": "v0.1.0-27-g2a58bd9", + "Rev": "2a58bd9379ca33579f0cf631945b717aa4fa373d" + }, { "ImportPath": "github.com/appc/spec/schema", "Comment": "v0.6.1-30-gc928a0c", @@ -55,58 +74,53 @@ }, { "ImportPath": "github.com/aws/aws-sdk-go/aws", - "Comment": "v0.6.0-7-gcea3a42", - "Rev": "cea3a425fc2d887d102e406ec2f8b37a57abd82f" - }, - { - "ImportPath": "github.com/aws/aws-sdk-go/internal/apierr", - "Comment": "v0.6.0-7-gcea3a42", - "Rev": "cea3a425fc2d887d102e406ec2f8b37a57abd82f" + "Comment": "v0.9.9", + "Rev": "c4ae871ffc03691a7b039fa751a1e7afee56e920" }, { "ImportPath": "github.com/aws/aws-sdk-go/internal/endpoints", - "Comment": "v0.6.0-7-gcea3a42", - "Rev": "cea3a425fc2d887d102e406ec2f8b37a57abd82f" + "Comment": "v0.9.9", + "Rev": "c4ae871ffc03691a7b039fa751a1e7afee56e920" }, { "ImportPath": "github.com/aws/aws-sdk-go/internal/protocol/ec2query", - "Comment": "v0.6.0-7-gcea3a42", - "Rev": "cea3a425fc2d887d102e406ec2f8b37a57abd82f" + "Comment": "v0.9.9", + "Rev": "c4ae871ffc03691a7b039fa751a1e7afee56e920" }, { "ImportPath": "github.com/aws/aws-sdk-go/internal/protocol/query", - "Comment": "v0.6.0-7-gcea3a42", - "Rev": "cea3a425fc2d887d102e406ec2f8b37a57abd82f" + "Comment": "v0.9.9", + "Rev": "c4ae871ffc03691a7b039fa751a1e7afee56e920" }, { "ImportPath": "github.com/aws/aws-sdk-go/internal/protocol/rest", - "Comment": "v0.6.0-7-gcea3a42", - "Rev": "cea3a425fc2d887d102e406ec2f8b37a57abd82f" + "Comment": "v0.9.9", + "Rev": "c4ae871ffc03691a7b039fa751a1e7afee56e920" }, { "ImportPath": "github.com/aws/aws-sdk-go/internal/protocol/xml/xmlutil", - "Comment": "v0.6.0-7-gcea3a42", - "Rev": "cea3a425fc2d887d102e406ec2f8b37a57abd82f" + "Comment": "v0.9.9", + "Rev": "c4ae871ffc03691a7b039fa751a1e7afee56e920" }, { "ImportPath": "github.com/aws/aws-sdk-go/internal/signer/v4", - "Comment": "v0.6.0-7-gcea3a42", - "Rev": "cea3a425fc2d887d102e406ec2f8b37a57abd82f" + "Comment": "v0.9.9", + "Rev": "c4ae871ffc03691a7b039fa751a1e7afee56e920" }, { "ImportPath": "github.com/aws/aws-sdk-go/service/autoscaling", - "Comment": "v0.6.0-7-gcea3a42", - "Rev": "cea3a425fc2d887d102e406ec2f8b37a57abd82f" + "Comment": "v0.9.9", + "Rev": "c4ae871ffc03691a7b039fa751a1e7afee56e920" }, { "ImportPath": "github.com/aws/aws-sdk-go/service/ec2", - "Comment": "v0.6.0-7-gcea3a42", - "Rev": "cea3a425fc2d887d102e406ec2f8b37a57abd82f" + "Comment": "v0.9.9", + "Rev": "c4ae871ffc03691a7b039fa751a1e7afee56e920" }, { "ImportPath": "github.com/aws/aws-sdk-go/service/elb", - "Comment": "v0.6.0-7-gcea3a42", - "Rev": "cea3a425fc2d887d102e406ec2f8b37a57abd82f" + "Comment": "v0.9.9", + "Rev": "c4ae871ffc03691a7b039fa751a1e7afee56e920" }, { "ImportPath": "github.com/beorn7/perks/quantile", @@ -116,10 +130,6 @@ "ImportPath": "github.com/bradfitz/http2", "Rev": "f8202bc903bda493ebba4aa54922d78430c2c42f" }, - { - "ImportPath": "github.com/bradfitz/http2/hpack", - "Rev": "f8202bc903bda493ebba4aa54922d78430c2c42f" - }, { "ImportPath": "github.com/coreos/etcd/client", "Comment": "v2.1.2", @@ -242,8 +252,8 @@ }, { "ImportPath": "github.com/coreos/go-etcd/etcd", - "Comment": "v2.0.0-13-g4cceaf7", - "Rev": "4cceaf7283b76f27c4a732b20730dcdb61053bf5" + "Comment": "v2.0.0-34-gde3514f", + "Rev": "de3514f25635bbfb024fdaf2a8d5f67378492675" }, { "ImportPath": "github.com/coreos/go-oidc/http", @@ -284,11 +294,6 @@ "Comment": "v2-27-g97e243d", "Rev": "97e243d21a8e232e9d8af38ba2366dfcfceebeba" }, - { - "ImportPath": "github.com/coreos/go-systemd/journal", - "Comment": "v2-27-g97e243d", - "Rev": "97e243d21a8e232e9d8af38ba2366dfcfceebeba" - }, { "ImportPath": "github.com/coreos/go-systemd/unit", "Comment": "v2-27-g97e243d", @@ -406,7 +411,7 @@ }, { "ImportPath": "github.com/fsouza/go-dockerclient", - "Rev": "76fd6c68cf24c48ee6a2b25def997182a29f940e" + "Rev": "1399676f53e6ccf46e0bf00751b21bed329bc60e" }, { "ImportPath": "github.com/garyburd/redigo/internal", @@ -422,7 +427,7 @@ }, { "ImportPath": "github.com/ghodss/yaml", - "Rev": "588cb435e59ee8b6c2795482887755841ad67207" + "Rev": "73d445a93680fa1a78ae23a5839bad48f32ba1ee" }, { "ImportPath": "github.com/go-ldap/ldap", @@ -436,8 +441,8 @@ }, { "ImportPath": "github.com/gogo/protobuf/proto", - "Comment": "v0.1", - "Rev": "6cab0cc9fec8f660c2cee46e1306ffc727261956" + "Comment": "v0.1-55-g2093b57", + "Rev": "2093b57e5ca2ccbee4626814100bc1aada691b18" }, { "ImportPath": "github.com/golang/glog", @@ -632,19 +637,23 @@ }, { "ImportPath": "github.com/mesos/mesos-go/detector", - "Rev": "65cb9ffec50a76f4ed9fe4808405b66b3bb7010d" + "Comment": "v0.0.1-20-gb164c06", + "Rev": "b164c06f346af1e93aecb6502f83d31dbacdbb91" }, { "ImportPath": "github.com/mesos/mesos-go/mesosproto", - "Rev": "65cb9ffec50a76f4ed9fe4808405b66b3bb7010d" + "Comment": "v0.0.1-20-gb164c06", + "Rev": "b164c06f346af1e93aecb6502f83d31dbacdbb91" }, { "ImportPath": "github.com/mesos/mesos-go/mesosutil", - "Rev": "65cb9ffec50a76f4ed9fe4808405b66b3bb7010d" + "Comment": "v0.0.1-20-gb164c06", + "Rev": "b164c06f346af1e93aecb6502f83d31dbacdbb91" }, { "ImportPath": "github.com/mesos/mesos-go/upid", - "Rev": "65cb9ffec50a76f4ed9fe4808405b66b3bb7010d" + "Comment": "v0.0.1-20-gb164c06", + "Rev": "b164c06f346af1e93aecb6502f83d31dbacdbb91" }, { "ImportPath": "github.com/miekg/dns", @@ -737,34 +746,32 @@ "Comment": "0.4.0-1-g692492e", "Rev": "692492e54b553a81013254cc1fba4b6dd76fad30" }, - { - "ImportPath": "github.com/prometheus/client_golang/model", - "Comment": "0.4.0-1-g692492e", - "Rev": "692492e54b553a81013254cc1fba4b6dd76fad30" - }, { "ImportPath": "github.com/prometheus/client_golang/prometheus", - "Comment": "0.4.0-1-g692492e", - "Rev": "692492e54b553a81013254cc1fba4b6dd76fad30" - }, - { - "ImportPath": "github.com/prometheus/client_golang/text", - "Comment": "0.4.0-1-g692492e", - "Rev": "692492e54b553a81013254cc1fba4b6dd76fad30" + "Comment": "0.7.0-39-g3b78d7a", + "Rev": "3b78d7a77f51ccbc364d4bc170920153022cfd08" }, { "ImportPath": "github.com/prometheus/client_model/go", "Comment": "model-0.0.2-12-gfa8ad6f", "Rev": "fa8ad6fec33561be4280a8f0514318c79d7f6cb6" }, + { + "ImportPath": "github.com/prometheus/common/expfmt", + "Rev": "ef7a9a5fb138aa5d3a19988537606226869a0390" + }, + { + "ImportPath": "github.com/prometheus/common/model", + "Rev": "ef7a9a5fb138aa5d3a19988537606226869a0390" + }, { "ImportPath": "github.com/prometheus/procfs", "Rev": "490cc6eb5fa45bf8a8b7b73c8bc82a8160e8531d" }, { "ImportPath": "github.com/rackspace/gophercloud", - "Comment": "v1.0.0-569-gf3ced00", - "Rev": "f3ced00552c1c7d4a6184500af9062cfb4ff4463" + "Comment": "v1.0.0-665-gf928634", + "Rev": "f92863476c034f851073599c09d90cd61ee95b3d" }, { "ImportPath": "github.com/russross/blackfriday", @@ -773,7 +780,7 @@ }, { "ImportPath": "github.com/samuel/go-zookeeper/zk", - "Rev": "d0e0d8e11f318e000a8cc434616d69e329edc374" + "Rev": "177002e16a0061912f02377e2dd8951a8b3551bc" }, { "ImportPath": "github.com/scalingdata/gcfg", @@ -836,7 +843,7 @@ }, { "ImportPath": "github.com/ugorji/go/codec", - "Rev": "821cda7e48749cacf7cad2c6ed01e96457ca7e9d" + "Rev": "2f4b94206aae781e63846a9bf02ad83c387d5296" }, { "ImportPath": "github.com/vaughan0/go-ini", @@ -868,11 +875,11 @@ }, { "ImportPath": "golang.org/x/net/context", - "Rev": "ea47fc708ee3e20177f3ca3716217c4ab75942cb" + "Rev": "c2528b2dd8352441850638a8bb678c2ad056fd3e" }, { "ImportPath": "golang.org/x/net/html", - "Rev": "ea47fc708ee3e20177f3ca3716217c4ab75942cb" + "Rev": "c2528b2dd8352441850638a8bb678c2ad056fd3e" }, { "ImportPath": "golang.org/x/net/internal/timeseries", @@ -888,12 +895,16 @@ }, { "ImportPath": "golang.org/x/net/websocket", - "Rev": "ea47fc708ee3e20177f3ca3716217c4ab75942cb" + "Rev": "c2528b2dd8352441850638a8bb678c2ad056fd3e" }, { "ImportPath": "golang.org/x/oauth2", "Rev": "b5adcc2dcdf009d0391547edc6ecbaff889f5bb9" }, + { + "ImportPath": "google.golang.org/api/cloudmonitoring/v2beta2", + "Rev": "0c2979aeaa5b573e60d3ddffe5ce8dca8df309bd" + }, { "ImportPath": "google.golang.org/api/compute/v1", "Rev": "0c2979aeaa5b573e60d3ddffe5ce8dca8df309bd" @@ -934,268 +945,303 @@ }, { "ImportPath": "k8s.io/kubernetes/cmd/kube-apiserver/app", - "Comment": "v1.1.0-alpha.1-653-g86b4e77", - "Rev": "86b4e777e1947c1bc00e422306a3ca74cbd54dbe" + "Comment": "v1.2.0-alpha.1-1107-g4c8e6f4", + "Rev": "4c8e6f47ec23f390978e651232b375f5f9cde3c7" }, { "ImportPath": "k8s.io/kubernetes/cmd/kube-controller-manager/app", - "Comment": "v1.1.0-alpha.1-653-g86b4e77", - "Rev": "86b4e777e1947c1bc00e422306a3ca74cbd54dbe" + "Comment": "v1.2.0-alpha.1-1107-g4c8e6f4", + "Rev": "4c8e6f47ec23f390978e651232b375f5f9cde3c7" }, { "ImportPath": "k8s.io/kubernetes/cmd/kube-proxy/app", - "Comment": "v1.1.0-alpha.1-653-g86b4e77", - "Rev": "86b4e777e1947c1bc00e422306a3ca74cbd54dbe" + "Comment": "v1.2.0-alpha.1-1107-g4c8e6f4", + "Rev": "4c8e6f47ec23f390978e651232b375f5f9cde3c7" }, { "ImportPath": "k8s.io/kubernetes/cmd/kubelet/app", - "Comment": "v1.1.0-alpha.1-653-g86b4e77", - "Rev": "86b4e777e1947c1bc00e422306a3ca74cbd54dbe" + "Comment": "v1.2.0-alpha.1-1107-g4c8e6f4", + "Rev": "4c8e6f47ec23f390978e651232b375f5f9cde3c7" }, { "ImportPath": "k8s.io/kubernetes/pkg/admission", - "Comment": "v1.1.0-alpha.1-653-g86b4e77", - "Rev": "86b4e777e1947c1bc00e422306a3ca74cbd54dbe" + "Comment": "v1.2.0-alpha.1-1107-g4c8e6f4", + "Rev": "4c8e6f47ec23f390978e651232b375f5f9cde3c7" }, { "ImportPath": "k8s.io/kubernetes/pkg/api", - "Comment": "v1.1.0-alpha.1-653-g86b4e77", - "Rev": "86b4e777e1947c1bc00e422306a3ca74cbd54dbe" + "Comment": "v1.2.0-alpha.1-1107-g4c8e6f4", + "Rev": "4c8e6f47ec23f390978e651232b375f5f9cde3c7" }, { - "ImportPath": "k8s.io/kubernetes/pkg/apis/experimental", - "Comment": "v1.1.0-alpha.1-653-g86b4e77", - "Rev": "86b4e777e1947c1bc00e422306a3ca74cbd54dbe" + "ImportPath": "k8s.io/kubernetes/pkg/apis/extensions", + "Comment": "v1.2.0-alpha.1-1107-g4c8e6f4", + "Rev": "4c8e6f47ec23f390978e651232b375f5f9cde3c7" }, { "ImportPath": "k8s.io/kubernetes/pkg/apiserver", - "Comment": "v1.1.0-alpha.1-653-g86b4e77", - "Rev": "86b4e777e1947c1bc00e422306a3ca74cbd54dbe" + "Comment": "v1.2.0-alpha.1-1107-g4c8e6f4", + "Rev": "4c8e6f47ec23f390978e651232b375f5f9cde3c7" }, { "ImportPath": "k8s.io/kubernetes/pkg/auth/authenticator", - "Comment": "v1.1.0-alpha.1-653-g86b4e77", - "Rev": "86b4e777e1947c1bc00e422306a3ca74cbd54dbe" + "Comment": "v1.2.0-alpha.1-1107-g4c8e6f4", + "Rev": "4c8e6f47ec23f390978e651232b375f5f9cde3c7" }, { "ImportPath": "k8s.io/kubernetes/pkg/auth/authorizer", - "Comment": "v1.1.0-alpha.1-653-g86b4e77", - "Rev": "86b4e777e1947c1bc00e422306a3ca74cbd54dbe" + "Comment": "v1.2.0-alpha.1-1107-g4c8e6f4", + "Rev": "4c8e6f47ec23f390978e651232b375f5f9cde3c7" }, { "ImportPath": "k8s.io/kubernetes/pkg/auth/handlers", - "Comment": "v1.1.0-alpha.1-653-g86b4e77", - "Rev": "86b4e777e1947c1bc00e422306a3ca74cbd54dbe" + "Comment": "v1.2.0-alpha.1-1107-g4c8e6f4", + "Rev": "4c8e6f47ec23f390978e651232b375f5f9cde3c7" }, { "ImportPath": "k8s.io/kubernetes/pkg/auth/user", - "Comment": "v1.1.0-alpha.1-653-g86b4e77", - "Rev": "86b4e777e1947c1bc00e422306a3ca74cbd54dbe" + "Comment": "v1.2.0-alpha.1-1107-g4c8e6f4", + "Rev": "4c8e6f47ec23f390978e651232b375f5f9cde3c7" }, { "ImportPath": "k8s.io/kubernetes/pkg/capabilities", - "Comment": "v1.1.0-alpha.1-653-g86b4e77", - "Rev": "86b4e777e1947c1bc00e422306a3ca74cbd54dbe" + "Comment": "v1.2.0-alpha.1-1107-g4c8e6f4", + "Rev": "4c8e6f47ec23f390978e651232b375f5f9cde3c7" + }, + { + "ImportPath": "k8s.io/kubernetes/pkg/client/cache", + "Comment": "v1.2.0-alpha.1-1107-g4c8e6f4", + "Rev": "4c8e6f47ec23f390978e651232b375f5f9cde3c7" + }, + { + "ImportPath": "k8s.io/kubernetes/pkg/client/chaosclient", + "Comment": "v1.2.0-alpha.1-1107-g4c8e6f4", + "Rev": "4c8e6f47ec23f390978e651232b375f5f9cde3c7" + }, + { + "ImportPath": "k8s.io/kubernetes/pkg/client/metrics", + "Comment": "v1.2.0-alpha.1-1107-g4c8e6f4", + "Rev": "4c8e6f47ec23f390978e651232b375f5f9cde3c7" + }, + { + "ImportPath": "k8s.io/kubernetes/pkg/client/record", + "Comment": "v1.2.0-alpha.1-1107-g4c8e6f4", + "Rev": "4c8e6f47ec23f390978e651232b375f5f9cde3c7" + }, + { + "ImportPath": "k8s.io/kubernetes/pkg/client/unversioned", + "Comment": "v1.2.0-alpha.1-1107-g4c8e6f4", + "Rev": "4c8e6f47ec23f390978e651232b375f5f9cde3c7" }, { "ImportPath": "k8s.io/kubernetes/pkg/cloudprovider", - "Comment": "v1.1.0-alpha.1-653-g86b4e77", - "Rev": "86b4e777e1947c1bc00e422306a3ca74cbd54dbe" + "Comment": "v1.2.0-alpha.1-1107-g4c8e6f4", + "Rev": "4c8e6f47ec23f390978e651232b375f5f9cde3c7" }, { "ImportPath": "k8s.io/kubernetes/pkg/controller", - "Comment": "v1.1.0-alpha.1-653-g86b4e77", - "Rev": "86b4e777e1947c1bc00e422306a3ca74cbd54dbe" + "Comment": "v1.2.0-alpha.1-1107-g4c8e6f4", + "Rev": "4c8e6f47ec23f390978e651232b375f5f9cde3c7" }, { "ImportPath": "k8s.io/kubernetes/pkg/conversion", - "Comment": "v1.1.0-alpha.1-653-g86b4e77", - "Rev": "86b4e777e1947c1bc00e422306a3ca74cbd54dbe" + "Comment": "v1.2.0-alpha.1-1107-g4c8e6f4", + "Rev": "4c8e6f47ec23f390978e651232b375f5f9cde3c7" }, { "ImportPath": "k8s.io/kubernetes/pkg/credentialprovider", - "Comment": "v1.1.0-alpha.1-653-g86b4e77", - "Rev": "86b4e777e1947c1bc00e422306a3ca74cbd54dbe" + "Comment": "v1.2.0-alpha.1-1107-g4c8e6f4", + "Rev": "4c8e6f47ec23f390978e651232b375f5f9cde3c7" }, { "ImportPath": "k8s.io/kubernetes/pkg/fieldpath", - "Comment": "v1.1.0-alpha.1-653-g86b4e77", - "Rev": "86b4e777e1947c1bc00e422306a3ca74cbd54dbe" + "Comment": "v1.2.0-alpha.1-1107-g4c8e6f4", + "Rev": "4c8e6f47ec23f390978e651232b375f5f9cde3c7" }, { "ImportPath": "k8s.io/kubernetes/pkg/fields", - "Comment": "v1.1.0-alpha.1-653-g86b4e77", - "Rev": "86b4e777e1947c1bc00e422306a3ca74cbd54dbe" + "Comment": "v1.2.0-alpha.1-1107-g4c8e6f4", + "Rev": "4c8e6f47ec23f390978e651232b375f5f9cde3c7" }, { "ImportPath": "k8s.io/kubernetes/pkg/healthz", - "Comment": "v1.1.0-alpha.1-653-g86b4e77", - "Rev": "86b4e777e1947c1bc00e422306a3ca74cbd54dbe" + "Comment": "v1.2.0-alpha.1-1107-g4c8e6f4", + "Rev": "4c8e6f47ec23f390978e651232b375f5f9cde3c7" }, { "ImportPath": "k8s.io/kubernetes/pkg/httplog", - "Comment": "v1.1.0-alpha.1-653-g86b4e77", - "Rev": "86b4e777e1947c1bc00e422306a3ca74cbd54dbe" + "Comment": "v1.2.0-alpha.1-1107-g4c8e6f4", + "Rev": "4c8e6f47ec23f390978e651232b375f5f9cde3c7" }, { "ImportPath": "k8s.io/kubernetes/pkg/kubectl", - "Comment": "v1.1.0-alpha.1-653-g86b4e77", - "Rev": "86b4e777e1947c1bc00e422306a3ca74cbd54dbe" + "Comment": "v1.2.0-alpha.1-1107-g4c8e6f4", + "Rev": "4c8e6f47ec23f390978e651232b375f5f9cde3c7" }, { "ImportPath": "k8s.io/kubernetes/pkg/kubelet", - "Comment": "v1.1.0-alpha.1-653-g86b4e77", - "Rev": "86b4e777e1947c1bc00e422306a3ca74cbd54dbe" + "Comment": "v1.2.0-alpha.1-1107-g4c8e6f4", + "Rev": "4c8e6f47ec23f390978e651232b375f5f9cde3c7" }, { "ImportPath": "k8s.io/kubernetes/pkg/labels", - "Comment": "v1.1.0-alpha.1-653-g86b4e77", - "Rev": "86b4e777e1947c1bc00e422306a3ca74cbd54dbe" + "Comment": "v1.2.0-alpha.1-1107-g4c8e6f4", + "Rev": "4c8e6f47ec23f390978e651232b375f5f9cde3c7" }, { "ImportPath": "k8s.io/kubernetes/pkg/master", - "Comment": "v1.1.0-alpha.1-653-g86b4e77", - "Rev": "86b4e777e1947c1bc00e422306a3ca74cbd54dbe" + "Comment": "v1.2.0-alpha.1-1107-g4c8e6f4", + "Rev": "4c8e6f47ec23f390978e651232b375f5f9cde3c7" }, { "ImportPath": "k8s.io/kubernetes/pkg/probe", - "Comment": "v1.1.0-alpha.1-653-g86b4e77", - "Rev": "86b4e777e1947c1bc00e422306a3ca74cbd54dbe" + "Comment": "v1.2.0-alpha.1-1107-g4c8e6f4", + "Rev": "4c8e6f47ec23f390978e651232b375f5f9cde3c7" }, { "ImportPath": "k8s.io/kubernetes/pkg/proxy", - "Comment": "v1.1.0-alpha.1-653-g86b4e77", - "Rev": "86b4e777e1947c1bc00e422306a3ca74cbd54dbe" + "Comment": "v1.2.0-alpha.1-1107-g4c8e6f4", + "Rev": "4c8e6f47ec23f390978e651232b375f5f9cde3c7" }, { "ImportPath": "k8s.io/kubernetes/pkg/registry/componentstatus", - "Comment": "v1.1.0-alpha.1-653-g86b4e77", - "Rev": "86b4e777e1947c1bc00e422306a3ca74cbd54dbe" + "Comment": "v1.2.0-alpha.1-1107-g4c8e6f4", + "Rev": "4c8e6f47ec23f390978e651232b375f5f9cde3c7" }, { "ImportPath": "k8s.io/kubernetes/pkg/registry/controller", - "Comment": "v1.1.0-alpha.1-653-g86b4e77", - "Rev": "86b4e777e1947c1bc00e422306a3ca74cbd54dbe" + "Comment": "v1.2.0-alpha.1-1107-g4c8e6f4", + "Rev": "4c8e6f47ec23f390978e651232b375f5f9cde3c7" }, { "ImportPath": "k8s.io/kubernetes/pkg/registry/daemonset", - "Comment": "v1.1.0-alpha.1-653-g86b4e77", - "Rev": "86b4e777e1947c1bc00e422306a3ca74cbd54dbe" + "Comment": "v1.2.0-alpha.1-1107-g4c8e6f4", + "Rev": "4c8e6f47ec23f390978e651232b375f5f9cde3c7" }, { "ImportPath": "k8s.io/kubernetes/pkg/registry/deployment", - "Comment": "v1.1.0-alpha.1-653-g86b4e77", - "Rev": "86b4e777e1947c1bc00e422306a3ca74cbd54dbe" + "Comment": "v1.2.0-alpha.1-1107-g4c8e6f4", + "Rev": "4c8e6f47ec23f390978e651232b375f5f9cde3c7" }, { "ImportPath": "k8s.io/kubernetes/pkg/registry/endpoint", - "Comment": "v1.1.0-alpha.1-653-g86b4e77", - "Rev": "86b4e777e1947c1bc00e422306a3ca74cbd54dbe" + "Comment": "v1.2.0-alpha.1-1107-g4c8e6f4", + "Rev": "4c8e6f47ec23f390978e651232b375f5f9cde3c7" }, { "ImportPath": "k8s.io/kubernetes/pkg/registry/event", - "Comment": "v1.1.0-alpha.1-653-g86b4e77", - "Rev": "86b4e777e1947c1bc00e422306a3ca74cbd54dbe" + "Comment": "v1.2.0-alpha.1-1107-g4c8e6f4", + "Rev": "4c8e6f47ec23f390978e651232b375f5f9cde3c7" }, { "ImportPath": "k8s.io/kubernetes/pkg/registry/experimental/controller/etcd", - "Comment": "v1.1.0-alpha.1-653-g86b4e77", - "Rev": "86b4e777e1947c1bc00e422306a3ca74cbd54dbe" + "Comment": "v1.2.0-alpha.1-1107-g4c8e6f4", + "Rev": "4c8e6f47ec23f390978e651232b375f5f9cde3c7" }, { "ImportPath": "k8s.io/kubernetes/pkg/registry/generic", - "Comment": "v1.1.0-alpha.1-653-g86b4e77", - "Rev": "86b4e777e1947c1bc00e422306a3ca74cbd54dbe" + "Comment": "v1.2.0-alpha.1-1107-g4c8e6f4", + "Rev": "4c8e6f47ec23f390978e651232b375f5f9cde3c7" }, { "ImportPath": "k8s.io/kubernetes/pkg/registry/horizontalpodautoscaler", - "Comment": "v1.1.0-alpha.1-653-g86b4e77", - "Rev": "86b4e777e1947c1bc00e422306a3ca74cbd54dbe" + "Comment": "v1.2.0-alpha.1-1107-g4c8e6f4", + "Rev": "4c8e6f47ec23f390978e651232b375f5f9cde3c7" + }, + { + "ImportPath": "k8s.io/kubernetes/pkg/registry/ingress", + "Comment": "v1.2.0-alpha.1-1107-g4c8e6f4", + "Rev": "4c8e6f47ec23f390978e651232b375f5f9cde3c7" }, { "ImportPath": "k8s.io/kubernetes/pkg/registry/job", - "Comment": "v1.1.0-alpha.1-653-g86b4e77", - "Rev": "86b4e777e1947c1bc00e422306a3ca74cbd54dbe" + "Comment": "v1.2.0-alpha.1-1107-g4c8e6f4", + "Rev": "4c8e6f47ec23f390978e651232b375f5f9cde3c7" }, { "ImportPath": "k8s.io/kubernetes/pkg/registry/limitrange", - "Comment": "v1.1.0-alpha.1-653-g86b4e77", - "Rev": "86b4e777e1947c1bc00e422306a3ca74cbd54dbe" + "Comment": "v1.2.0-alpha.1-1107-g4c8e6f4", + "Rev": "4c8e6f47ec23f390978e651232b375f5f9cde3c7" }, { "ImportPath": "k8s.io/kubernetes/pkg/registry/namespace", - "Comment": "v1.1.0-alpha.1-653-g86b4e77", - "Rev": "86b4e777e1947c1bc00e422306a3ca74cbd54dbe" + "Comment": "v1.2.0-alpha.1-1107-g4c8e6f4", + "Rev": "4c8e6f47ec23f390978e651232b375f5f9cde3c7" }, { "ImportPath": "k8s.io/kubernetes/pkg/registry/node", - "Comment": "v1.1.0-alpha.1-653-g86b4e77", - "Rev": "86b4e777e1947c1bc00e422306a3ca74cbd54dbe" + "Comment": "v1.2.0-alpha.1-1107-g4c8e6f4", + "Rev": "4c8e6f47ec23f390978e651232b375f5f9cde3c7" }, { "ImportPath": "k8s.io/kubernetes/pkg/registry/persistentvolume", - "Comment": "v1.1.0-alpha.1-653-g86b4e77", - "Rev": "86b4e777e1947c1bc00e422306a3ca74cbd54dbe" + "Comment": "v1.2.0-alpha.1-1107-g4c8e6f4", + "Rev": "4c8e6f47ec23f390978e651232b375f5f9cde3c7" }, { "ImportPath": "k8s.io/kubernetes/pkg/registry/persistentvolumeclaim", - "Comment": "v1.1.0-alpha.1-653-g86b4e77", - "Rev": "86b4e777e1947c1bc00e422306a3ca74cbd54dbe" + "Comment": "v1.2.0-alpha.1-1107-g4c8e6f4", + "Rev": "4c8e6f47ec23f390978e651232b375f5f9cde3c7" }, { "ImportPath": "k8s.io/kubernetes/pkg/registry/pod", - "Comment": "v1.1.0-alpha.1-653-g86b4e77", - "Rev": "86b4e777e1947c1bc00e422306a3ca74cbd54dbe" + "Comment": "v1.2.0-alpha.1-1107-g4c8e6f4", + "Rev": "4c8e6f47ec23f390978e651232b375f5f9cde3c7" }, { "ImportPath": "k8s.io/kubernetes/pkg/registry/podtemplate", - "Comment": "v1.1.0-alpha.1-653-g86b4e77", - "Rev": "86b4e777e1947c1bc00e422306a3ca74cbd54dbe" + "Comment": "v1.2.0-alpha.1-1107-g4c8e6f4", + "Rev": "4c8e6f47ec23f390978e651232b375f5f9cde3c7" }, { "ImportPath": "k8s.io/kubernetes/pkg/registry/registrytest", - "Comment": "v1.1.0-alpha.1-653-g86b4e77", - "Rev": "86b4e777e1947c1bc00e422306a3ca74cbd54dbe" + "Comment": "v1.2.0-alpha.1-1107-g4c8e6f4", + "Rev": "4c8e6f47ec23f390978e651232b375f5f9cde3c7" }, { "ImportPath": "k8s.io/kubernetes/pkg/registry/resourcequota", - "Comment": "v1.1.0-alpha.1-653-g86b4e77", - "Rev": "86b4e777e1947c1bc00e422306a3ca74cbd54dbe" + "Comment": "v1.2.0-alpha.1-1107-g4c8e6f4", + "Rev": "4c8e6f47ec23f390978e651232b375f5f9cde3c7" }, { "ImportPath": "k8s.io/kubernetes/pkg/registry/secret", - "Comment": "v1.1.0-alpha.1-653-g86b4e77", - "Rev": "86b4e777e1947c1bc00e422306a3ca74cbd54dbe" + "Comment": "v1.2.0-alpha.1-1107-g4c8e6f4", + "Rev": "4c8e6f47ec23f390978e651232b375f5f9cde3c7" }, { "ImportPath": "k8s.io/kubernetes/pkg/registry/service", - "Comment": "v1.1.0-alpha.1-653-g86b4e77", - "Rev": "86b4e777e1947c1bc00e422306a3ca74cbd54dbe" + "Comment": "v1.2.0-alpha.1-1107-g4c8e6f4", + "Rev": "4c8e6f47ec23f390978e651232b375f5f9cde3c7" }, { "ImportPath": "k8s.io/kubernetes/pkg/registry/serviceaccount", - "Comment": "v1.1.0-alpha.1-653-g86b4e77", - "Rev": "86b4e777e1947c1bc00e422306a3ca74cbd54dbe" + "Comment": "v1.2.0-alpha.1-1107-g4c8e6f4", + "Rev": "4c8e6f47ec23f390978e651232b375f5f9cde3c7" }, { "ImportPath": "k8s.io/kubernetes/pkg/registry/thirdpartyresource", - "Comment": "v1.1.0-alpha.1-653-g86b4e77", - "Rev": "86b4e777e1947c1bc00e422306a3ca74cbd54dbe" + "Comment": "v1.2.0-alpha.1-1107-g4c8e6f4", + "Rev": "4c8e6f47ec23f390978e651232b375f5f9cde3c7" }, { "ImportPath": "k8s.io/kubernetes/pkg/registry/thirdpartyresourcedata", - "Comment": "v1.1.0-alpha.1-653-g86b4e77", - "Rev": "86b4e777e1947c1bc00e422306a3ca74cbd54dbe" + "Comment": "v1.2.0-alpha.1-1107-g4c8e6f4", + "Rev": "4c8e6f47ec23f390978e651232b375f5f9cde3c7" }, { "ImportPath": "k8s.io/kubernetes/pkg/runtime", - "Comment": "v1.1.0-alpha.1-653-g86b4e77", - "Rev": "86b4e777e1947c1bc00e422306a3ca74cbd54dbe" + "Comment": "v1.2.0-alpha.1-1107-g4c8e6f4", + "Rev": "4c8e6f47ec23f390978e651232b375f5f9cde3c7" }, { "ImportPath": "k8s.io/kubernetes/pkg/securitycontext", - "Comment": "v1.1.0-alpha.1-653-g86b4e77", - "Rev": "86b4e777e1947c1bc00e422306a3ca74cbd54dbe" + "Comment": "v1.2.0-alpha.1-1107-g4c8e6f4", + "Rev": "4c8e6f47ec23f390978e651232b375f5f9cde3c7" + }, + { + "ImportPath": "k8s.io/kubernetes/pkg/securitycontextconstraints", + "Comment": "v1.2.0-alpha.1-1107-g4c8e6f4", + "Rev": "4c8e6f47ec23f390978e651232b375f5f9cde3c7" }, { "ImportPath": "k8s.io/kubernetes/pkg/securitycontextconstraints", @@ -1204,178 +1250,178 @@ }, { "ImportPath": "k8s.io/kubernetes/pkg/storage", - "Comment": "v1.1.0-alpha.1-653-g86b4e77", - "Rev": "86b4e777e1947c1bc00e422306a3ca74cbd54dbe" + "Comment": "v1.2.0-alpha.1-1107-g4c8e6f4", + "Rev": "4c8e6f47ec23f390978e651232b375f5f9cde3c7" }, { "ImportPath": "k8s.io/kubernetes/pkg/tools", - "Comment": "v1.1.0-alpha.1-653-g86b4e77", - "Rev": "86b4e777e1947c1bc00e422306a3ca74cbd54dbe" + "Comment": "v1.2.0-alpha.1-1107-g4c8e6f4", + "Rev": "4c8e6f47ec23f390978e651232b375f5f9cde3c7" }, { "ImportPath": "k8s.io/kubernetes/pkg/types", - "Comment": "v1.1.0-alpha.1-653-g86b4e77", - "Rev": "86b4e777e1947c1bc00e422306a3ca74cbd54dbe" + "Comment": "v1.2.0-alpha.1-1107-g4c8e6f4", + "Rev": "4c8e6f47ec23f390978e651232b375f5f9cde3c7" }, { "ImportPath": "k8s.io/kubernetes/pkg/ui", - "Comment": "v1.1.0-alpha.1-653-g86b4e77", - "Rev": "86b4e777e1947c1bc00e422306a3ca74cbd54dbe" + "Comment": "v1.2.0-alpha.1-1107-g4c8e6f4", + "Rev": "4c8e6f47ec23f390978e651232b375f5f9cde3c7" }, { "ImportPath": "k8s.io/kubernetes/pkg/util", - "Comment": "v1.1.0-alpha.1-653-g86b4e77", - "Rev": "86b4e777e1947c1bc00e422306a3ca74cbd54dbe" + "Comment": "v1.2.0-alpha.1-1107-g4c8e6f4", + "Rev": "4c8e6f47ec23f390978e651232b375f5f9cde3c7" }, { "ImportPath": "k8s.io/kubernetes/pkg/version", - "Comment": "v1.1.0-alpha.1-653-g86b4e77", - "Rev": "86b4e777e1947c1bc00e422306a3ca74cbd54dbe" + "Comment": "v1.2.0-alpha.1-1107-g4c8e6f4", + "Rev": "4c8e6f47ec23f390978e651232b375f5f9cde3c7" }, { "ImportPath": "k8s.io/kubernetes/pkg/volume", - "Comment": "v1.1.0-alpha.1-653-g86b4e77", - "Rev": "86b4e777e1947c1bc00e422306a3ca74cbd54dbe" + "Comment": "v1.2.0-alpha.1-1107-g4c8e6f4", + "Rev": "4c8e6f47ec23f390978e651232b375f5f9cde3c7" }, { "ImportPath": "k8s.io/kubernetes/pkg/watch", - "Comment": "v1.1.0-alpha.1-653-g86b4e77", - "Rev": "86b4e777e1947c1bc00e422306a3ca74cbd54dbe" + "Comment": "v1.2.0-alpha.1-1107-g4c8e6f4", + "Rev": "4c8e6f47ec23f390978e651232b375f5f9cde3c7" }, { "ImportPath": "k8s.io/kubernetes/plugin/cmd/kube-scheduler/app", - "Comment": "v1.1.0-alpha.1-653-g86b4e77", - "Rev": "86b4e777e1947c1bc00e422306a3ca74cbd54dbe" + "Comment": "v1.2.0-alpha.1-1107-g4c8e6f4", + "Rev": "4c8e6f47ec23f390978e651232b375f5f9cde3c7" }, { "ImportPath": "k8s.io/kubernetes/plugin/pkg/admission/admit", - "Comment": "v1.1.0-alpha.1-653-g86b4e77", - "Rev": "86b4e777e1947c1bc00e422306a3ca74cbd54dbe" + "Comment": "v1.2.0-alpha.1-1107-g4c8e6f4", + "Rev": "4c8e6f47ec23f390978e651232b375f5f9cde3c7" }, { "ImportPath": "k8s.io/kubernetes/plugin/pkg/admission/deny", - "Comment": "v1.1.0-alpha.1-653-g86b4e77", - "Rev": "86b4e777e1947c1bc00e422306a3ca74cbd54dbe" + "Comment": "v1.2.0-alpha.1-1107-g4c8e6f4", + "Rev": "4c8e6f47ec23f390978e651232b375f5f9cde3c7" }, { - "ImportPath": "k8s.io/kubernetes/plugin/pkg/admission/exec/denyprivileged", - "Comment": "v1.1.0-alpha.1-653-g86b4e77", - "Rev": "86b4e777e1947c1bc00e422306a3ca74cbd54dbe" + "ImportPath": "k8s.io/kubernetes/plugin/pkg/admission/exec", + "Comment": "v1.2.0-alpha.1-1107-g4c8e6f4", + "Rev": "4c8e6f47ec23f390978e651232b375f5f9cde3c7" }, { "ImportPath": "k8s.io/kubernetes/plugin/pkg/admission/initialresources", - "Comment": "v1.1.0-alpha.1-653-g86b4e77", - "Rev": "86b4e777e1947c1bc00e422306a3ca74cbd54dbe" + "Comment": "v1.2.0-alpha.1-1107-g4c8e6f4", + "Rev": "4c8e6f47ec23f390978e651232b375f5f9cde3c7" }, { "ImportPath": "k8s.io/kubernetes/plugin/pkg/admission/limitranger", - "Comment": "v1.1.0-alpha.1-653-g86b4e77", - "Rev": "86b4e777e1947c1bc00e422306a3ca74cbd54dbe" + "Comment": "v1.2.0-alpha.1-1107-g4c8e6f4", + "Rev": "4c8e6f47ec23f390978e651232b375f5f9cde3c7" }, { "ImportPath": "k8s.io/kubernetes/plugin/pkg/admission/namespace/autoprovision", - "Comment": "v1.1.0-alpha.1-653-g86b4e77", - "Rev": "86b4e777e1947c1bc00e422306a3ca74cbd54dbe" + "Comment": "v1.2.0-alpha.1-1107-g4c8e6f4", + "Rev": "4c8e6f47ec23f390978e651232b375f5f9cde3c7" }, { "ImportPath": "k8s.io/kubernetes/plugin/pkg/admission/namespace/exists", - "Comment": "v1.1.0-alpha.1-653-g86b4e77", - "Rev": "86b4e777e1947c1bc00e422306a3ca74cbd54dbe" + "Comment": "v1.2.0-alpha.1-1107-g4c8e6f4", + "Rev": "4c8e6f47ec23f390978e651232b375f5f9cde3c7" }, { "ImportPath": "k8s.io/kubernetes/plugin/pkg/admission/namespace/lifecycle", - "Comment": "v1.1.0-alpha.1-653-g86b4e77", - "Rev": "86b4e777e1947c1bc00e422306a3ca74cbd54dbe" + "Comment": "v1.2.0-alpha.1-1107-g4c8e6f4", + "Rev": "4c8e6f47ec23f390978e651232b375f5f9cde3c7" }, { "ImportPath": "k8s.io/kubernetes/plugin/pkg/admission/resourcequota", - "Comment": "v1.1.0-alpha.1-653-g86b4e77", - "Rev": "86b4e777e1947c1bc00e422306a3ca74cbd54dbe" + "Comment": "v1.2.0-alpha.1-1107-g4c8e6f4", + "Rev": "4c8e6f47ec23f390978e651232b375f5f9cde3c7" }, { "ImportPath": "k8s.io/kubernetes/plugin/pkg/admission/securitycontext/scdeny", - "Comment": "v1.1.0-alpha.1-653-g86b4e77", - "Rev": "86b4e777e1947c1bc00e422306a3ca74cbd54dbe" + "Comment": "v1.2.0-alpha.1-1107-g4c8e6f4", + "Rev": "4c8e6f47ec23f390978e651232b375f5f9cde3c7" }, { "ImportPath": "k8s.io/kubernetes/plugin/pkg/admission/serviceaccount", - "Comment": "v1.1.0-alpha.1-653-g86b4e77", - "Rev": "86b4e777e1947c1bc00e422306a3ca74cbd54dbe" + "Comment": "v1.2.0-alpha.1-1107-g4c8e6f4", + "Rev": "4c8e6f47ec23f390978e651232b375f5f9cde3c7" }, { "ImportPath": "k8s.io/kubernetes/plugin/pkg/auth/authenticator/password/passwordfile", - "Comment": "v1.1.0-alpha.1-653-g86b4e77", - "Rev": "86b4e777e1947c1bc00e422306a3ca74cbd54dbe" + "Comment": "v1.2.0-alpha.1-1107-g4c8e6f4", + "Rev": "4c8e6f47ec23f390978e651232b375f5f9cde3c7" }, { "ImportPath": "k8s.io/kubernetes/plugin/pkg/auth/authenticator/request/basicauth", - "Comment": "v1.1.0-alpha.1-653-g86b4e77", - "Rev": "86b4e777e1947c1bc00e422306a3ca74cbd54dbe" + "Comment": "v1.2.0-alpha.1-1107-g4c8e6f4", + "Rev": "4c8e6f47ec23f390978e651232b375f5f9cde3c7" }, { "ImportPath": "k8s.io/kubernetes/plugin/pkg/auth/authenticator/request/keystone", - "Comment": "v1.1.0-alpha.1-653-g86b4e77", - "Rev": "86b4e777e1947c1bc00e422306a3ca74cbd54dbe" + "Comment": "v1.2.0-alpha.1-1107-g4c8e6f4", + "Rev": "4c8e6f47ec23f390978e651232b375f5f9cde3c7" }, { "ImportPath": "k8s.io/kubernetes/plugin/pkg/auth/authenticator/request/union", - "Comment": "v1.1.0-alpha.1-653-g86b4e77", - "Rev": "86b4e777e1947c1bc00e422306a3ca74cbd54dbe" + "Comment": "v1.2.0-alpha.1-1107-g4c8e6f4", + "Rev": "4c8e6f47ec23f390978e651232b375f5f9cde3c7" }, { "ImportPath": "k8s.io/kubernetes/plugin/pkg/auth/authenticator/request/x509", - "Comment": "v1.1.0-alpha.1-653-g86b4e77", - "Rev": "86b4e777e1947c1bc00e422306a3ca74cbd54dbe" + "Comment": "v1.2.0-alpha.1-1107-g4c8e6f4", + "Rev": "4c8e6f47ec23f390978e651232b375f5f9cde3c7" }, { "ImportPath": "k8s.io/kubernetes/plugin/pkg/auth/authenticator/token/oidc", - "Comment": "v1.1.0-alpha.1-653-g86b4e77", - "Rev": "86b4e777e1947c1bc00e422306a3ca74cbd54dbe" + "Comment": "v1.2.0-alpha.1-1107-g4c8e6f4", + "Rev": "4c8e6f47ec23f390978e651232b375f5f9cde3c7" }, { "ImportPath": "k8s.io/kubernetes/plugin/pkg/auth/authenticator/token/tokenfile", - "Comment": "v1.1.0-alpha.1-653-g86b4e77", - "Rev": "86b4e777e1947c1bc00e422306a3ca74cbd54dbe" + "Comment": "v1.2.0-alpha.1-1107-g4c8e6f4", + "Rev": "4c8e6f47ec23f390978e651232b375f5f9cde3c7" }, { "ImportPath": "k8s.io/kubernetes/plugin/pkg/scheduler", - "Comment": "v1.1.0-alpha.1-653-g86b4e77", - "Rev": "86b4e777e1947c1bc00e422306a3ca74cbd54dbe" + "Comment": "v1.2.0-alpha.1-1107-g4c8e6f4", + "Rev": "4c8e6f47ec23f390978e651232b375f5f9cde3c7" }, { "ImportPath": "k8s.io/kubernetes/test/e2e", - "Comment": "v1.1.0-alpha.1-653-g86b4e77", - "Rev": "86b4e777e1947c1bc00e422306a3ca74cbd54dbe" + "Comment": "v1.2.0-alpha.1-1107-g4c8e6f4", + "Rev": "4c8e6f47ec23f390978e651232b375f5f9cde3c7" }, { "ImportPath": "k8s.io/kubernetes/third_party/forked/coreos/go-etcd/etcd", - "Comment": "v1.1.0-alpha.1-653-g86b4e77", - "Rev": "86b4e777e1947c1bc00e422306a3ca74cbd54dbe" + "Comment": "v1.2.0-alpha.1-1107-g4c8e6f4", + "Rev": "4c8e6f47ec23f390978e651232b375f5f9cde3c7" }, { "ImportPath": "k8s.io/kubernetes/third_party/forked/json", - "Comment": "v1.1.0-alpha.1-653-g86b4e77", - "Rev": "86b4e777e1947c1bc00e422306a3ca74cbd54dbe" + "Comment": "v1.2.0-alpha.1-1107-g4c8e6f4", + "Rev": "4c8e6f47ec23f390978e651232b375f5f9cde3c7" }, { "ImportPath": "k8s.io/kubernetes/third_party/forked/reflect", - "Comment": "v1.1.0-alpha.1-653-g86b4e77", - "Rev": "86b4e777e1947c1bc00e422306a3ca74cbd54dbe" + "Comment": "v1.2.0-alpha.1-1107-g4c8e6f4", + "Rev": "4c8e6f47ec23f390978e651232b375f5f9cde3c7" }, { "ImportPath": "k8s.io/kubernetes/third_party/golang/expansion", - "Comment": "v1.1.0-alpha.1-653-g86b4e77", - "Rev": "86b4e777e1947c1bc00e422306a3ca74cbd54dbe" + "Comment": "v1.2.0-alpha.1-1107-g4c8e6f4", + "Rev": "4c8e6f47ec23f390978e651232b375f5f9cde3c7" }, { "ImportPath": "k8s.io/kubernetes/third_party/golang/netutil", - "Comment": "v1.1.0-alpha.1-653-g86b4e77", - "Rev": "86b4e777e1947c1bc00e422306a3ca74cbd54dbe" + "Comment": "v1.2.0-alpha.1-1107-g4c8e6f4", + "Rev": "4c8e6f47ec23f390978e651232b375f5f9cde3c7" }, { "ImportPath": "k8s.io/kubernetes/third_party/golang/template", - "Comment": "v1.1.0-alpha.1-653-g86b4e77", - "Rev": "86b4e777e1947c1bc00e422306a3ca74cbd54dbe" + "Comment": "v1.2.0-alpha.1-1107-g4c8e6f4", + "Rev": "4c8e6f47ec23f390978e651232b375f5f9cde3c7" }, { "ImportPath": "speter.net/go/exp/math/dec/inf", diff --git a/Godeps/_workspace/src/github.com/ClusterHQ/flocker-go/README.md b/Godeps/_workspace/src/github.com/ClusterHQ/flocker-go/README.md new file mode 100644 index 000000000000..7c57e11295ec --- /dev/null +++ b/Godeps/_workspace/src/github.com/ClusterHQ/flocker-go/README.md @@ -0,0 +1,18 @@ +flocker-go +========== + +[![circleci](https://circleci.com/gh/ClusterHQ/flocker-go.svg)](https://circleci.com/gh/ClusterHQ/flocker-go) + +flocker-go implements the package `flocker` that will let you easily interact +with a Flocker Control Service. + +What can it do? +--------------- + +You can check the package documentation here: https://godoc.org/github.com/ClusterHQ/flocker-go + +TODO +---- + +- Define a proper interface `flockerClientable` with all the needed methods for + wrapping the Flocker API. diff --git a/Godeps/_workspace/src/github.com/ClusterHQ/flocker-go/client.go b/Godeps/_workspace/src/github.com/ClusterHQ/flocker-go/client.go new file mode 100644 index 000000000000..e054ee121eec --- /dev/null +++ b/Godeps/_workspace/src/github.com/ClusterHQ/flocker-go/client.go @@ -0,0 +1,323 @@ +package flocker + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "io" + "net/http" + "time" +) + +// From https://github.com/ClusterHQ/flocker-docker-plugin/blob/master/flockerdockerplugin/adapter.py#L18 +const defaultVolumeSize = json.Number("107374182400") + +var ( + // A volume can take a long time to be available, if we don't want + // Kubernetes to wait forever we need to stop trying after some time, that + // time is defined here + timeoutWaitingForVolume = 2 * time.Minute + tickerWaitingForVolume = 5 * time.Second + + errStateNotFound = errors.New("State not found by Dataset ID") + errConfigurationNotFound = errors.New("Configuration not found by Name") + + errFlockerControlServiceHost = errors.New("The volume config must have a key CONTROL_SERVICE_HOST defined in the OtherAttributes field") + errFlockerControlServicePort = errors.New("The volume config must have a key CONTROL_SERVICE_PORT defined in the OtherAttributes field") + + errVolumeAlreadyExists = errors.New("The volume already exists") + errVolumeDoesNotExist = errors.New("The volume does not exist") + + errUpdatingDataset = errors.New("It was impossible to update the dataset") +) + +// Clientable exposes the needed methods to implement your own Flocker Client. +type Clientable interface { + CreateDataset(metaName string) (*DatasetState, error) + + GetDatasetState(datasetID string) (*DatasetState, error) + GetDatasetID(metaName string) (datasetID string, err error) + GetPrimaryUUID() (primaryUUID string, err error) + + UpdatePrimaryForDataset(primaryUUID, datasetID string) (*DatasetState, error) +} + +// Client is a default Flocker Client. +type Client struct { + *http.Client + + schema string + host string + port int + version string + + clientIP string + + maximumSize json.Number +} + +// NewClient creates a wrapper over http.Client to communicate with the flocker control service. +func NewClient(host string, port int, clientIP string, caCertPath, keyPath, certPath string) (*Client, error) { + client, err := newTLSClient(caCertPath, keyPath, certPath) + if err != nil { + return nil, err + } + + return &Client{ + Client: client, + schema: "https", + host: host, + port: port, + version: "v1", + maximumSize: defaultVolumeSize, + clientIP: clientIP, + }, nil +} + +/* +request do a request using the http.Client embedded to the control service +and returns the response or an error in case it happens. + +Note: you will need to deal with the response body call to Close if you +don't want to deal with problems later. +*/ +func (c Client) request(method, url string, payload interface{}) (*http.Response, error) { + var ( + b []byte + err error + ) + + if method == "POST" { // Just allow payload on POST + b, err = json.Marshal(payload) + if err != nil { + return nil, err + } + } + + req, err := http.NewRequest(method, url, bytes.NewBuffer(b)) + if err != nil { + return nil, err + } + req.Header.Set("Content-Type", "application/json") + + // REMEMBER TO CLOSE THE BODY IN THE OUTSIDE FUNCTION + return c.Do(req) +} + +// post performs a post request with the indicated payload +func (c Client) post(url string, payload interface{}) (*http.Response, error) { + return c.request("POST", url, payload) +} + +// get performs a get request +func (c Client) get(url string) (*http.Response, error) { + return c.request("GET", url, nil) +} + +// getURL returns a full URI to the control service +func (c Client) getURL(path string) string { + return fmt.Sprintf("%s://%s:%d/%s/%s", c.schema, c.host, c.port, c.version, path) +} + +type configurationPayload struct { + Primary string `json:"primary"` + DatasetID string `json:"dataset_id,omitempty"` + MaximumSize json.Number `json:"maximum_size,omitempty"` + Metadata metadataPayload `json:"metadata,omitempty"` +} + +type metadataPayload struct { + Name string `json:"name,omitempty"` +} + +type DatasetState struct { + Path string `json:"path"` + DatasetID string `json:"dataset_id"` + Primary string `json:"primary,omitempty"` + MaximumSize json.Number `json:"maximum_size,omitempty"` +} + +type datasetStatePayload struct { + *DatasetState +} + +type nodeStatePayload struct { + UUID string `json:"uuid"` + Host string `json:"host"` +} + +// findIDInConfigurationsPayload returns the datasetID if it was found in the +// configurations payload, otherwise it will return an error. +func (c Client) findIDInConfigurationsPayload(body io.ReadCloser, name string) (datasetID string, err error) { + var configurations []configurationPayload + if err = json.NewDecoder(body).Decode(&configurations); err == nil { + for _, r := range configurations { + if r.Metadata.Name == name { + return r.DatasetID, nil + } + } + return "", errConfigurationNotFound + } + return "", err +} + +// GetPrimaryUUID returns the UUID of the primary Flocker Control Service for +// the given host. +func (c Client) GetPrimaryUUID() (uuid string, err error) { + resp, err := c.get(c.getURL("state/nodes")) + if err != nil { + return "", err + } + defer resp.Body.Close() + + var states []nodeStatePayload + if err = json.NewDecoder(resp.Body).Decode(&states); err == nil { + for _, s := range states { + if s.Host == c.clientIP { + return s.UUID, nil + } + } + return "", errStateNotFound + } + return "", err +} + +// GetDatasetState performs a get request to get the state of the given datasetID, if +// something goes wrong or the datasetID was not found it returns an error. +func (c Client) GetDatasetState(datasetID string) (*DatasetState, error) { + resp, err := c.get(c.getURL("state/datasets")) + if err != nil { + return nil, err + } + defer resp.Body.Close() + + var states []datasetStatePayload + if err = json.NewDecoder(resp.Body).Decode(&states); err == nil { + for _, s := range states { + if s.DatasetID == datasetID { + return s.DatasetState, nil + } + } + return nil, errStateNotFound + } + + return nil, err +} + +/* +CreateDataset creates a volume in Flocker, waits for it to be ready and +returns the dataset id. + +This process is a little bit complex but follows this flow: + +1. Find the Flocker Control Service UUID +2. Try to create the dataset +3. If it already exists an error is returned +4. If it didn't previously exist, wait for it to be ready +*/ +func (c Client) CreateDataset(metaName string) (*DatasetState, error) { + // 1) Find the primary Flocker UUID + // Note: it could be cached, but doing this query we health check it + primary, err := c.GetPrimaryUUID() + if err != nil { + return nil, err + } + + // 2) Try to create the dataset in the given Primary + payload := configurationPayload{ + Primary: primary, + MaximumSize: json.Number(c.maximumSize), + Metadata: metadataPayload{ + Name: metaName, + }, + } + + resp, err := c.post(c.getURL("configuration/datasets"), payload) + if err != nil { + return nil, err + } + defer resp.Body.Close() + + // 3) Return if the dataset was previously created + if resp.StatusCode == http.StatusConflict { + return nil, errVolumeAlreadyExists + } + + if resp.StatusCode >= 300 { + return nil, fmt.Errorf("Expected: {1,2}xx creating the volume, got: %d", resp.StatusCode) + } + + var p configurationPayload + if err := json.NewDecoder(resp.Body).Decode(&p); err != nil { + return nil, err + } + + // 4) Wait until the dataset is ready for usage. In case it never gets + // ready there is a timeoutChan that will return an error + timeoutChan := time.NewTimer(timeoutWaitingForVolume).C + tickChan := time.NewTicker(tickerWaitingForVolume).C + + for { + if s, err := c.GetDatasetState(p.DatasetID); err == nil { + return s, nil + } else if err != errStateNotFound { + return nil, err + } + + select { + case <-timeoutChan: + return nil, err + case <-tickChan: + break + } + } +} + +// UpdatePrimaryForDataset will update the Primary for the given dataset +// returning the current DatasetState. +func (c Client) UpdatePrimaryForDataset(newPrimaryUUID, datasetID string) (*DatasetState, error) { + payload := struct { + Primary string `json:"primary"` + }{ + Primary: newPrimaryUUID, + } + + url := c.getURL(fmt.Sprintf("configuration/datasets/%s", datasetID)) + resp, err := c.post(url, payload) + if err != nil { + return nil, err + } + defer resp.Body.Close() + + if resp.StatusCode >= 300 { + return nil, errUpdatingDataset + } + + var s DatasetState + if err := json.NewDecoder(resp.Body).Decode(&s); err != nil { + return nil, err + } + + return &s, nil +} + +// GetDatasetID will return the DatasetID found for the given metadata name. +func (c Client) GetDatasetID(metaName string) (datasetID string, err error) { + resp, err := c.get(c.getURL("configuration/datasets")) + if err != nil { + return "", err + } + defer resp.Body.Close() + + var configurations []configurationPayload + if err = json.NewDecoder(resp.Body).Decode(&configurations); err == nil { + for _, c := range configurations { + if c.Metadata.Name == metaName { + return c.DatasetID, nil + } + } + return "", errConfigurationNotFound + } + return "", err +} diff --git a/Godeps/_workspace/src/github.com/ClusterHQ/flocker-go/client_test.go b/Godeps/_workspace/src/github.com/ClusterHQ/flocker-go/client_test.go new file mode 100644 index 000000000000..ef0feaf7e97e --- /dev/null +++ b/Godeps/_workspace/src/github.com/ClusterHQ/flocker-go/client_test.go @@ -0,0 +1,316 @@ +package flocker + +import ( + "bytes" + "encoding/json" + "fmt" + "io/ioutil" + "net/http" + "net/http/httptest" + "net/url" + "strconv" + "strings" + "testing" + "time" + + "k8s.io/kubernetes/pkg/volume" + + "github.com/stretchr/testify/assert" +) + +func TestMaximumSizeIs1024Multiple(t *testing.T) { + assert := assert.New(t) + + n, err := strconv.Atoi(string(defaultVolumeSize)) + assert.NoError(err) + assert.Equal(0, n%1024) +} + +func TestPost(t *testing.T) { + const ( + expectedPayload = "foobar" + expectedStatusCode = 418 + ) + + assert := assert.New(t) + + type payload struct { + Test string `json:"test"` + } + + ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + var result payload + err := json.NewDecoder(r.Body).Decode(&result) + assert.NoError(err) + assert.Equal(expectedPayload, result.Test) + w.WriteHeader(expectedStatusCode) + })) + defer ts.Close() + + c := Client{Client: &http.Client{}} + + resp, err := c.post(ts.URL, payload{expectedPayload}) + assert.NoError(err) + assert.Equal(expectedStatusCode, resp.StatusCode) +} + +func TestGet(t *testing.T) { + const ( + expectedStatusCode = 418 + ) + + assert := assert.New(t) + + ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(expectedStatusCode) + })) + defer ts.Close() + + c := Client{Client: &http.Client{}} + + resp, err := c.get(ts.URL) + assert.NoError(err) + assert.Equal(expectedStatusCode, resp.StatusCode) +} + +func TestFindIDInConfigurationsPayload(t *testing.T) { + const ( + searchedName = "search-for-this-name" + expected = "The-42-id" + ) + assert := assert.New(t) + + c := Client{} + + payload := fmt.Sprintf( + `[{"dataset_id": "1-2-3", "metadata": {"name": "test"}}, {"dataset_id": "The-42-id", "metadata": {"name": "%s"}}]`, + searchedName, + ) + + id, err := c.findIDInConfigurationsPayload( + ioutil.NopCloser(bytes.NewBufferString(payload)), searchedName, + ) + assert.NoError(err) + assert.Equal(expected, id) + + id, err = c.findIDInConfigurationsPayload( + ioutil.NopCloser(bytes.NewBufferString(payload)), "it will not be found", + ) + assert.Equal(errConfigurationNotFound, err) + + id, err = c.findIDInConfigurationsPayload( + ioutil.NopCloser(bytes.NewBufferString("invalid { json")), "", + ) + assert.Error(err) +} + +func TestFindPrimaryUUID(t *testing.T) { + const expectedPrimary = "primary-uuid" + assert := assert.New(t) + + var ( + mockedHost = "127.0.0.1" + mockedPrimary = expectedPrimary + ) + + ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + assert.Equal("GET", r.Method) + assert.Equal("/v1/state/nodes", r.URL.Path) + w.Write([]byte(fmt.Sprintf(`[{"host": "%s", "uuid": "%s"}]`, mockedHost, mockedPrimary))) + })) + + host, port, err := getHostAndPortFromTestServer(ts) + assert.NoError(err) + + c := newFlockerTestClient(host, port) + assert.NoError(err) + + mockedPrimary = expectedPrimary + primary, err := c.GetPrimaryUUID() + assert.NoError(err) + assert.Equal(expectedPrimary, primary) + + c.clientIP = "not.found" + _, err = c.GetPrimaryUUID() + assert.Equal(errStateNotFound, err) +} + +func TestGetURL(t *testing.T) { + const ( + expectedHost = "host" + expectedPort = 42 + ) + + assert := assert.New(t) + + c := newFlockerTestClient(expectedHost, expectedPort) + var expectedURL = fmt.Sprintf("%s://%s:%d/v1/test", c.schema, expectedHost, expectedPort) + + url := c.getURL("test") + assert.Equal(expectedURL, url) +} + +func getHostAndPortFromTestServer(ts *httptest.Server) (string, int, error) { + tsURL, err := url.Parse(ts.URL) + if err != nil { + return "", 0, err + } + + hostSplits := strings.Split(tsURL.Host, ":") + + port, err := strconv.Atoi(hostSplits[1]) + if err != nil { + return "", 0, nil + } + return hostSplits[0], port, nil +} + +func getVolumeConfig(host string, port int) volume.VolumeConfig { + return volume.VolumeConfig{ + OtherAttributes: map[string]string{ + "CONTROL_SERVICE_HOST": host, + "CONTROL_SERVICE_PORT": strconv.Itoa(port), + }, + } +} + +func TestHappyPathCreateDatasetFromNonExistent(t *testing.T) { + const ( + expectedDatasetName = "dir" + expectedPrimary = "A-B-C-D" + expectedDatasetID = "datasetID" + ) + expectedPath := fmt.Sprintf("/flocker/%s", expectedDatasetID) + + assert := assert.New(t) + var ( + numCalls int + err error + ) + + ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + numCalls++ + switch numCalls { + case 1: + assert.Equal("GET", r.Method) + assert.Equal("/v1/state/nodes", r.URL.Path) + w.Write([]byte(fmt.Sprintf(`[{"host": "127.0.0.1", "uuid": "%s"}]`, expectedPrimary))) + case 2: + assert.Equal("POST", r.Method) + assert.Equal("/v1/configuration/datasets", r.URL.Path) + + var c configurationPayload + err := json.NewDecoder(r.Body).Decode(&c) + assert.NoError(err) + assert.Equal(expectedPrimary, c.Primary) + assert.Equal(defaultVolumeSize, c.MaximumSize) + assert.Equal(expectedDatasetName, c.Metadata.Name) + + w.Write([]byte(fmt.Sprintf(`{"dataset_id": "%s"}`, expectedDatasetID))) + case 3: + assert.Equal("GET", r.Method) + assert.Equal("/v1/state/datasets", r.URL.Path) + w.Write([]byte(`[]`)) + case 4: + assert.Equal("GET", r.Method) + assert.Equal("/v1/state/datasets", r.URL.Path) + w.Write([]byte(fmt.Sprintf(`[{"dataset_id": "%s", "path": "/flocker/%s"}]`, expectedDatasetID, expectedDatasetID))) + } + })) + + host, port, err := getHostAndPortFromTestServer(ts) + assert.NoError(err) + + c := newFlockerTestClient(host, port) + assert.NoError(err) + + tickerWaitingForVolume = 1 * time.Millisecond // TODO: this is overriding globally + + s, err := c.CreateDataset(expectedDatasetName) + assert.NoError(err) + assert.Equal(expectedPath, s.Path) +} + +func TestCreateDatasetThatAlreadyExists(t *testing.T) { + const ( + datasetName = "dir" + expectedPrimary = "A-B-C-D" + ) + + assert := assert.New(t) + var numCalls int + + ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + numCalls++ + switch numCalls { + case 1: + assert.Equal("GET", r.Method) + assert.Equal("/v1/state/nodes", r.URL.Path) + w.Write([]byte(fmt.Sprintf(`[{"host": "127.0.0.1", "uuid": "%s"}]`, expectedPrimary))) + case 2: + assert.Equal("POST", r.Method) + assert.Equal("/v1/configuration/datasets", r.URL.Path) + w.WriteHeader(http.StatusConflict) + } + })) + + host, port, err := getHostAndPortFromTestServer(ts) + assert.NoError(err) + + c := newFlockerTestClient(host, port) + assert.NoError(err) + + _, err = c.CreateDataset(datasetName) + assert.Equal(errVolumeAlreadyExists, err) +} + +func TestUpdatePrimaryForDataset(t *testing.T) { + const ( + dir = "dir" + expectedPrimary = "the-new-primary" + expectedDatasetID = "datasetID" + ) + expectedURL := fmt.Sprintf("/v1/configuration/datasets/%s", expectedDatasetID) + + assert := assert.New(t) + + ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + assert.Equal("POST", r.Method) + assert.Equal(expectedURL, r.URL.Path) + + var c configurationPayload + err := json.NewDecoder(r.Body).Decode(&c) + assert.NoError(err) + + assert.Equal(expectedPrimary, c.Primary) + + w.Write([]byte(fmt.Sprintf(`{"dataset_id": "%s", "path": "just-to-double-check"}`, expectedDatasetID))) + })) + + host, port, err := getHostAndPortFromTestServer(ts) + assert.NoError(err) + + c := newFlockerTestClient(host, port) + assert.NoError(err) + + s, err := c.UpdatePrimaryForDataset(expectedPrimary, expectedDatasetID) + assert.NoError(err) + assert.Equal(expectedDatasetID, s.DatasetID) + assert.NotEqual("", s.Path) +} + +func TestInterfaceIsImplemented(t *testing.T) { + assert.Implements(t, (*Clientable)(nil), Client{}) +} + +func newFlockerTestClient(host string, port int) *Client { + return &Client{ + Client: &http.Client{}, + host: host, + port: port, + version: "v1", + schema: "http", + maximumSize: defaultVolumeSize, + clientIP: "127.0.0.1", + } +} diff --git a/Godeps/_workspace/src/github.com/ClusterHQ/flocker-go/doc.go b/Godeps/_workspace/src/github.com/ClusterHQ/flocker-go/doc.go new file mode 100644 index 000000000000..f3cd05b01962 --- /dev/null +++ b/Godeps/_workspace/src/github.com/ClusterHQ/flocker-go/doc.go @@ -0,0 +1,2 @@ +// flocker package allows you to easily interact with a Flocker Control Service. +package flocker diff --git a/Godeps/_workspace/src/github.com/ClusterHQ/flocker-go/util.go b/Godeps/_workspace/src/github.com/ClusterHQ/flocker-go/util.go new file mode 100644 index 000000000000..8322ea8cd788 --- /dev/null +++ b/Godeps/_workspace/src/github.com/ClusterHQ/flocker-go/util.go @@ -0,0 +1,34 @@ +package flocker + +import ( + "crypto/tls" + "crypto/x509" + "io/ioutil" + "net/http" +) + +// newTLSClient returns a new TLS http client +func newTLSClient(caCertPath, keyPath, certPath string) (*http.Client, error) { + // Client certificate + cert, err := tls.LoadX509KeyPair(certPath, keyPath) + if err != nil { + return nil, err + } + + // CA certificate + caCert, err := ioutil.ReadFile(caCertPath) + if err != nil { + return nil, err + } + caCertPool := x509.NewCertPool() + caCertPool.AppendCertsFromPEM(caCert) + + tlsConfig := &tls.Config{ + Certificates: []tls.Certificate{cert}, + RootCAs: caCertPool, + } + tlsConfig.BuildNameToCertificate() + transport := &http.Transport{TLSClientConfig: tlsConfig} + + return &http.Client{Transport: transport}, nil +} diff --git a/Godeps/_workspace/src/github.com/GoogleCloudPlatform/gcloud-golang/compute/metadata/metadata.go b/Godeps/_workspace/src/github.com/GoogleCloudPlatform/gcloud-golang/compute/metadata/metadata.go deleted file mode 100644 index b007cde63665..000000000000 --- a/Godeps/_workspace/src/github.com/GoogleCloudPlatform/gcloud-golang/compute/metadata/metadata.go +++ /dev/null @@ -1,279 +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 metadata provides access to Google Compute Engine (GCE) -// metadata and API service accounts. -// -// This package is a wrapper around the GCE metadata service, -// as documented at https://developers.google.com/compute/docs/metadata. -package metadata - -import ( - "encoding/json" - "fmt" - "io/ioutil" - "net" - "net/http" - "os" - "strings" - "sync" - "time" - - "google.golang.org/cloud/internal" -) - -type cachedValue struct { - k string - trim bool - mu sync.Mutex - v string -} - -var ( - projID = &cachedValue{k: "project/project-id", trim: true} - projNum = &cachedValue{k: "project/numeric-project-id", trim: true} - instID = &cachedValue{k: "instance/id", trim: true} -) - -var metaClient = &http.Client{ - Transport: &internal.Transport{ - Base: &http.Transport{ - Dial: (&net.Dialer{ - Timeout: 750 * time.Millisecond, - KeepAlive: 30 * time.Second, - }).Dial, - ResponseHeaderTimeout: 750 * time.Millisecond, - }, - }, -} - -// NotDefinedError is returned when requested metadata is not defined. -// -// The underlying string is the suffix after "/computeMetadata/v1/". -// -// This error is not returned if the value is defined to be the empty -// string. -type NotDefinedError string - -func (suffix NotDefinedError) Error() string { - return fmt.Sprintf("metadata: GCE metadata %q not defined", string(suffix)) -} - -// Get returns a value from the metadata service. -// The suffix is appended to "http://${GCE_METADATA_HOST}/computeMetadata/v1/". -// -// If the GCE_METADATA_HOST environment variable is not defined, a default of -// 169.254.169.254 will be used instead. -// -// If the requested metadata is not defined, the returned error will -// be of type NotDefinedError. -func Get(suffix string) (string, error) { - // Using a fixed IP makes it very difficult to spoof the metadata service in - // a container, which is an important use-case for local testing of cloud - // deployments. To enable spoofing of the metadata service, the environment - // variable GCE_METADATA_HOST is first inspected to decide where metadata - // requests shall go. - host := os.Getenv("GCE_METADATA_HOST") - if host == "" { - // Using 169.254.169.254 instead of "metadata" here because Go - // binaries built with the "netgo" tag and without cgo won't - // know the search suffix for "metadata" is - // ".google.internal", and this IP address is documented as - // being stable anyway. - host = "169.254.169.254" - } - url := "http://" + host + "/computeMetadata/v1/" + suffix - req, _ := http.NewRequest("GET", url, nil) - req.Header.Set("Metadata-Flavor", "Google") - res, err := metaClient.Do(req) - if err != nil { - return "", err - } - defer res.Body.Close() - if res.StatusCode == http.StatusNotFound { - return "", NotDefinedError(suffix) - } - if res.StatusCode != 200 { - return "", fmt.Errorf("status code %d trying to fetch %s", res.StatusCode, url) - } - all, err := ioutil.ReadAll(res.Body) - if err != nil { - return "", err - } - return string(all), nil -} - -func getTrimmed(suffix string) (s string, err error) { - s, err = Get(suffix) - s = strings.TrimSpace(s) - return -} - -func (c *cachedValue) get() (v string, err error) { - defer c.mu.Unlock() - c.mu.Lock() - if c.v != "" { - return c.v, nil - } - if c.trim { - v, err = getTrimmed(c.k) - } else { - v, err = Get(c.k) - } - if err == nil { - c.v = v - } - return -} - -var onGCE struct { - sync.Mutex - set bool - v bool -} - -// OnGCE reports whether this process is running on Google Compute Engine. -func OnGCE() bool { - defer onGCE.Unlock() - onGCE.Lock() - if onGCE.set { - return onGCE.v - } - onGCE.set = true - - // We use the DNS name of the metadata service here instead of the IP address - // because we expect that to fail faster in the not-on-GCE case. - res, err := metaClient.Get("http://metadata.google.internal") - if err != nil { - return false - } - onGCE.v = res.Header.Get("Metadata-Flavor") == "Google" - return onGCE.v -} - -// ProjectID returns the current instance's project ID string. -func ProjectID() (string, error) { return projID.get() } - -// NumericProjectID returns the current instance's numeric project ID. -func NumericProjectID() (string, error) { return projNum.get() } - -// InternalIP returns the instance's primary internal IP address. -func InternalIP() (string, error) { - return getTrimmed("instance/network-interfaces/0/ip") -} - -// ExternalIP returns the instance's primary external (public) IP address. -func ExternalIP() (string, error) { - return getTrimmed("instance/network-interfaces/0/access-configs/0/external-ip") -} - -// Hostname returns the instance's hostname. This will be of the form -// ".c..internal". -func Hostname() (string, error) { - return getTrimmed("instance/hostname") -} - -// InstanceTags returns the list of user-defined instance tags, -// assigned when initially creating a GCE instance. -func InstanceTags() ([]string, error) { - var s []string - j, err := Get("instance/tags") - if err != nil { - return nil, err - } - if err := json.NewDecoder(strings.NewReader(j)).Decode(&s); err != nil { - return nil, err - } - return s, nil -} - -// InstanceID returns the current VM's numeric instance ID. -func InstanceID() (string, error) { - return instID.get() -} - -// InstanceName returns the current VM's instance ID string. -func InstanceName() (string, error) { - host, err := Hostname() - if err != nil { - return "", err - } - return strings.Split(host, ".")[0], nil -} - -// Zone returns the current VM's zone, such as "us-central1-b". -func Zone() (string, error) { - zone, err := getTrimmed("instance/zone") - // zone is of the form "projects//zones/". - if err != nil { - return "", err - } - return zone[strings.LastIndex(zone, "/")+1:], nil -} - -// InstanceAttributes returns the list of user-defined attributes, -// assigned when initially creating a GCE VM instance. The value of an -// attribute can be obtained with InstanceAttributeValue. -func InstanceAttributes() ([]string, error) { return lines("instance/attributes/") } - -// ProjectAttributes returns the list of user-defined attributes -// applying to the project as a whole, not just this VM. The value of -// an attribute can be obtained with ProjectAttributeValue. -func ProjectAttributes() ([]string, error) { return lines("project/attributes/") } - -func lines(suffix string) ([]string, error) { - j, err := Get(suffix) - if err != nil { - return nil, err - } - s := strings.Split(strings.TrimSpace(j), "\n") - for i := range s { - s[i] = strings.TrimSpace(s[i]) - } - return s, nil -} - -// InstanceAttributeValue returns the value of the provided VM -// instance attribute. -// -// If the requested attribute is not defined, the returned error will -// be of type NotDefinedError. -// -// InstanceAttributeValue may return ("", nil) if the attribute was -// defined to be the empty string. -func InstanceAttributeValue(attr string) (string, error) { - return Get("instance/attributes/" + attr) -} - -// ProjectAttributeValue returns the value of the provided -// project attribute. -// -// If the requested attribute is not defined, the returned error will -// be of type NotDefinedError. -// -// ProjectAttributeValue may return ("", nil) if the attribute was -// defined to be the empty string. -func ProjectAttributeValue(attr string) (string, error) { - return Get("project/attributes/" + attr) -} - -// Scopes returns the service account scopes for the given account. -// The account may be empty or the string "default" to use the instance's -// main account. -func Scopes(serviceAccount string) ([]string, error) { - if serviceAccount == "" { - serviceAccount = "default" - } - return lines("instance/service-accounts/" + serviceAccount + "/scopes") -} diff --git a/Godeps/_workspace/src/github.com/GoogleCloudPlatform/kubernetes/pkg/util/mount/safe_format_and_mount_test.go b/Godeps/_workspace/src/github.com/GoogleCloudPlatform/kubernetes/pkg/util/mount/safe_format_and_mount_test.go deleted file mode 100644 index 455e08f9e1b2..000000000000 --- a/Godeps/_workspace/src/github.com/GoogleCloudPlatform/kubernetes/pkg/util/mount/safe_format_and_mount_test.go +++ /dev/null @@ -1,172 +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 mount - -import ( - "fmt" - "testing" - - "github.com/GoogleCloudPlatform/kubernetes/pkg/util/exec" -) - -type ErrorMounter struct { - *FakeMounter - errIndex int - err []error -} - -func (mounter *ErrorMounter) Mount(source string, target string, fstype string, options []string) error { - i := mounter.errIndex - mounter.errIndex++ - if mounter.err != nil && mounter.err[i] != nil { - return mounter.err[i] - } - return mounter.FakeMounter.Mount(source, target, fstype, options) -} - -type ExecArgs struct { - command string - args []string - output string - err error -} - -func TestSafeFormatAndMount(t *testing.T) { - tests := []struct { - fstype string - mountOptions []string - execScripts []ExecArgs - mountErrs []error - expectedError error - }{ - { // Test a read only mount - fstype: "ext4", - mountOptions: []string{"ro"}, - }, - { // Test a normal mount - fstype: "ext4", - }, - - { // Test that 'file' is called and fails - fstype: "ext4", - mountErrs: []error{fmt.Errorf("unknown filesystem type '(null)'")}, - execScripts: []ExecArgs{ - {"file", []string{"-L", "--special-files", "/dev/foo"}, "ext4 filesystem", nil}, - }, - expectedError: fmt.Errorf("unknown filesystem type '(null)'"), - }, - { // Test that 'file' is called and confirms unformatted disk, format fails - fstype: "ext4", - mountErrs: []error{fmt.Errorf("unknown filesystem type '(null)'")}, - execScripts: []ExecArgs{ - {"file", []string{"-L", "--special-files", "/dev/foo"}, "data", nil}, - {"mkfs.ext4", []string{"-E", "lazy_itable_init=0,lazy_journal_init=0", "-F", "/dev/foo"}, "", fmt.Errorf("formatting failed")}, - }, - expectedError: fmt.Errorf("formatting failed"), - }, - { // Test that 'file' is called and confirms unformatted disk, format passes, second mount fails - fstype: "ext4", - mountErrs: []error{fmt.Errorf("unknown filesystem type '(null)'"), fmt.Errorf("Still cannot mount")}, - execScripts: []ExecArgs{ - {"file", []string{"-L", "--special-files", "/dev/foo"}, "data", nil}, - {"mkfs.ext4", []string{"-E", "lazy_itable_init=0,lazy_journal_init=0", "-F", "/dev/foo"}, "", nil}, - }, - expectedError: fmt.Errorf("Still cannot mount"), - }, - { // Test that 'file' is called and confirms unformatted disk, format passes, second mount passes - fstype: "ext4", - mountErrs: []error{fmt.Errorf("unknown filesystem type '(null)'"), nil}, - execScripts: []ExecArgs{ - {"file", []string{"-L", "--special-files", "/dev/foo"}, "data", nil}, - {"mkfs.ext4", []string{"-E", "lazy_itable_init=0,lazy_journal_init=0", "-F", "/dev/foo"}, "", nil}, - }, - expectedError: nil, - }, - { // Test that 'file' is called and confirms unformatted disk, format passes, second mount passes with ext3 - fstype: "ext3", - mountErrs: []error{fmt.Errorf("unknown filesystem type '(null)'"), nil}, - execScripts: []ExecArgs{ - {"file", []string{"-L", "--special-files", "/dev/foo"}, "data", nil}, - {"mkfs.ext3", []string{"-E", "lazy_itable_init=0,lazy_journal_init=0", "-F", "/dev/foo"}, "", nil}, - }, - expectedError: nil, - }, - } - - for _, test := range tests { - commandScripts := []exec.FakeCommandAction{} - for _, expected := range test.execScripts { - ecmd := expected.command - eargs := expected.args - output := expected.output - err := expected.err - commandScript := func(cmd string, args ...string) exec.Cmd { - if cmd != ecmd { - t.Errorf("Unexpected command %s. Expecting %s", cmd, ecmd) - } - - for j := range args { - if args[j] != eargs[j] { - t.Errorf("Unexpected args %v. Expecting %v", args, eargs) - } - } - fake := exec.FakeCmd{ - CombinedOutputScript: []exec.FakeCombinedOutputAction{ - func() ([]byte, error) { return []byte(output), err }, - }, - } - return exec.InitFakeCmd(&fake, cmd, args...) - } - commandScripts = append(commandScripts, commandScript) - } - - fake := exec.FakeExec{ - CommandScript: commandScripts, - } - - fakeMounter := ErrorMounter{&FakeMounter{}, 0, test.mountErrs} - mounter := SafeFormatAndMount{ - Interface: &fakeMounter, - Runner: &fake, - } - - device := "/dev/foo" - dest := "/mnt/bar" - err := mounter.Mount(device, dest, test.fstype, test.mountOptions) - if test.expectedError == nil { - if err != nil { - t.Errorf("unexpected non-error: %v", err) - } - - // Check that something was mounted on the directory - isMountPoint, err := fakeMounter.IsMountPoint(dest) - if err != nil || !isMountPoint { - t.Errorf("the directory was not mounted") - } - - //check that the correct device was mounted - mountedDevice, _, err := GetDeviceNameFromMount(fakeMounter.FakeMounter, dest) - if err != nil || mountedDevice != device { - t.Errorf("the correct device was not mounted") - } - } else { - if err == nil || test.expectedError.Error() != err.Error() { - t.Errorf("unexpected error: %v. Expecting %v", err, test.expectedError) - } - } - } -} diff --git a/Godeps/_workspace/src/github.com/appc/cni/libcni/api.go b/Godeps/_workspace/src/github.com/appc/cni/libcni/api.go new file mode 100644 index 000000000000..4ad714a03e99 --- /dev/null +++ b/Godeps/_workspace/src/github.com/appc/cni/libcni/api.go @@ -0,0 +1,65 @@ +// 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 libcni + +import ( + "strings" + + "github.com/appc/cni/pkg/invoke" + "github.com/appc/cni/pkg/types" +) + +type RuntimeConf struct { + ContainerID string + NetNS string + IfName string + Args [][2]string +} + +type NetworkConfig struct { + Network *types.NetConf + Bytes []byte +} + +type CNI interface { + AddNetwork(net *NetworkConfig, rt *RuntimeConf) (*types.Result, error) + DelNetwork(net *NetworkConfig, rt *RuntimeConf) error +} + +type CNIConfig struct { + Path []string +} + +func (c *CNIConfig) AddNetwork(net *NetworkConfig, rt *RuntimeConf) (*types.Result, error) { + pluginPath := invoke.FindInPath(net.Network.Type, c.Path) + return invoke.ExecPluginWithResult(pluginPath, net.Bytes, c.args("ADD", rt)) +} + +func (c *CNIConfig) DelNetwork(net *NetworkConfig, rt *RuntimeConf) error { + pluginPath := invoke.FindInPath(net.Network.Type, c.Path) + return invoke.ExecPluginWithoutResult(pluginPath, net.Bytes, c.args("DEL", rt)) +} + +// ===== +func (c *CNIConfig) args(action string, rt *RuntimeConf) *invoke.Args { + return &invoke.Args{ + Command: action, + ContainerID: rt.ContainerID, + NetNS: rt.NetNS, + PluginArgs: rt.Args, + IfName: rt.IfName, + Path: strings.Join(c.Path, ":"), + } +} diff --git a/Godeps/_workspace/src/github.com/appc/cni/libcni/conf.go b/Godeps/_workspace/src/github.com/appc/cni/libcni/conf.go new file mode 100644 index 000000000000..47babeb447f7 --- /dev/null +++ b/Godeps/_workspace/src/github.com/appc/cni/libcni/conf.go @@ -0,0 +1,85 @@ +// 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 libcni + +import ( + "encoding/json" + "fmt" + "io/ioutil" + "os" + "path/filepath" + "sort" +) + +func ConfFromBytes(bytes []byte) (*NetworkConfig, error) { + conf := &NetworkConfig{Bytes: bytes} + if err := json.Unmarshal(bytes, &conf.Network); err != nil { + return nil, fmt.Errorf("error parsing configuration: %s", err) + } + return conf, nil +} + +func ConfFromFile(filename string) (*NetworkConfig, error) { + bytes, err := ioutil.ReadFile(filename) + if err != nil { + return nil, fmt.Errorf("error reading %s: %s", filename, err) + } + return ConfFromBytes(bytes) +} + +func ConfFiles(dir string) ([]string, error) { + // In part, adapted from rkt/networking/podenv.go#listFiles + files, err := ioutil.ReadDir(dir) + switch { + case err == nil: // break + case os.IsNotExist(err): + return nil, nil + default: + return nil, err + } + + confFiles := []string{} + for _, f := range files { + if f.IsDir() { + continue + } + if filepath.Ext(f.Name()) == ".conf" { + confFiles = append(confFiles, filepath.Join(dir, f.Name())) + } + } + return confFiles, nil +} + +func LoadConf(dir, name string) (*NetworkConfig, error) { + files, err := ConfFiles(dir) + switch { + case err != nil: + return nil, err + case len(files) == 0: + return nil, fmt.Errorf("no net configurations found") + } + sort.Strings(files) + + for _, confFile := range files { + conf, err := ConfFromFile(confFile) + if err != nil { + return nil, err + } + if conf.Network.Name == name { + return conf, nil + } + } + return nil, fmt.Errorf(`no net configuration with name "%s" in %s`, name, dir) +} diff --git a/Godeps/_workspace/src/github.com/appc/cni/pkg/invoke/args.go b/Godeps/_workspace/src/github.com/appc/cni/pkg/invoke/args.go new file mode 100644 index 000000000000..6f0a813ad370 --- /dev/null +++ b/Godeps/_workspace/src/github.com/appc/cni/pkg/invoke/args.go @@ -0,0 +1,76 @@ +// 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 invoke + +import ( + "os" + "strings" +) + +type CNIArgs interface { + // For use with os/exec; i.e., return nil to inherit the + // environment from this process + AsEnv() []string +} + +type inherited struct{} + +var inheritArgsFromEnv inherited + +func (_ *inherited) AsEnv() []string { + return nil +} + +func ArgsFromEnv() CNIArgs { + return &inheritArgsFromEnv +} + +type Args struct { + Command string + ContainerID string + NetNS string + PluginArgs [][2]string + PluginArgsStr string + IfName string + Path string +} + +func (args *Args) AsEnv() []string { + env := os.Environ() + pluginArgsStr := args.PluginArgsStr + if pluginArgsStr == "" { + pluginArgsStr = stringify(args.PluginArgs) + } + + env = append(env, + "CNI_COMMAND="+args.Command, + "CNI_CONTAINERID="+args.ContainerID, + "CNI_NETNS="+args.NetNS, + "CNI_ARGS="+pluginArgsStr, + "CNI_IFNAME="+args.IfName, + "CNI_PATH="+args.Path) + return env +} + +// taken from rkt/networking/net_plugin.go +func stringify(pluginArgs [][2]string) string { + entries := make([]string, len(pluginArgs)) + + for i, kv := range pluginArgs { + entries[i] = strings.Join(kv[:], "=") + } + + return strings.Join(entries, ";") +} diff --git a/Godeps/_workspace/src/github.com/appc/cni/pkg/invoke/exec.go b/Godeps/_workspace/src/github.com/appc/cni/pkg/invoke/exec.go new file mode 100644 index 000000000000..cf0cff47e93c --- /dev/null +++ b/Godeps/_workspace/src/github.com/appc/cni/pkg/invoke/exec.go @@ -0,0 +1,80 @@ +// 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 invoke + +import ( + "bytes" + "encoding/json" + "fmt" + "os" + "os/exec" + "path/filepath" + + "github.com/appc/cni/pkg/types" +) + +func pluginErr(err error, output []byte) error { + if _, ok := err.(*exec.ExitError); ok { + emsg := types.Error{} + if perr := json.Unmarshal(output, &emsg); perr != nil { + return fmt.Errorf("netplugin failed but error parsing its diagnostic message %q: %v", string(output), perr) + } + details := "" + if emsg.Details != "" { + details = fmt.Sprintf("; %v", emsg.Details) + } + return fmt.Errorf("%v%v", emsg.Msg, details) + } + + return err +} + +func ExecPluginWithResult(pluginPath string, netconf []byte, args CNIArgs) (*types.Result, error) { + stdoutBytes, err := execPlugin(pluginPath, netconf, args) + if err != nil { + return nil, err + } + + res := &types.Result{} + err = json.Unmarshal(stdoutBytes, res) + return res, err +} + +func ExecPluginWithoutResult(pluginPath string, netconf []byte, args CNIArgs) error { + _, err := execPlugin(pluginPath, netconf, args) + return err +} + +func execPlugin(pluginPath string, netconf []byte, args CNIArgs) ([]byte, error) { + if pluginPath == "" { + return nil, fmt.Errorf("could not find %q plugin", filepath.Base(pluginPath)) + } + + stdout := &bytes.Buffer{} + + c := exec.Cmd{ + Env: args.AsEnv(), + Path: pluginPath, + Args: []string{pluginPath}, + Stdin: bytes.NewBuffer(netconf), + Stdout: stdout, + Stderr: os.Stderr, + } + if err := c.Run(); err != nil { + return nil, pluginErr(err, stdout.Bytes()) + } + + return stdout.Bytes(), nil +} diff --git a/Godeps/_workspace/src/github.com/appc/cni/pkg/invoke/find.go b/Godeps/_workspace/src/github.com/appc/cni/pkg/invoke/find.go new file mode 100644 index 000000000000..dfad12bc64f7 --- /dev/null +++ b/Godeps/_workspace/src/github.com/appc/cni/pkg/invoke/find.go @@ -0,0 +1,37 @@ +// 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 invoke + +import ( + "os" + "path/filepath" + "strings" +) + +func FindInPath(plugin string, path []string) string { + for _, p := range path { + fullname := filepath.Join(p, plugin) + if fi, err := os.Stat(fullname); err == nil && fi.Mode().IsRegular() { + return fullname + } + } + return "" +} + +// Find returns the full path of the plugin by searching in CNI_PATH +func Find(plugin string) string { + paths := strings.Split(os.Getenv("CNI_PATH"), ":") + return FindInPath(plugin, paths) +} diff --git a/Godeps/_workspace/src/github.com/appc/cni/pkg/types/args.go b/Godeps/_workspace/src/github.com/appc/cni/pkg/types/args.go new file mode 100644 index 000000000000..68162435a81a --- /dev/null +++ b/Godeps/_workspace/src/github.com/appc/cni/pkg/types/args.go @@ -0,0 +1,50 @@ +// 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 types + +import ( + "encoding" + "fmt" + "reflect" + "strings" +) + +func LoadArgs(args string, container interface{}) error { + if args == "" { + return nil + } + + containerValue := reflect.ValueOf(container) + + pairs := strings.Split(args, ";") + for _, pair := range pairs { + kv := strings.Split(pair, "=") + if len(kv) != 2 { + return fmt.Errorf("ARGS: invalid pair %q", pair) + } + keyString := kv[0] + valueString := kv[1] + keyField := containerValue.Elem().FieldByName(keyString) + if !keyField.IsValid() { + return fmt.Errorf("ARGS: invalid key %q", keyString) + } + u := keyField.Addr().Interface().(encoding.TextUnmarshaler) + err := u.UnmarshalText([]byte(valueString)) + if err != nil { + return fmt.Errorf("ARGS: error parsing value of pair %q: %v)", pair, err) + } + } + return nil +} diff --git a/Godeps/_workspace/src/github.com/appc/cni/pkg/types/types.go b/Godeps/_workspace/src/github.com/appc/cni/pkg/types/types.go new file mode 100644 index 000000000000..21ba32d61f26 --- /dev/null +++ b/Godeps/_workspace/src/github.com/appc/cni/pkg/types/types.go @@ -0,0 +1,166 @@ +// 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 types + +import ( + "encoding/json" + "net" + "os" +) + +// like net.IPNet but adds JSON marshalling and unmarshalling +type IPNet net.IPNet + +// ParseCIDR takes a string like "10.2.3.1/24" and +// return IPNet with "10.2.3.1" and /24 mask +func ParseCIDR(s string) (*net.IPNet, error) { + ip, ipn, err := net.ParseCIDR(s) + if err != nil { + return nil, err + } + + ipn.IP = ip + return ipn, nil +} + +func (n IPNet) MarshalJSON() ([]byte, error) { + return json.Marshal((*net.IPNet)(&n).String()) +} + +func (n *IPNet) UnmarshalJSON(data []byte) error { + var s string + if err := json.Unmarshal(data, &s); err != nil { + return err + } + + tmp, err := ParseCIDR(s) + if err != nil { + return err + } + + *n = IPNet(*tmp) + return nil +} + +// NetConf describes a network. +type NetConf struct { + Name string `json:"name,omitempty"` + Type string `json:"type,omitempty"` + IPAM struct { + Type string `json:"type,omitempty"` + } `json:"ipam,omitempty"` +} + +// Result is what gets returned from the plugin (via stdout) to the caller +type Result struct { + IP4 *IPConfig `json:"ip4,omitempty"` + IP6 *IPConfig `json:"ip6,omitempty"` +} + +func (r *Result) Print() error { + return prettyPrint(r) +} + +// IPConfig contains values necessary to configure an interface +type IPConfig struct { + IP net.IPNet + Gateway net.IP + Routes []Route +} + +type Route struct { + Dst net.IPNet + GW net.IP +} + +type Error struct { + Code uint `json:"code"` + Msg string `json:"msg"` + Details string `json:"details,omitempty"` +} + +func (e *Error) Error() string { + return e.Msg +} + +func (e *Error) Print() error { + return prettyPrint(e) +} + +// net.IPNet is not JSON (un)marshallable so this duality is needed +// for our custom IPNet type + +// JSON (un)marshallable types +type ipConfig struct { + IP IPNet `json:"ip"` + Gateway net.IP `json:"gateway,omitempty"` + Routes []Route `json:"routes,omitempty"` +} + +type route struct { + Dst IPNet `json:"dst"` + GW net.IP `json:"gw,omitempty"` +} + +func (c *IPConfig) MarshalJSON() ([]byte, error) { + ipc := ipConfig{ + IP: IPNet(c.IP), + Gateway: c.Gateway, + Routes: c.Routes, + } + + return json.Marshal(ipc) +} + +func (c *IPConfig) UnmarshalJSON(data []byte) error { + ipc := ipConfig{} + if err := json.Unmarshal(data, &ipc); err != nil { + return err + } + + c.IP = net.IPNet(ipc.IP) + c.Gateway = ipc.Gateway + c.Routes = ipc.Routes + return nil +} + +func (r *Route) UnmarshalJSON(data []byte) error { + rt := route{} + if err := json.Unmarshal(data, &rt); err != nil { + return err + } + + r.Dst = net.IPNet(rt.Dst) + r.GW = rt.GW + return nil +} + +func (r *Route) MarshalJSON() ([]byte, error) { + rt := route{ + Dst: IPNet(r.Dst), + GW: r.GW, + } + + return json.Marshal(rt) +} + +func prettyPrint(obj interface{}) error { + data, err := json.MarshalIndent(obj, "", " ") + if err != nil { + return err + } + _, err = os.Stdout.Write(data) + return err +} diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/awserr/error.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/awserr/error.go index cf54d89d1ed3..a52743bef1cd 100644 --- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/awserr/error.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/awserr/error.go @@ -10,23 +10,23 @@ package awserr // // Example: // -// output, err := s3manage.Upload(svc, input, opts) -// if err != nil { -// if awsErr, ok := err.(awserr.Error); ok { -// // Get error details -// log.Println("Error:", err.Code(), err.Message()) +// output, err := s3manage.Upload(svc, input, opts) +// if err != nil { +// if awsErr, ok := err.(awserr.Error); ok { +// // Get error details +// log.Println("Error:", err.Code(), err.Message()) // -// Prints out full error message, including original error if there was one. -// log.Println("Error:", err.Error()) +// // Prints out full error message, including original error if there was one. +// log.Println("Error:", err.Error()) // -// // Get original error -// if origErr := err.Err(); origErr != nil { -// // operate on original error. -// } -// } else { -// fmt.Println(err.Error()) -// } -// } +// // Get original error +// if origErr := err.Err(); origErr != nil { +// // operate on original error. +// } +// } else { +// fmt.Println(err.Error()) +// } +// } // type Error interface { // Satisfy the generic error interface. @@ -42,6 +42,17 @@ type Error interface { OrigErr() error } +// New returns an Error object described by the code, message, and origErr. +// +// If origErr satisfies the Error interface it will not be wrapped within a new +// Error object and will instead be returned. +func New(code, message string, origErr error) Error { + if e, ok := origErr.(Error); ok && e != nil { + return e + } + return newBaseError(code, message, origErr) +} + // A RequestFailure is an interface to extract request failure information from // an Error such as the request ID of the failed request returned by a service. // RequestFailures may not always have a requestID value if the request failed @@ -86,3 +97,9 @@ type RequestFailure interface { // to a connection error. RequestID() string } + +// NewRequestFailure returns a new request error wrapper for the given Error +// provided. +func NewRequestFailure(err Error, statusCode int, reqID string) RequestFailure { + return newRequestError(err, statusCode, reqID) +} diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/awserr/types.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/awserr/types.go new file mode 100644 index 000000000000..003a6e8067e4 --- /dev/null +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/awserr/types.go @@ -0,0 +1,135 @@ +package awserr + +import "fmt" + +// SprintError returns a string of the formatted error code. +// +// Both extra and origErr are optional. If they are included their lines +// will be added, but if they are not included their lines will be ignored. +func SprintError(code, message, extra string, origErr error) string { + msg := fmt.Sprintf("%s: %s", code, message) + if extra != "" { + msg = fmt.Sprintf("%s\n\t%s", msg, extra) + } + if origErr != nil { + msg = fmt.Sprintf("%s\ncaused by: %s", msg, origErr.Error()) + } + return msg +} + +// A baseError wraps the code and message which defines an error. It also +// can be used to wrap an original error object. +// +// Should be used as the root for errors satisfying the awserr.Error. Also +// for any error which does not fit into a specific error wrapper type. +type baseError struct { + // Classification of error + code string + + // Detailed information about error + message string + + // Optional original error this error is based off of. Allows building + // chained errors. + origErr error +} + +// newBaseError returns an error object for the code, message, and err. +// +// code is a short no whitespace phrase depicting the classification of +// the error that is being created. +// +// message is the free flow string containing detailed information about the error. +// +// origErr is the error object which will be nested under the new error to be returned. +func newBaseError(code, message string, origErr error) *baseError { + return &baseError{ + code: code, + message: message, + origErr: origErr, + } +} + +// Error returns the string representation of the error. +// +// See ErrorWithExtra for formatting. +// +// Satisfies the error interface. +func (b baseError) Error() string { + return SprintError(b.code, b.message, "", b.origErr) +} + +// String returns the string representation of the error. +// Alias for Error to satisfy the stringer interface. +func (b baseError) String() string { + return b.Error() +} + +// Code returns the short phrase depicting the classification of the error. +func (b baseError) Code() string { + return b.code +} + +// Message returns the error details message. +func (b baseError) Message() string { + return b.message +} + +// OrigErr returns the original error if one was set. Nil is returned if no error +// was set. +func (b baseError) OrigErr() error { + return b.origErr +} + +// So that the Error interface type can be included as an anonymous field +// in the requestError struct and not conflict with the error.Error() method. +type awsError Error + +// A requestError wraps a request or service error. +// +// Composed of baseError for code, message, and original error. +type requestError struct { + awsError + statusCode int + requestID string +} + +// newRequestError returns a wrapped error with additional information for request +// status code, and service requestID. +// +// Should be used to wrap all request which involve service requests. Even if +// the request failed without a service response, but had an HTTP status code +// that may be meaningful. +// +// Also wraps original errors via the baseError. +func newRequestError(err Error, statusCode int, requestID string) *requestError { + return &requestError{ + awsError: err, + statusCode: statusCode, + requestID: requestID, + } +} + +// Error returns the string representation of the error. +// Satisfies the error interface. +func (r requestError) Error() string { + extra := fmt.Sprintf("status code: %d, request id: %s", + r.statusCode, r.requestID) + return SprintError(r.Code(), r.Message(), extra, r.OrigErr()) +} + +// String returns the string representation of the error. +// Alias for Error to satisfy the stringer interface. +func (r requestError) String() string { + return r.Error() +} + +// StatusCode returns the wrapped status code for the error +func (r requestError) StatusCode() int { + return r.statusCode +} + +// RequestID returns the wrapped requestID +func (r requestError) RequestID() string { + return r.requestID +} diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/awsutil/copy.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/awsutil/copy.go index 99a11567f598..f91743c6e1d3 100644 --- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/awsutil/copy.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/awsutil/copy.go @@ -70,12 +70,20 @@ func rcopy(dst, src reflect.Value, root bool) { } } case reflect.Slice: + if src.IsNil() { + break + } + s := reflect.MakeSlice(src.Type(), src.Len(), src.Cap()) dst.Set(s) for i := 0; i < src.Len(); i++ { rcopy(dst.Index(i), src.Index(i), false) } case reflect.Map: + if src.IsNil() { + break + } + s := reflect.MakeMap(src.Type()) dst.Set(s) for _, k := range src.MapKeys() { diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/awsutil/copy_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/awsutil/copy_test.go index 4ae04ac1dd2c..4f26241a2b8b 100644 --- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/awsutil/copy_test.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/awsutil/copy_test.go @@ -27,7 +27,7 @@ func ExampleCopy() { awsutil.Copy(&f2, f1) // Print the result - fmt.Println(awsutil.StringValue(f2)) + fmt.Println(awsutil.Prettify(f2)) // Output: // { @@ -80,18 +80,26 @@ func TestCopy(t *testing.T) { func TestCopyIgnoreNilMembers(t *testing.T) { type Foo struct { A *string + B []string + C map[string]string } f := &Foo{} assert.Nil(t, f.A) + assert.Nil(t, f.B) + assert.Nil(t, f.C) var f2 Foo awsutil.Copy(&f2, f) assert.Nil(t, f2.A) + assert.Nil(t, f2.B) + assert.Nil(t, f2.C) fcopy := awsutil.CopyOf(f) f3 := fcopy.(*Foo) assert.Nil(t, f3.A) + assert.Nil(t, f3.B) + assert.Nil(t, f3.C) } func TestCopyPrimitive(t *testing.T) { @@ -183,7 +191,7 @@ func ExampleCopyOf() { var f2 *Foo = v.(*Foo) // Print the result - fmt.Println(awsutil.StringValue(f2)) + fmt.Println(awsutil.Prettify(f2)) // Output: // { diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/awsutil/path_value.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/awsutil/path_value.go index 7ae01efe4278..905d82385ecd 100644 --- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/awsutil/path_value.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/awsutil/path_value.go @@ -81,6 +81,12 @@ func rValuesAtPath(v interface{}, path string, create bool, caseSensitive bool) value = reflect.Indirect(value) } + if value.Kind() == reflect.Slice || value.Kind() == reflect.Map { + if !create && value.IsNil() { + value = reflect.ValueOf(nil) + } + } + if value.IsValid() { nextvals = append(nextvals, value) } @@ -118,6 +124,12 @@ func rValuesAtPath(v interface{}, path string, create bool, caseSensitive bool) } value = reflect.Indirect(value.Index(i)) + if value.Kind() == reflect.Slice || value.Kind() == reflect.Map { + if !create && value.IsNil() { + value = reflect.ValueOf(nil) + } + } + if value.IsValid() { nextvals = append(nextvals, value) } diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/awsutil/path_value_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/awsutil/path_value_test.go index 1262cf6bef15..0da6b06fddcf 100644 --- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/awsutil/path_value_test.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/awsutil/path_value_test.go @@ -16,8 +16,8 @@ type Struct struct { } var data = Struct{ - A: []Struct{Struct{C: "value1"}, Struct{C: "value2"}, Struct{C: "value3"}}, - z: []Struct{Struct{C: "value1"}, Struct{C: "value2"}, Struct{C: "value3"}}, + A: []Struct{{C: "value1"}, {C: "value2"}, {C: "value3"}}, + z: []Struct{{C: "value1"}, {C: "value2"}, {C: "value3"}}, B: &Struct{B: &Struct{C: "terminal"}, D: &Struct{C: "terminal2"}}, C: "initial", } @@ -44,6 +44,7 @@ func TestValueAtPathFailure(t *testing.T) { assert.Equal(t, []interface{}{}, awsutil.ValuesAtPath(data, "B.B.C.Z")) assert.Equal(t, []interface{}(nil), awsutil.ValuesAtPath(data, "z[-1].C")) assert.Equal(t, []interface{}{}, awsutil.ValuesAtPath(nil, "A.B.C")) + assert.Equal(t, []interface{}{}, awsutil.ValuesAtPath(Struct{}, "A")) } func TestSetValueAtPathSuccess(t *testing.T) { @@ -62,4 +63,6 @@ func TestSetValueAtPathSuccess(t *testing.T) { var s2 Struct awsutil.SetValueAtAnyPath(&s2, "b.b.c", "test0") assert.Equal(t, "test0", s2.B.B.C) + awsutil.SetValueAtAnyPath(&s2, "A", []Struct{{}}) + assert.Equal(t, []Struct{{}}, s2.A) } diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/awsutil/prettify.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/awsutil/prettify.go new file mode 100644 index 000000000000..0de3eaa0f639 --- /dev/null +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/awsutil/prettify.go @@ -0,0 +1,103 @@ +package awsutil + +import ( + "bytes" + "fmt" + "io" + "reflect" + "strings" +) + +// Prettify returns the string representation of a value. +func Prettify(i interface{}) string { + var buf bytes.Buffer + prettify(reflect.ValueOf(i), 0, &buf) + return buf.String() +} + +// prettify will recursively walk value v to build a textual +// representation of the value. +func prettify(v reflect.Value, indent int, buf *bytes.Buffer) { + for v.Kind() == reflect.Ptr { + v = v.Elem() + } + + switch v.Kind() { + case reflect.Struct: + strtype := v.Type().String() + if strtype == "time.Time" { + fmt.Fprintf(buf, "%s", v.Interface()) + break + } else if strings.HasPrefix(strtype, "io.") { + buf.WriteString("") + break + } + + buf.WriteString("{\n") + + names := []string{} + for i := 0; i < v.Type().NumField(); i++ { + name := v.Type().Field(i).Name + f := v.Field(i) + if name[0:1] == strings.ToLower(name[0:1]) { + continue // ignore unexported fields + } + if (f.Kind() == reflect.Ptr || f.Kind() == reflect.Slice || f.Kind() == reflect.Map) && f.IsNil() { + continue // ignore unset fields + } + names = append(names, name) + } + + for i, n := range names { + val := v.FieldByName(n) + buf.WriteString(strings.Repeat(" ", indent+2)) + buf.WriteString(n + ": ") + prettify(val, indent+2, buf) + + if i < len(names)-1 { + buf.WriteString(",\n") + } + } + + buf.WriteString("\n" + strings.Repeat(" ", indent) + "}") + case reflect.Slice: + nl, id, id2 := "", "", "" + if v.Len() > 3 { + nl, id, id2 = "\n", strings.Repeat(" ", indent), strings.Repeat(" ", indent+2) + } + buf.WriteString("[" + nl) + for i := 0; i < v.Len(); i++ { + buf.WriteString(id2) + prettify(v.Index(i), indent+2, buf) + + if i < v.Len()-1 { + buf.WriteString("," + nl) + } + } + + buf.WriteString(nl + id + "]") + case reflect.Map: + buf.WriteString("{\n") + + for i, k := range v.MapKeys() { + buf.WriteString(strings.Repeat(" ", indent+2)) + buf.WriteString(k.String() + ": ") + prettify(v.MapIndex(k), indent+2, buf) + + if i < v.Len()-1 { + buf.WriteString(",\n") + } + } + + buf.WriteString("\n" + strings.Repeat(" ", indent) + "}") + default: + format := "%v" + switch v.Interface().(type) { + case string: + format = "%q" + case io.ReadSeeker, io.Reader: + format = "buffer(%p)" + } + fmt.Fprintf(buf, format, v.Interface()) + } +} diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/awsutil/string_value.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/awsutil/string_value.go deleted file mode 100644 index 09673a12ed27..000000000000 --- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/awsutil/string_value.go +++ /dev/null @@ -1,103 +0,0 @@ -package awsutil - -import ( - "bytes" - "fmt" - "io" - "reflect" - "strings" -) - -// StringValue returns the string representation of a value. -func StringValue(i interface{}) string { - var buf bytes.Buffer - stringValue(reflect.ValueOf(i), 0, &buf) - return buf.String() -} - -// stringValue will recursively walk value v to build a textual -// representation of the value. -func stringValue(v reflect.Value, indent int, buf *bytes.Buffer) { - for v.Kind() == reflect.Ptr { - v = v.Elem() - } - - switch v.Kind() { - case reflect.Struct: - strtype := v.Type().String() - if strtype == "time.Time" { - fmt.Fprintf(buf, "%s", v.Interface()) - break - } else if strings.HasPrefix(strtype, "io.") { - buf.WriteString("") - break - } - - buf.WriteString("{\n") - - names := []string{} - for i := 0; i < v.Type().NumField(); i++ { - name := v.Type().Field(i).Name - f := v.Field(i) - if name[0:1] == strings.ToLower(name[0:1]) { - continue // ignore unexported fields - } - if (f.Kind() == reflect.Ptr || f.Kind() == reflect.Slice || f.Kind() == reflect.Map) && f.IsNil() { - continue // ignore unset fields - } - names = append(names, name) - } - - for i, n := range names { - val := v.FieldByName(n) - buf.WriteString(strings.Repeat(" ", indent+2)) - buf.WriteString(n + ": ") - stringValue(val, indent+2, buf) - - if i < len(names)-1 { - buf.WriteString(",\n") - } - } - - buf.WriteString("\n" + strings.Repeat(" ", indent) + "}") - case reflect.Slice: - nl, id, id2 := "", "", "" - if v.Len() > 3 { - nl, id, id2 = "\n", strings.Repeat(" ", indent), strings.Repeat(" ", indent+2) - } - buf.WriteString("[" + nl) - for i := 0; i < v.Len(); i++ { - buf.WriteString(id2) - stringValue(v.Index(i), indent+2, buf) - - if i < v.Len()-1 { - buf.WriteString("," + nl) - } - } - - buf.WriteString(nl + id + "]") - case reflect.Map: - buf.WriteString("{\n") - - for i, k := range v.MapKeys() { - buf.WriteString(strings.Repeat(" ", indent+2)) - buf.WriteString(k.String() + ": ") - stringValue(v.MapIndex(k), indent+2, buf) - - if i < v.Len()-1 { - buf.WriteString(",\n") - } - } - - buf.WriteString("\n" + strings.Repeat(" ", indent) + "}") - default: - format := "%v" - switch v.Interface().(type) { - case string: - format = "%q" - case io.ReadSeeker, io.Reader: - format = "buffer(%p)" - } - fmt.Fprintf(buf, format, v.Interface()) - } -} diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/config.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/config.go index bd805f36b80c..a72f702229f9 100644 --- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/config.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/config.go @@ -1,172 +1,239 @@ package aws import ( - "io" "net/http" - "os" "time" "github.com/aws/aws-sdk-go/aws/credentials" ) -// DefaultChainCredentials is a Credentials which will find the first available -// credentials Value from the list of Providers. -// -// This should be used in the default case. Once the type of credentials are -// known switching to the specific Credentials will be more efficient. -var DefaultChainCredentials = credentials.NewChainCredentials( - []credentials.Provider{ - &credentials.EnvProvider{}, - &credentials.SharedCredentialsProvider{Filename: "", Profile: ""}, - &credentials.EC2RoleProvider{ExpiryWindow: 5 * time.Minute}, - }) - // The default number of retries for a service. The value of -1 indicates that // the service specific retry default will be used. const DefaultRetries = -1 -// DefaultConfig is the default all service configuration will be based off of. -var DefaultConfig = &Config{ - Credentials: DefaultChainCredentials, - Endpoint: "", - Region: os.Getenv("AWS_REGION"), - DisableSSL: false, - ManualSend: false, - HTTPClient: http.DefaultClient, - LogHTTPBody: false, - LogLevel: 0, - Logger: os.Stdout, - MaxRetries: DefaultRetries, - DisableParamValidation: false, - DisableComputeChecksums: false, - S3ForcePathStyle: false, -} - -// A Config provides service configuration +// A Config provides service configuration for service clients. By default, +// all clients will use the {defaults.DefaultConfig} structure. type Config struct { - Credentials *credentials.Credentials - Endpoint string - Region string - DisableSSL bool - ManualSend bool - HTTPClient *http.Client - LogHTTPBody bool - LogLevel uint - Logger io.Writer - MaxRetries int - DisableParamValidation bool - DisableComputeChecksums bool - S3ForcePathStyle bool + // The credentials object to use when signing requests. Defaults to + // {defaults.DefaultChainCredentials}. + Credentials *credentials.Credentials + + // An optional endpoint URL (hostname only or fully qualified URI) + // that overrides the default generated endpoint for a client. Set this + // to `""` to use the default generated endpoint. + // + // @note You must still provide a `Region` value when specifying an + // endpoint for a client. + Endpoint *string + + // The region to send requests to. This parameter is required and must + // be configured globally or on a per-client basis unless otherwise + // noted. A full list of regions is found in the "Regions and Endpoints" + // document. + // + // @see http://docs.aws.amazon.com/general/latest/gr/rande.html + // AWS Regions and Endpoints + Region *string + + // Set this to `true` to disable SSL when sending requests. Defaults + // to `false`. + DisableSSL *bool + + // The HTTP client to use when sending requests. Defaults to + // `http.DefaultClient`. + HTTPClient *http.Client + + // An integer value representing the logging level. The default log level + // is zero (LogOff), which represents no logging. To enable logging set + // to a LogLevel Value. + LogLevel *LogLevelType + + // The logger writer interface to write logging messages to. Defaults to + // standard out. + Logger Logger + + // The maximum number of times that a request will be retried for failures. + // Defaults to -1, which defers the max retry setting to the service specific + // configuration. + MaxRetries *int + + // Disables semantic parameter validation, which validates input for missing + // required fields and/or other semantic request input errors. + DisableParamValidation *bool + + // Disables the computation of request and response checksums, e.g., + // CRC32 checksums in Amazon DynamoDB. + DisableComputeChecksums *bool + + // Set this to `true` to force the request to use path-style addressing, + // i.e., `http://s3.amazonaws.com/BUCKET/KEY`. By default, the S3 client will + // use virtual hosted bucket addressing when possible + // (`http://BUCKET.s3.amazonaws.com/KEY`). + // + // @note This configuration option is specific to the Amazon S3 service. + // @see http://docs.aws.amazon.com/AmazonS3/latest/dev/VirtualHosting.html + // Amazon S3: Virtual Hosting of Buckets + S3ForcePathStyle *bool + + SleepDelay func(time.Duration) } -// Copy will return a shallow copy of the Config object. -func (c Config) Copy() Config { - dst := Config{} - dst.Credentials = c.Credentials - dst.Endpoint = c.Endpoint - dst.Region = c.Region - dst.DisableSSL = c.DisableSSL - dst.ManualSend = c.ManualSend - dst.HTTPClient = c.HTTPClient - dst.LogLevel = c.LogLevel - dst.Logger = c.Logger - dst.MaxRetries = c.MaxRetries - dst.DisableParamValidation = c.DisableParamValidation - dst.DisableComputeChecksums = c.DisableComputeChecksums - dst.S3ForcePathStyle = c.S3ForcePathStyle - - return dst -} - -// Merge merges the newcfg attribute values into this Config. Each attribute -// will be merged into this config if the newcfg attribute's value is non-zero. -// Due to this, newcfg attributes with zero values cannot be merged in. For -// example bool attributes cannot be cleared using Merge, and must be explicitly -// set on the Config structure. -func (c Config) Merge(newcfg *Config) *Config { - if newcfg == nil { +// NewConfig returns a new Config pointer that can be chained with builder methods to +// set multiple configuration values inline without using pointers. +// +// svc := s3.New(aws.NewConfig().WithRegion("us-west-2").WithMaxRetries(10)) +// +func NewConfig() *Config { + return &Config{} +} + +// WithCredentials sets a config Credentials value returning a Config pointer +// for chaining. +func (c *Config) WithCredentials(creds *credentials.Credentials) *Config { + c.Credentials = creds + return c +} + +// WithEndpoint sets a config Endpoint value returning a Config pointer for +// chaining. +func (c *Config) WithEndpoint(endpoint string) *Config { + c.Endpoint = &endpoint + return c +} + +// WithRegion sets a config Region value returning a Config pointer for +// chaining. +func (c *Config) WithRegion(region string) *Config { + c.Region = ®ion + return c +} + +// WithDisableSSL sets a config DisableSSL value returning a Config pointer +// for chaining. +func (c *Config) WithDisableSSL(disable bool) *Config { + c.DisableSSL = &disable + return c +} + +// WithHTTPClient sets a config HTTPClient value returning a Config pointer +// for chaining. +func (c *Config) WithHTTPClient(client *http.Client) *Config { + c.HTTPClient = client + return c +} + +// WithMaxRetries sets a config MaxRetries value returning a Config pointer +// for chaining. +func (c *Config) WithMaxRetries(max int) *Config { + c.MaxRetries = &max + return c +} + +// WithDisableParamValidation sets a config DisableParamValidation value +// returning a Config pointer for chaining. +func (c *Config) WithDisableParamValidation(disable bool) *Config { + c.DisableParamValidation = &disable + return c +} + +// WithDisableComputeChecksums sets a config DisableComputeChecksums value +// returning a Config pointer for chaining. +func (c *Config) WithDisableComputeChecksums(disable bool) *Config { + c.DisableComputeChecksums = &disable + return c +} + +// WithLogLevel sets a config LogLevel value returning a Config pointer for +// chaining. +func (c *Config) WithLogLevel(level LogLevelType) *Config { + c.LogLevel = &level + return c +} + +// WithLogger sets a config Logger value returning a Config pointer for +// chaining. +func (c *Config) WithLogger(logger Logger) *Config { + c.Logger = logger + return c +} + +// WithS3ForcePathStyle sets a config S3ForcePathStyle value returning a Config +// pointer for chaining. +func (c *Config) WithS3ForcePathStyle(force bool) *Config { + c.S3ForcePathStyle = &force + return c +} + +// WithSleepDelay overrides the function used to sleep while waiting for the +// next retry. Defaults to time.Sleep. +func (c *Config) WithSleepDelay(fn func(time.Duration)) *Config { + c.SleepDelay = fn + return c +} + +// Merge returns a new Config with the other Config's attribute values merged into +// this Config. If the other Config's attribute is nil it will not be merged into +// the new Config to be returned. +func (c Config) Merge(other *Config) *Config { + if other == nil { return &c } - cfg := Config{} + dst := c - if newcfg != nil && newcfg.Credentials != nil { - cfg.Credentials = newcfg.Credentials - } else { - cfg.Credentials = c.Credentials + if other.Credentials != nil { + dst.Credentials = other.Credentials } - if newcfg != nil && newcfg.Endpoint != "" { - cfg.Endpoint = newcfg.Endpoint - } else { - cfg.Endpoint = c.Endpoint + if other.Endpoint != nil { + dst.Endpoint = other.Endpoint } - if newcfg != nil && newcfg.Region != "" { - cfg.Region = newcfg.Region - } else { - cfg.Region = c.Region + if other.Region != nil { + dst.Region = other.Region } - if newcfg != nil && newcfg.DisableSSL { - cfg.DisableSSL = newcfg.DisableSSL - } else { - cfg.DisableSSL = c.DisableSSL + if other.DisableSSL != nil { + dst.DisableSSL = other.DisableSSL } - if newcfg != nil && newcfg.ManualSend { - cfg.ManualSend = newcfg.ManualSend - } else { - cfg.ManualSend = c.ManualSend + if other.HTTPClient != nil { + dst.HTTPClient = other.HTTPClient } - if newcfg != nil && newcfg.HTTPClient != nil { - cfg.HTTPClient = newcfg.HTTPClient - } else { - cfg.HTTPClient = c.HTTPClient + if other.LogLevel != nil { + dst.LogLevel = other.LogLevel } - if newcfg != nil && newcfg.LogHTTPBody { - cfg.LogHTTPBody = newcfg.LogHTTPBody - } else { - cfg.LogHTTPBody = c.LogHTTPBody + if other.Logger != nil { + dst.Logger = other.Logger } - if newcfg != nil && newcfg.LogLevel != 0 { - cfg.LogLevel = newcfg.LogLevel - } else { - cfg.LogLevel = c.LogLevel + if other.MaxRetries != nil { + dst.MaxRetries = other.MaxRetries } - if newcfg != nil && newcfg.Logger != nil { - cfg.Logger = newcfg.Logger - } else { - cfg.Logger = c.Logger + if other.DisableParamValidation != nil { + dst.DisableParamValidation = other.DisableParamValidation } - if newcfg != nil && newcfg.MaxRetries != DefaultRetries { - cfg.MaxRetries = newcfg.MaxRetries - } else { - cfg.MaxRetries = c.MaxRetries + if other.DisableComputeChecksums != nil { + dst.DisableComputeChecksums = other.DisableComputeChecksums } - if newcfg != nil && newcfg.DisableParamValidation { - cfg.DisableParamValidation = newcfg.DisableParamValidation - } else { - cfg.DisableParamValidation = c.DisableParamValidation + if other.S3ForcePathStyle != nil { + dst.S3ForcePathStyle = other.S3ForcePathStyle } - if newcfg != nil && newcfg.DisableComputeChecksums { - cfg.DisableComputeChecksums = newcfg.DisableComputeChecksums - } else { - cfg.DisableComputeChecksums = c.DisableComputeChecksums + if other.SleepDelay != nil { + dst.SleepDelay = other.SleepDelay } - if newcfg != nil && newcfg.S3ForcePathStyle { - cfg.S3ForcePathStyle = newcfg.S3ForcePathStyle - } else { - cfg.S3ForcePathStyle = c.S3ForcePathStyle - } + return &dst +} - return &cfg +// Copy will return a shallow copy of the Config object. +func (c Config) Copy() *Config { + dst := c + return &dst } diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/config_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/config_test.go new file mode 100644 index 000000000000..c4320ca1ede4 --- /dev/null +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/config_test.go @@ -0,0 +1,80 @@ +package aws + +import ( + "net/http" + "reflect" + "testing" + + "github.com/aws/aws-sdk-go/aws/credentials" +) + +var testCredentials = credentials.NewStaticCredentials("AKID", "SECRET", "SESSION") + +var copyTestConfig = Config{ + Credentials: testCredentials, + Endpoint: String("CopyTestEndpoint"), + Region: String("COPY_TEST_AWS_REGION"), + DisableSSL: Bool(true), + HTTPClient: http.DefaultClient, + LogLevel: LogLevel(LogDebug), + Logger: NewDefaultLogger(), + MaxRetries: Int(DefaultRetries), + DisableParamValidation: Bool(true), + DisableComputeChecksums: Bool(true), + S3ForcePathStyle: Bool(true), +} + +func TestCopy(t *testing.T) { + want := copyTestConfig + got := copyTestConfig.Copy() + if !reflect.DeepEqual(*got, want) { + t.Errorf("Copy() = %+v", got) + t.Errorf(" want %+v", want) + } +} + +func TestCopyReturnsNewInstance(t *testing.T) { + want := copyTestConfig + got := copyTestConfig.Copy() + if got == &want { + t.Errorf("Copy() = %p; want different instance as source %p", got, &want) + } +} + +var mergeTestZeroValueConfig = Config{} + +var mergeTestConfig = Config{ + Credentials: testCredentials, + Endpoint: String("MergeTestEndpoint"), + Region: String("MERGE_TEST_AWS_REGION"), + DisableSSL: Bool(true), + HTTPClient: http.DefaultClient, + LogLevel: LogLevel(LogDebug), + Logger: NewDefaultLogger(), + MaxRetries: Int(10), + DisableParamValidation: Bool(true), + DisableComputeChecksums: Bool(true), + S3ForcePathStyle: Bool(true), +} + +var mergeTests = []struct { + cfg *Config + in *Config + want *Config +}{ + {&Config{}, nil, &Config{}}, + {&Config{}, &mergeTestZeroValueConfig, &Config{}}, + {&Config{}, &mergeTestConfig, &mergeTestConfig}, +} + +func TestMerge(t *testing.T) { + for i, tt := range mergeTests { + got := tt.cfg.Merge(tt.in) + if !reflect.DeepEqual(got, tt.want) { + t.Errorf("Config %d %+v", i, tt.cfg) + t.Errorf(" Merge(%+v)", tt.in) + t.Errorf(" got %+v", got) + t.Errorf(" want %+v", tt.want) + } + } +} diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/convert_types.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/convert_types.go new file mode 100644 index 000000000000..d6a7b08dffe4 --- /dev/null +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/convert_types.go @@ -0,0 +1,357 @@ +package aws + +import "time" + +// String returns a pointer to of the string value passed in. +func String(v string) *string { + return &v +} + +// StringValue returns the value of the string pointer passed in or +// "" if the pointer is nil. +func StringValue(v *string) string { + if v != nil { + return *v + } + return "" +} + +// StringSlice converts a slice of string values into a slice of +// string pointers +func StringSlice(src []string) []*string { + dst := make([]*string, len(src)) + for i := 0; i < len(src); i++ { + dst[i] = &(src[i]) + } + return dst +} + +// StringValueSlice converts a slice of string pointers into a slice of +// string values +func StringValueSlice(src []*string) []string { + dst := make([]string, len(src)) + for i := 0; i < len(src); i++ { + if src[i] != nil { + dst[i] = *(src[i]) + } + } + return dst +} + +// StringMap converts a string map of string values into a string +// map of string pointers +func StringMap(src map[string]string) map[string]*string { + dst := make(map[string]*string) + for k, val := range src { + v := val + dst[k] = &v + } + return dst +} + +// StringValueMap converts a string map of string pointers into a string +// map of string values +func StringValueMap(src map[string]*string) map[string]string { + dst := make(map[string]string) + for k, val := range src { + if val != nil { + dst[k] = *val + } + } + return dst +} + +// Bool returns a pointer to of the bool value passed in. +func Bool(v bool) *bool { + return &v +} + +// BoolValue returns the value of the bool pointer passed in or +// false if the pointer is nil. +func BoolValue(v *bool) bool { + if v != nil { + return *v + } + return false +} + +// BoolSlice converts a slice of bool values into a slice of +// bool pointers +func BoolSlice(src []bool) []*bool { + dst := make([]*bool, len(src)) + for i := 0; i < len(src); i++ { + dst[i] = &(src[i]) + } + return dst +} + +// BoolValueSlice converts a slice of bool pointers into a slice of +// bool values +func BoolValueSlice(src []*bool) []bool { + dst := make([]bool, len(src)) + for i := 0; i < len(src); i++ { + if src[i] != nil { + dst[i] = *(src[i]) + } + } + return dst +} + +// BoolMap converts a string map of bool values into a string +// map of bool pointers +func BoolMap(src map[string]bool) map[string]*bool { + dst := make(map[string]*bool) + for k, val := range src { + v := val + dst[k] = &v + } + return dst +} + +// BoolValueMap converts a string map of bool pointers into a string +// map of bool values +func BoolValueMap(src map[string]*bool) map[string]bool { + dst := make(map[string]bool) + for k, val := range src { + if val != nil { + dst[k] = *val + } + } + return dst +} + +// Int returns a pointer to of the int value passed in. +func Int(v int) *int { + return &v +} + +// IntValue returns the value of the int pointer passed in or +// 0 if the pointer is nil. +func IntValue(v *int) int { + if v != nil { + return *v + } + return 0 +} + +// IntSlice converts a slice of int values into a slice of +// int pointers +func IntSlice(src []int) []*int { + dst := make([]*int, len(src)) + for i := 0; i < len(src); i++ { + dst[i] = &(src[i]) + } + return dst +} + +// IntValueSlice converts a slice of int pointers into a slice of +// int values +func IntValueSlice(src []*int) []int { + dst := make([]int, len(src)) + for i := 0; i < len(src); i++ { + if src[i] != nil { + dst[i] = *(src[i]) + } + } + return dst +} + +// IntMap converts a string map of int values into a string +// map of int pointers +func IntMap(src map[string]int) map[string]*int { + dst := make(map[string]*int) + for k, val := range src { + v := val + dst[k] = &v + } + return dst +} + +// IntValueMap converts a string map of int pointers into a string +// map of int values +func IntValueMap(src map[string]*int) map[string]int { + dst := make(map[string]int) + for k, val := range src { + if val != nil { + dst[k] = *val + } + } + return dst +} + +// Int64 returns a pointer to of the int64 value passed in. +func Int64(v int64) *int64 { + return &v +} + +// Int64Value returns the value of the int64 pointer passed in or +// 0 if the pointer is nil. +func Int64Value(v *int64) int64 { + if v != nil { + return *v + } + return 0 +} + +// Int64Slice converts a slice of int64 values into a slice of +// int64 pointers +func Int64Slice(src []int64) []*int64 { + dst := make([]*int64, len(src)) + for i := 0; i < len(src); i++ { + dst[i] = &(src[i]) + } + return dst +} + +// Int64ValueSlice converts a slice of int64 pointers into a slice of +// int64 values +func Int64ValueSlice(src []*int64) []int64 { + dst := make([]int64, len(src)) + for i := 0; i < len(src); i++ { + if src[i] != nil { + dst[i] = *(src[i]) + } + } + return dst +} + +// Int64Map converts a string map of int64 values into a string +// map of int64 pointers +func Int64Map(src map[string]int64) map[string]*int64 { + dst := make(map[string]*int64) + for k, val := range src { + v := val + dst[k] = &v + } + return dst +} + +// Int64ValueMap converts a string map of int64 pointers into a string +// map of int64 values +func Int64ValueMap(src map[string]*int64) map[string]int64 { + dst := make(map[string]int64) + for k, val := range src { + if val != nil { + dst[k] = *val + } + } + return dst +} + +// Float64 returns a pointer to of the float64 value passed in. +func Float64(v float64) *float64 { + return &v +} + +// Float64Value returns the value of the float64 pointer passed in or +// 0 if the pointer is nil. +func Float64Value(v *float64) float64 { + if v != nil { + return *v + } + return 0 +} + +// Float64Slice converts a slice of float64 values into a slice of +// float64 pointers +func Float64Slice(src []float64) []*float64 { + dst := make([]*float64, len(src)) + for i := 0; i < len(src); i++ { + dst[i] = &(src[i]) + } + return dst +} + +// Float64ValueSlice converts a slice of float64 pointers into a slice of +// float64 values +func Float64ValueSlice(src []*float64) []float64 { + dst := make([]float64, len(src)) + for i := 0; i < len(src); i++ { + if src[i] != nil { + dst[i] = *(src[i]) + } + } + return dst +} + +// Float64Map converts a string map of float64 values into a string +// map of float64 pointers +func Float64Map(src map[string]float64) map[string]*float64 { + dst := make(map[string]*float64) + for k, val := range src { + v := val + dst[k] = &v + } + return dst +} + +// Float64ValueMap converts a string map of float64 pointers into a string +// map of float64 values +func Float64ValueMap(src map[string]*float64) map[string]float64 { + dst := make(map[string]float64) + for k, val := range src { + if val != nil { + dst[k] = *val + } + } + return dst +} + +// Time returns a pointer to of the time.Time value passed in. +func Time(v time.Time) *time.Time { + return &v +} + +// TimeValue returns the value of the time.Time pointer passed in or +// time.Time{} if the pointer is nil. +func TimeValue(v *time.Time) time.Time { + if v != nil { + return *v + } + return time.Time{} +} + +// TimeSlice converts a slice of time.Time values into a slice of +// time.Time pointers +func TimeSlice(src []time.Time) []*time.Time { + dst := make([]*time.Time, len(src)) + for i := 0; i < len(src); i++ { + dst[i] = &(src[i]) + } + return dst +} + +// TimeValueSlice converts a slice of time.Time pointers into a slice of +// time.Time values +func TimeValueSlice(src []*time.Time) []time.Time { + dst := make([]time.Time, len(src)) + for i := 0; i < len(src); i++ { + if src[i] != nil { + dst[i] = *(src[i]) + } + } + return dst +} + +// TimeMap converts a string map of time.Time values into a string +// map of time.Time pointers +func TimeMap(src map[string]time.Time) map[string]*time.Time { + dst := make(map[string]*time.Time) + for k, val := range src { + v := val + dst[k] = &v + } + return dst +} + +// TimeValueMap converts a string map of time.Time pointers into a string +// map of time.Time values +func TimeValueMap(src map[string]*time.Time) map[string]time.Time { + dst := make(map[string]time.Time) + for k, val := range src { + if val != nil { + dst[k] = *val + } + } + return dst +} diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/convert_types_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/convert_types_test.go new file mode 100644 index 000000000000..df7a3e5d2de5 --- /dev/null +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/convert_types_test.go @@ -0,0 +1,437 @@ +package aws + +import ( + "testing" + "time" + + "github.com/stretchr/testify/assert" +) + +var testCasesStringSlice = [][]string{ + {"a", "b", "c", "d", "e"}, + {"a", "b", "", "", "e"}, +} + +func TestStringSlice(t *testing.T) { + for idx, in := range testCasesStringSlice { + if in == nil { + continue + } + out := StringSlice(in) + assert.Len(t, out, len(in), "Unexpected len at idx %d", idx) + for i := range out { + assert.Equal(t, in[i], *(out[i]), "Unexpected value at idx %d", idx) + } + + out2 := StringValueSlice(out) + assert.Len(t, out2, len(in), "Unexpected len at idx %d", idx) + assert.Equal(t, in, out2, "Unexpected value at idx %d", idx) + } +} + +var testCasesStringValueSlice = [][]*string{ + {String("a"), String("b"), nil, String("c")}, +} + +func TestStringValueSlice(t *testing.T) { + for idx, in := range testCasesStringValueSlice { + if in == nil { + continue + } + out := StringValueSlice(in) + assert.Len(t, out, len(in), "Unexpected len at idx %d", idx) + for i := range out { + if in[i] == nil { + assert.Empty(t, out[i], "Unexpected value at idx %d", idx) + } else { + assert.Equal(t, *(in[i]), out[i], "Unexpected value at idx %d", idx) + } + } + + out2 := StringSlice(out) + assert.Len(t, out2, len(in), "Unexpected len at idx %d", idx) + for i := range out2 { + if in[i] == nil { + assert.Empty(t, *(out2[i]), "Unexpected value at idx %d", idx) + } else { + assert.Equal(t, in[i], out2[i], "Unexpected value at idx %d", idx) + } + } + } +} + +var testCasesStringMap = []map[string]string{ + {"a": "1", "b": "2", "c": "3"}, +} + +func TestStringMap(t *testing.T) { + for idx, in := range testCasesStringMap { + if in == nil { + continue + } + out := StringMap(in) + assert.Len(t, out, len(in), "Unexpected len at idx %d", idx) + for i := range out { + assert.Equal(t, in[i], *(out[i]), "Unexpected value at idx %d", idx) + } + + out2 := StringValueMap(out) + assert.Len(t, out2, len(in), "Unexpected len at idx %d", idx) + assert.Equal(t, in, out2, "Unexpected value at idx %d", idx) + } +} + +var testCasesBoolSlice = [][]bool{ + {true, true, false, false}, +} + +func TestBoolSlice(t *testing.T) { + for idx, in := range testCasesBoolSlice { + if in == nil { + continue + } + out := BoolSlice(in) + assert.Len(t, out, len(in), "Unexpected len at idx %d", idx) + for i := range out { + assert.Equal(t, in[i], *(out[i]), "Unexpected value at idx %d", idx) + } + + out2 := BoolValueSlice(out) + assert.Len(t, out2, len(in), "Unexpected len at idx %d", idx) + assert.Equal(t, in, out2, "Unexpected value at idx %d", idx) + } +} + +var testCasesBoolValueSlice = [][]*bool{} + +func TestBoolValueSlice(t *testing.T) { + for idx, in := range testCasesBoolValueSlice { + if in == nil { + continue + } + out := BoolValueSlice(in) + assert.Len(t, out, len(in), "Unexpected len at idx %d", idx) + for i := range out { + if in[i] == nil { + assert.Empty(t, out[i], "Unexpected value at idx %d", idx) + } else { + assert.Equal(t, *(in[i]), out[i], "Unexpected value at idx %d", idx) + } + } + + out2 := BoolSlice(out) + assert.Len(t, out2, len(in), "Unexpected len at idx %d", idx) + for i := range out2 { + if in[i] == nil { + assert.Empty(t, *(out2[i]), "Unexpected value at idx %d", idx) + } else { + assert.Equal(t, in[i], out2[i], "Unexpected value at idx %d", idx) + } + } + } +} + +var testCasesBoolMap = []map[string]bool{ + {"a": true, "b": false, "c": true}, +} + +func TestBoolMap(t *testing.T) { + for idx, in := range testCasesBoolMap { + if in == nil { + continue + } + out := BoolMap(in) + assert.Len(t, out, len(in), "Unexpected len at idx %d", idx) + for i := range out { + assert.Equal(t, in[i], *(out[i]), "Unexpected value at idx %d", idx) + } + + out2 := BoolValueMap(out) + assert.Len(t, out2, len(in), "Unexpected len at idx %d", idx) + assert.Equal(t, in, out2, "Unexpected value at idx %d", idx) + } +} + +var testCasesIntSlice = [][]int{ + {1, 2, 3, 4}, +} + +func TestIntSlice(t *testing.T) { + for idx, in := range testCasesIntSlice { + if in == nil { + continue + } + out := IntSlice(in) + assert.Len(t, out, len(in), "Unexpected len at idx %d", idx) + for i := range out { + assert.Equal(t, in[i], *(out[i]), "Unexpected value at idx %d", idx) + } + + out2 := IntValueSlice(out) + assert.Len(t, out2, len(in), "Unexpected len at idx %d", idx) + assert.Equal(t, in, out2, "Unexpected value at idx %d", idx) + } +} + +var testCasesIntValueSlice = [][]*int{} + +func TestIntValueSlice(t *testing.T) { + for idx, in := range testCasesIntValueSlice { + if in == nil { + continue + } + out := IntValueSlice(in) + assert.Len(t, out, len(in), "Unexpected len at idx %d", idx) + for i := range out { + if in[i] == nil { + assert.Empty(t, out[i], "Unexpected value at idx %d", idx) + } else { + assert.Equal(t, *(in[i]), out[i], "Unexpected value at idx %d", idx) + } + } + + out2 := IntSlice(out) + assert.Len(t, out2, len(in), "Unexpected len at idx %d", idx) + for i := range out2 { + if in[i] == nil { + assert.Empty(t, *(out2[i]), "Unexpected value at idx %d", idx) + } else { + assert.Equal(t, in[i], out2[i], "Unexpected value at idx %d", idx) + } + } + } +} + +var testCasesIntMap = []map[string]int{ + {"a": 3, "b": 2, "c": 1}, +} + +func TestIntMap(t *testing.T) { + for idx, in := range testCasesIntMap { + if in == nil { + continue + } + out := IntMap(in) + assert.Len(t, out, len(in), "Unexpected len at idx %d", idx) + for i := range out { + assert.Equal(t, in[i], *(out[i]), "Unexpected value at idx %d", idx) + } + + out2 := IntValueMap(out) + assert.Len(t, out2, len(in), "Unexpected len at idx %d", idx) + assert.Equal(t, in, out2, "Unexpected value at idx %d", idx) + } +} + +var testCasesInt64Slice = [][]int64{ + {1, 2, 3, 4}, +} + +func TestInt64Slice(t *testing.T) { + for idx, in := range testCasesInt64Slice { + if in == nil { + continue + } + out := Int64Slice(in) + assert.Len(t, out, len(in), "Unexpected len at idx %d", idx) + for i := range out { + assert.Equal(t, in[i], *(out[i]), "Unexpected value at idx %d", idx) + } + + out2 := Int64ValueSlice(out) + assert.Len(t, out2, len(in), "Unexpected len at idx %d", idx) + assert.Equal(t, in, out2, "Unexpected value at idx %d", idx) + } +} + +var testCasesInt64ValueSlice = [][]*int64{} + +func TestInt64ValueSlice(t *testing.T) { + for idx, in := range testCasesInt64ValueSlice { + if in == nil { + continue + } + out := Int64ValueSlice(in) + assert.Len(t, out, len(in), "Unexpected len at idx %d", idx) + for i := range out { + if in[i] == nil { + assert.Empty(t, out[i], "Unexpected value at idx %d", idx) + } else { + assert.Equal(t, *(in[i]), out[i], "Unexpected value at idx %d", idx) + } + } + + out2 := Int64Slice(out) + assert.Len(t, out2, len(in), "Unexpected len at idx %d", idx) + for i := range out2 { + if in[i] == nil { + assert.Empty(t, *(out2[i]), "Unexpected value at idx %d", idx) + } else { + assert.Equal(t, in[i], out2[i], "Unexpected value at idx %d", idx) + } + } + } +} + +var testCasesInt64Map = []map[string]int64{ + {"a": 3, "b": 2, "c": 1}, +} + +func TestInt64Map(t *testing.T) { + for idx, in := range testCasesInt64Map { + if in == nil { + continue + } + out := Int64Map(in) + assert.Len(t, out, len(in), "Unexpected len at idx %d", idx) + for i := range out { + assert.Equal(t, in[i], *(out[i]), "Unexpected value at idx %d", idx) + } + + out2 := Int64ValueMap(out) + assert.Len(t, out2, len(in), "Unexpected len at idx %d", idx) + assert.Equal(t, in, out2, "Unexpected value at idx %d", idx) + } +} + +var testCasesFloat64Slice = [][]float64{ + {1, 2, 3, 4}, +} + +func TestFloat64Slice(t *testing.T) { + for idx, in := range testCasesFloat64Slice { + if in == nil { + continue + } + out := Float64Slice(in) + assert.Len(t, out, len(in), "Unexpected len at idx %d", idx) + for i := range out { + assert.Equal(t, in[i], *(out[i]), "Unexpected value at idx %d", idx) + } + + out2 := Float64ValueSlice(out) + assert.Len(t, out2, len(in), "Unexpected len at idx %d", idx) + assert.Equal(t, in, out2, "Unexpected value at idx %d", idx) + } +} + +var testCasesFloat64ValueSlice = [][]*float64{} + +func TestFloat64ValueSlice(t *testing.T) { + for idx, in := range testCasesFloat64ValueSlice { + if in == nil { + continue + } + out := Float64ValueSlice(in) + assert.Len(t, out, len(in), "Unexpected len at idx %d", idx) + for i := range out { + if in[i] == nil { + assert.Empty(t, out[i], "Unexpected value at idx %d", idx) + } else { + assert.Equal(t, *(in[i]), out[i], "Unexpected value at idx %d", idx) + } + } + + out2 := Float64Slice(out) + assert.Len(t, out2, len(in), "Unexpected len at idx %d", idx) + for i := range out2 { + if in[i] == nil { + assert.Empty(t, *(out2[i]), "Unexpected value at idx %d", idx) + } else { + assert.Equal(t, in[i], out2[i], "Unexpected value at idx %d", idx) + } + } + } +} + +var testCasesFloat64Map = []map[string]float64{ + {"a": 3, "b": 2, "c": 1}, +} + +func TestFloat64Map(t *testing.T) { + for idx, in := range testCasesFloat64Map { + if in == nil { + continue + } + out := Float64Map(in) + assert.Len(t, out, len(in), "Unexpected len at idx %d", idx) + for i := range out { + assert.Equal(t, in[i], *(out[i]), "Unexpected value at idx %d", idx) + } + + out2 := Float64ValueMap(out) + assert.Len(t, out2, len(in), "Unexpected len at idx %d", idx) + assert.Equal(t, in, out2, "Unexpected value at idx %d", idx) + } +} + +var testCasesTimeSlice = [][]time.Time{ + {time.Now(), time.Now().AddDate(100, 0, 0)}, +} + +func TestTimeSlice(t *testing.T) { + for idx, in := range testCasesTimeSlice { + if in == nil { + continue + } + out := TimeSlice(in) + assert.Len(t, out, len(in), "Unexpected len at idx %d", idx) + for i := range out { + assert.Equal(t, in[i], *(out[i]), "Unexpected value at idx %d", idx) + } + + out2 := TimeValueSlice(out) + assert.Len(t, out2, len(in), "Unexpected len at idx %d", idx) + assert.Equal(t, in, out2, "Unexpected value at idx %d", idx) + } +} + +var testCasesTimeValueSlice = [][]*time.Time{} + +func TestTimeValueSlice(t *testing.T) { + for idx, in := range testCasesTimeValueSlice { + if in == nil { + continue + } + out := TimeValueSlice(in) + assert.Len(t, out, len(in), "Unexpected len at idx %d", idx) + for i := range out { + if in[i] == nil { + assert.Empty(t, out[i], "Unexpected value at idx %d", idx) + } else { + assert.Equal(t, *(in[i]), out[i], "Unexpected value at idx %d", idx) + } + } + + out2 := TimeSlice(out) + assert.Len(t, out2, len(in), "Unexpected len at idx %d", idx) + for i := range out2 { + if in[i] == nil { + assert.Empty(t, *(out2[i]), "Unexpected value at idx %d", idx) + } else { + assert.Equal(t, in[i], out2[i], "Unexpected value at idx %d", idx) + } + } + } +} + +var testCasesTimeMap = []map[string]time.Time{ + {"a": time.Now().AddDate(-100, 0, 0), "b": time.Now()}, +} + +func TestTimeMap(t *testing.T) { + for idx, in := range testCasesTimeMap { + if in == nil { + continue + } + out := TimeMap(in) + assert.Len(t, out, len(in), "Unexpected len at idx %d", idx) + for i := range out { + assert.Equal(t, in[i], *(out[i]), "Unexpected value at idx %d", idx) + } + + out2 := TimeValueMap(out) + assert.Len(t, out2, len(in), "Unexpected len at idx %d", idx) + assert.Equal(t, in, out2, "Unexpected value at idx %d", idx) + } +} diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/corehandlers/handlers.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/corehandlers/handlers.go new file mode 100644 index 000000000000..2fcb391a2880 --- /dev/null +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/corehandlers/handlers.go @@ -0,0 +1,136 @@ +package corehandlers + +import ( + "bytes" + "fmt" + "io" + "io/ioutil" + "net/http" + "net/url" + "regexp" + "strconv" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/awserr" + "github.com/aws/aws-sdk-go/aws/request" +) + +// Interface for matching types which also have a Len method. +type lener interface { + Len() int +} + +// BuildContentLength builds the content length of a request based on the body, +// or will use the HTTPRequest.Header's "Content-Length" if defined. If unable +// to determine request body length and no "Content-Length" was specified it will panic. +var BuildContentLengthHandler = request.NamedHandler{"core.BuildContentLengthHandler", func(r *request.Request) { + if slength := r.HTTPRequest.Header.Get("Content-Length"); slength != "" { + length, _ := strconv.ParseInt(slength, 10, 64) + r.HTTPRequest.ContentLength = length + return + } + + var length int64 + switch body := r.Body.(type) { + case nil: + length = 0 + case lener: + length = int64(body.Len()) + case io.Seeker: + r.BodyStart, _ = body.Seek(0, 1) + end, _ := body.Seek(0, 2) + body.Seek(r.BodyStart, 0) // make sure to seek back to original location + length = end - r.BodyStart + default: + panic("Cannot get length of body, must provide `ContentLength`") + } + + r.HTTPRequest.ContentLength = length + r.HTTPRequest.Header.Set("Content-Length", fmt.Sprintf("%d", length)) +}} + +// UserAgentHandler is a request handler for injecting User agent into requests. +var UserAgentHandler = request.NamedHandler{"core.UserAgentHandler", func(r *request.Request) { + r.HTTPRequest.Header.Set("User-Agent", aws.SDKName+"/"+aws.SDKVersion) +}} + +var reStatusCode = regexp.MustCompile(`^(\d{3})`) + +// SendHandler is a request handler to send service request using HTTP client. +var SendHandler = request.NamedHandler{"core.SendHandler", func(r *request.Request) { + var err error + r.HTTPResponse, err = r.Service.Config.HTTPClient.Do(r.HTTPRequest) + if err != nil { + // Capture the case where url.Error is returned for error processing + // response. e.g. 301 without location header comes back as string + // error and r.HTTPResponse is nil. Other url redirect errors will + // comeback in a similar method. + if e, ok := err.(*url.Error); ok && e.Err != nil { + if s := reStatusCode.FindStringSubmatch(e.Err.Error()); s != nil { + code, _ := strconv.ParseInt(s[1], 10, 64) + r.HTTPResponse = &http.Response{ + StatusCode: int(code), + Status: http.StatusText(int(code)), + Body: ioutil.NopCloser(bytes.NewReader([]byte{})), + } + return + } + } + if r.HTTPResponse == nil { + // Add a dummy request response object to ensure the HTTPResponse + // value is consistent. + r.HTTPResponse = &http.Response{ + StatusCode: int(0), + Status: http.StatusText(int(0)), + Body: ioutil.NopCloser(bytes.NewReader([]byte{})), + } + } + // Catch all other request errors. + r.Error = awserr.New("RequestError", "send request failed", err) + r.Retryable = aws.Bool(true) // network errors are retryable + } +}} + +// ValidateResponseHandler is a request handler to validate service response. +var ValidateResponseHandler = request.NamedHandler{"core.ValidateResponseHandler", func(r *request.Request) { + if r.HTTPResponse.StatusCode == 0 || r.HTTPResponse.StatusCode >= 300 { + // this may be replaced by an UnmarshalError handler + r.Error = awserr.New("UnknownError", "unknown error", nil) + } +}} + +// AfterRetryHandler performs final checks to determine if the request should +// be retried and how long to delay. +var AfterRetryHandler = request.NamedHandler{"core.AfterRetryHandler", func(r *request.Request) { + // If one of the other handlers already set the retry state + // we don't want to override it based on the service's state + if r.Retryable == nil { + r.Retryable = aws.Bool(r.ShouldRetry(r)) + } + + if r.WillRetry() { + r.RetryDelay = r.RetryRules(r) + r.Service.Config.SleepDelay(r.RetryDelay) + + // when the expired token exception occurs the credentials + // need to be expired locally so that the next request to + // get credentials will trigger a credentials refresh. + if r.IsErrorExpired() { + r.Service.Config.Credentials.Expire() + } + + r.RetryCount++ + r.Error = nil + } +}} + +// ValidateEndpointHandler is a request handler to validate a request had the +// appropriate Region and Endpoint set. Will set r.Error if the endpoint or +// region is not valid. +var ValidateEndpointHandler = request.NamedHandler{"core.ValidateEndpointHandler", func(r *request.Request) { + if r.Service.SigningRegion == "" && aws.StringValue(r.Service.Config.Region) == "" { + r.Error = aws.ErrMissingRegion + } else if r.Service.Endpoint == "" { + r.Error = aws.ErrMissingEndpoint + } +}} diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/corehandlers/handlers_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/corehandlers/handlers_test.go new file mode 100644 index 000000000000..214adcab0884 --- /dev/null +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/corehandlers/handlers_test.go @@ -0,0 +1,107 @@ +package corehandlers_test + +import ( + "fmt" + "net/http" + "os" + "testing" + + "github.com/stretchr/testify/assert" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/awserr" + "github.com/aws/aws-sdk-go/aws/corehandlers" + "github.com/aws/aws-sdk-go/aws/credentials" + "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/aws/service" +) + +func TestValidateEndpointHandler(t *testing.T) { + os.Clearenv() + svc := service.New(aws.NewConfig().WithRegion("us-west-2")) + svc.Handlers.Clear() + svc.Handlers.Validate.PushBackNamed(corehandlers.ValidateEndpointHandler) + + req := svc.NewRequest(&request.Operation{Name: "Operation"}, nil, nil) + err := req.Build() + + assert.NoError(t, err) +} + +func TestValidateEndpointHandlerErrorRegion(t *testing.T) { + os.Clearenv() + svc := service.New(nil) + svc.Handlers.Clear() + svc.Handlers.Validate.PushBackNamed(corehandlers.ValidateEndpointHandler) + + req := svc.NewRequest(&request.Operation{Name: "Operation"}, nil, nil) + err := req.Build() + + assert.Error(t, err) + assert.Equal(t, aws.ErrMissingRegion, err) +} + +type mockCredsProvider struct { + expired bool + retrieveCalled bool +} + +func (m *mockCredsProvider) Retrieve() (credentials.Value, error) { + m.retrieveCalled = true + return credentials.Value{}, nil +} + +func (m *mockCredsProvider) IsExpired() bool { + return m.expired +} + +func TestAfterRetryRefreshCreds(t *testing.T) { + os.Clearenv() + credProvider := &mockCredsProvider{} + svc := service.New(&aws.Config{Credentials: credentials.NewCredentials(credProvider), MaxRetries: aws.Int(1)}) + + svc.Handlers.Clear() + svc.Handlers.ValidateResponse.PushBack(func(r *request.Request) { + r.Error = awserr.New("UnknownError", "", nil) + r.HTTPResponse = &http.Response{StatusCode: 400} + }) + svc.Handlers.UnmarshalError.PushBack(func(r *request.Request) { + r.Error = awserr.New("ExpiredTokenException", "", nil) + }) + svc.Handlers.AfterRetry.PushBackNamed(corehandlers.AfterRetryHandler) + + assert.True(t, svc.Config.Credentials.IsExpired(), "Expect to start out expired") + assert.False(t, credProvider.retrieveCalled) + + req := svc.NewRequest(&request.Operation{Name: "Operation"}, nil, nil) + req.Send() + + assert.True(t, svc.Config.Credentials.IsExpired()) + assert.False(t, credProvider.retrieveCalled) + + _, err := svc.Config.Credentials.Get() + assert.NoError(t, err) + assert.True(t, credProvider.retrieveCalled) +} + +type testSendHandlerTransport struct{} + +func (t *testSendHandlerTransport) RoundTrip(r *http.Request) (*http.Response, error) { + return nil, fmt.Errorf("mock error") +} + +func TestSendHandlerError(t *testing.T) { + svc := service.New(&aws.Config{ + HTTPClient: &http.Client{ + Transport: &testSendHandlerTransport{}, + }, + }) + svc.Handlers.Clear() + svc.Handlers.Send.PushBackNamed(corehandlers.SendHandler) + r := svc.NewRequest(&request.Operation{Name: "Operation"}, nil, nil) + + r.Send() + + assert.Error(t, r.Error) + assert.NotNil(t, r.HTTPResponse) +} diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/corehandlers/param_validator.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/corehandlers/param_validator.go new file mode 100644 index 000000000000..a22197734118 --- /dev/null +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/corehandlers/param_validator.go @@ -0,0 +1,144 @@ +package corehandlers + +import ( + "fmt" + "reflect" + "strconv" + "strings" + + "github.com/aws/aws-sdk-go/aws/awserr" + "github.com/aws/aws-sdk-go/aws/request" +) + +// ValidateParameters is a request handler to validate the input parameters. +// Validating parameters only has meaning if done prior to the request being sent. +var ValidateParametersHandler = request.NamedHandler{"core.ValidateParametersHandler", func(r *request.Request) { + if r.ParamsFilled() { + v := validator{errors: []string{}} + v.validateAny(reflect.ValueOf(r.Params), "") + + if count := len(v.errors); count > 0 { + format := "%d validation errors:\n- %s" + msg := fmt.Sprintf(format, count, strings.Join(v.errors, "\n- ")) + r.Error = awserr.New("InvalidParameter", msg, nil) + } + } +}} + +// A validator validates values. Collects validations errors which occurs. +type validator struct { + errors []string +} + +// validateAny will validate any struct, slice or map type. All validations +// are also performed recursively for nested types. +func (v *validator) validateAny(value reflect.Value, path string) { + value = reflect.Indirect(value) + if !value.IsValid() { + return + } + + switch value.Kind() { + case reflect.Struct: + v.validateStruct(value, path) + case reflect.Slice: + for i := 0; i < value.Len(); i++ { + v.validateAny(value.Index(i), path+fmt.Sprintf("[%d]", i)) + } + case reflect.Map: + for _, n := range value.MapKeys() { + v.validateAny(value.MapIndex(n), path+fmt.Sprintf("[%q]", n.String())) + } + } +} + +// validateStruct will validate the struct value's fields. If the structure has +// nested types those types will be validated also. +func (v *validator) validateStruct(value reflect.Value, path string) { + prefix := "." + if path == "" { + prefix = "" + } + + for i := 0; i < value.Type().NumField(); i++ { + f := value.Type().Field(i) + if strings.ToLower(f.Name[0:1]) == f.Name[0:1] { + continue + } + fvalue := value.FieldByName(f.Name) + + err := validateField(f, fvalue, validateFieldRequired, validateFieldMin) + if err != nil { + v.errors = append(v.errors, fmt.Sprintf("%s: %s", err.Error(), path+prefix+f.Name)) + continue + } + + v.validateAny(fvalue, path+prefix+f.Name) + } +} + +type validatorFunc func(f reflect.StructField, fvalue reflect.Value) error + +func validateField(f reflect.StructField, fvalue reflect.Value, funcs ...validatorFunc) error { + for _, fn := range funcs { + if err := fn(f, fvalue); err != nil { + return err + } + } + return nil +} + +// Validates that a field has a valid value provided for required fields. +func validateFieldRequired(f reflect.StructField, fvalue reflect.Value) error { + if f.Tag.Get("required") == "" { + return nil + } + + switch fvalue.Kind() { + case reflect.Ptr, reflect.Slice, reflect.Map: + if fvalue.IsNil() { + return fmt.Errorf("missing required parameter") + } + default: + if !fvalue.IsValid() { + return fmt.Errorf("missing required parameter") + } + } + return nil +} + +// Validates that if a value is provided for a field, that value must be at +// least a minimum length. +func validateFieldMin(f reflect.StructField, fvalue reflect.Value) error { + minStr := f.Tag.Get("min") + if minStr == "" { + return nil + } + min, _ := strconv.ParseInt(minStr, 10, 64) + + kind := fvalue.Kind() + if kind == reflect.Ptr { + if fvalue.IsNil() { + return nil + } + fvalue = fvalue.Elem() + } + + switch fvalue.Kind() { + case reflect.String: + if int64(fvalue.Len()) < min { + return fmt.Errorf("field too short, minimum length %d", min) + } + case reflect.Slice, reflect.Map: + if fvalue.IsNil() { + return nil + } + if int64(fvalue.Len()) < min { + return fmt.Errorf("field too short, minimum length %d", min) + } + + // TODO min can also apply to number minimum value. + + } + return nil +} diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/corehandlers/param_validator_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/corehandlers/param_validator_test.go new file mode 100644 index 000000000000..db483ba408b3 --- /dev/null +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/corehandlers/param_validator_test.go @@ -0,0 +1,134 @@ +package corehandlers_test + +import ( + "testing" + + "github.com/stretchr/testify/assert" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/awserr" + "github.com/aws/aws-sdk-go/aws/corehandlers" + "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/aws/service" + "github.com/aws/aws-sdk-go/aws/service/serviceinfo" + "github.com/stretchr/testify/require" +) + +var testSvc = func() *service.Service { + s := &service.Service{ + ServiceInfo: serviceinfo.ServiceInfo{ + Config: &aws.Config{}, + ServiceName: "mock-service", + APIVersion: "2015-01-01", + }, + } + return s +}() + +type StructShape struct { + RequiredList []*ConditionalStructShape `required:"true"` + RequiredMap map[string]*ConditionalStructShape `required:"true"` + RequiredBool *bool `required:"true"` + OptionalStruct *ConditionalStructShape + + hiddenParameter *string + + metadataStructureShape +} + +type metadataStructureShape struct { + SDKShapeTraits bool +} + +type ConditionalStructShape struct { + Name *string `required:"true"` + SDKShapeTraits bool +} + +func TestNoErrors(t *testing.T) { + input := &StructShape{ + RequiredList: []*ConditionalStructShape{}, + RequiredMap: map[string]*ConditionalStructShape{ + "key1": {Name: aws.String("Name")}, + "key2": {Name: aws.String("Name")}, + }, + RequiredBool: aws.Bool(true), + OptionalStruct: &ConditionalStructShape{Name: aws.String("Name")}, + } + + req := testSvc.NewRequest(&request.Operation{}, input, nil) + corehandlers.ValidateParametersHandler.Fn(req) + require.NoError(t, req.Error) +} + +func TestMissingRequiredParameters(t *testing.T) { + input := &StructShape{} + req := testSvc.NewRequest(&request.Operation{}, input, nil) + corehandlers.ValidateParametersHandler.Fn(req) + + require.Error(t, req.Error) + assert.Equal(t, "InvalidParameter", req.Error.(awserr.Error).Code()) + assert.Equal(t, "3 validation errors:\n- missing required parameter: RequiredList\n- missing required parameter: RequiredMap\n- missing required parameter: RequiredBool", req.Error.(awserr.Error).Message()) +} + +func TestNestedMissingRequiredParameters(t *testing.T) { + input := &StructShape{ + RequiredList: []*ConditionalStructShape{{}}, + RequiredMap: map[string]*ConditionalStructShape{ + "key1": {Name: aws.String("Name")}, + "key2": {}, + }, + RequiredBool: aws.Bool(true), + OptionalStruct: &ConditionalStructShape{}, + } + + req := testSvc.NewRequest(&request.Operation{}, input, nil) + corehandlers.ValidateParametersHandler.Fn(req) + + require.Error(t, req.Error) + assert.Equal(t, "InvalidParameter", req.Error.(awserr.Error).Code()) + assert.Equal(t, "3 validation errors:\n- missing required parameter: RequiredList[0].Name\n- missing required parameter: RequiredMap[\"key2\"].Name\n- missing required parameter: OptionalStruct.Name", req.Error.(awserr.Error).Message()) +} + +type testInput struct { + StringField string `min:"5"` + PtrStrField *string `min:"2"` + ListField []string `min:"3"` + MapField map[string]string `min:"4"` +} + +var testsFieldMin = []struct { + err awserr.Error + in testInput +}{ + { + err: awserr.New("InvalidParameter", "1 validation errors:\n- field too short, minimum length 5: StringField", nil), + in: testInput{StringField: "abcd"}, + }, + { + err: awserr.New("InvalidParameter", "2 validation errors:\n- field too short, minimum length 5: StringField\n- field too short, minimum length 3: ListField", nil), + in: testInput{StringField: "abcd", ListField: []string{"a", "b"}}, + }, + { + err: awserr.New("InvalidParameter", "3 validation errors:\n- field too short, minimum length 5: StringField\n- field too short, minimum length 3: ListField\n- field too short, minimum length 4: MapField", nil), + in: testInput{StringField: "abcd", ListField: []string{"a", "b"}, MapField: map[string]string{"a": "a", "b": "b"}}, + }, + { + err: awserr.New("InvalidParameter", "1 validation errors:\n- field too short, minimum length 2: PtrStrField", nil), + in: testInput{StringField: "abcde", PtrStrField: aws.String("v")}, + }, + { + err: nil, + in: testInput{StringField: "abcde", PtrStrField: aws.String("value"), + ListField: []string{"a", "b", "c"}, MapField: map[string]string{"a": "a", "b": "b", "c": "c", "d": "d"}}, + }, +} + +func TestValidateFieldMinParameter(t *testing.T) { + for i, c := range testsFieldMin { + req := testSvc.NewRequest(&request.Operation{}, &c.in, nil) + corehandlers.ValidateParametersHandler.Fn(req) + + require.Equal(t, c.err, req.Error, "%d case failed", i) + } +} diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/chain_provider.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/chain_provider.go index 196be7c1728b..7f509ca83ca5 100644 --- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/chain_provider.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/chain_provider.go @@ -1,13 +1,15 @@ package credentials import ( - "github.com/aws/aws-sdk-go/internal/apierr" + "github.com/aws/aws-sdk-go/aws/awserr" ) var ( // ErrNoValidProvidersFoundInChain Is returned when there are no valid // providers in the ChainProvider. - ErrNoValidProvidersFoundInChain = apierr.New("NoCredentialProviders", "no valid providers in chain", nil) + // + // @readonly + ErrNoValidProvidersFoundInChain = awserr.New("NoCredentialProviders", "no valid providers in chain", nil) ) // A ChainProvider will search for a provider which returns credentials @@ -36,7 +38,9 @@ var ( // &EnvProvider{}, // &EC2RoleProvider{}, // }) -// creds.Retrieve() +// +// // Usage of ChainCredentials with aws.Config +// svc := ec2.New(&aws.Config{Credentials: creds}) // type ChainProvider struct { Providers []Provider diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/chain_provider_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/chain_provider_test.go index 1a275fcac255..4fba22f29f44 100644 --- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/chain_provider_test.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/chain_provider_test.go @@ -3,15 +3,15 @@ package credentials import ( "testing" - "github.com/aws/aws-sdk-go/internal/apierr" + "github.com/aws/aws-sdk-go/aws/awserr" "github.com/stretchr/testify/assert" ) func TestChainProviderGet(t *testing.T) { p := &ChainProvider{ Providers: []Provider{ - &stubProvider{err: apierr.New("FirstError", "first provider error", nil)}, - &stubProvider{err: apierr.New("SecondError", "second provider error", nil)}, + &stubProvider{err: awserr.New("FirstError", "first provider error", nil)}, + &stubProvider{err: awserr.New("SecondError", "second provider error", nil)}, &stubProvider{ creds: Value{ AccessKeyID: "AKID", @@ -62,8 +62,8 @@ func TestChainProviderWithNoProvider(t *testing.T) { func TestChainProviderWithNoValidProvider(t *testing.T) { p := &ChainProvider{ Providers: []Provider{ - &stubProvider{err: apierr.New("FirstError", "first provider error", nil)}, - &stubProvider{err: apierr.New("SecondError", "second provider error", nil)}, + &stubProvider{err: awserr.New("FirstError", "first provider error", nil)}, + &stubProvider{err: awserr.New("SecondError", "second provider error", nil)}, }, } diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/credentials.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/credentials.go index 6f6ec03127e9..2834a088aab9 100644 --- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/credentials.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/credentials.go @@ -63,6 +63,7 @@ import ( // svc := s3.New(&aws.Config{Credentials: AnonymousCredentials}) // // Access public S3 buckets. // +// @readonly var AnonymousCredentials = NewStaticCredentials("", "", "") // A Value is the AWS credentials value for individual credential fields. @@ -93,6 +94,50 @@ type Provider interface { IsExpired() bool } +// A Expiry provides shared expiration logic to be used by credentials +// providers to implement expiry functionality. +// +// The best method to use this struct is as an anonymous field within the +// provider's struct. +// +// Example: +// type EC2RoleProvider struct { +// Expiry +// ... +// } +type Expiry struct { + // The date/time when to expire on + expiration time.Time + + // If set will be used by IsExpired to determine the current time. + // Defaults to time.Now if CurrentTime is not set. Available for testing + // to be able to mock out the current time. + CurrentTime func() time.Time +} + +// SetExpiration sets the expiration IsExpired will check when called. +// +// If window is greater than 0 the expiration time will be reduced by the +// window value. +// +// Using a window is helpful to trigger credentials to expire sooner than +// the expiration time given to ensure no requests are made with expired +// tokens. +func (e *Expiry) SetExpiration(expiration time.Time, window time.Duration) { + e.expiration = expiration + if window > 0 { + e.expiration = e.expiration.Add(-window) + } +} + +// IsExpired returns if the credentials are expired. +func (e *Expiry) IsExpired() bool { + if e.CurrentTime == nil { + e.CurrentTime = time.Now + } + return e.expiration.Before(e.CurrentTime()) +} + // A Credentials provides synchronous safe retrieval of AWS credentials Value. // Credentials will cache the credentials value until they expire. Once the value // expires the next Get will attempt to retrieve valid credentials. @@ -173,6 +218,3 @@ func (c *Credentials) IsExpired() bool { func (c *Credentials) isExpired() bool { return c.forceRefresh || c.provider.IsExpired() } - -// Provide a stub-able time.Now for unit tests so expiry can be tested. -var currentTime = time.Now diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/credentials_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/credentials_test.go index 779bb0da4a80..99c2b47742e0 100644 --- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/credentials_test.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/credentials_test.go @@ -4,7 +4,6 @@ import ( "testing" "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/internal/apierr" "github.com/stretchr/testify/assert" ) @@ -40,7 +39,7 @@ func TestCredentialsGet(t *testing.T) { } func TestCredentialsGetWithError(t *testing.T) { - c := NewCredentials(&stubProvider{err: apierr.New("provider error", "", nil), expired: true}) + c := NewCredentials(&stubProvider{err: awserr.New("provider error", "", nil), expired: true}) _, err := c.Get() assert.Equal(t, "provider error", err.(awserr.Error).Code(), "Expected provider error") diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/ec2_role_provider.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/ec2_role_provider.go deleted file mode 100644 index ed0c8ba9cd46..000000000000 --- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/ec2_role_provider.go +++ /dev/null @@ -1,173 +0,0 @@ -package credentials - -import ( - "bufio" - "encoding/json" - "fmt" - "net/http" - "time" - - "github.com/aws/aws-sdk-go/internal/apierr" -) - -const metadataCredentialsEndpoint = "http://169.254.169.254/latest/meta-data/iam/security-credentials/" - -// A EC2RoleProvider retrieves credentials from the EC2 service, and keeps track if -// those credentials are expired. -// -// Example how to configure the EC2RoleProvider with custom http Client, Endpoint -// or ExpiryWindow -// -// p := &credentials.EC2RoleProvider{ -// // Pass in a custom timeout to be used when requesting -// // IAM EC2 Role credentials. -// Client: &http.Client{ -// Timeout: 10 * time.Second, -// }, -// // Use default EC2 Role metadata endpoint, Alternate endpoints can be -// // specified setting Endpoint to something else. -// Endpoint: "", -// // Do not use early expiry of credentials. If a non zero value is -// // specified the credentials will be expired early -// ExpiryWindow: 0, -// } -// -type EC2RoleProvider struct { - // Endpoint must be fully quantified URL - Endpoint string - - // HTTP client to use when connecting to EC2 service - Client *http.Client - - // 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 - - // The date/time at which the credentials expire. - expiresOn time.Time -} - -// NewEC2RoleCredentials returns a pointer to a new Credentials object -// wrapping the EC2RoleProvider. -// -// Takes a custom http.Client which can be configured for custom handling of -// things such as timeout. -// -// Endpoint is the URL that the EC2RoleProvider will connect to when retrieving -// role and credentials. -// -// Window is the expiry window that will be subtracted from the expiry returned -// by the role credential request. This is done so that the credentials will -// expire sooner than their actual lifespan. -func NewEC2RoleCredentials(client *http.Client, endpoint string, window time.Duration) *Credentials { - return NewCredentials(&EC2RoleProvider{ - Endpoint: endpoint, - Client: client, - ExpiryWindow: window, - }) -} - -// Retrieve retrieves credentials from the EC2 service. -// Error will be returned if the request fails, or unable to extract -// the desired credentials. -func (m *EC2RoleProvider) Retrieve() (Value, error) { - if m.Client == nil { - m.Client = http.DefaultClient - } - if m.Endpoint == "" { - m.Endpoint = metadataCredentialsEndpoint - } - - credsList, err := requestCredList(m.Client, m.Endpoint) - if err != nil { - return Value{}, err - } - - if len(credsList) == 0 { - return Value{}, apierr.New("EmptyEC2RoleList", "empty EC2 Role list", nil) - } - credsName := credsList[0] - - roleCreds, err := requestCred(m.Client, m.Endpoint, credsName) - if err != nil { - return Value{}, err - } - - m.expiresOn = roleCreds.Expiration - if m.ExpiryWindow > 0 { - // Offset based on expiry window if set. - m.expiresOn = m.expiresOn.Add(-m.ExpiryWindow) - } - - return Value{ - AccessKeyID: roleCreds.AccessKeyID, - SecretAccessKey: roleCreds.SecretAccessKey, - SessionToken: roleCreds.Token, - }, nil -} - -// IsExpired returns if the credentials are expired. -func (m *EC2RoleProvider) IsExpired() bool { - return m.expiresOn.Before(currentTime()) -} - -// A ec2RoleCredRespBody provides the shape for deserializing credential -// request responses. -type ec2RoleCredRespBody struct { - Expiration time.Time - AccessKeyID string - SecretAccessKey string - Token string -} - -// requestCredList requests a list of credentials from the EC2 service. -// If there are no credentials, or there is an error making or receiving the request -func requestCredList(client *http.Client, endpoint string) ([]string, error) { - resp, err := client.Get(endpoint) - if err != nil { - return nil, apierr.New("ListEC2Role", "failed to list EC2 Roles", err) - } - defer resp.Body.Close() - - credsList := []string{} - s := bufio.NewScanner(resp.Body) - for s.Scan() { - credsList = append(credsList, s.Text()) - } - - if err := s.Err(); err != nil { - return nil, apierr.New("ReadEC2Role", "failed to read list of EC2 Roles", err) - } - - return credsList, nil -} - -// requestCred requests the credentials for a specific credentials from the EC2 service. -// -// If the credentials cannot be found, or there is an error reading the response -// and error will be returned. -func requestCred(client *http.Client, endpoint, credsName string) (*ec2RoleCredRespBody, error) { - resp, err := client.Get(endpoint + credsName) - if err != nil { - return nil, apierr.New("GetEC2RoleCredentials", - fmt.Sprintf("failed to get %s EC2 Role credentials", credsName), - err) - } - defer resp.Body.Close() - - respCreds := &ec2RoleCredRespBody{} - if err := json.NewDecoder(resp.Body).Decode(respCreds); err != nil { - return nil, apierr.New("DecodeEC2RoleCredentials", - fmt.Sprintf("failed to decode %s EC2 Role credentials", credsName), - err) - } - - return respCreds, nil -} diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/ec2_role_provider_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/ec2_role_provider_test.go deleted file mode 100644 index 5232a1dcafda..000000000000 --- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/ec2_role_provider_test.go +++ /dev/null @@ -1,114 +0,0 @@ -package credentials - -import ( - "fmt" - "github.com/stretchr/testify/assert" - "net/http" - "net/http/httptest" - "testing" - "time" -) - -func initTestServer(expireOn string) *httptest.Server { - server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - if r.RequestURI == "/" { - fmt.Fprintln(w, "/creds") - } else { - fmt.Fprintf(w, `{ - "AccessKeyId" : "accessKey", - "SecretAccessKey" : "secret", - "Token" : "token", - "Expiration" : "%s" -}`, expireOn) - } - })) - - return server -} - -func TestEC2RoleProvider(t *testing.T) { - server := initTestServer("2014-12-16T01:51:37Z") - defer server.Close() - - p := &EC2RoleProvider{Client: http.DefaultClient, Endpoint: server.URL} - - creds, err := p.Retrieve() - assert.Nil(t, err, "Expect no error") - - assert.Equal(t, "accessKey", creds.AccessKeyID, "Expect access key ID to match") - assert.Equal(t, "secret", creds.SecretAccessKey, "Expect secret access key to match") - assert.Equal(t, "token", creds.SessionToken, "Expect session token to match") -} - -func TestEC2RoleProviderIsExpired(t *testing.T) { - server := initTestServer("2014-12-16T01:51:37Z") - defer server.Close() - - p := &EC2RoleProvider{Client: http.DefaultClient, Endpoint: server.URL} - defer func() { - currentTime = time.Now - }() - currentTime = func() time.Time { - return time.Date(2014, 12, 15, 21, 26, 0, 0, time.UTC) - } - - assert.True(t, p.IsExpired(), "Expect creds to be expired before retrieve.") - - _, err := p.Retrieve() - assert.Nil(t, err, "Expect no error") - - assert.False(t, p.IsExpired(), "Expect creds to not be expired after retrieve.") - - currentTime = func() time.Time { - return time.Date(3014, 12, 15, 21, 26, 0, 0, time.UTC) - } - - assert.True(t, p.IsExpired(), "Expect creds to be expired.") -} - -func TestEC2RoleProviderExpiryWindowIsExpired(t *testing.T) { - server := initTestServer("2014-12-16T01:51:37Z") - defer server.Close() - - p := &EC2RoleProvider{Client: http.DefaultClient, Endpoint: server.URL, ExpiryWindow: time.Hour * 1} - defer func() { - currentTime = time.Now - }() - currentTime = func() time.Time { - return time.Date(2014, 12, 15, 0, 51, 37, 0, time.UTC) - } - - assert.True(t, p.IsExpired(), "Expect creds to be expired before retrieve.") - - _, err := p.Retrieve() - assert.Nil(t, err, "Expect no error") - - assert.False(t, p.IsExpired(), "Expect creds to not be expired after retrieve.") - - currentTime = func() time.Time { - return time.Date(2014, 12, 16, 0, 55, 37, 0, time.UTC) - } - - assert.True(t, p.IsExpired(), "Expect creds to be expired.") -} - -func BenchmarkEC2RoleProvider(b *testing.B) { - server := initTestServer("2014-12-16T01:51:37Z") - defer server.Close() - - p := &EC2RoleProvider{Client: http.DefaultClient, Endpoint: server.URL} - _, err := p.Retrieve() - if err != nil { - b.Fatal(err) - } - - b.ResetTimer() - b.RunParallel(func(pb *testing.PB) { - for pb.Next() { - _, err := p.Retrieve() - if err != nil { - b.Fatal(err) - } - } - }) -} diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds/ec2_role_provider.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds/ec2_role_provider.go new file mode 100644 index 000000000000..946a117206ee --- /dev/null +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds/ec2_role_provider.go @@ -0,0 +1,168 @@ +package ec2rolecreds + +import ( + "bufio" + "encoding/json" + "fmt" + "path" + "strings" + "time" + + "github.com/aws/aws-sdk-go/aws/awserr" + "github.com/aws/aws-sdk-go/aws/credentials" + "github.com/aws/aws-sdk-go/aws/ec2metadata" +) + +// A EC2RoleProvider retrieves credentials from the EC2 service, and keeps track if +// those credentials are expired. +// +// Example how to configure the EC2RoleProvider with custom http Client, Endpoint +// or ExpiryWindow +// +// p := &ec2rolecreds.EC2RoleProvider{ +// // Pass in a custom timeout to be used when requesting +// // IAM EC2 Role credentials. +// Client: &http.Client{ +// Timeout: 10 * time.Second, +// }, +// // Use default EC2 Role metadata endpoint, Alternate endpoints can be +// // specified setting Endpoint to something else. +// Endpoint: "", +// // Do not use early expiry of credentials. If a non zero value is +// // specified the credentials will be expired early +// ExpiryWindow: 0, +// } +type EC2RoleProvider struct { + credentials.Expiry + + // EC2Metadata client to use when connecting to EC2 metadata service + Client *ec2metadata.Client + + // 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 EC2RoleProvider. +// +// Takes a custom http.Client which can be configured for custom handling of +// things such as timeout. +// +// Endpoint is the URL that the EC2RoleProvider will connect to when retrieving +// role and credentials. +// +// Window is the expiry window that will be subtracted from the expiry returned +// by the role credential request. This is done so that the credentials will +// expire sooner than their actual lifespan. +func NewCredentials(client *ec2metadata.Client, window time.Duration) *credentials.Credentials { + return credentials.NewCredentials(&EC2RoleProvider{ + Client: client, + ExpiryWindow: window, + }) +} + +// Retrieve retrieves credentials from the EC2 service. +// Error will be returned if the request fails, or unable to extract +// the desired credentials. +func (m *EC2RoleProvider) Retrieve() (credentials.Value, error) { + if m.Client == nil { + m.Client = ec2metadata.New(nil) + } + + credsList, err := requestCredList(m.Client) + if err != nil { + return credentials.Value{}, err + } + + if len(credsList) == 0 { + return credentials.Value{}, awserr.New("EmptyEC2RoleList", "empty EC2 Role list", nil) + } + credsName := credsList[0] + + roleCreds, err := requestCred(m.Client, credsName) + if err != nil { + return credentials.Value{}, err + } + + m.SetExpiration(roleCreds.Expiration, m.ExpiryWindow) + + return credentials.Value{ + AccessKeyID: roleCreds.AccessKeyID, + SecretAccessKey: roleCreds.SecretAccessKey, + SessionToken: roleCreds.Token, + }, nil +} + +// A ec2RoleCredRespBody provides the shape for deserializing credential +// request responses. +type ec2RoleCredRespBody struct { + // Success State + Expiration time.Time + AccessKeyID string + SecretAccessKey string + Token string + + // Error state + Code string + Message string +} + +const iamSecurityCredsPath = "/iam/security-credentials" + +// requestCredList requests a list of credentials from the EC2 service. +// If there are no credentials, or there is an error making or receiving the request +func requestCredList(client *ec2metadata.Client) ([]string, error) { + resp, err := client.GetMetadata(iamSecurityCredsPath) + if err != nil { + return nil, awserr.New("EC2RoleRequestError", "failed to list EC2 Roles", err) + } + + credsList := []string{} + s := bufio.NewScanner(strings.NewReader(resp)) + for s.Scan() { + credsList = append(credsList, s.Text()) + } + + if err := s.Err(); err != nil { + return nil, awserr.New("SerializationError", "failed to read list of EC2 Roles", err) + } + + return credsList, nil +} + +// requestCred requests the credentials for a specific credentials from the EC2 service. +// +// If the credentials cannot be found, or there is an error reading the response +// and error will be returned. +func requestCred(client *ec2metadata.Client, credsName string) (ec2RoleCredRespBody, error) { + resp, err := client.GetMetadata(path.Join(iamSecurityCredsPath, credsName)) + if err != nil { + return ec2RoleCredRespBody{}, + awserr.New("EC2RoleRequestError", + fmt.Sprintf("failed to get %s EC2 Role credentials", credsName), + err) + } + + respCreds := ec2RoleCredRespBody{} + if err := json.NewDecoder(strings.NewReader(resp)).Decode(&respCreds); err != nil { + return ec2RoleCredRespBody{}, + awserr.New("SerializationError", + fmt.Sprintf("failed to decode %s EC2 Role credentials", credsName), + err) + } + + if respCreds.Code != "Success" { + // If an error code was returned something failed requesting the role. + return ec2RoleCredRespBody{}, awserr.New(respCreds.Code, respCreds.Message, nil) + } + + return respCreds, nil +} diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds/ec2_role_provider_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds/ec2_role_provider_test.go new file mode 100644 index 000000000000..cd0cbc97e06c --- /dev/null +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds/ec2_role_provider_test.go @@ -0,0 +1,161 @@ +package ec2rolecreds_test + +import ( + "fmt" + "net/http" + "net/http/httptest" + "testing" + "time" + + "github.com/stretchr/testify/assert" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/awserr" + "github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds" + "github.com/aws/aws-sdk-go/aws/ec2metadata" +) + +const credsRespTmpl = `{ + "Code": "Success", + "Type": "AWS-HMAC", + "AccessKeyId" : "accessKey", + "SecretAccessKey" : "secret", + "Token" : "token", + "Expiration" : "%s", + "LastUpdated" : "2009-11-23T0:00:00Z" +}` + +const credsFailRespTmpl = `{ + "Code": "ErrorCode", + "Message": "ErrorMsg", + "LastUpdated": "2009-11-23T0:00:00Z" +}` + +func initTestServer(expireOn string, failAssume bool) *httptest.Server { + server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + if r.URL.Path == "/latest/meta-data/iam/security-credentials" { + fmt.Fprintln(w, "RoleName") + } else if r.URL.Path == "/latest/meta-data/iam/security-credentials/RoleName" { + if failAssume { + fmt.Fprintf(w, credsFailRespTmpl) + } else { + fmt.Fprintf(w, credsRespTmpl, expireOn) + } + } else { + http.Error(w, "bad request", http.StatusBadRequest) + } + })) + + return server +} + +func TestEC2RoleProvider(t *testing.T) { + server := initTestServer("2014-12-16T01:51:37Z", false) + defer server.Close() + + p := &ec2rolecreds.EC2RoleProvider{ + Client: ec2metadata.New(&ec2metadata.Config{Endpoint: aws.String(server.URL + "/latest")}), + } + + creds, err := p.Retrieve() + assert.Nil(t, err, "Expect no error") + + assert.Equal(t, "accessKey", creds.AccessKeyID, "Expect access key ID to match") + assert.Equal(t, "secret", creds.SecretAccessKey, "Expect secret access key to match") + assert.Equal(t, "token", creds.SessionToken, "Expect session token to match") +} + +func TestEC2RoleProviderFailAssume(t *testing.T) { + server := initTestServer("2014-12-16T01:51:37Z", true) + defer server.Close() + + p := &ec2rolecreds.EC2RoleProvider{ + Client: ec2metadata.New(&ec2metadata.Config{Endpoint: aws.String(server.URL + "/latest")}), + } + + creds, err := p.Retrieve() + assert.Error(t, err, "Expect error") + + e := err.(awserr.Error) + assert.Equal(t, "ErrorCode", e.Code()) + assert.Equal(t, "ErrorMsg", e.Message()) + assert.Nil(t, e.OrigErr()) + + assert.Equal(t, "", creds.AccessKeyID, "Expect access key ID to match") + assert.Equal(t, "", creds.SecretAccessKey, "Expect secret access key to match") + assert.Equal(t, "", creds.SessionToken, "Expect session token to match") +} + +func TestEC2RoleProviderIsExpired(t *testing.T) { + server := initTestServer("2014-12-16T01:51:37Z", false) + defer server.Close() + + p := &ec2rolecreds.EC2RoleProvider{ + Client: ec2metadata.New(&ec2metadata.Config{Endpoint: aws.String(server.URL + "/latest")}), + } + p.CurrentTime = func() time.Time { + return time.Date(2014, 12, 15, 21, 26, 0, 0, time.UTC) + } + + assert.True(t, p.IsExpired(), "Expect creds to be expired before retrieve.") + + _, err := p.Retrieve() + assert.Nil(t, err, "Expect no error") + + assert.False(t, p.IsExpired(), "Expect creds to not be expired after retrieve.") + + p.CurrentTime = func() time.Time { + return time.Date(3014, 12, 15, 21, 26, 0, 0, time.UTC) + } + + assert.True(t, p.IsExpired(), "Expect creds to be expired.") +} + +func TestEC2RoleProviderExpiryWindowIsExpired(t *testing.T) { + server := initTestServer("2014-12-16T01:51:37Z", false) + defer server.Close() + + p := &ec2rolecreds.EC2RoleProvider{ + Client: ec2metadata.New(&ec2metadata.Config{Endpoint: aws.String(server.URL + "/latest")}), + ExpiryWindow: time.Hour * 1, + } + p.CurrentTime = func() time.Time { + return time.Date(2014, 12, 15, 0, 51, 37, 0, time.UTC) + } + + assert.True(t, p.IsExpired(), "Expect creds to be expired before retrieve.") + + _, err := p.Retrieve() + assert.Nil(t, err, "Expect no error") + + assert.False(t, p.IsExpired(), "Expect creds to not be expired after retrieve.") + + p.CurrentTime = func() time.Time { + return time.Date(2014, 12, 16, 0, 55, 37, 0, time.UTC) + } + + assert.True(t, p.IsExpired(), "Expect creds to be expired.") +} + +func BenchmarkEC2RoleProvider(b *testing.B) { + server := initTestServer("2014-12-16T01:51:37Z", false) + defer server.Close() + + p := &ec2rolecreds.EC2RoleProvider{ + Client: ec2metadata.New(&ec2metadata.Config{Endpoint: aws.String(server.URL + "/latest")}), + } + _, err := p.Retrieve() + if err != nil { + b.Fatal(err) + } + + b.ResetTimer() + b.RunParallel(func(pb *testing.PB) { + for pb.Next() { + _, err := p.Retrieve() + if err != nil { + b.Fatal(err) + } + } + }) +} diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/env_provider.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/env_provider.go index e9c575292ede..043e861d6f2c 100644 --- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/env_provider.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/env_provider.go @@ -3,24 +3,30 @@ package credentials import ( "os" - "github.com/aws/aws-sdk-go/internal/apierr" + "github.com/aws/aws-sdk-go/aws/awserr" ) var ( // ErrAccessKeyIDNotFound is returned when the AWS Access Key ID can't be // found in the process's environment. - ErrAccessKeyIDNotFound = apierr.New("EnvAccessKeyNotFound", "AWS_ACCESS_KEY_ID or AWS_ACCESS_KEY not found in environment", nil) + // + // @readonly + ErrAccessKeyIDNotFound = awserr.New("EnvAccessKeyNotFound", "AWS_ACCESS_KEY_ID or AWS_ACCESS_KEY not found in environment", nil) + // ErrSecretAccessKeyNotFound is returned when the AWS Secret Access Key // can't be found in the process's environment. - ErrSecretAccessKeyNotFound = apierr.New("EnvSecretNotFound", "AWS_SECRET_ACCESS_KEY or AWS_SECRET_KEY not found in environment", nil) + // + // @readonly + ErrSecretAccessKeyNotFound = awserr.New("EnvSecretNotFound", "AWS_SECRET_ACCESS_KEY or AWS_SECRET_KEY not found in environment", nil) ) // A EnvProvider retrieves credentials from the environment variables of the // running process. Environment credentials never expire. // // Environment variables used: -// - Access Key ID: AWS_ACCESS_KEY_ID or AWS_ACCESS_KEY -// - Secret Access Key: AWS_SECRET_ACCESS_KEY or AWS_SECRET_KEY +// +// * Access Key ID: AWS_ACCESS_KEY_ID or AWS_ACCESS_KEY +// * Secret Access Key: AWS_SECRET_ACCESS_KEY or AWS_SECRET_KEY type EnvProvider struct { retrieved bool } diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/shared_credentials_provider.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/shared_credentials_provider.go index d61b140be467..fac6d78c41e5 100644 --- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/shared_credentials_provider.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/shared_credentials_provider.go @@ -7,12 +7,14 @@ import ( "github.com/vaughan0/go-ini" - "github.com/aws/aws-sdk-go/internal/apierr" + "github.com/aws/aws-sdk-go/aws/awserr" ) var ( // ErrSharedCredentialsHomeNotFound is emitted when the user directory cannot be found. - ErrSharedCredentialsHomeNotFound = apierr.New("UserHomeNotFound", "user home directory not found.", nil) + // + // @readonly + ErrSharedCredentialsHomeNotFound = awserr.New("UserHomeNotFound", "user home directory not found.", nil) ) // A SharedCredentialsProvider retrieves credentials from the current user's home @@ -20,8 +22,12 @@ var ( // // Profile ini file example: $HOME/.aws/credentials type SharedCredentialsProvider struct { - // Path to the shared credentials file. If empty will default to current user's - // home directory. + // Path to the shared credentials file. + // + // If empty will look for "AWS_SHARED_CREDENTIALS_FILE" env variable. If the + // env value is empty will default to current user's home directory. + // Linux/OSX: "$HOME/.aws/credentials" + // Windows: "%USERPROFILE%\.aws\credentials" Filename string // AWS Profile to extract credentials from the shared credentials file. If empty @@ -72,20 +78,20 @@ func (p *SharedCredentialsProvider) IsExpired() bool { func loadProfile(filename, profile string) (Value, error) { config, err := ini.LoadFile(filename) if err != nil { - return Value{}, apierr.New("SharedCredsLoad", "failed to load shared credentials file", err) + return Value{}, awserr.New("SharedCredsLoad", "failed to load shared credentials file", err) } iniProfile := config.Section(profile) id, ok := iniProfile["aws_access_key_id"] if !ok { - return Value{}, apierr.New("SharedCredsAccessKey", + return Value{}, awserr.New("SharedCredsAccessKey", fmt.Sprintf("shared credentials %s in %s did not contain aws_access_key_id", profile, filename), nil) } secret, ok := iniProfile["aws_secret_access_key"] if !ok { - return Value{}, apierr.New("SharedCredsSecret", + return Value{}, awserr.New("SharedCredsSecret", fmt.Sprintf("shared credentials %s in %s did not contain aws_secret_access_key", profile, filename), nil) } @@ -104,6 +110,10 @@ func loadProfile(filename, profile string) (Value, error) { // Will return an error if the user's home directory path cannot be found. func (p *SharedCredentialsProvider) filename() (string, error) { if p.Filename == "" { + if p.Filename = os.Getenv("AWS_SHARED_CREDENTIALS_FILE"); p.Filename != "" { + return p.Filename, nil + } + homeDir := os.Getenv("HOME") // *nix if homeDir == "" { // Windows homeDir = os.Getenv("USERPROFILE") diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/shared_credentials_provider_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/shared_credentials_provider_test.go index 3621d56eddca..1d9983f2ce10 100644 --- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/shared_credentials_provider_test.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/shared_credentials_provider_test.go @@ -31,6 +31,19 @@ func TestSharedCredentialsProviderIsExpired(t *testing.T) { assert.False(t, p.IsExpired(), "Expect creds to not be expired after retrieve") } +func TestSharedCredentialsProviderWithAWS_SHARED_CREDENTIALS_FILE(t *testing.T) { + os.Clearenv() + os.Setenv("AWS_SHARED_CREDENTIALS_FILE", "example.ini") + p := SharedCredentialsProvider{} + creds, err := p.Retrieve() + + assert.Nil(t, err, "Expect no error") + + assert.Equal(t, "accessKey", creds.AccessKeyID, "Expect access key ID to match") + assert.Equal(t, "secret", creds.SecretAccessKey, "Expect secret access key to match") + assert.Equal(t, "token", creds.SessionToken, "Expect session token to match") +} + func TestSharedCredentialsProviderWithAWS_PROFILE(t *testing.T) { os.Clearenv() os.Setenv("AWS_PROFILE", "no_token") @@ -66,12 +79,10 @@ func BenchmarkSharedCredentialsProvider(b *testing.B) { } b.ResetTimer() - b.RunParallel(func(pb *testing.PB) { - for pb.Next() { - _, err := p.Retrieve() - if err != nil { - b.Fatal(err) - } + for i := 0; i < b.N; i++ { + _, err := p.Retrieve() + if err != nil { + b.Fatal(err) } - }) + } } diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/static_provider.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/static_provider.go index 4466cd263ccc..530a9ac2f363 100644 --- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/static_provider.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/static_provider.go @@ -1,12 +1,14 @@ package credentials import ( - "github.com/aws/aws-sdk-go/internal/apierr" + "github.com/aws/aws-sdk-go/aws/awserr" ) var ( // ErrStaticCredentialsEmpty is emitted when static credentials are empty. - ErrStaticCredentialsEmpty = apierr.New("EmptyStaticCreds", "static credentials are empty", nil) + // + // @readonly + ErrStaticCredentialsEmpty = awserr.New("EmptyStaticCreds", "static credentials are empty", nil) ) // A StaticProvider is a set of credentials which are set pragmatically, diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/stscreds/assume_role_provider.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/stscreds/assume_role_provider.go new file mode 100644 index 000000000000..7a4459f80466 --- /dev/null +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/stscreds/assume_role_provider.go @@ -0,0 +1,125 @@ +// 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/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) +} + +// 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. +// +// Example how to configure a service to use this provider: +// +// config := &aws.Config{ +// Credentials: stscreds.NewCredentials(nil, "arn-of-the-role-to-assume", 10*time.Second), +// }) +// // Use config for creating your AWS service. +// +// Example how to obtain customised credentials: +// +// provider := &stscreds.Provider{ +// // Extend the duration to 1 hour. +// Duration: time.Hour, +// // Custom role name. +// RoleSessionName: "custom-session-name", +// } +// creds := credentials.NewCredentials(provider) +// +type AssumeRoleProvider struct { + credentials.Expiry + + // Custom STS client. If not set the default STS client will be used. + 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. +// +// The sts and roleARN parameters are used for building the "AssumeRole" call. +// Pass nil as sts to use the default client. +// +// Window is the expiry window that will be subtracted from the expiry returned +// by the role credential request. This is done so that the credentials will +// expire sooner than their actual lifespan. +func NewCredentials(client AssumeRoler, roleARN string, window time.Duration) *credentials.Credentials { + return credentials.NewCredentials(&AssumeRoleProvider{ + Client: client, + RoleARN: roleARN, + ExpiryWindow: window, + }) +} + +// 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.Client == nil { + p.Client = sts.New(nil) + } + 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 = 15 * time.Minute + } + + 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/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/stscreds/assume_role_provider_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/stscreds/assume_role_provider_test.go new file mode 100644 index 000000000000..f5b97c0053b9 --- /dev/null +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/stscreds/assume_role_provider_test.go @@ -0,0 +1,59 @@ +package stscreds + +import ( + "testing" + "time" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/sts" + "github.com/stretchr/testify/assert" +) + +type stubSTS struct { +} + +func (s *stubSTS) AssumeRole(input *sts.AssumeRoleInput) (*sts.AssumeRoleOutput, error) { + expiry := time.Now().Add(60 * time.Minute) + return &sts.AssumeRoleOutput{ + Credentials: &sts.Credentials{ + // Just reflect the role arn to the provider. + AccessKeyId: input.RoleArn, + SecretAccessKey: aws.String("assumedSecretAccessKey"), + SessionToken: aws.String("assumedSessionToken"), + Expiration: &expiry, + }, + }, nil +} + +func TestAssumeRoleProvider(t *testing.T) { + stub := &stubSTS{} + p := &AssumeRoleProvider{ + Client: stub, + RoleARN: "roleARN", + } + + creds, err := p.Retrieve() + assert.Nil(t, err, "Expect no error") + + assert.Equal(t, "roleARN", creds.AccessKeyID, "Expect access key ID to be reflected role ARN") + assert.Equal(t, "assumedSecretAccessKey", creds.SecretAccessKey, "Expect secret access key to match") + assert.Equal(t, "assumedSessionToken", creds.SessionToken, "Expect session token to match") +} + +func BenchmarkAssumeRoleProvider(b *testing.B) { + stub := &stubSTS{} + p := &AssumeRoleProvider{ + Client: stub, + RoleARN: "roleARN", + } + + b.ResetTimer() + b.RunParallel(func(pb *testing.PB) { + for pb.Next() { + _, err := p.Retrieve() + if err != nil { + b.Fatal(err) + } + } + }) +} diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/defaults/defaults.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/defaults/defaults.go new file mode 100644 index 000000000000..2f161b57f1d5 --- /dev/null +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/defaults/defaults.go @@ -0,0 +1,39 @@ +package defaults + +import ( + "net/http" + "os" + "time" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/credentials" + "github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds" +) + +// DefaultChainCredentials is a Credentials which will find the first available +// credentials Value from the list of Providers. +// +// This should be used in the default case. Once the type of credentials are +// known switching to the specific Credentials will be more efficient. +var DefaultChainCredentials = credentials.NewChainCredentials( + []credentials.Provider{ + &credentials.EnvProvider{}, + &credentials.SharedCredentialsProvider{Filename: "", Profile: ""}, + &ec2rolecreds.EC2RoleProvider{ExpiryWindow: 5 * time.Minute}, + }) + +// DefaultConfig is the default all service configuration will be based off of. +// By default, all clients use this structure for initialization options unless +// a custom configuration object is passed in. +// +// You may modify this global structure to change all default configuration +// in the SDK. Note that configuration options are copied by value, so any +// modifications must happen before constructing a client. +var DefaultConfig = aws.NewConfig(). + WithCredentials(DefaultChainCredentials). + WithRegion(os.Getenv("AWS_REGION")). + WithHTTPClient(http.DefaultClient). + WithMaxRetries(aws.DefaultRetries). + WithLogger(aws.NewDefaultLogger()). + WithLogLevel(aws.LogOff). + WithSleepDelay(time.Sleep) diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/ec2metadata/api.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/ec2metadata/api.go new file mode 100644 index 000000000000..9d784b6e6abe --- /dev/null +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/ec2metadata/api.go @@ -0,0 +1,43 @@ +package ec2metadata + +import ( + "path" + + "github.com/aws/aws-sdk-go/aws/request" +) + +// GetMetadata uses the path provided to request +func (c *Client) GetMetadata(p string) (string, error) { + op := &request.Operation{ + Name: "GetMetadata", + HTTPMethod: "GET", + HTTPPath: path.Join("/", "meta-data", p), + } + + output := &metadataOutput{} + req := request.New(c.Service.ServiceInfo, c.Service.Handlers, c.Service.Retryer, op, nil, output) + + return output.Content, req.Send() +} + +// Region returns the region the instance is running in. +func (c *Client) Region() (string, error) { + resp, err := c.GetMetadata("placement/availability-zone") + if err != nil { + return "", err + } + + // returns region without the suffix. Eg: us-west-2a becomes us-west-2 + return resp[:len(resp)-1], nil +} + +// Available returns if the application has access to the EC2 Metadata service. +// Can be used to determine if application is running within an EC2 Instance and +// the metadata service is available. +func (c *Client) Available() bool { + if _, err := c.GetMetadata("instance-id"); err != nil { + return false + } + + return true +} diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/ec2metadata/api_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/ec2metadata/api_test.go new file mode 100644 index 000000000000..61ab62a5305d --- /dev/null +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/ec2metadata/api_test.go @@ -0,0 +1,100 @@ +package ec2metadata_test + +import ( + "bytes" + "io/ioutil" + "net/http" + "net/http/httptest" + "path" + "testing" + + "github.com/stretchr/testify/assert" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/awserr" + "github.com/aws/aws-sdk-go/aws/ec2metadata" + "github.com/aws/aws-sdk-go/aws/request" +) + +func initTestServer(path string, resp string) *httptest.Server { + return httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + if r.RequestURI != path { + http.Error(w, "not found", http.StatusNotFound) + return + } + + w.Write([]byte(resp)) + })) +} + +func TestEndpoint(t *testing.T) { + c := ec2metadata.New(&ec2metadata.Config{}) + op := &request.Operation{ + Name: "GetMetadata", + HTTPMethod: "GET", + HTTPPath: path.Join("/", "meta-data", "testpath"), + } + + req := c.Service.NewRequest(op, nil, nil) + assert.Equal(t, "http://169.254.169.254/latest", req.Service.Endpoint) + assert.Equal(t, "http://169.254.169.254/latest/meta-data/testpath", req.HTTPRequest.URL.String()) +} + +func TestGetMetadata(t *testing.T) { + server := initTestServer( + "/latest/meta-data/some/path", + "success", // real response includes suffix + ) + defer server.Close() + c := ec2metadata.New(&ec2metadata.Config{Endpoint: aws.String(server.URL + "/latest")}) + + resp, err := c.GetMetadata("some/path") + + assert.NoError(t, err) + assert.Equal(t, "success", resp) +} + +func TestGetRegion(t *testing.T) { + server := initTestServer( + "/latest/meta-data/placement/availability-zone", + "us-west-2a", // real response includes suffix + ) + defer server.Close() + c := ec2metadata.New(&ec2metadata.Config{Endpoint: aws.String(server.URL + "/latest")}) + + region, err := c.Region() + + assert.NoError(t, err) + assert.Equal(t, "us-west-2", region) +} + +func TestMetadataAvailable(t *testing.T) { + server := initTestServer( + "/latest/meta-data/instance-id", + "instance-id", + ) + defer server.Close() + c := ec2metadata.New(&ec2metadata.Config{Endpoint: aws.String(server.URL + "/latest")}) + + available := c.Available() + + assert.True(t, available) +} + +func TestMetadataNotAvailable(t *testing.T) { + c := ec2metadata.New(nil) + c.Handlers.Send.Clear() + c.Handlers.Send.PushBack(func(r *request.Request) { + r.HTTPResponse = &http.Response{ + StatusCode: int(0), + Status: http.StatusText(int(0)), + Body: ioutil.NopCloser(bytes.NewReader([]byte{})), + } + r.Error = awserr.New("RequestError", "send request failed", nil) + r.Retryable = aws.Bool(true) // network errors are retryable + }) + + available := c.Available() + + assert.False(t, available) +} diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/ec2metadata/service.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/ec2metadata/service.go new file mode 100644 index 000000000000..d230df6f9fa3 --- /dev/null +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/ec2metadata/service.go @@ -0,0 +1,135 @@ +package ec2metadata + +import ( + "io/ioutil" + "net/http" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/awserr" + "github.com/aws/aws-sdk-go/aws/credentials" + "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/aws/service" + "github.com/aws/aws-sdk-go/aws/service/serviceinfo" +) + +// DefaultRetries states the default number of times the service client will +// attempt to retry a failed request before failing. +const DefaultRetries = 3 + +// A Config provides the configuration for the EC2 Metadata service. +type Config struct { + // An optional endpoint URL (hostname only or fully qualified URI) + // that overrides the default service endpoint for a client. Set this + // to nil, or `""` to use the default service endpoint. + Endpoint *string + + // The HTTP client to use when sending requests. Defaults to + // `http.DefaultClient`. + HTTPClient *http.Client + + // An integer value representing the logging level. The default log level + // is zero (LogOff), which represents no logging. To enable logging set + // to a LogLevel Value. + Logger aws.Logger + + // The logger writer interface to write logging messages to. Defaults to + // standard out. + LogLevel *aws.LogLevelType + + // The maximum number of times that a request will be retried for failures. + // Defaults to DefaultRetries for the number of retries to be performed + // per request. + MaxRetries *int +} + +// A Client is an EC2 Metadata service Client. +type Client struct { + *service.Service +} + +// New creates a new instance of the EC2 Metadata service client. +// +// In the general use case the configuration for this service client should not +// be needed and `nil` can be provided. Configuration is only needed if the +// `ec2metadata.Config` defaults need to be overridden. Eg. Setting LogLevel. +// +// @note This configuration will NOT be merged with the default AWS service +// client configuration `defaults.DefaultConfig`. Due to circular dependencies +// with the defaults package and credentials EC2 Role Provider. +func New(config *Config) *Client { + service := &service.Service{ + ServiceInfo: serviceinfo.ServiceInfo{ + Config: copyConfig(config), + ServiceName: "Client", + Endpoint: "http://169.254.169.254/latest", + APIVersion: "latest", + }, + } + service.Initialize() + service.Handlers.Unmarshal.PushBack(unmarshalHandler) + service.Handlers.UnmarshalError.PushBack(unmarshalError) + service.Handlers.Validate.Clear() + service.Handlers.Validate.PushBack(validateEndpointHandler) + + return &Client{service} +} + +func copyConfig(config *Config) *aws.Config { + if config == nil { + config = &Config{} + } + c := &aws.Config{ + Credentials: credentials.AnonymousCredentials, + Endpoint: config.Endpoint, + HTTPClient: config.HTTPClient, + Logger: config.Logger, + LogLevel: config.LogLevel, + MaxRetries: config.MaxRetries, + } + + if c.HTTPClient == nil { + c.HTTPClient = http.DefaultClient + } + if c.Logger == nil { + c.Logger = aws.NewDefaultLogger() + } + if c.LogLevel == nil { + c.LogLevel = aws.LogLevel(aws.LogOff) + } + if c.MaxRetries == nil { + c.MaxRetries = aws.Int(DefaultRetries) + } + + return c +} + +type metadataOutput struct { + Content string +} + +func unmarshalHandler(r *request.Request) { + defer r.HTTPResponse.Body.Close() + b, err := ioutil.ReadAll(r.HTTPResponse.Body) + if err != nil { + r.Error = awserr.New("SerializationError", "unable to unmarshal EC2 metadata respose", err) + } + + data := r.Data.(*metadataOutput) + data.Content = string(b) +} + +func unmarshalError(r *request.Request) { + defer r.HTTPResponse.Body.Close() + _, err := ioutil.ReadAll(r.HTTPResponse.Body) + if err != nil { + r.Error = awserr.New("SerializationError", "unable to unmarshal EC2 metadata error respose", err) + } + + // TODO extract the error... +} + +func validateEndpointHandler(r *request.Request) { + if r.Service.Endpoint == "" { + r.Error = aws.ErrMissingEndpoint + } +} diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/errors.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/errors.go new file mode 100644 index 000000000000..db2f481b01bd --- /dev/null +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/errors.go @@ -0,0 +1,17 @@ +package aws + +import "github.com/aws/aws-sdk-go/aws/awserr" + +var ( + // ErrMissingRegion is an error that is returned if region configuration is + // not found. + // + // @readonly + ErrMissingRegion error = awserr.New("MissingRegion", "could not find region configuration", nil) + + // ErrMissingEndpoint is an error that is returned if an endpoint cannot be + // resolved for a service. + // + // @readonly + ErrMissingEndpoint error = awserr.New("MissingEndpoint", "'Endpoint' configuration is required for this service", nil) +) diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/handler_functions.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/handler_functions.go deleted file mode 100644 index e15ab8291f7d..000000000000 --- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/handler_functions.go +++ /dev/null @@ -1,147 +0,0 @@ -package aws - -import ( - "bytes" - "fmt" - "io" - "io/ioutil" - "net/http" - "net/url" - "regexp" - "strconv" - "time" - - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/internal/apierr" -) - -var sleepDelay = func(delay time.Duration) { - time.Sleep(delay) -} - -// Interface for matching types which also have a Len method. -type lener interface { - Len() int -} - -// BuildContentLength builds the content length of a request based on the body, -// or will use the HTTPRequest.Header's "Content-Length" if defined. If unable -// to determine request body length and no "Content-Length" was specified it will panic. -func BuildContentLength(r *Request) { - if slength := r.HTTPRequest.Header.Get("Content-Length"); slength != "" { - length, _ := strconv.ParseInt(slength, 10, 64) - r.HTTPRequest.ContentLength = length - return - } - - var length int64 - switch body := r.Body.(type) { - case nil: - length = 0 - case lener: - length = int64(body.Len()) - case io.Seeker: - r.bodyStart, _ = body.Seek(0, 1) - end, _ := body.Seek(0, 2) - body.Seek(r.bodyStart, 0) // make sure to seek back to original location - length = end - r.bodyStart - default: - panic("Cannot get length of body, must provide `ContentLength`") - } - - r.HTTPRequest.ContentLength = length - r.HTTPRequest.Header.Set("Content-Length", fmt.Sprintf("%d", length)) -} - -// UserAgentHandler is a request handler for injecting User agent into requests. -func UserAgentHandler(r *Request) { - r.HTTPRequest.Header.Set("User-Agent", SDKName+"/"+SDKVersion) -} - -var reStatusCode = regexp.MustCompile(`^(\d+)`) - -// SendHandler is a request handler to send service request using HTTP client. -func SendHandler(r *Request) { - var err error - r.HTTPResponse, err = r.Service.Config.HTTPClient.Do(r.HTTPRequest) - if err != nil { - // Capture the case where url.Error is returned for error processing - // response. e.g. 301 without location header comes back as string - // error and r.HTTPResponse is nil. Other url redirect errors will - // comeback in a similar method. - if e, ok := err.(*url.Error); ok { - if s := reStatusCode.FindStringSubmatch(e.Error()); s != nil { - code, _ := strconv.ParseInt(s[1], 10, 64) - r.HTTPResponse = &http.Response{ - StatusCode: int(code), - Status: http.StatusText(int(code)), - Body: ioutil.NopCloser(bytes.NewReader([]byte{})), - } - return - } - } - // Catch all other request errors. - r.Error = apierr.New("RequestError", "send request failed", err) - r.Retryable.Set(true) // network errors are retryable - } -} - -// ValidateResponseHandler is a request handler to validate service response. -func ValidateResponseHandler(r *Request) { - if r.HTTPResponse.StatusCode == 0 || r.HTTPResponse.StatusCode >= 300 { - // this may be replaced by an UnmarshalError handler - r.Error = apierr.New("UnknownError", "unknown error", nil) - } -} - -// AfterRetryHandler performs final checks to determine if the request should -// be retried and how long to delay. -func AfterRetryHandler(r *Request) { - // If one of the other handlers already set the retry state - // we don't want to override it based on the service's state - if !r.Retryable.IsSet() { - r.Retryable.Set(r.Service.ShouldRetry(r)) - } - - if r.WillRetry() { - r.RetryDelay = r.Service.RetryRules(r) - sleepDelay(r.RetryDelay) - - // when the expired token exception occurs the credentials - // need to be expired locally so that the next request to - // get credentials will trigger a credentials refresh. - if r.Error != nil { - if err, ok := r.Error.(awserr.Error); ok { - if isCodeExpiredCreds(err.Code()) { - r.Config.Credentials.Expire() - // The credentials will need to be resigned with new credentials - r.signed = false - } - } - } - - r.RetryCount++ - r.Error = nil - } -} - -var ( - // ErrMissingRegion is an error that is returned if region configuration is - // not found. - ErrMissingRegion error = apierr.New("MissingRegion", "could not find region configuration", nil) - - // ErrMissingEndpoint is an error that is returned if an endpoint cannot be - // resolved for a service. - ErrMissingEndpoint error = apierr.New("MissingEndpoint", "'Endpoint' configuration is required for this service", nil) -) - -// ValidateEndpointHandler is a request handler to validate a request had the -// appropriate Region and Endpoint set. Will set r.Error if the endpoint or -// region is not valid. -func ValidateEndpointHandler(r *Request) { - if r.Service.SigningRegion == "" && r.Service.Config.Region == "" { - r.Error = ErrMissingRegion - } else if r.Service.Endpoint == "" { - r.Error = ErrMissingEndpoint - } -} diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/handler_functions_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/handler_functions_test.go deleted file mode 100644 index 822db9fe2070..000000000000 --- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/handler_functions_test.go +++ /dev/null @@ -1,81 +0,0 @@ -package aws - -import ( - "net/http" - "os" - "testing" - - "github.com/aws/aws-sdk-go/aws/credentials" - "github.com/aws/aws-sdk-go/internal/apierr" - "github.com/stretchr/testify/assert" -) - -func TestValidateEndpointHandler(t *testing.T) { - os.Clearenv() - svc := NewService(&Config{Region: "us-west-2"}) - svc.Handlers.Clear() - svc.Handlers.Validate.PushBack(ValidateEndpointHandler) - - req := NewRequest(svc, &Operation{Name: "Operation"}, nil, nil) - err := req.Build() - - assert.NoError(t, err) -} - -func TestValidateEndpointHandlerErrorRegion(t *testing.T) { - os.Clearenv() - svc := NewService(nil) - svc.Handlers.Clear() - svc.Handlers.Validate.PushBack(ValidateEndpointHandler) - - req := NewRequest(svc, &Operation{Name: "Operation"}, nil, nil) - err := req.Build() - - assert.Error(t, err) - assert.Equal(t, ErrMissingRegion, err) -} - -type mockCredsProvider struct { - expired bool - retreiveCalled bool -} - -func (m *mockCredsProvider) Retrieve() (credentials.Value, error) { - m.retreiveCalled = true - return credentials.Value{}, nil -} - -func (m *mockCredsProvider) IsExpired() bool { - return m.expired -} - -func TestAfterRetryRefreshCreds(t *testing.T) { - os.Clearenv() - credProvider := &mockCredsProvider{} - svc := NewService(&Config{Credentials: credentials.NewCredentials(credProvider), MaxRetries: 1}) - - svc.Handlers.Clear() - svc.Handlers.ValidateResponse.PushBack(func(r *Request) { - r.Error = apierr.New("UnknownError", "", nil) - r.HTTPResponse = &http.Response{StatusCode: 400} - }) - svc.Handlers.UnmarshalError.PushBack(func(r *Request) { - r.Error = apierr.New("ExpiredTokenException", "", nil) - }) - svc.Handlers.AfterRetry.PushBack(func(r *Request) { - AfterRetryHandler(r) - }) - - assert.True(t, svc.Config.Credentials.IsExpired(), "Expect to start out expired") - assert.False(t, credProvider.retreiveCalled) - - req := NewRequest(svc, &Operation{Name: "Operation"}, nil, nil) - req.Send() - - assert.True(t, svc.Config.Credentials.IsExpired()) - assert.False(t, credProvider.retreiveCalled) - - _, err := svc.Config.Credentials.Get() - assert.NoError(t, err) - assert.True(t, credProvider.retreiveCalled) -} diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/handlers.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/handlers.go deleted file mode 100644 index 1968cb9f8b1d..000000000000 --- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/handlers.go +++ /dev/null @@ -1,85 +0,0 @@ -package aws - -// A Handlers provides a collection of request handlers for various -// stages of handling requests. -type Handlers struct { - Validate HandlerList - Build HandlerList - Sign HandlerList - Send HandlerList - ValidateResponse HandlerList - Unmarshal HandlerList - UnmarshalMeta HandlerList - UnmarshalError HandlerList - Retry HandlerList - AfterRetry HandlerList -} - -// copy returns of this handler's lists. -func (h *Handlers) copy() Handlers { - return Handlers{ - Validate: h.Validate.copy(), - Build: h.Build.copy(), - Sign: h.Sign.copy(), - Send: h.Send.copy(), - ValidateResponse: h.ValidateResponse.copy(), - Unmarshal: h.Unmarshal.copy(), - UnmarshalError: h.UnmarshalError.copy(), - UnmarshalMeta: h.UnmarshalMeta.copy(), - Retry: h.Retry.copy(), - AfterRetry: h.AfterRetry.copy(), - } -} - -// Clear removes callback functions for all handlers -func (h *Handlers) Clear() { - h.Validate.Clear() - h.Build.Clear() - h.Send.Clear() - h.Sign.Clear() - h.Unmarshal.Clear() - h.UnmarshalMeta.Clear() - h.UnmarshalError.Clear() - h.ValidateResponse.Clear() - h.Retry.Clear() - h.AfterRetry.Clear() -} - -// A HandlerList manages zero or more handlers in a list. -type HandlerList struct { - list []func(*Request) -} - -// copy creates a copy of the handler list. -func (l *HandlerList) copy() HandlerList { - var n HandlerList - n.list = append([]func(*Request){}, l.list...) - return n -} - -// Clear clears the handler list. -func (l *HandlerList) Clear() { - l.list = []func(*Request){} -} - -// Len returns the number of handlers in the list. -func (l *HandlerList) Len() int { - return len(l.list) -} - -// PushBack pushes handlers f to the back of the handler list. -func (l *HandlerList) PushBack(f ...func(*Request)) { - l.list = append(l.list, f...) -} - -// PushFront pushes handlers f to the front of the handler list. -func (l *HandlerList) PushFront(f ...func(*Request)) { - l.list = append(f, l.list...) -} - -// Run executes all handlers in the list with a given request object. -func (l *HandlerList) Run(r *Request) { - for _, f := range l.list { - f(r) - } -} diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/handlers_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/handlers_test.go deleted file mode 100644 index 26776f6da6cb..000000000000 --- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/handlers_test.go +++ /dev/null @@ -1,31 +0,0 @@ -package aws - -import ( - "testing" - - "github.com/stretchr/testify/assert" -) - -func TestHandlerList(t *testing.T) { - s := "" - r := &Request{} - l := HandlerList{} - l.PushBack(func(r *Request) { - s += "a" - r.Data = s - }) - l.Run(r) - assert.Equal(t, "a", s) - assert.Equal(t, "a", r.Data) -} - -func TestMultipleHandlers(t *testing.T) { - r := &Request{} - l := HandlerList{} - l.PushBack(func(r *Request) { r.Data = nil }) - l.PushFront(func(r *Request) { r.Data = Boolean(true) }) - l.Run(r) - if r.Data != nil { - t.Error("Expected handler to execute") - } -} diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/logger.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/logger.go new file mode 100644 index 000000000000..f5369487384e --- /dev/null +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/logger.go @@ -0,0 +1,98 @@ +package aws + +import ( + "log" + "os" +) + +// A LogLevelType defines the level logging should be performed at. Used to instruct +// the SDK which statements should be logged. +type LogLevelType uint + +// LogLevel returns the pointer to a LogLevel. Should be used to workaround +// not being able to take the address of a non-composite literal. +func LogLevel(l LogLevelType) *LogLevelType { + return &l +} + +// Value returns the LogLevel value or the default value LogOff if the LogLevel +// is nil. Safe to use on nil value LogLevelTypes. +func (l *LogLevelType) Value() LogLevelType { + if l != nil { + return *l + } + return LogOff +} + +// Matches returns true if the v LogLevel is enabled by this LogLevel. Should be +// used with logging sub levels. Is safe to use on nil value LogLevelTypes. If +// LogLevel is nill, will default to LogOff comparison. +func (l *LogLevelType) Matches(v LogLevelType) bool { + c := l.Value() + return c&v == v +} + +// AtLeast returns true if this LogLevel is at least high enough to satisfies v. +// Is safe to use on nil value LogLevelTypes. If LogLevel is nill, will default +// to LogOff comparison. +func (l *LogLevelType) AtLeast(v LogLevelType) bool { + c := l.Value() + return c >= v +} + +const ( + // LogOff states that no logging should be performed by the SDK. This is the + // default state of the SDK, and should be use to disable all logging. + LogOff LogLevelType = iota * 0x1000 + + // LogDebug state that debug output should be logged by the SDK. This should + // be used to inspect request made and responses received. + LogDebug +) + +// Debug Logging Sub Levels +const ( + // LogDebugWithSigning states that the SDK should log request signing and + // presigning events. This should be used to log the signing details of + // requests for debugging. Will also enable LogDebug. + LogDebugWithSigning LogLevelType = LogDebug | (1 << iota) + + // LogDebugWithHTTPBody states the SDK should log HTTP request and response + // HTTP bodys in addition to the headers and path. This should be used to + // see the body content of requests and responses made while using the SDK + // Will also enable LogDebug. + LogDebugWithHTTPBody + + // LogDebugWithRequestRetries states the SDK should log when service requests will + // be retried. This should be used to log when you want to log when service + // requests are being retried. Will also enable LogDebug. + LogDebugWithRequestRetries + + // LogDebugWithRequestErrors states the SDK should log when service requests fail + // to build, send, validate, or unmarshal. + LogDebugWithRequestErrors +) + +// A Logger is a minimalistic interface for the SDK to log messages to. Should +// be used to provide custom logging writers for the SDK to use. +type Logger interface { + Log(...interface{}) +} + +// NewDefaultLogger returns a Logger which will write log messages to stdout, and +// use same formatting runes as the stdlib log.Logger +func NewDefaultLogger() Logger { + return &defaultLogger{ + logger: log.New(os.Stdout, "", log.LstdFlags), + } +} + +// A defaultLogger provides a minimalistic logger satisfying the Logger interface. +type defaultLogger struct { + logger *log.Logger +} + +// Log logs the parameters to the stdlib logger. See log.Println. +func (l defaultLogger) Log(args ...interface{}) { + l.logger.Println(args...) +} diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/param_validator.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/param_validator.go deleted file mode 100644 index 7c1377281dfa..000000000000 --- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/param_validator.go +++ /dev/null @@ -1,89 +0,0 @@ -package aws - -import ( - "fmt" - "reflect" - "strings" - - "github.com/aws/aws-sdk-go/internal/apierr" -) - -// ValidateParameters is a request handler to validate the input parameters. -// Validating parameters only has meaning if done prior to the request being sent. -func ValidateParameters(r *Request) { - if r.ParamsFilled() { - v := validator{errors: []string{}} - v.validateAny(reflect.ValueOf(r.Params), "") - - if count := len(v.errors); count > 0 { - format := "%d validation errors:\n- %s" - msg := fmt.Sprintf(format, count, strings.Join(v.errors, "\n- ")) - r.Error = apierr.New("InvalidParameter", msg, nil) - } - } -} - -// A validator validates values. Collects validations errors which occurs. -type validator struct { - errors []string -} - -// validateAny will validate any struct, slice or map type. All validations -// are also performed recursively for nested types. -func (v *validator) validateAny(value reflect.Value, path string) { - value = reflect.Indirect(value) - if !value.IsValid() { - return - } - - switch value.Kind() { - case reflect.Struct: - v.validateStruct(value, path) - case reflect.Slice: - for i := 0; i < value.Len(); i++ { - v.validateAny(value.Index(i), path+fmt.Sprintf("[%d]", i)) - } - case reflect.Map: - for _, n := range value.MapKeys() { - v.validateAny(value.MapIndex(n), path+fmt.Sprintf("[%q]", n.String())) - } - } -} - -// validateStruct will validate the struct value's fields. If the structure has -// nested types those types will be validated also. -func (v *validator) validateStruct(value reflect.Value, path string) { - prefix := "." - if path == "" { - prefix = "" - } - - for i := 0; i < value.Type().NumField(); i++ { - f := value.Type().Field(i) - if strings.ToLower(f.Name[0:1]) == f.Name[0:1] { - continue - } - fvalue := value.FieldByName(f.Name) - - notset := false - if f.Tag.Get("required") != "" { - switch fvalue.Kind() { - case reflect.Ptr, reflect.Slice, reflect.Map: - if fvalue.IsNil() { - notset = true - } - default: - if !fvalue.IsValid() { - notset = true - } - } - } - - if notset { - msg := "missing required parameter: " + path + prefix + f.Name - v.errors = append(v.errors, msg) - } else { - v.validateAny(fvalue, path+prefix+f.Name) - } - } -} diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/param_validator_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/param_validator_test.go deleted file mode 100644 index 66515673070b..000000000000 --- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/param_validator_test.go +++ /dev/null @@ -1,84 +0,0 @@ -package aws_test - -import ( - "testing" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/stretchr/testify/assert" -) - -var service = func() *aws.Service { - s := &aws.Service{ - Config: &aws.Config{}, - ServiceName: "mock-service", - APIVersion: "2015-01-01", - } - return s -}() - -type StructShape struct { - RequiredList []*ConditionalStructShape `required:"true"` - RequiredMap map[string]*ConditionalStructShape `required:"true"` - RequiredBool *bool `required:"true"` - OptionalStruct *ConditionalStructShape - - hiddenParameter *string - - metadataStructureShape -} - -type metadataStructureShape struct { - SDKShapeTraits bool -} - -type ConditionalStructShape struct { - Name *string `required:"true"` - SDKShapeTraits bool -} - -func TestNoErrors(t *testing.T) { - input := &StructShape{ - RequiredList: []*ConditionalStructShape{}, - RequiredMap: map[string]*ConditionalStructShape{ - "key1": &ConditionalStructShape{Name: aws.String("Name")}, - "key2": &ConditionalStructShape{Name: aws.String("Name")}, - }, - RequiredBool: aws.Boolean(true), - OptionalStruct: &ConditionalStructShape{Name: aws.String("Name")}, - } - - req := aws.NewRequest(service, &aws.Operation{}, input, nil) - aws.ValidateParameters(req) - assert.NoError(t, req.Error) -} - -func TestMissingRequiredParameters(t *testing.T) { - input := &StructShape{} - req := aws.NewRequest(service, &aws.Operation{}, input, nil) - aws.ValidateParameters(req) - - assert.Error(t, req.Error) - assert.Equal(t, "InvalidParameter", req.Error.(awserr.Error).Code()) - assert.Equal(t, "3 validation errors:\n- missing required parameter: RequiredList\n- missing required parameter: RequiredMap\n- missing required parameter: RequiredBool", req.Error.(awserr.Error).Message()) -} - -func TestNestedMissingRequiredParameters(t *testing.T) { - input := &StructShape{ - RequiredList: []*ConditionalStructShape{&ConditionalStructShape{}}, - RequiredMap: map[string]*ConditionalStructShape{ - "key1": &ConditionalStructShape{Name: aws.String("Name")}, - "key2": &ConditionalStructShape{}, - }, - RequiredBool: aws.Boolean(true), - OptionalStruct: &ConditionalStructShape{}, - } - - req := aws.NewRequest(service, &aws.Operation{}, input, nil) - aws.ValidateParameters(req) - - assert.Error(t, req.Error) - assert.Equal(t, "InvalidParameter", req.Error.(awserr.Error).Code()) - assert.Equal(t, "3 validation errors:\n- missing required parameter: RequiredList[0].Name\n- missing required parameter: RequiredMap[\"key2\"].Name\n- missing required parameter: OptionalStruct.Name", req.Error.(awserr.Error).Message()) - -} diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/request/handlers.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/request/handlers.go new file mode 100644 index 000000000000..85bc122e7b3e --- /dev/null +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/request/handlers.go @@ -0,0 +1,112 @@ +package request + +// A Handlers provides a collection of request handlers for various +// stages of handling requests. +type Handlers struct { + Validate HandlerList + Build HandlerList + Sign HandlerList + Send HandlerList + ValidateResponse HandlerList + Unmarshal HandlerList + UnmarshalMeta HandlerList + UnmarshalError HandlerList + Retry HandlerList + AfterRetry HandlerList +} + +// Copy returns of this handler's lists. +func (h *Handlers) Copy() Handlers { + return Handlers{ + Validate: h.Validate.copy(), + Build: h.Build.copy(), + Sign: h.Sign.copy(), + Send: h.Send.copy(), + ValidateResponse: h.ValidateResponse.copy(), + Unmarshal: h.Unmarshal.copy(), + UnmarshalError: h.UnmarshalError.copy(), + UnmarshalMeta: h.UnmarshalMeta.copy(), + Retry: h.Retry.copy(), + AfterRetry: h.AfterRetry.copy(), + } +} + +// Clear removes callback functions for all handlers +func (h *Handlers) Clear() { + h.Validate.Clear() + h.Build.Clear() + h.Send.Clear() + h.Sign.Clear() + h.Unmarshal.Clear() + h.UnmarshalMeta.Clear() + h.UnmarshalError.Clear() + h.ValidateResponse.Clear() + h.Retry.Clear() + h.AfterRetry.Clear() +} + +// A HandlerList manages zero or more handlers in a list. +type HandlerList struct { + list []NamedHandler +} + +// A NamedHandler is a struct that contains a name and function callback. +type NamedHandler struct { + Name string + Fn func(*Request) +} + +// copy creates a copy of the handler list. +func (l *HandlerList) copy() HandlerList { + var n HandlerList + n.list = append([]NamedHandler{}, l.list...) + return n +} + +// Clear clears the handler list. +func (l *HandlerList) Clear() { + l.list = []NamedHandler{} +} + +// Len returns the number of handlers in the list. +func (l *HandlerList) Len() int { + return len(l.list) +} + +// PushBack pushes handler f to the back of the handler list. +func (l *HandlerList) PushBack(f func(*Request)) { + l.list = append(l.list, NamedHandler{"__anonymous", f}) +} + +// PushFront pushes handler f to the front of the handler list. +func (l *HandlerList) PushFront(f func(*Request)) { + l.list = append([]NamedHandler{{"__anonymous", f}}, l.list...) +} + +// PushBackNamed pushes named handler f to the back of the handler list. +func (l *HandlerList) PushBackNamed(n NamedHandler) { + l.list = append(l.list, n) +} + +// PushFrontNamed pushes named handler f to the front of the handler list. +func (l *HandlerList) PushFrontNamed(n NamedHandler) { + l.list = append([]NamedHandler{n}, l.list...) +} + +// Remove removes a NamedHandler n +func (l *HandlerList) Remove(n NamedHandler) { + newlist := []NamedHandler{} + for _, m := range l.list { + if m.Name != n.Name { + newlist = append(newlist, m) + } + } + l.list = newlist +} + +// Run executes all handlers in the list with a given request object. +func (l *HandlerList) Run(r *Request) { + for _, f := range l.list { + f.Fn(r) + } +} diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/request/handlers_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/request/handlers_test.go new file mode 100644 index 000000000000..2ff05a8154e7 --- /dev/null +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/request/handlers_test.go @@ -0,0 +1,47 @@ +package request_test + +import ( + "testing" + + "github.com/stretchr/testify/assert" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/request" +) + +func TestHandlerList(t *testing.T) { + s := "" + r := &request.Request{} + l := request.HandlerList{} + l.PushBack(func(r *request.Request) { + s += "a" + r.Data = s + }) + l.Run(r) + assert.Equal(t, "a", s) + assert.Equal(t, "a", r.Data) +} + +func TestMultipleHandlers(t *testing.T) { + r := &request.Request{} + l := request.HandlerList{} + l.PushBack(func(r *request.Request) { r.Data = nil }) + l.PushFront(func(r *request.Request) { r.Data = aws.Bool(true) }) + l.Run(r) + if r.Data != nil { + t.Error("Expected handler to execute") + } +} + +func TestNamedHandlers(t *testing.T) { + l := request.HandlerList{} + named := request.NamedHandler{"Name", func(r *request.Request) {}} + named2 := request.NamedHandler{"NotName", func(r *request.Request) {}} + l.PushBackNamed(named) + l.PushBackNamed(named) + l.PushBackNamed(named2) + l.PushBack(func(r *request.Request) {}) + assert.Equal(t, 4, l.Len()) + l.Remove(named) + assert.Equal(t, 2, l.Len()) +} diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/request.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/request/request.go similarity index 79% rename from Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/request.go rename to Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/request/request.go index df5885fcb4b7..70c28b883164 100644 --- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/request.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/request/request.go @@ -1,7 +1,8 @@ -package aws +package request import ( "bytes" + "fmt" "io" "io/ioutil" "net/http" @@ -10,12 +11,15 @@ import ( "strings" "time" + "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awsutil" + "github.com/aws/aws-sdk-go/aws/service/serviceinfo" ) // A Request is the service request to be made. type Request struct { - *Service + Retryer + Service serviceinfo.ServiceInfo Handlers Handlers Time time.Time ExpireTime time.Duration @@ -23,17 +27,16 @@ type Request struct { HTTPRequest *http.Request HTTPResponse *http.Response Body io.ReadSeeker - bodyStart int64 // offset from beginning of Body that the request body starts + BodyStart int64 // offset from beginning of Body that the request body starts Params interface{} Error error Data interface{} RequestID string RetryCount uint - Retryable SettableBool + Retryable *bool RetryDelay time.Duration - built bool - signed bool + built bool } // An Operation is the service API operation to be made. @@ -52,13 +55,13 @@ type Paginator struct { TruncationToken string } -// NewRequest returns a new Request pointer for the service API +// New returns a new Request pointer for the service API // operation and parameters. // // Params is any value of input parameters to be the request payload. // Data is pointer value to an object which the request's response // payload will be deserialized to. -func NewRequest(service *Service, operation *Operation, params interface{}, data interface{}) *Request { +func New(service serviceinfo.ServiceInfo, handlers Handlers, retryer Retryer, operation *Operation, params interface{}, data interface{}) *Request { method := operation.HTTPMethod if method == "" { method = "POST" @@ -72,8 +75,9 @@ func NewRequest(service *Service, operation *Operation, params interface{}, data httpReq.URL, _ = url.Parse(service.Endpoint + p) r := &Request{ + Retryer: retryer, Service: service, - Handlers: service.Handlers.copy(), + Handlers: handlers.Copy(), Time: time.Now(), ExpireTime: 0, Operation: operation, @@ -90,7 +94,7 @@ func NewRequest(service *Service, operation *Operation, params interface{}, data // WillRetry returns if the request's can be retried. func (r *Request) WillRetry() bool { - return r.Error != nil && r.Retryable.Get() && r.RetryCount < r.Service.MaxRetries() + return r.Error != nil && aws.BoolValue(r.Retryable) && r.RetryCount < r.MaxRetries() } // ParamsFilled returns if the request's parameters have been populated @@ -135,6 +139,20 @@ func (r *Request) Presign(expireTime time.Duration) (string, error) { return r.HTTPRequest.URL.String(), nil } +func debugLogReqError(r *Request, stage string, retrying bool, err error) { + if !r.Service.Config.LogLevel.Matches(aws.LogDebugWithRequestErrors) { + return + } + + retryStr := "not retrying" + if retrying { + retryStr = "will retry" + } + + r.Service.Config.Logger.Log(fmt.Sprintf("DEBUG: %s %s/%s failed, %s, error %v", + stage, r.Service.ServiceName, r.Operation.Name, retryStr, err)) +} + // Build will build the request's object so it can be signed and sent // to the service. Build will also validate all the request's parameters. // Anny additional build Handlers set on this request will be run @@ -150,6 +168,7 @@ func (r *Request) Build() error { r.Error = nil r.Handlers.Validate.Run(r) if r.Error != nil { + debugLogReqError(r, "Validate Request", false, r.Error) return r.Error } r.Handlers.Build.Run(r) @@ -164,17 +183,13 @@ func (r *Request) Build() error { // Send will build the request prior to signing. All Sign Handlers will // be executed in the order they were set. func (r *Request) Sign() error { - if r.signed { - return r.Error - } - r.Build() if r.Error != nil { + debugLogReqError(r, "Build Request", false, r.Error) return r.Error } r.Handlers.Sign.Run(r) - r.signed = r.Error != nil return r.Error } @@ -189,42 +204,57 @@ func (r *Request) Send() error { return r.Error } - if r.Retryable.Get() { + if aws.BoolValue(r.Retryable) { + if r.Service.Config.LogLevel.Matches(aws.LogDebugWithRequestRetries) { + r.Service.Config.Logger.Log(fmt.Sprintf("DEBUG: Retrying Request %s/%s, attempt %d", + r.Service.ServiceName, r.Operation.Name, r.RetryCount)) + } + // Re-seek the body back to the original point in for a retry so that // send will send the body's contents again in the upcoming request. - r.Body.Seek(r.bodyStart, 0) + r.Body.Seek(r.BodyStart, 0) + r.HTTPRequest.Body = ioutil.NopCloser(r.Body) } - r.Retryable.Reset() + r.Retryable = nil r.Handlers.Send.Run(r) if r.Error != nil { + err := r.Error r.Handlers.Retry.Run(r) r.Handlers.AfterRetry.Run(r) if r.Error != nil { + debugLogReqError(r, "Send Request", false, r.Error) return r.Error } + debugLogReqError(r, "Send Request", true, err) continue } r.Handlers.UnmarshalMeta.Run(r) r.Handlers.ValidateResponse.Run(r) if r.Error != nil { + err := r.Error r.Handlers.UnmarshalError.Run(r) r.Handlers.Retry.Run(r) r.Handlers.AfterRetry.Run(r) if r.Error != nil { + debugLogReqError(r, "Validate Response", false, r.Error) return r.Error } + debugLogReqError(r, "Validate Response", true, err) continue } r.Handlers.Unmarshal.Run(r) if r.Error != nil { + err := r.Error r.Handlers.Retry.Run(r) r.Handlers.AfterRetry.Run(r) if r.Error != nil { + debugLogReqError(r, "Unmarshal Response", false, r.Error) return r.Error } + debugLogReqError(r, "Unmarshal Response", true, err) continue } @@ -285,7 +315,7 @@ func (r *Request) NextPage() *Request { } data := reflect.New(reflect.TypeOf(r.Data).Elem()).Interface() - nr := NewRequest(r.Service, r.Operation, awsutil.CopyOf(r.Params), data) + nr := New(r.Service, r.Handlers, r.Retryer, r.Operation, awsutil.CopyOf(r.Params), data) for i, intok := range nr.Operation.InputTokens { awsutil.SetValueAtAnyPath(nr.Params, intok, tokens[i]) } diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/request/request_pagination_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/request/request_pagination_test.go new file mode 100644 index 000000000000..c0f151eeea6b --- /dev/null +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/request/request_pagination_test.go @@ -0,0 +1,307 @@ +package request_test + +import ( + "testing" + + "github.com/stretchr/testify/assert" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/internal/test/unit" + "github.com/aws/aws-sdk-go/service/dynamodb" + "github.com/aws/aws-sdk-go/service/s3" +) + +var _ = unit.Imported + +// Use DynamoDB methods for simplicity +func TestPagination(t *testing.T) { + db := dynamodb.New(nil) + tokens, pages, numPages, gotToEnd := []string{}, []string{}, 0, false + + reqNum := 0 + resps := []*dynamodb.ListTablesOutput{ + {TableNames: []*string{aws.String("Table1"), aws.String("Table2")}, LastEvaluatedTableName: aws.String("Table2")}, + {TableNames: []*string{aws.String("Table3"), aws.String("Table4")}, LastEvaluatedTableName: aws.String("Table4")}, + {TableNames: []*string{aws.String("Table5")}}, + } + + db.Handlers.Send.Clear() // mock sending + db.Handlers.Unmarshal.Clear() + db.Handlers.UnmarshalMeta.Clear() + db.Handlers.ValidateResponse.Clear() + db.Handlers.Build.PushBack(func(r *request.Request) { + in := r.Params.(*dynamodb.ListTablesInput) + if in == nil { + tokens = append(tokens, "") + } else if in.ExclusiveStartTableName != nil { + tokens = append(tokens, *in.ExclusiveStartTableName) + } + }) + db.Handlers.Unmarshal.PushBack(func(r *request.Request) { + r.Data = resps[reqNum] + reqNum++ + }) + + params := &dynamodb.ListTablesInput{Limit: aws.Int64(2)} + err := db.ListTablesPages(params, func(p *dynamodb.ListTablesOutput, last bool) bool { + numPages++ + for _, t := range p.TableNames { + pages = append(pages, *t) + } + if last { + if gotToEnd { + assert.Fail(t, "last=true happened twice") + } + gotToEnd = true + } + return true + }) + + assert.Equal(t, []string{"Table2", "Table4"}, tokens) + assert.Equal(t, []string{"Table1", "Table2", "Table3", "Table4", "Table5"}, pages) + assert.Equal(t, 3, numPages) + assert.True(t, gotToEnd) + assert.Nil(t, err) + assert.Nil(t, params.ExclusiveStartTableName) +} + +// Use DynamoDB methods for simplicity +func TestPaginationEachPage(t *testing.T) { + db := dynamodb.New(nil) + tokens, pages, numPages, gotToEnd := []string{}, []string{}, 0, false + + reqNum := 0 + resps := []*dynamodb.ListTablesOutput{ + {TableNames: []*string{aws.String("Table1"), aws.String("Table2")}, LastEvaluatedTableName: aws.String("Table2")}, + {TableNames: []*string{aws.String("Table3"), aws.String("Table4")}, LastEvaluatedTableName: aws.String("Table4")}, + {TableNames: []*string{aws.String("Table5")}}, + } + + db.Handlers.Send.Clear() // mock sending + db.Handlers.Unmarshal.Clear() + db.Handlers.UnmarshalMeta.Clear() + db.Handlers.ValidateResponse.Clear() + db.Handlers.Build.PushBack(func(r *request.Request) { + in := r.Params.(*dynamodb.ListTablesInput) + if in == nil { + tokens = append(tokens, "") + } else if in.ExclusiveStartTableName != nil { + tokens = append(tokens, *in.ExclusiveStartTableName) + } + }) + db.Handlers.Unmarshal.PushBack(func(r *request.Request) { + r.Data = resps[reqNum] + reqNum++ + }) + + params := &dynamodb.ListTablesInput{Limit: aws.Int64(2)} + req, _ := db.ListTablesRequest(params) + err := req.EachPage(func(p interface{}, last bool) bool { + numPages++ + for _, t := range p.(*dynamodb.ListTablesOutput).TableNames { + pages = append(pages, *t) + } + if last { + if gotToEnd { + assert.Fail(t, "last=true happened twice") + } + gotToEnd = true + } + + return true + }) + + assert.Equal(t, []string{"Table2", "Table4"}, tokens) + assert.Equal(t, []string{"Table1", "Table2", "Table3", "Table4", "Table5"}, pages) + assert.Equal(t, 3, numPages) + assert.True(t, gotToEnd) + assert.Nil(t, err) +} + +// Use DynamoDB methods for simplicity +func TestPaginationEarlyExit(t *testing.T) { + db := dynamodb.New(nil) + numPages, gotToEnd := 0, false + + reqNum := 0 + resps := []*dynamodb.ListTablesOutput{ + {TableNames: []*string{aws.String("Table1"), aws.String("Table2")}, LastEvaluatedTableName: aws.String("Table2")}, + {TableNames: []*string{aws.String("Table3"), aws.String("Table4")}, LastEvaluatedTableName: aws.String("Table4")}, + {TableNames: []*string{aws.String("Table5")}}, + } + + db.Handlers.Send.Clear() // mock sending + db.Handlers.Unmarshal.Clear() + db.Handlers.UnmarshalMeta.Clear() + db.Handlers.ValidateResponse.Clear() + db.Handlers.Unmarshal.PushBack(func(r *request.Request) { + r.Data = resps[reqNum] + reqNum++ + }) + + params := &dynamodb.ListTablesInput{Limit: aws.Int64(2)} + err := db.ListTablesPages(params, func(p *dynamodb.ListTablesOutput, last bool) bool { + numPages++ + if numPages == 2 { + return false + } + if last { + if gotToEnd { + assert.Fail(t, "last=true happened twice") + } + gotToEnd = true + } + return true + }) + + assert.Equal(t, 2, numPages) + assert.False(t, gotToEnd) + assert.Nil(t, err) +} + +func TestSkipPagination(t *testing.T) { + client := s3.New(nil) + client.Handlers.Send.Clear() // mock sending + client.Handlers.Unmarshal.Clear() + client.Handlers.UnmarshalMeta.Clear() + client.Handlers.ValidateResponse.Clear() + client.Handlers.Unmarshal.PushBack(func(r *request.Request) { + r.Data = &s3.HeadBucketOutput{} + }) + + req, _ := client.HeadBucketRequest(&s3.HeadBucketInput{Bucket: aws.String("bucket")}) + + numPages, gotToEnd := 0, false + req.EachPage(func(p interface{}, last bool) bool { + numPages++ + if last { + gotToEnd = true + } + return true + }) + assert.Equal(t, 1, numPages) + assert.True(t, gotToEnd) +} + +// Use S3 for simplicity +func TestPaginationTruncation(t *testing.T) { + count := 0 + client := s3.New(nil) + + reqNum := &count + resps := []*s3.ListObjectsOutput{ + {IsTruncated: aws.Bool(true), Contents: []*s3.Object{{Key: aws.String("Key1")}}}, + {IsTruncated: aws.Bool(true), Contents: []*s3.Object{{Key: aws.String("Key2")}}}, + {IsTruncated: aws.Bool(false), Contents: []*s3.Object{{Key: aws.String("Key3")}}}, + {IsTruncated: aws.Bool(true), Contents: []*s3.Object{{Key: aws.String("Key4")}}}, + } + + client.Handlers.Send.Clear() // mock sending + client.Handlers.Unmarshal.Clear() + client.Handlers.UnmarshalMeta.Clear() + client.Handlers.ValidateResponse.Clear() + client.Handlers.Unmarshal.PushBack(func(r *request.Request) { + r.Data = resps[*reqNum] + *reqNum++ + }) + + params := &s3.ListObjectsInput{Bucket: aws.String("bucket")} + + results := []string{} + err := client.ListObjectsPages(params, func(p *s3.ListObjectsOutput, last bool) bool { + results = append(results, *p.Contents[0].Key) + return true + }) + + assert.Equal(t, []string{"Key1", "Key2", "Key3"}, results) + assert.Nil(t, err) + + // Try again without truncation token at all + count = 0 + resps[1].IsTruncated = nil + resps[2].IsTruncated = aws.Bool(true) + results = []string{} + err = client.ListObjectsPages(params, func(p *s3.ListObjectsOutput, last bool) bool { + results = append(results, *p.Contents[0].Key) + return true + }) + + assert.Equal(t, []string{"Key1", "Key2"}, results) + assert.Nil(t, err) + +} + +// Benchmarks +var benchResps = []*dynamodb.ListTablesOutput{ + {TableNames: []*string{aws.String("TABLE"), aws.String("NXT")}, LastEvaluatedTableName: aws.String("NXT")}, + {TableNames: []*string{aws.String("TABLE"), aws.String("NXT")}, LastEvaluatedTableName: aws.String("NXT")}, + {TableNames: []*string{aws.String("TABLE"), aws.String("NXT")}, LastEvaluatedTableName: aws.String("NXT")}, + {TableNames: []*string{aws.String("TABLE"), aws.String("NXT")}, LastEvaluatedTableName: aws.String("NXT")}, + {TableNames: []*string{aws.String("TABLE"), aws.String("NXT")}, LastEvaluatedTableName: aws.String("NXT")}, + {TableNames: []*string{aws.String("TABLE"), aws.String("NXT")}, LastEvaluatedTableName: aws.String("NXT")}, + {TableNames: []*string{aws.String("TABLE"), aws.String("NXT")}, LastEvaluatedTableName: aws.String("NXT")}, + {TableNames: []*string{aws.String("TABLE"), aws.String("NXT")}, LastEvaluatedTableName: aws.String("NXT")}, + {TableNames: []*string{aws.String("TABLE"), aws.String("NXT")}, LastEvaluatedTableName: aws.String("NXT")}, + {TableNames: []*string{aws.String("TABLE"), aws.String("NXT")}, LastEvaluatedTableName: aws.String("NXT")}, + {TableNames: []*string{aws.String("TABLE"), aws.String("NXT")}, LastEvaluatedTableName: aws.String("NXT")}, + {TableNames: []*string{aws.String("TABLE"), aws.String("NXT")}, LastEvaluatedTableName: aws.String("NXT")}, + {TableNames: []*string{aws.String("TABLE"), aws.String("NXT")}, LastEvaluatedTableName: aws.String("NXT")}, + {TableNames: []*string{aws.String("TABLE")}}, +} + +var benchDb = func() *dynamodb.DynamoDB { + db := dynamodb.New(nil) + db.Handlers.Send.Clear() // mock sending + db.Handlers.Unmarshal.Clear() + db.Handlers.UnmarshalMeta.Clear() + db.Handlers.ValidateResponse.Clear() + return db +} + +func BenchmarkCodegenIterator(b *testing.B) { + reqNum := 0 + db := benchDb() + db.Handlers.Unmarshal.PushBack(func(r *request.Request) { + r.Data = benchResps[reqNum] + reqNum++ + }) + + input := &dynamodb.ListTablesInput{Limit: aws.Int64(2)} + iter := func(fn func(*dynamodb.ListTablesOutput, bool) bool) error { + page, _ := db.ListTablesRequest(input) + for ; page != nil; page = page.NextPage() { + page.Send() + out := page.Data.(*dynamodb.ListTablesOutput) + if result := fn(out, !page.HasNextPage()); page.Error != nil || !result { + return page.Error + } + } + return nil + } + + for i := 0; i < b.N; i++ { + reqNum = 0 + iter(func(p *dynamodb.ListTablesOutput, last bool) bool { + return true + }) + } +} + +func BenchmarkEachPageIterator(b *testing.B) { + reqNum := 0 + db := benchDb() + db.Handlers.Unmarshal.PushBack(func(r *request.Request) { + r.Data = benchResps[reqNum] + reqNum++ + }) + + input := &dynamodb.ListTablesInput{Limit: aws.Int64(2)} + for i := 0; i < b.N; i++ { + reqNum = 0 + req, _ := db.ListTablesRequest(input) + req.EachPage(func(p interface{}, last bool) bool { + return true + }) + } +} diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/request/request_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/request/request_test.go new file mode 100644 index 000000000000..6cea0bd2fffb --- /dev/null +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/request/request_test.go @@ -0,0 +1,228 @@ +package request_test + +import ( + "bytes" + "encoding/json" + "fmt" + "io" + "io/ioutil" + "net/http" + "testing" + "time" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/awserr" + "github.com/aws/aws-sdk-go/aws/credentials" + "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/aws/service" + "github.com/stretchr/testify/assert" +) + +type testData struct { + Data string +} + +func body(str string) io.ReadCloser { + return ioutil.NopCloser(bytes.NewReader([]byte(str))) +} + +func unmarshal(req *request.Request) { + defer req.HTTPResponse.Body.Close() + if req.Data != nil { + json.NewDecoder(req.HTTPResponse.Body).Decode(req.Data) + } + return +} + +func unmarshalError(req *request.Request) { + bodyBytes, err := ioutil.ReadAll(req.HTTPResponse.Body) + if err != nil { + req.Error = awserr.New("UnmarshaleError", req.HTTPResponse.Status, err) + return + } + if len(bodyBytes) == 0 { + req.Error = awserr.NewRequestFailure( + awserr.New("UnmarshaleError", req.HTTPResponse.Status, fmt.Errorf("empty body")), + req.HTTPResponse.StatusCode, + "", + ) + return + } + var jsonErr jsonErrorResponse + if err := json.Unmarshal(bodyBytes, &jsonErr); err != nil { + req.Error = awserr.New("UnmarshaleError", "JSON unmarshal", err) + return + } + req.Error = awserr.NewRequestFailure( + awserr.New(jsonErr.Code, jsonErr.Message, nil), + req.HTTPResponse.StatusCode, + "", + ) +} + +type jsonErrorResponse struct { + Code string `json:"__type"` + Message string `json:"message"` +} + +// test that retries occur for 5xx status codes +func TestRequestRecoverRetry5xx(t *testing.T) { + reqNum := 0 + reqs := []http.Response{ + {StatusCode: 500, Body: body(`{"__type":"UnknownError","message":"An error occurred."}`)}, + {StatusCode: 501, Body: body(`{"__type":"UnknownError","message":"An error occurred."}`)}, + {StatusCode: 200, Body: body(`{"data":"valid"}`)}, + } + + s := service.New(aws.NewConfig().WithMaxRetries(10)) + s.Handlers.Validate.Clear() + s.Handlers.Unmarshal.PushBack(unmarshal) + s.Handlers.UnmarshalError.PushBack(unmarshalError) + s.Handlers.Send.Clear() // mock sending + s.Handlers.Send.PushBack(func(r *request.Request) { + r.HTTPResponse = &reqs[reqNum] + reqNum++ + }) + out := &testData{} + r := s.NewRequest(&request.Operation{Name: "Operation"}, nil, out) + err := r.Send() + assert.Nil(t, err) + assert.Equal(t, 2, int(r.RetryCount)) + assert.Equal(t, "valid", out.Data) +} + +// test that retries occur for 4xx status codes with a response type that can be retried - see `shouldRetry` +func TestRequestRecoverRetry4xxRetryable(t *testing.T) { + reqNum := 0 + reqs := []http.Response{ + {StatusCode: 400, Body: body(`{"__type":"Throttling","message":"Rate exceeded."}`)}, + {StatusCode: 429, Body: body(`{"__type":"ProvisionedThroughputExceededException","message":"Rate exceeded."}`)}, + {StatusCode: 200, Body: body(`{"data":"valid"}`)}, + } + + s := service.New(aws.NewConfig().WithMaxRetries(10)) + s.Handlers.Validate.Clear() + s.Handlers.Unmarshal.PushBack(unmarshal) + s.Handlers.UnmarshalError.PushBack(unmarshalError) + s.Handlers.Send.Clear() // mock sending + s.Handlers.Send.PushBack(func(r *request.Request) { + r.HTTPResponse = &reqs[reqNum] + reqNum++ + }) + out := &testData{} + r := s.NewRequest(&request.Operation{Name: "Operation"}, nil, out) + err := r.Send() + assert.Nil(t, err) + assert.Equal(t, 2, int(r.RetryCount)) + assert.Equal(t, "valid", out.Data) +} + +// test that retries don't occur for 4xx status codes with a response type that can't be retried +func TestRequest4xxUnretryable(t *testing.T) { + s := service.New(aws.NewConfig().WithMaxRetries(10)) + s.Handlers.Validate.Clear() + s.Handlers.Unmarshal.PushBack(unmarshal) + s.Handlers.UnmarshalError.PushBack(unmarshalError) + s.Handlers.Send.Clear() // mock sending + s.Handlers.Send.PushBack(func(r *request.Request) { + r.HTTPResponse = &http.Response{StatusCode: 401, Body: body(`{"__type":"SignatureDoesNotMatch","message":"Signature does not match."}`)} + }) + out := &testData{} + r := s.NewRequest(&request.Operation{Name: "Operation"}, nil, out) + err := r.Send() + assert.NotNil(t, err) + if e, ok := err.(awserr.RequestFailure); ok { + assert.Equal(t, 401, e.StatusCode()) + } else { + assert.Fail(t, "Expected error to be a service failure") + } + assert.Equal(t, "SignatureDoesNotMatch", err.(awserr.Error).Code()) + assert.Equal(t, "Signature does not match.", err.(awserr.Error).Message()) + assert.Equal(t, 0, int(r.RetryCount)) +} + +func TestRequestExhaustRetries(t *testing.T) { + delays := []time.Duration{} + sleepDelay := func(delay time.Duration) { + delays = append(delays, delay) + } + + reqNum := 0 + reqs := []http.Response{ + {StatusCode: 500, Body: body(`{"__type":"UnknownError","message":"An error occurred."}`)}, + {StatusCode: 500, Body: body(`{"__type":"UnknownError","message":"An error occurred."}`)}, + {StatusCode: 500, Body: body(`{"__type":"UnknownError","message":"An error occurred."}`)}, + {StatusCode: 500, Body: body(`{"__type":"UnknownError","message":"An error occurred."}`)}, + } + + s := service.New(aws.NewConfig().WithMaxRetries(aws.DefaultRetries).WithSleepDelay(sleepDelay)) + s.Handlers.Validate.Clear() + s.Handlers.Unmarshal.PushBack(unmarshal) + s.Handlers.UnmarshalError.PushBack(unmarshalError) + s.Handlers.Send.Clear() // mock sending + s.Handlers.Send.PushBack(func(r *request.Request) { + r.HTTPResponse = &reqs[reqNum] + reqNum++ + }) + r := s.NewRequest(&request.Operation{Name: "Operation"}, nil, nil) + err := r.Send() + assert.NotNil(t, err) + if e, ok := err.(awserr.RequestFailure); ok { + assert.Equal(t, 500, e.StatusCode()) + } else { + assert.Fail(t, "Expected error to be a service failure") + } + assert.Equal(t, "UnknownError", err.(awserr.Error).Code()) + assert.Equal(t, "An error occurred.", err.(awserr.Error).Message()) + assert.Equal(t, 3, int(r.RetryCount)) + + expectDelays := []struct{ min, max time.Duration }{{30, 59}, {60, 118}, {120, 236}} + for i, v := range delays { + min := expectDelays[i].min * time.Millisecond + max := expectDelays[i].max * time.Millisecond + assert.True(t, min <= v && v <= max, + "Expect delay to be within range, i:%d, v:%s, min:%s, max:%s", i, v, min, max) + } +} + +// test that the request is retried after the credentials are expired. +func TestRequestRecoverExpiredCreds(t *testing.T) { + reqNum := 0 + reqs := []http.Response{ + {StatusCode: 400, Body: body(`{"__type":"ExpiredTokenException","message":"expired token"}`)}, + {StatusCode: 200, Body: body(`{"data":"valid"}`)}, + } + + s := service.New(&aws.Config{MaxRetries: aws.Int(10), Credentials: credentials.NewStaticCredentials("AKID", "SECRET", "")}) + s.Handlers.Validate.Clear() + s.Handlers.Unmarshal.PushBack(unmarshal) + s.Handlers.UnmarshalError.PushBack(unmarshalError) + + credExpiredBeforeRetry := false + credExpiredAfterRetry := false + + s.Handlers.AfterRetry.PushBack(func(r *request.Request) { + credExpiredAfterRetry = r.Service.Config.Credentials.IsExpired() + }) + + s.Handlers.Sign.Clear() + s.Handlers.Sign.PushBack(func(r *request.Request) { + r.Service.Config.Credentials.Get() + }) + s.Handlers.Send.Clear() // mock sending + s.Handlers.Send.PushBack(func(r *request.Request) { + r.HTTPResponse = &reqs[reqNum] + reqNum++ + }) + out := &testData{} + r := s.NewRequest(&request.Operation{Name: "Operation"}, nil, out) + err := r.Send() + assert.Nil(t, err) + + assert.False(t, credExpiredBeforeRetry, "Expect valid creds before retry check") + assert.True(t, credExpiredAfterRetry, "Expect expired creds after retry check") + assert.False(t, s.Config.Credentials.IsExpired(), "Expect valid creds after cred expired recovery") + + assert.Equal(t, 1, int(r.RetryCount)) + assert.Equal(t, "valid", out.Data) +} diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/request/retryer.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/request/retryer.go new file mode 100644 index 000000000000..f03b0c659607 --- /dev/null +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/request/retryer.go @@ -0,0 +1,71 @@ +package request + +import ( + "time" + + "github.com/aws/aws-sdk-go/aws/awserr" +) + +// Retryer is an interface to control retry logic for a given service. +// The default implementation used by most services is the service.DefaultRetryer +// structure, which contains basic retry logic using exponential backoff. +type Retryer interface { + RetryRules(*Request) time.Duration + ShouldRetry(*Request) bool + MaxRetries() uint +} + +// retryableCodes is a collection of service response codes which are retry-able +// without any further action. +var retryableCodes = map[string]struct{}{ + "RequestError": {}, + "ProvisionedThroughputExceededException": {}, + "Throttling": {}, + "ThrottlingException": {}, + "RequestLimitExceeded": {}, + "RequestThrottled": {}, +} + +// credsExpiredCodes is a collection of error codes which signify the credentials +// need to be refreshed. Expired tokens require refreshing of credentials, and +// resigning before the request can be retried. +var credsExpiredCodes = map[string]struct{}{ + "ExpiredToken": {}, + "ExpiredTokenException": {}, + "RequestExpired": {}, // EC2 Only +} + +func isCodeRetryable(code string) bool { + if _, ok := retryableCodes[code]; ok { + return true + } + + return isCodeExpiredCreds(code) +} + +func isCodeExpiredCreds(code string) bool { + _, ok := credsExpiredCodes[code] + return ok +} + +// IsErrorRetryable returns whether the error is retryable, based on its Code. +// Returns false if the request has no Error set. +func (r *Request) IsErrorRetryable() bool { + if r.Error != nil { + if err, ok := r.Error.(awserr.Error); ok { + return isCodeRetryable(err.Code()) + } + } + return false +} + +// IsErrorExpired returns whether the error code is a credential expiry error. +// Returns false if the request has no Error set. +func (r *Request) IsErrorExpired() bool { + if r.Error != nil { + if err, ok := r.Error.(awserr.Error); ok { + return isCodeExpiredCreds(err.Code()) + } + } + return false +} diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/request_pagination_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/request_pagination_test.go deleted file mode 100644 index eabd9aea7a4a..000000000000 --- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/request_pagination_test.go +++ /dev/null @@ -1,305 +0,0 @@ -package aws_test - -import ( - "testing" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/internal/test/unit" - "github.com/aws/aws-sdk-go/service/dynamodb" - "github.com/aws/aws-sdk-go/service/s3" - "github.com/stretchr/testify/assert" -) - -var _ = unit.Imported - -// Use DynamoDB methods for simplicity -func TestPagination(t *testing.T) { - db := dynamodb.New(nil) - tokens, pages, numPages, gotToEnd := []string{}, []string{}, 0, false - - reqNum := 0 - resps := []*dynamodb.ListTablesOutput{ - &dynamodb.ListTablesOutput{TableNames: []*string{aws.String("Table1"), aws.String("Table2")}, LastEvaluatedTableName: aws.String("Table2")}, - &dynamodb.ListTablesOutput{TableNames: []*string{aws.String("Table3"), aws.String("Table4")}, LastEvaluatedTableName: aws.String("Table4")}, - &dynamodb.ListTablesOutput{TableNames: []*string{aws.String("Table5")}}, - } - - db.Handlers.Send.Clear() // mock sending - db.Handlers.Unmarshal.Clear() - db.Handlers.UnmarshalMeta.Clear() - db.Handlers.ValidateResponse.Clear() - db.Handlers.Build.PushBack(func(r *aws.Request) { - in := r.Params.(*dynamodb.ListTablesInput) - if in == nil { - tokens = append(tokens, "") - } else if in.ExclusiveStartTableName != nil { - tokens = append(tokens, *in.ExclusiveStartTableName) - } - }) - db.Handlers.Unmarshal.PushBack(func(r *aws.Request) { - r.Data = resps[reqNum] - reqNum++ - }) - - params := &dynamodb.ListTablesInput{Limit: aws.Long(2)} - err := db.ListTablesPages(params, func(p *dynamodb.ListTablesOutput, last bool) bool { - numPages++ - for _, t := range p.TableNames { - pages = append(pages, *t) - } - if last { - if gotToEnd { - assert.Fail(t, "last=true happened twice") - } - gotToEnd = true - } - return true - }) - - assert.Equal(t, []string{"Table2", "Table4"}, tokens) - assert.Equal(t, []string{"Table1", "Table2", "Table3", "Table4", "Table5"}, pages) - assert.Equal(t, 3, numPages) - assert.True(t, gotToEnd) - assert.Nil(t, err) - assert.Nil(t, params.ExclusiveStartTableName) -} - -// Use DynamoDB methods for simplicity -func TestPaginationEachPage(t *testing.T) { - db := dynamodb.New(nil) - tokens, pages, numPages, gotToEnd := []string{}, []string{}, 0, false - - reqNum := 0 - resps := []*dynamodb.ListTablesOutput{ - &dynamodb.ListTablesOutput{TableNames: []*string{aws.String("Table1"), aws.String("Table2")}, LastEvaluatedTableName: aws.String("Table2")}, - &dynamodb.ListTablesOutput{TableNames: []*string{aws.String("Table3"), aws.String("Table4")}, LastEvaluatedTableName: aws.String("Table4")}, - &dynamodb.ListTablesOutput{TableNames: []*string{aws.String("Table5")}}, - } - - db.Handlers.Send.Clear() // mock sending - db.Handlers.Unmarshal.Clear() - db.Handlers.UnmarshalMeta.Clear() - db.Handlers.ValidateResponse.Clear() - db.Handlers.Build.PushBack(func(r *aws.Request) { - in := r.Params.(*dynamodb.ListTablesInput) - if in == nil { - tokens = append(tokens, "") - } else if in.ExclusiveStartTableName != nil { - tokens = append(tokens, *in.ExclusiveStartTableName) - } - }) - db.Handlers.Unmarshal.PushBack(func(r *aws.Request) { - r.Data = resps[reqNum] - reqNum++ - }) - - params := &dynamodb.ListTablesInput{Limit: aws.Long(2)} - req, _ := db.ListTablesRequest(params) - err := req.EachPage(func(p interface{}, last bool) bool { - numPages++ - for _, t := range p.(*dynamodb.ListTablesOutput).TableNames { - pages = append(pages, *t) - } - if last { - if gotToEnd { - assert.Fail(t, "last=true happened twice") - } - gotToEnd = true - } - - return true - }) - - assert.Equal(t, []string{"Table2", "Table4"}, tokens) - assert.Equal(t, []string{"Table1", "Table2", "Table3", "Table4", "Table5"}, pages) - assert.Equal(t, 3, numPages) - assert.True(t, gotToEnd) - assert.Nil(t, err) -} - -// Use DynamoDB methods for simplicity -func TestPaginationEarlyExit(t *testing.T) { - db := dynamodb.New(nil) - numPages, gotToEnd := 0, false - - reqNum := 0 - resps := []*dynamodb.ListTablesOutput{ - &dynamodb.ListTablesOutput{TableNames: []*string{aws.String("Table1"), aws.String("Table2")}, LastEvaluatedTableName: aws.String("Table2")}, - &dynamodb.ListTablesOutput{TableNames: []*string{aws.String("Table3"), aws.String("Table4")}, LastEvaluatedTableName: aws.String("Table4")}, - &dynamodb.ListTablesOutput{TableNames: []*string{aws.String("Table5")}}, - } - - db.Handlers.Send.Clear() // mock sending - db.Handlers.Unmarshal.Clear() - db.Handlers.UnmarshalMeta.Clear() - db.Handlers.ValidateResponse.Clear() - db.Handlers.Unmarshal.PushBack(func(r *aws.Request) { - r.Data = resps[reqNum] - reqNum++ - }) - - params := &dynamodb.ListTablesInput{Limit: aws.Long(2)} - err := db.ListTablesPages(params, func(p *dynamodb.ListTablesOutput, last bool) bool { - numPages++ - if numPages == 2 { - return false - } - if last { - if gotToEnd { - assert.Fail(t, "last=true happened twice") - } - gotToEnd = true - } - return true - }) - - assert.Equal(t, 2, numPages) - assert.False(t, gotToEnd) - assert.Nil(t, err) -} - -func TestSkipPagination(t *testing.T) { - client := s3.New(nil) - client.Handlers.Send.Clear() // mock sending - client.Handlers.Unmarshal.Clear() - client.Handlers.UnmarshalMeta.Clear() - client.Handlers.ValidateResponse.Clear() - client.Handlers.Unmarshal.PushBack(func(r *aws.Request) { - r.Data = &s3.HeadBucketOutput{} - }) - - req, _ := client.HeadBucketRequest(&s3.HeadBucketInput{Bucket: aws.String("bucket")}) - - numPages, gotToEnd := 0, false - req.EachPage(func(p interface{}, last bool) bool { - numPages++ - if last { - gotToEnd = true - } - return true - }) - assert.Equal(t, 1, numPages) - assert.True(t, gotToEnd) -} - -// Use S3 for simplicity -func TestPaginationTruncation(t *testing.T) { - count := 0 - client := s3.New(nil) - - reqNum := &count - resps := []*s3.ListObjectsOutput{ - &s3.ListObjectsOutput{IsTruncated: aws.Boolean(true), Contents: []*s3.Object{&s3.Object{Key: aws.String("Key1")}}}, - &s3.ListObjectsOutput{IsTruncated: aws.Boolean(true), Contents: []*s3.Object{&s3.Object{Key: aws.String("Key2")}}}, - &s3.ListObjectsOutput{IsTruncated: aws.Boolean(false), Contents: []*s3.Object{&s3.Object{Key: aws.String("Key3")}}}, - &s3.ListObjectsOutput{IsTruncated: aws.Boolean(true), Contents: []*s3.Object{&s3.Object{Key: aws.String("Key4")}}}, - } - - client.Handlers.Send.Clear() // mock sending - client.Handlers.Unmarshal.Clear() - client.Handlers.UnmarshalMeta.Clear() - client.Handlers.ValidateResponse.Clear() - client.Handlers.Unmarshal.PushBack(func(r *aws.Request) { - r.Data = resps[*reqNum] - *reqNum++ - }) - - params := &s3.ListObjectsInput{Bucket: aws.String("bucket")} - - results := []string{} - err := client.ListObjectsPages(params, func(p *s3.ListObjectsOutput, last bool) bool { - results = append(results, *p.Contents[0].Key) - return true - }) - - assert.Equal(t, []string{"Key1", "Key2", "Key3"}, results) - assert.Nil(t, err) - - // Try again without truncation token at all - count = 0 - resps[1].IsTruncated = nil - resps[2].IsTruncated = aws.Boolean(true) - results = []string{} - err = client.ListObjectsPages(params, func(p *s3.ListObjectsOutput, last bool) bool { - results = append(results, *p.Contents[0].Key) - return true - }) - - assert.Equal(t, []string{"Key1", "Key2"}, results) - assert.Nil(t, err) - -} - -// Benchmarks -var benchResps = []*dynamodb.ListTablesOutput{ - &dynamodb.ListTablesOutput{TableNames: []*string{aws.String("TABLE"), aws.String("NXT")}, LastEvaluatedTableName: aws.String("NXT")}, - &dynamodb.ListTablesOutput{TableNames: []*string{aws.String("TABLE"), aws.String("NXT")}, LastEvaluatedTableName: aws.String("NXT")}, - &dynamodb.ListTablesOutput{TableNames: []*string{aws.String("TABLE"), aws.String("NXT")}, LastEvaluatedTableName: aws.String("NXT")}, - &dynamodb.ListTablesOutput{TableNames: []*string{aws.String("TABLE"), aws.String("NXT")}, LastEvaluatedTableName: aws.String("NXT")}, - &dynamodb.ListTablesOutput{TableNames: []*string{aws.String("TABLE"), aws.String("NXT")}, LastEvaluatedTableName: aws.String("NXT")}, - &dynamodb.ListTablesOutput{TableNames: []*string{aws.String("TABLE"), aws.String("NXT")}, LastEvaluatedTableName: aws.String("NXT")}, - &dynamodb.ListTablesOutput{TableNames: []*string{aws.String("TABLE"), aws.String("NXT")}, LastEvaluatedTableName: aws.String("NXT")}, - &dynamodb.ListTablesOutput{TableNames: []*string{aws.String("TABLE"), aws.String("NXT")}, LastEvaluatedTableName: aws.String("NXT")}, - &dynamodb.ListTablesOutput{TableNames: []*string{aws.String("TABLE"), aws.String("NXT")}, LastEvaluatedTableName: aws.String("NXT")}, - &dynamodb.ListTablesOutput{TableNames: []*string{aws.String("TABLE"), aws.String("NXT")}, LastEvaluatedTableName: aws.String("NXT")}, - &dynamodb.ListTablesOutput{TableNames: []*string{aws.String("TABLE"), aws.String("NXT")}, LastEvaluatedTableName: aws.String("NXT")}, - &dynamodb.ListTablesOutput{TableNames: []*string{aws.String("TABLE"), aws.String("NXT")}, LastEvaluatedTableName: aws.String("NXT")}, - &dynamodb.ListTablesOutput{TableNames: []*string{aws.String("TABLE"), aws.String("NXT")}, LastEvaluatedTableName: aws.String("NXT")}, - &dynamodb.ListTablesOutput{TableNames: []*string{aws.String("TABLE")}}, -} - -var benchDb = func() *dynamodb.DynamoDB { - db := dynamodb.New(nil) - db.Handlers.Send.Clear() // mock sending - db.Handlers.Unmarshal.Clear() - db.Handlers.UnmarshalMeta.Clear() - db.Handlers.ValidateResponse.Clear() - return db -} - -func BenchmarkCodegenIterator(b *testing.B) { - reqNum := 0 - db := benchDb() - db.Handlers.Unmarshal.PushBack(func(r *aws.Request) { - r.Data = benchResps[reqNum] - reqNum++ - }) - - input := &dynamodb.ListTablesInput{Limit: aws.Long(2)} - iter := func(fn func(*dynamodb.ListTablesOutput, bool) bool) error { - page, _ := db.ListTablesRequest(input) - for ; page != nil; page = page.NextPage() { - page.Send() - out := page.Data.(*dynamodb.ListTablesOutput) - if result := fn(out, !page.HasNextPage()); page.Error != nil || !result { - return page.Error - } - } - return nil - } - - for i := 0; i < b.N; i++ { - reqNum = 0 - iter(func(p *dynamodb.ListTablesOutput, last bool) bool { - return true - }) - } -} - -func BenchmarkEachPageIterator(b *testing.B) { - reqNum := 0 - db := benchDb() - db.Handlers.Unmarshal.PushBack(func(r *aws.Request) { - r.Data = benchResps[reqNum] - reqNum++ - }) - - input := &dynamodb.ListTablesInput{Limit: aws.Long(2)} - for i := 0; i < b.N; i++ { - reqNum = 0 - req, _ := db.ListTablesRequest(input) - req.EachPage(func(p interface{}, last bool) bool { - return true - }) - } -} diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/request_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/request_test.go deleted file mode 100644 index 27507f039d3e..000000000000 --- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/request_test.go +++ /dev/null @@ -1,220 +0,0 @@ -package aws - -import ( - "bytes" - "encoding/json" - "fmt" - "io" - "io/ioutil" - "net/http" - "reflect" - "testing" - "time" - - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/aws/credentials" - "github.com/aws/aws-sdk-go/internal/apierr" - "github.com/stretchr/testify/assert" -) - -type testData struct { - Data string -} - -func body(str string) io.ReadCloser { - return ioutil.NopCloser(bytes.NewReader([]byte(str))) -} - -func unmarshal(req *Request) { - defer req.HTTPResponse.Body.Close() - if req.Data != nil { - json.NewDecoder(req.HTTPResponse.Body).Decode(req.Data) - } - return -} - -func unmarshalError(req *Request) { - bodyBytes, err := ioutil.ReadAll(req.HTTPResponse.Body) - if err != nil { - req.Error = apierr.New("UnmarshaleError", req.HTTPResponse.Status, err) - return - } - if len(bodyBytes) == 0 { - req.Error = apierr.NewRequestError( - apierr.New("UnmarshaleError", req.HTTPResponse.Status, fmt.Errorf("empty body")), - req.HTTPResponse.StatusCode, - "", - ) - return - } - var jsonErr jsonErrorResponse - if err := json.Unmarshal(bodyBytes, &jsonErr); err != nil { - req.Error = apierr.New("UnmarshaleError", "JSON unmarshal", err) - return - } - req.Error = apierr.NewRequestError( - apierr.New(jsonErr.Code, jsonErr.Message, nil), - req.HTTPResponse.StatusCode, - "", - ) -} - -type jsonErrorResponse struct { - Code string `json:"__type"` - Message string `json:"message"` -} - -// test that retries occur for 5xx status codes -func TestRequestRecoverRetry5xx(t *testing.T) { - reqNum := 0 - reqs := []http.Response{ - http.Response{StatusCode: 500, Body: body(`{"__type":"UnknownError","message":"An error occurred."}`)}, - http.Response{StatusCode: 501, Body: body(`{"__type":"UnknownError","message":"An error occurred."}`)}, - http.Response{StatusCode: 200, Body: body(`{"data":"valid"}`)}, - } - - s := NewService(&Config{MaxRetries: 10}) - s.Handlers.Validate.Clear() - s.Handlers.Unmarshal.PushBack(unmarshal) - s.Handlers.UnmarshalError.PushBack(unmarshalError) - s.Handlers.Send.Clear() // mock sending - s.Handlers.Send.PushBack(func(r *Request) { - r.HTTPResponse = &reqs[reqNum] - reqNum++ - }) - out := &testData{} - r := NewRequest(s, &Operation{Name: "Operation"}, nil, out) - err := r.Send() - assert.Nil(t, err) - assert.Equal(t, 2, int(r.RetryCount)) - assert.Equal(t, "valid", out.Data) -} - -// test that retries occur for 4xx status codes with a response type that can be retried - see `shouldRetry` -func TestRequestRecoverRetry4xxRetryable(t *testing.T) { - reqNum := 0 - reqs := []http.Response{ - http.Response{StatusCode: 400, Body: body(`{"__type":"Throttling","message":"Rate exceeded."}`)}, - http.Response{StatusCode: 429, Body: body(`{"__type":"ProvisionedThroughputExceededException","message":"Rate exceeded."}`)}, - http.Response{StatusCode: 200, Body: body(`{"data":"valid"}`)}, - } - - s := NewService(&Config{MaxRetries: 10}) - s.Handlers.Validate.Clear() - s.Handlers.Unmarshal.PushBack(unmarshal) - s.Handlers.UnmarshalError.PushBack(unmarshalError) - s.Handlers.Send.Clear() // mock sending - s.Handlers.Send.PushBack(func(r *Request) { - r.HTTPResponse = &reqs[reqNum] - reqNum++ - }) - out := &testData{} - r := NewRequest(s, &Operation{Name: "Operation"}, nil, out) - err := r.Send() - assert.Nil(t, err) - assert.Equal(t, 2, int(r.RetryCount)) - assert.Equal(t, "valid", out.Data) -} - -// test that retries don't occur for 4xx status codes with a response type that can't be retried -func TestRequest4xxUnretryable(t *testing.T) { - s := NewService(&Config{MaxRetries: 10}) - s.Handlers.Validate.Clear() - s.Handlers.Unmarshal.PushBack(unmarshal) - s.Handlers.UnmarshalError.PushBack(unmarshalError) - s.Handlers.Send.Clear() // mock sending - s.Handlers.Send.PushBack(func(r *Request) { - r.HTTPResponse = &http.Response{StatusCode: 401, Body: body(`{"__type":"SignatureDoesNotMatch","message":"Signature does not match."}`)} - }) - out := &testData{} - r := NewRequest(s, &Operation{Name: "Operation"}, nil, out) - err := r.Send() - assert.NotNil(t, err) - if e, ok := err.(awserr.RequestFailure); ok { - assert.Equal(t, 401, e.StatusCode()) - } else { - assert.Fail(t, "Expected error to be a service failure") - } - assert.Equal(t, "SignatureDoesNotMatch", err.(awserr.Error).Code()) - assert.Equal(t, "Signature does not match.", err.(awserr.Error).Message()) - assert.Equal(t, 0, int(r.RetryCount)) -} - -func TestRequestExhaustRetries(t *testing.T) { - delays := []time.Duration{} - sleepDelay = func(delay time.Duration) { - delays = append(delays, delay) - } - - reqNum := 0 - reqs := []http.Response{ - http.Response{StatusCode: 500, Body: body(`{"__type":"UnknownError","message":"An error occurred."}`)}, - http.Response{StatusCode: 500, Body: body(`{"__type":"UnknownError","message":"An error occurred."}`)}, - http.Response{StatusCode: 500, Body: body(`{"__type":"UnknownError","message":"An error occurred."}`)}, - http.Response{StatusCode: 500, Body: body(`{"__type":"UnknownError","message":"An error occurred."}`)}, - } - - s := NewService(&Config{MaxRetries: -1}) - s.Handlers.Validate.Clear() - s.Handlers.Unmarshal.PushBack(unmarshal) - s.Handlers.UnmarshalError.PushBack(unmarshalError) - s.Handlers.Send.Clear() // mock sending - s.Handlers.Send.PushBack(func(r *Request) { - r.HTTPResponse = &reqs[reqNum] - reqNum++ - }) - r := NewRequest(s, &Operation{Name: "Operation"}, nil, nil) - err := r.Send() - assert.NotNil(t, err) - if e, ok := err.(awserr.RequestFailure); ok { - assert.Equal(t, 500, e.StatusCode()) - } else { - assert.Fail(t, "Expected error to be a service failure") - } - assert.Equal(t, "UnknownError", err.(awserr.Error).Code()) - assert.Equal(t, "An error occurred.", err.(awserr.Error).Message()) - assert.Equal(t, 3, int(r.RetryCount)) - assert.True(t, reflect.DeepEqual([]time.Duration{30 * time.Millisecond, 60 * time.Millisecond, 120 * time.Millisecond}, delays)) -} - -// test that the request is retried after the credentials are expired. -func TestRequestRecoverExpiredCreds(t *testing.T) { - reqNum := 0 - reqs := []http.Response{ - http.Response{StatusCode: 400, Body: body(`{"__type":"ExpiredTokenException","message":"expired token"}`)}, - http.Response{StatusCode: 200, Body: body(`{"data":"valid"}`)}, - } - - s := NewService(&Config{MaxRetries: 10, Credentials: credentials.NewStaticCredentials("AKID", "SECRET", "")}) - s.Handlers.Validate.Clear() - s.Handlers.Unmarshal.PushBack(unmarshal) - s.Handlers.UnmarshalError.PushBack(unmarshalError) - - credExpiredBeforeRetry := false - credExpiredAfterRetry := false - - s.Handlers.AfterRetry.PushBack(func(r *Request) { - credExpiredAfterRetry = r.Config.Credentials.IsExpired() - }) - - s.Handlers.Sign.Clear() - s.Handlers.Sign.PushBack(func(r *Request) { - r.Config.Credentials.Get() - }) - s.Handlers.Send.Clear() // mock sending - s.Handlers.Send.PushBack(func(r *Request) { - r.HTTPResponse = &reqs[reqNum] - reqNum++ - }) - out := &testData{} - r := NewRequest(s, &Operation{Name: "Operation"}, nil, out) - err := r.Send() - assert.Nil(t, err) - - assert.False(t, credExpiredBeforeRetry, "Expect valid creds before retry check") - assert.True(t, credExpiredAfterRetry, "Expect expired creds after retry check") - assert.False(t, s.Config.Credentials.IsExpired(), "Expect valid creds after cred expired recovery") - - assert.Equal(t, 1, int(r.RetryCount)) - assert.Equal(t, "valid", out.Data) -} diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/service.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/service.go deleted file mode 100644 index 7e8e229ba4f2..000000000000 --- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/service.go +++ /dev/null @@ -1,177 +0,0 @@ -package aws - -import ( - "fmt" - "math" - "net/http" - "net/http/httputil" - "regexp" - "time" - - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/internal/endpoints" -) - -// A Service implements the base service request and response handling -// used by all services. -type Service struct { - Config *Config - Handlers Handlers - ManualSend bool - ServiceName string - APIVersion string - Endpoint string - SigningName string - SigningRegion string - JSONVersion string - TargetPrefix string - RetryRules func(*Request) time.Duration - ShouldRetry func(*Request) bool - DefaultMaxRetries uint -} - -var schemeRE = regexp.MustCompile("^([^:]+)://") - -// NewService will return a pointer to a new Server object initialized. -func NewService(config *Config) *Service { - svc := &Service{Config: config} - svc.Initialize() - return svc -} - -// Initialize initializes the service. -func (s *Service) Initialize() { - if s.Config == nil { - s.Config = &Config{} - } - if s.Config.HTTPClient == nil { - s.Config.HTTPClient = http.DefaultClient - } - - if s.RetryRules == nil { - s.RetryRules = retryRules - } - - if s.ShouldRetry == nil { - s.ShouldRetry = shouldRetry - } - - s.DefaultMaxRetries = 3 - s.Handlers.Validate.PushBack(ValidateEndpointHandler) - s.Handlers.Build.PushBack(UserAgentHandler) - s.Handlers.Sign.PushBack(BuildContentLength) - s.Handlers.Send.PushBack(SendHandler) - s.Handlers.AfterRetry.PushBack(AfterRetryHandler) - s.Handlers.ValidateResponse.PushBack(ValidateResponseHandler) - s.AddDebugHandlers() - s.buildEndpoint() - - if !s.Config.DisableParamValidation { - s.Handlers.Validate.PushBack(ValidateParameters) - } -} - -// buildEndpoint builds the endpoint values the service will use to make requests with. -func (s *Service) buildEndpoint() { - if s.Config.Endpoint != "" { - s.Endpoint = s.Config.Endpoint - } else { - s.Endpoint, s.SigningRegion = - endpoints.EndpointForRegion(s.ServiceName, s.Config.Region) - } - - if s.Endpoint != "" && !schemeRE.MatchString(s.Endpoint) { - scheme := "https" - if s.Config.DisableSSL { - scheme = "http" - } - s.Endpoint = scheme + "://" + s.Endpoint - } -} - -// AddDebugHandlers injects debug logging handlers into the service to log request -// debug information. -func (s *Service) AddDebugHandlers() { - out := s.Config.Logger - if s.Config.LogLevel == 0 { - return - } - - s.Handlers.Send.PushFront(func(r *Request) { - logBody := r.Config.LogHTTPBody - dumpedBody, _ := httputil.DumpRequestOut(r.HTTPRequest, logBody) - - fmt.Fprintf(out, "---[ REQUEST POST-SIGN ]-----------------------------\n") - fmt.Fprintf(out, "%s\n", string(dumpedBody)) - fmt.Fprintf(out, "-----------------------------------------------------\n") - }) - s.Handlers.Send.PushBack(func(r *Request) { - fmt.Fprintf(out, "---[ RESPONSE ]--------------------------------------\n") - if r.HTTPResponse != nil { - logBody := r.Config.LogHTTPBody - dumpedBody, _ := httputil.DumpResponse(r.HTTPResponse, logBody) - fmt.Fprintf(out, "%s\n", string(dumpedBody)) - } else if r.Error != nil { - fmt.Fprintf(out, "%s\n", r.Error) - } - fmt.Fprintf(out, "-----------------------------------------------------\n") - }) -} - -// MaxRetries returns the number of maximum returns the service will use to make -// an individual API request. -func (s *Service) MaxRetries() uint { - if s.Config.MaxRetries < 0 { - return s.DefaultMaxRetries - } - return uint(s.Config.MaxRetries) -} - -// retryRules returns the delay duration before retrying this request again -func retryRules(r *Request) time.Duration { - delay := time.Duration(math.Pow(2, float64(r.RetryCount))) * 30 - return delay * time.Millisecond -} - -// retryableCodes is a collection of service response codes which are retry-able -// without any further action. -var retryableCodes = map[string]struct{}{ - "RequestError": struct{}{}, - "ProvisionedThroughputExceededException": struct{}{}, - "Throttling": struct{}{}, -} - -// credsExpiredCodes is a collection of error codes which signify the credentials -// need to be refreshed. Expired tokens require refreshing of credentials, and -// resigning before the request can be retried. -var credsExpiredCodes = map[string]struct{}{ - "ExpiredToken": struct{}{}, - "ExpiredTokenException": struct{}{}, - "RequestExpired": struct{}{}, // EC2 Only -} - -func isCodeRetryable(code string) bool { - if _, ok := retryableCodes[code]; ok { - return true - } - - return isCodeExpiredCreds(code) -} - -func isCodeExpiredCreds(code string) bool { - _, ok := credsExpiredCodes[code] - return ok -} - -// shouldRetry returns if the request should be retried. -func shouldRetry(r *Request) bool { - if r.HTTPResponse.StatusCode >= 500 { - return true - } - if r.Error != nil { - if err, ok := r.Error.(awserr.Error); ok { - return isCodeRetryable(err.Code()) - } - } - return false -} diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/service/default_retryer.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/service/default_retryer.go new file mode 100644 index 000000000000..e642d16b716e --- /dev/null +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/service/default_retryer.go @@ -0,0 +1,51 @@ +package service + +import ( + "math" + "math/rand" + "time" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/request" +) + +// DefaultRetryer implements basic retry logic using exponential backoff for +// most services. If you want to implement custom retry logic, implement the +// request.Retryer interface or create a structure type that composes this +// struct and override the specific methods. For example, to override only +// the MaxRetries method: +// +// type retryer struct { +// service.DefaultRetryer +// } +// +// // This implementation always has 100 max retries +// func (d retryer) MaxRetries() uint { return 100 } +type DefaultRetryer struct { + *Service +} + +// MaxRetries returns the number of maximum returns the service will use to make +// an individual API request. +func (d DefaultRetryer) MaxRetries() uint { + if aws.IntValue(d.Service.Config.MaxRetries) < 0 { + return d.DefaultMaxRetries + } + return uint(aws.IntValue(d.Service.Config.MaxRetries)) +} + +var seededRand = rand.New(rand.NewSource(time.Now().UnixNano())) + +// RetryRules returns the delay duration before retrying this request again +func (d DefaultRetryer) RetryRules(r *request.Request) time.Duration { + delay := int(math.Pow(2, float64(r.RetryCount))) * (seededRand.Intn(30) + 30) + return time.Duration(delay) * time.Millisecond +} + +// ShouldRetry returns if the request should be retried. +func (d DefaultRetryer) ShouldRetry(r *request.Request) bool { + if r.HTTPResponse.StatusCode >= 500 { + return true + } + return r.IsErrorRetryable() +} diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/service/service.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/service/service.go new file mode 100644 index 000000000000..7205212e19b1 --- /dev/null +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/service/service.go @@ -0,0 +1,133 @@ +package service + +import ( + "fmt" + "io/ioutil" + "net/http" + "net/http/httputil" + "regexp" + "time" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/corehandlers" + "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/aws/service/serviceinfo" + "github.com/aws/aws-sdk-go/internal/endpoints" +) + +// A Service implements the base service request and response handling +// used by all services. +type Service struct { + serviceinfo.ServiceInfo + request.Retryer + DefaultMaxRetries uint + Handlers request.Handlers +} + +var schemeRE = regexp.MustCompile("^([^:]+)://") + +// New will return a pointer to a new Server object initialized. +func New(config *aws.Config) *Service { + svc := &Service{ServiceInfo: serviceinfo.ServiceInfo{Config: config}} + svc.Initialize() + return svc +} + +// Initialize initializes the service. +func (s *Service) Initialize() { + if s.Config == nil { + s.Config = &aws.Config{} + } + if s.Config.HTTPClient == nil { + s.Config.HTTPClient = http.DefaultClient + } + if s.Config.SleepDelay == nil { + s.Config.SleepDelay = time.Sleep + } + + s.Retryer = DefaultRetryer{s} + s.DefaultMaxRetries = 3 + s.Handlers.Validate.PushBackNamed(corehandlers.ValidateEndpointHandler) + s.Handlers.Build.PushBackNamed(corehandlers.UserAgentHandler) + s.Handlers.Sign.PushBackNamed(corehandlers.BuildContentLengthHandler) + s.Handlers.Send.PushBackNamed(corehandlers.SendHandler) + s.Handlers.AfterRetry.PushBackNamed(corehandlers.AfterRetryHandler) + s.Handlers.ValidateResponse.PushBackNamed(corehandlers.ValidateResponseHandler) + if !aws.BoolValue(s.Config.DisableParamValidation) { + s.Handlers.Validate.PushBackNamed(corehandlers.ValidateParametersHandler) + } + s.AddDebugHandlers() + s.buildEndpoint() +} + +// NewRequest returns a new Request pointer for the service API +// operation and parameters. +func (s *Service) NewRequest(operation *request.Operation, params interface{}, data interface{}) *request.Request { + return request.New(s.ServiceInfo, s.Handlers, s.Retryer, operation, params, data) +} + +// buildEndpoint builds the endpoint values the service will use to make requests with. +func (s *Service) buildEndpoint() { + if aws.StringValue(s.Config.Endpoint) != "" { + s.Endpoint = *s.Config.Endpoint + } else if s.Endpoint == "" { + s.Endpoint, s.SigningRegion = + endpoints.EndpointForRegion(s.ServiceName, aws.StringValue(s.Config.Region)) + } + + if s.Endpoint != "" && !schemeRE.MatchString(s.Endpoint) { + scheme := "https" + if aws.BoolValue(s.Config.DisableSSL) { + scheme = "http" + } + s.Endpoint = scheme + "://" + s.Endpoint + } +} + +// AddDebugHandlers injects debug logging handlers into the service to log request +// debug information. +func (s *Service) AddDebugHandlers() { + if !s.Config.LogLevel.AtLeast(aws.LogDebug) { + return + } + + s.Handlers.Send.PushFront(logRequest) + s.Handlers.Send.PushBack(logResponse) +} + +const logReqMsg = `DEBUG: Request %s/%s Details: +---[ REQUEST POST-SIGN ]----------------------------- +%s +-----------------------------------------------------` + +func logRequest(r *request.Request) { + logBody := r.Service.Config.LogLevel.Matches(aws.LogDebugWithHTTPBody) + dumpedBody, _ := httputil.DumpRequestOut(r.HTTPRequest, logBody) + + if logBody { + // Reset the request body because dumpRequest will re-wrap the r.HTTPRequest's + // Body as a NoOpCloser and will not be reset after read by the HTTP + // client reader. + r.Body.Seek(r.BodyStart, 0) + r.HTTPRequest.Body = ioutil.NopCloser(r.Body) + } + + r.Service.Config.Logger.Log(fmt.Sprintf(logReqMsg, r.Service.ServiceName, r.Operation.Name, string(dumpedBody))) +} + +const logRespMsg = `DEBUG: Response %s/%s Details: +---[ RESPONSE ]-------------------------------------- +%s +-----------------------------------------------------` + +func logResponse(r *request.Request) { + var msg = "no reponse data" + if r.HTTPResponse != nil { + logBody := r.Service.Config.LogLevel.Matches(aws.LogDebugWithHTTPBody) + dumpedBody, _ := httputil.DumpResponse(r.HTTPResponse, logBody) + msg = string(dumpedBody) + } else if r.Error != nil { + msg = r.Error.Error() + } + r.Service.Config.Logger.Log(fmt.Sprintf(logRespMsg, r.Service.ServiceName, r.Operation.Name, msg)) +} diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/service/serviceinfo/service_info.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/service/serviceinfo/service_info.go new file mode 100644 index 000000000000..a920e96a967d --- /dev/null +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/service/serviceinfo/service_info.go @@ -0,0 +1,15 @@ +package serviceinfo + +import "github.com/aws/aws-sdk-go/aws" + +// ServiceInfo wraps immutable data from the service.Service structure. +type ServiceInfo struct { + Config *aws.Config + ServiceName string + APIVersion string + Endpoint string + SigningName string + SigningRegion string + JSONVersion string + TargetPrefix string +} diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/types.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/types.go index 7801cb689a5a..846b732dda1f 100644 --- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/types.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/types.go @@ -1,36 +1,10 @@ package aws import ( - "fmt" "io" - "time" + "sync" ) -// String converts a Go string into a string pointer. -func String(v string) *string { - return &v -} - -// Boolean converts a Go bool into a boolean pointer. -func Boolean(v bool) *bool { - return &v -} - -// Long converts a Go int64 into a long pointer. -func Long(v int64) *int64 { - return &v -} - -// Double converts a Go float64 into a double pointer. -func Double(v float64) *float64 { - return &v -} - -// Time converts a Go Time into a Time pointer -func Time(t time.Time) *time.Time { - return &t -} - // ReadSeekCloser wraps a io.Reader returning a ReaderSeakerCloser func ReadSeekCloser(r io.Reader) ReaderSeekerCloser { return ReaderSeekerCloser{r} @@ -81,51 +55,34 @@ func (r ReaderSeekerCloser) Close() error { return nil } -// A SettableBool provides a boolean value which includes the state if -// the value was set or unset. The set state is in addition to the value's -// value(true|false) -type SettableBool struct { - value bool - set bool +// A WriteAtBuffer provides a in memory buffer supporting the io.WriterAt interface +// Can be used with the s3manager.Downloader to download content to a buffer +// in memory. Safe to use concurrently. +type WriteAtBuffer struct { + buf []byte + m sync.Mutex } -// SetBool returns a SettableBool with a value set -func SetBool(value bool) SettableBool { - return SettableBool{value: value, set: true} -} +// WriteAt writes a slice of bytes to a buffer starting at the position provided +// The number of bytes written will be returned, or error. Can overwrite previous +// written slices if the write ats overlap. +func (b *WriteAtBuffer) WriteAt(p []byte, pos int64) (n int, err error) { + b.m.Lock() + defer b.m.Unlock() -// Get returns the value. Will always be false if the SettableBool was not set. -func (b *SettableBool) Get() bool { - if !b.set { - return false + expLen := pos + int64(len(p)) + if int64(len(b.buf)) < expLen { + newBuf := make([]byte, expLen) + copy(newBuf, b.buf) + b.buf = newBuf } - return b.value -} - -// Set sets the value and updates the state that the value has been set. -func (b *SettableBool) Set(value bool) { - b.value = value - b.set = true -} - -// IsSet returns if the value has been set -func (b *SettableBool) IsSet() bool { - return b.set -} - -// Reset resets the state and value of the SettableBool to its initial default -// state of not set and zero value. -func (b *SettableBool) Reset() { - b.value = false - b.set = false -} - -// String returns the string representation of the value if set. Zero if not set. -func (b *SettableBool) String() string { - return fmt.Sprintf("%t", b.Get()) + copy(b.buf[pos:], p) + return len(p), nil } -// GoString returns the string representation of the SettableBool value and state -func (b *SettableBool) GoString() string { - return fmt.Sprintf("Bool{value:%t, set:%t}", b.value, b.set) +// Bytes returns a slice of bytes written to the buffer. +func (b *WriteAtBuffer) Bytes() []byte { + b.m.Lock() + defer b.m.Unlock() + return b.buf[:len(b.buf):len(b.buf)] } diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/types_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/types_test.go new file mode 100644 index 000000000000..a4ed20e7d220 --- /dev/null +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/types_test.go @@ -0,0 +1,56 @@ +package aws + +import ( + "math/rand" + "testing" + + "github.com/stretchr/testify/assert" +) + +func TestWriteAtBuffer(t *testing.T) { + b := &WriteAtBuffer{} + + n, err := b.WriteAt([]byte{1}, 0) + assert.NoError(t, err) + assert.Equal(t, 1, n) + + n, err = b.WriteAt([]byte{1, 1, 1}, 5) + assert.NoError(t, err) + assert.Equal(t, 3, n) + + n, err = b.WriteAt([]byte{2}, 1) + assert.NoError(t, err) + assert.Equal(t, 1, n) + + n, err = b.WriteAt([]byte{3}, 2) + assert.NoError(t, err) + assert.Equal(t, 1, n) + + assert.Equal(t, []byte{1, 2, 3, 0, 0, 1, 1, 1}, b.Bytes()) +} + +func BenchmarkWriteAtBuffer(b *testing.B) { + buf := &WriteAtBuffer{} + r := rand.New(rand.NewSource(1)) + + b.ResetTimer() + for i := 0; i < b.N; i++ { + to := r.Intn(10) * 4096 + bs := make([]byte, to) + buf.WriteAt(bs, r.Int63n(10)*4096) + } +} + +func BenchmarkWriteAtBufferParallel(b *testing.B) { + buf := &WriteAtBuffer{} + r := rand.New(rand.NewSource(1)) + + b.ResetTimer() + b.RunParallel(func(pb *testing.PB) { + for pb.Next() { + to := r.Intn(10) * 4096 + bs := make([]byte, to) + buf.WriteAt(bs, r.Int63n(10)*4096) + } + }) +} diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/version.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/version.go index 7c156dbe2a28..f89f1e112faf 100644 --- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/version.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/version.go @@ -5,4 +5,4 @@ package aws const SDKName = "aws-sdk-go" // SDKVersion is the version of this SDK -const SDKVersion = "0.6.0" +const SDKVersion = "0.9.9" diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/apierr/error.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/apierr/error.go deleted file mode 100644 index c45555a9f000..000000000000 --- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/apierr/error.go +++ /dev/null @@ -1,139 +0,0 @@ -// Package apierr represents API error types. -package apierr - -import "fmt" - -// A BaseError wraps the code and message which defines an error. It also -// can be used to wrap an original error object. -// -// Should be used as the root for errors satisfying the awserr.Error. Also -// for any error which does not fit into a specific error wrapper type. -type BaseError struct { - // Classification of error - code string - - // Detailed information about error - message string - - // Optional original error this error is based off of. Allows building - // chained errors. - origErr error -} - -// New returns an error object for the code, message, and err. -// -// code is a short no whitespace phrase depicting the classification of -// the error that is being created. -// -// message is the free flow string containing detailed information about the error. -// -// origErr is the error object which will be nested under the new error to be returned. -func New(code, message string, origErr error) *BaseError { - return &BaseError{ - code: code, - message: message, - origErr: origErr, - } -} - -// Error returns the string representation of the error. -// -// See ErrorWithExtra for formatting. -// -// Satisfies the error interface. -func (b *BaseError) Error() string { - return b.ErrorWithExtra("") -} - -// String returns the string representation of the error. -// Alias for Error to satisfy the stringer interface. -func (b *BaseError) String() string { - return b.Error() -} - -// Code returns the short phrase depicting the classification of the error. -func (b *BaseError) Code() string { - return b.code -} - -// Message returns the error details message. -func (b *BaseError) Message() string { - return b.message -} - -// OrigErr returns the original error if one was set. Nil is returned if no error -// was set. -func (b *BaseError) OrigErr() error { - return b.origErr -} - -// ErrorWithExtra is a helper method to add an extra string to the stratified -// error message. The extra message will be added on the next line below the -// error message like the following: -// -// : -// -// -// If there is a original error the error will be included on a new line. -// -// : -// -// caused by: -func (b *BaseError) ErrorWithExtra(extra string) string { - msg := fmt.Sprintf("%s: %s", b.code, b.message) - if extra != "" { - msg = fmt.Sprintf("%s\n\t%s", msg, extra) - } - if b.origErr != nil { - msg = fmt.Sprintf("%s\ncaused by: %s", msg, b.origErr.Error()) - } - return msg -} - -// A RequestError wraps a request or service error. -// -// Composed of BaseError for code, message, and original error. -type RequestError struct { - *BaseError - statusCode int - requestID string -} - -// NewRequestError returns a wrapped error with additional information for request -// status code, and service requestID. -// -// Should be used to wrap all request which involve service requests. Even if -// the request failed without a service response, but had an HTTP status code -// that may be meaningful. -// -// Also wraps original errors via the BaseError. -func NewRequestError(base *BaseError, statusCode int, requestID string) *RequestError { - return &RequestError{ - BaseError: base, - statusCode: statusCode, - requestID: requestID, - } -} - -// Error returns the string representation of the error. -// Satisfies the error interface. -func (r *RequestError) Error() string { - return r.ErrorWithExtra(fmt.Sprintf("status code: %d, request id: [%s]", - r.statusCode, r.requestID)) -} - -// String returns the string representation of the error. -// Alias for Error to satisfy the stringer interface. -func (r *RequestError) String() string { - return r.Error() -} - -// StatusCode returns the wrapped status code for the error -func (r *RequestError) StatusCode() int { - return r.statusCode -} - -// RequestID returns the wrapped requestID -func (r *RequestError) RequestID() string { - return r.requestID -} diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/endpoints/endpoints.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/endpoints/endpoints.go index 32e87c8a4a4f..d040cccd57d3 100644 --- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/endpoints/endpoints.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/endpoints/endpoints.go @@ -2,6 +2,7 @@ package endpoints //go:generate go run ../model/cli/gen-endpoints/main.go endpoints.json endpoints_map.go +//go:generate gofmt -s -w endpoints_map.go import "strings" diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/endpoints/endpoints_map.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/endpoints/endpoints_map.go index 637fcbe43aad..894c1a643419 100644 --- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/endpoints/endpoints_map.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/endpoints/endpoints_map.go @@ -15,74 +15,74 @@ type endpointEntry struct { var endpointsMap = endpointStruct{ Version: 2, Endpoints: map[string]endpointEntry{ - "*/*": endpointEntry{ + "*/*": { Endpoint: "{service}.{region}.amazonaws.com", }, - "*/cloudfront": endpointEntry{ + "*/cloudfront": { Endpoint: "cloudfront.amazonaws.com", SigningRegion: "us-east-1", }, - "*/cloudsearchdomain": endpointEntry{ + "*/cloudsearchdomain": { Endpoint: "", SigningRegion: "us-east-1", }, - "*/iam": endpointEntry{ + "*/iam": { Endpoint: "iam.amazonaws.com", SigningRegion: "us-east-1", }, - "*/importexport": endpointEntry{ + "*/importexport": { Endpoint: "importexport.amazonaws.com", SigningRegion: "us-east-1", }, - "*/route53": endpointEntry{ + "*/route53": { Endpoint: "route53.amazonaws.com", SigningRegion: "us-east-1", }, - "*/sts": endpointEntry{ + "*/sts": { Endpoint: "sts.amazonaws.com", SigningRegion: "us-east-1", }, - "ap-northeast-1/s3": endpointEntry{ + "ap-northeast-1/s3": { Endpoint: "s3-{region}.amazonaws.com", }, - "ap-southeast-1/s3": endpointEntry{ + "ap-southeast-1/s3": { Endpoint: "s3-{region}.amazonaws.com", }, - "ap-southeast-2/s3": endpointEntry{ + "ap-southeast-2/s3": { Endpoint: "s3-{region}.amazonaws.com", }, - "cn-north-1/*": endpointEntry{ + "cn-north-1/*": { Endpoint: "{service}.{region}.amazonaws.com.cn", }, - "eu-central-1/s3": endpointEntry{ + "eu-central-1/s3": { Endpoint: "{service}.{region}.amazonaws.com", }, - "eu-west-1/s3": endpointEntry{ + "eu-west-1/s3": { Endpoint: "s3-{region}.amazonaws.com", }, - "sa-east-1/s3": endpointEntry{ + "sa-east-1/s3": { Endpoint: "s3-{region}.amazonaws.com", }, - "us-east-1/s3": endpointEntry{ + "us-east-1/s3": { Endpoint: "s3.amazonaws.com", }, - "us-east-1/sdb": endpointEntry{ + "us-east-1/sdb": { Endpoint: "sdb.amazonaws.com", SigningRegion: "us-east-1", }, - "us-gov-west-1/iam": endpointEntry{ + "us-gov-west-1/iam": { Endpoint: "iam.us-gov.amazonaws.com", }, - "us-gov-west-1/s3": endpointEntry{ + "us-gov-west-1/s3": { Endpoint: "s3-{region}.amazonaws.com", }, - "us-gov-west-1/sts": endpointEntry{ + "us-gov-west-1/sts": { Endpoint: "sts.us-gov-west-1.amazonaws.com", }, - "us-west-1/s3": endpointEntry{ + "us-west-1/s3": { Endpoint: "s3-{region}.amazonaws.com", }, - "us-west-2/s3": endpointEntry{ + "us-west-2/s3": { Endpoint: "s3-{region}.amazonaws.com", }, }, diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/ec2query/build.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/ec2query/build.go index bdf2bc4f8256..fabe9b3c3043 100644 --- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/ec2query/build.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/ec2query/build.go @@ -6,19 +6,19 @@ package ec2query import ( "net/url" - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/internal/apierr" + "github.com/aws/aws-sdk-go/aws/awserr" + "github.com/aws/aws-sdk-go/aws/request" "github.com/aws/aws-sdk-go/internal/protocol/query/queryutil" ) // Build builds a request for the EC2 protocol. -func Build(r *aws.Request) { +func Build(r *request.Request) { body := url.Values{ "Action": {r.Operation.Name}, "Version": {r.Service.APIVersion}, } if err := queryutil.Parse(body, r.Params, true); err != nil { - r.Error = apierr.New("Marshal", "failed encoding EC2 Query request", err) + r.Error = awserr.New("SerializationError", "failed encoding EC2 Query request", err) } if r.ExpireTime == 0 { diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/ec2query/build_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/ec2query/build_test.go index f267f0215879..8b2e59a8ae04 100644 --- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/ec2query/build_test.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/ec2query/build_test.go @@ -1,10 +1,6 @@ package ec2query_test import ( - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/internal/protocol/ec2query" - "github.com/aws/aws-sdk-go/internal/signer/v4" - "bytes" "encoding/json" "encoding/xml" @@ -15,7 +11,14 @@ import ( "testing" "time" + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/defaults" + "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/aws/service" + "github.com/aws/aws-sdk-go/aws/service/serviceinfo" + "github.com/aws/aws-sdk-go/internal/protocol/ec2query" "github.com/aws/aws-sdk-go/internal/protocol/xml/xmlutil" + "github.com/aws/aws-sdk-go/internal/signer/v4" "github.com/aws/aws-sdk-go/internal/util" "github.com/stretchr/testify/assert" ) @@ -31,17 +34,18 @@ var _ = util.Trim("") var _ = url.Values{} var _ = io.EOF -// InputService1ProtocolTest is a client for InputService1ProtocolTest. type InputService1ProtocolTest struct { - *aws.Service + *service.Service } // New returns a new InputService1ProtocolTest client. func NewInputService1ProtocolTest(config *aws.Config) *InputService1ProtocolTest { - service := &aws.Service{ - Config: aws.DefaultConfig.Merge(config), - ServiceName: "inputservice1protocoltest", - APIVersion: "2014-01-01", + service := &service.Service{ + ServiceInfo: serviceinfo.ServiceInfo{ + Config: defaults.DefaultConfig.Merge(config), + ServiceName: "inputservice1protocoltest", + APIVersion: "2014-01-01", + }, } service.Initialize() @@ -57,70 +61,68 @@ func NewInputService1ProtocolTest(config *aws.Config) *InputService1ProtocolTest // newRequest creates a new request for a InputService1ProtocolTest operation and runs any // custom request initialization. -func (c *InputService1ProtocolTest) newRequest(op *aws.Operation, params, data interface{}) *aws.Request { - req := aws.NewRequest(c.Service, op, params, data) +func (c *InputService1ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { + req := c.NewRequest(op, params, data) return req } -// InputService1TestCaseOperation1Request generates a request for the InputService1TestCaseOperation1 operation. -func (c *InputService1ProtocolTest) InputService1TestCaseOperation1Request(input *InputService1TestShapeInputShape) (req *aws.Request, output *InputService1TestShapeInputService1TestCaseOperation1Output) { +const opInputService1TestCaseOperation1 = "OperationName" - if opInputService1TestCaseOperation1 == nil { - opInputService1TestCaseOperation1 = &aws.Operation{ - Name: "OperationName", - } +// InputService1TestCaseOperation1Request generates a request for the InputService1TestCaseOperation1 operation. +func (c *InputService1ProtocolTest) InputService1TestCaseOperation1Request(input *InputService1TestShapeInputService1TestCaseOperation1Input) (req *request.Request, output *InputService1TestShapeInputService1TestCaseOperation1Output) { + op := &request.Operation{ + Name: opInputService1TestCaseOperation1, } if input == nil { - input = &InputService1TestShapeInputShape{} + input = &InputService1TestShapeInputService1TestCaseOperation1Input{} } - req = c.newRequest(opInputService1TestCaseOperation1, input, output) + req = c.newRequest(op, input, output) output = &InputService1TestShapeInputService1TestCaseOperation1Output{} req.Data = output return } -func (c *InputService1ProtocolTest) InputService1TestCaseOperation1(input *InputService1TestShapeInputShape) (*InputService1TestShapeInputService1TestCaseOperation1Output, error) { +func (c *InputService1ProtocolTest) InputService1TestCaseOperation1(input *InputService1TestShapeInputService1TestCaseOperation1Input) (*InputService1TestShapeInputService1TestCaseOperation1Output, error) { req, out := c.InputService1TestCaseOperation1Request(input) err := req.Send() return out, err } -var opInputService1TestCaseOperation1 *aws.Operation +type InputService1TestShapeInputService1TestCaseOperation1Input struct { + Bar *string `type:"string"` -type InputService1TestShapeInputService1TestCaseOperation1Output struct { - metadataInputService1TestShapeInputService1TestCaseOperation1Output `json:"-" xml:"-"` + Foo *string `type:"string"` + + metadataInputService1TestShapeInputService1TestCaseOperation1Input `json:"-" xml:"-"` } -type metadataInputService1TestShapeInputService1TestCaseOperation1Output struct { +type metadataInputService1TestShapeInputService1TestCaseOperation1Input struct { SDKShapeTraits bool `type:"structure"` } -type InputService1TestShapeInputShape struct { - Bar *string `type:"string"` - - Foo *string `type:"string"` - - metadataInputService1TestShapeInputShape `json:"-" xml:"-"` +type InputService1TestShapeInputService1TestCaseOperation1Output struct { + metadataInputService1TestShapeInputService1TestCaseOperation1Output `json:"-" xml:"-"` } -type metadataInputService1TestShapeInputShape struct { +type metadataInputService1TestShapeInputService1TestCaseOperation1Output struct { SDKShapeTraits bool `type:"structure"` } -// InputService2ProtocolTest is a client for InputService2ProtocolTest. type InputService2ProtocolTest struct { - *aws.Service + *service.Service } // New returns a new InputService2ProtocolTest client. func NewInputService2ProtocolTest(config *aws.Config) *InputService2ProtocolTest { - service := &aws.Service{ - Config: aws.DefaultConfig.Merge(config), - ServiceName: "inputservice2protocoltest", - APIVersion: "2014-01-01", + service := &service.Service{ + ServiceInfo: serviceinfo.ServiceInfo{ + Config: defaults.DefaultConfig.Merge(config), + ServiceName: "inputservice2protocoltest", + APIVersion: "2014-01-01", + }, } service.Initialize() @@ -136,72 +138,70 @@ func NewInputService2ProtocolTest(config *aws.Config) *InputService2ProtocolTest // newRequest creates a new request for a InputService2ProtocolTest operation and runs any // custom request initialization. -func (c *InputService2ProtocolTest) newRequest(op *aws.Operation, params, data interface{}) *aws.Request { - req := aws.NewRequest(c.Service, op, params, data) +func (c *InputService2ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { + req := c.NewRequest(op, params, data) return req } -// InputService2TestCaseOperation1Request generates a request for the InputService2TestCaseOperation1 operation. -func (c *InputService2ProtocolTest) InputService2TestCaseOperation1Request(input *InputService2TestShapeInputShape) (req *aws.Request, output *InputService2TestShapeInputService2TestCaseOperation1Output) { +const opInputService2TestCaseOperation1 = "OperationName" - if opInputService2TestCaseOperation1 == nil { - opInputService2TestCaseOperation1 = &aws.Operation{ - Name: "OperationName", - } +// InputService2TestCaseOperation1Request generates a request for the InputService2TestCaseOperation1 operation. +func (c *InputService2ProtocolTest) InputService2TestCaseOperation1Request(input *InputService2TestShapeInputService2TestCaseOperation1Input) (req *request.Request, output *InputService2TestShapeInputService2TestCaseOperation1Output) { + op := &request.Operation{ + Name: opInputService2TestCaseOperation1, } if input == nil { - input = &InputService2TestShapeInputShape{} + input = &InputService2TestShapeInputService2TestCaseOperation1Input{} } - req = c.newRequest(opInputService2TestCaseOperation1, input, output) + req = c.newRequest(op, input, output) output = &InputService2TestShapeInputService2TestCaseOperation1Output{} req.Data = output return } -func (c *InputService2ProtocolTest) InputService2TestCaseOperation1(input *InputService2TestShapeInputShape) (*InputService2TestShapeInputService2TestCaseOperation1Output, error) { +func (c *InputService2ProtocolTest) InputService2TestCaseOperation1(input *InputService2TestShapeInputService2TestCaseOperation1Input) (*InputService2TestShapeInputService2TestCaseOperation1Output, error) { req, out := c.InputService2TestCaseOperation1Request(input) err := req.Send() return out, err } -var opInputService2TestCaseOperation1 *aws.Operation - -type InputService2TestShapeInputService2TestCaseOperation1Output struct { - metadataInputService2TestShapeInputService2TestCaseOperation1Output `json:"-" xml:"-"` -} - -type metadataInputService2TestShapeInputService2TestCaseOperation1Output struct { - SDKShapeTraits bool `type:"structure"` -} - -type InputService2TestShapeInputShape struct { +type InputService2TestShapeInputService2TestCaseOperation1Input struct { Bar *string `locationName:"barLocationName" type:"string"` Foo *string `type:"string"` Yuck *string `locationName:"yuckLocationName" queryName:"yuckQueryName" type:"string"` - metadataInputService2TestShapeInputShape `json:"-" xml:"-"` + metadataInputService2TestShapeInputService2TestCaseOperation1Input `json:"-" xml:"-"` } -type metadataInputService2TestShapeInputShape struct { +type metadataInputService2TestShapeInputService2TestCaseOperation1Input struct { + SDKShapeTraits bool `type:"structure"` +} + +type InputService2TestShapeInputService2TestCaseOperation1Output struct { + metadataInputService2TestShapeInputService2TestCaseOperation1Output `json:"-" xml:"-"` +} + +type metadataInputService2TestShapeInputService2TestCaseOperation1Output struct { SDKShapeTraits bool `type:"structure"` } -// InputService3ProtocolTest is a client for InputService3ProtocolTest. type InputService3ProtocolTest struct { - *aws.Service + *service.Service } // New returns a new InputService3ProtocolTest client. func NewInputService3ProtocolTest(config *aws.Config) *InputService3ProtocolTest { - service := &aws.Service{ - Config: aws.DefaultConfig.Merge(config), - ServiceName: "inputservice3protocoltest", - APIVersion: "2014-01-01", + service := &service.Service{ + ServiceInfo: serviceinfo.ServiceInfo{ + Config: defaults.DefaultConfig.Merge(config), + ServiceName: "inputservice3protocoltest", + APIVersion: "2014-01-01", + }, } service.Initialize() @@ -217,54 +217,51 @@ func NewInputService3ProtocolTest(config *aws.Config) *InputService3ProtocolTest // newRequest creates a new request for a InputService3ProtocolTest operation and runs any // custom request initialization. -func (c *InputService3ProtocolTest) newRequest(op *aws.Operation, params, data interface{}) *aws.Request { - req := aws.NewRequest(c.Service, op, params, data) +func (c *InputService3ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { + req := c.NewRequest(op, params, data) return req } -// InputService3TestCaseOperation1Request generates a request for the InputService3TestCaseOperation1 operation. -func (c *InputService3ProtocolTest) InputService3TestCaseOperation1Request(input *InputService3TestShapeInputShape) (req *aws.Request, output *InputService3TestShapeInputService3TestCaseOperation1Output) { +const opInputService3TestCaseOperation1 = "OperationName" - if opInputService3TestCaseOperation1 == nil { - opInputService3TestCaseOperation1 = &aws.Operation{ - Name: "OperationName", - } +// InputService3TestCaseOperation1Request generates a request for the InputService3TestCaseOperation1 operation. +func (c *InputService3ProtocolTest) InputService3TestCaseOperation1Request(input *InputService3TestShapeInputService3TestCaseOperation1Input) (req *request.Request, output *InputService3TestShapeInputService3TestCaseOperation1Output) { + op := &request.Operation{ + Name: opInputService3TestCaseOperation1, } if input == nil { - input = &InputService3TestShapeInputShape{} + input = &InputService3TestShapeInputService3TestCaseOperation1Input{} } - req = c.newRequest(opInputService3TestCaseOperation1, input, output) + req = c.newRequest(op, input, output) output = &InputService3TestShapeInputService3TestCaseOperation1Output{} req.Data = output return } -func (c *InputService3ProtocolTest) InputService3TestCaseOperation1(input *InputService3TestShapeInputShape) (*InputService3TestShapeInputService3TestCaseOperation1Output, error) { +func (c *InputService3ProtocolTest) InputService3TestCaseOperation1(input *InputService3TestShapeInputService3TestCaseOperation1Input) (*InputService3TestShapeInputService3TestCaseOperation1Output, error) { req, out := c.InputService3TestCaseOperation1Request(input) err := req.Send() return out, err } -var opInputService3TestCaseOperation1 *aws.Operation +type InputService3TestShapeInputService3TestCaseOperation1Input struct { + StructArg *InputService3TestShapeStructType `locationName:"Struct" type:"structure"` -type InputService3TestShapeInputService3TestCaseOperation1Output struct { - metadataInputService3TestShapeInputService3TestCaseOperation1Output `json:"-" xml:"-"` + metadataInputService3TestShapeInputService3TestCaseOperation1Input `json:"-" xml:"-"` } -type metadataInputService3TestShapeInputService3TestCaseOperation1Output struct { +type metadataInputService3TestShapeInputService3TestCaseOperation1Input struct { SDKShapeTraits bool `type:"structure"` } -type InputService3TestShapeInputShape struct { - StructArg *InputService3TestShapeStructType `locationName:"Struct" type:"structure"` - - metadataInputService3TestShapeInputShape `json:"-" xml:"-"` +type InputService3TestShapeInputService3TestCaseOperation1Output struct { + metadataInputService3TestShapeInputService3TestCaseOperation1Output `json:"-" xml:"-"` } -type metadataInputService3TestShapeInputShape struct { +type metadataInputService3TestShapeInputService3TestCaseOperation1Output struct { SDKShapeTraits bool `type:"structure"` } @@ -278,17 +275,18 @@ type metadataInputService3TestShapeStructType struct { SDKShapeTraits bool `type:"structure"` } -// InputService4ProtocolTest is a client for InputService4ProtocolTest. type InputService4ProtocolTest struct { - *aws.Service + *service.Service } // New returns a new InputService4ProtocolTest client. func NewInputService4ProtocolTest(config *aws.Config) *InputService4ProtocolTest { - service := &aws.Service{ - Config: aws.DefaultConfig.Merge(config), - ServiceName: "inputservice4protocoltest", - APIVersion: "2014-01-01", + service := &service.Service{ + ServiceInfo: serviceinfo.ServiceInfo{ + Config: defaults.DefaultConfig.Merge(config), + ServiceName: "inputservice4protocoltest", + APIVersion: "2014-01-01", + }, } service.Initialize() @@ -304,68 +302,66 @@ func NewInputService4ProtocolTest(config *aws.Config) *InputService4ProtocolTest // newRequest creates a new request for a InputService4ProtocolTest operation and runs any // custom request initialization. -func (c *InputService4ProtocolTest) newRequest(op *aws.Operation, params, data interface{}) *aws.Request { - req := aws.NewRequest(c.Service, op, params, data) +func (c *InputService4ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { + req := c.NewRequest(op, params, data) return req } -// InputService4TestCaseOperation1Request generates a request for the InputService4TestCaseOperation1 operation. -func (c *InputService4ProtocolTest) InputService4TestCaseOperation1Request(input *InputService4TestShapeInputShape) (req *aws.Request, output *InputService4TestShapeInputService4TestCaseOperation1Output) { +const opInputService4TestCaseOperation1 = "OperationName" - if opInputService4TestCaseOperation1 == nil { - opInputService4TestCaseOperation1 = &aws.Operation{ - Name: "OperationName", - } +// InputService4TestCaseOperation1Request generates a request for the InputService4TestCaseOperation1 operation. +func (c *InputService4ProtocolTest) InputService4TestCaseOperation1Request(input *InputService4TestShapeInputService4TestCaseOperation1Input) (req *request.Request, output *InputService4TestShapeInputService4TestCaseOperation1Output) { + op := &request.Operation{ + Name: opInputService4TestCaseOperation1, } if input == nil { - input = &InputService4TestShapeInputShape{} + input = &InputService4TestShapeInputService4TestCaseOperation1Input{} } - req = c.newRequest(opInputService4TestCaseOperation1, input, output) + req = c.newRequest(op, input, output) output = &InputService4TestShapeInputService4TestCaseOperation1Output{} req.Data = output return } -func (c *InputService4ProtocolTest) InputService4TestCaseOperation1(input *InputService4TestShapeInputShape) (*InputService4TestShapeInputService4TestCaseOperation1Output, error) { +func (c *InputService4ProtocolTest) InputService4TestCaseOperation1(input *InputService4TestShapeInputService4TestCaseOperation1Input) (*InputService4TestShapeInputService4TestCaseOperation1Output, error) { req, out := c.InputService4TestCaseOperation1Request(input) err := req.Send() return out, err } -var opInputService4TestCaseOperation1 *aws.Operation +type InputService4TestShapeInputService4TestCaseOperation1Input struct { + ListArg []*string `type:"list"` -type InputService4TestShapeInputService4TestCaseOperation1Output struct { - metadataInputService4TestShapeInputService4TestCaseOperation1Output `json:"-" xml:"-"` + metadataInputService4TestShapeInputService4TestCaseOperation1Input `json:"-" xml:"-"` } -type metadataInputService4TestShapeInputService4TestCaseOperation1Output struct { +type metadataInputService4TestShapeInputService4TestCaseOperation1Input struct { SDKShapeTraits bool `type:"structure"` } -type InputService4TestShapeInputShape struct { - ListArg []*string `type:"list"` - - metadataInputService4TestShapeInputShape `json:"-" xml:"-"` +type InputService4TestShapeInputService4TestCaseOperation1Output struct { + metadataInputService4TestShapeInputService4TestCaseOperation1Output `json:"-" xml:"-"` } -type metadataInputService4TestShapeInputShape struct { +type metadataInputService4TestShapeInputService4TestCaseOperation1Output struct { SDKShapeTraits bool `type:"structure"` } -// InputService5ProtocolTest is a client for InputService5ProtocolTest. type InputService5ProtocolTest struct { - *aws.Service + *service.Service } // New returns a new InputService5ProtocolTest client. func NewInputService5ProtocolTest(config *aws.Config) *InputService5ProtocolTest { - service := &aws.Service{ - Config: aws.DefaultConfig.Merge(config), - ServiceName: "inputservice5protocoltest", - APIVersion: "2014-01-01", + service := &service.Service{ + ServiceInfo: serviceinfo.ServiceInfo{ + Config: defaults.DefaultConfig.Merge(config), + ServiceName: "inputservice5protocoltest", + APIVersion: "2014-01-01", + }, } service.Initialize() @@ -381,68 +377,66 @@ func NewInputService5ProtocolTest(config *aws.Config) *InputService5ProtocolTest // newRequest creates a new request for a InputService5ProtocolTest operation and runs any // custom request initialization. -func (c *InputService5ProtocolTest) newRequest(op *aws.Operation, params, data interface{}) *aws.Request { - req := aws.NewRequest(c.Service, op, params, data) +func (c *InputService5ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { + req := c.NewRequest(op, params, data) return req } -// InputService5TestCaseOperation1Request generates a request for the InputService5TestCaseOperation1 operation. -func (c *InputService5ProtocolTest) InputService5TestCaseOperation1Request(input *InputService5TestShapeInputShape) (req *aws.Request, output *InputService5TestShapeInputService5TestCaseOperation1Output) { +const opInputService5TestCaseOperation1 = "OperationName" - if opInputService5TestCaseOperation1 == nil { - opInputService5TestCaseOperation1 = &aws.Operation{ - Name: "OperationName", - } +// InputService5TestCaseOperation1Request generates a request for the InputService5TestCaseOperation1 operation. +func (c *InputService5ProtocolTest) InputService5TestCaseOperation1Request(input *InputService5TestShapeInputService5TestCaseOperation1Input) (req *request.Request, output *InputService5TestShapeInputService5TestCaseOperation1Output) { + op := &request.Operation{ + Name: opInputService5TestCaseOperation1, } if input == nil { - input = &InputService5TestShapeInputShape{} + input = &InputService5TestShapeInputService5TestCaseOperation1Input{} } - req = c.newRequest(opInputService5TestCaseOperation1, input, output) + req = c.newRequest(op, input, output) output = &InputService5TestShapeInputService5TestCaseOperation1Output{} req.Data = output return } -func (c *InputService5ProtocolTest) InputService5TestCaseOperation1(input *InputService5TestShapeInputShape) (*InputService5TestShapeInputService5TestCaseOperation1Output, error) { +func (c *InputService5ProtocolTest) InputService5TestCaseOperation1(input *InputService5TestShapeInputService5TestCaseOperation1Input) (*InputService5TestShapeInputService5TestCaseOperation1Output, error) { req, out := c.InputService5TestCaseOperation1Request(input) err := req.Send() return out, err } -var opInputService5TestCaseOperation1 *aws.Operation +type InputService5TestShapeInputService5TestCaseOperation1Input struct { + ListArg []*string `locationName:"ListMemberName" locationNameList:"item" type:"list"` -type InputService5TestShapeInputService5TestCaseOperation1Output struct { - metadataInputService5TestShapeInputService5TestCaseOperation1Output `json:"-" xml:"-"` + metadataInputService5TestShapeInputService5TestCaseOperation1Input `json:"-" xml:"-"` } -type metadataInputService5TestShapeInputService5TestCaseOperation1Output struct { +type metadataInputService5TestShapeInputService5TestCaseOperation1Input struct { SDKShapeTraits bool `type:"structure"` } -type InputService5TestShapeInputShape struct { - ListArg []*string `locationName:"ListMemberName" locationNameList:"item" type:"list"` - - metadataInputService5TestShapeInputShape `json:"-" xml:"-"` +type InputService5TestShapeInputService5TestCaseOperation1Output struct { + metadataInputService5TestShapeInputService5TestCaseOperation1Output `json:"-" xml:"-"` } -type metadataInputService5TestShapeInputShape struct { +type metadataInputService5TestShapeInputService5TestCaseOperation1Output struct { SDKShapeTraits bool `type:"structure"` } -// InputService6ProtocolTest is a client for InputService6ProtocolTest. type InputService6ProtocolTest struct { - *aws.Service + *service.Service } // New returns a new InputService6ProtocolTest client. func NewInputService6ProtocolTest(config *aws.Config) *InputService6ProtocolTest { - service := &aws.Service{ - Config: aws.DefaultConfig.Merge(config), - ServiceName: "inputservice6protocoltest", - APIVersion: "2014-01-01", + service := &service.Service{ + ServiceInfo: serviceinfo.ServiceInfo{ + Config: defaults.DefaultConfig.Merge(config), + ServiceName: "inputservice6protocoltest", + APIVersion: "2014-01-01", + }, } service.Initialize() @@ -458,68 +452,66 @@ func NewInputService6ProtocolTest(config *aws.Config) *InputService6ProtocolTest // newRequest creates a new request for a InputService6ProtocolTest operation and runs any // custom request initialization. -func (c *InputService6ProtocolTest) newRequest(op *aws.Operation, params, data interface{}) *aws.Request { - req := aws.NewRequest(c.Service, op, params, data) +func (c *InputService6ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { + req := c.NewRequest(op, params, data) return req } -// InputService6TestCaseOperation1Request generates a request for the InputService6TestCaseOperation1 operation. -func (c *InputService6ProtocolTest) InputService6TestCaseOperation1Request(input *InputService6TestShapeInputShape) (req *aws.Request, output *InputService6TestShapeInputService6TestCaseOperation1Output) { +const opInputService6TestCaseOperation1 = "OperationName" - if opInputService6TestCaseOperation1 == nil { - opInputService6TestCaseOperation1 = &aws.Operation{ - Name: "OperationName", - } +// InputService6TestCaseOperation1Request generates a request for the InputService6TestCaseOperation1 operation. +func (c *InputService6ProtocolTest) InputService6TestCaseOperation1Request(input *InputService6TestShapeInputService6TestCaseOperation1Input) (req *request.Request, output *InputService6TestShapeInputService6TestCaseOperation1Output) { + op := &request.Operation{ + Name: opInputService6TestCaseOperation1, } if input == nil { - input = &InputService6TestShapeInputShape{} + input = &InputService6TestShapeInputService6TestCaseOperation1Input{} } - req = c.newRequest(opInputService6TestCaseOperation1, input, output) + req = c.newRequest(op, input, output) output = &InputService6TestShapeInputService6TestCaseOperation1Output{} req.Data = output return } -func (c *InputService6ProtocolTest) InputService6TestCaseOperation1(input *InputService6TestShapeInputShape) (*InputService6TestShapeInputService6TestCaseOperation1Output, error) { +func (c *InputService6ProtocolTest) InputService6TestCaseOperation1(input *InputService6TestShapeInputService6TestCaseOperation1Input) (*InputService6TestShapeInputService6TestCaseOperation1Output, error) { req, out := c.InputService6TestCaseOperation1Request(input) err := req.Send() return out, err } -var opInputService6TestCaseOperation1 *aws.Operation +type InputService6TestShapeInputService6TestCaseOperation1Input struct { + ListArg []*string `locationName:"ListMemberName" queryName:"ListQueryName" locationNameList:"item" type:"list"` -type InputService6TestShapeInputService6TestCaseOperation1Output struct { - metadataInputService6TestShapeInputService6TestCaseOperation1Output `json:"-" xml:"-"` + metadataInputService6TestShapeInputService6TestCaseOperation1Input `json:"-" xml:"-"` } -type metadataInputService6TestShapeInputService6TestCaseOperation1Output struct { +type metadataInputService6TestShapeInputService6TestCaseOperation1Input struct { SDKShapeTraits bool `type:"structure"` } -type InputService6TestShapeInputShape struct { - ListArg []*string `locationName:"ListMemberName" queryName:"ListQueryName" locationNameList:"item" type:"list"` - - metadataInputService6TestShapeInputShape `json:"-" xml:"-"` +type InputService6TestShapeInputService6TestCaseOperation1Output struct { + metadataInputService6TestShapeInputService6TestCaseOperation1Output `json:"-" xml:"-"` } -type metadataInputService6TestShapeInputShape struct { +type metadataInputService6TestShapeInputService6TestCaseOperation1Output struct { SDKShapeTraits bool `type:"structure"` } -// InputService7ProtocolTest is a client for InputService7ProtocolTest. type InputService7ProtocolTest struct { - *aws.Service + *service.Service } // New returns a new InputService7ProtocolTest client. func NewInputService7ProtocolTest(config *aws.Config) *InputService7ProtocolTest { - service := &aws.Service{ - Config: aws.DefaultConfig.Merge(config), - ServiceName: "inputservice7protocoltest", - APIVersion: "2014-01-01", + service := &service.Service{ + ServiceInfo: serviceinfo.ServiceInfo{ + Config: defaults.DefaultConfig.Merge(config), + ServiceName: "inputservice7protocoltest", + APIVersion: "2014-01-01", + }, } service.Initialize() @@ -535,68 +527,66 @@ func NewInputService7ProtocolTest(config *aws.Config) *InputService7ProtocolTest // newRequest creates a new request for a InputService7ProtocolTest operation and runs any // custom request initialization. -func (c *InputService7ProtocolTest) newRequest(op *aws.Operation, params, data interface{}) *aws.Request { - req := aws.NewRequest(c.Service, op, params, data) +func (c *InputService7ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { + req := c.NewRequest(op, params, data) return req } -// InputService7TestCaseOperation1Request generates a request for the InputService7TestCaseOperation1 operation. -func (c *InputService7ProtocolTest) InputService7TestCaseOperation1Request(input *InputService7TestShapeInputShape) (req *aws.Request, output *InputService7TestShapeInputService7TestCaseOperation1Output) { +const opInputService7TestCaseOperation1 = "OperationName" - if opInputService7TestCaseOperation1 == nil { - opInputService7TestCaseOperation1 = &aws.Operation{ - Name: "OperationName", - } +// InputService7TestCaseOperation1Request generates a request for the InputService7TestCaseOperation1 operation. +func (c *InputService7ProtocolTest) InputService7TestCaseOperation1Request(input *InputService7TestShapeInputService7TestCaseOperation1Input) (req *request.Request, output *InputService7TestShapeInputService7TestCaseOperation1Output) { + op := &request.Operation{ + Name: opInputService7TestCaseOperation1, } if input == nil { - input = &InputService7TestShapeInputShape{} + input = &InputService7TestShapeInputService7TestCaseOperation1Input{} } - req = c.newRequest(opInputService7TestCaseOperation1, input, output) + req = c.newRequest(op, input, output) output = &InputService7TestShapeInputService7TestCaseOperation1Output{} req.Data = output return } -func (c *InputService7ProtocolTest) InputService7TestCaseOperation1(input *InputService7TestShapeInputShape) (*InputService7TestShapeInputService7TestCaseOperation1Output, error) { +func (c *InputService7ProtocolTest) InputService7TestCaseOperation1(input *InputService7TestShapeInputService7TestCaseOperation1Input) (*InputService7TestShapeInputService7TestCaseOperation1Output, error) { req, out := c.InputService7TestCaseOperation1Request(input) err := req.Send() return out, err } -var opInputService7TestCaseOperation1 *aws.Operation +type InputService7TestShapeInputService7TestCaseOperation1Input struct { + BlobArg []byte `type:"blob"` -type InputService7TestShapeInputService7TestCaseOperation1Output struct { - metadataInputService7TestShapeInputService7TestCaseOperation1Output `json:"-" xml:"-"` + metadataInputService7TestShapeInputService7TestCaseOperation1Input `json:"-" xml:"-"` } -type metadataInputService7TestShapeInputService7TestCaseOperation1Output struct { +type metadataInputService7TestShapeInputService7TestCaseOperation1Input struct { SDKShapeTraits bool `type:"structure"` } -type InputService7TestShapeInputShape struct { - BlobArg []byte `type:"blob"` - - metadataInputService7TestShapeInputShape `json:"-" xml:"-"` +type InputService7TestShapeInputService7TestCaseOperation1Output struct { + metadataInputService7TestShapeInputService7TestCaseOperation1Output `json:"-" xml:"-"` } -type metadataInputService7TestShapeInputShape struct { +type metadataInputService7TestShapeInputService7TestCaseOperation1Output struct { SDKShapeTraits bool `type:"structure"` } -// InputService8ProtocolTest is a client for InputService8ProtocolTest. type InputService8ProtocolTest struct { - *aws.Service + *service.Service } // New returns a new InputService8ProtocolTest client. func NewInputService8ProtocolTest(config *aws.Config) *InputService8ProtocolTest { - service := &aws.Service{ - Config: aws.DefaultConfig.Merge(config), - ServiceName: "inputservice8protocoltest", - APIVersion: "2014-01-01", + service := &service.Service{ + ServiceInfo: serviceinfo.ServiceInfo{ + Config: defaults.DefaultConfig.Merge(config), + ServiceName: "inputservice8protocoltest", + APIVersion: "2014-01-01", + }, } service.Initialize() @@ -612,54 +602,51 @@ func NewInputService8ProtocolTest(config *aws.Config) *InputService8ProtocolTest // newRequest creates a new request for a InputService8ProtocolTest operation and runs any // custom request initialization. -func (c *InputService8ProtocolTest) newRequest(op *aws.Operation, params, data interface{}) *aws.Request { - req := aws.NewRequest(c.Service, op, params, data) +func (c *InputService8ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { + req := c.NewRequest(op, params, data) return req } -// InputService8TestCaseOperation1Request generates a request for the InputService8TestCaseOperation1 operation. -func (c *InputService8ProtocolTest) InputService8TestCaseOperation1Request(input *InputService8TestShapeInputShape) (req *aws.Request, output *InputService8TestShapeInputService8TestCaseOperation1Output) { +const opInputService8TestCaseOperation1 = "OperationName" - if opInputService8TestCaseOperation1 == nil { - opInputService8TestCaseOperation1 = &aws.Operation{ - Name: "OperationName", - } +// InputService8TestCaseOperation1Request generates a request for the InputService8TestCaseOperation1 operation. +func (c *InputService8ProtocolTest) InputService8TestCaseOperation1Request(input *InputService8TestShapeInputService8TestCaseOperation1Input) (req *request.Request, output *InputService8TestShapeInputService8TestCaseOperation1Output) { + op := &request.Operation{ + Name: opInputService8TestCaseOperation1, } if input == nil { - input = &InputService8TestShapeInputShape{} + input = &InputService8TestShapeInputService8TestCaseOperation1Input{} } - req = c.newRequest(opInputService8TestCaseOperation1, input, output) + req = c.newRequest(op, input, output) output = &InputService8TestShapeInputService8TestCaseOperation1Output{} req.Data = output return } -func (c *InputService8ProtocolTest) InputService8TestCaseOperation1(input *InputService8TestShapeInputShape) (*InputService8TestShapeInputService8TestCaseOperation1Output, error) { +func (c *InputService8ProtocolTest) InputService8TestCaseOperation1(input *InputService8TestShapeInputService8TestCaseOperation1Input) (*InputService8TestShapeInputService8TestCaseOperation1Output, error) { req, out := c.InputService8TestCaseOperation1Request(input) err := req.Send() return out, err } -var opInputService8TestCaseOperation1 *aws.Operation +type InputService8TestShapeInputService8TestCaseOperation1Input struct { + TimeArg *time.Time `type:"timestamp" timestampFormat:"iso8601"` -type InputService8TestShapeInputService8TestCaseOperation1Output struct { - metadataInputService8TestShapeInputService8TestCaseOperation1Output `json:"-" xml:"-"` + metadataInputService8TestShapeInputService8TestCaseOperation1Input `json:"-" xml:"-"` } -type metadataInputService8TestShapeInputService8TestCaseOperation1Output struct { +type metadataInputService8TestShapeInputService8TestCaseOperation1Input struct { SDKShapeTraits bool `type:"structure"` } -type InputService8TestShapeInputShape struct { - TimeArg *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - metadataInputService8TestShapeInputShape `json:"-" xml:"-"` +type InputService8TestShapeInputService8TestCaseOperation1Output struct { + metadataInputService8TestShapeInputService8TestCaseOperation1Output `json:"-" xml:"-"` } -type metadataInputService8TestShapeInputShape struct { +type metadataInputService8TestShapeInputService8TestCaseOperation1Output struct { SDKShapeTraits bool `type:"structure"` } @@ -671,7 +658,7 @@ func TestInputService1ProtocolTestScalarMembersCase1(t *testing.T) { svc := NewInputService1ProtocolTest(nil) svc.Endpoint = "https://test" - input := &InputService1TestShapeInputShape{ + input := &InputService1TestShapeInputService1TestCaseOperation1Input{ Bar: aws.String("val2"), Foo: aws.String("val1"), } @@ -698,7 +685,7 @@ func TestInputService2ProtocolTestStructureWithLocationNameAndQueryNameAppliedTo svc := NewInputService2ProtocolTest(nil) svc.Endpoint = "https://test" - input := &InputService2TestShapeInputShape{ + input := &InputService2TestShapeInputService2TestCaseOperation1Input{ Bar: aws.String("val2"), Foo: aws.String("val1"), Yuck: aws.String("val3"), @@ -726,7 +713,7 @@ func TestInputService3ProtocolTestNestedStructureMembersCase1(t *testing.T) { svc := NewInputService3ProtocolTest(nil) svc.Endpoint = "https://test" - input := &InputService3TestShapeInputShape{ + input := &InputService3TestShapeInputService3TestCaseOperation1Input{ StructArg: &InputService3TestShapeStructType{ ScalarArg: aws.String("foo"), }, @@ -754,7 +741,7 @@ func TestInputService4ProtocolTestListTypesCase1(t *testing.T) { svc := NewInputService4ProtocolTest(nil) svc.Endpoint = "https://test" - input := &InputService4TestShapeInputShape{ + input := &InputService4TestShapeInputService4TestCaseOperation1Input{ ListArg: []*string{ aws.String("foo"), aws.String("bar"), @@ -784,7 +771,7 @@ func TestInputService5ProtocolTestListWithLocationNameAppliedToMemberCase1(t *te svc := NewInputService5ProtocolTest(nil) svc.Endpoint = "https://test" - input := &InputService5TestShapeInputShape{ + input := &InputService5TestShapeInputService5TestCaseOperation1Input{ ListArg: []*string{ aws.String("a"), aws.String("b"), @@ -814,7 +801,7 @@ func TestInputService6ProtocolTestListWithLocationNameAndQueryNameCase1(t *testi svc := NewInputService6ProtocolTest(nil) svc.Endpoint = "https://test" - input := &InputService6TestShapeInputShape{ + input := &InputService6TestShapeInputService6TestCaseOperation1Input{ ListArg: []*string{ aws.String("a"), aws.String("b"), @@ -844,7 +831,7 @@ func TestInputService7ProtocolTestBase64EncodedBlobsCase1(t *testing.T) { svc := NewInputService7ProtocolTest(nil) svc.Endpoint = "https://test" - input := &InputService7TestShapeInputShape{ + input := &InputService7TestShapeInputService7TestCaseOperation1Input{ BlobArg: []byte("foo"), } req, _ := svc.InputService7TestCaseOperation1Request(input) @@ -870,7 +857,7 @@ func TestInputService8ProtocolTestTimestampValuesCase1(t *testing.T) { svc := NewInputService8ProtocolTest(nil) svc.Endpoint = "https://test" - input := &InputService8TestShapeInputShape{ + input := &InputService8TestShapeInputService8TestCaseOperation1Input{ TimeArg: aws.Time(time.Unix(1422172800, 0)), } req, _ := svc.InputService8TestCaseOperation1Request(input) diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/ec2query/unmarshal.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/ec2query/unmarshal.go index b25ece116fb0..bb0f01588897 100644 --- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/ec2query/unmarshal.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/ec2query/unmarshal.go @@ -6,26 +6,26 @@ import ( "encoding/xml" "io" - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/internal/apierr" + "github.com/aws/aws-sdk-go/aws/awserr" + "github.com/aws/aws-sdk-go/aws/request" "github.com/aws/aws-sdk-go/internal/protocol/xml/xmlutil" ) // Unmarshal unmarshals a response body for the EC2 protocol. -func Unmarshal(r *aws.Request) { +func Unmarshal(r *request.Request) { defer r.HTTPResponse.Body.Close() if r.DataFilled() { decoder := xml.NewDecoder(r.HTTPResponse.Body) err := xmlutil.UnmarshalXML(r.Data, decoder, "") if err != nil { - r.Error = apierr.New("Unmarshal", "failed decoding EC2 Query response", err) + r.Error = awserr.New("SerializationError", "failed decoding EC2 Query response", err) return } } } // UnmarshalMeta unmarshals response headers for the EC2 protocol. -func UnmarshalMeta(r *aws.Request) { +func UnmarshalMeta(r *request.Request) { // TODO implement unmarshaling of request IDs } @@ -37,16 +37,16 @@ type xmlErrorResponse struct { } // UnmarshalError unmarshals a response error for the EC2 protocol. -func UnmarshalError(r *aws.Request) { +func UnmarshalError(r *request.Request) { defer r.HTTPResponse.Body.Close() resp := &xmlErrorResponse{} err := xml.NewDecoder(r.HTTPResponse.Body).Decode(resp) if err != nil && err != io.EOF { - r.Error = apierr.New("Unmarshal", "failed decoding EC2 Query error response", err) + r.Error = awserr.New("SerializationError", "failed decoding EC2 Query error response", err) } else { - r.Error = apierr.NewRequestError( - apierr.New(resp.Code, resp.Message, nil), + r.Error = awserr.NewRequestFailure( + awserr.New(resp.Code, resp.Message, nil), r.HTTPResponse.StatusCode, resp.RequestID, ) diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/ec2query/unmarshal_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/ec2query/unmarshal_test.go index 058f47801c05..3d7b0430bdc6 100644 --- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/ec2query/unmarshal_test.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/ec2query/unmarshal_test.go @@ -1,10 +1,6 @@ package ec2query_test import ( - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/internal/protocol/ec2query" - "github.com/aws/aws-sdk-go/internal/signer/v4" - "bytes" "encoding/json" "encoding/xml" @@ -15,7 +11,14 @@ import ( "testing" "time" + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/defaults" + "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/aws/service" + "github.com/aws/aws-sdk-go/aws/service/serviceinfo" + "github.com/aws/aws-sdk-go/internal/protocol/ec2query" "github.com/aws/aws-sdk-go/internal/protocol/xml/xmlutil" + "github.com/aws/aws-sdk-go/internal/signer/v4" "github.com/aws/aws-sdk-go/internal/util" "github.com/stretchr/testify/assert" ) @@ -31,17 +34,18 @@ var _ = util.Trim("") var _ = url.Values{} var _ = io.EOF -// OutputService1ProtocolTest is a client for OutputService1ProtocolTest. type OutputService1ProtocolTest struct { - *aws.Service + *service.Service } // New returns a new OutputService1ProtocolTest client. func NewOutputService1ProtocolTest(config *aws.Config) *OutputService1ProtocolTest { - service := &aws.Service{ - Config: aws.DefaultConfig.Merge(config), - ServiceName: "outputservice1protocoltest", - APIVersion: "", + service := &service.Service{ + ServiceInfo: serviceinfo.ServiceInfo{ + Config: defaults.DefaultConfig.Merge(config), + ServiceName: "outputservice1protocoltest", + APIVersion: "", + }, } service.Initialize() @@ -57,39 +61,36 @@ func NewOutputService1ProtocolTest(config *aws.Config) *OutputService1ProtocolTe // newRequest creates a new request for a OutputService1ProtocolTest operation and runs any // custom request initialization. -func (c *OutputService1ProtocolTest) newRequest(op *aws.Operation, params, data interface{}) *aws.Request { - req := aws.NewRequest(c.Service, op, params, data) +func (c *OutputService1ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { + req := c.NewRequest(op, params, data) return req } -// OutputService1TestCaseOperation1Request generates a request for the OutputService1TestCaseOperation1 operation. -func (c *OutputService1ProtocolTest) OutputService1TestCaseOperation1Request(input *OutputService1TestShapeOutputService1TestCaseOperation1Input) (req *aws.Request, output *OutputService1TestShapeOutputShape) { +const opOutputService1TestCaseOperation1 = "OperationName" - if opOutputService1TestCaseOperation1 == nil { - opOutputService1TestCaseOperation1 = &aws.Operation{ - Name: "OperationName", - } +// OutputService1TestCaseOperation1Request generates a request for the OutputService1TestCaseOperation1 operation. +func (c *OutputService1ProtocolTest) OutputService1TestCaseOperation1Request(input *OutputService1TestShapeOutputService1TestCaseOperation1Input) (req *request.Request, output *OutputService1TestShapeOutputService1TestCaseOperation1Output) { + op := &request.Operation{ + Name: opOutputService1TestCaseOperation1, } if input == nil { input = &OutputService1TestShapeOutputService1TestCaseOperation1Input{} } - req = c.newRequest(opOutputService1TestCaseOperation1, input, output) - output = &OutputService1TestShapeOutputShape{} + req = c.newRequest(op, input, output) + output = &OutputService1TestShapeOutputService1TestCaseOperation1Output{} req.Data = output return } -func (c *OutputService1ProtocolTest) OutputService1TestCaseOperation1(input *OutputService1TestShapeOutputService1TestCaseOperation1Input) (*OutputService1TestShapeOutputShape, error) { +func (c *OutputService1ProtocolTest) OutputService1TestCaseOperation1(input *OutputService1TestShapeOutputService1TestCaseOperation1Input) (*OutputService1TestShapeOutputService1TestCaseOperation1Output, error) { req, out := c.OutputService1TestCaseOperation1Request(input) err := req.Send() return out, err } -var opOutputService1TestCaseOperation1 *aws.Operation - type OutputService1TestShapeOutputService1TestCaseOperation1Input struct { metadataOutputService1TestShapeOutputService1TestCaseOperation1Input `json:"-" xml:"-"` } @@ -98,7 +99,7 @@ type metadataOutputService1TestShapeOutputService1TestCaseOperation1Input struct SDKShapeTraits bool `type:"structure"` } -type OutputService1TestShapeOutputShape struct { +type OutputService1TestShapeOutputService1TestCaseOperation1Output struct { Char *string `type:"character"` Double *float64 `type:"double"` @@ -115,24 +116,25 @@ type OutputService1TestShapeOutputShape struct { TrueBool *bool `type:"boolean"` - metadataOutputService1TestShapeOutputShape `json:"-" xml:"-"` + metadataOutputService1TestShapeOutputService1TestCaseOperation1Output `json:"-" xml:"-"` } -type metadataOutputService1TestShapeOutputShape struct { +type metadataOutputService1TestShapeOutputService1TestCaseOperation1Output struct { SDKShapeTraits bool `type:"structure"` } -// OutputService2ProtocolTest is a client for OutputService2ProtocolTest. type OutputService2ProtocolTest struct { - *aws.Service + *service.Service } // New returns a new OutputService2ProtocolTest client. func NewOutputService2ProtocolTest(config *aws.Config) *OutputService2ProtocolTest { - service := &aws.Service{ - Config: aws.DefaultConfig.Merge(config), - ServiceName: "outputservice2protocoltest", - APIVersion: "", + service := &service.Service{ + ServiceInfo: serviceinfo.ServiceInfo{ + Config: defaults.DefaultConfig.Merge(config), + ServiceName: "outputservice2protocoltest", + APIVersion: "", + }, } service.Initialize() @@ -148,39 +150,36 @@ func NewOutputService2ProtocolTest(config *aws.Config) *OutputService2ProtocolTe // newRequest creates a new request for a OutputService2ProtocolTest operation and runs any // custom request initialization. -func (c *OutputService2ProtocolTest) newRequest(op *aws.Operation, params, data interface{}) *aws.Request { - req := aws.NewRequest(c.Service, op, params, data) +func (c *OutputService2ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { + req := c.NewRequest(op, params, data) return req } -// OutputService2TestCaseOperation1Request generates a request for the OutputService2TestCaseOperation1 operation. -func (c *OutputService2ProtocolTest) OutputService2TestCaseOperation1Request(input *OutputService2TestShapeOutputService2TestCaseOperation1Input) (req *aws.Request, output *OutputService2TestShapeOutputShape) { +const opOutputService2TestCaseOperation1 = "OperationName" - if opOutputService2TestCaseOperation1 == nil { - opOutputService2TestCaseOperation1 = &aws.Operation{ - Name: "OperationName", - } +// OutputService2TestCaseOperation1Request generates a request for the OutputService2TestCaseOperation1 operation. +func (c *OutputService2ProtocolTest) OutputService2TestCaseOperation1Request(input *OutputService2TestShapeOutputService2TestCaseOperation1Input) (req *request.Request, output *OutputService2TestShapeOutputService2TestCaseOperation1Output) { + op := &request.Operation{ + Name: opOutputService2TestCaseOperation1, } if input == nil { input = &OutputService2TestShapeOutputService2TestCaseOperation1Input{} } - req = c.newRequest(opOutputService2TestCaseOperation1, input, output) - output = &OutputService2TestShapeOutputShape{} + req = c.newRequest(op, input, output) + output = &OutputService2TestShapeOutputService2TestCaseOperation1Output{} req.Data = output return } -func (c *OutputService2ProtocolTest) OutputService2TestCaseOperation1(input *OutputService2TestShapeOutputService2TestCaseOperation1Input) (*OutputService2TestShapeOutputShape, error) { +func (c *OutputService2ProtocolTest) OutputService2TestCaseOperation1(input *OutputService2TestShapeOutputService2TestCaseOperation1Input) (*OutputService2TestShapeOutputService2TestCaseOperation1Output, error) { req, out := c.OutputService2TestCaseOperation1Request(input) err := req.Send() return out, err } -var opOutputService2TestCaseOperation1 *aws.Operation - type OutputService2TestShapeOutputService2TestCaseOperation1Input struct { metadataOutputService2TestShapeOutputService2TestCaseOperation1Input `json:"-" xml:"-"` } @@ -189,27 +188,28 @@ type metadataOutputService2TestShapeOutputService2TestCaseOperation1Input struct SDKShapeTraits bool `type:"structure"` } -type OutputService2TestShapeOutputShape struct { +type OutputService2TestShapeOutputService2TestCaseOperation1Output struct { Blob []byte `type:"blob"` - metadataOutputService2TestShapeOutputShape `json:"-" xml:"-"` + metadataOutputService2TestShapeOutputService2TestCaseOperation1Output `json:"-" xml:"-"` } -type metadataOutputService2TestShapeOutputShape struct { +type metadataOutputService2TestShapeOutputService2TestCaseOperation1Output struct { SDKShapeTraits bool `type:"structure"` } -// OutputService3ProtocolTest is a client for OutputService3ProtocolTest. type OutputService3ProtocolTest struct { - *aws.Service + *service.Service } // New returns a new OutputService3ProtocolTest client. func NewOutputService3ProtocolTest(config *aws.Config) *OutputService3ProtocolTest { - service := &aws.Service{ - Config: aws.DefaultConfig.Merge(config), - ServiceName: "outputservice3protocoltest", - APIVersion: "", + service := &service.Service{ + ServiceInfo: serviceinfo.ServiceInfo{ + Config: defaults.DefaultConfig.Merge(config), + ServiceName: "outputservice3protocoltest", + APIVersion: "", + }, } service.Initialize() @@ -225,39 +225,36 @@ func NewOutputService3ProtocolTest(config *aws.Config) *OutputService3ProtocolTe // newRequest creates a new request for a OutputService3ProtocolTest operation and runs any // custom request initialization. -func (c *OutputService3ProtocolTest) newRequest(op *aws.Operation, params, data interface{}) *aws.Request { - req := aws.NewRequest(c.Service, op, params, data) +func (c *OutputService3ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { + req := c.NewRequest(op, params, data) return req } -// OutputService3TestCaseOperation1Request generates a request for the OutputService3TestCaseOperation1 operation. -func (c *OutputService3ProtocolTest) OutputService3TestCaseOperation1Request(input *OutputService3TestShapeOutputService3TestCaseOperation1Input) (req *aws.Request, output *OutputService3TestShapeOutputShape) { +const opOutputService3TestCaseOperation1 = "OperationName" - if opOutputService3TestCaseOperation1 == nil { - opOutputService3TestCaseOperation1 = &aws.Operation{ - Name: "OperationName", - } +// OutputService3TestCaseOperation1Request generates a request for the OutputService3TestCaseOperation1 operation. +func (c *OutputService3ProtocolTest) OutputService3TestCaseOperation1Request(input *OutputService3TestShapeOutputService3TestCaseOperation1Input) (req *request.Request, output *OutputService3TestShapeOutputService3TestCaseOperation1Output) { + op := &request.Operation{ + Name: opOutputService3TestCaseOperation1, } if input == nil { input = &OutputService3TestShapeOutputService3TestCaseOperation1Input{} } - req = c.newRequest(opOutputService3TestCaseOperation1, input, output) - output = &OutputService3TestShapeOutputShape{} + req = c.newRequest(op, input, output) + output = &OutputService3TestShapeOutputService3TestCaseOperation1Output{} req.Data = output return } -func (c *OutputService3ProtocolTest) OutputService3TestCaseOperation1(input *OutputService3TestShapeOutputService3TestCaseOperation1Input) (*OutputService3TestShapeOutputShape, error) { +func (c *OutputService3ProtocolTest) OutputService3TestCaseOperation1(input *OutputService3TestShapeOutputService3TestCaseOperation1Input) (*OutputService3TestShapeOutputService3TestCaseOperation1Output, error) { req, out := c.OutputService3TestCaseOperation1Request(input) err := req.Send() return out, err } -var opOutputService3TestCaseOperation1 *aws.Operation - type OutputService3TestShapeOutputService3TestCaseOperation1Input struct { metadataOutputService3TestShapeOutputService3TestCaseOperation1Input `json:"-" xml:"-"` } @@ -266,27 +263,28 @@ type metadataOutputService3TestShapeOutputService3TestCaseOperation1Input struct SDKShapeTraits bool `type:"structure"` } -type OutputService3TestShapeOutputShape struct { +type OutputService3TestShapeOutputService3TestCaseOperation1Output struct { ListMember []*string `type:"list"` - metadataOutputService3TestShapeOutputShape `json:"-" xml:"-"` + metadataOutputService3TestShapeOutputService3TestCaseOperation1Output `json:"-" xml:"-"` } -type metadataOutputService3TestShapeOutputShape struct { +type metadataOutputService3TestShapeOutputService3TestCaseOperation1Output struct { SDKShapeTraits bool `type:"structure"` } -// OutputService4ProtocolTest is a client for OutputService4ProtocolTest. type OutputService4ProtocolTest struct { - *aws.Service + *service.Service } // New returns a new OutputService4ProtocolTest client. func NewOutputService4ProtocolTest(config *aws.Config) *OutputService4ProtocolTest { - service := &aws.Service{ - Config: aws.DefaultConfig.Merge(config), - ServiceName: "outputservice4protocoltest", - APIVersion: "", + service := &service.Service{ + ServiceInfo: serviceinfo.ServiceInfo{ + Config: defaults.DefaultConfig.Merge(config), + ServiceName: "outputservice4protocoltest", + APIVersion: "", + }, } service.Initialize() @@ -302,39 +300,36 @@ func NewOutputService4ProtocolTest(config *aws.Config) *OutputService4ProtocolTe // newRequest creates a new request for a OutputService4ProtocolTest operation and runs any // custom request initialization. -func (c *OutputService4ProtocolTest) newRequest(op *aws.Operation, params, data interface{}) *aws.Request { - req := aws.NewRequest(c.Service, op, params, data) +func (c *OutputService4ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { + req := c.NewRequest(op, params, data) return req } -// OutputService4TestCaseOperation1Request generates a request for the OutputService4TestCaseOperation1 operation. -func (c *OutputService4ProtocolTest) OutputService4TestCaseOperation1Request(input *OutputService4TestShapeOutputService4TestCaseOperation1Input) (req *aws.Request, output *OutputService4TestShapeOutputShape) { +const opOutputService4TestCaseOperation1 = "OperationName" - if opOutputService4TestCaseOperation1 == nil { - opOutputService4TestCaseOperation1 = &aws.Operation{ - Name: "OperationName", - } +// OutputService4TestCaseOperation1Request generates a request for the OutputService4TestCaseOperation1 operation. +func (c *OutputService4ProtocolTest) OutputService4TestCaseOperation1Request(input *OutputService4TestShapeOutputService4TestCaseOperation1Input) (req *request.Request, output *OutputService4TestShapeOutputService4TestCaseOperation1Output) { + op := &request.Operation{ + Name: opOutputService4TestCaseOperation1, } if input == nil { input = &OutputService4TestShapeOutputService4TestCaseOperation1Input{} } - req = c.newRequest(opOutputService4TestCaseOperation1, input, output) - output = &OutputService4TestShapeOutputShape{} + req = c.newRequest(op, input, output) + output = &OutputService4TestShapeOutputService4TestCaseOperation1Output{} req.Data = output return } -func (c *OutputService4ProtocolTest) OutputService4TestCaseOperation1(input *OutputService4TestShapeOutputService4TestCaseOperation1Input) (*OutputService4TestShapeOutputShape, error) { +func (c *OutputService4ProtocolTest) OutputService4TestCaseOperation1(input *OutputService4TestShapeOutputService4TestCaseOperation1Input) (*OutputService4TestShapeOutputService4TestCaseOperation1Output, error) { req, out := c.OutputService4TestCaseOperation1Request(input) err := req.Send() return out, err } -var opOutputService4TestCaseOperation1 *aws.Operation - type OutputService4TestShapeOutputService4TestCaseOperation1Input struct { metadataOutputService4TestShapeOutputService4TestCaseOperation1Input `json:"-" xml:"-"` } @@ -343,27 +338,28 @@ type metadataOutputService4TestShapeOutputService4TestCaseOperation1Input struct SDKShapeTraits bool `type:"structure"` } -type OutputService4TestShapeOutputShape struct { +type OutputService4TestShapeOutputService4TestCaseOperation1Output struct { ListMember []*string `locationNameList:"item" type:"list"` - metadataOutputService4TestShapeOutputShape `json:"-" xml:"-"` + metadataOutputService4TestShapeOutputService4TestCaseOperation1Output `json:"-" xml:"-"` } -type metadataOutputService4TestShapeOutputShape struct { +type metadataOutputService4TestShapeOutputService4TestCaseOperation1Output struct { SDKShapeTraits bool `type:"structure"` } -// OutputService5ProtocolTest is a client for OutputService5ProtocolTest. type OutputService5ProtocolTest struct { - *aws.Service + *service.Service } // New returns a new OutputService5ProtocolTest client. func NewOutputService5ProtocolTest(config *aws.Config) *OutputService5ProtocolTest { - service := &aws.Service{ - Config: aws.DefaultConfig.Merge(config), - ServiceName: "outputservice5protocoltest", - APIVersion: "", + service := &service.Service{ + ServiceInfo: serviceinfo.ServiceInfo{ + Config: defaults.DefaultConfig.Merge(config), + ServiceName: "outputservice5protocoltest", + APIVersion: "", + }, } service.Initialize() @@ -379,39 +375,36 @@ func NewOutputService5ProtocolTest(config *aws.Config) *OutputService5ProtocolTe // newRequest creates a new request for a OutputService5ProtocolTest operation and runs any // custom request initialization. -func (c *OutputService5ProtocolTest) newRequest(op *aws.Operation, params, data interface{}) *aws.Request { - req := aws.NewRequest(c.Service, op, params, data) +func (c *OutputService5ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { + req := c.NewRequest(op, params, data) return req } -// OutputService5TestCaseOperation1Request generates a request for the OutputService5TestCaseOperation1 operation. -func (c *OutputService5ProtocolTest) OutputService5TestCaseOperation1Request(input *OutputService5TestShapeOutputService5TestCaseOperation1Input) (req *aws.Request, output *OutputService5TestShapeOutputShape) { +const opOutputService5TestCaseOperation1 = "OperationName" - if opOutputService5TestCaseOperation1 == nil { - opOutputService5TestCaseOperation1 = &aws.Operation{ - Name: "OperationName", - } +// OutputService5TestCaseOperation1Request generates a request for the OutputService5TestCaseOperation1 operation. +func (c *OutputService5ProtocolTest) OutputService5TestCaseOperation1Request(input *OutputService5TestShapeOutputService5TestCaseOperation1Input) (req *request.Request, output *OutputService5TestShapeOutputService5TestCaseOperation1Output) { + op := &request.Operation{ + Name: opOutputService5TestCaseOperation1, } if input == nil { input = &OutputService5TestShapeOutputService5TestCaseOperation1Input{} } - req = c.newRequest(opOutputService5TestCaseOperation1, input, output) - output = &OutputService5TestShapeOutputShape{} + req = c.newRequest(op, input, output) + output = &OutputService5TestShapeOutputService5TestCaseOperation1Output{} req.Data = output return } -func (c *OutputService5ProtocolTest) OutputService5TestCaseOperation1(input *OutputService5TestShapeOutputService5TestCaseOperation1Input) (*OutputService5TestShapeOutputShape, error) { +func (c *OutputService5ProtocolTest) OutputService5TestCaseOperation1(input *OutputService5TestShapeOutputService5TestCaseOperation1Input) (*OutputService5TestShapeOutputService5TestCaseOperation1Output, error) { req, out := c.OutputService5TestCaseOperation1Request(input) err := req.Send() return out, err } -var opOutputService5TestCaseOperation1 *aws.Operation - type OutputService5TestShapeOutputService5TestCaseOperation1Input struct { metadataOutputService5TestShapeOutputService5TestCaseOperation1Input `json:"-" xml:"-"` } @@ -420,27 +413,28 @@ type metadataOutputService5TestShapeOutputService5TestCaseOperation1Input struct SDKShapeTraits bool `type:"structure"` } -type OutputService5TestShapeOutputShape struct { +type OutputService5TestShapeOutputService5TestCaseOperation1Output struct { ListMember []*string `type:"list" flattened:"true"` - metadataOutputService5TestShapeOutputShape `json:"-" xml:"-"` + metadataOutputService5TestShapeOutputService5TestCaseOperation1Output `json:"-" xml:"-"` } -type metadataOutputService5TestShapeOutputShape struct { +type metadataOutputService5TestShapeOutputService5TestCaseOperation1Output struct { SDKShapeTraits bool `type:"structure"` } -// OutputService6ProtocolTest is a client for OutputService6ProtocolTest. type OutputService6ProtocolTest struct { - *aws.Service + *service.Service } // New returns a new OutputService6ProtocolTest client. func NewOutputService6ProtocolTest(config *aws.Config) *OutputService6ProtocolTest { - service := &aws.Service{ - Config: aws.DefaultConfig.Merge(config), - ServiceName: "outputservice6protocoltest", - APIVersion: "", + service := &service.Service{ + ServiceInfo: serviceinfo.ServiceInfo{ + Config: defaults.DefaultConfig.Merge(config), + ServiceName: "outputservice6protocoltest", + APIVersion: "", + }, } service.Initialize() @@ -456,39 +450,36 @@ func NewOutputService6ProtocolTest(config *aws.Config) *OutputService6ProtocolTe // newRequest creates a new request for a OutputService6ProtocolTest operation and runs any // custom request initialization. -func (c *OutputService6ProtocolTest) newRequest(op *aws.Operation, params, data interface{}) *aws.Request { - req := aws.NewRequest(c.Service, op, params, data) +func (c *OutputService6ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { + req := c.NewRequest(op, params, data) return req } -// OutputService6TestCaseOperation1Request generates a request for the OutputService6TestCaseOperation1 operation. -func (c *OutputService6ProtocolTest) OutputService6TestCaseOperation1Request(input *OutputService6TestShapeOutputService6TestCaseOperation1Input) (req *aws.Request, output *OutputService6TestShapeOutputShape) { +const opOutputService6TestCaseOperation1 = "OperationName" - if opOutputService6TestCaseOperation1 == nil { - opOutputService6TestCaseOperation1 = &aws.Operation{ - Name: "OperationName", - } +// OutputService6TestCaseOperation1Request generates a request for the OutputService6TestCaseOperation1 operation. +func (c *OutputService6ProtocolTest) OutputService6TestCaseOperation1Request(input *OutputService6TestShapeOutputService6TestCaseOperation1Input) (req *request.Request, output *OutputService6TestShapeOutputService6TestCaseOperation1Output) { + op := &request.Operation{ + Name: opOutputService6TestCaseOperation1, } if input == nil { input = &OutputService6TestShapeOutputService6TestCaseOperation1Input{} } - req = c.newRequest(opOutputService6TestCaseOperation1, input, output) - output = &OutputService6TestShapeOutputShape{} + req = c.newRequest(op, input, output) + output = &OutputService6TestShapeOutputService6TestCaseOperation1Output{} req.Data = output return } -func (c *OutputService6ProtocolTest) OutputService6TestCaseOperation1(input *OutputService6TestShapeOutputService6TestCaseOperation1Input) (*OutputService6TestShapeOutputShape, error) { +func (c *OutputService6ProtocolTest) OutputService6TestCaseOperation1(input *OutputService6TestShapeOutputService6TestCaseOperation1Input) (*OutputService6TestShapeOutputService6TestCaseOperation1Output, error) { req, out := c.OutputService6TestCaseOperation1Request(input) err := req.Send() return out, err } -var opOutputService6TestCaseOperation1 *aws.Operation - type OutputService6TestShapeOutputService6TestCaseOperation1Input struct { metadataOutputService6TestShapeOutputService6TestCaseOperation1Input `json:"-" xml:"-"` } @@ -497,13 +488,13 @@ type metadataOutputService6TestShapeOutputService6TestCaseOperation1Input struct SDKShapeTraits bool `type:"structure"` } -type OutputService6TestShapeOutputShape struct { +type OutputService6TestShapeOutputService6TestCaseOperation1Output struct { Map map[string]*OutputService6TestShapeStructureType `type:"map"` - metadataOutputService6TestShapeOutputShape `json:"-" xml:"-"` + metadataOutputService6TestShapeOutputService6TestCaseOperation1Output `json:"-" xml:"-"` } -type metadataOutputService6TestShapeOutputShape struct { +type metadataOutputService6TestShapeOutputService6TestCaseOperation1Output struct { SDKShapeTraits bool `type:"structure"` } @@ -517,17 +508,18 @@ type metadataOutputService6TestShapeStructureType struct { SDKShapeTraits bool `type:"structure"` } -// OutputService7ProtocolTest is a client for OutputService7ProtocolTest. type OutputService7ProtocolTest struct { - *aws.Service + *service.Service } // New returns a new OutputService7ProtocolTest client. func NewOutputService7ProtocolTest(config *aws.Config) *OutputService7ProtocolTest { - service := &aws.Service{ - Config: aws.DefaultConfig.Merge(config), - ServiceName: "outputservice7protocoltest", - APIVersion: "", + service := &service.Service{ + ServiceInfo: serviceinfo.ServiceInfo{ + Config: defaults.DefaultConfig.Merge(config), + ServiceName: "outputservice7protocoltest", + APIVersion: "", + }, } service.Initialize() @@ -543,39 +535,36 @@ func NewOutputService7ProtocolTest(config *aws.Config) *OutputService7ProtocolTe // newRequest creates a new request for a OutputService7ProtocolTest operation and runs any // custom request initialization. -func (c *OutputService7ProtocolTest) newRequest(op *aws.Operation, params, data interface{}) *aws.Request { - req := aws.NewRequest(c.Service, op, params, data) +func (c *OutputService7ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { + req := c.NewRequest(op, params, data) return req } -// OutputService7TestCaseOperation1Request generates a request for the OutputService7TestCaseOperation1 operation. -func (c *OutputService7ProtocolTest) OutputService7TestCaseOperation1Request(input *OutputService7TestShapeOutputService7TestCaseOperation1Input) (req *aws.Request, output *OutputService7TestShapeOutputShape) { +const opOutputService7TestCaseOperation1 = "OperationName" - if opOutputService7TestCaseOperation1 == nil { - opOutputService7TestCaseOperation1 = &aws.Operation{ - Name: "OperationName", - } +// OutputService7TestCaseOperation1Request generates a request for the OutputService7TestCaseOperation1 operation. +func (c *OutputService7ProtocolTest) OutputService7TestCaseOperation1Request(input *OutputService7TestShapeOutputService7TestCaseOperation1Input) (req *request.Request, output *OutputService7TestShapeOutputService7TestCaseOperation1Output) { + op := &request.Operation{ + Name: opOutputService7TestCaseOperation1, } if input == nil { input = &OutputService7TestShapeOutputService7TestCaseOperation1Input{} } - req = c.newRequest(opOutputService7TestCaseOperation1, input, output) - output = &OutputService7TestShapeOutputShape{} + req = c.newRequest(op, input, output) + output = &OutputService7TestShapeOutputService7TestCaseOperation1Output{} req.Data = output return } -func (c *OutputService7ProtocolTest) OutputService7TestCaseOperation1(input *OutputService7TestShapeOutputService7TestCaseOperation1Input) (*OutputService7TestShapeOutputShape, error) { +func (c *OutputService7ProtocolTest) OutputService7TestCaseOperation1(input *OutputService7TestShapeOutputService7TestCaseOperation1Input) (*OutputService7TestShapeOutputService7TestCaseOperation1Output, error) { req, out := c.OutputService7TestCaseOperation1Request(input) err := req.Send() return out, err } -var opOutputService7TestCaseOperation1 *aws.Operation - type OutputService7TestShapeOutputService7TestCaseOperation1Input struct { metadataOutputService7TestShapeOutputService7TestCaseOperation1Input `json:"-" xml:"-"` } @@ -584,27 +573,28 @@ type metadataOutputService7TestShapeOutputService7TestCaseOperation1Input struct SDKShapeTraits bool `type:"structure"` } -type OutputService7TestShapeOutputShape struct { +type OutputService7TestShapeOutputService7TestCaseOperation1Output struct { Map map[string]*string `type:"map" flattened:"true"` - metadataOutputService7TestShapeOutputShape `json:"-" xml:"-"` + metadataOutputService7TestShapeOutputService7TestCaseOperation1Output `json:"-" xml:"-"` } -type metadataOutputService7TestShapeOutputShape struct { +type metadataOutputService7TestShapeOutputService7TestCaseOperation1Output struct { SDKShapeTraits bool `type:"structure"` } -// OutputService8ProtocolTest is a client for OutputService8ProtocolTest. type OutputService8ProtocolTest struct { - *aws.Service + *service.Service } // New returns a new OutputService8ProtocolTest client. func NewOutputService8ProtocolTest(config *aws.Config) *OutputService8ProtocolTest { - service := &aws.Service{ - Config: aws.DefaultConfig.Merge(config), - ServiceName: "outputservice8protocoltest", - APIVersion: "", + service := &service.Service{ + ServiceInfo: serviceinfo.ServiceInfo{ + Config: defaults.DefaultConfig.Merge(config), + ServiceName: "outputservice8protocoltest", + APIVersion: "", + }, } service.Initialize() @@ -620,39 +610,36 @@ func NewOutputService8ProtocolTest(config *aws.Config) *OutputService8ProtocolTe // newRequest creates a new request for a OutputService8ProtocolTest operation and runs any // custom request initialization. -func (c *OutputService8ProtocolTest) newRequest(op *aws.Operation, params, data interface{}) *aws.Request { - req := aws.NewRequest(c.Service, op, params, data) +func (c *OutputService8ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { + req := c.NewRequest(op, params, data) return req } -// OutputService8TestCaseOperation1Request generates a request for the OutputService8TestCaseOperation1 operation. -func (c *OutputService8ProtocolTest) OutputService8TestCaseOperation1Request(input *OutputService8TestShapeOutputService8TestCaseOperation1Input) (req *aws.Request, output *OutputService8TestShapeOutputShape) { +const opOutputService8TestCaseOperation1 = "OperationName" - if opOutputService8TestCaseOperation1 == nil { - opOutputService8TestCaseOperation1 = &aws.Operation{ - Name: "OperationName", - } +// OutputService8TestCaseOperation1Request generates a request for the OutputService8TestCaseOperation1 operation. +func (c *OutputService8ProtocolTest) OutputService8TestCaseOperation1Request(input *OutputService8TestShapeOutputService8TestCaseOperation1Input) (req *request.Request, output *OutputService8TestShapeOutputService8TestCaseOperation1Output) { + op := &request.Operation{ + Name: opOutputService8TestCaseOperation1, } if input == nil { input = &OutputService8TestShapeOutputService8TestCaseOperation1Input{} } - req = c.newRequest(opOutputService8TestCaseOperation1, input, output) - output = &OutputService8TestShapeOutputShape{} + req = c.newRequest(op, input, output) + output = &OutputService8TestShapeOutputService8TestCaseOperation1Output{} req.Data = output return } -func (c *OutputService8ProtocolTest) OutputService8TestCaseOperation1(input *OutputService8TestShapeOutputService8TestCaseOperation1Input) (*OutputService8TestShapeOutputShape, error) { +func (c *OutputService8ProtocolTest) OutputService8TestCaseOperation1(input *OutputService8TestShapeOutputService8TestCaseOperation1Input) (*OutputService8TestShapeOutputService8TestCaseOperation1Output, error) { req, out := c.OutputService8TestCaseOperation1Request(input) err := req.Send() return out, err } -var opOutputService8TestCaseOperation1 *aws.Operation - type OutputService8TestShapeOutputService8TestCaseOperation1Input struct { metadataOutputService8TestShapeOutputService8TestCaseOperation1Input `json:"-" xml:"-"` } @@ -661,13 +648,13 @@ type metadataOutputService8TestShapeOutputService8TestCaseOperation1Input struct SDKShapeTraits bool `type:"structure"` } -type OutputService8TestShapeOutputShape struct { +type OutputService8TestShapeOutputService8TestCaseOperation1Output struct { Map map[string]*string `locationNameKey:"foo" locationNameValue:"bar" type:"map" flattened:"true"` - metadataOutputService8TestShapeOutputShape `json:"-" xml:"-"` + metadataOutputService8TestShapeOutputService8TestCaseOperation1Output `json:"-" xml:"-"` } -type metadataOutputService8TestShapeOutputShape struct { +type metadataOutputService8TestShapeOutputService8TestCaseOperation1Output struct { SDKShapeTraits bool `type:"structure"` } diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/query/build.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/query/build.go index 0f17031a0d8f..83ed8758ef97 100644 --- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/query/build.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/query/build.go @@ -6,19 +6,19 @@ package query import ( "net/url" - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/internal/apierr" + "github.com/aws/aws-sdk-go/aws/awserr" + "github.com/aws/aws-sdk-go/aws/request" "github.com/aws/aws-sdk-go/internal/protocol/query/queryutil" ) // Build builds a request for an AWS Query service. -func Build(r *aws.Request) { +func Build(r *request.Request) { body := url.Values{ "Action": {r.Operation.Name}, "Version": {r.Service.APIVersion}, } if err := queryutil.Parse(body, r.Params, false); err != nil { - r.Error = apierr.New("Marshal", "failed encoding Query request", err) + r.Error = awserr.New("SerializationError", "failed encoding Query request", err) return } diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/query/build_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/query/build_test.go index da266758b4f5..7b29fd79d747 100644 --- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/query/build_test.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/query/build_test.go @@ -1,10 +1,6 @@ package query_test import ( - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/internal/protocol/query" - "github.com/aws/aws-sdk-go/internal/signer/v4" - "bytes" "encoding/json" "encoding/xml" @@ -15,7 +11,14 @@ import ( "testing" "time" + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/defaults" + "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/aws/service" + "github.com/aws/aws-sdk-go/aws/service/serviceinfo" + "github.com/aws/aws-sdk-go/internal/protocol/query" "github.com/aws/aws-sdk-go/internal/protocol/xml/xmlutil" + "github.com/aws/aws-sdk-go/internal/signer/v4" "github.com/aws/aws-sdk-go/internal/util" "github.com/stretchr/testify/assert" ) @@ -31,17 +34,18 @@ var _ = util.Trim("") var _ = url.Values{} var _ = io.EOF -// InputService1ProtocolTest is a client for InputService1ProtocolTest. type InputService1ProtocolTest struct { - *aws.Service + *service.Service } // New returns a new InputService1ProtocolTest client. func NewInputService1ProtocolTest(config *aws.Config) *InputService1ProtocolTest { - service := &aws.Service{ - Config: aws.DefaultConfig.Merge(config), - ServiceName: "inputservice1protocoltest", - APIVersion: "2014-01-01", + service := &service.Service{ + ServiceInfo: serviceinfo.ServiceInfo{ + Config: defaults.DefaultConfig.Merge(config), + ServiceName: "inputservice1protocoltest", + APIVersion: "2014-01-01", + }, } service.Initialize() @@ -57,70 +61,68 @@ func NewInputService1ProtocolTest(config *aws.Config) *InputService1ProtocolTest // newRequest creates a new request for a InputService1ProtocolTest operation and runs any // custom request initialization. -func (c *InputService1ProtocolTest) newRequest(op *aws.Operation, params, data interface{}) *aws.Request { - req := aws.NewRequest(c.Service, op, params, data) +func (c *InputService1ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { + req := c.NewRequest(op, params, data) return req } -// InputService1TestCaseOperation1Request generates a request for the InputService1TestCaseOperation1 operation. -func (c *InputService1ProtocolTest) InputService1TestCaseOperation1Request(input *InputService1TestShapeInputShape) (req *aws.Request, output *InputService1TestShapeInputService1TestCaseOperation1Output) { +const opInputService1TestCaseOperation1 = "OperationName" - if opInputService1TestCaseOperation1 == nil { - opInputService1TestCaseOperation1 = &aws.Operation{ - Name: "OperationName", - } +// InputService1TestCaseOperation1Request generates a request for the InputService1TestCaseOperation1 operation. +func (c *InputService1ProtocolTest) InputService1TestCaseOperation1Request(input *InputService1TestShapeInputService1TestCaseOperation1Input) (req *request.Request, output *InputService1TestShapeInputService1TestCaseOperation1Output) { + op := &request.Operation{ + Name: opInputService1TestCaseOperation1, } if input == nil { - input = &InputService1TestShapeInputShape{} + input = &InputService1TestShapeInputService1TestCaseOperation1Input{} } - req = c.newRequest(opInputService1TestCaseOperation1, input, output) + req = c.newRequest(op, input, output) output = &InputService1TestShapeInputService1TestCaseOperation1Output{} req.Data = output return } -func (c *InputService1ProtocolTest) InputService1TestCaseOperation1(input *InputService1TestShapeInputShape) (*InputService1TestShapeInputService1TestCaseOperation1Output, error) { +func (c *InputService1ProtocolTest) InputService1TestCaseOperation1(input *InputService1TestShapeInputService1TestCaseOperation1Input) (*InputService1TestShapeInputService1TestCaseOperation1Output, error) { req, out := c.InputService1TestCaseOperation1Request(input) err := req.Send() return out, err } -var opInputService1TestCaseOperation1 *aws.Operation +type InputService1TestShapeInputService1TestCaseOperation1Input struct { + Bar *string `type:"string"` -type InputService1TestShapeInputService1TestCaseOperation1Output struct { - metadataInputService1TestShapeInputService1TestCaseOperation1Output `json:"-" xml:"-"` + Foo *string `type:"string"` + + metadataInputService1TestShapeInputService1TestCaseOperation1Input `json:"-" xml:"-"` } -type metadataInputService1TestShapeInputService1TestCaseOperation1Output struct { +type metadataInputService1TestShapeInputService1TestCaseOperation1Input struct { SDKShapeTraits bool `type:"structure"` } -type InputService1TestShapeInputShape struct { - Bar *string `type:"string"` - - Foo *string `type:"string"` - - metadataInputService1TestShapeInputShape `json:"-" xml:"-"` +type InputService1TestShapeInputService1TestCaseOperation1Output struct { + metadataInputService1TestShapeInputService1TestCaseOperation1Output `json:"-" xml:"-"` } -type metadataInputService1TestShapeInputShape struct { +type metadataInputService1TestShapeInputService1TestCaseOperation1Output struct { SDKShapeTraits bool `type:"structure"` } -// InputService2ProtocolTest is a client for InputService2ProtocolTest. type InputService2ProtocolTest struct { - *aws.Service + *service.Service } // New returns a new InputService2ProtocolTest client. func NewInputService2ProtocolTest(config *aws.Config) *InputService2ProtocolTest { - service := &aws.Service{ - Config: aws.DefaultConfig.Merge(config), - ServiceName: "inputservice2protocoltest", - APIVersion: "2014-01-01", + service := &service.Service{ + ServiceInfo: serviceinfo.ServiceInfo{ + Config: defaults.DefaultConfig.Merge(config), + ServiceName: "inputservice2protocoltest", + APIVersion: "2014-01-01", + }, } service.Initialize() @@ -136,54 +138,51 @@ func NewInputService2ProtocolTest(config *aws.Config) *InputService2ProtocolTest // newRequest creates a new request for a InputService2ProtocolTest operation and runs any // custom request initialization. -func (c *InputService2ProtocolTest) newRequest(op *aws.Operation, params, data interface{}) *aws.Request { - req := aws.NewRequest(c.Service, op, params, data) +func (c *InputService2ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { + req := c.NewRequest(op, params, data) return req } -// InputService2TestCaseOperation1Request generates a request for the InputService2TestCaseOperation1 operation. -func (c *InputService2ProtocolTest) InputService2TestCaseOperation1Request(input *InputService2TestShapeInputShape) (req *aws.Request, output *InputService2TestShapeInputService2TestCaseOperation1Output) { +const opInputService2TestCaseOperation1 = "OperationName" - if opInputService2TestCaseOperation1 == nil { - opInputService2TestCaseOperation1 = &aws.Operation{ - Name: "OperationName", - } +// InputService2TestCaseOperation1Request generates a request for the InputService2TestCaseOperation1 operation. +func (c *InputService2ProtocolTest) InputService2TestCaseOperation1Request(input *InputService2TestShapeInputService2TestCaseOperation1Input) (req *request.Request, output *InputService2TestShapeInputService2TestCaseOperation1Output) { + op := &request.Operation{ + Name: opInputService2TestCaseOperation1, } if input == nil { - input = &InputService2TestShapeInputShape{} + input = &InputService2TestShapeInputService2TestCaseOperation1Input{} } - req = c.newRequest(opInputService2TestCaseOperation1, input, output) + req = c.newRequest(op, input, output) output = &InputService2TestShapeInputService2TestCaseOperation1Output{} req.Data = output return } -func (c *InputService2ProtocolTest) InputService2TestCaseOperation1(input *InputService2TestShapeInputShape) (*InputService2TestShapeInputService2TestCaseOperation1Output, error) { +func (c *InputService2ProtocolTest) InputService2TestCaseOperation1(input *InputService2TestShapeInputService2TestCaseOperation1Input) (*InputService2TestShapeInputService2TestCaseOperation1Output, error) { req, out := c.InputService2TestCaseOperation1Request(input) err := req.Send() return out, err } -var opInputService2TestCaseOperation1 *aws.Operation +type InputService2TestShapeInputService2TestCaseOperation1Input struct { + StructArg *InputService2TestShapeStructType `type:"structure"` -type InputService2TestShapeInputService2TestCaseOperation1Output struct { - metadataInputService2TestShapeInputService2TestCaseOperation1Output `json:"-" xml:"-"` + metadataInputService2TestShapeInputService2TestCaseOperation1Input `json:"-" xml:"-"` } -type metadataInputService2TestShapeInputService2TestCaseOperation1Output struct { +type metadataInputService2TestShapeInputService2TestCaseOperation1Input struct { SDKShapeTraits bool `type:"structure"` } -type InputService2TestShapeInputShape struct { - StructArg *InputService2TestShapeStructType `type:"structure"` - - metadataInputService2TestShapeInputShape `json:"-" xml:"-"` +type InputService2TestShapeInputService2TestCaseOperation1Output struct { + metadataInputService2TestShapeInputService2TestCaseOperation1Output `json:"-" xml:"-"` } -type metadataInputService2TestShapeInputShape struct { +type metadataInputService2TestShapeInputService2TestCaseOperation1Output struct { SDKShapeTraits bool `type:"structure"` } @@ -197,17 +196,18 @@ type metadataInputService2TestShapeStructType struct { SDKShapeTraits bool `type:"structure"` } -// InputService3ProtocolTest is a client for InputService3ProtocolTest. type InputService3ProtocolTest struct { - *aws.Service + *service.Service } // New returns a new InputService3ProtocolTest client. func NewInputService3ProtocolTest(config *aws.Config) *InputService3ProtocolTest { - service := &aws.Service{ - Config: aws.DefaultConfig.Merge(config), - ServiceName: "inputservice3protocoltest", - APIVersion: "2014-01-01", + service := &service.Service{ + ServiceInfo: serviceinfo.ServiceInfo{ + Config: defaults.DefaultConfig.Merge(config), + ServiceName: "inputservice3protocoltest", + APIVersion: "2014-01-01", + }, } service.Initialize() @@ -223,66 +223,46 @@ func NewInputService3ProtocolTest(config *aws.Config) *InputService3ProtocolTest // newRequest creates a new request for a InputService3ProtocolTest operation and runs any // custom request initialization. -func (c *InputService3ProtocolTest) newRequest(op *aws.Operation, params, data interface{}) *aws.Request { - req := aws.NewRequest(c.Service, op, params, data) +func (c *InputService3ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { + req := c.NewRequest(op, params, data) return req } -// InputService3TestCaseOperation1Request generates a request for the InputService3TestCaseOperation1 operation. -func (c *InputService3ProtocolTest) InputService3TestCaseOperation1Request(input *InputService3TestShapeInputShape) (req *aws.Request, output *InputService3TestShapeInputService3TestCaseOperation1Output) { +const opInputService3TestCaseOperation1 = "OperationName" - if opInputService3TestCaseOperation1 == nil { - opInputService3TestCaseOperation1 = &aws.Operation{ - Name: "OperationName", - } +// InputService3TestCaseOperation1Request generates a request for the InputService3TestCaseOperation1 operation. +func (c *InputService3ProtocolTest) InputService3TestCaseOperation1Request(input *InputService3TestShapeInputService3TestCaseOperation1Input) (req *request.Request, output *InputService3TestShapeInputService3TestCaseOperation1Output) { + op := &request.Operation{ + Name: opInputService3TestCaseOperation1, } if input == nil { - input = &InputService3TestShapeInputShape{} + input = &InputService3TestShapeInputService3TestCaseOperation1Input{} } - req = c.newRequest(opInputService3TestCaseOperation1, input, output) + req = c.newRequest(op, input, output) output = &InputService3TestShapeInputService3TestCaseOperation1Output{} req.Data = output return } -func (c *InputService3ProtocolTest) InputService3TestCaseOperation1(input *InputService3TestShapeInputShape) (*InputService3TestShapeInputService3TestCaseOperation1Output, error) { +func (c *InputService3ProtocolTest) InputService3TestCaseOperation1(input *InputService3TestShapeInputService3TestCaseOperation1Input) (*InputService3TestShapeInputService3TestCaseOperation1Output, error) { req, out := c.InputService3TestCaseOperation1Request(input) err := req.Send() return out, err } -var opInputService3TestCaseOperation1 *aws.Operation - -// InputService3TestCaseOperation2Request generates a request for the InputService3TestCaseOperation2 operation. -func (c *InputService3ProtocolTest) InputService3TestCaseOperation2Request(input *InputService3TestShapeInputShape) (req *aws.Request, output *InputService3TestShapeInputService3TestCaseOperation2Output) { - - if opInputService3TestCaseOperation2 == nil { - opInputService3TestCaseOperation2 = &aws.Operation{ - Name: "OperationName", - } - } - - if input == nil { - input = &InputService3TestShapeInputShape{} - } +type InputService3TestShapeInputService3TestCaseOperation1Input struct { + ListArg []*string `type:"list"` - req = c.newRequest(opInputService3TestCaseOperation2, input, output) - output = &InputService3TestShapeInputService3TestCaseOperation2Output{} - req.Data = output - return + metadataInputService3TestShapeInputService3TestCaseOperation1Input `json:"-" xml:"-"` } -func (c *InputService3ProtocolTest) InputService3TestCaseOperation2(input *InputService3TestShapeInputShape) (*InputService3TestShapeInputService3TestCaseOperation2Output, error) { - req, out := c.InputService3TestCaseOperation2Request(input) - err := req.Send() - return out, err +type metadataInputService3TestShapeInputService3TestCaseOperation1Input struct { + SDKShapeTraits bool `type:"structure"` } -var opInputService3TestCaseOperation2 *aws.Operation - type InputService3TestShapeInputService3TestCaseOperation1Output struct { metadataInputService3TestShapeInputService3TestCaseOperation1Output `json:"-" xml:"-"` } @@ -291,35 +271,18 @@ type metadataInputService3TestShapeInputService3TestCaseOperation1Output struct SDKShapeTraits bool `type:"structure"` } -type InputService3TestShapeInputService3TestCaseOperation2Output struct { - metadataInputService3TestShapeInputService3TestCaseOperation2Output `json:"-" xml:"-"` -} - -type metadataInputService3TestShapeInputService3TestCaseOperation2Output struct { - SDKShapeTraits bool `type:"structure"` -} - -type InputService3TestShapeInputShape struct { - ListArg []*string `type:"list"` - - metadataInputService3TestShapeInputShape `json:"-" xml:"-"` -} - -type metadataInputService3TestShapeInputShape struct { - SDKShapeTraits bool `type:"structure"` -} - -// InputService4ProtocolTest is a client for InputService4ProtocolTest. type InputService4ProtocolTest struct { - *aws.Service + *service.Service } // New returns a new InputService4ProtocolTest client. func NewInputService4ProtocolTest(config *aws.Config) *InputService4ProtocolTest { - service := &aws.Service{ - Config: aws.DefaultConfig.Merge(config), - ServiceName: "inputservice4protocoltest", - APIVersion: "2014-01-01", + service := &service.Service{ + ServiceInfo: serviceinfo.ServiceInfo{ + Config: defaults.DefaultConfig.Merge(config), + ServiceName: "inputservice4protocoltest", + APIVersion: "2014-01-01", + }, } service.Initialize() @@ -335,66 +298,48 @@ func NewInputService4ProtocolTest(config *aws.Config) *InputService4ProtocolTest // newRequest creates a new request for a InputService4ProtocolTest operation and runs any // custom request initialization. -func (c *InputService4ProtocolTest) newRequest(op *aws.Operation, params, data interface{}) *aws.Request { - req := aws.NewRequest(c.Service, op, params, data) +func (c *InputService4ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { + req := c.NewRequest(op, params, data) return req } -// InputService4TestCaseOperation1Request generates a request for the InputService4TestCaseOperation1 operation. -func (c *InputService4ProtocolTest) InputService4TestCaseOperation1Request(input *InputService4TestShapeInputShape) (req *aws.Request, output *InputService4TestShapeInputService4TestCaseOperation1Output) { +const opInputService4TestCaseOperation1 = "OperationName" - if opInputService4TestCaseOperation1 == nil { - opInputService4TestCaseOperation1 = &aws.Operation{ - Name: "OperationName", - } +// InputService4TestCaseOperation1Request generates a request for the InputService4TestCaseOperation1 operation. +func (c *InputService4ProtocolTest) InputService4TestCaseOperation1Request(input *InputService4TestShapeInputService4TestCaseOperation1Input) (req *request.Request, output *InputService4TestShapeInputService4TestCaseOperation1Output) { + op := &request.Operation{ + Name: opInputService4TestCaseOperation1, } if input == nil { - input = &InputService4TestShapeInputShape{} + input = &InputService4TestShapeInputService4TestCaseOperation1Input{} } - req = c.newRequest(opInputService4TestCaseOperation1, input, output) + req = c.newRequest(op, input, output) output = &InputService4TestShapeInputService4TestCaseOperation1Output{} req.Data = output return } -func (c *InputService4ProtocolTest) InputService4TestCaseOperation1(input *InputService4TestShapeInputShape) (*InputService4TestShapeInputService4TestCaseOperation1Output, error) { +func (c *InputService4ProtocolTest) InputService4TestCaseOperation1(input *InputService4TestShapeInputService4TestCaseOperation1Input) (*InputService4TestShapeInputService4TestCaseOperation1Output, error) { req, out := c.InputService4TestCaseOperation1Request(input) err := req.Send() return out, err } -var opInputService4TestCaseOperation1 *aws.Operation - -// InputService4TestCaseOperation2Request generates a request for the InputService4TestCaseOperation2 operation. -func (c *InputService4ProtocolTest) InputService4TestCaseOperation2Request(input *InputService4TestShapeInputShape) (req *aws.Request, output *InputService4TestShapeInputService4TestCaseOperation2Output) { - - if opInputService4TestCaseOperation2 == nil { - opInputService4TestCaseOperation2 = &aws.Operation{ - Name: "OperationName", - } - } +type InputService4TestShapeInputService4TestCaseOperation1Input struct { + ListArg []*string `type:"list" flattened:"true"` - if input == nil { - input = &InputService4TestShapeInputShape{} - } + ScalarArg *string `type:"string"` - req = c.newRequest(opInputService4TestCaseOperation2, input, output) - output = &InputService4TestShapeInputService4TestCaseOperation2Output{} - req.Data = output - return + metadataInputService4TestShapeInputService4TestCaseOperation1Input `json:"-" xml:"-"` } -func (c *InputService4ProtocolTest) InputService4TestCaseOperation2(input *InputService4TestShapeInputShape) (*InputService4TestShapeInputService4TestCaseOperation2Output, error) { - req, out := c.InputService4TestCaseOperation2Request(input) - err := req.Send() - return out, err +type metadataInputService4TestShapeInputService4TestCaseOperation1Input struct { + SDKShapeTraits bool `type:"structure"` } -var opInputService4TestCaseOperation2 *aws.Operation - type InputService4TestShapeInputService4TestCaseOperation1Output struct { metadataInputService4TestShapeInputService4TestCaseOperation1Output `json:"-" xml:"-"` } @@ -403,37 +348,18 @@ type metadataInputService4TestShapeInputService4TestCaseOperation1Output struct SDKShapeTraits bool `type:"structure"` } -type InputService4TestShapeInputService4TestCaseOperation2Output struct { - metadataInputService4TestShapeInputService4TestCaseOperation2Output `json:"-" xml:"-"` -} - -type metadataInputService4TestShapeInputService4TestCaseOperation2Output struct { - SDKShapeTraits bool `type:"structure"` -} - -type InputService4TestShapeInputShape struct { - ListArg []*string `type:"list" flattened:"true"` - - ScalarArg *string `type:"string"` - - metadataInputService4TestShapeInputShape `json:"-" xml:"-"` -} - -type metadataInputService4TestShapeInputShape struct { - SDKShapeTraits bool `type:"structure"` -} - -// InputService5ProtocolTest is a client for InputService5ProtocolTest. type InputService5ProtocolTest struct { - *aws.Service + *service.Service } // New returns a new InputService5ProtocolTest client. func NewInputService5ProtocolTest(config *aws.Config) *InputService5ProtocolTest { - service := &aws.Service{ - Config: aws.DefaultConfig.Merge(config), - ServiceName: "inputservice5protocoltest", - APIVersion: "2014-01-01", + service := &service.Service{ + ServiceInfo: serviceinfo.ServiceInfo{ + Config: defaults.DefaultConfig.Merge(config), + ServiceName: "inputservice5protocoltest", + APIVersion: "2014-01-01", + }, } service.Initialize() @@ -449,66 +375,48 @@ func NewInputService5ProtocolTest(config *aws.Config) *InputService5ProtocolTest // newRequest creates a new request for a InputService5ProtocolTest operation and runs any // custom request initialization. -func (c *InputService5ProtocolTest) newRequest(op *aws.Operation, params, data interface{}) *aws.Request { - req := aws.NewRequest(c.Service, op, params, data) +func (c *InputService5ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { + req := c.NewRequest(op, params, data) return req } -// InputService5TestCaseOperation1Request generates a request for the InputService5TestCaseOperation1 operation. -func (c *InputService5ProtocolTest) InputService5TestCaseOperation1Request(input *InputService5TestShapeInputShape) (req *aws.Request, output *InputService5TestShapeInputService5TestCaseOperation1Output) { +const opInputService5TestCaseOperation1 = "OperationName" - if opInputService5TestCaseOperation1 == nil { - opInputService5TestCaseOperation1 = &aws.Operation{ - Name: "OperationName", - } +// InputService5TestCaseOperation1Request generates a request for the InputService5TestCaseOperation1 operation. +func (c *InputService5ProtocolTest) InputService5TestCaseOperation1Request(input *InputService5TestShapeInputService5TestCaseOperation1Input) (req *request.Request, output *InputService5TestShapeInputService5TestCaseOperation1Output) { + op := &request.Operation{ + Name: opInputService5TestCaseOperation1, } if input == nil { - input = &InputService5TestShapeInputShape{} + input = &InputService5TestShapeInputService5TestCaseOperation1Input{} } - req = c.newRequest(opInputService5TestCaseOperation1, input, output) + req = c.newRequest(op, input, output) output = &InputService5TestShapeInputService5TestCaseOperation1Output{} req.Data = output return } -func (c *InputService5ProtocolTest) InputService5TestCaseOperation1(input *InputService5TestShapeInputShape) (*InputService5TestShapeInputService5TestCaseOperation1Output, error) { +func (c *InputService5ProtocolTest) InputService5TestCaseOperation1(input *InputService5TestShapeInputService5TestCaseOperation1Input) (*InputService5TestShapeInputService5TestCaseOperation1Output, error) { req, out := c.InputService5TestCaseOperation1Request(input) err := req.Send() return out, err } -var opInputService5TestCaseOperation1 *aws.Operation +type InputService5TestShapeInputService5TestCaseOperation1Input struct { + ListArg []*string `locationNameList:"ListArgLocation" type:"list" flattened:"true"` -// InputService5TestCaseOperation2Request generates a request for the InputService5TestCaseOperation2 operation. -func (c *InputService5ProtocolTest) InputService5TestCaseOperation2Request(input *InputService5TestShapeInputShape) (req *aws.Request, output *InputService5TestShapeInputService5TestCaseOperation2Output) { - - if opInputService5TestCaseOperation2 == nil { - opInputService5TestCaseOperation2 = &aws.Operation{ - Name: "OperationName", - } - } - - if input == nil { - input = &InputService5TestShapeInputShape{} - } + ScalarArg *string `type:"string"` - req = c.newRequest(opInputService5TestCaseOperation2, input, output) - output = &InputService5TestShapeInputService5TestCaseOperation2Output{} - req.Data = output - return + metadataInputService5TestShapeInputService5TestCaseOperation1Input `json:"-" xml:"-"` } -func (c *InputService5ProtocolTest) InputService5TestCaseOperation2(input *InputService5TestShapeInputShape) (*InputService5TestShapeInputService5TestCaseOperation2Output, error) { - req, out := c.InputService5TestCaseOperation2Request(input) - err := req.Send() - return out, err +type metadataInputService5TestShapeInputService5TestCaseOperation1Input struct { + SDKShapeTraits bool `type:"structure"` } -var opInputService5TestCaseOperation2 *aws.Operation - type InputService5TestShapeInputService5TestCaseOperation1Output struct { metadataInputService5TestShapeInputService5TestCaseOperation1Output `json:"-" xml:"-"` } @@ -517,35 +425,18 @@ type metadataInputService5TestShapeInputService5TestCaseOperation1Output struct SDKShapeTraits bool `type:"structure"` } -type InputService5TestShapeInputService5TestCaseOperation2Output struct { - metadataInputService5TestShapeInputService5TestCaseOperation2Output `json:"-" xml:"-"` -} - -type metadataInputService5TestShapeInputService5TestCaseOperation2Output struct { - SDKShapeTraits bool `type:"structure"` -} - -type InputService5TestShapeInputShape struct { - MapArg map[string]*string `type:"map"` - - metadataInputService5TestShapeInputShape `json:"-" xml:"-"` -} - -type metadataInputService5TestShapeInputShape struct { - SDKShapeTraits bool `type:"structure"` -} - -// InputService6ProtocolTest is a client for InputService6ProtocolTest. type InputService6ProtocolTest struct { - *aws.Service + *service.Service } // New returns a new InputService6ProtocolTest client. func NewInputService6ProtocolTest(config *aws.Config) *InputService6ProtocolTest { - service := &aws.Service{ - Config: aws.DefaultConfig.Merge(config), - ServiceName: "inputservice6protocoltest", - APIVersion: "2014-01-01", + service := &service.Service{ + ServiceInfo: serviceinfo.ServiceInfo{ + Config: defaults.DefaultConfig.Merge(config), + ServiceName: "inputservice6protocoltest", + APIVersion: "2014-01-01", + }, } service.Initialize() @@ -561,68 +452,66 @@ func NewInputService6ProtocolTest(config *aws.Config) *InputService6ProtocolTest // newRequest creates a new request for a InputService6ProtocolTest operation and runs any // custom request initialization. -func (c *InputService6ProtocolTest) newRequest(op *aws.Operation, params, data interface{}) *aws.Request { - req := aws.NewRequest(c.Service, op, params, data) +func (c *InputService6ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { + req := c.NewRequest(op, params, data) return req } -// InputService6TestCaseOperation1Request generates a request for the InputService6TestCaseOperation1 operation. -func (c *InputService6ProtocolTest) InputService6TestCaseOperation1Request(input *InputService6TestShapeInputShape) (req *aws.Request, output *InputService6TestShapeInputService6TestCaseOperation1Output) { +const opInputService6TestCaseOperation1 = "OperationName" - if opInputService6TestCaseOperation1 == nil { - opInputService6TestCaseOperation1 = &aws.Operation{ - Name: "OperationName", - } +// InputService6TestCaseOperation1Request generates a request for the InputService6TestCaseOperation1 operation. +func (c *InputService6ProtocolTest) InputService6TestCaseOperation1Request(input *InputService6TestShapeInputService6TestCaseOperation1Input) (req *request.Request, output *InputService6TestShapeInputService6TestCaseOperation1Output) { + op := &request.Operation{ + Name: opInputService6TestCaseOperation1, } if input == nil { - input = &InputService6TestShapeInputShape{} + input = &InputService6TestShapeInputService6TestCaseOperation1Input{} } - req = c.newRequest(opInputService6TestCaseOperation1, input, output) + req = c.newRequest(op, input, output) output = &InputService6TestShapeInputService6TestCaseOperation1Output{} req.Data = output return } -func (c *InputService6ProtocolTest) InputService6TestCaseOperation1(input *InputService6TestShapeInputShape) (*InputService6TestShapeInputService6TestCaseOperation1Output, error) { +func (c *InputService6ProtocolTest) InputService6TestCaseOperation1(input *InputService6TestShapeInputService6TestCaseOperation1Input) (*InputService6TestShapeInputService6TestCaseOperation1Output, error) { req, out := c.InputService6TestCaseOperation1Request(input) err := req.Send() return out, err } -var opInputService6TestCaseOperation1 *aws.Operation +type InputService6TestShapeInputService6TestCaseOperation1Input struct { + MapArg map[string]*string `type:"map"` -type InputService6TestShapeInputService6TestCaseOperation1Output struct { - metadataInputService6TestShapeInputService6TestCaseOperation1Output `json:"-" xml:"-"` + metadataInputService6TestShapeInputService6TestCaseOperation1Input `json:"-" xml:"-"` } -type metadataInputService6TestShapeInputService6TestCaseOperation1Output struct { +type metadataInputService6TestShapeInputService6TestCaseOperation1Input struct { SDKShapeTraits bool `type:"structure"` } -type InputService6TestShapeInputShape struct { - MapArg map[string]*string `locationNameKey:"TheKey" locationNameValue:"TheValue" type:"map"` - - metadataInputService6TestShapeInputShape `json:"-" xml:"-"` +type InputService6TestShapeInputService6TestCaseOperation1Output struct { + metadataInputService6TestShapeInputService6TestCaseOperation1Output `json:"-" xml:"-"` } -type metadataInputService6TestShapeInputShape struct { +type metadataInputService6TestShapeInputService6TestCaseOperation1Output struct { SDKShapeTraits bool `type:"structure"` } -// InputService7ProtocolTest is a client for InputService7ProtocolTest. type InputService7ProtocolTest struct { - *aws.Service + *service.Service } // New returns a new InputService7ProtocolTest client. func NewInputService7ProtocolTest(config *aws.Config) *InputService7ProtocolTest { - service := &aws.Service{ - Config: aws.DefaultConfig.Merge(config), - ServiceName: "inputservice7protocoltest", - APIVersion: "2014-01-01", + service := &service.Service{ + ServiceInfo: serviceinfo.ServiceInfo{ + Config: defaults.DefaultConfig.Merge(config), + ServiceName: "inputservice7protocoltest", + APIVersion: "2014-01-01", + }, } service.Initialize() @@ -638,68 +527,66 @@ func NewInputService7ProtocolTest(config *aws.Config) *InputService7ProtocolTest // newRequest creates a new request for a InputService7ProtocolTest operation and runs any // custom request initialization. -func (c *InputService7ProtocolTest) newRequest(op *aws.Operation, params, data interface{}) *aws.Request { - req := aws.NewRequest(c.Service, op, params, data) +func (c *InputService7ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { + req := c.NewRequest(op, params, data) return req } -// InputService7TestCaseOperation1Request generates a request for the InputService7TestCaseOperation1 operation. -func (c *InputService7ProtocolTest) InputService7TestCaseOperation1Request(input *InputService7TestShapeInputShape) (req *aws.Request, output *InputService7TestShapeInputService7TestCaseOperation1Output) { +const opInputService7TestCaseOperation1 = "OperationName" - if opInputService7TestCaseOperation1 == nil { - opInputService7TestCaseOperation1 = &aws.Operation{ - Name: "OperationName", - } +// InputService7TestCaseOperation1Request generates a request for the InputService7TestCaseOperation1 operation. +func (c *InputService7ProtocolTest) InputService7TestCaseOperation1Request(input *InputService7TestShapeInputService7TestCaseOperation1Input) (req *request.Request, output *InputService7TestShapeInputService7TestCaseOperation1Output) { + op := &request.Operation{ + Name: opInputService7TestCaseOperation1, } if input == nil { - input = &InputService7TestShapeInputShape{} + input = &InputService7TestShapeInputService7TestCaseOperation1Input{} } - req = c.newRequest(opInputService7TestCaseOperation1, input, output) + req = c.newRequest(op, input, output) output = &InputService7TestShapeInputService7TestCaseOperation1Output{} req.Data = output return } -func (c *InputService7ProtocolTest) InputService7TestCaseOperation1(input *InputService7TestShapeInputShape) (*InputService7TestShapeInputService7TestCaseOperation1Output, error) { +func (c *InputService7ProtocolTest) InputService7TestCaseOperation1(input *InputService7TestShapeInputService7TestCaseOperation1Input) (*InputService7TestShapeInputService7TestCaseOperation1Output, error) { req, out := c.InputService7TestCaseOperation1Request(input) err := req.Send() return out, err } -var opInputService7TestCaseOperation1 *aws.Operation +type InputService7TestShapeInputService7TestCaseOperation1Input struct { + BlobArg []byte `type:"blob"` -type InputService7TestShapeInputService7TestCaseOperation1Output struct { - metadataInputService7TestShapeInputService7TestCaseOperation1Output `json:"-" xml:"-"` + metadataInputService7TestShapeInputService7TestCaseOperation1Input `json:"-" xml:"-"` } -type metadataInputService7TestShapeInputService7TestCaseOperation1Output struct { +type metadataInputService7TestShapeInputService7TestCaseOperation1Input struct { SDKShapeTraits bool `type:"structure"` } -type InputService7TestShapeInputShape struct { - BlobArg []byte `type:"blob"` - - metadataInputService7TestShapeInputShape `json:"-" xml:"-"` +type InputService7TestShapeInputService7TestCaseOperation1Output struct { + metadataInputService7TestShapeInputService7TestCaseOperation1Output `json:"-" xml:"-"` } -type metadataInputService7TestShapeInputShape struct { +type metadataInputService7TestShapeInputService7TestCaseOperation1Output struct { SDKShapeTraits bool `type:"structure"` } -// InputService8ProtocolTest is a client for InputService8ProtocolTest. type InputService8ProtocolTest struct { - *aws.Service + *service.Service } // New returns a new InputService8ProtocolTest client. func NewInputService8ProtocolTest(config *aws.Config) *InputService8ProtocolTest { - service := &aws.Service{ - Config: aws.DefaultConfig.Merge(config), - ServiceName: "inputservice8protocoltest", - APIVersion: "2014-01-01", + service := &service.Service{ + ServiceInfo: serviceinfo.ServiceInfo{ + Config: defaults.DefaultConfig.Merge(config), + ServiceName: "inputservice8protocoltest", + APIVersion: "2014-01-01", + }, } service.Initialize() @@ -715,68 +602,66 @@ func NewInputService8ProtocolTest(config *aws.Config) *InputService8ProtocolTest // newRequest creates a new request for a InputService8ProtocolTest operation and runs any // custom request initialization. -func (c *InputService8ProtocolTest) newRequest(op *aws.Operation, params, data interface{}) *aws.Request { - req := aws.NewRequest(c.Service, op, params, data) +func (c *InputService8ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { + req := c.NewRequest(op, params, data) return req } -// InputService8TestCaseOperation1Request generates a request for the InputService8TestCaseOperation1 operation. -func (c *InputService8ProtocolTest) InputService8TestCaseOperation1Request(input *InputService8TestShapeInputShape) (req *aws.Request, output *InputService8TestShapeInputService8TestCaseOperation1Output) { +const opInputService8TestCaseOperation1 = "OperationName" - if opInputService8TestCaseOperation1 == nil { - opInputService8TestCaseOperation1 = &aws.Operation{ - Name: "OperationName", - } +// InputService8TestCaseOperation1Request generates a request for the InputService8TestCaseOperation1 operation. +func (c *InputService8ProtocolTest) InputService8TestCaseOperation1Request(input *InputService8TestShapeInputService8TestCaseOperation1Input) (req *request.Request, output *InputService8TestShapeInputService8TestCaseOperation1Output) { + op := &request.Operation{ + Name: opInputService8TestCaseOperation1, } if input == nil { - input = &InputService8TestShapeInputShape{} + input = &InputService8TestShapeInputService8TestCaseOperation1Input{} } - req = c.newRequest(opInputService8TestCaseOperation1, input, output) + req = c.newRequest(op, input, output) output = &InputService8TestShapeInputService8TestCaseOperation1Output{} req.Data = output return } -func (c *InputService8ProtocolTest) InputService8TestCaseOperation1(input *InputService8TestShapeInputShape) (*InputService8TestShapeInputService8TestCaseOperation1Output, error) { +func (c *InputService8ProtocolTest) InputService8TestCaseOperation1(input *InputService8TestShapeInputService8TestCaseOperation1Input) (*InputService8TestShapeInputService8TestCaseOperation1Output, error) { req, out := c.InputService8TestCaseOperation1Request(input) err := req.Send() return out, err } -var opInputService8TestCaseOperation1 *aws.Operation +type InputService8TestShapeInputService8TestCaseOperation1Input struct { + TimeArg *time.Time `type:"timestamp" timestampFormat:"iso8601"` -type InputService8TestShapeInputService8TestCaseOperation1Output struct { - metadataInputService8TestShapeInputService8TestCaseOperation1Output `json:"-" xml:"-"` + metadataInputService8TestShapeInputService8TestCaseOperation1Input `json:"-" xml:"-"` } -type metadataInputService8TestShapeInputService8TestCaseOperation1Output struct { +type metadataInputService8TestShapeInputService8TestCaseOperation1Input struct { SDKShapeTraits bool `type:"structure"` } -type InputService8TestShapeInputShape struct { - TimeArg *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - metadataInputService8TestShapeInputShape `json:"-" xml:"-"` +type InputService8TestShapeInputService8TestCaseOperation1Output struct { + metadataInputService8TestShapeInputService8TestCaseOperation1Output `json:"-" xml:"-"` } -type metadataInputService8TestShapeInputShape struct { +type metadataInputService8TestShapeInputService8TestCaseOperation1Output struct { SDKShapeTraits bool `type:"structure"` } -// InputService9ProtocolTest is a client for InputService9ProtocolTest. type InputService9ProtocolTest struct { - *aws.Service + *service.Service } // New returns a new InputService9ProtocolTest client. func NewInputService9ProtocolTest(config *aws.Config) *InputService9ProtocolTest { - service := &aws.Service{ - Config: aws.DefaultConfig.Merge(config), - ServiceName: "inputservice9protocoltest", - APIVersion: "2014-01-01", + service := &service.Service{ + ServiceInfo: serviceinfo.ServiceInfo{ + Config: defaults.DefaultConfig.Merge(config), + ServiceName: "inputservice9protocoltest", + APIVersion: "2014-01-01", + }, } service.Initialize() @@ -792,26 +677,25 @@ func NewInputService9ProtocolTest(config *aws.Config) *InputService9ProtocolTest // newRequest creates a new request for a InputService9ProtocolTest operation and runs any // custom request initialization. -func (c *InputService9ProtocolTest) newRequest(op *aws.Operation, params, data interface{}) *aws.Request { - req := aws.NewRequest(c.Service, op, params, data) +func (c *InputService9ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { + req := c.NewRequest(op, params, data) return req } -// InputService9TestCaseOperation1Request generates a request for the InputService9TestCaseOperation1 operation. -func (c *InputService9ProtocolTest) InputService9TestCaseOperation1Request(input *InputService9TestShapeInputShape) (req *aws.Request, output *InputService9TestShapeInputService9TestCaseOperation1Output) { +const opInputService9TestCaseOperation1 = "OperationName" - if opInputService9TestCaseOperation1 == nil { - opInputService9TestCaseOperation1 = &aws.Operation{ - Name: "OperationName", - } +// InputService9TestCaseOperation1Request generates a request for the InputService9TestCaseOperation1 operation. +func (c *InputService9ProtocolTest) InputService9TestCaseOperation1Request(input *InputService9TestShapeInputShape) (req *request.Request, output *InputService9TestShapeInputService9TestCaseOperation1Output) { + op := &request.Operation{ + Name: opInputService9TestCaseOperation1, } if input == nil { input = &InputService9TestShapeInputShape{} } - req = c.newRequest(opInputService9TestCaseOperation1, input, output) + req = c.newRequest(op, input, output) output = &InputService9TestShapeInputService9TestCaseOperation1Output{} req.Data = output return @@ -823,22 +707,19 @@ func (c *InputService9ProtocolTest) InputService9TestCaseOperation1(input *Input return out, err } -var opInputService9TestCaseOperation1 *aws.Operation +const opInputService9TestCaseOperation2 = "OperationName" // InputService9TestCaseOperation2Request generates a request for the InputService9TestCaseOperation2 operation. -func (c *InputService9ProtocolTest) InputService9TestCaseOperation2Request(input *InputService9TestShapeInputShape) (req *aws.Request, output *InputService9TestShapeInputService9TestCaseOperation2Output) { - - if opInputService9TestCaseOperation2 == nil { - opInputService9TestCaseOperation2 = &aws.Operation{ - Name: "OperationName", - } +func (c *InputService9ProtocolTest) InputService9TestCaseOperation2Request(input *InputService9TestShapeInputShape) (req *request.Request, output *InputService9TestShapeInputService9TestCaseOperation2Output) { + op := &request.Operation{ + Name: opInputService9TestCaseOperation2, } if input == nil { input = &InputService9TestShapeInputShape{} } - req = c.newRequest(opInputService9TestCaseOperation2, input, output) + req = c.newRequest(op, input, output) output = &InputService9TestShapeInputService9TestCaseOperation2Output{} req.Data = output return @@ -850,22 +731,19 @@ func (c *InputService9ProtocolTest) InputService9TestCaseOperation2(input *Input return out, err } -var opInputService9TestCaseOperation2 *aws.Operation +const opInputService9TestCaseOperation3 = "OperationName" // InputService9TestCaseOperation3Request generates a request for the InputService9TestCaseOperation3 operation. -func (c *InputService9ProtocolTest) InputService9TestCaseOperation3Request(input *InputService9TestShapeInputShape) (req *aws.Request, output *InputService9TestShapeInputService9TestCaseOperation3Output) { - - if opInputService9TestCaseOperation3 == nil { - opInputService9TestCaseOperation3 = &aws.Operation{ - Name: "OperationName", - } +func (c *InputService9ProtocolTest) InputService9TestCaseOperation3Request(input *InputService9TestShapeInputShape) (req *request.Request, output *InputService9TestShapeInputService9TestCaseOperation3Output) { + op := &request.Operation{ + Name: opInputService9TestCaseOperation3, } if input == nil { input = &InputService9TestShapeInputShape{} } - req = c.newRequest(opInputService9TestCaseOperation3, input, output) + req = c.newRequest(op, input, output) output = &InputService9TestShapeInputService9TestCaseOperation3Output{} req.Data = output return @@ -877,22 +755,19 @@ func (c *InputService9ProtocolTest) InputService9TestCaseOperation3(input *Input return out, err } -var opInputService9TestCaseOperation3 *aws.Operation +const opInputService9TestCaseOperation4 = "OperationName" // InputService9TestCaseOperation4Request generates a request for the InputService9TestCaseOperation4 operation. -func (c *InputService9ProtocolTest) InputService9TestCaseOperation4Request(input *InputService9TestShapeInputShape) (req *aws.Request, output *InputService9TestShapeInputService9TestCaseOperation4Output) { - - if opInputService9TestCaseOperation4 == nil { - opInputService9TestCaseOperation4 = &aws.Operation{ - Name: "OperationName", - } +func (c *InputService9ProtocolTest) InputService9TestCaseOperation4Request(input *InputService9TestShapeInputShape) (req *request.Request, output *InputService9TestShapeInputService9TestCaseOperation4Output) { + op := &request.Operation{ + Name: opInputService9TestCaseOperation4, } if input == nil { input = &InputService9TestShapeInputShape{} } - req = c.newRequest(opInputService9TestCaseOperation4, input, output) + req = c.newRequest(op, input, output) output = &InputService9TestShapeInputService9TestCaseOperation4Output{} req.Data = output return @@ -904,22 +779,19 @@ func (c *InputService9ProtocolTest) InputService9TestCaseOperation4(input *Input return out, err } -var opInputService9TestCaseOperation4 *aws.Operation +const opInputService9TestCaseOperation5 = "OperationName" // InputService9TestCaseOperation5Request generates a request for the InputService9TestCaseOperation5 operation. -func (c *InputService9ProtocolTest) InputService9TestCaseOperation5Request(input *InputService9TestShapeInputShape) (req *aws.Request, output *InputService9TestShapeInputService9TestCaseOperation5Output) { - - if opInputService9TestCaseOperation5 == nil { - opInputService9TestCaseOperation5 = &aws.Operation{ - Name: "OperationName", - } +func (c *InputService9ProtocolTest) InputService9TestCaseOperation5Request(input *InputService9TestShapeInputShape) (req *request.Request, output *InputService9TestShapeInputService9TestCaseOperation5Output) { + op := &request.Operation{ + Name: opInputService9TestCaseOperation5, } if input == nil { input = &InputService9TestShapeInputShape{} } - req = c.newRequest(opInputService9TestCaseOperation5, input, output) + req = c.newRequest(op, input, output) output = &InputService9TestShapeInputService9TestCaseOperation5Output{} req.Data = output return @@ -931,22 +803,19 @@ func (c *InputService9ProtocolTest) InputService9TestCaseOperation5(input *Input return out, err } -var opInputService9TestCaseOperation5 *aws.Operation +const opInputService9TestCaseOperation6 = "OperationName" // InputService9TestCaseOperation6Request generates a request for the InputService9TestCaseOperation6 operation. -func (c *InputService9ProtocolTest) InputService9TestCaseOperation6Request(input *InputService9TestShapeInputShape) (req *aws.Request, output *InputService9TestShapeInputService9TestCaseOperation6Output) { - - if opInputService9TestCaseOperation6 == nil { - opInputService9TestCaseOperation6 = &aws.Operation{ - Name: "OperationName", - } +func (c *InputService9ProtocolTest) InputService9TestCaseOperation6Request(input *InputService9TestShapeInputShape) (req *request.Request, output *InputService9TestShapeInputService9TestCaseOperation6Output) { + op := &request.Operation{ + Name: opInputService9TestCaseOperation6, } if input == nil { input = &InputService9TestShapeInputShape{} } - req = c.newRequest(opInputService9TestCaseOperation6, input, output) + req = c.newRequest(op, input, output) output = &InputService9TestShapeInputService9TestCaseOperation6Output{} req.Data = output return @@ -958,8 +827,6 @@ func (c *InputService9ProtocolTest) InputService9TestCaseOperation6(input *Input return out, err } -var opInputService9TestCaseOperation6 *aws.Operation - type InputService9TestShapeInputService9TestCaseOperation1Output struct { metadataInputService9TestShapeInputService9TestCaseOperation1Output `json:"-" xml:"-"` } @@ -1042,7 +909,7 @@ func TestInputService1ProtocolTestScalarMembersCase1(t *testing.T) { svc := NewInputService1ProtocolTest(nil) svc.Endpoint = "https://test" - input := &InputService1TestShapeInputShape{ + input := &InputService1TestShapeInputService1TestCaseOperation1Input{ Bar: aws.String("val2"), Foo: aws.String("val1"), } @@ -1069,7 +936,7 @@ func TestInputService2ProtocolTestNestedStructureMembersCase1(t *testing.T) { svc := NewInputService2ProtocolTest(nil) svc.Endpoint = "https://test" - input := &InputService2TestShapeInputShape{ + input := &InputService2TestShapeInputService2TestCaseOperation1Input{ StructArg: &InputService2TestShapeStructType{ ScalarArg: aws.String("foo"), }, @@ -1097,7 +964,7 @@ func TestInputService3ProtocolTestListTypesCase1(t *testing.T) { svc := NewInputService3ProtocolTest(nil) svc.Endpoint = "https://test" - input := &InputService3TestShapeInputShape{ + input := &InputService3TestShapeInputService3TestCaseOperation1Input{ ListArg: []*string{ aws.String("foo"), aws.String("bar"), @@ -1123,37 +990,11 @@ func TestInputService3ProtocolTestListTypesCase1(t *testing.T) { } -func TestInputService3ProtocolTestListTypesCase2(t *testing.T) { - svc := NewInputService3ProtocolTest(nil) - svc.Endpoint = "https://test" - - input := &InputService3TestShapeInputShape{ - ListArg: []*string{}, - } - req, _ := svc.InputService3TestCaseOperation2Request(input) - r := req.HTTPRequest - - // build request - query.Build(req) - assert.NoError(t, req.Error) - - // assert body - assert.NotNil(t, r.Body) - body, _ := ioutil.ReadAll(r.Body) - assert.Equal(t, util.Trim(`Action=OperationName&ListArg=&Version=2014-01-01`), util.Trim(string(body))) - - // assert URL - assert.Equal(t, "https://test/", r.URL.String()) - - // assert headers - -} - func TestInputService4ProtocolTestFlattenedListCase1(t *testing.T) { svc := NewInputService4ProtocolTest(nil) svc.Endpoint = "https://test" - input := &InputService4TestShapeInputShape{ + input := &InputService4TestShapeInputService4TestCaseOperation1Input{ ListArg: []*string{ aws.String("a"), aws.String("b"), @@ -1180,42 +1021,17 @@ func TestInputService4ProtocolTestFlattenedListCase1(t *testing.T) { } -func TestInputService4ProtocolTestFlattenedListCase2(t *testing.T) { - svc := NewInputService4ProtocolTest(nil) - svc.Endpoint = "https://test" - - input := &InputService4TestShapeInputShape{ - ListArg: []*string{}, - ScalarArg: aws.String("foo"), - } - req, _ := svc.InputService4TestCaseOperation2Request(input) - r := req.HTTPRequest - - // build request - query.Build(req) - assert.NoError(t, req.Error) - - // assert body - assert.NotNil(t, r.Body) - body, _ := ioutil.ReadAll(r.Body) - assert.Equal(t, util.Trim(`Action=OperationName&ListArg=&ScalarArg=foo&Version=2014-01-01`), util.Trim(string(body))) - - // assert URL - assert.Equal(t, "https://test/", r.URL.String()) - - // assert headers - -} - -func TestInputService5ProtocolTestSerializeMapTypeCase1(t *testing.T) { +func TestInputService5ProtocolTestFlattenedListWithLocationNameCase1(t *testing.T) { svc := NewInputService5ProtocolTest(nil) svc.Endpoint = "https://test" - input := &InputService5TestShapeInputShape{ - MapArg: map[string]*string{ - "key1": aws.String("val1"), - "key2": aws.String("val2"), + input := &InputService5TestShapeInputService5TestCaseOperation1Input{ + ListArg: []*string{ + aws.String("a"), + aws.String("b"), + aws.String("c"), }, + ScalarArg: aws.String("foo"), } req, _ := svc.InputService5TestCaseOperation1Request(input) r := req.HTTPRequest @@ -1227,7 +1043,7 @@ func TestInputService5ProtocolTestSerializeMapTypeCase1(t *testing.T) { // assert body assert.NotNil(t, r.Body) body, _ := ioutil.ReadAll(r.Body) - assert.Equal(t, util.Trim(`Action=OperationName&MapArg.entry.1.key=key1&MapArg.entry.1.value=val1&MapArg.entry.2.key=key2&MapArg.entry.2.value=val2&Version=2014-01-01`), util.Trim(string(body))) + assert.Equal(t, util.Trim(`Action=OperationName&ListArgLocation.1=a&ListArgLocation.2=b&ListArgLocation.3=c&ScalarArg=foo&Version=2014-01-01`), util.Trim(string(body))) // assert URL assert.Equal(t, "https://test/", r.URL.String()) @@ -1236,37 +1052,11 @@ func TestInputService5ProtocolTestSerializeMapTypeCase1(t *testing.T) { } -func TestInputService5ProtocolTestSerializeMapTypeCase2(t *testing.T) { - svc := NewInputService5ProtocolTest(nil) - svc.Endpoint = "https://test" - - input := &InputService5TestShapeInputShape{ - MapArg: map[string]*string{}, - } - req, _ := svc.InputService5TestCaseOperation2Request(input) - r := req.HTTPRequest - - // build request - query.Build(req) - assert.NoError(t, req.Error) - - // assert body - assert.NotNil(t, r.Body) - body, _ := ioutil.ReadAll(r.Body) - assert.Equal(t, util.Trim(`Action=OperationName&MapArg=&Version=2014-01-01`), util.Trim(string(body))) - - // assert URL - assert.Equal(t, "https://test/", r.URL.String()) - - // assert headers - -} - -func TestInputService6ProtocolTestSerializeMapTypeWithLocationNameCase1(t *testing.T) { +func TestInputService6ProtocolTestSerializeMapTypeCase1(t *testing.T) { svc := NewInputService6ProtocolTest(nil) svc.Endpoint = "https://test" - input := &InputService6TestShapeInputShape{ + input := &InputService6TestShapeInputService6TestCaseOperation1Input{ MapArg: map[string]*string{ "key1": aws.String("val1"), "key2": aws.String("val2"), @@ -1282,7 +1072,7 @@ func TestInputService6ProtocolTestSerializeMapTypeWithLocationNameCase1(t *testi // assert body assert.NotNil(t, r.Body) body, _ := ioutil.ReadAll(r.Body) - assert.Equal(t, util.Trim(`Action=OperationName&MapArg.entry.1.TheKey=key1&MapArg.entry.1.TheValue=val1&MapArg.entry.2.TheKey=key2&MapArg.entry.2.TheValue=val2&Version=2014-01-01`), util.Trim(string(body))) + assert.Equal(t, util.Trim(`Action=OperationName&MapArg.entry.1.key=key1&MapArg.entry.1.value=val1&MapArg.entry.2.key=key2&MapArg.entry.2.value=val2&Version=2014-01-01`), util.Trim(string(body))) // assert URL assert.Equal(t, "https://test/", r.URL.String()) @@ -1295,7 +1085,7 @@ func TestInputService7ProtocolTestBase64EncodedBlobsCase1(t *testing.T) { svc := NewInputService7ProtocolTest(nil) svc.Endpoint = "https://test" - input := &InputService7TestShapeInputShape{ + input := &InputService7TestShapeInputService7TestCaseOperation1Input{ BlobArg: []byte("foo"), } req, _ := svc.InputService7TestCaseOperation1Request(input) @@ -1321,7 +1111,7 @@ func TestInputService8ProtocolTestTimestampValuesCase1(t *testing.T) { svc := NewInputService8ProtocolTest(nil) svc.Endpoint = "https://test" - input := &InputService8TestShapeInputShape{ + input := &InputService8TestShapeInputService8TestCaseOperation1Input{ TimeArg: aws.Time(time.Unix(1422172800, 0)), } req, _ := svc.InputService8TestCaseOperation1Request(input) @@ -1442,10 +1232,10 @@ func TestInputService9ProtocolTestRecursiveShapesCase4(t *testing.T) { input := &InputService9TestShapeInputShape{ RecursiveStruct: &InputService9TestShapeRecursiveStructType{ RecursiveList: []*InputService9TestShapeRecursiveStructType{ - &InputService9TestShapeRecursiveStructType{ + { NoRecurse: aws.String("foo"), }, - &InputService9TestShapeRecursiveStructType{ + { NoRecurse: aws.String("bar"), }, }, @@ -1477,10 +1267,10 @@ func TestInputService9ProtocolTestRecursiveShapesCase5(t *testing.T) { input := &InputService9TestShapeInputShape{ RecursiveStruct: &InputService9TestShapeRecursiveStructType{ RecursiveList: []*InputService9TestShapeRecursiveStructType{ - &InputService9TestShapeRecursiveStructType{ + { NoRecurse: aws.String("foo"), }, - &InputService9TestShapeRecursiveStructType{ + { RecursiveStruct: &InputService9TestShapeRecursiveStructType{ NoRecurse: aws.String("bar"), }, @@ -1514,10 +1304,10 @@ func TestInputService9ProtocolTestRecursiveShapesCase6(t *testing.T) { input := &InputService9TestShapeInputShape{ RecursiveStruct: &InputService9TestShapeRecursiveStructType{ RecursiveMap: map[string]*InputService9TestShapeRecursiveStructType{ - "bar": &InputService9TestShapeRecursiveStructType{ + "bar": { NoRecurse: aws.String("bar"), }, - "foo": &InputService9TestShapeRecursiveStructType{ + "foo": { NoRecurse: aws.String("foo"), }, }, diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/query/unmarshal.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/query/unmarshal.go index 8acdd2274c31..a374f88b14f9 100644 --- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/query/unmarshal.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/query/unmarshal.go @@ -5,25 +5,25 @@ package query import ( "encoding/xml" - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/internal/apierr" + "github.com/aws/aws-sdk-go/aws/awserr" + "github.com/aws/aws-sdk-go/aws/request" "github.com/aws/aws-sdk-go/internal/protocol/xml/xmlutil" ) // Unmarshal unmarshals a response for an AWS Query service. -func Unmarshal(r *aws.Request) { +func Unmarshal(r *request.Request) { defer r.HTTPResponse.Body.Close() if r.DataFilled() { decoder := xml.NewDecoder(r.HTTPResponse.Body) err := xmlutil.UnmarshalXML(r.Data, decoder, r.Operation.Name+"Result") if err != nil { - r.Error = apierr.New("Unmarshal", "failed decoding Query response", err) + r.Error = awserr.New("SerializationError", "failed decoding Query response", err) return } } } // UnmarshalMeta unmarshals header response values for an AWS Query service. -func UnmarshalMeta(r *aws.Request) { +func UnmarshalMeta(r *request.Request) { // TODO implement unmarshaling of request IDs } diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/query/unmarshal_error.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/query/unmarshal_error.go index deb529524aa2..08609d920881 100644 --- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/query/unmarshal_error.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/query/unmarshal_error.go @@ -4,8 +4,8 @@ import ( "encoding/xml" "io" - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/internal/apierr" + "github.com/aws/aws-sdk-go/aws/awserr" + "github.com/aws/aws-sdk-go/aws/request" ) type xmlErrorResponse struct { @@ -16,16 +16,16 @@ type xmlErrorResponse struct { } // UnmarshalError unmarshals an error response for an AWS Query service. -func UnmarshalError(r *aws.Request) { +func UnmarshalError(r *request.Request) { defer r.HTTPResponse.Body.Close() resp := &xmlErrorResponse{} err := xml.NewDecoder(r.HTTPResponse.Body).Decode(resp) if err != nil && err != io.EOF { - r.Error = apierr.New("Unmarshal", "failed to decode query XML error response", err) + r.Error = awserr.New("SerializationError", "failed to decode query XML error response", err) } else { - r.Error = apierr.NewRequestError( - apierr.New(resp.Code, resp.Message, nil), + r.Error = awserr.NewRequestFailure( + awserr.New(resp.Code, resp.Message, nil), r.HTTPResponse.StatusCode, resp.RequestID, ) diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/query/unmarshal_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/query/unmarshal_test.go index a17f56ccd58c..a0dcfc43adbf 100644 --- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/query/unmarshal_test.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/query/unmarshal_test.go @@ -1,10 +1,6 @@ package query_test import ( - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/internal/protocol/query" - "github.com/aws/aws-sdk-go/internal/signer/v4" - "bytes" "encoding/json" "encoding/xml" @@ -15,7 +11,14 @@ import ( "testing" "time" + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/defaults" + "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/aws/service" + "github.com/aws/aws-sdk-go/aws/service/serviceinfo" + "github.com/aws/aws-sdk-go/internal/protocol/query" "github.com/aws/aws-sdk-go/internal/protocol/xml/xmlutil" + "github.com/aws/aws-sdk-go/internal/signer/v4" "github.com/aws/aws-sdk-go/internal/util" "github.com/stretchr/testify/assert" ) @@ -31,17 +34,18 @@ var _ = util.Trim("") var _ = url.Values{} var _ = io.EOF -// OutputService1ProtocolTest is a client for OutputService1ProtocolTest. type OutputService1ProtocolTest struct { - *aws.Service + *service.Service } // New returns a new OutputService1ProtocolTest client. func NewOutputService1ProtocolTest(config *aws.Config) *OutputService1ProtocolTest { - service := &aws.Service{ - Config: aws.DefaultConfig.Merge(config), - ServiceName: "outputservice1protocoltest", - APIVersion: "", + service := &service.Service{ + ServiceInfo: serviceinfo.ServiceInfo{ + Config: defaults.DefaultConfig.Merge(config), + ServiceName: "outputservice1protocoltest", + APIVersion: "", + }, } service.Initialize() @@ -57,39 +61,36 @@ func NewOutputService1ProtocolTest(config *aws.Config) *OutputService1ProtocolTe // newRequest creates a new request for a OutputService1ProtocolTest operation and runs any // custom request initialization. -func (c *OutputService1ProtocolTest) newRequest(op *aws.Operation, params, data interface{}) *aws.Request { - req := aws.NewRequest(c.Service, op, params, data) +func (c *OutputService1ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { + req := c.NewRequest(op, params, data) return req } -// OutputService1TestCaseOperation1Request generates a request for the OutputService1TestCaseOperation1 operation. -func (c *OutputService1ProtocolTest) OutputService1TestCaseOperation1Request(input *OutputService1TestShapeOutputService1TestCaseOperation1Input) (req *aws.Request, output *OutputService1TestShapeOutputShape) { +const opOutputService1TestCaseOperation1 = "OperationName" - if opOutputService1TestCaseOperation1 == nil { - opOutputService1TestCaseOperation1 = &aws.Operation{ - Name: "OperationName", - } +// OutputService1TestCaseOperation1Request generates a request for the OutputService1TestCaseOperation1 operation. +func (c *OutputService1ProtocolTest) OutputService1TestCaseOperation1Request(input *OutputService1TestShapeOutputService1TestCaseOperation1Input) (req *request.Request, output *OutputService1TestShapeOutputService1TestCaseOperation1Output) { + op := &request.Operation{ + Name: opOutputService1TestCaseOperation1, } if input == nil { input = &OutputService1TestShapeOutputService1TestCaseOperation1Input{} } - req = c.newRequest(opOutputService1TestCaseOperation1, input, output) - output = &OutputService1TestShapeOutputShape{} + req = c.newRequest(op, input, output) + output = &OutputService1TestShapeOutputService1TestCaseOperation1Output{} req.Data = output return } -func (c *OutputService1ProtocolTest) OutputService1TestCaseOperation1(input *OutputService1TestShapeOutputService1TestCaseOperation1Input) (*OutputService1TestShapeOutputShape, error) { +func (c *OutputService1ProtocolTest) OutputService1TestCaseOperation1(input *OutputService1TestShapeOutputService1TestCaseOperation1Input) (*OutputService1TestShapeOutputService1TestCaseOperation1Output, error) { req, out := c.OutputService1TestCaseOperation1Request(input) err := req.Send() return out, err } -var opOutputService1TestCaseOperation1 *aws.Operation - type OutputService1TestShapeOutputService1TestCaseOperation1Input struct { metadataOutputService1TestShapeOutputService1TestCaseOperation1Input `json:"-" xml:"-"` } @@ -98,7 +99,7 @@ type metadataOutputService1TestShapeOutputService1TestCaseOperation1Input struct SDKShapeTraits bool `type:"structure"` } -type OutputService1TestShapeOutputShape struct { +type OutputService1TestShapeOutputService1TestCaseOperation1Output struct { Char *string `type:"character"` Double *float64 `type:"double"` @@ -117,24 +118,25 @@ type OutputService1TestShapeOutputShape struct { TrueBool *bool `type:"boolean"` - metadataOutputService1TestShapeOutputShape `json:"-" xml:"-"` + metadataOutputService1TestShapeOutputService1TestCaseOperation1Output `json:"-" xml:"-"` } -type metadataOutputService1TestShapeOutputShape struct { +type metadataOutputService1TestShapeOutputService1TestCaseOperation1Output struct { SDKShapeTraits bool `type:"structure"` } -// OutputService2ProtocolTest is a client for OutputService2ProtocolTest. type OutputService2ProtocolTest struct { - *aws.Service + *service.Service } // New returns a new OutputService2ProtocolTest client. func NewOutputService2ProtocolTest(config *aws.Config) *OutputService2ProtocolTest { - service := &aws.Service{ - Config: aws.DefaultConfig.Merge(config), - ServiceName: "outputservice2protocoltest", - APIVersion: "", + service := &service.Service{ + ServiceInfo: serviceinfo.ServiceInfo{ + Config: defaults.DefaultConfig.Merge(config), + ServiceName: "outputservice2protocoltest", + APIVersion: "", + }, } service.Initialize() @@ -150,39 +152,36 @@ func NewOutputService2ProtocolTest(config *aws.Config) *OutputService2ProtocolTe // newRequest creates a new request for a OutputService2ProtocolTest operation and runs any // custom request initialization. -func (c *OutputService2ProtocolTest) newRequest(op *aws.Operation, params, data interface{}) *aws.Request { - req := aws.NewRequest(c.Service, op, params, data) +func (c *OutputService2ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { + req := c.NewRequest(op, params, data) return req } -// OutputService2TestCaseOperation1Request generates a request for the OutputService2TestCaseOperation1 operation. -func (c *OutputService2ProtocolTest) OutputService2TestCaseOperation1Request(input *OutputService2TestShapeOutputService2TestCaseOperation1Input) (req *aws.Request, output *OutputService2TestShapeOutputShape) { +const opOutputService2TestCaseOperation1 = "OperationName" - if opOutputService2TestCaseOperation1 == nil { - opOutputService2TestCaseOperation1 = &aws.Operation{ - Name: "OperationName", - } +// OutputService2TestCaseOperation1Request generates a request for the OutputService2TestCaseOperation1 operation. +func (c *OutputService2ProtocolTest) OutputService2TestCaseOperation1Request(input *OutputService2TestShapeOutputService2TestCaseOperation1Input) (req *request.Request, output *OutputService2TestShapeOutputService2TestCaseOperation1Output) { + op := &request.Operation{ + Name: opOutputService2TestCaseOperation1, } if input == nil { input = &OutputService2TestShapeOutputService2TestCaseOperation1Input{} } - req = c.newRequest(opOutputService2TestCaseOperation1, input, output) - output = &OutputService2TestShapeOutputShape{} + req = c.newRequest(op, input, output) + output = &OutputService2TestShapeOutputService2TestCaseOperation1Output{} req.Data = output return } -func (c *OutputService2ProtocolTest) OutputService2TestCaseOperation1(input *OutputService2TestShapeOutputService2TestCaseOperation1Input) (*OutputService2TestShapeOutputShape, error) { +func (c *OutputService2ProtocolTest) OutputService2TestCaseOperation1(input *OutputService2TestShapeOutputService2TestCaseOperation1Input) (*OutputService2TestShapeOutputService2TestCaseOperation1Output, error) { req, out := c.OutputService2TestCaseOperation1Request(input) err := req.Send() return out, err } -var opOutputService2TestCaseOperation1 *aws.Operation - type OutputService2TestShapeOutputService2TestCaseOperation1Input struct { metadataOutputService2TestShapeOutputService2TestCaseOperation1Input `json:"-" xml:"-"` } @@ -191,29 +190,30 @@ type metadataOutputService2TestShapeOutputService2TestCaseOperation1Input struct SDKShapeTraits bool `type:"structure"` } -type OutputService2TestShapeOutputShape struct { +type OutputService2TestShapeOutputService2TestCaseOperation1Output struct { Num *int64 `type:"integer"` Str *string `type:"string"` - metadataOutputService2TestShapeOutputShape `json:"-" xml:"-"` + metadataOutputService2TestShapeOutputService2TestCaseOperation1Output `json:"-" xml:"-"` } -type metadataOutputService2TestShapeOutputShape struct { +type metadataOutputService2TestShapeOutputService2TestCaseOperation1Output struct { SDKShapeTraits bool `type:"structure"` } -// OutputService3ProtocolTest is a client for OutputService3ProtocolTest. type OutputService3ProtocolTest struct { - *aws.Service + *service.Service } // New returns a new OutputService3ProtocolTest client. func NewOutputService3ProtocolTest(config *aws.Config) *OutputService3ProtocolTest { - service := &aws.Service{ - Config: aws.DefaultConfig.Merge(config), - ServiceName: "outputservice3protocoltest", - APIVersion: "", + service := &service.Service{ + ServiceInfo: serviceinfo.ServiceInfo{ + Config: defaults.DefaultConfig.Merge(config), + ServiceName: "outputservice3protocoltest", + APIVersion: "", + }, } service.Initialize() @@ -229,39 +229,36 @@ func NewOutputService3ProtocolTest(config *aws.Config) *OutputService3ProtocolTe // newRequest creates a new request for a OutputService3ProtocolTest operation and runs any // custom request initialization. -func (c *OutputService3ProtocolTest) newRequest(op *aws.Operation, params, data interface{}) *aws.Request { - req := aws.NewRequest(c.Service, op, params, data) +func (c *OutputService3ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { + req := c.NewRequest(op, params, data) return req } -// OutputService3TestCaseOperation1Request generates a request for the OutputService3TestCaseOperation1 operation. -func (c *OutputService3ProtocolTest) OutputService3TestCaseOperation1Request(input *OutputService3TestShapeOutputService3TestCaseOperation1Input) (req *aws.Request, output *OutputService3TestShapeOutputShape) { +const opOutputService3TestCaseOperation1 = "OperationName" - if opOutputService3TestCaseOperation1 == nil { - opOutputService3TestCaseOperation1 = &aws.Operation{ - Name: "OperationName", - } +// OutputService3TestCaseOperation1Request generates a request for the OutputService3TestCaseOperation1 operation. +func (c *OutputService3ProtocolTest) OutputService3TestCaseOperation1Request(input *OutputService3TestShapeOutputService3TestCaseOperation1Input) (req *request.Request, output *OutputService3TestShapeOutputService3TestCaseOperation1Output) { + op := &request.Operation{ + Name: opOutputService3TestCaseOperation1, } if input == nil { input = &OutputService3TestShapeOutputService3TestCaseOperation1Input{} } - req = c.newRequest(opOutputService3TestCaseOperation1, input, output) - output = &OutputService3TestShapeOutputShape{} + req = c.newRequest(op, input, output) + output = &OutputService3TestShapeOutputService3TestCaseOperation1Output{} req.Data = output return } -func (c *OutputService3ProtocolTest) OutputService3TestCaseOperation1(input *OutputService3TestShapeOutputService3TestCaseOperation1Input) (*OutputService3TestShapeOutputShape, error) { +func (c *OutputService3ProtocolTest) OutputService3TestCaseOperation1(input *OutputService3TestShapeOutputService3TestCaseOperation1Input) (*OutputService3TestShapeOutputService3TestCaseOperation1Output, error) { req, out := c.OutputService3TestCaseOperation1Request(input) err := req.Send() return out, err } -var opOutputService3TestCaseOperation1 *aws.Operation - type OutputService3TestShapeOutputService3TestCaseOperation1Input struct { metadataOutputService3TestShapeOutputService3TestCaseOperation1Input `json:"-" xml:"-"` } @@ -270,27 +267,28 @@ type metadataOutputService3TestShapeOutputService3TestCaseOperation1Input struct SDKShapeTraits bool `type:"structure"` } -type OutputService3TestShapeOutputShape struct { +type OutputService3TestShapeOutputService3TestCaseOperation1Output struct { Blob []byte `type:"blob"` - metadataOutputService3TestShapeOutputShape `json:"-" xml:"-"` + metadataOutputService3TestShapeOutputService3TestCaseOperation1Output `json:"-" xml:"-"` } -type metadataOutputService3TestShapeOutputShape struct { +type metadataOutputService3TestShapeOutputService3TestCaseOperation1Output struct { SDKShapeTraits bool `type:"structure"` } -// OutputService4ProtocolTest is a client for OutputService4ProtocolTest. type OutputService4ProtocolTest struct { - *aws.Service + *service.Service } // New returns a new OutputService4ProtocolTest client. func NewOutputService4ProtocolTest(config *aws.Config) *OutputService4ProtocolTest { - service := &aws.Service{ - Config: aws.DefaultConfig.Merge(config), - ServiceName: "outputservice4protocoltest", - APIVersion: "", + service := &service.Service{ + ServiceInfo: serviceinfo.ServiceInfo{ + Config: defaults.DefaultConfig.Merge(config), + ServiceName: "outputservice4protocoltest", + APIVersion: "", + }, } service.Initialize() @@ -306,39 +304,36 @@ func NewOutputService4ProtocolTest(config *aws.Config) *OutputService4ProtocolTe // newRequest creates a new request for a OutputService4ProtocolTest operation and runs any // custom request initialization. -func (c *OutputService4ProtocolTest) newRequest(op *aws.Operation, params, data interface{}) *aws.Request { - req := aws.NewRequest(c.Service, op, params, data) +func (c *OutputService4ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { + req := c.NewRequest(op, params, data) return req } -// OutputService4TestCaseOperation1Request generates a request for the OutputService4TestCaseOperation1 operation. -func (c *OutputService4ProtocolTest) OutputService4TestCaseOperation1Request(input *OutputService4TestShapeOutputService4TestCaseOperation1Input) (req *aws.Request, output *OutputService4TestShapeOutputShape) { +const opOutputService4TestCaseOperation1 = "OperationName" - if opOutputService4TestCaseOperation1 == nil { - opOutputService4TestCaseOperation1 = &aws.Operation{ - Name: "OperationName", - } +// OutputService4TestCaseOperation1Request generates a request for the OutputService4TestCaseOperation1 operation. +func (c *OutputService4ProtocolTest) OutputService4TestCaseOperation1Request(input *OutputService4TestShapeOutputService4TestCaseOperation1Input) (req *request.Request, output *OutputService4TestShapeOutputService4TestCaseOperation1Output) { + op := &request.Operation{ + Name: opOutputService4TestCaseOperation1, } if input == nil { input = &OutputService4TestShapeOutputService4TestCaseOperation1Input{} } - req = c.newRequest(opOutputService4TestCaseOperation1, input, output) - output = &OutputService4TestShapeOutputShape{} + req = c.newRequest(op, input, output) + output = &OutputService4TestShapeOutputService4TestCaseOperation1Output{} req.Data = output return } -func (c *OutputService4ProtocolTest) OutputService4TestCaseOperation1(input *OutputService4TestShapeOutputService4TestCaseOperation1Input) (*OutputService4TestShapeOutputShape, error) { +func (c *OutputService4ProtocolTest) OutputService4TestCaseOperation1(input *OutputService4TestShapeOutputService4TestCaseOperation1Input) (*OutputService4TestShapeOutputService4TestCaseOperation1Output, error) { req, out := c.OutputService4TestCaseOperation1Request(input) err := req.Send() return out, err } -var opOutputService4TestCaseOperation1 *aws.Operation - type OutputService4TestShapeOutputService4TestCaseOperation1Input struct { metadataOutputService4TestShapeOutputService4TestCaseOperation1Input `json:"-" xml:"-"` } @@ -347,27 +342,28 @@ type metadataOutputService4TestShapeOutputService4TestCaseOperation1Input struct SDKShapeTraits bool `type:"structure"` } -type OutputService4TestShapeOutputShape struct { +type OutputService4TestShapeOutputService4TestCaseOperation1Output struct { ListMember []*string `type:"list"` - metadataOutputService4TestShapeOutputShape `json:"-" xml:"-"` + metadataOutputService4TestShapeOutputService4TestCaseOperation1Output `json:"-" xml:"-"` } -type metadataOutputService4TestShapeOutputShape struct { +type metadataOutputService4TestShapeOutputService4TestCaseOperation1Output struct { SDKShapeTraits bool `type:"structure"` } -// OutputService5ProtocolTest is a client for OutputService5ProtocolTest. type OutputService5ProtocolTest struct { - *aws.Service + *service.Service } // New returns a new OutputService5ProtocolTest client. func NewOutputService5ProtocolTest(config *aws.Config) *OutputService5ProtocolTest { - service := &aws.Service{ - Config: aws.DefaultConfig.Merge(config), - ServiceName: "outputservice5protocoltest", - APIVersion: "", + service := &service.Service{ + ServiceInfo: serviceinfo.ServiceInfo{ + Config: defaults.DefaultConfig.Merge(config), + ServiceName: "outputservice5protocoltest", + APIVersion: "", + }, } service.Initialize() @@ -383,39 +379,36 @@ func NewOutputService5ProtocolTest(config *aws.Config) *OutputService5ProtocolTe // newRequest creates a new request for a OutputService5ProtocolTest operation and runs any // custom request initialization. -func (c *OutputService5ProtocolTest) newRequest(op *aws.Operation, params, data interface{}) *aws.Request { - req := aws.NewRequest(c.Service, op, params, data) +func (c *OutputService5ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { + req := c.NewRequest(op, params, data) return req } -// OutputService5TestCaseOperation1Request generates a request for the OutputService5TestCaseOperation1 operation. -func (c *OutputService5ProtocolTest) OutputService5TestCaseOperation1Request(input *OutputService5TestShapeOutputService5TestCaseOperation1Input) (req *aws.Request, output *OutputService5TestShapeOutputShape) { +const opOutputService5TestCaseOperation1 = "OperationName" - if opOutputService5TestCaseOperation1 == nil { - opOutputService5TestCaseOperation1 = &aws.Operation{ - Name: "OperationName", - } +// OutputService5TestCaseOperation1Request generates a request for the OutputService5TestCaseOperation1 operation. +func (c *OutputService5ProtocolTest) OutputService5TestCaseOperation1Request(input *OutputService5TestShapeOutputService5TestCaseOperation1Input) (req *request.Request, output *OutputService5TestShapeOutputService5TestCaseOperation1Output) { + op := &request.Operation{ + Name: opOutputService5TestCaseOperation1, } if input == nil { input = &OutputService5TestShapeOutputService5TestCaseOperation1Input{} } - req = c.newRequest(opOutputService5TestCaseOperation1, input, output) - output = &OutputService5TestShapeOutputShape{} + req = c.newRequest(op, input, output) + output = &OutputService5TestShapeOutputService5TestCaseOperation1Output{} req.Data = output return } -func (c *OutputService5ProtocolTest) OutputService5TestCaseOperation1(input *OutputService5TestShapeOutputService5TestCaseOperation1Input) (*OutputService5TestShapeOutputShape, error) { +func (c *OutputService5ProtocolTest) OutputService5TestCaseOperation1(input *OutputService5TestShapeOutputService5TestCaseOperation1Input) (*OutputService5TestShapeOutputService5TestCaseOperation1Output, error) { req, out := c.OutputService5TestCaseOperation1Request(input) err := req.Send() return out, err } -var opOutputService5TestCaseOperation1 *aws.Operation - type OutputService5TestShapeOutputService5TestCaseOperation1Input struct { metadataOutputService5TestShapeOutputService5TestCaseOperation1Input `json:"-" xml:"-"` } @@ -424,27 +417,28 @@ type metadataOutputService5TestShapeOutputService5TestCaseOperation1Input struct SDKShapeTraits bool `type:"structure"` } -type OutputService5TestShapeOutputShape struct { +type OutputService5TestShapeOutputService5TestCaseOperation1Output struct { ListMember []*string `locationNameList:"item" type:"list"` - metadataOutputService5TestShapeOutputShape `json:"-" xml:"-"` + metadataOutputService5TestShapeOutputService5TestCaseOperation1Output `json:"-" xml:"-"` } -type metadataOutputService5TestShapeOutputShape struct { +type metadataOutputService5TestShapeOutputService5TestCaseOperation1Output struct { SDKShapeTraits bool `type:"structure"` } -// OutputService6ProtocolTest is a client for OutputService6ProtocolTest. type OutputService6ProtocolTest struct { - *aws.Service + *service.Service } // New returns a new OutputService6ProtocolTest client. func NewOutputService6ProtocolTest(config *aws.Config) *OutputService6ProtocolTest { - service := &aws.Service{ - Config: aws.DefaultConfig.Merge(config), - ServiceName: "outputservice6protocoltest", - APIVersion: "", + service := &service.Service{ + ServiceInfo: serviceinfo.ServiceInfo{ + Config: defaults.DefaultConfig.Merge(config), + ServiceName: "outputservice6protocoltest", + APIVersion: "", + }, } service.Initialize() @@ -460,39 +454,36 @@ func NewOutputService6ProtocolTest(config *aws.Config) *OutputService6ProtocolTe // newRequest creates a new request for a OutputService6ProtocolTest operation and runs any // custom request initialization. -func (c *OutputService6ProtocolTest) newRequest(op *aws.Operation, params, data interface{}) *aws.Request { - req := aws.NewRequest(c.Service, op, params, data) +func (c *OutputService6ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { + req := c.NewRequest(op, params, data) return req } -// OutputService6TestCaseOperation1Request generates a request for the OutputService6TestCaseOperation1 operation. -func (c *OutputService6ProtocolTest) OutputService6TestCaseOperation1Request(input *OutputService6TestShapeOutputService6TestCaseOperation1Input) (req *aws.Request, output *OutputService6TestShapeOutputShape) { +const opOutputService6TestCaseOperation1 = "OperationName" - if opOutputService6TestCaseOperation1 == nil { - opOutputService6TestCaseOperation1 = &aws.Operation{ - Name: "OperationName", - } +// OutputService6TestCaseOperation1Request generates a request for the OutputService6TestCaseOperation1 operation. +func (c *OutputService6ProtocolTest) OutputService6TestCaseOperation1Request(input *OutputService6TestShapeOutputService6TestCaseOperation1Input) (req *request.Request, output *OutputService6TestShapeOutputService6TestCaseOperation1Output) { + op := &request.Operation{ + Name: opOutputService6TestCaseOperation1, } if input == nil { input = &OutputService6TestShapeOutputService6TestCaseOperation1Input{} } - req = c.newRequest(opOutputService6TestCaseOperation1, input, output) - output = &OutputService6TestShapeOutputShape{} + req = c.newRequest(op, input, output) + output = &OutputService6TestShapeOutputService6TestCaseOperation1Output{} req.Data = output return } -func (c *OutputService6ProtocolTest) OutputService6TestCaseOperation1(input *OutputService6TestShapeOutputService6TestCaseOperation1Input) (*OutputService6TestShapeOutputShape, error) { +func (c *OutputService6ProtocolTest) OutputService6TestCaseOperation1(input *OutputService6TestShapeOutputService6TestCaseOperation1Input) (*OutputService6TestShapeOutputService6TestCaseOperation1Output, error) { req, out := c.OutputService6TestCaseOperation1Request(input) err := req.Send() return out, err } -var opOutputService6TestCaseOperation1 *aws.Operation - type OutputService6TestShapeOutputService6TestCaseOperation1Input struct { metadataOutputService6TestShapeOutputService6TestCaseOperation1Input `json:"-" xml:"-"` } @@ -501,27 +492,28 @@ type metadataOutputService6TestShapeOutputService6TestCaseOperation1Input struct SDKShapeTraits bool `type:"structure"` } -type OutputService6TestShapeOutputShape struct { +type OutputService6TestShapeOutputService6TestCaseOperation1Output struct { ListMember []*string `type:"list" flattened:"true"` - metadataOutputService6TestShapeOutputShape `json:"-" xml:"-"` + metadataOutputService6TestShapeOutputService6TestCaseOperation1Output `json:"-" xml:"-"` } -type metadataOutputService6TestShapeOutputShape struct { +type metadataOutputService6TestShapeOutputService6TestCaseOperation1Output struct { SDKShapeTraits bool `type:"structure"` } -// OutputService7ProtocolTest is a client for OutputService7ProtocolTest. type OutputService7ProtocolTest struct { - *aws.Service + *service.Service } // New returns a new OutputService7ProtocolTest client. func NewOutputService7ProtocolTest(config *aws.Config) *OutputService7ProtocolTest { - service := &aws.Service{ - Config: aws.DefaultConfig.Merge(config), - ServiceName: "outputservice7protocoltest", - APIVersion: "", + service := &service.Service{ + ServiceInfo: serviceinfo.ServiceInfo{ + Config: defaults.DefaultConfig.Merge(config), + ServiceName: "outputservice7protocoltest", + APIVersion: "", + }, } service.Initialize() @@ -537,39 +529,36 @@ func NewOutputService7ProtocolTest(config *aws.Config) *OutputService7ProtocolTe // newRequest creates a new request for a OutputService7ProtocolTest operation and runs any // custom request initialization. -func (c *OutputService7ProtocolTest) newRequest(op *aws.Operation, params, data interface{}) *aws.Request { - req := aws.NewRequest(c.Service, op, params, data) +func (c *OutputService7ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { + req := c.NewRequest(op, params, data) return req } -// OutputService7TestCaseOperation1Request generates a request for the OutputService7TestCaseOperation1 operation. -func (c *OutputService7ProtocolTest) OutputService7TestCaseOperation1Request(input *OutputService7TestShapeOutputService7TestCaseOperation1Input) (req *aws.Request, output *OutputService7TestShapeOutputShape) { +const opOutputService7TestCaseOperation1 = "OperationName" - if opOutputService7TestCaseOperation1 == nil { - opOutputService7TestCaseOperation1 = &aws.Operation{ - Name: "OperationName", - } +// OutputService7TestCaseOperation1Request generates a request for the OutputService7TestCaseOperation1 operation. +func (c *OutputService7ProtocolTest) OutputService7TestCaseOperation1Request(input *OutputService7TestShapeOutputService7TestCaseOperation1Input) (req *request.Request, output *OutputService7TestShapeOutputService7TestCaseOperation1Output) { + op := &request.Operation{ + Name: opOutputService7TestCaseOperation1, } if input == nil { input = &OutputService7TestShapeOutputService7TestCaseOperation1Input{} } - req = c.newRequest(opOutputService7TestCaseOperation1, input, output) - output = &OutputService7TestShapeOutputShape{} + req = c.newRequest(op, input, output) + output = &OutputService7TestShapeOutputService7TestCaseOperation1Output{} req.Data = output return } -func (c *OutputService7ProtocolTest) OutputService7TestCaseOperation1(input *OutputService7TestShapeOutputService7TestCaseOperation1Input) (*OutputService7TestShapeOutputShape, error) { +func (c *OutputService7ProtocolTest) OutputService7TestCaseOperation1(input *OutputService7TestShapeOutputService7TestCaseOperation1Input) (*OutputService7TestShapeOutputService7TestCaseOperation1Output, error) { req, out := c.OutputService7TestCaseOperation1Request(input) err := req.Send() return out, err } -var opOutputService7TestCaseOperation1 *aws.Operation - type OutputService7TestShapeOutputService7TestCaseOperation1Input struct { metadataOutputService7TestShapeOutputService7TestCaseOperation1Input `json:"-" xml:"-"` } @@ -578,27 +567,28 @@ type metadataOutputService7TestShapeOutputService7TestCaseOperation1Input struct SDKShapeTraits bool `type:"structure"` } -type OutputService7TestShapeOutputShape struct { +type OutputService7TestShapeOutputService7TestCaseOperation1Output struct { ListMember []*string `type:"list" flattened:"true"` - metadataOutputService7TestShapeOutputShape `json:"-" xml:"-"` + metadataOutputService7TestShapeOutputService7TestCaseOperation1Output `json:"-" xml:"-"` } -type metadataOutputService7TestShapeOutputShape struct { +type metadataOutputService7TestShapeOutputService7TestCaseOperation1Output struct { SDKShapeTraits bool `type:"structure"` } -// OutputService8ProtocolTest is a client for OutputService8ProtocolTest. type OutputService8ProtocolTest struct { - *aws.Service + *service.Service } // New returns a new OutputService8ProtocolTest client. func NewOutputService8ProtocolTest(config *aws.Config) *OutputService8ProtocolTest { - service := &aws.Service{ - Config: aws.DefaultConfig.Merge(config), - ServiceName: "outputservice8protocoltest", - APIVersion: "", + service := &service.Service{ + ServiceInfo: serviceinfo.ServiceInfo{ + Config: defaults.DefaultConfig.Merge(config), + ServiceName: "outputservice8protocoltest", + APIVersion: "", + }, } service.Initialize() @@ -614,39 +604,36 @@ func NewOutputService8ProtocolTest(config *aws.Config) *OutputService8ProtocolTe // newRequest creates a new request for a OutputService8ProtocolTest operation and runs any // custom request initialization. -func (c *OutputService8ProtocolTest) newRequest(op *aws.Operation, params, data interface{}) *aws.Request { - req := aws.NewRequest(c.Service, op, params, data) +func (c *OutputService8ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { + req := c.NewRequest(op, params, data) return req } -// OutputService8TestCaseOperation1Request generates a request for the OutputService8TestCaseOperation1 operation. -func (c *OutputService8ProtocolTest) OutputService8TestCaseOperation1Request(input *OutputService8TestShapeOutputService8TestCaseOperation1Input) (req *aws.Request, output *OutputService8TestShapeOutputShape) { +const opOutputService8TestCaseOperation1 = "OperationName" - if opOutputService8TestCaseOperation1 == nil { - opOutputService8TestCaseOperation1 = &aws.Operation{ - Name: "OperationName", - } +// OutputService8TestCaseOperation1Request generates a request for the OutputService8TestCaseOperation1 operation. +func (c *OutputService8ProtocolTest) OutputService8TestCaseOperation1Request(input *OutputService8TestShapeOutputService8TestCaseOperation1Input) (req *request.Request, output *OutputService8TestShapeOutputService8TestCaseOperation1Output) { + op := &request.Operation{ + Name: opOutputService8TestCaseOperation1, } if input == nil { input = &OutputService8TestShapeOutputService8TestCaseOperation1Input{} } - req = c.newRequest(opOutputService8TestCaseOperation1, input, output) - output = &OutputService8TestShapeOutputShape{} + req = c.newRequest(op, input, output) + output = &OutputService8TestShapeOutputService8TestCaseOperation1Output{} req.Data = output return } -func (c *OutputService8ProtocolTest) OutputService8TestCaseOperation1(input *OutputService8TestShapeOutputService8TestCaseOperation1Input) (*OutputService8TestShapeOutputShape, error) { +func (c *OutputService8ProtocolTest) OutputService8TestCaseOperation1(input *OutputService8TestShapeOutputService8TestCaseOperation1Input) (*OutputService8TestShapeOutputService8TestCaseOperation1Output, error) { req, out := c.OutputService8TestCaseOperation1Request(input) err := req.Send() return out, err } -var opOutputService8TestCaseOperation1 *aws.Operation - type OutputService8TestShapeOutputService8TestCaseOperation1Input struct { metadataOutputService8TestShapeOutputService8TestCaseOperation1Input `json:"-" xml:"-"` } @@ -655,13 +642,13 @@ type metadataOutputService8TestShapeOutputService8TestCaseOperation1Input struct SDKShapeTraits bool `type:"structure"` } -type OutputService8TestShapeOutputShape struct { +type OutputService8TestShapeOutputService8TestCaseOperation1Output struct { List []*OutputService8TestShapeStructureShape `type:"list"` - metadataOutputService8TestShapeOutputShape `json:"-" xml:"-"` + metadataOutputService8TestShapeOutputService8TestCaseOperation1Output `json:"-" xml:"-"` } -type metadataOutputService8TestShapeOutputShape struct { +type metadataOutputService8TestShapeOutputService8TestCaseOperation1Output struct { SDKShapeTraits bool `type:"structure"` } @@ -679,17 +666,18 @@ type metadataOutputService8TestShapeStructureShape struct { SDKShapeTraits bool `type:"structure"` } -// OutputService9ProtocolTest is a client for OutputService9ProtocolTest. type OutputService9ProtocolTest struct { - *aws.Service + *service.Service } // New returns a new OutputService9ProtocolTest client. func NewOutputService9ProtocolTest(config *aws.Config) *OutputService9ProtocolTest { - service := &aws.Service{ - Config: aws.DefaultConfig.Merge(config), - ServiceName: "outputservice9protocoltest", - APIVersion: "", + service := &service.Service{ + ServiceInfo: serviceinfo.ServiceInfo{ + Config: defaults.DefaultConfig.Merge(config), + ServiceName: "outputservice9protocoltest", + APIVersion: "", + }, } service.Initialize() @@ -705,39 +693,36 @@ func NewOutputService9ProtocolTest(config *aws.Config) *OutputService9ProtocolTe // newRequest creates a new request for a OutputService9ProtocolTest operation and runs any // custom request initialization. -func (c *OutputService9ProtocolTest) newRequest(op *aws.Operation, params, data interface{}) *aws.Request { - req := aws.NewRequest(c.Service, op, params, data) +func (c *OutputService9ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { + req := c.NewRequest(op, params, data) return req } -// OutputService9TestCaseOperation1Request generates a request for the OutputService9TestCaseOperation1 operation. -func (c *OutputService9ProtocolTest) OutputService9TestCaseOperation1Request(input *OutputService9TestShapeOutputService9TestCaseOperation1Input) (req *aws.Request, output *OutputService9TestShapeOutputShape) { +const opOutputService9TestCaseOperation1 = "OperationName" - if opOutputService9TestCaseOperation1 == nil { - opOutputService9TestCaseOperation1 = &aws.Operation{ - Name: "OperationName", - } +// OutputService9TestCaseOperation1Request generates a request for the OutputService9TestCaseOperation1 operation. +func (c *OutputService9ProtocolTest) OutputService9TestCaseOperation1Request(input *OutputService9TestShapeOutputService9TestCaseOperation1Input) (req *request.Request, output *OutputService9TestShapeOutputService9TestCaseOperation1Output) { + op := &request.Operation{ + Name: opOutputService9TestCaseOperation1, } if input == nil { input = &OutputService9TestShapeOutputService9TestCaseOperation1Input{} } - req = c.newRequest(opOutputService9TestCaseOperation1, input, output) - output = &OutputService9TestShapeOutputShape{} + req = c.newRequest(op, input, output) + output = &OutputService9TestShapeOutputService9TestCaseOperation1Output{} req.Data = output return } -func (c *OutputService9ProtocolTest) OutputService9TestCaseOperation1(input *OutputService9TestShapeOutputService9TestCaseOperation1Input) (*OutputService9TestShapeOutputShape, error) { +func (c *OutputService9ProtocolTest) OutputService9TestCaseOperation1(input *OutputService9TestShapeOutputService9TestCaseOperation1Input) (*OutputService9TestShapeOutputService9TestCaseOperation1Output, error) { req, out := c.OutputService9TestCaseOperation1Request(input) err := req.Send() return out, err } -var opOutputService9TestCaseOperation1 *aws.Operation - type OutputService9TestShapeOutputService9TestCaseOperation1Input struct { metadataOutputService9TestShapeOutputService9TestCaseOperation1Input `json:"-" xml:"-"` } @@ -746,13 +731,13 @@ type metadataOutputService9TestShapeOutputService9TestCaseOperation1Input struct SDKShapeTraits bool `type:"structure"` } -type OutputService9TestShapeOutputShape struct { +type OutputService9TestShapeOutputService9TestCaseOperation1Output struct { List []*OutputService9TestShapeStructureShape `type:"list" flattened:"true"` - metadataOutputService9TestShapeOutputShape `json:"-" xml:"-"` + metadataOutputService9TestShapeOutputService9TestCaseOperation1Output `json:"-" xml:"-"` } -type metadataOutputService9TestShapeOutputShape struct { +type metadataOutputService9TestShapeOutputService9TestCaseOperation1Output struct { SDKShapeTraits bool `type:"structure"` } @@ -770,17 +755,18 @@ type metadataOutputService9TestShapeStructureShape struct { SDKShapeTraits bool `type:"structure"` } -// OutputService10ProtocolTest is a client for OutputService10ProtocolTest. type OutputService10ProtocolTest struct { - *aws.Service + *service.Service } // New returns a new OutputService10ProtocolTest client. func NewOutputService10ProtocolTest(config *aws.Config) *OutputService10ProtocolTest { - service := &aws.Service{ - Config: aws.DefaultConfig.Merge(config), - ServiceName: "outputservice10protocoltest", - APIVersion: "", + service := &service.Service{ + ServiceInfo: serviceinfo.ServiceInfo{ + Config: defaults.DefaultConfig.Merge(config), + ServiceName: "outputservice10protocoltest", + APIVersion: "", + }, } service.Initialize() @@ -796,39 +782,36 @@ func NewOutputService10ProtocolTest(config *aws.Config) *OutputService10Protocol // newRequest creates a new request for a OutputService10ProtocolTest operation and runs any // custom request initialization. -func (c *OutputService10ProtocolTest) newRequest(op *aws.Operation, params, data interface{}) *aws.Request { - req := aws.NewRequest(c.Service, op, params, data) +func (c *OutputService10ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { + req := c.NewRequest(op, params, data) return req } -// OutputService10TestCaseOperation1Request generates a request for the OutputService10TestCaseOperation1 operation. -func (c *OutputService10ProtocolTest) OutputService10TestCaseOperation1Request(input *OutputService10TestShapeOutputService10TestCaseOperation1Input) (req *aws.Request, output *OutputService10TestShapeOutputShape) { +const opOutputService10TestCaseOperation1 = "OperationName" - if opOutputService10TestCaseOperation1 == nil { - opOutputService10TestCaseOperation1 = &aws.Operation{ - Name: "OperationName", - } +// OutputService10TestCaseOperation1Request generates a request for the OutputService10TestCaseOperation1 operation. +func (c *OutputService10ProtocolTest) OutputService10TestCaseOperation1Request(input *OutputService10TestShapeOutputService10TestCaseOperation1Input) (req *request.Request, output *OutputService10TestShapeOutputService10TestCaseOperation1Output) { + op := &request.Operation{ + Name: opOutputService10TestCaseOperation1, } if input == nil { input = &OutputService10TestShapeOutputService10TestCaseOperation1Input{} } - req = c.newRequest(opOutputService10TestCaseOperation1, input, output) - output = &OutputService10TestShapeOutputShape{} + req = c.newRequest(op, input, output) + output = &OutputService10TestShapeOutputService10TestCaseOperation1Output{} req.Data = output return } -func (c *OutputService10ProtocolTest) OutputService10TestCaseOperation1(input *OutputService10TestShapeOutputService10TestCaseOperation1Input) (*OutputService10TestShapeOutputShape, error) { +func (c *OutputService10ProtocolTest) OutputService10TestCaseOperation1(input *OutputService10TestShapeOutputService10TestCaseOperation1Input) (*OutputService10TestShapeOutputService10TestCaseOperation1Output, error) { req, out := c.OutputService10TestCaseOperation1Request(input) err := req.Send() return out, err } -var opOutputService10TestCaseOperation1 *aws.Operation - type OutputService10TestShapeOutputService10TestCaseOperation1Input struct { metadataOutputService10TestShapeOutputService10TestCaseOperation1Input `json:"-" xml:"-"` } @@ -837,27 +820,28 @@ type metadataOutputService10TestShapeOutputService10TestCaseOperation1Input stru SDKShapeTraits bool `type:"structure"` } -type OutputService10TestShapeOutputShape struct { +type OutputService10TestShapeOutputService10TestCaseOperation1Output struct { List []*string `locationNameList:"NamedList" type:"list" flattened:"true"` - metadataOutputService10TestShapeOutputShape `json:"-" xml:"-"` + metadataOutputService10TestShapeOutputService10TestCaseOperation1Output `json:"-" xml:"-"` } -type metadataOutputService10TestShapeOutputShape struct { +type metadataOutputService10TestShapeOutputService10TestCaseOperation1Output struct { SDKShapeTraits bool `type:"structure"` } -// OutputService11ProtocolTest is a client for OutputService11ProtocolTest. type OutputService11ProtocolTest struct { - *aws.Service + *service.Service } // New returns a new OutputService11ProtocolTest client. func NewOutputService11ProtocolTest(config *aws.Config) *OutputService11ProtocolTest { - service := &aws.Service{ - Config: aws.DefaultConfig.Merge(config), - ServiceName: "outputservice11protocoltest", - APIVersion: "", + service := &service.Service{ + ServiceInfo: serviceinfo.ServiceInfo{ + Config: defaults.DefaultConfig.Merge(config), + ServiceName: "outputservice11protocoltest", + APIVersion: "", + }, } service.Initialize() @@ -873,39 +857,36 @@ func NewOutputService11ProtocolTest(config *aws.Config) *OutputService11Protocol // newRequest creates a new request for a OutputService11ProtocolTest operation and runs any // custom request initialization. -func (c *OutputService11ProtocolTest) newRequest(op *aws.Operation, params, data interface{}) *aws.Request { - req := aws.NewRequest(c.Service, op, params, data) +func (c *OutputService11ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { + req := c.NewRequest(op, params, data) return req } -// OutputService11TestCaseOperation1Request generates a request for the OutputService11TestCaseOperation1 operation. -func (c *OutputService11ProtocolTest) OutputService11TestCaseOperation1Request(input *OutputService11TestShapeOutputService11TestCaseOperation1Input) (req *aws.Request, output *OutputService11TestShapeOutputShape) { +const opOutputService11TestCaseOperation1 = "OperationName" - if opOutputService11TestCaseOperation1 == nil { - opOutputService11TestCaseOperation1 = &aws.Operation{ - Name: "OperationName", - } +// OutputService11TestCaseOperation1Request generates a request for the OutputService11TestCaseOperation1 operation. +func (c *OutputService11ProtocolTest) OutputService11TestCaseOperation1Request(input *OutputService11TestShapeOutputService11TestCaseOperation1Input) (req *request.Request, output *OutputService11TestShapeOutputService11TestCaseOperation1Output) { + op := &request.Operation{ + Name: opOutputService11TestCaseOperation1, } if input == nil { input = &OutputService11TestShapeOutputService11TestCaseOperation1Input{} } - req = c.newRequest(opOutputService11TestCaseOperation1, input, output) - output = &OutputService11TestShapeOutputShape{} + req = c.newRequest(op, input, output) + output = &OutputService11TestShapeOutputService11TestCaseOperation1Output{} req.Data = output return } -func (c *OutputService11ProtocolTest) OutputService11TestCaseOperation1(input *OutputService11TestShapeOutputService11TestCaseOperation1Input) (*OutputService11TestShapeOutputShape, error) { +func (c *OutputService11ProtocolTest) OutputService11TestCaseOperation1(input *OutputService11TestShapeOutputService11TestCaseOperation1Input) (*OutputService11TestShapeOutputService11TestCaseOperation1Output, error) { req, out := c.OutputService11TestCaseOperation1Request(input) err := req.Send() return out, err } -var opOutputService11TestCaseOperation1 *aws.Operation - type OutputService11TestShapeOutputService11TestCaseOperation1Input struct { metadataOutputService11TestShapeOutputService11TestCaseOperation1Input `json:"-" xml:"-"` } @@ -914,13 +895,13 @@ type metadataOutputService11TestShapeOutputService11TestCaseOperation1Input stru SDKShapeTraits bool `type:"structure"` } -type OutputService11TestShapeOutputShape struct { +type OutputService11TestShapeOutputService11TestCaseOperation1Output struct { Map map[string]*OutputService11TestShapeStructType `type:"map"` - metadataOutputService11TestShapeOutputShape `json:"-" xml:"-"` + metadataOutputService11TestShapeOutputService11TestCaseOperation1Output `json:"-" xml:"-"` } -type metadataOutputService11TestShapeOutputShape struct { +type metadataOutputService11TestShapeOutputService11TestCaseOperation1Output struct { SDKShapeTraits bool `type:"structure"` } @@ -934,17 +915,18 @@ type metadataOutputService11TestShapeStructType struct { SDKShapeTraits bool `type:"structure"` } -// OutputService12ProtocolTest is a client for OutputService12ProtocolTest. type OutputService12ProtocolTest struct { - *aws.Service + *service.Service } // New returns a new OutputService12ProtocolTest client. func NewOutputService12ProtocolTest(config *aws.Config) *OutputService12ProtocolTest { - service := &aws.Service{ - Config: aws.DefaultConfig.Merge(config), - ServiceName: "outputservice12protocoltest", - APIVersion: "", + service := &service.Service{ + ServiceInfo: serviceinfo.ServiceInfo{ + Config: defaults.DefaultConfig.Merge(config), + ServiceName: "outputservice12protocoltest", + APIVersion: "", + }, } service.Initialize() @@ -960,39 +942,36 @@ func NewOutputService12ProtocolTest(config *aws.Config) *OutputService12Protocol // newRequest creates a new request for a OutputService12ProtocolTest operation and runs any // custom request initialization. -func (c *OutputService12ProtocolTest) newRequest(op *aws.Operation, params, data interface{}) *aws.Request { - req := aws.NewRequest(c.Service, op, params, data) +func (c *OutputService12ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { + req := c.NewRequest(op, params, data) return req } -// OutputService12TestCaseOperation1Request generates a request for the OutputService12TestCaseOperation1 operation. -func (c *OutputService12ProtocolTest) OutputService12TestCaseOperation1Request(input *OutputService12TestShapeOutputService12TestCaseOperation1Input) (req *aws.Request, output *OutputService12TestShapeOutputShape) { +const opOutputService12TestCaseOperation1 = "OperationName" - if opOutputService12TestCaseOperation1 == nil { - opOutputService12TestCaseOperation1 = &aws.Operation{ - Name: "OperationName", - } +// OutputService12TestCaseOperation1Request generates a request for the OutputService12TestCaseOperation1 operation. +func (c *OutputService12ProtocolTest) OutputService12TestCaseOperation1Request(input *OutputService12TestShapeOutputService12TestCaseOperation1Input) (req *request.Request, output *OutputService12TestShapeOutputService12TestCaseOperation1Output) { + op := &request.Operation{ + Name: opOutputService12TestCaseOperation1, } if input == nil { input = &OutputService12TestShapeOutputService12TestCaseOperation1Input{} } - req = c.newRequest(opOutputService12TestCaseOperation1, input, output) - output = &OutputService12TestShapeOutputShape{} + req = c.newRequest(op, input, output) + output = &OutputService12TestShapeOutputService12TestCaseOperation1Output{} req.Data = output return } -func (c *OutputService12ProtocolTest) OutputService12TestCaseOperation1(input *OutputService12TestShapeOutputService12TestCaseOperation1Input) (*OutputService12TestShapeOutputShape, error) { +func (c *OutputService12ProtocolTest) OutputService12TestCaseOperation1(input *OutputService12TestShapeOutputService12TestCaseOperation1Input) (*OutputService12TestShapeOutputService12TestCaseOperation1Output, error) { req, out := c.OutputService12TestCaseOperation1Request(input) err := req.Send() return out, err } -var opOutputService12TestCaseOperation1 *aws.Operation - type OutputService12TestShapeOutputService12TestCaseOperation1Input struct { metadataOutputService12TestShapeOutputService12TestCaseOperation1Input `json:"-" xml:"-"` } @@ -1001,27 +980,28 @@ type metadataOutputService12TestShapeOutputService12TestCaseOperation1Input stru SDKShapeTraits bool `type:"structure"` } -type OutputService12TestShapeOutputShape struct { +type OutputService12TestShapeOutputService12TestCaseOperation1Output struct { Map map[string]*string `type:"map" flattened:"true"` - metadataOutputService12TestShapeOutputShape `json:"-" xml:"-"` + metadataOutputService12TestShapeOutputService12TestCaseOperation1Output `json:"-" xml:"-"` } -type metadataOutputService12TestShapeOutputShape struct { +type metadataOutputService12TestShapeOutputService12TestCaseOperation1Output struct { SDKShapeTraits bool `type:"structure"` } -// OutputService13ProtocolTest is a client for OutputService13ProtocolTest. type OutputService13ProtocolTest struct { - *aws.Service + *service.Service } // New returns a new OutputService13ProtocolTest client. func NewOutputService13ProtocolTest(config *aws.Config) *OutputService13ProtocolTest { - service := &aws.Service{ - Config: aws.DefaultConfig.Merge(config), - ServiceName: "outputservice13protocoltest", - APIVersion: "", + service := &service.Service{ + ServiceInfo: serviceinfo.ServiceInfo{ + Config: defaults.DefaultConfig.Merge(config), + ServiceName: "outputservice13protocoltest", + APIVersion: "", + }, } service.Initialize() @@ -1037,39 +1017,36 @@ func NewOutputService13ProtocolTest(config *aws.Config) *OutputService13Protocol // newRequest creates a new request for a OutputService13ProtocolTest operation and runs any // custom request initialization. -func (c *OutputService13ProtocolTest) newRequest(op *aws.Operation, params, data interface{}) *aws.Request { - req := aws.NewRequest(c.Service, op, params, data) +func (c *OutputService13ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { + req := c.NewRequest(op, params, data) return req } -// OutputService13TestCaseOperation1Request generates a request for the OutputService13TestCaseOperation1 operation. -func (c *OutputService13ProtocolTest) OutputService13TestCaseOperation1Request(input *OutputService13TestShapeOutputService13TestCaseOperation1Input) (req *aws.Request, output *OutputService13TestShapeOutputShape) { +const opOutputService13TestCaseOperation1 = "OperationName" - if opOutputService13TestCaseOperation1 == nil { - opOutputService13TestCaseOperation1 = &aws.Operation{ - Name: "OperationName", - } +// OutputService13TestCaseOperation1Request generates a request for the OutputService13TestCaseOperation1 operation. +func (c *OutputService13ProtocolTest) OutputService13TestCaseOperation1Request(input *OutputService13TestShapeOutputService13TestCaseOperation1Input) (req *request.Request, output *OutputService13TestShapeOutputService13TestCaseOperation1Output) { + op := &request.Operation{ + Name: opOutputService13TestCaseOperation1, } if input == nil { input = &OutputService13TestShapeOutputService13TestCaseOperation1Input{} } - req = c.newRequest(opOutputService13TestCaseOperation1, input, output) - output = &OutputService13TestShapeOutputShape{} + req = c.newRequest(op, input, output) + output = &OutputService13TestShapeOutputService13TestCaseOperation1Output{} req.Data = output return } -func (c *OutputService13ProtocolTest) OutputService13TestCaseOperation1(input *OutputService13TestShapeOutputService13TestCaseOperation1Input) (*OutputService13TestShapeOutputShape, error) { +func (c *OutputService13ProtocolTest) OutputService13TestCaseOperation1(input *OutputService13TestShapeOutputService13TestCaseOperation1Input) (*OutputService13TestShapeOutputService13TestCaseOperation1Output, error) { req, out := c.OutputService13TestCaseOperation1Request(input) err := req.Send() return out, err } -var opOutputService13TestCaseOperation1 *aws.Operation - type OutputService13TestShapeOutputService13TestCaseOperation1Input struct { metadataOutputService13TestShapeOutputService13TestCaseOperation1Input `json:"-" xml:"-"` } @@ -1078,27 +1055,28 @@ type metadataOutputService13TestShapeOutputService13TestCaseOperation1Input stru SDKShapeTraits bool `type:"structure"` } -type OutputService13TestShapeOutputShape struct { +type OutputService13TestShapeOutputService13TestCaseOperation1Output struct { Map map[string]*string `locationName:"Attribute" locationNameKey:"Name" locationNameValue:"Value" type:"map" flattened:"true"` - metadataOutputService13TestShapeOutputShape `json:"-" xml:"-"` + metadataOutputService13TestShapeOutputService13TestCaseOperation1Output `json:"-" xml:"-"` } -type metadataOutputService13TestShapeOutputShape struct { +type metadataOutputService13TestShapeOutputService13TestCaseOperation1Output struct { SDKShapeTraits bool `type:"structure"` } -// OutputService14ProtocolTest is a client for OutputService14ProtocolTest. type OutputService14ProtocolTest struct { - *aws.Service + *service.Service } // New returns a new OutputService14ProtocolTest client. func NewOutputService14ProtocolTest(config *aws.Config) *OutputService14ProtocolTest { - service := &aws.Service{ - Config: aws.DefaultConfig.Merge(config), - ServiceName: "outputservice14protocoltest", - APIVersion: "", + service := &service.Service{ + ServiceInfo: serviceinfo.ServiceInfo{ + Config: defaults.DefaultConfig.Merge(config), + ServiceName: "outputservice14protocoltest", + APIVersion: "", + }, } service.Initialize() @@ -1114,39 +1092,36 @@ func NewOutputService14ProtocolTest(config *aws.Config) *OutputService14Protocol // newRequest creates a new request for a OutputService14ProtocolTest operation and runs any // custom request initialization. -func (c *OutputService14ProtocolTest) newRequest(op *aws.Operation, params, data interface{}) *aws.Request { - req := aws.NewRequest(c.Service, op, params, data) +func (c *OutputService14ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { + req := c.NewRequest(op, params, data) return req } -// OutputService14TestCaseOperation1Request generates a request for the OutputService14TestCaseOperation1 operation. -func (c *OutputService14ProtocolTest) OutputService14TestCaseOperation1Request(input *OutputService14TestShapeOutputService14TestCaseOperation1Input) (req *aws.Request, output *OutputService14TestShapeOutputShape) { +const opOutputService14TestCaseOperation1 = "OperationName" - if opOutputService14TestCaseOperation1 == nil { - opOutputService14TestCaseOperation1 = &aws.Operation{ - Name: "OperationName", - } +// OutputService14TestCaseOperation1Request generates a request for the OutputService14TestCaseOperation1 operation. +func (c *OutputService14ProtocolTest) OutputService14TestCaseOperation1Request(input *OutputService14TestShapeOutputService14TestCaseOperation1Input) (req *request.Request, output *OutputService14TestShapeOutputService14TestCaseOperation1Output) { + op := &request.Operation{ + Name: opOutputService14TestCaseOperation1, } if input == nil { input = &OutputService14TestShapeOutputService14TestCaseOperation1Input{} } - req = c.newRequest(opOutputService14TestCaseOperation1, input, output) - output = &OutputService14TestShapeOutputShape{} + req = c.newRequest(op, input, output) + output = &OutputService14TestShapeOutputService14TestCaseOperation1Output{} req.Data = output return } -func (c *OutputService14ProtocolTest) OutputService14TestCaseOperation1(input *OutputService14TestShapeOutputService14TestCaseOperation1Input) (*OutputService14TestShapeOutputShape, error) { +func (c *OutputService14ProtocolTest) OutputService14TestCaseOperation1(input *OutputService14TestShapeOutputService14TestCaseOperation1Input) (*OutputService14TestShapeOutputService14TestCaseOperation1Output, error) { req, out := c.OutputService14TestCaseOperation1Request(input) err := req.Send() return out, err } -var opOutputService14TestCaseOperation1 *aws.Operation - type OutputService14TestShapeOutputService14TestCaseOperation1Input struct { metadataOutputService14TestShapeOutputService14TestCaseOperation1Input `json:"-" xml:"-"` } @@ -1155,13 +1130,13 @@ type metadataOutputService14TestShapeOutputService14TestCaseOperation1Input stru SDKShapeTraits bool `type:"structure"` } -type OutputService14TestShapeOutputShape struct { +type OutputService14TestShapeOutputService14TestCaseOperation1Output struct { Map map[string]*string `locationNameKey:"foo" locationNameValue:"bar" type:"map" flattened:"true"` - metadataOutputService14TestShapeOutputShape `json:"-" xml:"-"` + metadataOutputService14TestShapeOutputService14TestCaseOperation1Output `json:"-" xml:"-"` } -type metadataOutputService14TestShapeOutputShape struct { +type metadataOutputService14TestShapeOutputService14TestCaseOperation1Output struct { SDKShapeTraits bool `type:"structure"` } diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/rest/build.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/rest/build.go index 38c4512bea1c..326e96cc6251 100644 --- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/rest/build.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/rest/build.go @@ -1,4 +1,4 @@ -// Package rest provides RESTful serialisation of AWS requests and responses. +// Package rest provides RESTful serialization of AWS requests and responses. package rest import ( @@ -13,8 +13,8 @@ import ( "strings" "time" - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/internal/apierr" + "github.com/aws/aws-sdk-go/aws/awserr" + "github.com/aws/aws-sdk-go/aws/request" ) // RFC822 returns an RFC822 formatted timestamp for AWS protocols @@ -37,7 +37,7 @@ func init() { } // Build builds the REST component of a service request. -func Build(r *aws.Request) { +func Build(r *request.Request) { if r.ParamsFilled() { v := reflect.ValueOf(r.Params).Elem() buildLocationElements(r, v) @@ -45,7 +45,7 @@ func Build(r *aws.Request) { } } -func buildLocationElements(r *aws.Request, v reflect.Value) { +func buildLocationElements(r *request.Request, v reflect.Value) { query := r.HTTPRequest.URL.Query() for i := 0; i < v.NumField(); i++ { @@ -87,7 +87,7 @@ func buildLocationElements(r *aws.Request, v reflect.Value) { updatePath(r.HTTPRequest.URL, r.HTTPRequest.URL.Path) } -func buildBody(r *aws.Request, v reflect.Value) { +func buildBody(r *request.Request, v reflect.Value) { if field, ok := v.Type().FieldByName("SDKShapeTraits"); ok { if payloadName := field.Tag.Get("payload"); payloadName != "" { pfield, _ := v.Type().FieldByName(payloadName) @@ -102,7 +102,7 @@ func buildBody(r *aws.Request, v reflect.Value) { case string: r.SetStringBody(reader) default: - r.Error = apierr.New("Marshal", + r.Error = awserr.New("SerializationError", "failed to encode REST request", fmt.Errorf("unknown payload type %s", payload.Type())) } @@ -112,30 +112,30 @@ func buildBody(r *aws.Request, v reflect.Value) { } } -func buildHeader(r *aws.Request, v reflect.Value, name string) { +func buildHeader(r *request.Request, v reflect.Value, name string) { str, err := convertType(v) if err != nil { - r.Error = apierr.New("Marshal", "failed to encode REST request", err) + r.Error = awserr.New("SerializationError", "failed to encode REST request", err) } else if str != nil { r.HTTPRequest.Header.Add(name, *str) } } -func buildHeaderMap(r *aws.Request, v reflect.Value, prefix string) { +func buildHeaderMap(r *request.Request, v reflect.Value, prefix string) { for _, key := range v.MapKeys() { str, err := convertType(v.MapIndex(key)) if err != nil { - r.Error = apierr.New("Marshal", "failed to encode REST request", err) + r.Error = awserr.New("SerializationError", "failed to encode REST request", err) } else if str != nil { r.HTTPRequest.Header.Add(prefix+key.String(), *str) } } } -func buildURI(r *aws.Request, v reflect.Value, name string) { +func buildURI(r *request.Request, v reflect.Value, name string) { value, err := convertType(v) if err != nil { - r.Error = apierr.New("Marshal", "failed to encode REST request", err) + r.Error = awserr.New("SerializationError", "failed to encode REST request", err) } else if value != nil { uri := r.HTTPRequest.URL.Path uri = strings.Replace(uri, "{"+name+"}", EscapePath(*value, true), -1) @@ -144,10 +144,10 @@ func buildURI(r *aws.Request, v reflect.Value, name string) { } } -func buildQueryString(r *aws.Request, v reflect.Value, name string, query url.Values) { +func buildQueryString(r *request.Request, v reflect.Value, name string, query url.Values) { str, err := convertType(v) if err != nil { - r.Error = apierr.New("Marshal", "failed to encode REST request", err) + r.Error = awserr.New("SerializationError", "failed to encode REST request", err) } else if str != nil { query.Set(name, *str) } @@ -156,8 +156,13 @@ func buildQueryString(r *aws.Request, v reflect.Value, name string, query url.Va func updatePath(url *url.URL, urlPath string) { scheme, query := url.Scheme, url.RawQuery + hasSlash := strings.HasSuffix(urlPath, "/") + // clean up path urlPath = path.Clean(urlPath) + if hasSlash && !strings.HasSuffix(urlPath, "/") { + urlPath += "/" + } // get formatted URL minus scheme so we can build this into Opaque url.Scheme, url.Path, url.RawQuery = "", "", "" diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/rest/unmarshal.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/rest/unmarshal.go index 009c5c95098f..06d9accbacb1 100644 --- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/rest/unmarshal.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/rest/unmarshal.go @@ -11,19 +11,28 @@ import ( "time" "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/internal/apierr" + "github.com/aws/aws-sdk-go/aws/awserr" + "github.com/aws/aws-sdk-go/aws/request" ) // Unmarshal unmarshals the REST component of a response in a REST service. -func Unmarshal(r *aws.Request) { +func Unmarshal(r *request.Request) { if r.DataFilled() { v := reflect.Indirect(reflect.ValueOf(r.Data)) unmarshalBody(r, v) + } +} + +// UnmarshalMeta unmarshals the REST metadata of a response in a REST service +func UnmarshalMeta(r *request.Request) { + r.RequestID = r.HTTPResponse.Header.Get("X-Amzn-Requestid") + if r.DataFilled() { + v := reflect.Indirect(reflect.ValueOf(r.Data)) unmarshalLocationElements(r, v) } } -func unmarshalBody(r *aws.Request, v reflect.Value) { +func unmarshalBody(r *request.Request, v reflect.Value) { if field, ok := v.Type().FieldByName("SDKShapeTraits"); ok { if payloadName := field.Tag.Get("payload"); payloadName != "" { pfield, _ := v.Type().FieldByName(payloadName) @@ -34,14 +43,14 @@ func unmarshalBody(r *aws.Request, v reflect.Value) { case []byte: b, err := ioutil.ReadAll(r.HTTPResponse.Body) if err != nil { - r.Error = apierr.New("Unmarshal", "failed to decode REST response", err) + r.Error = awserr.New("SerializationError", "failed to decode REST response", err) } else { payload.Set(reflect.ValueOf(b)) } case *string: b, err := ioutil.ReadAll(r.HTTPResponse.Body) if err != nil { - r.Error = apierr.New("Unmarshal", "failed to decode REST response", err) + r.Error = awserr.New("SerializationError", "failed to decode REST response", err) } else { str := string(b) payload.Set(reflect.ValueOf(&str)) @@ -53,7 +62,7 @@ func unmarshalBody(r *aws.Request, v reflect.Value) { case "aws.ReadSeekCloser", "io.ReadCloser": payload.Set(reflect.ValueOf(r.HTTPResponse.Body)) default: - r.Error = apierr.New("Unmarshal", + r.Error = awserr.New("SerializationError", "failed to decode REST response", fmt.Errorf("unknown payload type %s", payload.Type())) } @@ -64,7 +73,7 @@ func unmarshalBody(r *aws.Request, v reflect.Value) { } } -func unmarshalLocationElements(r *aws.Request, v reflect.Value) { +func unmarshalLocationElements(r *request.Request, v reflect.Value) { for i := 0; i < v.NumField(); i++ { m, field := v.Field(i), v.Type().Field(i) if n := field.Name; n[0:1] == strings.ToLower(n[0:1]) { @@ -83,14 +92,14 @@ func unmarshalLocationElements(r *aws.Request, v reflect.Value) { case "header": err := unmarshalHeader(m, r.HTTPResponse.Header.Get(name)) if err != nil { - r.Error = apierr.New("Unmarshal", "failed to decode REST response", err) + r.Error = awserr.New("SerializationError", "failed to decode REST response", err) break } case "headers": prefix := field.Tag.Get("locationName") err := unmarshalHeaderMap(m, r.HTTPResponse.Header, prefix) if err != nil { - r.Error = apierr.New("Unmarshal", "failed to decode REST response", err) + r.Error = awserr.New("SerializationError", "failed to decode REST response", err) break } } diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/xml/xmlutil/unmarshal.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/xml/xmlutil/unmarshal.go index a7b7a60b2ec0..5e4fe210b369 100644 --- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/xml/xmlutil/unmarshal.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/xml/xmlutil/unmarshal.go @@ -114,7 +114,7 @@ func parseStruct(r reflect.Value, node *XMLNode, tag reflect.StructTag) error { for _, a := range node.Attr { if name == a.Name.Local { // turn this into a text node for de-serializing - elems = []*XMLNode{&XMLNode{Text: a.Value}} + elems = []*XMLNode{{Text: a.Value}} } } } diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/signer/v4/v4.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/signer/v4/v4.go index 8efda142091c..fc7bc35350e0 100644 --- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/signer/v4/v4.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/signer/v4/v4.go @@ -14,10 +14,10 @@ import ( "strings" "time" + "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/credentials" + "github.com/aws/aws-sdk-go/aws/request" "github.com/aws/aws-sdk-go/internal/protocol/rest" - - "github.com/aws/aws-sdk-go/aws" ) const ( @@ -34,18 +34,17 @@ var ignoredHeaders = map[string]bool{ } type signer struct { - Request *http.Request - Time time.Time - ExpireTime time.Duration - ServiceName string - Region string - AccessKeyID string - SecretAccessKey string - SessionToken string - Query url.Values - Body io.ReadSeeker - Debug uint - Logger io.Writer + Request *http.Request + Time time.Time + ExpireTime time.Duration + ServiceName string + Region string + CredValues credentials.Value + Credentials *credentials.Credentials + Query url.Values + Body io.ReadSeeker + Debug aws.LogLevelType + Logger aws.Logger isPresign bool formattedTime string @@ -65,21 +64,16 @@ type signer struct { // Will sign the requests with the service config's Credentials object // Signing is skipped if the credentials is the credentials.AnonymousCredentials // object. -func Sign(req *aws.Request) { +func Sign(req *request.Request) { // If the request does not need to be signed ignore the signing of the // request if the AnonymousCredentials object is used. if req.Service.Config.Credentials == credentials.AnonymousCredentials { return } - creds, err := req.Service.Config.Credentials.Get() - if err != nil { - req.Error = err - return - } region := req.Service.SigningRegion if region == "" { - region = req.Service.Config.Region + region = aws.StringValue(req.Service.Config.Region) } name := req.Service.SigningName @@ -88,53 +82,86 @@ func Sign(req *aws.Request) { } s := signer{ - Request: req.HTTPRequest, - Time: req.Time, - ExpireTime: req.ExpireTime, - Query: req.HTTPRequest.URL.Query(), - Body: req.Body, - ServiceName: name, - Region: region, - AccessKeyID: creds.AccessKeyID, - SecretAccessKey: creds.SecretAccessKey, - SessionToken: creds.SessionToken, - Debug: req.Service.Config.LogLevel, - Logger: req.Service.Config.Logger, + Request: req.HTTPRequest, + Time: req.Time, + ExpireTime: req.ExpireTime, + Query: req.HTTPRequest.URL.Query(), + Body: req.Body, + ServiceName: name, + Region: region, + Credentials: req.Service.Config.Credentials, + Debug: req.Service.Config.LogLevel.Value(), + Logger: req.Service.Config.Logger, } - s.sign() - return + + req.Error = s.sign() } -func (v4 *signer) sign() { +func (v4 *signer) sign() error { if v4.ExpireTime != 0 { v4.isPresign = true } + if v4.isRequestSigned() { + if !v4.Credentials.IsExpired() { + // If the request is already signed, and the credentials have not + // expired yet ignore the signing request. + return nil + } + + // The credentials have expired for this request. The current signing + // is invalid, and needs to be request because the request will fail. + if v4.isPresign { + v4.removePresign() + // Update the request's query string to ensure the values stays in + // sync in the case retrieving the new credentials fails. + v4.Request.URL.RawQuery = v4.Query.Encode() + } + } + + var err error + v4.CredValues, err = v4.Credentials.Get() + if err != nil { + return err + } + if v4.isPresign { v4.Query.Set("X-Amz-Algorithm", authHeaderPrefix) - if v4.SessionToken != "" { - v4.Query.Set("X-Amz-Security-Token", v4.SessionToken) + if v4.CredValues.SessionToken != "" { + v4.Query.Set("X-Amz-Security-Token", v4.CredValues.SessionToken) } else { v4.Query.Del("X-Amz-Security-Token") } - } else if v4.SessionToken != "" { - v4.Request.Header.Set("X-Amz-Security-Token", v4.SessionToken) + } else if v4.CredValues.SessionToken != "" { + v4.Request.Header.Set("X-Amz-Security-Token", v4.CredValues.SessionToken) } v4.build() - if v4.Debug > 0 { - out := v4.Logger - fmt.Fprintf(out, "---[ CANONICAL STRING ]-----------------------------\n") - fmt.Fprintln(out, v4.canonicalString) - fmt.Fprintf(out, "---[ STRING TO SIGN ]--------------------------------\n") - fmt.Fprintln(out, v4.stringToSign) - if v4.isPresign { - fmt.Fprintf(out, "---[ SIGNED URL ]--------------------------------\n") - fmt.Fprintln(out, v4.Request.URL) - } - fmt.Fprintf(out, "-----------------------------------------------------\n") + if v4.Debug.Matches(aws.LogDebugWithSigning) { + v4.logSigningInfo() } + + return nil +} + +const logSignInfoMsg = `DEBUG: Request Signiture: +---[ CANONICAL STRING ]----------------------------- +%s +---[ STRING TO SIGN ]-------------------------------- +%s%s +-----------------------------------------------------` +const logSignedURLMsg = ` +---[ SIGNED URL ]------------------------------------ +%s` + +func (v4 *signer) logSigningInfo() { + signedURLMsg := "" + if v4.isPresign { + signedURLMsg = fmt.Sprintf(logSignedURLMsg, v4.Request.URL.String()) + } + msg := fmt.Sprintf(logSignInfoMsg, v4.canonicalString, v4.stringToSign, signedURLMsg) + v4.Logger.Log(msg) } func (v4 *signer) build() { @@ -152,7 +179,7 @@ func (v4 *signer) build() { v4.Request.URL.RawQuery += "&X-Amz-Signature=" + v4.signature } else { parts := []string{ - authHeaderPrefix + " Credential=" + v4.AccessKeyID + "/" + v4.credentialString, + authHeaderPrefix + " Credential=" + v4.CredValues.AccessKeyID + "/" + v4.credentialString, "SignedHeaders=" + v4.signedHeaders, "Signature=" + v4.signature, } @@ -182,7 +209,7 @@ func (v4 *signer) buildCredentialString() { }, "/") if v4.isPresign { - v4.Query.Set("X-Amz-Credential", v4.AccessKeyID+"/"+v4.credentialString) + v4.Query.Set("X-Amz-Credential", v4.CredValues.AccessKeyID+"/"+v4.credentialString) } } @@ -269,7 +296,7 @@ func (v4 *signer) buildStringToSign() { } func (v4 *signer) buildSignature() { - secret := v4.SecretAccessKey + secret := v4.CredValues.SecretAccessKey date := makeHmac([]byte("AWS4"+secret), []byte(v4.formattedShortTime)) region := makeHmac(date, []byte(v4.Region)) service := makeHmac(region, []byte(v4.ServiceName)) @@ -293,6 +320,29 @@ func (v4 *signer) bodyDigest() string { return hash } +// isRequestSigned returns if the request is currently signed or presigned +func (v4 *signer) isRequestSigned() bool { + if v4.isPresign && v4.Query.Get("X-Amz-Signature") != "" { + return true + } + if v4.Request.Header.Get("Authorization") != "" { + return true + } + + return false +} + +// unsign removes signing flags for both signed and presigned requests. +func (v4 *signer) removePresign() { + v4.Query.Del("X-Amz-Algorithm") + v4.Query.Del("X-Amz-Signature") + v4.Query.Del("X-Amz-Security-Token") + v4.Query.Del("X-Amz-Date") + v4.Query.Del("X-Amz-Expires") + v4.Query.Del("X-Amz-Credential") + v4.Query.Del("X-Amz-SignedHeaders") +} + func makeHmac(key []byte, data []byte) []byte { hash := hmac.New(sha256.New, key) hash.Write(data) @@ -306,21 +356,10 @@ func makeSha256(data []byte) []byte { } func makeSha256Reader(reader io.ReadSeeker) []byte { - packet := make([]byte, 4096) hash := sha256.New() - start, _ := reader.Seek(0, 1) defer reader.Seek(start, 0) - for { - n, err := reader.Read(packet) - if n > 0 { - hash.Write(packet[0:n]) - } - if err == io.EOF || n == 0 { - break - } - } - + io.Copy(hash, reader) return hash.Sum(nil) } diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/signer/v4/v4_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/signer/v4/v4_test.go index 20f655ac6c7e..0ba9ff25f73a 100644 --- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/signer/v4/v4_test.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/signer/v4/v4_test.go @@ -8,6 +8,8 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/credentials" + "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/aws/service" "github.com/stretchr/testify/assert" ) @@ -22,16 +24,14 @@ func buildSigner(serviceName string, region string, signTime time.Time, expireTi req.Header.Add("X-Amz-Meta-Other-Header", "some-value=!@#$%^&* (+)") return signer{ - Request: req, - Time: signTime, - ExpireTime: expireTime, - Query: req.URL.Query(), - Body: reader, - ServiceName: serviceName, - Region: region, - AccessKeyID: "AKID", - SecretAccessKey: "SECRET", - SessionToken: "SESSION", + Request: req, + Time: signTime, + ExpireTime: expireTime, + Query: req.URL.Query(), + Body: reader, + ServiceName: serviceName, + Region: region, + Credentials: credentials.NewStaticCredentials("AKID", "SECRET", "SESSION"), } } @@ -118,9 +118,9 @@ func TestSignPrecomputedBodyChecksum(t *testing.T) { } func TestAnonymousCredentials(t *testing.T) { - r := aws.NewRequest( - aws.NewService(&aws.Config{Credentials: credentials.AnonymousCredentials}), - &aws.Operation{ + svc := service.New(&aws.Config{Credentials: credentials.AnonymousCredentials}) + r := svc.NewRequest( + &request.Operation{ Name: "BatchGetItem", HTTPMethod: "POST", HTTPPath: "/", @@ -141,6 +141,97 @@ func TestAnonymousCredentials(t *testing.T) { assert.Empty(t, hQ.Get("X-Amz-Date")) } +func TestIgnoreResignRequestWithValidCreds(t *testing.T) { + svc := service.New(&aws.Config{ + Credentials: credentials.NewStaticCredentials("AKID", "SECRET", "SESSION"), + Region: aws.String("us-west-2"), + }) + r := svc.NewRequest( + &request.Operation{ + Name: "BatchGetItem", + HTTPMethod: "POST", + HTTPPath: "/", + }, + nil, + nil, + ) + + Sign(r) + sig := r.HTTPRequest.Header.Get("Authorization") + + Sign(r) + assert.Equal(t, sig, r.HTTPRequest.Header.Get("Authorization")) +} + +func TestIgnorePreResignRequestWithValidCreds(t *testing.T) { + svc := service.New(&aws.Config{ + Credentials: credentials.NewStaticCredentials("AKID", "SECRET", "SESSION"), + Region: aws.String("us-west-2"), + }) + r := svc.NewRequest( + &request.Operation{ + Name: "BatchGetItem", + HTTPMethod: "POST", + HTTPPath: "/", + }, + nil, + nil, + ) + r.ExpireTime = time.Minute * 10 + + Sign(r) + sig := r.HTTPRequest.Header.Get("X-Amz-Signature") + + Sign(r) + assert.Equal(t, sig, r.HTTPRequest.Header.Get("X-Amz-Signature")) +} + +func TestResignRequestExpiredCreds(t *testing.T) { + creds := credentials.NewStaticCredentials("AKID", "SECRET", "SESSION") + svc := service.New(&aws.Config{Credentials: creds}) + r := svc.NewRequest( + &request.Operation{ + Name: "BatchGetItem", + HTTPMethod: "POST", + HTTPPath: "/", + }, + nil, + nil, + ) + Sign(r) + querySig := r.HTTPRequest.Header.Get("Authorization") + + creds.Expire() + + Sign(r) + assert.NotEqual(t, querySig, r.HTTPRequest.Header.Get("Authorization")) +} + +func TestPreResignRequestExpiredCreds(t *testing.T) { + provider := &credentials.StaticProvider{credentials.Value{"AKID", "SECRET", "SESSION"}} + creds := credentials.NewCredentials(provider) + svc := service.New(&aws.Config{Credentials: creds}) + r := svc.NewRequest( + &request.Operation{ + Name: "BatchGetItem", + HTTPMethod: "POST", + HTTPPath: "/", + }, + nil, + nil, + ) + r.ExpireTime = time.Minute * 10 + + Sign(r) + querySig := r.HTTPRequest.URL.Query().Get("X-Amz-Signature") + + creds.Expire() + r.Time = time.Now().Add(time.Hour * 48) + + Sign(r) + assert.NotEqual(t, querySig, r.HTTPRequest.URL.Query().Get("X-Amz-Signature")) +} + func BenchmarkPresignRequest(b *testing.B) { signer := buildSigner("dynamodb", "us-east-1", time.Now(), 300*time.Second, "{}") for i := 0; i < b.N; i++ { diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/autoscaling/api.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/autoscaling/api.go index 7c1443e21f96..34f6d43759f6 100644 --- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/autoscaling/api.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/autoscaling/api.go @@ -4,32 +4,27 @@ package autoscaling import ( - "sync" "time" - "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/awsutil" + "github.com/aws/aws-sdk-go/aws/request" ) -var oprw sync.Mutex +const opAttachInstances = "AttachInstances" // AttachInstancesRequest generates a request for the AttachInstances operation. -func (c *AutoScaling) AttachInstancesRequest(input *AttachInstancesInput) (req *aws.Request, output *AttachInstancesOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opAttachInstances == nil { - opAttachInstances = &aws.Operation{ - Name: "AttachInstances", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *AutoScaling) AttachInstancesRequest(input *AttachInstancesInput) (req *request.Request, output *AttachInstancesOutput) { + op := &request.Operation{ + Name: opAttachInstances, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &AttachInstancesInput{} } - req = c.newRequest(opAttachInstances, input, output) + req = c.newRequest(op, input, output) output = &AttachInstancesOutput{} req.Data = output return @@ -37,8 +32,8 @@ func (c *AutoScaling) AttachInstancesRequest(input *AttachInstancesInput) (req * // Attaches one or more EC2 instances to the specified Auto Scaling group. // -// For more information, see Attach Amazon EC2 Instances to Your Existing Auto -// Scaling Group (http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/attach-instance-asg.html) +// For more information, see Attach EC2 Instances to Your Auto Scaling Group +// (http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/attach-instance-asg.html) // in the Auto Scaling Developer Guide. func (c *AutoScaling) AttachInstances(input *AttachInstancesInput) (*AttachInstancesOutput, error) { req, out := c.AttachInstancesRequest(input) @@ -46,26 +41,55 @@ func (c *AutoScaling) AttachInstances(input *AttachInstancesInput) (*AttachInsta return out, err } -var opAttachInstances *aws.Operation +const opAttachLoadBalancers = "AttachLoadBalancers" + +// AttachLoadBalancersRequest generates a request for the AttachLoadBalancers operation. +func (c *AutoScaling) AttachLoadBalancersRequest(input *AttachLoadBalancersInput) (req *request.Request, output *AttachLoadBalancersOutput) { + op := &request.Operation{ + Name: opAttachLoadBalancers, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &AttachLoadBalancersInput{} + } + + req = c.newRequest(op, input, output) + output = &AttachLoadBalancersOutput{} + req.Data = output + return +} + +// Attaches one or more load balancers to the specified Auto Scaling group. +// +// To describe the load balancers for an Auto Scaling group, use DescribeLoadBalancers. +// To detach the load balancer from the Auto Scaling group, use DetachLoadBalancers. +// +// For more information, see Attach a Load Balancer to Your Auto Scaling Group +// (http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/attach-load-balancer-asg.html) +// in the Auto Scaling Developer Guide. +func (c *AutoScaling) AttachLoadBalancers(input *AttachLoadBalancersInput) (*AttachLoadBalancersOutput, error) { + req, out := c.AttachLoadBalancersRequest(input) + err := req.Send() + return out, err +} + +const opCompleteLifecycleAction = "CompleteLifecycleAction" // CompleteLifecycleActionRequest generates a request for the CompleteLifecycleAction operation. -func (c *AutoScaling) CompleteLifecycleActionRequest(input *CompleteLifecycleActionInput) (req *aws.Request, output *CompleteLifecycleActionOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opCompleteLifecycleAction == nil { - opCompleteLifecycleAction = &aws.Operation{ - Name: "CompleteLifecycleAction", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *AutoScaling) CompleteLifecycleActionRequest(input *CompleteLifecycleActionInput) (req *request.Request, output *CompleteLifecycleActionOutput) { + op := &request.Operation{ + Name: opCompleteLifecycleAction, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &CompleteLifecycleActionInput{} } - req = c.newRequest(opCompleteLifecycleAction, input, output) + req = c.newRequest(op, input, output) output = &CompleteLifecycleActionOutput{} req.Data = output return @@ -92,26 +116,21 @@ func (c *AutoScaling) CompleteLifecycleAction(input *CompleteLifecycleActionInpu return out, err } -var opCompleteLifecycleAction *aws.Operation +const opCreateAutoScalingGroup = "CreateAutoScalingGroup" // CreateAutoScalingGroupRequest generates a request for the CreateAutoScalingGroup operation. -func (c *AutoScaling) CreateAutoScalingGroupRequest(input *CreateAutoScalingGroupInput) (req *aws.Request, output *CreateAutoScalingGroupOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opCreateAutoScalingGroup == nil { - opCreateAutoScalingGroup = &aws.Operation{ - Name: "CreateAutoScalingGroup", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *AutoScaling) CreateAutoScalingGroupRequest(input *CreateAutoScalingGroupInput) (req *request.Request, output *CreateAutoScalingGroupOutput) { + op := &request.Operation{ + Name: opCreateAutoScalingGroup, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &CreateAutoScalingGroupInput{} } - req = c.newRequest(opCreateAutoScalingGroup, input, output) + req = c.newRequest(op, input, output) output = &CreateAutoScalingGroupOutput{} req.Data = output return @@ -121,33 +140,31 @@ func (c *AutoScaling) CreateAutoScalingGroupRequest(input *CreateAutoScalingGrou // // If you exceed your maximum limit of Auto Scaling groups, which by default // is 20 per region, the call fails. For information about viewing and updating -// these limits, see DescribeAccountLimits. +// this limit, see DescribeAccountLimits. +// +// For more information, see Auto Scaling Groups (http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/AutoScalingGroup.html) +// in the Auto Scaling Developer Guide. func (c *AutoScaling) CreateAutoScalingGroup(input *CreateAutoScalingGroupInput) (*CreateAutoScalingGroupOutput, error) { req, out := c.CreateAutoScalingGroupRequest(input) err := req.Send() return out, err } -var opCreateAutoScalingGroup *aws.Operation +const opCreateLaunchConfiguration = "CreateLaunchConfiguration" // CreateLaunchConfigurationRequest generates a request for the CreateLaunchConfiguration operation. -func (c *AutoScaling) CreateLaunchConfigurationRequest(input *CreateLaunchConfigurationInput) (req *aws.Request, output *CreateLaunchConfigurationOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opCreateLaunchConfiguration == nil { - opCreateLaunchConfiguration = &aws.Operation{ - Name: "CreateLaunchConfiguration", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *AutoScaling) CreateLaunchConfigurationRequest(input *CreateLaunchConfigurationInput) (req *request.Request, output *CreateLaunchConfigurationOutput) { + op := &request.Operation{ + Name: opCreateLaunchConfiguration, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &CreateLaunchConfigurationInput{} } - req = c.newRequest(opCreateLaunchConfiguration, input, output) + req = c.newRequest(op, input, output) output = &CreateLaunchConfigurationOutput{} req.Data = output return @@ -157,33 +174,31 @@ func (c *AutoScaling) CreateLaunchConfigurationRequest(input *CreateLaunchConfig // // If you exceed your maximum limit of launch configurations, which by default // is 100 per region, the call fails. For information about viewing and updating -// these limits, see DescribeAccountLimits. +// this limit, see DescribeAccountLimits. +// +// For more information, see Launch Configurations (http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/LaunchConfiguration.html) +// in the Auto Scaling Developer Guide. func (c *AutoScaling) CreateLaunchConfiguration(input *CreateLaunchConfigurationInput) (*CreateLaunchConfigurationOutput, error) { req, out := c.CreateLaunchConfigurationRequest(input) err := req.Send() return out, err } -var opCreateLaunchConfiguration *aws.Operation +const opCreateOrUpdateTags = "CreateOrUpdateTags" // CreateOrUpdateTagsRequest generates a request for the CreateOrUpdateTags operation. -func (c *AutoScaling) CreateOrUpdateTagsRequest(input *CreateOrUpdateTagsInput) (req *aws.Request, output *CreateOrUpdateTagsOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opCreateOrUpdateTags == nil { - opCreateOrUpdateTags = &aws.Operation{ - Name: "CreateOrUpdateTags", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *AutoScaling) CreateOrUpdateTagsRequest(input *CreateOrUpdateTagsInput) (req *request.Request, output *CreateOrUpdateTagsOutput) { + op := &request.Operation{ + Name: opCreateOrUpdateTags, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &CreateOrUpdateTagsInput{} } - req = c.newRequest(opCreateOrUpdateTags, input, output) + req = c.newRequest(op, input, output) output = &CreateOrUpdateTagsOutput{} req.Data = output return @@ -191,10 +206,17 @@ func (c *AutoScaling) CreateOrUpdateTagsRequest(input *CreateOrUpdateTagsInput) // Creates or updates tags for the specified Auto Scaling group. // -// A tag's definition is composed of a resource ID, resource type, key and -// value, and the propagate flag. Value and the propagate flag are optional -// parameters. See the Request Parameters for more information. For more information, -// see Add, Modify, or Remove Auto Scaling Group Tags (http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/ASTagging.html) +// A tag is defined by its resource ID, resource type, key, value, and propagate +// flag. The value and the propagate flag are optional parameters. The only +// supported resource type is auto-scaling-group, and the resource ID must be +// the name of the group. The PropagateAtLaunch flag determines whether the +// tag is added to instances launched in the group. Valid values are true or +// false. +// +// When you specify a tag with a key that already exists, the operation overwrites +// the previous tag definition, and you do not get an error message. +// +// For more information, see Tagging Auto Scaling Groups and Instances (http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/ASTagging.html) // in the Auto Scaling Developer Guide. func (c *AutoScaling) CreateOrUpdateTags(input *CreateOrUpdateTagsInput) (*CreateOrUpdateTagsOutput, error) { req, out := c.CreateOrUpdateTagsRequest(input) @@ -202,26 +224,21 @@ func (c *AutoScaling) CreateOrUpdateTags(input *CreateOrUpdateTagsInput) (*Creat return out, err } -var opCreateOrUpdateTags *aws.Operation +const opDeleteAutoScalingGroup = "DeleteAutoScalingGroup" // DeleteAutoScalingGroupRequest generates a request for the DeleteAutoScalingGroup operation. -func (c *AutoScaling) DeleteAutoScalingGroupRequest(input *DeleteAutoScalingGroupInput) (req *aws.Request, output *DeleteAutoScalingGroupOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opDeleteAutoScalingGroup == nil { - opDeleteAutoScalingGroup = &aws.Operation{ - Name: "DeleteAutoScalingGroup", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *AutoScaling) DeleteAutoScalingGroupRequest(input *DeleteAutoScalingGroupInput) (req *request.Request, output *DeleteAutoScalingGroupOutput) { + op := &request.Operation{ + Name: opDeleteAutoScalingGroup, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &DeleteAutoScalingGroupInput{} } - req = c.newRequest(opDeleteAutoScalingGroup, input, output) + req = c.newRequest(op, input, output) output = &DeleteAutoScalingGroupOutput{} req.Data = output return @@ -231,35 +248,29 @@ func (c *AutoScaling) DeleteAutoScalingGroupRequest(input *DeleteAutoScalingGrou // // The group must have no instances and no scaling activities in progress. // -// To remove all instances before calling DeleteAutoScalingGroup, you can call -// UpdateAutoScalingGroup to set the minimum and maximum size of the AutoScalingGroup -// to zero. +// To remove all instances before calling DeleteAutoScalingGroup, call UpdateAutoScalingGroup +// to set the minimum and maximum size of the Auto Scaling group to zero. func (c *AutoScaling) DeleteAutoScalingGroup(input *DeleteAutoScalingGroupInput) (*DeleteAutoScalingGroupOutput, error) { req, out := c.DeleteAutoScalingGroupRequest(input) err := req.Send() return out, err } -var opDeleteAutoScalingGroup *aws.Operation +const opDeleteLaunchConfiguration = "DeleteLaunchConfiguration" // DeleteLaunchConfigurationRequest generates a request for the DeleteLaunchConfiguration operation. -func (c *AutoScaling) DeleteLaunchConfigurationRequest(input *DeleteLaunchConfigurationInput) (req *aws.Request, output *DeleteLaunchConfigurationOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opDeleteLaunchConfiguration == nil { - opDeleteLaunchConfiguration = &aws.Operation{ - Name: "DeleteLaunchConfiguration", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *AutoScaling) DeleteLaunchConfigurationRequest(input *DeleteLaunchConfigurationInput) (req *request.Request, output *DeleteLaunchConfigurationOutput) { + op := &request.Operation{ + Name: opDeleteLaunchConfiguration, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &DeleteLaunchConfigurationInput{} } - req = c.newRequest(opDeleteLaunchConfiguration, input, output) + req = c.newRequest(op, input, output) output = &DeleteLaunchConfigurationOutput{} req.Data = output return @@ -276,26 +287,21 @@ func (c *AutoScaling) DeleteLaunchConfiguration(input *DeleteLaunchConfiguration return out, err } -var opDeleteLaunchConfiguration *aws.Operation +const opDeleteLifecycleHook = "DeleteLifecycleHook" // DeleteLifecycleHookRequest generates a request for the DeleteLifecycleHook operation. -func (c *AutoScaling) DeleteLifecycleHookRequest(input *DeleteLifecycleHookInput) (req *aws.Request, output *DeleteLifecycleHookOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opDeleteLifecycleHook == nil { - opDeleteLifecycleHook = &aws.Operation{ - Name: "DeleteLifecycleHook", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *AutoScaling) DeleteLifecycleHookRequest(input *DeleteLifecycleHookInput) (req *request.Request, output *DeleteLifecycleHookOutput) { + op := &request.Operation{ + Name: opDeleteLifecycleHook, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &DeleteLifecycleHookInput{} } - req = c.newRequest(opDeleteLifecycleHook, input, output) + req = c.newRequest(op, input, output) output = &DeleteLifecycleHookOutput{} req.Data = output return @@ -311,26 +317,21 @@ func (c *AutoScaling) DeleteLifecycleHook(input *DeleteLifecycleHookInput) (*Del return out, err } -var opDeleteLifecycleHook *aws.Operation +const opDeleteNotificationConfiguration = "DeleteNotificationConfiguration" // DeleteNotificationConfigurationRequest generates a request for the DeleteNotificationConfiguration operation. -func (c *AutoScaling) DeleteNotificationConfigurationRequest(input *DeleteNotificationConfigurationInput) (req *aws.Request, output *DeleteNotificationConfigurationOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opDeleteNotificationConfiguration == nil { - opDeleteNotificationConfiguration = &aws.Operation{ - Name: "DeleteNotificationConfiguration", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *AutoScaling) DeleteNotificationConfigurationRequest(input *DeleteNotificationConfigurationInput) (req *request.Request, output *DeleteNotificationConfigurationOutput) { + op := &request.Operation{ + Name: opDeleteNotificationConfiguration, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &DeleteNotificationConfigurationInput{} } - req = c.newRequest(opDeleteNotificationConfiguration, input, output) + req = c.newRequest(op, input, output) output = &DeleteNotificationConfigurationOutput{} req.Data = output return @@ -343,26 +344,21 @@ func (c *AutoScaling) DeleteNotificationConfiguration(input *DeleteNotificationC return out, err } -var opDeleteNotificationConfiguration *aws.Operation +const opDeletePolicy = "DeletePolicy" // DeletePolicyRequest generates a request for the DeletePolicy operation. -func (c *AutoScaling) DeletePolicyRequest(input *DeletePolicyInput) (req *aws.Request, output *DeletePolicyOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opDeletePolicy == nil { - opDeletePolicy = &aws.Operation{ - Name: "DeletePolicy", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *AutoScaling) DeletePolicyRequest(input *DeletePolicyInput) (req *request.Request, output *DeletePolicyOutput) { + op := &request.Operation{ + Name: opDeletePolicy, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &DeletePolicyInput{} } - req = c.newRequest(opDeletePolicy, input, output) + req = c.newRequest(op, input, output) output = &DeletePolicyOutput{} req.Data = output return @@ -375,26 +371,21 @@ func (c *AutoScaling) DeletePolicy(input *DeletePolicyInput) (*DeletePolicyOutpu return out, err } -var opDeletePolicy *aws.Operation +const opDeleteScheduledAction = "DeleteScheduledAction" // DeleteScheduledActionRequest generates a request for the DeleteScheduledAction operation. -func (c *AutoScaling) DeleteScheduledActionRequest(input *DeleteScheduledActionInput) (req *aws.Request, output *DeleteScheduledActionOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opDeleteScheduledAction == nil { - opDeleteScheduledAction = &aws.Operation{ - Name: "DeleteScheduledAction", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *AutoScaling) DeleteScheduledActionRequest(input *DeleteScheduledActionInput) (req *request.Request, output *DeleteScheduledActionOutput) { + op := &request.Operation{ + Name: opDeleteScheduledAction, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &DeleteScheduledActionInput{} } - req = c.newRequest(opDeleteScheduledAction, input, output) + req = c.newRequest(op, input, output) output = &DeleteScheduledActionOutput{} req.Data = output return @@ -407,26 +398,21 @@ func (c *AutoScaling) DeleteScheduledAction(input *DeleteScheduledActionInput) ( return out, err } -var opDeleteScheduledAction *aws.Operation +const opDeleteTags = "DeleteTags" // DeleteTagsRequest generates a request for the DeleteTags operation. -func (c *AutoScaling) DeleteTagsRequest(input *DeleteTagsInput) (req *aws.Request, output *DeleteTagsOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opDeleteTags == nil { - opDeleteTags = &aws.Operation{ - Name: "DeleteTags", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *AutoScaling) DeleteTagsRequest(input *DeleteTagsInput) (req *request.Request, output *DeleteTagsOutput) { + op := &request.Operation{ + Name: opDeleteTags, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &DeleteTagsInput{} } - req = c.newRequest(opDeleteTags, input, output) + req = c.newRequest(op, input, output) output = &DeleteTagsOutput{} req.Data = output return @@ -439,26 +425,21 @@ func (c *AutoScaling) DeleteTags(input *DeleteTagsInput) (*DeleteTagsOutput, err return out, err } -var opDeleteTags *aws.Operation +const opDescribeAccountLimits = "DescribeAccountLimits" // DescribeAccountLimitsRequest generates a request for the DescribeAccountLimits operation. -func (c *AutoScaling) DescribeAccountLimitsRequest(input *DescribeAccountLimitsInput) (req *aws.Request, output *DescribeAccountLimitsOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opDescribeAccountLimits == nil { - opDescribeAccountLimits = &aws.Operation{ - Name: "DescribeAccountLimits", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *AutoScaling) DescribeAccountLimitsRequest(input *DescribeAccountLimitsInput) (req *request.Request, output *DescribeAccountLimitsOutput) { + op := &request.Operation{ + Name: opDescribeAccountLimits, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &DescribeAccountLimitsInput{} } - req = c.newRequest(opDescribeAccountLimits, input, output) + req = c.newRequest(op, input, output) output = &DescribeAccountLimitsOutput{} req.Data = output return @@ -467,71 +448,62 @@ func (c *AutoScaling) DescribeAccountLimitsRequest(input *DescribeAccountLimitsI // Describes the current Auto Scaling resource limits for your AWS account. // // For information about requesting an increase in these limits, see AWS Service -// Limits (http://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html). +// Limits (http://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html) +// in the Amazon Web Services General Reference. func (c *AutoScaling) DescribeAccountLimits(input *DescribeAccountLimitsInput) (*DescribeAccountLimitsOutput, error) { req, out := c.DescribeAccountLimitsRequest(input) err := req.Send() return out, err } -var opDescribeAccountLimits *aws.Operation +const opDescribeAdjustmentTypes = "DescribeAdjustmentTypes" // DescribeAdjustmentTypesRequest generates a request for the DescribeAdjustmentTypes operation. -func (c *AutoScaling) DescribeAdjustmentTypesRequest(input *DescribeAdjustmentTypesInput) (req *aws.Request, output *DescribeAdjustmentTypesOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opDescribeAdjustmentTypes == nil { - opDescribeAdjustmentTypes = &aws.Operation{ - Name: "DescribeAdjustmentTypes", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *AutoScaling) DescribeAdjustmentTypesRequest(input *DescribeAdjustmentTypesInput) (req *request.Request, output *DescribeAdjustmentTypesOutput) { + op := &request.Operation{ + Name: opDescribeAdjustmentTypes, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &DescribeAdjustmentTypesInput{} } - req = c.newRequest(opDescribeAdjustmentTypes, input, output) + req = c.newRequest(op, input, output) output = &DescribeAdjustmentTypesOutput{} req.Data = output return } -// Lists the policy adjustment types for use with PutScalingPolicy. +// Describes the policy adjustment types for use with PutScalingPolicy. func (c *AutoScaling) DescribeAdjustmentTypes(input *DescribeAdjustmentTypesInput) (*DescribeAdjustmentTypesOutput, error) { req, out := c.DescribeAdjustmentTypesRequest(input) err := req.Send() return out, err } -var opDescribeAdjustmentTypes *aws.Operation +const opDescribeAutoScalingGroups = "DescribeAutoScalingGroups" // DescribeAutoScalingGroupsRequest generates a request for the DescribeAutoScalingGroups operation. -func (c *AutoScaling) DescribeAutoScalingGroupsRequest(input *DescribeAutoScalingGroupsInput) (req *aws.Request, output *DescribeAutoScalingGroupsOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opDescribeAutoScalingGroups == nil { - opDescribeAutoScalingGroups = &aws.Operation{ - Name: "DescribeAutoScalingGroups", - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &aws.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxRecords", - TruncationToken: "", - }, - } +func (c *AutoScaling) DescribeAutoScalingGroupsRequest(input *DescribeAutoScalingGroupsInput) (req *request.Request, output *DescribeAutoScalingGroupsOutput) { + op := &request.Operation{ + Name: opDescribeAutoScalingGroups, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxRecords", + TruncationToken: "", + }, } if input == nil { input = &DescribeAutoScalingGroupsInput{} } - req = c.newRequest(opDescribeAutoScalingGroups, input, output) + req = c.newRequest(op, input, output) output = &DescribeAutoScalingGroupsOutput{} req.Data = output return @@ -539,10 +511,6 @@ func (c *AutoScaling) DescribeAutoScalingGroupsRequest(input *DescribeAutoScalin // Describes one or more Auto Scaling groups. If a list of names is not provided, // the call describes all Auto Scaling groups. -// -// You can specify a maximum number of items to be returned with a single call. -// If there are more items to return, the call returns a token. To get the next -// set of items, repeat the call with the returned token in the NextToken parameter. func (c *AutoScaling) DescribeAutoScalingGroups(input *DescribeAutoScalingGroupsInput) (*DescribeAutoScalingGroupsOutput, error) { req, out := c.DescribeAutoScalingGroupsRequest(input) err := req.Send() @@ -556,32 +524,27 @@ func (c *AutoScaling) DescribeAutoScalingGroupsPages(input *DescribeAutoScalingG }) } -var opDescribeAutoScalingGroups *aws.Operation +const opDescribeAutoScalingInstances = "DescribeAutoScalingInstances" // DescribeAutoScalingInstancesRequest generates a request for the DescribeAutoScalingInstances operation. -func (c *AutoScaling) DescribeAutoScalingInstancesRequest(input *DescribeAutoScalingInstancesInput) (req *aws.Request, output *DescribeAutoScalingInstancesOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opDescribeAutoScalingInstances == nil { - opDescribeAutoScalingInstances = &aws.Operation{ - Name: "DescribeAutoScalingInstances", - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &aws.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxRecords", - TruncationToken: "", - }, - } +func (c *AutoScaling) DescribeAutoScalingInstancesRequest(input *DescribeAutoScalingInstancesInput) (req *request.Request, output *DescribeAutoScalingInstancesOutput) { + op := &request.Operation{ + Name: opDescribeAutoScalingInstances, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxRecords", + TruncationToken: "", + }, } if input == nil { input = &DescribeAutoScalingInstancesInput{} } - req = c.newRequest(opDescribeAutoScalingInstances, input, output) + req = c.newRequest(op, input, output) output = &DescribeAutoScalingInstancesOutput{} req.Data = output return @@ -589,11 +552,6 @@ func (c *AutoScaling) DescribeAutoScalingInstancesRequest(input *DescribeAutoSca // Describes one or more Auto Scaling instances. If a list is not provided, // the call describes all instances. -// -// You can describe up to a maximum of 50 instances with a single call. By -// default, a call returns up to 20 instances. If there are more items to return, -// the call returns a token. To get the next set of items, repeat the call with -// the returned token in the NextToken parameter. func (c *AutoScaling) DescribeAutoScalingInstances(input *DescribeAutoScalingInstancesInput) (*DescribeAutoScalingInstancesOutput, error) { req, out := c.DescribeAutoScalingInstancesRequest(input) err := req.Send() @@ -607,64 +565,54 @@ func (c *AutoScaling) DescribeAutoScalingInstancesPages(input *DescribeAutoScali }) } -var opDescribeAutoScalingInstances *aws.Operation +const opDescribeAutoScalingNotificationTypes = "DescribeAutoScalingNotificationTypes" // DescribeAutoScalingNotificationTypesRequest generates a request for the DescribeAutoScalingNotificationTypes operation. -func (c *AutoScaling) DescribeAutoScalingNotificationTypesRequest(input *DescribeAutoScalingNotificationTypesInput) (req *aws.Request, output *DescribeAutoScalingNotificationTypesOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opDescribeAutoScalingNotificationTypes == nil { - opDescribeAutoScalingNotificationTypes = &aws.Operation{ - Name: "DescribeAutoScalingNotificationTypes", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *AutoScaling) DescribeAutoScalingNotificationTypesRequest(input *DescribeAutoScalingNotificationTypesInput) (req *request.Request, output *DescribeAutoScalingNotificationTypesOutput) { + op := &request.Operation{ + Name: opDescribeAutoScalingNotificationTypes, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &DescribeAutoScalingNotificationTypesInput{} } - req = c.newRequest(opDescribeAutoScalingNotificationTypes, input, output) + req = c.newRequest(op, input, output) output = &DescribeAutoScalingNotificationTypesOutput{} req.Data = output return } -// Lists the notification types that are supported by Auto Scaling. +// Describes the notification types that are supported by Auto Scaling. func (c *AutoScaling) DescribeAutoScalingNotificationTypes(input *DescribeAutoScalingNotificationTypesInput) (*DescribeAutoScalingNotificationTypesOutput, error) { req, out := c.DescribeAutoScalingNotificationTypesRequest(input) err := req.Send() return out, err } -var opDescribeAutoScalingNotificationTypes *aws.Operation +const opDescribeLaunchConfigurations = "DescribeLaunchConfigurations" // DescribeLaunchConfigurationsRequest generates a request for the DescribeLaunchConfigurations operation. -func (c *AutoScaling) DescribeLaunchConfigurationsRequest(input *DescribeLaunchConfigurationsInput) (req *aws.Request, output *DescribeLaunchConfigurationsOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opDescribeLaunchConfigurations == nil { - opDescribeLaunchConfigurations = &aws.Operation{ - Name: "DescribeLaunchConfigurations", - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &aws.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxRecords", - TruncationToken: "", - }, - } +func (c *AutoScaling) DescribeLaunchConfigurationsRequest(input *DescribeLaunchConfigurationsInput) (req *request.Request, output *DescribeLaunchConfigurationsOutput) { + op := &request.Operation{ + Name: opDescribeLaunchConfigurations, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxRecords", + TruncationToken: "", + }, } if input == nil { input = &DescribeLaunchConfigurationsInput{} } - req = c.newRequest(opDescribeLaunchConfigurations, input, output) + req = c.newRequest(op, input, output) output = &DescribeLaunchConfigurationsOutput{} req.Data = output return @@ -672,10 +620,6 @@ func (c *AutoScaling) DescribeLaunchConfigurationsRequest(input *DescribeLaunchC // Describes one or more launch configurations. If you omit the list of names, // then the call describes all launch configurations. -// -// You can specify a maximum number of items to be returned with a single call. -// If there are more items to return, the call returns a token. To get the next -// set of items, repeat the call with the returned token in the NextToken parameter. func (c *AutoScaling) DescribeLaunchConfigurations(input *DescribeLaunchConfigurationsInput) (*DescribeLaunchConfigurationsOutput, error) { req, out := c.DescribeLaunchConfigurationsRequest(input) err := req.Send() @@ -689,26 +633,21 @@ func (c *AutoScaling) DescribeLaunchConfigurationsPages(input *DescribeLaunchCon }) } -var opDescribeLaunchConfigurations *aws.Operation +const opDescribeLifecycleHookTypes = "DescribeLifecycleHookTypes" // DescribeLifecycleHookTypesRequest generates a request for the DescribeLifecycleHookTypes operation. -func (c *AutoScaling) DescribeLifecycleHookTypesRequest(input *DescribeLifecycleHookTypesInput) (req *aws.Request, output *DescribeLifecycleHookTypesOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opDescribeLifecycleHookTypes == nil { - opDescribeLifecycleHookTypes = &aws.Operation{ - Name: "DescribeLifecycleHookTypes", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *AutoScaling) DescribeLifecycleHookTypesRequest(input *DescribeLifecycleHookTypesInput) (req *request.Request, output *DescribeLifecycleHookTypesOutput) { + op := &request.Operation{ + Name: opDescribeLifecycleHookTypes, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &DescribeLifecycleHookTypesInput{} } - req = c.newRequest(opDescribeLifecycleHookTypes, input, output) + req = c.newRequest(op, input, output) output = &DescribeLifecycleHookTypesOutput{} req.Data = output return @@ -721,26 +660,21 @@ func (c *AutoScaling) DescribeLifecycleHookTypes(input *DescribeLifecycleHookTyp return out, err } -var opDescribeLifecycleHookTypes *aws.Operation +const opDescribeLifecycleHooks = "DescribeLifecycleHooks" // DescribeLifecycleHooksRequest generates a request for the DescribeLifecycleHooks operation. -func (c *AutoScaling) DescribeLifecycleHooksRequest(input *DescribeLifecycleHooksInput) (req *aws.Request, output *DescribeLifecycleHooksOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opDescribeLifecycleHooks == nil { - opDescribeLifecycleHooks = &aws.Operation{ - Name: "DescribeLifecycleHooks", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *AutoScaling) DescribeLifecycleHooksRequest(input *DescribeLifecycleHooksInput) (req *request.Request, output *DescribeLifecycleHooksOutput) { + op := &request.Operation{ + Name: opDescribeLifecycleHooks, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &DescribeLifecycleHooksInput{} } - req = c.newRequest(opDescribeLifecycleHooks, input, output) + req = c.newRequest(op, input, output) output = &DescribeLifecycleHooksOutput{} req.Data = output return @@ -753,68 +687,84 @@ func (c *AutoScaling) DescribeLifecycleHooks(input *DescribeLifecycleHooksInput) return out, err } -var opDescribeLifecycleHooks *aws.Operation +const opDescribeLoadBalancers = "DescribeLoadBalancers" + +// DescribeLoadBalancersRequest generates a request for the DescribeLoadBalancers operation. +func (c *AutoScaling) DescribeLoadBalancersRequest(input *DescribeLoadBalancersInput) (req *request.Request, output *DescribeLoadBalancersOutput) { + op := &request.Operation{ + Name: opDescribeLoadBalancers, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DescribeLoadBalancersInput{} + } + + req = c.newRequest(op, input, output) + output = &DescribeLoadBalancersOutput{} + req.Data = output + return +} + +// Describes the load balancers for the specified Auto Scaling group. +func (c *AutoScaling) DescribeLoadBalancers(input *DescribeLoadBalancersInput) (*DescribeLoadBalancersOutput, error) { + req, out := c.DescribeLoadBalancersRequest(input) + err := req.Send() + return out, err +} + +const opDescribeMetricCollectionTypes = "DescribeMetricCollectionTypes" // DescribeMetricCollectionTypesRequest generates a request for the DescribeMetricCollectionTypes operation. -func (c *AutoScaling) DescribeMetricCollectionTypesRequest(input *DescribeMetricCollectionTypesInput) (req *aws.Request, output *DescribeMetricCollectionTypesOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opDescribeMetricCollectionTypes == nil { - opDescribeMetricCollectionTypes = &aws.Operation{ - Name: "DescribeMetricCollectionTypes", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *AutoScaling) DescribeMetricCollectionTypesRequest(input *DescribeMetricCollectionTypesInput) (req *request.Request, output *DescribeMetricCollectionTypesOutput) { + op := &request.Operation{ + Name: opDescribeMetricCollectionTypes, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &DescribeMetricCollectionTypesInput{} } - req = c.newRequest(opDescribeMetricCollectionTypes, input, output) + req = c.newRequest(op, input, output) output = &DescribeMetricCollectionTypesOutput{} req.Data = output return } -// Returns a list of metrics and a corresponding list of granularities for each -// metric. +// Describes the available CloudWatch metrics for Auto Scaling. // -// The GroupStandbyInstances metric is not returned by default. You must explicitly -// request it when calling EnableMetricsCollection. +// Note that the GroupStandbyInstances metric is not returned by default. You +// must explicitly request this metric when calling EnableMetricsCollection. func (c *AutoScaling) DescribeMetricCollectionTypes(input *DescribeMetricCollectionTypesInput) (*DescribeMetricCollectionTypesOutput, error) { req, out := c.DescribeMetricCollectionTypesRequest(input) err := req.Send() return out, err } -var opDescribeMetricCollectionTypes *aws.Operation +const opDescribeNotificationConfigurations = "DescribeNotificationConfigurations" // DescribeNotificationConfigurationsRequest generates a request for the DescribeNotificationConfigurations operation. -func (c *AutoScaling) DescribeNotificationConfigurationsRequest(input *DescribeNotificationConfigurationsInput) (req *aws.Request, output *DescribeNotificationConfigurationsOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opDescribeNotificationConfigurations == nil { - opDescribeNotificationConfigurations = &aws.Operation{ - Name: "DescribeNotificationConfigurations", - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &aws.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxRecords", - TruncationToken: "", - }, - } +func (c *AutoScaling) DescribeNotificationConfigurationsRequest(input *DescribeNotificationConfigurationsInput) (req *request.Request, output *DescribeNotificationConfigurationsOutput) { + op := &request.Operation{ + Name: opDescribeNotificationConfigurations, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxRecords", + TruncationToken: "", + }, } if input == nil { input = &DescribeNotificationConfigurationsInput{} } - req = c.newRequest(opDescribeNotificationConfigurations, input, output) + req = c.newRequest(op, input, output) output = &DescribeNotificationConfigurationsOutput{} req.Data = output return @@ -835,42 +785,33 @@ func (c *AutoScaling) DescribeNotificationConfigurationsPages(input *DescribeNot }) } -var opDescribeNotificationConfigurations *aws.Operation +const opDescribePolicies = "DescribePolicies" // DescribePoliciesRequest generates a request for the DescribePolicies operation. -func (c *AutoScaling) DescribePoliciesRequest(input *DescribePoliciesInput) (req *aws.Request, output *DescribePoliciesOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opDescribePolicies == nil { - opDescribePolicies = &aws.Operation{ - Name: "DescribePolicies", - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &aws.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxRecords", - TruncationToken: "", - }, - } +func (c *AutoScaling) DescribePoliciesRequest(input *DescribePoliciesInput) (req *request.Request, output *DescribePoliciesOutput) { + op := &request.Operation{ + Name: opDescribePolicies, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxRecords", + TruncationToken: "", + }, } if input == nil { input = &DescribePoliciesInput{} } - req = c.newRequest(opDescribePolicies, input, output) + req = c.newRequest(op, input, output) output = &DescribePoliciesOutput{} req.Data = output return } // Describes the policies for the specified Auto Scaling group. -// -// You can specify a maximum number of items to be returned with a single call. -// If there are more items to return, the call returns a token. To get the next -// set of items, repeat the call with the returned token in the NextToken parameter. func (c *AutoScaling) DescribePolicies(input *DescribePoliciesInput) (*DescribePoliciesOutput, error) { req, out := c.DescribePoliciesRequest(input) err := req.Send() @@ -884,32 +825,27 @@ func (c *AutoScaling) DescribePoliciesPages(input *DescribePoliciesInput, fn fun }) } -var opDescribePolicies *aws.Operation +const opDescribeScalingActivities = "DescribeScalingActivities" // DescribeScalingActivitiesRequest generates a request for the DescribeScalingActivities operation. -func (c *AutoScaling) DescribeScalingActivitiesRequest(input *DescribeScalingActivitiesInput) (req *aws.Request, output *DescribeScalingActivitiesOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opDescribeScalingActivities == nil { - opDescribeScalingActivities = &aws.Operation{ - Name: "DescribeScalingActivities", - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &aws.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxRecords", - TruncationToken: "", - }, - } +func (c *AutoScaling) DescribeScalingActivitiesRequest(input *DescribeScalingActivitiesInput) (req *request.Request, output *DescribeScalingActivitiesOutput) { + op := &request.Operation{ + Name: opDescribeScalingActivities, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxRecords", + TruncationToken: "", + }, } if input == nil { input = &DescribeScalingActivitiesInput{} } - req = c.newRequest(opDescribeScalingActivities, input, output) + req = c.newRequest(op, input, output) output = &DescribeScalingActivitiesOutput{} req.Data = output return @@ -919,10 +855,6 @@ func (c *AutoScaling) DescribeScalingActivitiesRequest(input *DescribeScalingAct // If you omit the ActivityIds, the call returns all activities from the past // six weeks. Activities are sorted by the start time. Activities still in progress // appear first on the list. -// -// You can specify a maximum number of items to be returned with a single call. -// If there are more items to return, the call returns a token. To get the next -// set of items, repeat the call with the returned token in the NextToken parameter. func (c *AutoScaling) DescribeScalingActivities(input *DescribeScalingActivitiesInput) (*DescribeScalingActivitiesOutput, error) { req, out := c.DescribeScalingActivitiesRequest(input) err := req.Send() @@ -936,72 +868,61 @@ func (c *AutoScaling) DescribeScalingActivitiesPages(input *DescribeScalingActiv }) } -var opDescribeScalingActivities *aws.Operation +const opDescribeScalingProcessTypes = "DescribeScalingProcessTypes" // DescribeScalingProcessTypesRequest generates a request for the DescribeScalingProcessTypes operation. -func (c *AutoScaling) DescribeScalingProcessTypesRequest(input *DescribeScalingProcessTypesInput) (req *aws.Request, output *DescribeScalingProcessTypesOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opDescribeScalingProcessTypes == nil { - opDescribeScalingProcessTypes = &aws.Operation{ - Name: "DescribeScalingProcessTypes", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *AutoScaling) DescribeScalingProcessTypesRequest(input *DescribeScalingProcessTypesInput) (req *request.Request, output *DescribeScalingProcessTypesOutput) { + op := &request.Operation{ + Name: opDescribeScalingProcessTypes, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &DescribeScalingProcessTypesInput{} } - req = c.newRequest(opDescribeScalingProcessTypes, input, output) + req = c.newRequest(op, input, output) output = &DescribeScalingProcessTypesOutput{} req.Data = output return } -// Returns scaling process types for use in the ResumeProcesses and SuspendProcesses -// actions. +// Describes the scaling process types for use with ResumeProcesses and SuspendProcesses. func (c *AutoScaling) DescribeScalingProcessTypes(input *DescribeScalingProcessTypesInput) (*DescribeScalingProcessTypesOutput, error) { req, out := c.DescribeScalingProcessTypesRequest(input) err := req.Send() return out, err } -var opDescribeScalingProcessTypes *aws.Operation +const opDescribeScheduledActions = "DescribeScheduledActions" // DescribeScheduledActionsRequest generates a request for the DescribeScheduledActions operation. -func (c *AutoScaling) DescribeScheduledActionsRequest(input *DescribeScheduledActionsInput) (req *aws.Request, output *DescribeScheduledActionsOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opDescribeScheduledActions == nil { - opDescribeScheduledActions = &aws.Operation{ - Name: "DescribeScheduledActions", - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &aws.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxRecords", - TruncationToken: "", - }, - } +func (c *AutoScaling) DescribeScheduledActionsRequest(input *DescribeScheduledActionsInput) (req *request.Request, output *DescribeScheduledActionsOutput) { + op := &request.Operation{ + Name: opDescribeScheduledActions, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxRecords", + TruncationToken: "", + }, } if input == nil { input = &DescribeScheduledActionsInput{} } - req = c.newRequest(opDescribeScheduledActions, input, output) + req = c.newRequest(op, input, output) output = &DescribeScheduledActionsOutput{} req.Data = output return } -// Lists the actions scheduled for your Auto Scaling group that haven't been -// executed. To list the actions that were already executed, use DescribeScalingActivities. +// Describes the actions scheduled for your Auto Scaling group that haven't +// run. To describe the actions that have already run, use DescribeScalingActivities. func (c *AutoScaling) DescribeScheduledActions(input *DescribeScheduledActionsInput) (*DescribeScheduledActionsOutput, error) { req, out := c.DescribeScheduledActionsRequest(input) err := req.Send() @@ -1015,32 +936,27 @@ func (c *AutoScaling) DescribeScheduledActionsPages(input *DescribeScheduledActi }) } -var opDescribeScheduledActions *aws.Operation +const opDescribeTags = "DescribeTags" // DescribeTagsRequest generates a request for the DescribeTags operation. -func (c *AutoScaling) DescribeTagsRequest(input *DescribeTagsInput) (req *aws.Request, output *DescribeTagsOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opDescribeTags == nil { - opDescribeTags = &aws.Operation{ - Name: "DescribeTags", - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &aws.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxRecords", - TruncationToken: "", - }, - } +func (c *AutoScaling) DescribeTagsRequest(input *DescribeTagsInput) (req *request.Request, output *DescribeTagsOutput) { + op := &request.Operation{ + Name: opDescribeTags, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxRecords", + TruncationToken: "", + }, } if input == nil { input = &DescribeTagsInput{} } - req = c.newRequest(opDescribeTags, input, output) + req = c.newRequest(op, input, output) output = &DescribeTagsOutput{} req.Data = output return @@ -1069,58 +985,48 @@ func (c *AutoScaling) DescribeTagsPages(input *DescribeTagsInput, fn func(p *Des }) } -var opDescribeTags *aws.Operation +const opDescribeTerminationPolicyTypes = "DescribeTerminationPolicyTypes" // DescribeTerminationPolicyTypesRequest generates a request for the DescribeTerminationPolicyTypes operation. -func (c *AutoScaling) DescribeTerminationPolicyTypesRequest(input *DescribeTerminationPolicyTypesInput) (req *aws.Request, output *DescribeTerminationPolicyTypesOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opDescribeTerminationPolicyTypes == nil { - opDescribeTerminationPolicyTypes = &aws.Operation{ - Name: "DescribeTerminationPolicyTypes", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *AutoScaling) DescribeTerminationPolicyTypesRequest(input *DescribeTerminationPolicyTypesInput) (req *request.Request, output *DescribeTerminationPolicyTypesOutput) { + op := &request.Operation{ + Name: opDescribeTerminationPolicyTypes, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &DescribeTerminationPolicyTypesInput{} } - req = c.newRequest(opDescribeTerminationPolicyTypes, input, output) + req = c.newRequest(op, input, output) output = &DescribeTerminationPolicyTypesOutput{} req.Data = output return } -// Lists the termination policies supported by Auto Scaling. +// Describes the termination policies supported by Auto Scaling. func (c *AutoScaling) DescribeTerminationPolicyTypes(input *DescribeTerminationPolicyTypesInput) (*DescribeTerminationPolicyTypesOutput, error) { req, out := c.DescribeTerminationPolicyTypesRequest(input) err := req.Send() return out, err } -var opDescribeTerminationPolicyTypes *aws.Operation +const opDetachInstances = "DetachInstances" // DetachInstancesRequest generates a request for the DetachInstances operation. -func (c *AutoScaling) DetachInstancesRequest(input *DetachInstancesInput) (req *aws.Request, output *DetachInstancesOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opDetachInstances == nil { - opDetachInstances = &aws.Operation{ - Name: "DetachInstances", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *AutoScaling) DetachInstancesRequest(input *DetachInstancesInput) (req *request.Request, output *DetachInstancesOutput) { + op := &request.Operation{ + Name: opDetachInstances, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &DetachInstancesInput{} } - req = c.newRequest(opDetachInstances, input, output) + req = c.newRequest(op, input, output) output = &DetachInstancesOutput{} req.Data = output return @@ -1139,26 +1045,53 @@ func (c *AutoScaling) DetachInstances(input *DetachInstancesInput) (*DetachInsta return out, err } -var opDetachInstances *aws.Operation +const opDetachLoadBalancers = "DetachLoadBalancers" + +// DetachLoadBalancersRequest generates a request for the DetachLoadBalancers operation. +func (c *AutoScaling) DetachLoadBalancersRequest(input *DetachLoadBalancersInput) (req *request.Request, output *DetachLoadBalancersOutput) { + op := &request.Operation{ + Name: opDetachLoadBalancers, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DetachLoadBalancersInput{} + } + + req = c.newRequest(op, input, output) + output = &DetachLoadBalancersOutput{} + req.Data = output + return +} + +// Removes one or more load balancers from the specified Auto Scaling group. +// +// When you detach a load balancer, it enters the Removing state while deregistering +// the instances in the group. When all instances are deregistered, then you +// can no longer describe the load balancer using DescribeLoadBalancers. Note +// that the instances remain running. +func (c *AutoScaling) DetachLoadBalancers(input *DetachLoadBalancersInput) (*DetachLoadBalancersOutput, error) { + req, out := c.DetachLoadBalancersRequest(input) + err := req.Send() + return out, err +} + +const opDisableMetricsCollection = "DisableMetricsCollection" // DisableMetricsCollectionRequest generates a request for the DisableMetricsCollection operation. -func (c *AutoScaling) DisableMetricsCollectionRequest(input *DisableMetricsCollectionInput) (req *aws.Request, output *DisableMetricsCollectionOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opDisableMetricsCollection == nil { - opDisableMetricsCollection = &aws.Operation{ - Name: "DisableMetricsCollection", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *AutoScaling) DisableMetricsCollectionRequest(input *DisableMetricsCollectionInput) (req *request.Request, output *DisableMetricsCollectionOutput) { + op := &request.Operation{ + Name: opDisableMetricsCollection, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &DisableMetricsCollectionInput{} } - req = c.newRequest(opDisableMetricsCollection, input, output) + req = c.newRequest(op, input, output) output = &DisableMetricsCollectionOutput{} req.Data = output return @@ -1172,26 +1105,21 @@ func (c *AutoScaling) DisableMetricsCollection(input *DisableMetricsCollectionIn return out, err } -var opDisableMetricsCollection *aws.Operation +const opEnableMetricsCollection = "EnableMetricsCollection" // EnableMetricsCollectionRequest generates a request for the EnableMetricsCollection operation. -func (c *AutoScaling) EnableMetricsCollectionRequest(input *EnableMetricsCollectionInput) (req *aws.Request, output *EnableMetricsCollectionOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opEnableMetricsCollection == nil { - opEnableMetricsCollection = &aws.Operation{ - Name: "EnableMetricsCollection", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *AutoScaling) EnableMetricsCollectionRequest(input *EnableMetricsCollectionInput) (req *request.Request, output *EnableMetricsCollectionOutput) { + op := &request.Operation{ + Name: opEnableMetricsCollection, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &EnableMetricsCollectionInput{} } - req = c.newRequest(opEnableMetricsCollection, input, output) + req = c.newRequest(op, input, output) output = &EnableMetricsCollectionOutput{} req.Data = output return @@ -1208,26 +1136,21 @@ func (c *AutoScaling) EnableMetricsCollection(input *EnableMetricsCollectionInpu return out, err } -var opEnableMetricsCollection *aws.Operation +const opEnterStandby = "EnterStandby" // EnterStandbyRequest generates a request for the EnterStandby operation. -func (c *AutoScaling) EnterStandbyRequest(input *EnterStandbyInput) (req *aws.Request, output *EnterStandbyOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opEnterStandby == nil { - opEnterStandby = &aws.Operation{ - Name: "EnterStandby", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *AutoScaling) EnterStandbyRequest(input *EnterStandbyInput) (req *request.Request, output *EnterStandbyOutput) { + op := &request.Operation{ + Name: opEnterStandby, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &EnterStandbyInput{} } - req = c.newRequest(opEnterStandby, input, output) + req = c.newRequest(op, input, output) output = &EnterStandbyOutput{} req.Data = output return @@ -1243,26 +1166,21 @@ func (c *AutoScaling) EnterStandby(input *EnterStandbyInput) (*EnterStandbyOutpu return out, err } -var opEnterStandby *aws.Operation +const opExecutePolicy = "ExecutePolicy" // ExecutePolicyRequest generates a request for the ExecutePolicy operation. -func (c *AutoScaling) ExecutePolicyRequest(input *ExecutePolicyInput) (req *aws.Request, output *ExecutePolicyOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opExecutePolicy == nil { - opExecutePolicy = &aws.Operation{ - Name: "ExecutePolicy", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *AutoScaling) ExecutePolicyRequest(input *ExecutePolicyInput) (req *request.Request, output *ExecutePolicyOutput) { + op := &request.Operation{ + Name: opExecutePolicy, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &ExecutePolicyInput{} } - req = c.newRequest(opExecutePolicy, input, output) + req = c.newRequest(op, input, output) output = &ExecutePolicyOutput{} req.Data = output return @@ -1275,26 +1193,21 @@ func (c *AutoScaling) ExecutePolicy(input *ExecutePolicyInput) (*ExecutePolicyOu return out, err } -var opExecutePolicy *aws.Operation +const opExitStandby = "ExitStandby" // ExitStandbyRequest generates a request for the ExitStandby operation. -func (c *AutoScaling) ExitStandbyRequest(input *ExitStandbyInput) (req *aws.Request, output *ExitStandbyOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opExitStandby == nil { - opExitStandby = &aws.Operation{ - Name: "ExitStandby", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *AutoScaling) ExitStandbyRequest(input *ExitStandbyInput) (req *request.Request, output *ExitStandbyOutput) { + op := &request.Operation{ + Name: opExitStandby, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &ExitStandbyInput{} } - req = c.newRequest(opExitStandby, input, output) + req = c.newRequest(op, input, output) output = &ExitStandbyOutput{} req.Data = output return @@ -1310,26 +1223,21 @@ func (c *AutoScaling) ExitStandby(input *ExitStandbyInput) (*ExitStandbyOutput, return out, err } -var opExitStandby *aws.Operation +const opPutLifecycleHook = "PutLifecycleHook" // PutLifecycleHookRequest generates a request for the PutLifecycleHook operation. -func (c *AutoScaling) PutLifecycleHookRequest(input *PutLifecycleHookInput) (req *aws.Request, output *PutLifecycleHookOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opPutLifecycleHook == nil { - opPutLifecycleHook = &aws.Operation{ - Name: "PutLifecycleHook", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *AutoScaling) PutLifecycleHookRequest(input *PutLifecycleHookInput) (req *request.Request, output *PutLifecycleHookOutput) { + op := &request.Operation{ + Name: opPutLifecycleHook, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &PutLifecycleHookInput{} } - req = c.newRequest(opPutLifecycleHook, input, output) + req = c.newRequest(op, input, output) output = &PutLifecycleHookOutput{} req.Data = output return @@ -1353,32 +1261,32 @@ func (c *AutoScaling) PutLifecycleHookRequest(input *PutLifecycleHookInput) (req // action. For more information, see Auto Scaling Pending State (http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/AutoScalingPendingState.html) // and Auto Scaling Terminating State (http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/AutoScalingTerminatingState.html) // in the Auto Scaling Developer Guide. +// +// If you exceed your maximum limit of lifecycle hooks, which by default is +// 50 per region, the call fails. For information about updating this limit, +// see AWS Service Limits (http://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html) +// in the Amazon Web Services General Reference. func (c *AutoScaling) PutLifecycleHook(input *PutLifecycleHookInput) (*PutLifecycleHookOutput, error) { req, out := c.PutLifecycleHookRequest(input) err := req.Send() return out, err } -var opPutLifecycleHook *aws.Operation +const opPutNotificationConfiguration = "PutNotificationConfiguration" // PutNotificationConfigurationRequest generates a request for the PutNotificationConfiguration operation. -func (c *AutoScaling) PutNotificationConfigurationRequest(input *PutNotificationConfigurationInput) (req *aws.Request, output *PutNotificationConfigurationOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opPutNotificationConfiguration == nil { - opPutNotificationConfiguration = &aws.Operation{ - Name: "PutNotificationConfiguration", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *AutoScaling) PutNotificationConfigurationRequest(input *PutNotificationConfigurationInput) (req *request.Request, output *PutNotificationConfigurationOutput) { + op := &request.Operation{ + Name: opPutNotificationConfiguration, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &PutNotificationConfigurationInput{} } - req = c.newRequest(opPutNotificationConfiguration, input, output) + req = c.newRequest(op, input, output) output = &PutNotificationConfigurationOutput{} req.Data = output return @@ -1399,26 +1307,21 @@ func (c *AutoScaling) PutNotificationConfiguration(input *PutNotificationConfigu return out, err } -var opPutNotificationConfiguration *aws.Operation +const opPutScalingPolicy = "PutScalingPolicy" // PutScalingPolicyRequest generates a request for the PutScalingPolicy operation. -func (c *AutoScaling) PutScalingPolicyRequest(input *PutScalingPolicyInput) (req *aws.Request, output *PutScalingPolicyOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opPutScalingPolicy == nil { - opPutScalingPolicy = &aws.Operation{ - Name: "PutScalingPolicy", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *AutoScaling) PutScalingPolicyRequest(input *PutScalingPolicyInput) (req *request.Request, output *PutScalingPolicyOutput) { + op := &request.Operation{ + Name: opPutScalingPolicy, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &PutScalingPolicyInput{} } - req = c.newRequest(opPutScalingPolicy, input, output) + req = c.newRequest(op, input, output) output = &PutScalingPolicyOutput{} req.Data = output return @@ -1428,32 +1331,32 @@ func (c *AutoScaling) PutScalingPolicyRequest(input *PutScalingPolicyInput) (req // policy, use the existing policy name and set the parameters you want to change. // Any existing parameter not changed in an update to an existing policy is // not changed in this update request. +// +// If you exceed your maximum limit of step adjustments, which by default is +// 20 per region, the call fails. For information about updating this limit, +// see AWS Service Limits (http://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html) +// in the Amazon Web Services General Reference. func (c *AutoScaling) PutScalingPolicy(input *PutScalingPolicyInput) (*PutScalingPolicyOutput, error) { req, out := c.PutScalingPolicyRequest(input) err := req.Send() return out, err } -var opPutScalingPolicy *aws.Operation +const opPutScheduledUpdateGroupAction = "PutScheduledUpdateGroupAction" // PutScheduledUpdateGroupActionRequest generates a request for the PutScheduledUpdateGroupAction operation. -func (c *AutoScaling) PutScheduledUpdateGroupActionRequest(input *PutScheduledUpdateGroupActionInput) (req *aws.Request, output *PutScheduledUpdateGroupActionOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opPutScheduledUpdateGroupAction == nil { - opPutScheduledUpdateGroupAction = &aws.Operation{ - Name: "PutScheduledUpdateGroupAction", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *AutoScaling) PutScheduledUpdateGroupActionRequest(input *PutScheduledUpdateGroupActionInput) (req *request.Request, output *PutScheduledUpdateGroupActionOutput) { + op := &request.Operation{ + Name: opPutScheduledUpdateGroupAction, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &PutScheduledUpdateGroupActionInput{} } - req = c.newRequest(opPutScheduledUpdateGroupAction, input, output) + req = c.newRequest(op, input, output) output = &PutScheduledUpdateGroupActionOutput{} req.Data = output return @@ -1465,35 +1368,27 @@ func (c *AutoScaling) PutScheduledUpdateGroupActionRequest(input *PutScheduledUp // // For more information, see Scheduled Scaling (http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/schedule_time.html) // in the Auto Scaling Developer Guide. -// -// Auto Scaling supports the date and time expressed in "YYYY-MM-DDThh:mm:ssZ" -// format in UTC/GMT only. func (c *AutoScaling) PutScheduledUpdateGroupAction(input *PutScheduledUpdateGroupActionInput) (*PutScheduledUpdateGroupActionOutput, error) { req, out := c.PutScheduledUpdateGroupActionRequest(input) err := req.Send() return out, err } -var opPutScheduledUpdateGroupAction *aws.Operation +const opRecordLifecycleActionHeartbeat = "RecordLifecycleActionHeartbeat" // RecordLifecycleActionHeartbeatRequest generates a request for the RecordLifecycleActionHeartbeat operation. -func (c *AutoScaling) RecordLifecycleActionHeartbeatRequest(input *RecordLifecycleActionHeartbeatInput) (req *aws.Request, output *RecordLifecycleActionHeartbeatOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opRecordLifecycleActionHeartbeat == nil { - opRecordLifecycleActionHeartbeat = &aws.Operation{ - Name: "RecordLifecycleActionHeartbeat", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *AutoScaling) RecordLifecycleActionHeartbeatRequest(input *RecordLifecycleActionHeartbeatInput) (req *request.Request, output *RecordLifecycleActionHeartbeatOutput) { + op := &request.Operation{ + Name: opRecordLifecycleActionHeartbeat, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &RecordLifecycleActionHeartbeatInput{} } - req = c.newRequest(opRecordLifecycleActionHeartbeat, input, output) + req = c.newRequest(op, input, output) output = &RecordLifecycleActionHeartbeatOutput{} req.Data = output return @@ -1521,26 +1416,21 @@ func (c *AutoScaling) RecordLifecycleActionHeartbeat(input *RecordLifecycleActio return out, err } -var opRecordLifecycleActionHeartbeat *aws.Operation +const opResumeProcesses = "ResumeProcesses" // ResumeProcessesRequest generates a request for the ResumeProcesses operation. -func (c *AutoScaling) ResumeProcessesRequest(input *ScalingProcessQuery) (req *aws.Request, output *ResumeProcessesOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opResumeProcesses == nil { - opResumeProcesses = &aws.Operation{ - Name: "ResumeProcesses", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *AutoScaling) ResumeProcessesRequest(input *ScalingProcessQuery) (req *request.Request, output *ResumeProcessesOutput) { + op := &request.Operation{ + Name: opResumeProcesses, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &ScalingProcessQuery{} } - req = c.newRequest(opResumeProcesses, input, output) + req = c.newRequest(op, input, output) output = &ResumeProcessesOutput{} req.Data = output return @@ -1557,58 +1447,51 @@ func (c *AutoScaling) ResumeProcesses(input *ScalingProcessQuery) (*ResumeProces return out, err } -var opResumeProcesses *aws.Operation +const opSetDesiredCapacity = "SetDesiredCapacity" // SetDesiredCapacityRequest generates a request for the SetDesiredCapacity operation. -func (c *AutoScaling) SetDesiredCapacityRequest(input *SetDesiredCapacityInput) (req *aws.Request, output *SetDesiredCapacityOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opSetDesiredCapacity == nil { - opSetDesiredCapacity = &aws.Operation{ - Name: "SetDesiredCapacity", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *AutoScaling) SetDesiredCapacityRequest(input *SetDesiredCapacityInput) (req *request.Request, output *SetDesiredCapacityOutput) { + op := &request.Operation{ + Name: opSetDesiredCapacity, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &SetDesiredCapacityInput{} } - req = c.newRequest(opSetDesiredCapacity, input, output) + req = c.newRequest(op, input, output) output = &SetDesiredCapacityOutput{} req.Data = output return } -// Sets the size of the specified AutoScalingGroup. +// Sets the size of the specified Auto Scaling group. +// +// For more information about desired capacity, see What Is Auto Scaling? (http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/WhatIsAutoScaling.html) +// in the Auto Scaling Developer Guide. func (c *AutoScaling) SetDesiredCapacity(input *SetDesiredCapacityInput) (*SetDesiredCapacityOutput, error) { req, out := c.SetDesiredCapacityRequest(input) err := req.Send() return out, err } -var opSetDesiredCapacity *aws.Operation +const opSetInstanceHealth = "SetInstanceHealth" // SetInstanceHealthRequest generates a request for the SetInstanceHealth operation. -func (c *AutoScaling) SetInstanceHealthRequest(input *SetInstanceHealthInput) (req *aws.Request, output *SetInstanceHealthOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opSetInstanceHealth == nil { - opSetInstanceHealth = &aws.Operation{ - Name: "SetInstanceHealth", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *AutoScaling) SetInstanceHealthRequest(input *SetInstanceHealthInput) (req *request.Request, output *SetInstanceHealthOutput) { + op := &request.Operation{ + Name: opSetInstanceHealth, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &SetInstanceHealthInput{} } - req = c.newRequest(opSetInstanceHealth, input, output) + req = c.newRequest(op, input, output) output = &SetInstanceHealthOutput{} req.Data = output return @@ -1624,26 +1507,21 @@ func (c *AutoScaling) SetInstanceHealth(input *SetInstanceHealthInput) (*SetInst return out, err } -var opSetInstanceHealth *aws.Operation +const opSuspendProcesses = "SuspendProcesses" // SuspendProcessesRequest generates a request for the SuspendProcesses operation. -func (c *AutoScaling) SuspendProcessesRequest(input *ScalingProcessQuery) (req *aws.Request, output *SuspendProcessesOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opSuspendProcesses == nil { - opSuspendProcesses = &aws.Operation{ - Name: "SuspendProcesses", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *AutoScaling) SuspendProcessesRequest(input *ScalingProcessQuery) (req *request.Request, output *SuspendProcessesOutput) { + op := &request.Operation{ + Name: opSuspendProcesses, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &ScalingProcessQuery{} } - req = c.newRequest(opSuspendProcesses, input, output) + req = c.newRequest(op, input, output) output = &SuspendProcessesOutput{} req.Data = output return @@ -1666,26 +1544,21 @@ func (c *AutoScaling) SuspendProcesses(input *ScalingProcessQuery) (*SuspendProc return out, err } -var opSuspendProcesses *aws.Operation +const opTerminateInstanceInAutoScalingGroup = "TerminateInstanceInAutoScalingGroup" // TerminateInstanceInAutoScalingGroupRequest generates a request for the TerminateInstanceInAutoScalingGroup operation. -func (c *AutoScaling) TerminateInstanceInAutoScalingGroupRequest(input *TerminateInstanceInAutoScalingGroupInput) (req *aws.Request, output *TerminateInstanceInAutoScalingGroupOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opTerminateInstanceInAutoScalingGroup == nil { - opTerminateInstanceInAutoScalingGroup = &aws.Operation{ - Name: "TerminateInstanceInAutoScalingGroup", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *AutoScaling) TerminateInstanceInAutoScalingGroupRequest(input *TerminateInstanceInAutoScalingGroupInput) (req *request.Request, output *TerminateInstanceInAutoScalingGroupOutput) { + op := &request.Operation{ + Name: opTerminateInstanceInAutoScalingGroup, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &TerminateInstanceInAutoScalingGroupInput{} } - req = c.newRequest(opTerminateInstanceInAutoScalingGroup, input, output) + req = c.newRequest(op, input, output) output = &TerminateInstanceInAutoScalingGroupOutput{} req.Data = output return @@ -1702,96 +1575,89 @@ func (c *AutoScaling) TerminateInstanceInAutoScalingGroup(input *TerminateInstan return out, err } -var opTerminateInstanceInAutoScalingGroup *aws.Operation +const opUpdateAutoScalingGroup = "UpdateAutoScalingGroup" // UpdateAutoScalingGroupRequest generates a request for the UpdateAutoScalingGroup operation. -func (c *AutoScaling) UpdateAutoScalingGroupRequest(input *UpdateAutoScalingGroupInput) (req *aws.Request, output *UpdateAutoScalingGroupOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opUpdateAutoScalingGroup == nil { - opUpdateAutoScalingGroup = &aws.Operation{ - Name: "UpdateAutoScalingGroup", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *AutoScaling) UpdateAutoScalingGroupRequest(input *UpdateAutoScalingGroupInput) (req *request.Request, output *UpdateAutoScalingGroupOutput) { + op := &request.Operation{ + Name: opUpdateAutoScalingGroup, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &UpdateAutoScalingGroupInput{} } - req = c.newRequest(opUpdateAutoScalingGroup, input, output) + req = c.newRequest(op, input, output) output = &UpdateAutoScalingGroupOutput{} req.Data = output return } -// Updates the configuration for the specified AutoScalingGroup. +// Updates the configuration for the specified Auto Scaling group. // -// To update an Auto Scaling group with a launch configuration that has the -// InstanceMonitoring flag set to False, you must first ensure that collection -// of group metrics is disabled. Otherwise, calls to UpdateAutoScalingGroup -// will fail. If you have previously enabled group metrics collection, you can -// disable collection of all group metrics by calling DisableMetricsCollection. +// To update an Auto Scaling group with a launch configuration with InstanceMonitoring +// set to False, you must first disable the collection of group metrics. Otherwise, +// you will get an error. If you have previously enabled the collection of group +// metrics, you can disable it using DisableMetricsCollection. // -// The new settings are registered upon the completion of this call. Any -// launch configuration settings take effect on any triggers after this call -// returns. Scaling activities that are currently in progress aren't affected. +// The new settings are registered upon the completion of this call. Any launch +// configuration settings take effect on any triggers after this call returns. +// Scaling activities that are currently in progress aren't affected. // -// If a new value is specified for MinSize without specifying the value -// for DesiredCapacity, and if the new MinSize is larger than the current size -// of the Auto Scaling group, there will be an implicit call to SetDesiredCapacity -// to set the group to the new MinSize. +// Note the following: // -// If a new value is specified for MaxSize without specifying the value for +// If you specify a new value for MinSize without specifying a value for +// DesiredCapacity, and the new MinSize is larger than the current size of the +// group, we implicitly call SetDesiredCapacity to set the size of the group +// to the new value of MinSize. +// +// If you specify a new value for MaxSize without specifying a value for // DesiredCapacity, and the new MaxSize is smaller than the current size of -// the Auto Scaling group, there will be an implicit call to SetDesiredCapacity -// to set the group to the new MaxSize. +// the group, we implicitly call SetDesiredCapacity to set the size of the group +// to the new value of MaxSize. // -// All other optional parameters are left unchanged if not passed in the -// request. +// All other optional parameters are left unchanged if not specified. func (c *AutoScaling) UpdateAutoScalingGroup(input *UpdateAutoScalingGroupInput) (*UpdateAutoScalingGroupOutput, error) { req, out := c.UpdateAutoScalingGroupRequest(input) err := req.Send() return out, err } -var opUpdateAutoScalingGroup *aws.Operation - -// Describes a long-running process that represents a change to your Auto Scaling -// group, such as changing its size. This can also be a process to replace an -// instance, or a process to perform any other long-running operations. +// Describes scaling activity, which is a long-running process that represents +// a change to your Auto Scaling group, such as changing its size or replacing +// an instance. type Activity struct { // The ID of the activity. - ActivityID *string `locationName:"ActivityId" type:"string" required:"true"` + ActivityId *string `type:"string" required:"true"` // The name of the Auto Scaling group. - AutoScalingGroupName *string `type:"string" required:"true"` + AutoScalingGroupName *string `min:"1" type:"string" required:"true"` - // The reason the activity was begun. - Cause *string `type:"string" required:"true"` + // The reason the activity began. + Cause *string `min:"1" type:"string" required:"true"` - // A friendly, more verbose description of the scaling activity. + // A friendly, more verbose description of the activity. Description *string `type:"string"` - // The details about the scaling activity. + // The details about the activity. Details *string `type:"string"` - // The end time of this activity. + // The end time of the activity. EndTime *time.Time `type:"timestamp" timestampFormat:"iso8601"` // A value between 0 and 100 that indicates the progress of the activity. Progress *int64 `type:"integer"` - // The start time of this activity. + // The start time of the activity. StartTime *time.Time `type:"timestamp" timestampFormat:"iso8601" required:"true"` // The current status of the activity. - StatusCode *string `type:"string" required:"true"` + StatusCode *string `type:"string" required:"true" enum:"ScalingActivityStatusCode"` // A friendly, more verbose description of the activity status. - StatusMessage *string `type:"string"` + StatusMessage *string `min:"1" type:"string"` metadataActivity `json:"-" xml:"-"` } @@ -1800,14 +1666,24 @@ type metadataActivity struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s Activity) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Activity) GoString() string { + return s.String() +} + // Describes a policy adjustment type. +// +// For more information, see Dynamic Scaling (http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/as-scale-based-on-demand.html) +// in the Auto Scaling Developer Guide. type AdjustmentType struct { // The policy adjustment type. The valid values are ChangeInCapacity, ExactCapacity, // and PercentChangeInCapacity. - // - // For more information, see Dynamic Scaling (http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/as-scale-based-on-demand.html) - // in the Auto Scaling Developer Guide. - AdjustmentType *string `type:"string"` + AdjustmentType *string `min:"1" type:"string"` metadataAdjustmentType `json:"-" xml:"-"` } @@ -1816,13 +1692,23 @@ type metadataAdjustmentType struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s AdjustmentType) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AdjustmentType) GoString() string { + return s.String() +} + // Describes an alarm. type Alarm struct { // The Amazon Resource Name (ARN) of the alarm. - AlarmARN *string `type:"string"` + AlarmARN *string `min:"1" type:"string"` // The name of the alarm. - AlarmName *string `type:"string"` + AlarmName *string `min:"1" type:"string"` metadataAlarm `json:"-" xml:"-"` } @@ -1831,12 +1717,22 @@ type metadataAlarm struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s Alarm) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Alarm) GoString() string { + return s.String() +} + type AttachInstancesInput struct { // The name of the group. - AutoScalingGroupName *string `type:"string" required:"true"` + AutoScalingGroupName *string `min:"1" type:"string" required:"true"` - // One or more EC2 instance IDs. You must specify at least one ID. - InstanceIDs []*string `locationName:"InstanceIds" type:"list"` + // One or more EC2 instance IDs. + InstanceIds []*string `type:"list"` metadataAttachInstancesInput `json:"-" xml:"-"` } @@ -1845,6 +1741,16 @@ type metadataAttachInstancesInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s AttachInstancesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AttachInstancesInput) GoString() string { + return s.String() +} + type AttachInstancesOutput struct { metadataAttachInstancesOutput `json:"-" xml:"-"` } @@ -1853,23 +1759,75 @@ type metadataAttachInstancesOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s AttachInstancesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AttachInstancesOutput) GoString() string { + return s.String() +} + +type AttachLoadBalancersInput struct { + // The name of the group. + AutoScalingGroupName *string `min:"1" type:"string"` + + // One or more load balancer names. + LoadBalancerNames []*string `type:"list"` + + metadataAttachLoadBalancersInput `json:"-" xml:"-"` +} + +type metadataAttachLoadBalancersInput struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s AttachLoadBalancersInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AttachLoadBalancersInput) GoString() string { + return s.String() +} + +type AttachLoadBalancersOutput struct { + metadataAttachLoadBalancersOutput `json:"-" xml:"-"` +} + +type metadataAttachLoadBalancersOutput struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s AttachLoadBalancersOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AttachLoadBalancersOutput) GoString() string { + return s.String() +} + // Describes a block device mapping. type BlockDeviceMapping struct { // The device name exposed to the EC2 instance (for example, /dev/sdh or xvdh). - DeviceName *string `type:"string" required:"true"` + DeviceName *string `min:"1" type:"string" required:"true"` // The information about the Amazon EBS volume. - EBS *EBS `locationName:"Ebs" type:"structure"` + Ebs *Ebs `type:"structure"` // Suppresses a device mapping. // - // If NoDevice is set to true for the root device, the instance might fail - // the EC2 health check. Auto Scaling launches a replacement instance if the - // instance fails the health check. + // If this parameter is true for the root device, the instance might fail the + // EC2 health check. Auto Scaling launches a replacement instance if the instance + // fails the health check. NoDevice *bool `type:"boolean"` // The name of the virtual device, ephemeral0 to ephemeral3. - VirtualName *string `type:"string"` + VirtualName *string `min:"1" type:"string"` metadataBlockDeviceMapping `json:"-" xml:"-"` } @@ -1878,9 +1836,19 @@ type metadataBlockDeviceMapping struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s BlockDeviceMapping) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s BlockDeviceMapping) GoString() string { + return s.String() +} + type CompleteLifecycleActionInput struct { // The name of the group for the lifecycle hook. - AutoScalingGroupName *string `type:"string" required:"true"` + AutoScalingGroupName *string `min:"1" type:"string" required:"true"` // The action for the group to take. This parameter can be either CONTINUE or // ABANDON. @@ -1889,10 +1857,10 @@ type CompleteLifecycleActionInput struct { // A universally unique identifier (UUID) that identifies a specific lifecycle // action associated with an instance. Auto Scaling sends this token to the // notification target you specified when you created the lifecycle hook. - LifecycleActionToken *string `type:"string" required:"true"` + LifecycleActionToken *string `min:"36" type:"string" required:"true"` // The name of the lifecycle hook. - LifecycleHookName *string `type:"string" required:"true"` + LifecycleHookName *string `min:"1" type:"string" required:"true"` metadataCompleteLifecycleActionInput `json:"-" xml:"-"` } @@ -1901,6 +1869,16 @@ type metadataCompleteLifecycleActionInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s CompleteLifecycleActionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CompleteLifecycleActionInput) GoString() string { + return s.String() +} + type CompleteLifecycleActionOutput struct { metadataCompleteLifecycleActionOutput `json:"-" xml:"-"` } @@ -1909,24 +1887,34 @@ type metadataCompleteLifecycleActionOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s CompleteLifecycleActionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CompleteLifecycleActionOutput) GoString() string { + return s.String() +} + type CreateAutoScalingGroupInput struct { // The name of the group. This name must be unique within the scope of your // AWS account. - AutoScalingGroupName *string `type:"string" required:"true"` + AutoScalingGroupName *string `min:"1" type:"string" required:"true"` // One or more Availability Zones for the group. This parameter is optional // if you specify subnets using the VPCZoneIdentifier parameter. - AvailabilityZones []*string `type:"list"` + AvailabilityZones []*string `min:"1" type:"list"` // The amount of time, in seconds, after a scaling activity completes before // another scaling activity can start. // - // If DefaultCooldown is not specified, the default value is 300. For more - // information, see Understanding Auto Scaling Cooldowns (http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/Cooldown.html) + // If this parameter is not specified, the default value is 300. For more information, + // see Understanding Auto Scaling Cooldowns (http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/Cooldown.html) // in the Auto Scaling Developer Guide. DefaultCooldown *int64 `type:"integer"` - // The number of EC2 instances that should be running in the group. This value + // The number of EC2 instances that should be running in the group. This number // must be greater than or equal to the minimum size of the group and less than // or equal to the maximum size of the group. DesiredCapacity *int64 `type:"integer"` @@ -1949,7 +1937,7 @@ type CreateAutoScalingGroupInput struct { // // By default, health checks use Amazon EC2 instance status checks to determine // the health of an instance. For more information, see Health Checks (http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/healthcheck.html). - HealthCheckType *string `type:"string"` + HealthCheckType *string `min:"1" type:"string"` // The ID of the EC2 instance used to create a launch configuration for the // group. Alternatively, use the LaunchConfigurationName parameter to specify @@ -1960,14 +1948,14 @@ type CreateAutoScalingGroupInput struct { // derives its attributes from the specified instance, with the exception of // the block device mapping. // - // For more information, see Create an Auto Scaling Group Using an EC2 Instance - // ID (http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/create-asg-from-instance.html) + // For more information, see Create an Auto Scaling Group from an EC2 Instance + // (http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/create-asg-from-instance.html) // in the Auto Scaling Developer Guide. - InstanceID *string `locationName:"InstanceId" type:"string"` + InstanceId *string `min:"1" type:"string"` // The name of the launch configuration. Alternatively, use the InstanceId parameter // to specify an EC2 instance instead of a launch configuration. - LaunchConfigurationName *string `type:"string"` + LaunchConfigurationName *string `min:"1" type:"string"` // One or more load balancers. // @@ -1982,15 +1970,15 @@ type CreateAutoScalingGroupInput struct { MinSize *int64 `type:"integer" required:"true"` // The name of the placement group into which you'll launch your instances, - // if any. For more information, see Placement Groups (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/placement-groups.html). - PlacementGroup *string `type:"string"` + // if any. For more information, see Placement Groups (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/placement-groups.html) + // in the Amazon Elastic Compute Cloud User Guide. + PlacementGroup *string `min:"1" type:"string"` // The tag to be created or updated. Each tag should be defined by its resource // type, resource ID, key, value, and a propagate flag. Valid values: key=value, // value=value, propagate=true or false. Value and propagate are optional parameters. // - // For more information, see Add, Modify, or Remove Auto Scaling Group Tags - // (http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/ASTagging.html) + // For more information, see Tagging Auto Scaling Groups and Instances (http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/ASTagging.html) // in the Auto Scaling Developer Guide. Tags []*Tag `type:"list"` @@ -2008,9 +1996,10 @@ type CreateAutoScalingGroupInput struct { // If you specify subnets and Availability Zones with this call, ensure that // the subnets' Availability Zones match the Availability Zones specified. // - // For more information, see Auto Scaling and Amazon VPC (http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/autoscalingsubnets.html) + // For more information, see Auto Scaling and Amazon Virtual Private Cloud + // (http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/autoscalingsubnets.html) // in the Auto Scaling Developer Guide. - VPCZoneIdentifier *string `type:"string"` + VPCZoneIdentifier *string `min:"1" type:"string"` metadataCreateAutoScalingGroupInput `json:"-" xml:"-"` } @@ -2019,6 +2008,16 @@ type metadataCreateAutoScalingGroupInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s CreateAutoScalingGroupInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateAutoScalingGroupInput) GoString() string { + return s.String() +} + type CreateAutoScalingGroupOutput struct { metadataCreateAutoScalingGroupOutput `json:"-" xml:"-"` } @@ -2027,20 +2026,30 @@ type metadataCreateAutoScalingGroupOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s CreateAutoScalingGroupOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateAutoScalingGroupOutput) GoString() string { + return s.String() +} + type CreateLaunchConfigurationInput struct { // Used for groups that launch instances into a virtual private cloud (VPC). // Specifies whether to assign a public IP address to each instance. For more - // information, see Auto Scaling and Amazon VPC (http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/autoscalingsubnets.html) + // information, see Auto Scaling and Amazon Virtual Private Cloud (http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/autoscalingsubnets.html) // in the Auto Scaling Developer Guide. // - // If you specify a value for this parameter, be sure to specify at least - // one subnet using the VPCZoneIdentifier parameter when you create your group. + // If you specify a value for this parameter, be sure to specify at least one + // subnet using the VPCZoneIdentifier parameter when you create your group. // - // Default: If the instance is launched into a default subnet, the default + // Default: If the instance is launched into a default subnet, the default // is true. If the instance is launched into a nondefault subnet, the default - // is false. For more information, see Supported Platforms (http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide//as-supported-platforms.html) + // is false. For more information, see Supported Platforms (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-supported-platforms.html) // in the Amazon Elastic Compute Cloud User Guide. - AssociatePublicIPAddress *bool `locationName:"AssociatePublicIpAddress" type:"boolean"` + AssociatePublicIpAddress *bool `type:"boolean"` // One or more mappings that specify how block devices are exposed to the instance. // For more information, see Block Device Mapping (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/block-device-mapping-concepts.html) @@ -2048,14 +2057,14 @@ type CreateLaunchConfigurationInput struct { BlockDeviceMappings []*BlockDeviceMapping `type:"list"` // The ID of a ClassicLink-enabled VPC to link your EC2-Classic instances to. - // This parameter can only be used if you are launching EC2-Classic instances. + // This parameter is supported only if you are launching EC2-Classic instances. // For more information, see ClassicLink (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/vpc-classiclink.html) // in the Amazon Elastic Compute Cloud User Guide. - ClassicLinkVPCID *string `locationName:"ClassicLinkVPCId" type:"string"` + ClassicLinkVPCId *string `min:"1" type:"string"` // The IDs of one or more security groups for the VPC specified in ClassicLinkVPCId. - // This parameter is required if ClassicLinkVPCId is specified, and cannot be - // used otherwise. For more information, see ClassicLink (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/vpc-classiclink.html) + // This parameter is required if ClassicLinkVPCId is specified, and is not supported + // otherwise. For more information, see ClassicLink (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/vpc-classiclink.html) // in the Amazon Elastic Compute Cloud User Guide. ClassicLinkVPCSecurityGroups []*string `type:"list"` @@ -2066,23 +2075,23 @@ type CreateLaunchConfigurationInput struct { // types. Additional usage charges apply. For more information, see Amazon EBS-Optimized // Instances (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSOptimized.html) // in the Amazon Elastic Compute Cloud User Guide. - EBSOptimized *bool `locationName:"EbsOptimized" type:"boolean"` + EbsOptimized *bool `type:"boolean"` // The name or the Amazon Resource Name (ARN) of the instance profile associated // with the IAM role for the instance. // - // Amazon EC2 instances launched with an IAM role will automatically have AWS - // security credentials available. You can use IAM roles with Auto Scaling to - // automatically enable applications running on your Amazon EC2 instances to - // securely access other AWS resources. For more information, see Launch Auto - // Scaling Instances with an IAM Role (http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/us-iam-role.html) + // EC2 instances launched with an IAM role will automatically have AWS security + // credentials available. You can use IAM roles with Auto Scaling to automatically + // enable applications running on your EC2 instances to securely access other + // AWS resources. For more information, see Launch Auto Scaling Instances with + // an IAM Role (http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/us-iam-role.html) // in the Auto Scaling Developer Guide. - IAMInstanceProfile *string `locationName:"IamInstanceProfile" type:"string"` + IamInstanceProfile *string `min:"1" type:"string"` // The ID of the Amazon Machine Image (AMI) to use to launch your EC2 instances. // For more information, see Finding an AMI (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/finding-an-ami.html) // in the Amazon Elastic Compute Cloud User Guide. - ImageID *string `locationName:"ImageId" type:"string"` + ImageId *string `min:"1" type:"string"` // The ID of the EC2 instance to use to create the launch configuration. // @@ -2095,53 +2104,54 @@ type CreateLaunchConfigurationInput struct { // For more information, see Create a Launch Configuration Using an EC2 Instance // (http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/create-lc-with-instanceID.html) // in the Auto Scaling Developer Guide. - InstanceID *string `locationName:"InstanceId" type:"string"` + InstanceId *string `min:"1" type:"string"` // Enables detailed monitoring if it is disabled. Detailed monitoring is enabled // by default. // - // When detailed monitoring is enabled, Amazon Cloudwatch generates metrics + // When detailed monitoring is enabled, Amazon CloudWatch generates metrics // every minute and your account is charged a fee. When you disable detailed - // monitoring, by specifying False, Cloudwatch generates metrics every 5 minutes. + // monitoring, by specifying False, CloudWatch generates metrics every 5 minutes. // For more information, see Monitor Your Auto Scaling Instances (http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/as-instance-monitoring.html) // in the Auto Scaling Developer Guide. InstanceMonitoring *InstanceMonitoring `type:"structure"` - // The instance type of the Amazon EC2 instance. For information about available - // Amazon EC2 instance types, see Available Instance Types (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html#AvailableInstanceTypes) + // The instance type of the EC2 instance. For information about available instance + // types, see Available Instance Types (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html#AvailableInstanceTypes) // in the Amazon Elastic Cloud Compute User Guide. - InstanceType *string `type:"string"` + InstanceType *string `min:"1" type:"string"` - // The ID of the kernel associated with the Amazon EC2 AMI. - KernelID *string `locationName:"KernelId" type:"string"` + // The ID of the kernel associated with the AMI. + KernelId *string `min:"1" type:"string"` // The name of the key pair. For more information, see Amazon EC2 Key Pairs // (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html) in // the Amazon Elastic Compute Cloud User Guide. - KeyName *string `type:"string"` + KeyName *string `min:"1" type:"string"` // The name of the launch configuration. This name must be unique within the // scope of your AWS account. - LaunchConfigurationName *string `type:"string" required:"true"` + LaunchConfigurationName *string `min:"1" type:"string" required:"true"` // The tenancy of the instance. An instance with a tenancy of dedicated runs - // on single-tenant hardware and can only be launched in a VPC. + // on single-tenant hardware and can only be launched into a VPC. // // You must set the value of this parameter to dedicated if want to launch - // Dedicated Instances in a shared tenancy VPC (VPC with instance placement + // Dedicated Instances into a shared tenancy VPC (VPC with instance placement // tenancy attribute set to default). // // If you specify a value for this parameter, be sure to specify at least one - // VPC subnet using the VPCZoneIdentifier parameter when you create your group. + // subnet using the VPCZoneIdentifier parameter when you create your group. // - // For more information, see Auto Scaling and Amazon VPC (http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/autoscalingsubnets.html) + // For more information, see Auto Scaling and Amazon Virtual Private Cloud + // (http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/autoscalingsubnets.html) // in the Auto Scaling Developer Guide. // // Valid values: default | dedicated - PlacementTenancy *string `type:"string"` + PlacementTenancy *string `min:"1" type:"string"` - // The ID of the RAM disk associated with the Amazon EC2 AMI. - RAMDiskID *string `locationName:"RamdiskId" type:"string"` + // The ID of the RAM disk associated with the AMI. + RamdiskId *string `min:"1" type:"string"` // One or more security groups with which to associate the instances. // @@ -2150,7 +2160,7 @@ type CreateLaunchConfigurationInput struct { // groups for EC2-Classic, see Amazon EC2 Security Groups (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-network-security.html) // in the Amazon Elastic Compute Cloud User Guide. // - // If your instances are launched in a VPC, specify security group IDs. For + // If your instances are launched into a VPC, specify security group IDs. For // more information, see Security Groups for Your VPC (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_SecurityGroups.html) // in the Amazon Virtual Private Cloud User Guide. SecurityGroups []*string `type:"list"` @@ -2160,7 +2170,7 @@ type CreateLaunchConfigurationInput struct { // the current Spot market price. For more information, see Launch Spot Instances // in Your Auto Scaling Group (http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/US-SpotInstances.html) // in the Auto Scaling Developer Guide. - SpotPrice *string `type:"string"` + SpotPrice *string `min:"1" type:"string"` // The user data to make available to the launched EC2 instances. For more information, // see Instance Metadata and User Data (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html) @@ -2177,6 +2187,16 @@ type metadataCreateLaunchConfigurationInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s CreateLaunchConfigurationInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateLaunchConfigurationInput) GoString() string { + return s.String() +} + type CreateLaunchConfigurationOutput struct { metadataCreateLaunchConfigurationOutput `json:"-" xml:"-"` } @@ -2185,22 +2205,18 @@ type metadataCreateLaunchConfigurationOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s CreateLaunchConfigurationOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateLaunchConfigurationOutput) GoString() string { + return s.String() +} + type CreateOrUpdateTagsInput struct { - // The tag to be created or updated. Each tag should be defined by its resource - // type, resource ID, key, value, and a propagate flag. The resource type and - // resource ID identify the type and name of resource for which the tag is created. - // Currently, auto-scaling-group is the only supported resource type. The valid - // value for the resource ID is groupname. - // - // The PropagateAtLaunch flag defines whether the new tag will be applied to - // instances launched by the group. Valid values are true or false. However, - // instances that are already running will not get the new or updated tag. Likewise, - // when you modify a tag, the updated version will be applied only to new instances - // launched by the group after the change. Running instances that had the previous - // version of the tag will continue to have the older tag. - // - // When you create a tag and a tag of the same name already exists, the operation - // overwrites the previous tag definition, but you will not get an error message. + // One or more tags. Tags []*Tag `type:"list" required:"true"` metadataCreateOrUpdateTagsInput `json:"-" xml:"-"` @@ -2210,6 +2226,16 @@ type metadataCreateOrUpdateTagsInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s CreateOrUpdateTagsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateOrUpdateTagsInput) GoString() string { + return s.String() +} + type CreateOrUpdateTagsOutput struct { metadataCreateOrUpdateTagsOutput `json:"-" xml:"-"` } @@ -2218,9 +2244,19 @@ type metadataCreateOrUpdateTagsOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s CreateOrUpdateTagsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateOrUpdateTagsOutput) GoString() string { + return s.String() +} + type DeleteAutoScalingGroupInput struct { // The name of the group to delete. - AutoScalingGroupName *string `type:"string" required:"true"` + AutoScalingGroupName *string `min:"1" type:"string" required:"true"` // Specifies that the group will be deleted along with all instances associated // with the group, without waiting for all instances to be terminated. This @@ -2234,6 +2270,16 @@ type metadataDeleteAutoScalingGroupInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DeleteAutoScalingGroupInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteAutoScalingGroupInput) GoString() string { + return s.String() +} + type DeleteAutoScalingGroupOutput struct { metadataDeleteAutoScalingGroupOutput `json:"-" xml:"-"` } @@ -2242,9 +2288,19 @@ type metadataDeleteAutoScalingGroupOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DeleteAutoScalingGroupOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteAutoScalingGroupOutput) GoString() string { + return s.String() +} + type DeleteLaunchConfigurationInput struct { // The name of the launch configuration. - LaunchConfigurationName *string `type:"string" required:"true"` + LaunchConfigurationName *string `min:"1" type:"string" required:"true"` metadataDeleteLaunchConfigurationInput `json:"-" xml:"-"` } @@ -2253,6 +2309,16 @@ type metadataDeleteLaunchConfigurationInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DeleteLaunchConfigurationInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteLaunchConfigurationInput) GoString() string { + return s.String() +} + type DeleteLaunchConfigurationOutput struct { metadataDeleteLaunchConfigurationOutput `json:"-" xml:"-"` } @@ -2261,12 +2327,22 @@ type metadataDeleteLaunchConfigurationOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DeleteLaunchConfigurationOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteLaunchConfigurationOutput) GoString() string { + return s.String() +} + type DeleteLifecycleHookInput struct { // The name of the Auto Scaling group for the lifecycle hook. - AutoScalingGroupName *string `type:"string" required:"true"` + AutoScalingGroupName *string `min:"1" type:"string" required:"true"` // The name of the lifecycle hook. - LifecycleHookName *string `type:"string" required:"true"` + LifecycleHookName *string `min:"1" type:"string" required:"true"` metadataDeleteLifecycleHookInput `json:"-" xml:"-"` } @@ -2275,6 +2351,16 @@ type metadataDeleteLifecycleHookInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DeleteLifecycleHookInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteLifecycleHookInput) GoString() string { + return s.String() +} + type DeleteLifecycleHookOutput struct { metadataDeleteLifecycleHookOutput `json:"-" xml:"-"` } @@ -2283,13 +2369,23 @@ type metadataDeleteLifecycleHookOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DeleteLifecycleHookOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteLifecycleHookOutput) GoString() string { + return s.String() +} + type DeleteNotificationConfigurationInput struct { // The name of the Auto Scaling group. - AutoScalingGroupName *string `type:"string" required:"true"` + AutoScalingGroupName *string `min:"1" type:"string" required:"true"` // The Amazon Resource Name (ARN) of the Amazon Simple Notification Service // (SNS) topic. - TopicARN *string `type:"string" required:"true"` + TopicARN *string `min:"1" type:"string" required:"true"` metadataDeleteNotificationConfigurationInput `json:"-" xml:"-"` } @@ -2298,6 +2394,16 @@ type metadataDeleteNotificationConfigurationInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DeleteNotificationConfigurationInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteNotificationConfigurationInput) GoString() string { + return s.String() +} + type DeleteNotificationConfigurationOutput struct { metadataDeleteNotificationConfigurationOutput `json:"-" xml:"-"` } @@ -2306,12 +2412,22 @@ type metadataDeleteNotificationConfigurationOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DeleteNotificationConfigurationOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteNotificationConfigurationOutput) GoString() string { + return s.String() +} + type DeletePolicyInput struct { // The name of the Auto Scaling group. - AutoScalingGroupName *string `type:"string"` + AutoScalingGroupName *string `min:"1" type:"string"` // The name or Amazon Resource Name (ARN) of the policy. - PolicyName *string `type:"string" required:"true"` + PolicyName *string `min:"1" type:"string" required:"true"` metadataDeletePolicyInput `json:"-" xml:"-"` } @@ -2320,6 +2436,16 @@ type metadataDeletePolicyInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DeletePolicyInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeletePolicyInput) GoString() string { + return s.String() +} + type DeletePolicyOutput struct { metadataDeletePolicyOutput `json:"-" xml:"-"` } @@ -2328,12 +2454,22 @@ type metadataDeletePolicyOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DeletePolicyOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeletePolicyOutput) GoString() string { + return s.String() +} + type DeleteScheduledActionInput struct { // The name of the Auto Scaling group. - AutoScalingGroupName *string `type:"string"` + AutoScalingGroupName *string `min:"1" type:"string"` // The name of the action to delete. - ScheduledActionName *string `type:"string" required:"true"` + ScheduledActionName *string `min:"1" type:"string" required:"true"` metadataDeleteScheduledActionInput `json:"-" xml:"-"` } @@ -2342,6 +2478,16 @@ type metadataDeleteScheduledActionInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DeleteScheduledActionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteScheduledActionInput) GoString() string { + return s.String() +} + type DeleteScheduledActionOutput struct { metadataDeleteScheduledActionOutput `json:"-" xml:"-"` } @@ -2350,6 +2496,16 @@ type metadataDeleteScheduledActionOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DeleteScheduledActionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteScheduledActionOutput) GoString() string { + return s.String() +} + type DeleteTagsInput struct { // Each tag should be defined by its resource type, resource ID, key, value, // and a propagate flag. Valid values are: Resource type = auto-scaling-group, @@ -2364,6 +2520,16 @@ type metadataDeleteTagsInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DeleteTagsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteTagsInput) GoString() string { + return s.String() +} + type DeleteTagsOutput struct { metadataDeleteTagsOutput `json:"-" xml:"-"` } @@ -2372,6 +2538,16 @@ type metadataDeleteTagsOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DeleteTagsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteTagsOutput) GoString() string { + return s.String() +} + type DescribeAccountLimitsInput struct { metadataDescribeAccountLimitsInput `json:"-" xml:"-"` } @@ -2380,6 +2556,16 @@ type metadataDescribeAccountLimitsInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeAccountLimitsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeAccountLimitsInput) GoString() string { + return s.String() +} + type DescribeAccountLimitsOutput struct { // The maximum number of groups allowed for your AWS account. The default limit // is 20 per region. @@ -2396,6 +2582,16 @@ type metadataDescribeAccountLimitsOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeAccountLimitsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeAccountLimitsOutput) GoString() string { + return s.String() +} + type DescribeAdjustmentTypesInput struct { metadataDescribeAdjustmentTypesInput `json:"-" xml:"-"` } @@ -2404,6 +2600,16 @@ type metadataDescribeAdjustmentTypesInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeAdjustmentTypesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeAdjustmentTypesInput) GoString() string { + return s.String() +} + type DescribeAdjustmentTypesOutput struct { // The policy adjustment types. AdjustmentTypes []*AdjustmentType `type:"list"` @@ -2415,6 +2621,16 @@ type metadataDescribeAdjustmentTypesOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeAdjustmentTypesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeAdjustmentTypesOutput) GoString() string { + return s.String() +} + type DescribeAutoScalingGroupsInput struct { // The group names. AutoScalingGroupNames []*string `type:"list"` @@ -2433,6 +2649,16 @@ type metadataDescribeAutoScalingGroupsInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeAutoScalingGroupsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeAutoScalingGroupsInput) GoString() string { + return s.String() +} + type DescribeAutoScalingGroupsOutput struct { // The groups. AutoScalingGroups []*Group `type:"list" required:"true"` @@ -2448,11 +2674,21 @@ type metadataDescribeAutoScalingGroupsOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeAutoScalingGroupsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeAutoScalingGroupsOutput) GoString() string { + return s.String() +} + type DescribeAutoScalingInstancesInput struct { // One or more Auto Scaling instances to describe, up to 50 instances. If you // omit this parameter, all Auto Scaling instances are described. If you specify // an ID that does not exist, it is ignored with no error. - InstanceIDs []*string `locationName:"InstanceIds" type:"list"` + InstanceIds []*string `type:"list"` // The maximum number of items to return with this call. MaxRecords *int64 `type:"integer"` @@ -2468,6 +2704,16 @@ type metadataDescribeAutoScalingInstancesInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeAutoScalingInstancesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeAutoScalingInstancesInput) GoString() string { + return s.String() +} + type DescribeAutoScalingInstancesOutput struct { // The instances. AutoScalingInstances []*InstanceDetails `type:"list"` @@ -2483,6 +2729,16 @@ type metadataDescribeAutoScalingInstancesOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeAutoScalingInstancesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeAutoScalingInstancesOutput) GoString() string { + return s.String() +} + type DescribeAutoScalingNotificationTypesInput struct { metadataDescribeAutoScalingNotificationTypesInput `json:"-" xml:"-"` } @@ -2491,6 +2747,16 @@ type metadataDescribeAutoScalingNotificationTypesInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeAutoScalingNotificationTypesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeAutoScalingNotificationTypesInput) GoString() string { + return s.String() +} + type DescribeAutoScalingNotificationTypesOutput struct { // One or more of the following notification types: // @@ -2512,6 +2778,16 @@ type metadataDescribeAutoScalingNotificationTypesOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeAutoScalingNotificationTypesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeAutoScalingNotificationTypesOutput) GoString() string { + return s.String() +} + type DescribeLaunchConfigurationsInput struct { // The launch configuration names. LaunchConfigurationNames []*string `type:"list"` @@ -2530,6 +2806,16 @@ type metadataDescribeLaunchConfigurationsInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeLaunchConfigurationsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeLaunchConfigurationsInput) GoString() string { + return s.String() +} + type DescribeLaunchConfigurationsOutput struct { // The launch configurations. LaunchConfigurations []*LaunchConfiguration `type:"list" required:"true"` @@ -2545,6 +2831,16 @@ type metadataDescribeLaunchConfigurationsOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeLaunchConfigurationsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeLaunchConfigurationsOutput) GoString() string { + return s.String() +} + type DescribeLifecycleHookTypesInput struct { metadataDescribeLifecycleHookTypesInput `json:"-" xml:"-"` } @@ -2553,6 +2849,16 @@ type metadataDescribeLifecycleHookTypesInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeLifecycleHookTypesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeLifecycleHookTypesInput) GoString() string { + return s.String() +} + type DescribeLifecycleHookTypesOutput struct { // One or more of the following notification types: // @@ -2568,9 +2874,19 @@ type metadataDescribeLifecycleHookTypesOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeLifecycleHookTypesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeLifecycleHookTypesOutput) GoString() string { + return s.String() +} + type DescribeLifecycleHooksInput struct { // The name of the group. - AutoScalingGroupName *string `type:"string" required:"true"` + AutoScalingGroupName *string `min:"1" type:"string" required:"true"` // The names of one or more lifecycle hooks. LifecycleHookNames []*string `type:"list"` @@ -2582,6 +2898,16 @@ type metadataDescribeLifecycleHooksInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeLifecycleHooksInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeLifecycleHooksInput) GoString() string { + return s.String() +} + type DescribeLifecycleHooksOutput struct { // The lifecycle hooks for the specified group. LifecycleHooks []*LifecycleHook `type:"list"` @@ -2593,6 +2919,69 @@ type metadataDescribeLifecycleHooksOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeLifecycleHooksOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeLifecycleHooksOutput) GoString() string { + return s.String() +} + +type DescribeLoadBalancersInput struct { + // The name of the group. + AutoScalingGroupName *string `min:"1" type:"string" required:"true"` + + // The maximum number of items to return with this call. + MaxRecords *int64 `type:"integer"` + + // The token for the next set of items to return. (You received this token from + // a previous call.) + NextToken *string `type:"string"` + + metadataDescribeLoadBalancersInput `json:"-" xml:"-"` +} + +type metadataDescribeLoadBalancersInput struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s DescribeLoadBalancersInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeLoadBalancersInput) GoString() string { + return s.String() +} + +type DescribeLoadBalancersOutput struct { + // The load balancers. + LoadBalancers []*LoadBalancerState `type:"list"` + + // The token to use when requesting the next set of items. If there are no additional + // items to return, the string is empty. + NextToken *string `type:"string"` + + metadataDescribeLoadBalancersOutput `json:"-" xml:"-"` +} + +type metadataDescribeLoadBalancersOutput struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s DescribeLoadBalancersOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeLoadBalancersOutput) GoString() string { + return s.String() +} + type DescribeMetricCollectionTypesInput struct { metadataDescribeMetricCollectionTypesInput `json:"-" xml:"-"` } @@ -2601,30 +2990,21 @@ type metadataDescribeMetricCollectionTypesInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeMetricCollectionTypesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeMetricCollectionTypesInput) GoString() string { + return s.String() +} + type DescribeMetricCollectionTypesOutput struct { - // The granularities for the listed metrics. + // The granularities for the metrics. Granularities []*MetricGranularityType `type:"list"` - // One or more of the following metrics: - // - // GroupMinSize - // - // GroupMaxSize - // - // GroupDesiredCapacity - // - // GroupInServiceInstances - // - // GroupPendingInstances - // - // GroupStandbyInstances - // - // GroupTerminatingInstances - // - // GroupTotalInstances - // - // The GroupStandbyInstances metric is not returned by default. You must - // explicitly request it when calling EnableMetricsCollection. + // One or more metrics. Metrics []*MetricCollectionType `type:"list"` metadataDescribeMetricCollectionTypesOutput `json:"-" xml:"-"` @@ -2634,6 +3014,16 @@ type metadataDescribeMetricCollectionTypesOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeMetricCollectionTypesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeMetricCollectionTypesOutput) GoString() string { + return s.String() +} + type DescribeNotificationConfigurationsInput struct { // The name of the group. AutoScalingGroupNames []*string `type:"list"` @@ -2652,6 +3042,16 @@ type metadataDescribeNotificationConfigurationsInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeNotificationConfigurationsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeNotificationConfigurationsInput) GoString() string { + return s.String() +} + type DescribeNotificationConfigurationsOutput struct { // The token to use when requesting the next set of items. If there are no additional // items to return, the string is empty. @@ -2667,9 +3067,19 @@ type metadataDescribeNotificationConfigurationsOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeNotificationConfigurationsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeNotificationConfigurationsOutput) GoString() string { + return s.String() +} + type DescribePoliciesInput struct { // The name of the group. - AutoScalingGroupName *string `type:"string"` + AutoScalingGroupName *string `min:"1" type:"string"` // The maximum number of items to be returned with each call. MaxRecords *int64 `type:"integer"` @@ -2684,6 +3094,9 @@ type DescribePoliciesInput struct { // an unknown policy name, it is ignored with no error. PolicyNames []*string `type:"list"` + // One or more policy types. Valid values are SimpleScaling and StepScaling. + PolicyTypes []*string `type:"list"` + metadataDescribePoliciesInput `json:"-" xml:"-"` } @@ -2691,6 +3104,16 @@ type metadataDescribePoliciesInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribePoliciesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribePoliciesInput) GoString() string { + return s.String() +} + type DescribePoliciesOutput struct { // The token to use when requesting the next set of items. If there are no additional // items to return, the string is empty. @@ -2706,16 +3129,26 @@ type metadataDescribePoliciesOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribePoliciesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribePoliciesOutput) GoString() string { + return s.String() +} + type DescribeScalingActivitiesInput struct { - // A list containing the activity IDs of the desired scaling activities. If - // this list is omitted, all activities are described. If an AutoScalingGroupName - // is provided, the results are limited to that group. The list of requested - // activities cannot contain more than 50 items. If unknown activities are requested, - // they are ignored with no error. - ActivityIDs []*string `locationName:"ActivityIds" type:"list"` + // The activity IDs of the desired scaling activities. If this list is omitted, + // all activities are described. If the AutoScalingGroupName parameter is provided, + // the results are limited to that group. The list of requested activities cannot + // contain more than 50 items. If unknown activities are requested, they are + // ignored with no error. + ActivityIds []*string `type:"list"` // The name of the group. - AutoScalingGroupName *string `type:"string"` + AutoScalingGroupName *string `min:"1" type:"string"` // The maximum number of items to return with this call. MaxRecords *int64 `type:"integer"` @@ -2731,6 +3164,16 @@ type metadataDescribeScalingActivitiesInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeScalingActivitiesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeScalingActivitiesInput) GoString() string { + return s.String() +} + type DescribeScalingActivitiesOutput struct { // The scaling activities. Activities []*Activity `type:"list" required:"true"` @@ -2746,6 +3189,16 @@ type metadataDescribeScalingActivitiesOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeScalingActivitiesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeScalingActivitiesOutput) GoString() string { + return s.String() +} + type DescribeScalingProcessTypesInput struct { metadataDescribeScalingProcessTypesInput `json:"-" xml:"-"` } @@ -2754,6 +3207,16 @@ type metadataDescribeScalingProcessTypesInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeScalingProcessTypesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeScalingProcessTypesInput) GoString() string { + return s.String() +} + type DescribeScalingProcessTypesOutput struct { // The names of the process types. Processes []*ProcessType `type:"list"` @@ -2765,9 +3228,19 @@ type metadataDescribeScalingProcessTypesOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeScalingProcessTypesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeScalingProcessTypesOutput) GoString() string { + return s.String() +} + type DescribeScheduledActionsInput struct { // The name of the group. - AutoScalingGroupName *string `type:"string"` + AutoScalingGroupName *string `min:"1" type:"string"` // The latest scheduled start time to return. If scheduled action names are // provided, this parameter is ignored. @@ -2800,6 +3273,16 @@ type metadataDescribeScheduledActionsInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeScheduledActionsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeScheduledActionsInput) GoString() string { + return s.String() +} + type DescribeScheduledActionsOutput struct { // The token to use when requesting the next set of items. If there are no additional // items to return, the string is empty. @@ -2815,11 +3298,18 @@ type metadataDescribeScheduledActionsOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeScheduledActionsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeScheduledActionsOutput) GoString() string { + return s.String() +} + type DescribeTagsInput struct { - // The value of the filter type used to identify the tags to be returned. For - // example, you can filter so that tags are returned according to Auto Scaling - // group, the key and value, or whether the new tag will be applied to instances - // launched after the tag is created (PropagateAtLaunch). + // A filter used to scope the tags to return. Filters []*Filter `type:"list"` // The maximum number of items to return with this call. @@ -2836,6 +3326,16 @@ type metadataDescribeTagsInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeTagsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeTagsInput) GoString() string { + return s.String() +} + type DescribeTagsOutput struct { // The token to use when requesting the next set of items. If there are no additional // items to return, the string is empty. @@ -2851,6 +3351,16 @@ type metadataDescribeTagsOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeTagsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeTagsOutput) GoString() string { + return s.String() +} + type DescribeTerminationPolicyTypesInput struct { metadataDescribeTerminationPolicyTypesInput `json:"-" xml:"-"` } @@ -2859,10 +3369,19 @@ type metadataDescribeTerminationPolicyTypesInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeTerminationPolicyTypesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeTerminationPolicyTypesInput) GoString() string { + return s.String() +} + type DescribeTerminationPolicyTypesOutput struct { - // The Termination policies supported by Auto Scaling. They are: OldestInstance, - // OldestLaunchConfiguration, NewestInstance, ClosestToNextInstanceHour, and - // Default. + // The termination policies supported by Auto Scaling (OldestInstance, OldestLaunchConfiguration, + // NewestInstance, ClosestToNextInstanceHour, and Default). TerminationPolicyTypes []*string `type:"list"` metadataDescribeTerminationPolicyTypesOutput `json:"-" xml:"-"` @@ -2872,12 +3391,22 @@ type metadataDescribeTerminationPolicyTypesOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeTerminationPolicyTypesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeTerminationPolicyTypesOutput) GoString() string { + return s.String() +} + type DetachInstancesInput struct { // The name of the group. - AutoScalingGroupName *string `type:"string" required:"true"` + AutoScalingGroupName *string `min:"1" type:"string" required:"true"` // One or more instance IDs. - InstanceIDs []*string `locationName:"InstanceIds" type:"list"` + InstanceIds []*string `type:"list"` // If True, the Auto Scaling group decrements the desired capacity value by // the number of instances detached. @@ -2890,6 +3419,16 @@ type metadataDetachInstancesInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DetachInstancesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DetachInstancesInput) GoString() string { + return s.String() +} + type DetachInstancesOutput struct { // The activities related to detaching the instances from the Auto Scaling group. Activities []*Activity `type:"list"` @@ -2901,11 +3440,63 @@ type metadataDetachInstancesOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DetachInstancesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DetachInstancesOutput) GoString() string { + return s.String() +} + +type DetachLoadBalancersInput struct { + // The name of the group. + AutoScalingGroupName *string `min:"1" type:"string"` + + // One or more load balancer names. + LoadBalancerNames []*string `type:"list"` + + metadataDetachLoadBalancersInput `json:"-" xml:"-"` +} + +type metadataDetachLoadBalancersInput struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s DetachLoadBalancersInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DetachLoadBalancersInput) GoString() string { + return s.String() +} + +type DetachLoadBalancersOutput struct { + metadataDetachLoadBalancersOutput `json:"-" xml:"-"` +} + +type metadataDetachLoadBalancersOutput struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s DetachLoadBalancersOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DetachLoadBalancersOutput) GoString() string { + return s.String() +} + type DisableMetricsCollectionInput struct { // The name or Amazon Resource Name (ARN) of the group. - AutoScalingGroupName *string `type:"string" required:"true"` + AutoScalingGroupName *string `min:"1" type:"string" required:"true"` - // One or more of the following metrics: + // One or more metrics. If you omit this parameter, all metrics are disabled. // // GroupMinSize // @@ -2922,8 +3513,6 @@ type DisableMetricsCollectionInput struct { // GroupTerminatingInstances // // GroupTotalInstances - // - // If you omit this parameter, all metrics are disabled. Metrics []*string `type:"list"` metadataDisableMetricsCollectionInput `json:"-" xml:"-"` @@ -2933,6 +3522,16 @@ type metadataDisableMetricsCollectionInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DisableMetricsCollectionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DisableMetricsCollectionInput) GoString() string { + return s.String() +} + type DisableMetricsCollectionOutput struct { metadataDisableMetricsCollectionOutput `json:"-" xml:"-"` } @@ -2941,8 +3540,18 @@ type metadataDisableMetricsCollectionOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DisableMetricsCollectionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DisableMetricsCollectionOutput) GoString() string { + return s.String() +} + // Describes an Amazon EBS volume. -type EBS struct { +type Ebs struct { // Indicates whether to delete the volume on instance termination. // // Default: true @@ -2954,10 +3563,10 @@ type EBS struct { // Valid values: Range is 100 to 4000. // // Default: None - IOPS *int64 `locationName:"Iops" type:"integer"` + Iops *int64 `min:"100" type:"integer"` // The ID of the snapshot. - SnapshotID *string `locationName:"SnapshotId" type:"string"` + SnapshotId *string `min:"1" type:"string"` // The volume size, in gigabytes. // @@ -2969,31 +3578,41 @@ type EBS struct { // volume size, the default is the size of the snapshot. // // Required: Required when the volume type is io1. - VolumeSize *int64 `type:"integer"` + VolumeSize *int64 `min:"1" type:"integer"` // The volume type. // // Valid values: standard | io1 | gp2 // // Default: standard - VolumeType *string `type:"string"` + VolumeType *string `min:"1" type:"string"` - metadataEBS `json:"-" xml:"-"` + metadataEbs `json:"-" xml:"-"` } -type metadataEBS struct { +type metadataEbs struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s Ebs) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Ebs) GoString() string { + return s.String() +} + type EnableMetricsCollectionInput struct { // The name or ARN of the Auto Scaling group. - AutoScalingGroupName *string `type:"string" required:"true"` + AutoScalingGroupName *string `min:"1" type:"string" required:"true"` - // The granularity to associate with the metrics to collect. Currently, the - // only valid value is "1Minute". - Granularity *string `type:"string" required:"true"` + // The granularity to associate with the metrics to collect. The only valid + // value is 1Minute. + Granularity *string `min:"1" type:"string" required:"true"` - // One or more of the following metrics: + // One or more metrics. If you omit this parameter, all metrics are enabled. // // GroupMinSize // @@ -3011,10 +3630,8 @@ type EnableMetricsCollectionInput struct { // // GroupTotalInstances // - // If you omit this parameter, all metrics are enabled. - // - // The GroupStandbyInstances metric is not returned by default. You must explicitly - // request it when calling EnableMetricsCollection. + // Note that the GroupStandbyInstances metric is not enabled by default. You + // must explicitly request this metric. Metrics []*string `type:"list"` metadataEnableMetricsCollectionInput `json:"-" xml:"-"` @@ -3024,6 +3641,16 @@ type metadataEnableMetricsCollectionInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s EnableMetricsCollectionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s EnableMetricsCollectionInput) GoString() string { + return s.String() +} + type EnableMetricsCollectionOutput struct { metadataEnableMetricsCollectionOutput `json:"-" xml:"-"` } @@ -3032,13 +3659,39 @@ type metadataEnableMetricsCollectionOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s EnableMetricsCollectionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s EnableMetricsCollectionOutput) GoString() string { + return s.String() +} + // Describes an enabled metric. type EnabledMetric struct { - // The granularity of the metric. - Granularity *string `type:"string"` + // The granularity of the metric. The only valid value is 1Minute. + Granularity *string `min:"1" type:"string"` // The name of the metric. - Metric *string `type:"string"` + // + // GroupMinSize + // + // GroupMaxSize + // + // GroupDesiredCapacity + // + // GroupInServiceInstances + // + // GroupPendingInstances + // + // GroupStandbyInstances + // + // GroupTerminatingInstances + // + // GroupTotalInstances + Metric *string `min:"1" type:"string"` metadataEnabledMetric `json:"-" xml:"-"` } @@ -3047,13 +3700,23 @@ type metadataEnabledMetric struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s EnabledMetric) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s EnabledMetric) GoString() string { + return s.String() +} + type EnterStandbyInput struct { // The name of the Auto Scaling group. - AutoScalingGroupName *string `type:"string" required:"true"` + AutoScalingGroupName *string `min:"1" type:"string" required:"true"` // One or more instances to move into Standby mode. You must specify at least // one instance ID. - InstanceIDs []*string `locationName:"InstanceIds" type:"list"` + InstanceIds []*string `type:"list"` // Specifies whether the instances moved to Standby mode count as part of the // Auto Scaling group's desired capacity. If set, the desired capacity for the @@ -3068,6 +3731,16 @@ type metadataEnterStandbyInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s EnterStandbyInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s EnterStandbyInput) GoString() string { + return s.String() +} + type EnterStandbyOutput struct { // The activities related to moving instances into Standby mode. Activities []*Activity `type:"list"` @@ -3079,23 +3752,51 @@ type metadataEnterStandbyOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s EnterStandbyOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s EnterStandbyOutput) GoString() string { + return s.String() +} + type ExecutePolicyInput struct { // The name or Amazon Resource Name (ARN) of the Auto Scaling group. - AutoScalingGroupName *string `type:"string"` + AutoScalingGroupName *string `min:"1" type:"string"` + + // The breach threshold for the alarm. + // + // This parameter is required if the policy type is StepScaling and not supported + // otherwise. + BreachThreshold *float64 `type:"double"` - // Set to True if you want Auto Scaling to wait for the cooldown period associated - // with the Auto Scaling group to complete before executing the policy. + // If this parameter is true, Auto Scaling waits for the cooldown period to + // complete before executing the policy. Otherwise, Auto Scaling executes the + // policy without waiting for the cooldown period to complete. // - // Set to False if you want Auto Scaling to circumvent the cooldown period - // associated with the Auto Scaling group and execute the policy before the - // cooldown period ends. + // This parameter is not supported if the policy type is StepScaling. // // For more information, see Understanding Auto Scaling Cooldowns (http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/Cooldown.html) // in the Auto Scaling Developer Guide. HonorCooldown *bool `type:"boolean"` + // The metric value to compare to BreachThreshold. This enables you to execute + // a policy of type StepScaling and determine which step adjustment to use. + // For example, if the breach threshold is 50 and you want to use a step adjustment + // with a lower bound of 0 and an upper bound of 10, you can set the metric + // value to 59. + // + // If you specify a metric value that doesn't correspond to a step adjustment + // for the policy, the call returns an error. + // + // This parameter is required if the policy type is StepScaling and not supported + // otherwise. + MetricValue *float64 `type:"double"` + // The name or ARN of the policy. - PolicyName *string `type:"string" required:"true"` + PolicyName *string `min:"1" type:"string" required:"true"` metadataExecutePolicyInput `json:"-" xml:"-"` } @@ -3104,6 +3805,16 @@ type metadataExecutePolicyInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s ExecutePolicyInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ExecutePolicyInput) GoString() string { + return s.String() +} + type ExecutePolicyOutput struct { metadataExecutePolicyOutput `json:"-" xml:"-"` } @@ -3112,12 +3823,22 @@ type metadataExecutePolicyOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s ExecutePolicyOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ExecutePolicyOutput) GoString() string { + return s.String() +} + type ExitStandbyInput struct { // The name of the Auto Scaling group. - AutoScalingGroupName *string `type:"string" required:"true"` + AutoScalingGroupName *string `min:"1" type:"string" required:"true"` // One or more instance IDs. You must specify at least one instance ID. - InstanceIDs []*string `locationName:"InstanceIds" type:"list"` + InstanceIds []*string `type:"list"` metadataExitStandbyInput `json:"-" xml:"-"` } @@ -3126,6 +3847,16 @@ type metadataExitStandbyInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s ExitStandbyInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ExitStandbyInput) GoString() string { + return s.String() +} + type ExitStandbyOutput struct { // The activities related to moving instances out of Standby mode. Activities []*Activity `type:"list"` @@ -3137,6 +3868,16 @@ type metadataExitStandbyOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s ExitStandbyOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ExitStandbyOutput) GoString() string { + return s.String() +} + // Describes a filter. type Filter struct { // The name of the filter. The valid values are: "auto-scaling-group", "key", @@ -3153,16 +3894,26 @@ type metadataFilter struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s Filter) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Filter) GoString() string { + return s.String() +} + // Describes an Auto Scaling group. type Group struct { // The Amazon Resource Name (ARN) of the group. - AutoScalingGroupARN *string `type:"string"` + AutoScalingGroupARN *string `min:"1" type:"string"` // The name of the group. - AutoScalingGroupName *string `type:"string" required:"true"` + AutoScalingGroupName *string `min:"1" type:"string" required:"true"` // One or more Availability Zones for the group. - AvailabilityZones []*string `type:"list" required:"true"` + AvailabilityZones []*string `min:"1" type:"list" required:"true"` // The date and time the group was created. CreatedTime *time.Time `type:"timestamp" timestampFormat:"iso8601" required:"true"` @@ -3171,10 +3922,10 @@ type Group struct { // scaling activities can start. DefaultCooldown *int64 `type:"integer" required:"true"` - // The size of the group. + // The desired size of the group. DesiredCapacity *int64 `type:"integer" required:"true"` - // The metrics enabled for this Auto Scaling group. + // The metrics enabled for the group. EnabledMetrics []*EnabledMetric `type:"list"` // The amount of time that Auto Scaling waits before checking an instance's @@ -3183,13 +3934,13 @@ type Group struct { // The service of interest for the health status check, which can be either // EC2 for Amazon EC2 or ELB for Elastic Load Balancing. - HealthCheckType *string `type:"string" required:"true"` + HealthCheckType *string `min:"1" type:"string" required:"true"` // The EC2 instances associated with the group. Instances []*Instance `type:"list"` // The name of the associated launch configuration. - LaunchConfigurationName *string `type:"string" required:"true"` + LaunchConfigurationName *string `min:"1" type:"string" required:"true"` // One or more load balancers associated with the group. LoadBalancerNames []*string `type:"list"` @@ -3202,26 +3953,25 @@ type Group struct { // The name of the placement group into which you'll launch your instances, // if any. For more information, see Placement Groups (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/placement-groups.html). - PlacementGroup *string `type:"string"` + PlacementGroup *string `min:"1" type:"string"` - // The current state of the Auto Scaling group when a DeleteAutoScalingGroup - // action is in progress. - Status *string `type:"string"` + // The current state of the group when DeleteAutoScalingGroup is in progress. + Status *string `min:"1" type:"string"` // The suspended processes associated with the group. SuspendedProcesses []*SuspendedProcess `type:"list"` - // The tags for the Auto Scaling group. + // The tags for the group. Tags []*TagDescription `type:"list"` - // The termination policies for this Auto Scaling group. + // The termination policies for the group. TerminationPolicies []*string `type:"list"` // One or more subnet IDs, if applicable, separated by commas. // // If you specify VPCZoneIdentifier and AvailabilityZones, ensure that the // Availability Zones of the subnets match the values for AvailabilityZones. - VPCZoneIdentifier *string `type:"string"` + VPCZoneIdentifier *string `min:"1" type:"string"` metadataGroup `json:"-" xml:"-"` } @@ -3230,24 +3980,33 @@ type metadataGroup struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s Group) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Group) GoString() string { + return s.String() +} + // Describes an EC2 instance. type Instance struct { - // The Availability Zone associated with this instance. - AvailabilityZone *string `type:"string" required:"true"` + // The Availability Zone in which the instance is running. + AvailabilityZone *string `min:"1" type:"string" required:"true"` // The health status of the instance. - HealthStatus *string `type:"string" required:"true"` + HealthStatus *string `min:"1" type:"string" required:"true"` // The ID of the instance. - InstanceID *string `locationName:"InstanceId" type:"string" required:"true"` + InstanceId *string `min:"1" type:"string" required:"true"` // The launch configuration associated with the instance. - LaunchConfigurationName *string `type:"string" required:"true"` + LaunchConfigurationName *string `min:"1" type:"string" required:"true"` - // A description of the current lifecycle state. - // - // The Quarantined lifecycle state is not used. - LifecycleState *string `type:"string" required:"true"` + // A description of the current lifecycle state. Note that the Quarantined state + // is not used. + LifecycleState *string `type:"string" required:"true" enum:"LifecycleState"` metadataInstance `json:"-" xml:"-"` } @@ -3256,29 +4015,39 @@ type metadataInstance struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s Instance) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Instance) GoString() string { + return s.String() +} + // Describes an EC2 instance associated with an Auto Scaling group. type InstanceDetails struct { // The name of the Auto Scaling group associated with the instance. - AutoScalingGroupName *string `type:"string" required:"true"` + AutoScalingGroupName *string `min:"1" type:"string" required:"true"` // The Availability Zone for the instance. - AvailabilityZone *string `type:"string" required:"true"` + AvailabilityZone *string `min:"1" type:"string" required:"true"` // The health status of this instance. "Healthy" means that the instance is // healthy and should remain in service. "Unhealthy" means that the instance // is unhealthy and Auto Scaling should terminate and replace it. - HealthStatus *string `type:"string" required:"true"` + HealthStatus *string `min:"1" type:"string" required:"true"` // The ID of the instance. - InstanceID *string `locationName:"InstanceId" type:"string" required:"true"` + InstanceId *string `min:"1" type:"string" required:"true"` // The launch configuration associated with the instance. - LaunchConfigurationName *string `type:"string" required:"true"` + LaunchConfigurationName *string `min:"1" type:"string" required:"true"` // The lifecycle state for the instance. For more information, see Auto Scaling // Instance States (http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/AutoScalingGroupLifecycle.html#AutoScalingStates) // in the Auto Scaling Developer Guide. - LifecycleState *string `type:"string" required:"true"` + LifecycleState *string `min:"1" type:"string" required:"true"` metadataInstanceDetails `json:"-" xml:"-"` } @@ -3287,6 +4056,16 @@ type metadataInstanceDetails struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s InstanceDetails) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InstanceDetails) GoString() string { + return s.String() +} + // Describes whether instance monitoring is enabled. type InstanceMonitoring struct { // If True, instance monitoring is enabled. @@ -3299,21 +4078,30 @@ type metadataInstanceMonitoring struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s InstanceMonitoring) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InstanceMonitoring) GoString() string { + return s.String() +} + // Describes a launch configuration. type LaunchConfiguration struct { - // Specifies whether the EC2 instances are associated with a public IP address - // (true) or not (false). - AssociatePublicIPAddress *bool `locationName:"AssociatePublicIpAddress" type:"boolean"` + // Specifies whether the instances are associated with a public IP address (true) + // or not (false). + AssociatePublicIpAddress *bool `type:"boolean"` - // A block device mapping that specifies how block devices are exposed to the - // instance. Each mapping is made up of a virtualName and a deviceName. + // A block device mapping, which specifies the block devices for the instance. BlockDeviceMappings []*BlockDeviceMapping `type:"list"` // The ID of a ClassicLink-enabled VPC to link your EC2-Classic instances to. // This parameter can only be used if you are launching EC2-Classic instances. // For more information, see ClassicLink (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/vpc-classiclink.html) // in the Amazon Elastic Compute Cloud User Guide. - ClassicLinkVPCID *string `locationName:"ClassicLinkVPCId" type:"string"` + ClassicLinkVPCId *string `min:"1" type:"string"` // The IDs of one or more security groups for the VPC specified in ClassicLinkVPCId. // This parameter is required if ClassicLinkVPCId is specified, and cannot be @@ -3325,48 +4113,48 @@ type LaunchConfiguration struct { CreatedTime *time.Time `type:"timestamp" timestampFormat:"iso8601" required:"true"` // Controls whether the instance is optimized for EBS I/O (true) or not (false). - EBSOptimized *bool `locationName:"EbsOptimized" type:"boolean"` + EbsOptimized *bool `type:"boolean"` // The name or Amazon Resource Name (ARN) of the instance profile associated // with the IAM role for the instance. - IAMInstanceProfile *string `locationName:"IamInstanceProfile" type:"string"` + IamInstanceProfile *string `min:"1" type:"string"` // The ID of the Amazon Machine Image (AMI). - ImageID *string `locationName:"ImageId" type:"string" required:"true"` + ImageId *string `min:"1" type:"string" required:"true"` // Controls whether instances in this group are launched with detailed monitoring. InstanceMonitoring *InstanceMonitoring `type:"structure"` - // The instance type for the EC2 instances. - InstanceType *string `type:"string" required:"true"` + // The instance type for the instances. + InstanceType *string `min:"1" type:"string" required:"true"` // The ID of the kernel associated with the AMI. - KernelID *string `locationName:"KernelId" type:"string"` + KernelId *string `min:"1" type:"string"` // The name of the key pair. - KeyName *string `type:"string"` + KeyName *string `min:"1" type:"string"` // The Amazon Resource Name (ARN) of the launch configuration. - LaunchConfigurationARN *string `type:"string"` + LaunchConfigurationARN *string `min:"1" type:"string"` // The name of the launch configuration. - LaunchConfigurationName *string `type:"string" required:"true"` + LaunchConfigurationName *string `min:"1" type:"string" required:"true"` // The tenancy of the instance, either default or dedicated. An instance with // dedicated tenancy runs in an isolated, single-tenant hardware and can only - // be launched in a VPC. - PlacementTenancy *string `type:"string"` + // be launched into a VPC. + PlacementTenancy *string `min:"1" type:"string"` // The ID of the RAM disk associated with the AMI. - RAMDiskID *string `locationName:"RamdiskId" type:"string"` + RamdiskId *string `min:"1" type:"string"` - // The security groups to associate with the EC2 instances. + // The security groups to associate with the instances. SecurityGroups []*string `type:"list"` // The price to bid when launching Spot Instances. - SpotPrice *string `type:"string"` + SpotPrice *string `min:"1" type:"string"` - // The user data available to the EC2 instances. + // The user data available to the instances. UserData *string `type:"string"` metadataLaunchConfiguration `json:"-" xml:"-"` @@ -3376,6 +4164,16 @@ type metadataLaunchConfiguration struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s LaunchConfiguration) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LaunchConfiguration) GoString() string { + return s.String() +} + // Describes a lifecycle hook, which tells Auto Scaling that you want to perform // an action when an instance launches or terminates. When you have a lifecycle // hook in place, the Auto Scaling group will either: @@ -3387,7 +4185,7 @@ type metadataLaunchConfiguration struct { // in the Auto Scaling Developer Guide. type LifecycleHook struct { // The name of the Auto Scaling group for the lifecycle hook. - AutoScalingGroupName *string `type:"string"` + AutoScalingGroupName *string `min:"1" type:"string"` // Defines the action the Auto Scaling group should take when the lifecycle // hook timeout elapses or if an unexpected failure occurs. The valid values @@ -3395,7 +4193,7 @@ type LifecycleHook struct { DefaultResult *string `type:"string"` // The maximum length of time an instance can remain in a Pending:Wait or Terminating:Wait - // state. Currently, this value is set at 48 hours. + // state. Currently, the maximum is set to 48 hours. GlobalTimeout *int64 `type:"integer"` // The amount of time that can elapse before the lifecycle hook times out. When @@ -3405,15 +4203,15 @@ type LifecycleHook struct { HeartbeatTimeout *int64 `type:"integer"` // The name of the lifecycle hook. - LifecycleHookName *string `type:"string"` + LifecycleHookName *string `min:"1" type:"string"` // The state of the EC2 instance to which you want to attach the lifecycle hook. - // For a list of lifecycle hook types, see DescribeLifecycleHooks. + // For a list of lifecycle hook types, see DescribeLifecycleHookTypes. LifecycleTransition *string `type:"string"` // Additional information that you want to include any time Auto Scaling sends // a message to the notification target. - NotificationMetadata *string `type:"string"` + NotificationMetadata *string `min:"1" type:"string"` // The ARN of the notification target that Auto Scaling uses to notify you when // an instance is in the transition state for the lifecycle hook. This ARN target @@ -3422,11 +4220,11 @@ type LifecycleHook struct { // // Lifecycle action token User account ID Name of the Auto Scaling group Lifecycle // hook name EC2 instance ID Lifecycle transition Notification metadata - NotificationTargetARN *string `type:"string"` + NotificationTargetARN *string `min:"1" type:"string"` // The ARN of the IAM role that allows the Auto Scaling group to publish to // the specified notification target. - RoleARN *string `type:"string"` + RoleARN *string `min:"1" type:"string"` metadataLifecycleHook `json:"-" xml:"-"` } @@ -3435,10 +4233,72 @@ type metadataLifecycleHook struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s LifecycleHook) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LifecycleHook) GoString() string { + return s.String() +} + +// Describes the state of a load balancer. +type LoadBalancerState struct { + // The name of the load balancer. + LoadBalancerName *string `min:"1" type:"string"` + + // The state of the load balancer. + // + // Adding - The instances in the group are being registered with the load + // balancer. + // + // Added - All instances in the group are registered with the load balancer. + // + // InService - At least one instance in the group passed an ELB health check. + // + // Removing - The instances are being deregistered from the load balancer. + // If connection draining is enabled, Elastic Load Balancing waits for in-flight + // requests to complete before deregistering the instances. + State *string `min:"1" type:"string"` + + metadataLoadBalancerState `json:"-" xml:"-"` +} + +type metadataLoadBalancerState struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s LoadBalancerState) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LoadBalancerState) GoString() string { + return s.String() +} + // Describes a metric. type MetricCollectionType struct { // The metric. - Metric *string `type:"string"` + // + // GroupMinSize + // + // GroupMaxSize + // + // GroupDesiredCapacity + // + // GroupInServiceInstances + // + // GroupPendingInstances + // + // GroupStandbyInstances + // + // GroupTerminatingInstances + // + // GroupTotalInstances + Metric *string `min:"1" type:"string"` metadataMetricCollectionType `json:"-" xml:"-"` } @@ -3447,10 +4307,20 @@ type metadataMetricCollectionType struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s MetricCollectionType) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s MetricCollectionType) GoString() string { + return s.String() +} + // Describes a granularity of a metric. type MetricGranularityType struct { - // The granularity. - Granularity *string `type:"string"` + // The granularity. The only valid value is 1Minute. + Granularity *string `min:"1" type:"string"` metadataMetricGranularityType `json:"-" xml:"-"` } @@ -3459,17 +4329,37 @@ type metadataMetricGranularityType struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s MetricGranularityType) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s MetricGranularityType) GoString() string { + return s.String() +} + // Describes a notification. type NotificationConfiguration struct { // The name of the group. - AutoScalingGroupName *string `type:"string"` + AutoScalingGroupName *string `min:"1" type:"string"` // The types of events for an action to start. - NotificationType *string `type:"string"` + // + // autoscaling:EC2_INSTANCE_LAUNCH + // + // autoscaling:EC2_INSTANCE_LAUNCH_ERROR + // + // autoscaling:EC2_INSTANCE_TERMINATE + // + // autoscaling:EC2_INSTANCE_TERMINATE_ERROR + // + // autoscaling:TEST_NOTIFICATION + NotificationType *string `min:"1" type:"string"` // The Amazon Resource Name (ARN) of the Amazon Simple Notification Service // (SNS) topic. - TopicARN *string `type:"string"` + TopicARN *string `min:"1" type:"string"` metadataNotificationConfiguration `json:"-" xml:"-"` } @@ -3478,81 +4368,39 @@ type metadataNotificationConfiguration struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s NotificationConfiguration) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s NotificationConfiguration) GoString() string { + return s.String() +} + // Describes a process type. // -// There are two primary Auto Scaling process types--Launch and Terminate. -// The Launch process creates a new EC2 instance for an Auto Scaling group, -// and the Terminate process removes an existing EC2 instance. The remaining -// Auto Scaling process types relate to specific Auto Scaling features: -// -// AddToLoadBalancer AlarmNotification AZRebalance HealthCheck ReplaceUnhealthy -// ScheduledActions If you suspend Launch or Terminate, all other process -// types are affected to varying degrees. The following descriptions discuss -// how each process type is affected by a suspension of Launch or Terminate. -// The AddToLoadBalancer process type adds instances to the load balancer when -// the instances are launched. If you suspend this process, Auto Scaling will -// launch the instances but will not add them to the load balancer. If you resume -// the AddToLoadBalancer process, Auto Scaling will also resume adding new instances -// to the load balancer when they are launched. However, Auto Scaling will not -// add running instances that were launched while the process was suspended; -// those instances must be added manually using the RegisterInstancesWithLoadBalancer -// (http://docs.aws.amazon.com/ElasticLoadBalancing/latest/APIReference/API_RegisterInstancesWithLoadBalancer.html) -// call. -// -// The AlarmNotification process type accepts notifications from Amazon CloudWatch -// alarms that are associated with the Auto Scaling group. If you suspend the -// AlarmNotification process type, Auto Scaling will not automatically execute -// scaling policies that would be triggered by alarms. -// -// Although the AlarmNotification process type is not directly affected by -// a suspension of Launch or Terminate, alarm notifications are often used to -// signal that a change in the size of the Auto Scaling group is warranted. -// If you suspend Launch or Terminate, Auto Scaling might not be able to implement -// the alarm's associated policy. -// -// The AZRebalance process type seeks to maintain a balanced number of instances -// across Availability Zones within a Region. If you remove an Availability -// Zone from your Auto Scaling group or an Availability Zone otherwise becomes -// unhealthy or unavailable, Auto Scaling launches new instances in an unaffected -// Availability Zone before terminating the unhealthy or unavailable instances. -// When the unhealthy Availability Zone returns to a healthy state, Auto Scaling -// automatically redistributes the application instances evenly across all of -// the designated Availability Zones. -// -// If you call SuspendProcesses on the launch process type, the AZRebalance -// process will neither launch new instances nor terminate existing instances. -// This is because the AZRebalance process terminates existing instances only -// after launching the replacement instances. -// -// If you call SuspendProcesses on the terminate process type, the AZRebalance -// process can cause your Auto Scaling group to grow up to ten percent larger -// than the maximum size. This is because Auto Scaling allows groups to temporarily -// grow larger than the maximum size during rebalancing activities. If Auto -// Scaling cannot terminate instances, your Auto Scaling group could remain -// up to ten percent larger than the maximum size until you resume the terminate -// process type. -// -// The HealthCheck process type checks the health of the instances. Auto Scaling -// marks an instance as unhealthy if Amazon EC2 or Elastic Load Balancing informs -// Auto Scaling that the instance is unhealthy. The HealthCheck process can -// override the health status of an instance that you set with SetInstanceHealth. -// -// The ReplaceUnhealthy process type terminates instances that are marked as -// unhealthy and subsequently creates new instances to replace them. This process -// calls both of the primary process types--first Terminate and then Launch. -// -// The HealthCheck process type works in conjunction with the ReplaceUnhealthly -// process type to provide health check functionality. If you suspend either -// Launch or Terminate, the ReplaceUnhealthy process type will not function -// properly. -// -// The ScheduledActions process type performs scheduled actions that you create -// with PutScheduledUpdateGroupAction. Scheduled actions often involve launching -// new instances or terminating existing instances. If you suspend either Launch -// or Terminate, your scheduled actions might not function as expected. +// For more information, see Auto Scaling Processes (http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/US_SuspendResume.html#process-types) +// in the Auto Scaling Developer Guide. type ProcessType struct { // The name of the process. - ProcessName *string `type:"string" required:"true"` + // + // Launch + // + // Terminate + // + // AddToLoadBalancer + // + // AlarmNotification + // + // AZRebalance + // + // HealthCheck + // + // ReplaceUnhealthy + // + // ScheduledActions + ProcessName *string `min:"1" type:"string" required:"true"` metadataProcessType `json:"-" xml:"-"` } @@ -3561,10 +4409,20 @@ type metadataProcessType struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s ProcessType) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ProcessType) GoString() string { + return s.String() +} + type PutLifecycleHookInput struct { // The name of the Auto Scaling group to which you want to assign the lifecycle // hook. - AutoScalingGroupName *string `type:"string" required:"true"` + AutoScalingGroupName *string `min:"1" type:"string" required:"true"` // Defines the action the Auto Scaling group should take when the lifecycle // hook timeout elapses or if an unexpected failure occurs. The value for this @@ -3580,27 +4438,27 @@ type PutLifecycleHookInput struct { HeartbeatTimeout *int64 `type:"integer"` // The name of the lifecycle hook. - LifecycleHookName *string `type:"string" required:"true"` + LifecycleHookName *string `min:"1" type:"string" required:"true"` - // The Amazon EC2 instance state to which you want to attach the lifecycle hook. - // See DescribeLifecycleHookTypes for a list of available lifecycle hook types. + // The instance state to which you want to attach the lifecycle hook. For a + // list of lifecycle hook types, see DescribeLifecycleHookTypes. // - // This parameter is required for new lifecycle hooks, but optional when updating + // This parameter is required for new lifecycle hooks, but optional when updating // existing hooks. LifecycleTransition *string `type:"string"` // Contains additional information that you want to include any time Auto Scaling // sends a message to the notification target. - NotificationMetadata *string `type:"string"` + NotificationMetadata *string `min:"1" type:"string"` // The ARN of the notification target that Auto Scaling will use to notify you // when an instance is in the transition state for the lifecycle hook. This // ARN target can be either an SQS queue or an SNS topic. // - // This parameter is required for new lifecycle hooks, but optional when updating + // This parameter is required for new lifecycle hooks, but optional when updating // existing hooks. // - // The notification message sent to the target will include: + // The notification message sent to the target will include: // // LifecycleActionToken. The Lifecycle action token. AccountId. The user // account ID. AutoScalingGroupName. The name of the Auto Scaling group. LifecycleHookName. @@ -3612,14 +4470,14 @@ type PutLifecycleHookInput struct { // // When you call this operation, a test message is sent to the notification // target. This test message contains an additional key/value pair: Event:autoscaling:TEST_NOTIFICATION. - NotificationTargetARN *string `type:"string"` + NotificationTargetARN *string `min:"1" type:"string"` // The ARN of the IAM role that allows the Auto Scaling group to publish to // the specified notification target. // - // This parameter is required for new lifecycle hooks, but optional when updating + // This parameter is required for new lifecycle hooks, but optional when updating // existing hooks. - RoleARN *string `type:"string"` + RoleARN *string `min:"1" type:"string"` metadataPutLifecycleHookInput `json:"-" xml:"-"` } @@ -3628,6 +4486,16 @@ type metadataPutLifecycleHookInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s PutLifecycleHookInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutLifecycleHookInput) GoString() string { + return s.String() +} + type PutLifecycleHookOutput struct { metadataPutLifecycleHookOutput `json:"-" xml:"-"` } @@ -3636,9 +4504,19 @@ type metadataPutLifecycleHookOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s PutLifecycleHookOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutLifecycleHookOutput) GoString() string { + return s.String() +} + type PutNotificationConfigurationInput struct { // The name of the Auto Scaling group. - AutoScalingGroupName *string `type:"string" required:"true"` + AutoScalingGroupName *string `min:"1" type:"string" required:"true"` // The type of event that will cause the notification to be sent. For details // about notification types supported by Auto Scaling, see DescribeAutoScalingNotificationTypes. @@ -3646,7 +4524,7 @@ type PutNotificationConfigurationInput struct { // The Amazon Resource Name (ARN) of the Amazon Simple Notification Service // (SNS) topic. - TopicARN *string `type:"string" required:"true"` + TopicARN *string `min:"1" type:"string" required:"true"` metadataPutNotificationConfigurationInput `json:"-" xml:"-"` } @@ -3655,6 +4533,16 @@ type metadataPutNotificationConfigurationInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s PutNotificationConfigurationInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutNotificationConfigurationInput) GoString() string { + return s.String() +} + type PutNotificationConfigurationOutput struct { metadataPutNotificationConfigurationOutput `json:"-" xml:"-"` } @@ -3663,41 +4551,81 @@ type metadataPutNotificationConfigurationOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s PutNotificationConfigurationOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutNotificationConfigurationOutput) GoString() string { + return s.String() +} + type PutScalingPolicyInput struct { - // Specifies whether the ScalingAdjustment is an absolute number or a percentage - // of the current capacity. Valid values are ChangeInCapacity, ExactCapacity, - // and PercentChangeInCapacity. + // The adjustment type. Valid values are ChangeInCapacity, ExactCapacity, and + // PercentChangeInCapacity. // // For more information, see Dynamic Scaling (http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/as-scale-based-on-demand.html) // in the Auto Scaling Developer Guide. - AdjustmentType *string `type:"string" required:"true"` + AdjustmentType *string `min:"1" type:"string" required:"true"` // The name or ARN of the group. - AutoScalingGroupName *string `type:"string" required:"true"` + AutoScalingGroupName *string `min:"1" type:"string" required:"true"` // The amount of time, in seconds, after a scaling activity completes and before - // the next scaling activity can start. + // the next scaling activity can start. If this parameter is not specified, + // the default cooldown period for the group applies. + // + // This parameter is not supported unless the policy type is SimpleScaling. // // For more information, see Understanding Auto Scaling Cooldowns (http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/Cooldown.html) // in the Auto Scaling Developer Guide. Cooldown *int64 `type:"integer"` - // Used with AdjustmentType with the value PercentChangeInCapacity, the scaling - // policy changes the DesiredCapacity of the Auto Scaling group by at least - // the number of instances specified in the value. + // The estimated time, in seconds, until a newly launched instance can contribute + // to the CloudWatch metrics. The default is to use the value specified for + // the default cooldown period for the group. // - // You will get a ValidationError if you use MinAdjustmentStep on a policy - // with an AdjustmentType other than PercentChangeInCapacity. + // This parameter is not supported if the policy type is SimpleScaling. + EstimatedInstanceWarmup *int64 `type:"integer"` + + // The aggregation type for the CloudWatch metrics. Valid values are Minimum, + // Maximum, and Average. If the aggregation type is null, the value is treated + // as Average. + // + // This parameter is not supported if the policy type is SimpleScaling. + MetricAggregationType *string `min:"1" type:"string"` + + // The minimum number of instances to scale. If the value of AdjustmentType + // is PercentChangeInCapacity, the scaling policy changes the DesiredCapacity + // of the Auto Scaling group by at least this many instances. Otherwise, the + // error is ValidationError. + MinAdjustmentMagnitude *int64 `type:"integer"` + + // Available for backward compatibility. Use MinAdjustmentMagnitude instead. MinAdjustmentStep *int64 `type:"integer"` // The name of the policy. - PolicyName *string `type:"string" required:"true"` + PolicyName *string `min:"1" type:"string" required:"true"` - // The number of instances by which to scale. AdjustmentType determines the - // interpretation of this number (e.g., as an absolute number or as a percentage - // of the existing Auto Scaling group size). A positive increment adds to the - // current capacity and a negative value removes from the current capacity. - ScalingAdjustment *int64 `type:"integer" required:"true"` + // The policy type. Valid values are SimpleScaling and StepScaling. If the policy + // type is null, the value is treated as SimpleScaling. + PolicyType *string `min:"1" type:"string"` + + // The amount by which to scale, based on the specified adjustment type. A positive + // value adds to the current capacity while a negative number removes from the + // current capacity. + // + // This parameter is required if the policy type is SimpleScaling and not supported + // otherwise. + ScalingAdjustment *int64 `type:"integer"` + + // A set of adjustments that enable you to scale based on the size of the alarm + // breach. + // + // This parameter is required if the policy type is StepScaling and not supported + // otherwise. + StepAdjustments []*StepAdjustment `type:"list"` metadataPutScalingPolicyInput `json:"-" xml:"-"` } @@ -3706,9 +4634,19 @@ type metadataPutScalingPolicyInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s PutScalingPolicyInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutScalingPolicyInput) GoString() string { + return s.String() +} + type PutScalingPolicyOutput struct { // The Amazon Resource Name (ARN) of the policy. - PolicyARN *string `type:"string"` + PolicyARN *string `min:"1" type:"string"` metadataPutScalingPolicyOutput `json:"-" xml:"-"` } @@ -3717,11 +4655,21 @@ type metadataPutScalingPolicyOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s PutScalingPolicyOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutScalingPolicyOutput) GoString() string { + return s.String() +} + type PutScheduledUpdateGroupActionInput struct { // The name or Amazon Resource Name (ARN) of the Auto Scaling group. - AutoScalingGroupName *string `type:"string" required:"true"` + AutoScalingGroupName *string `min:"1" type:"string" required:"true"` - // The number of Amazon EC2 instances that should be running in the group. + // The number of EC2 instances that should be running in the group. DesiredCapacity *int64 `type:"integer"` // The time for this action to end. @@ -3730,35 +4678,34 @@ type PutScheduledUpdateGroupActionInput struct { // The maximum size for the Auto Scaling group. MaxSize *int64 `type:"integer"` - // The minimum size for the new Auto Scaling group. + // The minimum size for the Auto Scaling group. MinSize *int64 `type:"integer"` // The time when recurring future actions will start. Start time is specified - // by the user following the Unix cron syntax format. For information about - // cron syntax, go to Wikipedia, The Free Encyclopedia (http://en.wikipedia.org/wiki/Cron). + // by the user following the Unix cron syntax format. For more information, + // see Cron (http://en.wikipedia.org/wiki/Cron) in Wikipedia. // // When StartTime and EndTime are specified with Recurrence, they form the // boundaries of when the recurring action will start and stop. - Recurrence *string `type:"string"` + Recurrence *string `min:"1" type:"string"` // The name of this scaling action. - ScheduledActionName *string `type:"string" required:"true"` + ScheduledActionName *string `min:"1" type:"string" required:"true"` - // The time for this action to start, as in --start-time 2010-06-01T00:00:00Z. + // The time for this action to start, in "YYYY-MM-DDThh:mm:ssZ" format in UTC/GMT + // only (for example, 2014-06-01T00:00:00Z). // // If you try to schedule your action in the past, Auto Scaling returns an // error message. // // When StartTime and EndTime are specified with Recurrence, they form the - // boundaries of when the recurring action will start and stop. + // boundaries of when the recurring action starts and stops. StartTime *time.Time `type:"timestamp" timestampFormat:"iso8601"` - // Time is deprecated. + // This parameter is deprecated; use StartTime instead. // - // The time for this action to start. Time is an alias for StartTime and can - // be specified instead of StartTime, or vice versa. If both Time and StartTime - // are specified, their values should be identical. Otherwise, PutScheduledUpdateGroupAction - // will return an error. + // The time for this action to start. If both Time and StartTime are specified, + // their values must be identical. Time *time.Time `type:"timestamp" timestampFormat:"iso8601"` metadataPutScheduledUpdateGroupActionInput `json:"-" xml:"-"` @@ -3768,6 +4715,16 @@ type metadataPutScheduledUpdateGroupActionInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s PutScheduledUpdateGroupActionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutScheduledUpdateGroupActionInput) GoString() string { + return s.String() +} + type PutScheduledUpdateGroupActionOutput struct { metadataPutScheduledUpdateGroupActionOutput `json:"-" xml:"-"` } @@ -3776,17 +4733,27 @@ type metadataPutScheduledUpdateGroupActionOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s PutScheduledUpdateGroupActionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutScheduledUpdateGroupActionOutput) GoString() string { + return s.String() +} + type RecordLifecycleActionHeartbeatInput struct { // The name of the Auto Scaling group for the hook. - AutoScalingGroupName *string `type:"string" required:"true"` + AutoScalingGroupName *string `min:"1" type:"string" required:"true"` // A token that uniquely identifies a specific lifecycle action associated with // an instance. Auto Scaling sends this token to the notification target you // specified when you created the lifecycle hook. - LifecycleActionToken *string `type:"string" required:"true"` + LifecycleActionToken *string `min:"36" type:"string" required:"true"` // The name of the lifecycle hook. - LifecycleHookName *string `type:"string" required:"true"` + LifecycleHookName *string `min:"1" type:"string" required:"true"` metadataRecordLifecycleActionHeartbeatInput `json:"-" xml:"-"` } @@ -3795,6 +4762,16 @@ type metadataRecordLifecycleActionHeartbeatInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s RecordLifecycleActionHeartbeatInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RecordLifecycleActionHeartbeatInput) GoString() string { + return s.String() +} + type RecordLifecycleActionHeartbeatOutput struct { metadataRecordLifecycleActionHeartbeatOutput `json:"-" xml:"-"` } @@ -3803,6 +4780,16 @@ type metadataRecordLifecycleActionHeartbeatOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s RecordLifecycleActionHeartbeatOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RecordLifecycleActionHeartbeatOutput) GoString() string { + return s.String() +} + type ResumeProcessesOutput struct { metadataResumeProcessesOutput `json:"-" xml:"-"` } @@ -3811,38 +4798,67 @@ type metadataResumeProcessesOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s ResumeProcessesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResumeProcessesOutput) GoString() string { + return s.String() +} + // Describes a scaling policy. type ScalingPolicy struct { - // Specifies whether the ScalingAdjustment is an absolute number or a percentage - // of the current capacity. Valid values are ChangeInCapacity, ExactCapacity, - // and PercentChangeInCapacity. - AdjustmentType *string `type:"string"` + // The adjustment type, which specifies how ScalingAdjustment is interpreted. + // Valid values are ChangeInCapacity, ExactCapacity, and PercentChangeInCapacity. + AdjustmentType *string `min:"1" type:"string"` - // The CloudWatch Alarms related to the policy. + // The CloudWatch alarms related to the policy. Alarms []*Alarm `type:"list"` // The name of the Auto Scaling group associated with this scaling policy. - AutoScalingGroupName *string `type:"string"` + AutoScalingGroupName *string `min:"1" type:"string"` // The amount of time, in seconds, after a scaling activity completes before // any further trigger-related scaling activities can start. Cooldown *int64 `type:"integer"` - // Changes the DesiredCapacity of the Auto Scaling group by at least the specified - // number of instances. + // The estimated time, in seconds, until a newly launched instance can contribute + // to the CloudWatch metrics. + EstimatedInstanceWarmup *int64 `type:"integer"` + + // The aggregation type for the CloudWatch metrics. Valid values are Minimum, + // Maximum, and Average. + MetricAggregationType *string `min:"1" type:"string"` + + // The minimum number of instances to scale. If the value of AdjustmentType + // is PercentChangeInCapacity, the scaling policy changes the DesiredCapacity + // of the Auto Scaling group by at least this many instances. Otherwise, the + // error is ValidationError. + MinAdjustmentMagnitude *int64 `type:"integer"` + + // Available for backward compatibility. Use MinAdjustmentMagnitude instead. MinAdjustmentStep *int64 `type:"integer"` // The Amazon Resource Name (ARN) of the policy. - PolicyARN *string `type:"string"` + PolicyARN *string `min:"1" type:"string"` // The name of the scaling policy. - PolicyName *string `type:"string"` + PolicyName *string `min:"1" type:"string"` + + // The policy type. Valid values are SimpleScaling and StepScaling. + PolicyType *string `min:"1" type:"string"` - // The number associated with the specified adjustment type. A positive value - // adds to the current capacity and a negative value removes from the current - // capacity. + // The amount by which to scale, based on the specified adjustment type. A positive + // value adds to the current capacity while a negative number removes from the + // current capacity. ScalingAdjustment *int64 `type:"integer"` + // A set of adjustments that enable you to scale based on the size of the alarm + // breach. + StepAdjustments []*StepAdjustment `type:"list"` + metadataScalingPolicy `json:"-" xml:"-"` } @@ -3850,14 +4866,37 @@ type metadataScalingPolicy struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s ScalingPolicy) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ScalingPolicy) GoString() string { + return s.String() +} + type ScalingProcessQuery struct { // The name or Amazon Resource Name (ARN) of the Auto Scaling group. - AutoScalingGroupName *string `type:"string" required:"true"` + AutoScalingGroupName *string `min:"1" type:"string" required:"true"` // One or more of the following processes: // - // Launch Terminate HealthCheck ReplaceUnhealthy AZRebalance AlarmNotification - // ScheduledActions AddToLoadBalancer + // Launch + // + // Terminate + // + // HealthCheck + // + // ReplaceUnhealthy + // + // AZRebalance + // + // AlarmNotification + // + // ScheduledActions + // + // AddToLoadBalancer ScalingProcesses []*string `type:"list"` metadataScalingProcessQuery `json:"-" xml:"-"` @@ -3867,16 +4906,26 @@ type metadataScalingProcessQuery struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s ScalingProcessQuery) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ScalingProcessQuery) GoString() string { + return s.String() +} + // Describes a scheduled update to an Auto Scaling group. type ScheduledUpdateGroupAction struct { // The name of the group. - AutoScalingGroupName *string `type:"string"` + AutoScalingGroupName *string `min:"1" type:"string"` // The number of instances you prefer to maintain in the group. DesiredCapacity *int64 `type:"integer"` - // The time that the action is scheduled to end. This value can be up to one - // month in the future. + // The date and time that the action is scheduled to end. This date and time + // can be up to one month in the future. EndTime *time.Time `type:"timestamp" timestampFormat:"iso8601"` // The maximum size of the group. @@ -3885,25 +4934,23 @@ type ScheduledUpdateGroupAction struct { // The minimum size of the group. MinSize *int64 `type:"integer"` - // The regular schedule that an action occurs. - Recurrence *string `type:"string"` + // The recurring schedule for the action. + Recurrence *string `min:"1" type:"string"` // The Amazon Resource Name (ARN) of the scheduled action. - ScheduledActionARN *string `type:"string"` + ScheduledActionARN *string `min:"1" type:"string"` // The name of the scheduled action. - ScheduledActionName *string `type:"string"` + ScheduledActionName *string `min:"1" type:"string"` - // The time that the action is scheduled to begin. This value can be up to one - // month in the future. + // The date and time that the action is scheduled to begin. This date and time + // can be up to one month in the future. // // When StartTime and EndTime are specified with Recurrence, they form the // boundaries of when the recurring action will start and stop. StartTime *time.Time `type:"timestamp" timestampFormat:"iso8601"` - // Time is deprecated. - // - // The time that the action is scheduled to begin. Time is an alias for StartTime. + // This parameter is deprecated; use StartTime instead. Time *time.Time `type:"timestamp" timestampFormat:"iso8601"` metadataScheduledUpdateGroupAction `json:"-" xml:"-"` @@ -3913,9 +4960,19 @@ type metadataScheduledUpdateGroupAction struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s ScheduledUpdateGroupAction) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ScheduledUpdateGroupAction) GoString() string { + return s.String() +} + type SetDesiredCapacityInput struct { // The name of the Auto Scaling group. - AutoScalingGroupName *string `type:"string" required:"true"` + AutoScalingGroupName *string `min:"1" type:"string" required:"true"` // The number of EC2 instances that should be running in the Auto Scaling group. DesiredCapacity *int64 `type:"integer" required:"true"` @@ -3933,6 +4990,16 @@ type metadataSetDesiredCapacityInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s SetDesiredCapacityInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SetDesiredCapacityInput) GoString() string { + return s.String() +} + type SetDesiredCapacityOutput struct { metadataSetDesiredCapacityOutput `json:"-" xml:"-"` } @@ -3941,14 +5008,24 @@ type metadataSetDesiredCapacityOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s SetDesiredCapacityOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SetDesiredCapacityOutput) GoString() string { + return s.String() +} + type SetInstanceHealthInput struct { // The health status of the instance. Set to Healthy if you want the instance // to remain in service. Set to Unhealthy if you want the instance to be out // of service. Auto Scaling will terminate and replace the unhealthy instance. - HealthStatus *string `type:"string" required:"true"` + HealthStatus *string `min:"1" type:"string" required:"true"` // The ID of the EC2 instance. - InstanceID *string `locationName:"InstanceId" type:"string" required:"true"` + InstanceId *string `min:"1" type:"string" required:"true"` // If the Auto Scaling group of the specified instance has a HealthCheckGracePeriod // specified for the group, by default, this call will respect the grace period. @@ -3966,6 +5043,16 @@ type metadataSetInstanceHealthInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s SetInstanceHealthInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SetInstanceHealthInput) GoString() string { + return s.String() +} + type SetInstanceHealthOutput struct { metadataSetInstanceHealthOutput `json:"-" xml:"-"` } @@ -3974,6 +5061,84 @@ type metadataSetInstanceHealthOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s SetInstanceHealthOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SetInstanceHealthOutput) GoString() string { + return s.String() +} + +// Describes an adjustment based on the difference between the value of the +// aggregated CloudWatch metric and the breach threshold that you've defined +// for the alarm. +// +// For the following examples, suppose that you have an alarm with a breach +// threshold of 50: +// +// If you want the adjustment to be triggered when the metric is greater +// than or equal to 50 and less than 60, specify a lower bound of 0 and an upper +// bound of 10. +// +// If you want the adjustment to be triggered when the metric is greater +// than 40 and less than or equal to 50, specify a lower bound of -10 and an +// upper bound of 0. +// +// There are a few rules for the step adjustments for your step policy: +// +// The ranges of your step adjustments can't overlap or have a gap. +// +// At most one step adjustment can have a null lower bound. If one step adjustment +// has a negative lower bound, then there must be a step adjustment with a null +// lower bound. +// +// At most one step adjustment can have a null upper bound. If one step adjustment +// has a positive upper bound, then there must be a step adjustment with a null +// upper bound. +// +// The upper and lower bound can't be null in the same step adjustment. +type StepAdjustment struct { + // The lower bound for the difference between the alarm threshold and the CloudWatch + // metric. If the metric value is above the breach threshold, the lower bound + // is inclusive (the metric must be greater than or equal to the threshold plus + // the lower bound). Otherwise, it is exclusive (the metric must be greater + // than the threshold plus the lower bound). A null value indicates negative + // infinity. + MetricIntervalLowerBound *float64 `type:"double"` + + // The upper bound for the difference between the alarm threshold and the CloudWatch + // metric. If the metric value is above the breach threshold, the upper bound + // is exclusive (the metric must be less than the threshold plus the upper bound). + // Otherwise, it is inclusive (the metric must be less than or equal to the + // threshold plus the upper bound). A null value indicates positive infinity. + // + // The upper bound must be greater than the lower bound. + MetricIntervalUpperBound *float64 `type:"double"` + + // The amount by which to scale, based on the specified adjustment type. A positive + // value adds to the current capacity while a negative number removes from the + // current capacity. + ScalingAdjustment *int64 `type:"integer" required:"true"` + + metadataStepAdjustment `json:"-" xml:"-"` +} + +type metadataStepAdjustment struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s StepAdjustment) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s StepAdjustment) GoString() string { + return s.String() +} + type SuspendProcessesOutput struct { metadataSuspendProcessesOutput `json:"-" xml:"-"` } @@ -3982,14 +5147,24 @@ type metadataSuspendProcessesOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s SuspendProcessesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SuspendProcessesOutput) GoString() string { + return s.String() +} + // Describes an Auto Scaling process that has been suspended. For more information, // see ProcessType. type SuspendedProcess struct { // The name of the suspended process. - ProcessName *string `type:"string"` + ProcessName *string `min:"1" type:"string"` // The reason that the process was suspended. - SuspensionReason *string `type:"string"` + SuspensionReason *string `min:"1" type:"string"` metadataSuspendedProcess `json:"-" xml:"-"` } @@ -3998,21 +5173,29 @@ type metadataSuspendedProcess struct { SDKShapeTraits bool `type:"structure"` } -// Describes a tag applied to an Auto Scaling group. +// String returns the string representation +func (s SuspendedProcess) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SuspendedProcess) GoString() string { + return s.String() +} + +// Describes a tag for an Auto Scaling group. type Tag struct { // The tag key. - Key *string `type:"string" required:"true"` + Key *string `min:"1" type:"string" required:"true"` - // Specifies whether the tag is applied to instances launched after the tag - // is created. The same behavior applies to updates: If you change a tag, it - // is applied to all instances launched after you made the change. + // Determines whether the tag is added to new instances as they are launched + // in the group. PropagateAtLaunch *bool `type:"boolean"` // The name of the group. - ResourceID *string `locationName:"ResourceId" type:"string"` + ResourceId *string `type:"string"` - // The kind of resource to which the tag is applied. Currently, Auto Scaling - // supports the auto-scaling-group resource type. + // The type of resource. The only supported value is auto-scaling-group. ResourceType *string `type:"string"` // The tag value. @@ -4025,21 +5208,29 @@ type metadataTag struct { SDKShapeTraits bool `type:"structure"` } -// Describes a tag applied to an Auto Scaling group. +// String returns the string representation +func (s Tag) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Tag) GoString() string { + return s.String() +} + +// Describes a tag for an Auto Scaling group. type TagDescription struct { // The tag key. - Key *string `type:"string"` + Key *string `min:"1" type:"string"` - // Specifies whether the tag is applied to instances launched after the tag - // is created. The same behavior applies to updates: If you change a tag, it - // is applied to all instances launched after you made the change. + // Determines whether the tag is added to new instances as they are launched + // in the group. PropagateAtLaunch *bool `type:"boolean"` // The name of the group. - ResourceID *string `locationName:"ResourceId" type:"string"` + ResourceId *string `type:"string"` - // The kind of resource to which the tag is applied. Currently, Auto Scaling - // supports the auto-scaling-group resource type. + // The type of resource. The only supported value is auto-scaling-group. ResourceType *string `type:"string"` // The tag value. @@ -4052,9 +5243,19 @@ type metadataTagDescription struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s TagDescription) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TagDescription) GoString() string { + return s.String() +} + type TerminateInstanceInAutoScalingGroupInput struct { // The ID of the EC2 instance. - InstanceID *string `locationName:"InstanceId" type:"string" required:"true"` + InstanceId *string `min:"1" type:"string" required:"true"` // If true, terminating this instance also decrements the size of the Auto Scaling // group. @@ -4067,6 +5268,16 @@ type metadataTerminateInstanceInAutoScalingGroupInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s TerminateInstanceInAutoScalingGroupInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TerminateInstanceInAutoScalingGroupInput) GoString() string { + return s.String() +} + type TerminateInstanceInAutoScalingGroupOutput struct { // A scaling activity. Activity *Activity `type:"structure"` @@ -4078,12 +5289,22 @@ type metadataTerminateInstanceInAutoScalingGroupOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s TerminateInstanceInAutoScalingGroupOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TerminateInstanceInAutoScalingGroupOutput) GoString() string { + return s.String() +} + type UpdateAutoScalingGroupInput struct { // The name of the Auto Scaling group. - AutoScalingGroupName *string `type:"string" required:"true"` + AutoScalingGroupName *string `min:"1" type:"string" required:"true"` // One or more Availability Zones for the group. - AvailabilityZones []*string `type:"list"` + AvailabilityZones []*string `min:"1" type:"list"` // The amount of time, in seconds, after a scaling activity completes before // another scaling activity can start. For more information, see Understanding @@ -4091,23 +5312,23 @@ type UpdateAutoScalingGroupInput struct { DefaultCooldown *int64 `type:"integer"` // The number of EC2 instances that should be running in the Auto Scaling group. - // This value must be greater than or equal to the minimum size of the group + // This number must be greater than or equal to the minimum size of the group // and less than or equal to the maximum size of the group. DesiredCapacity *int64 `type:"integer"` - // The amount of time, in second, that Auto Scaling waits before checking the + // The amount of time, in seconds, that Auto Scaling waits before checking the // health status of an instance. The grace period begins when the instance passes - // System Status and the Instance Status checks from Amazon EC2. For more information, - // see DescribeInstanceStatus (http://docs.aws.amazon.com/AWSEC2/latest/APIReference/ApiReference-query-DescribeInstanceStatus.html). + // the system status and instance status checks from Amazon EC2. For more information, + // see . HealthCheckGracePeriod *int64 `type:"integer"` // The type of health check for the instances in the Auto Scaling group. The // health check type can either be EC2 for Amazon EC2 or ELB for Elastic Load // Balancing. - HealthCheckType *string `type:"string"` + HealthCheckType *string `min:"1" type:"string"` // The name of the launch configuration. - LaunchConfigurationName *string `type:"string"` + LaunchConfigurationName *string `min:"1" type:"string"` // The maximum size of the Auto Scaling group. MaxSize *int64 `type:"integer"` @@ -4117,7 +5338,7 @@ type UpdateAutoScalingGroupInput struct { // The name of the placement group into which you'll launch your instances, // if any. For more information, see Placement Groups (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/placement-groups.html). - PlacementGroup *string `type:"string"` + PlacementGroup *string `min:"1" type:"string"` // A standalone termination policy or a list of termination policies used to // select the instance to terminate. The policies are executed in the order @@ -4128,15 +5349,16 @@ type UpdateAutoScalingGroupInput struct { // in the Auto Scaling Developer Guide. TerminationPolicies []*string `type:"list"` - // The subnet identifier for the Amazon VPC connection, if applicable. You can - // specify several subnets in a comma-separated list. + // The ID of the subnet, if you are launching into a VPC. You can specify several + // subnets in a comma-separated list. // - // When you specify VPCZoneIdentifier with AvailabilityZones, ensure that - // the subnets' Availability Zones match the values you specify for AvailabilityZones. + // When you specify VPCZoneIdentifier with AvailabilityZones, ensure that the + // subnets' Availability Zones match the values you specify for AvailabilityZones. // - // For more information, see Auto Scaling and Amazon VPC (http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/autoscalingsubnets.html) + // For more information, see Auto Scaling and Amazon Virtual Private Cloud + // (http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/autoscalingsubnets.html) // in the Auto Scaling Developer Guide. - VPCZoneIdentifier *string `type:"string"` + VPCZoneIdentifier *string `min:"1" type:"string"` metadataUpdateAutoScalingGroupInput `json:"-" xml:"-"` } @@ -4145,6 +5367,16 @@ type metadataUpdateAutoScalingGroupInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s UpdateAutoScalingGroupInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateAutoScalingGroupInput) GoString() string { + return s.String() +} + type UpdateAutoScalingGroupOutput struct { metadataUpdateAutoScalingGroupOutput `json:"-" xml:"-"` } @@ -4152,3 +5384,67 @@ type UpdateAutoScalingGroupOutput struct { type metadataUpdateAutoScalingGroupOutput struct { SDKShapeTraits bool `type:"structure"` } + +// String returns the string representation +func (s UpdateAutoScalingGroupOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateAutoScalingGroupOutput) GoString() string { + return s.String() +} + +const ( + // @enum LifecycleState + LifecycleStatePending = "Pending" + // @enum LifecycleState + LifecycleStatePendingWait = "Pending:Wait" + // @enum LifecycleState + LifecycleStatePendingProceed = "Pending:Proceed" + // @enum LifecycleState + LifecycleStateQuarantined = "Quarantined" + // @enum LifecycleState + LifecycleStateInService = "InService" + // @enum LifecycleState + LifecycleStateTerminating = "Terminating" + // @enum LifecycleState + LifecycleStateTerminatingWait = "Terminating:Wait" + // @enum LifecycleState + LifecycleStateTerminatingProceed = "Terminating:Proceed" + // @enum LifecycleState + LifecycleStateTerminated = "Terminated" + // @enum LifecycleState + LifecycleStateDetaching = "Detaching" + // @enum LifecycleState + LifecycleStateDetached = "Detached" + // @enum LifecycleState + LifecycleStateEnteringStandby = "EnteringStandby" + // @enum LifecycleState + LifecycleStateStandby = "Standby" +) + +const ( + // @enum ScalingActivityStatusCode + ScalingActivityStatusCodeWaitingForSpotInstanceRequestId = "WaitingForSpotInstanceRequestId" + // @enum ScalingActivityStatusCode + ScalingActivityStatusCodeWaitingForSpotInstanceId = "WaitingForSpotInstanceId" + // @enum ScalingActivityStatusCode + ScalingActivityStatusCodeWaitingForInstanceId = "WaitingForInstanceId" + // @enum ScalingActivityStatusCode + ScalingActivityStatusCodePreInService = "PreInService" + // @enum ScalingActivityStatusCode + ScalingActivityStatusCodeInProgress = "InProgress" + // @enum ScalingActivityStatusCode + ScalingActivityStatusCodeWaitingForElbconnectionDraining = "WaitingForELBConnectionDraining" + // @enum ScalingActivityStatusCode + ScalingActivityStatusCodeMidLifecycleAction = "MidLifecycleAction" + // @enum ScalingActivityStatusCode + ScalingActivityStatusCodeWaitingForInstanceWarmup = "WaitingForInstanceWarmup" + // @enum ScalingActivityStatusCode + ScalingActivityStatusCodeSuccessful = "Successful" + // @enum ScalingActivityStatusCode + ScalingActivityStatusCodeFailed = "Failed" + // @enum ScalingActivityStatusCode + ScalingActivityStatusCodeCancelled = "Cancelled" +) diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/autoscaling/autoscalingiface/interface.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/autoscaling/autoscalingiface/interface.go index ab28228467f0..2de4f9e7e7f4 100644 --- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/autoscaling/autoscalingiface/interface.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/autoscaling/autoscalingiface/interface.go @@ -4,98 +4,217 @@ 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) + 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) } diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/autoscaling/examples_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/autoscaling/examples_test.go index c9c2f5a7889c..bdcac9be04f6 100644 --- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/autoscaling/examples_test.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/autoscaling/examples_test.go @@ -8,8 +8,6 @@ import ( "time" "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/aws/awsutil" "github.com/aws/aws-sdk-go/service/autoscaling" ) @@ -21,7 +19,7 @@ func ExampleAutoScaling_AttachInstances() { params := &autoscaling.AttachInstancesInput{ AutoScalingGroupName: aws.String("ResourceName"), // Required - InstanceIDs: []*string{ + InstanceIds: []*string{ aws.String("XmlStringMaxLen16"), // Required // More values... }, @@ -29,22 +27,37 @@ func ExampleAutoScaling_AttachInstances() { resp, err := svc.AttachInstances(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) +} + +func ExampleAutoScaling_AttachLoadBalancers() { + svc := autoscaling.New(nil) + + params := &autoscaling.AttachLoadBalancersInput{ + AutoScalingGroupName: aws.String("ResourceName"), + LoadBalancerNames: []*string{ + aws.String("XmlStringMaxLen255"), // Required + // More values... + }, + } + resp, err := svc.AttachLoadBalancers(params) + + if err != nil { + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return + } + + // Pretty-print the response data. + fmt.Println(resp) } func ExampleAutoScaling_CompleteLifecycleAction() { @@ -59,22 +72,14 @@ func ExampleAutoScaling_CompleteLifecycleAction() { resp, err := svc.CompleteLifecycleAction(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleAutoScaling_CreateAutoScalingGroup() { @@ -82,17 +87,17 @@ func ExampleAutoScaling_CreateAutoScalingGroup() { params := &autoscaling.CreateAutoScalingGroupInput{ AutoScalingGroupName: aws.String("XmlStringMaxLen255"), // Required - MaxSize: aws.Long(1), // Required - MinSize: aws.Long(1), // Required + MaxSize: aws.Int64(1), // Required + MinSize: aws.Int64(1), // Required AvailabilityZones: []*string{ aws.String("XmlStringMaxLen255"), // Required // More values... }, - DefaultCooldown: aws.Long(1), - DesiredCapacity: aws.Long(1), - HealthCheckGracePeriod: aws.Long(1), + DefaultCooldown: aws.Int64(1), + DesiredCapacity: aws.Int64(1), + HealthCheckGracePeriod: aws.Int64(1), HealthCheckType: aws.String("XmlStringMaxLen32"), - InstanceID: aws.String("XmlStringMaxLen16"), + InstanceId: aws.String("XmlStringMaxLen16"), LaunchConfigurationName: aws.String("ResourceName"), LoadBalancerNames: []*string{ aws.String("XmlStringMaxLen255"), // Required @@ -100,10 +105,10 @@ func ExampleAutoScaling_CreateAutoScalingGroup() { }, PlacementGroup: aws.String("XmlStringMaxLen255"), Tags: []*autoscaling.Tag{ - &autoscaling.Tag{ // Required + { // Required Key: aws.String("TagKey"), // Required - PropagateAtLaunch: aws.Boolean(true), - ResourceID: aws.String("XmlString"), + PropagateAtLaunch: aws.Bool(true), + ResourceId: aws.String("XmlString"), ResourceType: aws.String("XmlString"), Value: aws.String("TagValue"), }, @@ -118,22 +123,14 @@ func ExampleAutoScaling_CreateAutoScalingGroup() { resp, err := svc.CreateAutoScalingGroup(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleAutoScaling_CreateLaunchConfiguration() { @@ -141,39 +138,39 @@ func ExampleAutoScaling_CreateLaunchConfiguration() { params := &autoscaling.CreateLaunchConfigurationInput{ LaunchConfigurationName: aws.String("XmlStringMaxLen255"), // Required - AssociatePublicIPAddress: aws.Boolean(true), + AssociatePublicIpAddress: aws.Bool(true), BlockDeviceMappings: []*autoscaling.BlockDeviceMapping{ - &autoscaling.BlockDeviceMapping{ // Required + { // Required DeviceName: aws.String("XmlStringMaxLen255"), // Required - EBS: &autoscaling.EBS{ - DeleteOnTermination: aws.Boolean(true), - IOPS: aws.Long(1), - SnapshotID: aws.String("XmlStringMaxLen255"), - VolumeSize: aws.Long(1), + Ebs: &autoscaling.Ebs{ + DeleteOnTermination: aws.Bool(true), + Iops: aws.Int64(1), + SnapshotId: aws.String("XmlStringMaxLen255"), + VolumeSize: aws.Int64(1), VolumeType: aws.String("BlockDeviceEbsVolumeType"), }, - NoDevice: aws.Boolean(true), + NoDevice: aws.Bool(true), VirtualName: aws.String("XmlStringMaxLen255"), }, // More values... }, - ClassicLinkVPCID: aws.String("XmlStringMaxLen255"), + ClassicLinkVPCId: aws.String("XmlStringMaxLen255"), ClassicLinkVPCSecurityGroups: []*string{ aws.String("XmlStringMaxLen255"), // Required // More values... }, - EBSOptimized: aws.Boolean(true), - IAMInstanceProfile: aws.String("XmlStringMaxLen1600"), - ImageID: aws.String("XmlStringMaxLen255"), - InstanceID: aws.String("XmlStringMaxLen16"), + EbsOptimized: aws.Bool(true), + IamInstanceProfile: aws.String("XmlStringMaxLen1600"), + ImageId: aws.String("XmlStringMaxLen255"), + InstanceId: aws.String("XmlStringMaxLen16"), InstanceMonitoring: &autoscaling.InstanceMonitoring{ - Enabled: aws.Boolean(true), + Enabled: aws.Bool(true), }, InstanceType: aws.String("XmlStringMaxLen255"), - KernelID: aws.String("XmlStringMaxLen255"), + KernelId: aws.String("XmlStringMaxLen255"), KeyName: aws.String("XmlStringMaxLen255"), PlacementTenancy: aws.String("XmlStringMaxLen64"), - RAMDiskID: aws.String("XmlStringMaxLen255"), + RamdiskId: aws.String("XmlStringMaxLen255"), SecurityGroups: []*string{ aws.String("XmlString"), // Required // More values... @@ -184,22 +181,14 @@ func ExampleAutoScaling_CreateLaunchConfiguration() { resp, err := svc.CreateLaunchConfiguration(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleAutoScaling_CreateOrUpdateTags() { @@ -207,10 +196,10 @@ func ExampleAutoScaling_CreateOrUpdateTags() { params := &autoscaling.CreateOrUpdateTagsInput{ Tags: []*autoscaling.Tag{ // Required - &autoscaling.Tag{ // Required + { // Required Key: aws.String("TagKey"), // Required - PropagateAtLaunch: aws.Boolean(true), - ResourceID: aws.String("XmlString"), + PropagateAtLaunch: aws.Bool(true), + ResourceId: aws.String("XmlString"), ResourceType: aws.String("XmlString"), Value: aws.String("TagValue"), }, @@ -220,22 +209,14 @@ func ExampleAutoScaling_CreateOrUpdateTags() { resp, err := svc.CreateOrUpdateTags(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleAutoScaling_DeleteAutoScalingGroup() { @@ -243,27 +224,19 @@ func ExampleAutoScaling_DeleteAutoScalingGroup() { params := &autoscaling.DeleteAutoScalingGroupInput{ AutoScalingGroupName: aws.String("ResourceName"), // Required - ForceDelete: aws.Boolean(true), + ForceDelete: aws.Bool(true), } resp, err := svc.DeleteAutoScalingGroup(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleAutoScaling_DeleteLaunchConfiguration() { @@ -275,22 +248,14 @@ func ExampleAutoScaling_DeleteLaunchConfiguration() { resp, err := svc.DeleteLaunchConfiguration(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleAutoScaling_DeleteLifecycleHook() { @@ -303,22 +268,14 @@ func ExampleAutoScaling_DeleteLifecycleHook() { resp, err := svc.DeleteLifecycleHook(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleAutoScaling_DeleteNotificationConfiguration() { @@ -331,22 +288,14 @@ func ExampleAutoScaling_DeleteNotificationConfiguration() { resp, err := svc.DeleteNotificationConfiguration(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleAutoScaling_DeletePolicy() { @@ -359,22 +308,14 @@ func ExampleAutoScaling_DeletePolicy() { resp, err := svc.DeletePolicy(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleAutoScaling_DeleteScheduledAction() { @@ -387,22 +328,14 @@ func ExampleAutoScaling_DeleteScheduledAction() { resp, err := svc.DeleteScheduledAction(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleAutoScaling_DeleteTags() { @@ -410,10 +343,10 @@ func ExampleAutoScaling_DeleteTags() { params := &autoscaling.DeleteTagsInput{ Tags: []*autoscaling.Tag{ // Required - &autoscaling.Tag{ // Required + { // Required Key: aws.String("TagKey"), // Required - PropagateAtLaunch: aws.Boolean(true), - ResourceID: aws.String("XmlString"), + PropagateAtLaunch: aws.Bool(true), + ResourceId: aws.String("XmlString"), ResourceType: aws.String("XmlString"), Value: aws.String("TagValue"), }, @@ -423,22 +356,14 @@ func ExampleAutoScaling_DeleteTags() { resp, err := svc.DeleteTags(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleAutoScaling_DescribeAccountLimits() { @@ -448,22 +373,14 @@ func ExampleAutoScaling_DescribeAccountLimits() { resp, err := svc.DescribeAccountLimits(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleAutoScaling_DescribeAdjustmentTypes() { @@ -473,22 +390,14 @@ func ExampleAutoScaling_DescribeAdjustmentTypes() { resp, err := svc.DescribeAdjustmentTypes(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleAutoScaling_DescribeAutoScalingGroups() { @@ -499,60 +408,44 @@ func ExampleAutoScaling_DescribeAutoScalingGroups() { aws.String("ResourceName"), // Required // More values... }, - MaxRecords: aws.Long(1), + MaxRecords: aws.Int64(1), NextToken: aws.String("XmlString"), } resp, err := svc.DescribeAutoScalingGroups(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleAutoScaling_DescribeAutoScalingInstances() { svc := autoscaling.New(nil) params := &autoscaling.DescribeAutoScalingInstancesInput{ - InstanceIDs: []*string{ + InstanceIds: []*string{ aws.String("XmlStringMaxLen16"), // Required // More values... }, - MaxRecords: aws.Long(1), + MaxRecords: aws.Int64(1), NextToken: aws.String("XmlString"), } resp, err := svc.DescribeAutoScalingInstances(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleAutoScaling_DescribeAutoScalingNotificationTypes() { @@ -562,22 +455,14 @@ func ExampleAutoScaling_DescribeAutoScalingNotificationTypes() { resp, err := svc.DescribeAutoScalingNotificationTypes(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleAutoScaling_DescribeLaunchConfigurations() { @@ -588,28 +473,20 @@ func ExampleAutoScaling_DescribeLaunchConfigurations() { aws.String("ResourceName"), // Required // More values... }, - MaxRecords: aws.Long(1), + MaxRecords: aws.Int64(1), NextToken: aws.String("XmlString"), } resp, err := svc.DescribeLaunchConfigurations(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleAutoScaling_DescribeLifecycleHookTypes() { @@ -619,22 +496,14 @@ func ExampleAutoScaling_DescribeLifecycleHookTypes() { resp, err := svc.DescribeLifecycleHookTypes(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleAutoScaling_DescribeLifecycleHooks() { @@ -650,22 +519,35 @@ func ExampleAutoScaling_DescribeLifecycleHooks() { resp, err := svc.DescribeLifecycleHooks(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return + } + + // Pretty-print the response data. + fmt.Println(resp) +} + +func ExampleAutoScaling_DescribeLoadBalancers() { + svc := autoscaling.New(nil) + + params := &autoscaling.DescribeLoadBalancersInput{ + AutoScalingGroupName: aws.String("ResourceName"), // Required + MaxRecords: aws.Int64(1), + NextToken: aws.String("XmlString"), + } + resp, err := svc.DescribeLoadBalancers(params) + + if err != nil { + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleAutoScaling_DescribeMetricCollectionTypes() { @@ -675,22 +557,14 @@ func ExampleAutoScaling_DescribeMetricCollectionTypes() { resp, err := svc.DescribeMetricCollectionTypes(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleAutoScaling_DescribeNotificationConfigurations() { @@ -701,28 +575,20 @@ func ExampleAutoScaling_DescribeNotificationConfigurations() { aws.String("ResourceName"), // Required // More values... }, - MaxRecords: aws.Long(1), + MaxRecords: aws.Int64(1), NextToken: aws.String("XmlString"), } resp, err := svc.DescribeNotificationConfigurations(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleAutoScaling_DescribePolicies() { @@ -730,65 +596,53 @@ func ExampleAutoScaling_DescribePolicies() { params := &autoscaling.DescribePoliciesInput{ AutoScalingGroupName: aws.String("ResourceName"), - MaxRecords: aws.Long(1), + MaxRecords: aws.Int64(1), NextToken: aws.String("XmlString"), PolicyNames: []*string{ aws.String("ResourceName"), // Required // More values... }, + PolicyTypes: []*string{ + aws.String("XmlStringMaxLen64"), // Required + // More values... + }, } resp, err := svc.DescribePolicies(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleAutoScaling_DescribeScalingActivities() { svc := autoscaling.New(nil) params := &autoscaling.DescribeScalingActivitiesInput{ - ActivityIDs: []*string{ + ActivityIds: []*string{ aws.String("XmlString"), // Required // More values... }, AutoScalingGroupName: aws.String("ResourceName"), - MaxRecords: aws.Long(1), + MaxRecords: aws.Int64(1), NextToken: aws.String("XmlString"), } resp, err := svc.DescribeScalingActivities(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleAutoScaling_DescribeScalingProcessTypes() { @@ -798,22 +652,14 @@ func ExampleAutoScaling_DescribeScalingProcessTypes() { resp, err := svc.DescribeScalingProcessTypes(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleAutoScaling_DescribeScheduledActions() { @@ -822,7 +668,7 @@ func ExampleAutoScaling_DescribeScheduledActions() { params := &autoscaling.DescribeScheduledActionsInput{ AutoScalingGroupName: aws.String("ResourceName"), EndTime: aws.Time(time.Now()), - MaxRecords: aws.Long(1), + MaxRecords: aws.Int64(1), NextToken: aws.String("XmlString"), ScheduledActionNames: []*string{ aws.String("ResourceName"), // Required @@ -833,22 +679,14 @@ func ExampleAutoScaling_DescribeScheduledActions() { resp, err := svc.DescribeScheduledActions(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleAutoScaling_DescribeTags() { @@ -856,7 +694,7 @@ func ExampleAutoScaling_DescribeTags() { params := &autoscaling.DescribeTagsInput{ Filters: []*autoscaling.Filter{ - &autoscaling.Filter{ // Required + { // Required Name: aws.String("XmlString"), Values: []*string{ aws.String("XmlString"), // Required @@ -865,28 +703,20 @@ func ExampleAutoScaling_DescribeTags() { }, // More values... }, - MaxRecords: aws.Long(1), + MaxRecords: aws.Int64(1), NextToken: aws.String("XmlString"), } resp, err := svc.DescribeTags(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleAutoScaling_DescribeTerminationPolicyTypes() { @@ -896,22 +726,14 @@ func ExampleAutoScaling_DescribeTerminationPolicyTypes() { resp, err := svc.DescribeTerminationPolicyTypes(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleAutoScaling_DetachInstances() { @@ -919,8 +741,8 @@ func ExampleAutoScaling_DetachInstances() { params := &autoscaling.DetachInstancesInput{ AutoScalingGroupName: aws.String("ResourceName"), // Required - ShouldDecrementDesiredCapacity: aws.Boolean(true), // Required - InstanceIDs: []*string{ + ShouldDecrementDesiredCapacity: aws.Bool(true), // Required + InstanceIds: []*string{ aws.String("XmlStringMaxLen16"), // Required // More values... }, @@ -928,22 +750,37 @@ func ExampleAutoScaling_DetachInstances() { resp, err := svc.DetachInstances(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return + } + + // Pretty-print the response data. + fmt.Println(resp) +} + +func ExampleAutoScaling_DetachLoadBalancers() { + svc := autoscaling.New(nil) + + params := &autoscaling.DetachLoadBalancersInput{ + AutoScalingGroupName: aws.String("ResourceName"), + LoadBalancerNames: []*string{ + aws.String("XmlStringMaxLen255"), // Required + // More values... + }, + } + resp, err := svc.DetachLoadBalancers(params) + + if err != nil { + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleAutoScaling_DisableMetricsCollection() { @@ -959,22 +796,14 @@ func ExampleAutoScaling_DisableMetricsCollection() { resp, err := svc.DisableMetricsCollection(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleAutoScaling_EnableMetricsCollection() { @@ -991,22 +820,14 @@ func ExampleAutoScaling_EnableMetricsCollection() { resp, err := svc.EnableMetricsCollection(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleAutoScaling_EnterStandby() { @@ -1014,8 +835,8 @@ func ExampleAutoScaling_EnterStandby() { params := &autoscaling.EnterStandbyInput{ AutoScalingGroupName: aws.String("ResourceName"), // Required - ShouldDecrementDesiredCapacity: aws.Boolean(true), // Required - InstanceIDs: []*string{ + ShouldDecrementDesiredCapacity: aws.Bool(true), // Required + InstanceIds: []*string{ aws.String("XmlStringMaxLen16"), // Required // More values... }, @@ -1023,22 +844,14 @@ func ExampleAutoScaling_EnterStandby() { resp, err := svc.EnterStandby(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleAutoScaling_ExecutePolicy() { @@ -1047,27 +860,21 @@ func ExampleAutoScaling_ExecutePolicy() { params := &autoscaling.ExecutePolicyInput{ PolicyName: aws.String("ResourceName"), // Required AutoScalingGroupName: aws.String("ResourceName"), - HonorCooldown: aws.Boolean(true), + BreachThreshold: aws.Float64(1.0), + HonorCooldown: aws.Bool(true), + MetricValue: aws.Float64(1.0), } resp, err := svc.ExecutePolicy(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleAutoScaling_ExitStandby() { @@ -1075,7 +882,7 @@ func ExampleAutoScaling_ExitStandby() { params := &autoscaling.ExitStandbyInput{ AutoScalingGroupName: aws.String("ResourceName"), // Required - InstanceIDs: []*string{ + InstanceIds: []*string{ aws.String("XmlStringMaxLen16"), // Required // More values... }, @@ -1083,22 +890,14 @@ func ExampleAutoScaling_ExitStandby() { resp, err := svc.ExitStandby(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleAutoScaling_PutLifecycleHook() { @@ -1108,7 +907,7 @@ func ExampleAutoScaling_PutLifecycleHook() { AutoScalingGroupName: aws.String("ResourceName"), // Required LifecycleHookName: aws.String("AsciiStringMaxLen255"), // Required DefaultResult: aws.String("LifecycleActionResult"), - HeartbeatTimeout: aws.Long(1), + HeartbeatTimeout: aws.Int64(1), LifecycleTransition: aws.String("LifecycleTransition"), NotificationMetadata: aws.String("XmlStringMaxLen1023"), NotificationTargetARN: aws.String("ResourceName"), @@ -1117,22 +916,14 @@ func ExampleAutoScaling_PutLifecycleHook() { resp, err := svc.PutLifecycleHook(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleAutoScaling_PutNotificationConfiguration() { @@ -1149,54 +940,50 @@ func ExampleAutoScaling_PutNotificationConfiguration() { resp, err := svc.PutNotificationConfiguration(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleAutoScaling_PutScalingPolicy() { svc := autoscaling.New(nil) params := &autoscaling.PutScalingPolicyInput{ - AdjustmentType: aws.String("XmlStringMaxLen255"), // Required - AutoScalingGroupName: aws.String("ResourceName"), // Required - PolicyName: aws.String("XmlStringMaxLen255"), // Required - ScalingAdjustment: aws.Long(1), // Required - Cooldown: aws.Long(1), - MinAdjustmentStep: aws.Long(1), + AdjustmentType: aws.String("XmlStringMaxLen255"), // Required + AutoScalingGroupName: aws.String("ResourceName"), // Required + PolicyName: aws.String("XmlStringMaxLen255"), // Required + Cooldown: aws.Int64(1), + EstimatedInstanceWarmup: aws.Int64(1), + MetricAggregationType: aws.String("XmlStringMaxLen32"), + MinAdjustmentMagnitude: aws.Int64(1), + MinAdjustmentStep: aws.Int64(1), + PolicyType: aws.String("XmlStringMaxLen64"), + ScalingAdjustment: aws.Int64(1), + StepAdjustments: []*autoscaling.StepAdjustment{ + { // Required + ScalingAdjustment: aws.Int64(1), // Required + MetricIntervalLowerBound: aws.Float64(1.0), + MetricIntervalUpperBound: aws.Float64(1.0), + }, + // More values... + }, } resp, err := svc.PutScalingPolicy(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleAutoScaling_PutScheduledUpdateGroupAction() { @@ -1205,10 +992,10 @@ func ExampleAutoScaling_PutScheduledUpdateGroupAction() { params := &autoscaling.PutScheduledUpdateGroupActionInput{ AutoScalingGroupName: aws.String("ResourceName"), // Required ScheduledActionName: aws.String("XmlStringMaxLen255"), // Required - DesiredCapacity: aws.Long(1), + DesiredCapacity: aws.Int64(1), EndTime: aws.Time(time.Now()), - MaxSize: aws.Long(1), - MinSize: aws.Long(1), + MaxSize: aws.Int64(1), + MinSize: aws.Int64(1), Recurrence: aws.String("XmlStringMaxLen255"), StartTime: aws.Time(time.Now()), Time: aws.Time(time.Now()), @@ -1216,22 +1003,14 @@ func ExampleAutoScaling_PutScheduledUpdateGroupAction() { resp, err := svc.PutScheduledUpdateGroupAction(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleAutoScaling_RecordLifecycleActionHeartbeat() { @@ -1245,22 +1024,14 @@ func ExampleAutoScaling_RecordLifecycleActionHeartbeat() { resp, err := svc.RecordLifecycleActionHeartbeat(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleAutoScaling_ResumeProcesses() { @@ -1276,22 +1047,14 @@ func ExampleAutoScaling_ResumeProcesses() { resp, err := svc.ResumeProcesses(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleAutoScaling_SetDesiredCapacity() { @@ -1299,28 +1062,20 @@ func ExampleAutoScaling_SetDesiredCapacity() { params := &autoscaling.SetDesiredCapacityInput{ AutoScalingGroupName: aws.String("ResourceName"), // Required - DesiredCapacity: aws.Long(1), // Required - HonorCooldown: aws.Boolean(true), + DesiredCapacity: aws.Int64(1), // Required + HonorCooldown: aws.Bool(true), } resp, err := svc.SetDesiredCapacity(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleAutoScaling_SetInstanceHealth() { @@ -1328,28 +1083,20 @@ func ExampleAutoScaling_SetInstanceHealth() { params := &autoscaling.SetInstanceHealthInput{ HealthStatus: aws.String("XmlStringMaxLen32"), // Required - InstanceID: aws.String("XmlStringMaxLen16"), // Required - ShouldRespectGracePeriod: aws.Boolean(true), + InstanceId: aws.String("XmlStringMaxLen16"), // Required + ShouldRespectGracePeriod: aws.Bool(true), } resp, err := svc.SetInstanceHealth(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleAutoScaling_SuspendProcesses() { @@ -1365,50 +1112,34 @@ func ExampleAutoScaling_SuspendProcesses() { resp, err := svc.SuspendProcesses(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleAutoScaling_TerminateInstanceInAutoScalingGroup() { svc := autoscaling.New(nil) params := &autoscaling.TerminateInstanceInAutoScalingGroupInput{ - InstanceID: aws.String("XmlStringMaxLen16"), // Required - ShouldDecrementDesiredCapacity: aws.Boolean(true), // Required + InstanceId: aws.String("XmlStringMaxLen16"), // Required + ShouldDecrementDesiredCapacity: aws.Bool(true), // Required } resp, err := svc.TerminateInstanceInAutoScalingGroup(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleAutoScaling_UpdateAutoScalingGroup() { @@ -1420,13 +1151,13 @@ func ExampleAutoScaling_UpdateAutoScalingGroup() { aws.String("XmlStringMaxLen255"), // Required // More values... }, - DefaultCooldown: aws.Long(1), - DesiredCapacity: aws.Long(1), - HealthCheckGracePeriod: aws.Long(1), + DefaultCooldown: aws.Int64(1), + DesiredCapacity: aws.Int64(1), + HealthCheckGracePeriod: aws.Int64(1), HealthCheckType: aws.String("XmlStringMaxLen32"), LaunchConfigurationName: aws.String("ResourceName"), - MaxSize: aws.Long(1), - MinSize: aws.Long(1), + MaxSize: aws.Int64(1), + MinSize: aws.Int64(1), PlacementGroup: aws.String("XmlStringMaxLen255"), TerminationPolicies: []*string{ aws.String("XmlStringMaxLen1600"), // Required @@ -1437,20 +1168,12 @@ func ExampleAutoScaling_UpdateAutoScalingGroup() { resp, err := svc.UpdateAutoScalingGroup(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/autoscaling/service.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/autoscaling/service.go index 41d4b123f02e..d17015ad746c 100644 --- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/autoscaling/service.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/autoscaling/service.go @@ -4,27 +4,35 @@ package autoscaling import ( "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/defaults" + "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/aws/service" + "github.com/aws/aws-sdk-go/aws/service/serviceinfo" "github.com/aws/aws-sdk-go/internal/protocol/query" "github.com/aws/aws-sdk-go/internal/signer/v4" ) -// AutoScaling is a client for Auto Scaling. +// Auto Scaling is designed to automatically launch or terminate EC2 instances +// based on user-defined policies, schedules, and health checks. Use this service +// in conjunction with the Amazon CloudWatch and Elastic Load Balancing services. type AutoScaling struct { - *aws.Service + *service.Service } // Used for custom service initialization logic -var initService func(*aws.Service) +var initService func(*service.Service) // Used for custom request initialization logic -var initRequest func(*aws.Request) +var initRequest func(*request.Request) // New returns a new AutoScaling client. func New(config *aws.Config) *AutoScaling { - service := &aws.Service{ - Config: aws.DefaultConfig.Merge(config), - ServiceName: "autoscaling", - APIVersion: "2011-01-01", + service := &service.Service{ + ServiceInfo: serviceinfo.ServiceInfo{ + Config: defaults.DefaultConfig.Merge(config), + ServiceName: "autoscaling", + APIVersion: "2011-01-01", + }, } service.Initialize() @@ -45,8 +53,8 @@ func New(config *aws.Config) *AutoScaling { // newRequest creates a new request for a AutoScaling operation and runs any // custom request initialization. -func (c *AutoScaling) newRequest(op *aws.Operation, params, data interface{}) *aws.Request { - req := aws.NewRequest(c.Service, op, params, data) +func (c *AutoScaling) newRequest(op *request.Operation, params, data interface{}) *request.Request { + req := c.NewRequest(op, params, data) // Run custom request initialization if present if initRequest != nil { diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/ec2/api.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/ec2/api.go index 9255ab75c814..0327851d6078 100644 --- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/ec2/api.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/ec2/api.go @@ -4,33 +4,28 @@ package ec2 import ( - "sync" "time" - "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/awsutil" + "github.com/aws/aws-sdk-go/aws/request" ) -var oprw sync.Mutex +const opAcceptVpcPeeringConnection = "AcceptVpcPeeringConnection" -// AcceptVPCPeeringConnectionRequest generates a request for the AcceptVPCPeeringConnection operation. -func (c *EC2) AcceptVPCPeeringConnectionRequest(input *AcceptVPCPeeringConnectionInput) (req *aws.Request, output *AcceptVPCPeeringConnectionOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opAcceptVPCPeeringConnection == nil { - opAcceptVPCPeeringConnection = &aws.Operation{ - Name: "AcceptVpcPeeringConnection", - HTTPMethod: "POST", - HTTPPath: "/", - } +// AcceptVpcPeeringConnectionRequest generates a request for the AcceptVpcPeeringConnection operation. +func (c *EC2) AcceptVpcPeeringConnectionRequest(input *AcceptVpcPeeringConnectionInput) (req *request.Request, output *AcceptVpcPeeringConnectionOutput) { + op := &request.Operation{ + Name: opAcceptVpcPeeringConnection, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { - input = &AcceptVPCPeeringConnectionInput{} + input = &AcceptVpcPeeringConnectionInput{} } - req = c.newRequest(opAcceptVPCPeeringConnection, input, output) - output = &AcceptVPCPeeringConnectionOutput{} + req = c.newRequest(op, input, output) + output = &AcceptVpcPeeringConnectionOutput{} req.Data = output return } @@ -39,32 +34,27 @@ func (c *EC2) AcceptVPCPeeringConnectionRequest(input *AcceptVPCPeeringConnectio // connection must be in the pending-acceptance state, and you must be the owner // of the peer VPC. Use the DescribeVpcPeeringConnections request to view your // outstanding VPC peering connection requests. -func (c *EC2) AcceptVPCPeeringConnection(input *AcceptVPCPeeringConnectionInput) (*AcceptVPCPeeringConnectionOutput, error) { - req, out := c.AcceptVPCPeeringConnectionRequest(input) +func (c *EC2) AcceptVpcPeeringConnection(input *AcceptVpcPeeringConnectionInput) (*AcceptVpcPeeringConnectionOutput, error) { + req, out := c.AcceptVpcPeeringConnectionRequest(input) err := req.Send() return out, err } -var opAcceptVPCPeeringConnection *aws.Operation +const opAllocateAddress = "AllocateAddress" // AllocateAddressRequest generates a request for the AllocateAddress operation. -func (c *EC2) AllocateAddressRequest(input *AllocateAddressInput) (req *aws.Request, output *AllocateAddressOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opAllocateAddress == nil { - opAllocateAddress = &aws.Operation{ - Name: "AllocateAddress", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *EC2) AllocateAddressRequest(input *AllocateAddressInput) (req *request.Request, output *AllocateAddressOutput) { + op := &request.Operation{ + Name: opAllocateAddress, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &AllocateAddressInput{} } - req = c.newRequest(opAllocateAddress, input, output) + req = c.newRequest(op, input, output) output = &AllocateAddressOutput{} req.Data = output return @@ -81,27 +71,22 @@ func (c *EC2) AllocateAddress(input *AllocateAddressInput) (*AllocateAddressOutp return out, err } -var opAllocateAddress *aws.Operation +const opAssignPrivateIpAddresses = "AssignPrivateIpAddresses" -// AssignPrivateIPAddressesRequest generates a request for the AssignPrivateIPAddresses operation. -func (c *EC2) AssignPrivateIPAddressesRequest(input *AssignPrivateIPAddressesInput) (req *aws.Request, output *AssignPrivateIPAddressesOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opAssignPrivateIPAddresses == nil { - opAssignPrivateIPAddresses = &aws.Operation{ - Name: "AssignPrivateIpAddresses", - HTTPMethod: "POST", - HTTPPath: "/", - } +// AssignPrivateIpAddressesRequest generates a request for the AssignPrivateIpAddresses operation. +func (c *EC2) AssignPrivateIpAddressesRequest(input *AssignPrivateIpAddressesInput) (req *request.Request, output *AssignPrivateIpAddressesOutput) { + op := &request.Operation{ + Name: opAssignPrivateIpAddresses, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { - input = &AssignPrivateIPAddressesInput{} + input = &AssignPrivateIpAddressesInput{} } - req = c.newRequest(opAssignPrivateIPAddresses, input, output) - output = &AssignPrivateIPAddressesOutput{} + req = c.newRequest(op, input, output) + output = &AssignPrivateIpAddressesOutput{} req.Data = output return } @@ -117,32 +102,27 @@ func (c *EC2) AssignPrivateIPAddressesRequest(input *AssignPrivateIPAddressesInp // in the Amazon Elastic Compute Cloud User Guide. // // AssignPrivateIpAddresses is available only in EC2-VPC. -func (c *EC2) AssignPrivateIPAddresses(input *AssignPrivateIPAddressesInput) (*AssignPrivateIPAddressesOutput, error) { - req, out := c.AssignPrivateIPAddressesRequest(input) +func (c *EC2) AssignPrivateIpAddresses(input *AssignPrivateIpAddressesInput) (*AssignPrivateIpAddressesOutput, error) { + req, out := c.AssignPrivateIpAddressesRequest(input) err := req.Send() return out, err } -var opAssignPrivateIPAddresses *aws.Operation +const opAssociateAddress = "AssociateAddress" // AssociateAddressRequest generates a request for the AssociateAddress operation. -func (c *EC2) AssociateAddressRequest(input *AssociateAddressInput) (req *aws.Request, output *AssociateAddressOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opAssociateAddress == nil { - opAssociateAddress = &aws.Operation{ - Name: "AssociateAddress", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *EC2) AssociateAddressRequest(input *AssociateAddressInput) (req *request.Request, output *AssociateAddressOutput) { + op := &request.Operation{ + Name: opAssociateAddress, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &AssociateAddressInput{} } - req = c.newRequest(opAssociateAddress, input, output) + req = c.newRequest(op, input, output) output = &AssociateAddressOutput{} req.Data = output return @@ -171,27 +151,22 @@ func (c *EC2) AssociateAddress(input *AssociateAddressInput) (*AssociateAddressO return out, err } -var opAssociateAddress *aws.Operation +const opAssociateDhcpOptions = "AssociateDhcpOptions" -// AssociateDHCPOptionsRequest generates a request for the AssociateDHCPOptions operation. -func (c *EC2) AssociateDHCPOptionsRequest(input *AssociateDHCPOptionsInput) (req *aws.Request, output *AssociateDHCPOptionsOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opAssociateDHCPOptions == nil { - opAssociateDHCPOptions = &aws.Operation{ - Name: "AssociateDhcpOptions", - HTTPMethod: "POST", - HTTPPath: "/", - } +// AssociateDhcpOptionsRequest generates a request for the AssociateDhcpOptions operation. +func (c *EC2) AssociateDhcpOptionsRequest(input *AssociateDhcpOptionsInput) (req *request.Request, output *AssociateDhcpOptionsOutput) { + op := &request.Operation{ + Name: opAssociateDhcpOptions, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { - input = &AssociateDHCPOptionsInput{} + input = &AssociateDhcpOptionsInput{} } - req = c.newRequest(opAssociateDHCPOptions, input, output) - output = &AssociateDHCPOptionsOutput{} + req = c.newRequest(op, input, output) + output = &AssociateDhcpOptionsOutput{} req.Data = output return } @@ -208,32 +183,27 @@ func (c *EC2) AssociateDHCPOptionsRequest(input *AssociateDHCPOptionsInput) (req // // For more information, see DHCP Options Sets (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_DHCP_Options.html) // in the Amazon Virtual Private Cloud User Guide. -func (c *EC2) AssociateDHCPOptions(input *AssociateDHCPOptionsInput) (*AssociateDHCPOptionsOutput, error) { - req, out := c.AssociateDHCPOptionsRequest(input) +func (c *EC2) AssociateDhcpOptions(input *AssociateDhcpOptionsInput) (*AssociateDhcpOptionsOutput, error) { + req, out := c.AssociateDhcpOptionsRequest(input) err := req.Send() return out, err } -var opAssociateDHCPOptions *aws.Operation +const opAssociateRouteTable = "AssociateRouteTable" // AssociateRouteTableRequest generates a request for the AssociateRouteTable operation. -func (c *EC2) AssociateRouteTableRequest(input *AssociateRouteTableInput) (req *aws.Request, output *AssociateRouteTableOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opAssociateRouteTable == nil { - opAssociateRouteTable = &aws.Operation{ - Name: "AssociateRouteTable", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *EC2) AssociateRouteTableRequest(input *AssociateRouteTableInput) (req *request.Request, output *AssociateRouteTableOutput) { + op := &request.Operation{ + Name: opAssociateRouteTable, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &AssociateRouteTableInput{} } - req = c.newRequest(opAssociateRouteTable, input, output) + req = c.newRequest(op, input, output) output = &AssociateRouteTableOutput{} req.Data = output return @@ -253,27 +223,22 @@ func (c *EC2) AssociateRouteTable(input *AssociateRouteTableInput) (*AssociateRo return out, err } -var opAssociateRouteTable *aws.Operation +const opAttachClassicLinkVpc = "AttachClassicLinkVpc" -// AttachClassicLinkVPCRequest generates a request for the AttachClassicLinkVPC operation. -func (c *EC2) AttachClassicLinkVPCRequest(input *AttachClassicLinkVPCInput) (req *aws.Request, output *AttachClassicLinkVPCOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opAttachClassicLinkVPC == nil { - opAttachClassicLinkVPC = &aws.Operation{ - Name: "AttachClassicLinkVpc", - HTTPMethod: "POST", - HTTPPath: "/", - } +// AttachClassicLinkVpcRequest generates a request for the AttachClassicLinkVpc operation. +func (c *EC2) AttachClassicLinkVpcRequest(input *AttachClassicLinkVpcInput) (req *request.Request, output *AttachClassicLinkVpcOutput) { + op := &request.Operation{ + Name: opAttachClassicLinkVpc, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { - input = &AttachClassicLinkVPCInput{} + input = &AttachClassicLinkVpcInput{} } - req = c.newRequest(opAttachClassicLinkVPC, input, output) - output = &AttachClassicLinkVPCOutput{} + req = c.newRequest(op, input, output) + output = &AttachClassicLinkVpcOutput{} req.Data = output return } @@ -290,32 +255,27 @@ func (c *EC2) AttachClassicLinkVPCRequest(input *AttachClassicLinkVPCInput) (req // // Linking your instance to a VPC is sometimes referred to as attaching your // instance. -func (c *EC2) AttachClassicLinkVPC(input *AttachClassicLinkVPCInput) (*AttachClassicLinkVPCOutput, error) { - req, out := c.AttachClassicLinkVPCRequest(input) +func (c *EC2) AttachClassicLinkVpc(input *AttachClassicLinkVpcInput) (*AttachClassicLinkVpcOutput, error) { + req, out := c.AttachClassicLinkVpcRequest(input) err := req.Send() return out, err } -var opAttachClassicLinkVPC *aws.Operation +const opAttachInternetGateway = "AttachInternetGateway" // AttachInternetGatewayRequest generates a request for the AttachInternetGateway operation. -func (c *EC2) AttachInternetGatewayRequest(input *AttachInternetGatewayInput) (req *aws.Request, output *AttachInternetGatewayOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opAttachInternetGateway == nil { - opAttachInternetGateway = &aws.Operation{ - Name: "AttachInternetGateway", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *EC2) AttachInternetGatewayRequest(input *AttachInternetGatewayInput) (req *request.Request, output *AttachInternetGatewayOutput) { + op := &request.Operation{ + Name: opAttachInternetGateway, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &AttachInternetGatewayInput{} } - req = c.newRequest(opAttachInternetGateway, input, output) + req = c.newRequest(op, input, output) output = &AttachInternetGatewayOutput{} req.Data = output return @@ -330,26 +290,21 @@ func (c *EC2) AttachInternetGateway(input *AttachInternetGatewayInput) (*AttachI return out, err } -var opAttachInternetGateway *aws.Operation +const opAttachNetworkInterface = "AttachNetworkInterface" // AttachNetworkInterfaceRequest generates a request for the AttachNetworkInterface operation. -func (c *EC2) AttachNetworkInterfaceRequest(input *AttachNetworkInterfaceInput) (req *aws.Request, output *AttachNetworkInterfaceOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opAttachNetworkInterface == nil { - opAttachNetworkInterface = &aws.Operation{ - Name: "AttachNetworkInterface", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *EC2) AttachNetworkInterfaceRequest(input *AttachNetworkInterfaceInput) (req *request.Request, output *AttachNetworkInterfaceOutput) { + op := &request.Operation{ + Name: opAttachNetworkInterface, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &AttachNetworkInterfaceInput{} } - req = c.newRequest(opAttachNetworkInterface, input, output) + req = c.newRequest(op, input, output) output = &AttachNetworkInterfaceOutput{} req.Data = output return @@ -362,60 +317,21 @@ func (c *EC2) AttachNetworkInterface(input *AttachNetworkInterfaceInput) (*Attac return out, err } -var opAttachNetworkInterface *aws.Operation - -// AttachVPNGatewayRequest generates a request for the AttachVPNGateway operation. -func (c *EC2) AttachVPNGatewayRequest(input *AttachVPNGatewayInput) (req *aws.Request, output *AttachVPNGatewayOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opAttachVPNGateway == nil { - opAttachVPNGateway = &aws.Operation{ - Name: "AttachVpnGateway", - HTTPMethod: "POST", - HTTPPath: "/", - } - } - - if input == nil { - input = &AttachVPNGatewayInput{} - } - - req = c.newRequest(opAttachVPNGateway, input, output) - output = &AttachVPNGatewayOutput{} - req.Data = output - return -} - -// Attaches a virtual private gateway to a VPC. For more information, see Adding -// a Hardware Virtual Private Gateway to Your VPC (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_VPN.html) -// in the Amazon Virtual Private Cloud User Guide. -func (c *EC2) AttachVPNGateway(input *AttachVPNGatewayInput) (*AttachVPNGatewayOutput, error) { - req, out := c.AttachVPNGatewayRequest(input) - err := req.Send() - return out, err -} - -var opAttachVPNGateway *aws.Operation +const opAttachVolume = "AttachVolume" // AttachVolumeRequest generates a request for the AttachVolume operation. -func (c *EC2) AttachVolumeRequest(input *AttachVolumeInput) (req *aws.Request, output *VolumeAttachment) { - oprw.Lock() - defer oprw.Unlock() - - if opAttachVolume == nil { - opAttachVolume = &aws.Operation{ - Name: "AttachVolume", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *EC2) AttachVolumeRequest(input *AttachVolumeInput) (req *request.Request, output *VolumeAttachment) { + op := &request.Operation{ + Name: opAttachVolume, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &AttachVolumeInput{} } - req = c.newRequest(opAttachVolume, input, output) + req = c.newRequest(op, input, output) output = &VolumeAttachment{} req.Data = output return @@ -452,26 +368,50 @@ func (c *EC2) AttachVolume(input *AttachVolumeInput) (*VolumeAttachment, error) return out, err } -var opAttachVolume *aws.Operation +const opAttachVpnGateway = "AttachVpnGateway" -// AuthorizeSecurityGroupEgressRequest generates a request for the AuthorizeSecurityGroupEgress operation. -func (c *EC2) AuthorizeSecurityGroupEgressRequest(input *AuthorizeSecurityGroupEgressInput) (req *aws.Request, output *AuthorizeSecurityGroupEgressOutput) { - oprw.Lock() - defer oprw.Unlock() +// AttachVpnGatewayRequest generates a request for the AttachVpnGateway operation. +func (c *EC2) AttachVpnGatewayRequest(input *AttachVpnGatewayInput) (req *request.Request, output *AttachVpnGatewayOutput) { + op := &request.Operation{ + Name: opAttachVpnGateway, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &AttachVpnGatewayInput{} + } + + req = c.newRequest(op, input, output) + output = &AttachVpnGatewayOutput{} + req.Data = output + return +} + +// Attaches a virtual private gateway to a VPC. For more information, see Adding +// a Hardware Virtual Private Gateway to Your VPC (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_VPN.html) +// in the Amazon Virtual Private Cloud User Guide. +func (c *EC2) AttachVpnGateway(input *AttachVpnGatewayInput) (*AttachVpnGatewayOutput, error) { + req, out := c.AttachVpnGatewayRequest(input) + err := req.Send() + return out, err +} - if opAuthorizeSecurityGroupEgress == nil { - opAuthorizeSecurityGroupEgress = &aws.Operation{ - Name: "AuthorizeSecurityGroupEgress", - HTTPMethod: "POST", - HTTPPath: "/", - } +const opAuthorizeSecurityGroupEgress = "AuthorizeSecurityGroupEgress" + +// AuthorizeSecurityGroupEgressRequest generates a request for the AuthorizeSecurityGroupEgress operation. +func (c *EC2) AuthorizeSecurityGroupEgressRequest(input *AuthorizeSecurityGroupEgressInput) (req *request.Request, output *AuthorizeSecurityGroupEgressOutput) { + op := &request.Operation{ + Name: opAuthorizeSecurityGroupEgress, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &AuthorizeSecurityGroupEgressInput{} } - req = c.newRequest(opAuthorizeSecurityGroupEgress, input, output) + req = c.newRequest(op, input, output) output = &AuthorizeSecurityGroupEgressOutput{} req.Data = output return @@ -504,26 +444,21 @@ func (c *EC2) AuthorizeSecurityGroupEgress(input *AuthorizeSecurityGroupEgressIn return out, err } -var opAuthorizeSecurityGroupEgress *aws.Operation +const opAuthorizeSecurityGroupIngress = "AuthorizeSecurityGroupIngress" // AuthorizeSecurityGroupIngressRequest generates a request for the AuthorizeSecurityGroupIngress operation. -func (c *EC2) AuthorizeSecurityGroupIngressRequest(input *AuthorizeSecurityGroupIngressInput) (req *aws.Request, output *AuthorizeSecurityGroupIngressOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opAuthorizeSecurityGroupIngress == nil { - opAuthorizeSecurityGroupIngress = &aws.Operation{ - Name: "AuthorizeSecurityGroupIngress", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *EC2) AuthorizeSecurityGroupIngressRequest(input *AuthorizeSecurityGroupIngressInput) (req *request.Request, output *AuthorizeSecurityGroupIngressOutput) { + op := &request.Operation{ + Name: opAuthorizeSecurityGroupIngress, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &AuthorizeSecurityGroupIngressInput{} } - req = c.newRequest(opAuthorizeSecurityGroupIngress, input, output) + req = c.newRequest(op, input, output) output = &AuthorizeSecurityGroupIngressOutput{} req.Data = output return @@ -554,26 +489,21 @@ func (c *EC2) AuthorizeSecurityGroupIngress(input *AuthorizeSecurityGroupIngress return out, err } -var opAuthorizeSecurityGroupIngress *aws.Operation +const opBundleInstance = "BundleInstance" // BundleInstanceRequest generates a request for the BundleInstance operation. -func (c *EC2) BundleInstanceRequest(input *BundleInstanceInput) (req *aws.Request, output *BundleInstanceOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opBundleInstance == nil { - opBundleInstance = &aws.Operation{ - Name: "BundleInstance", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *EC2) BundleInstanceRequest(input *BundleInstanceInput) (req *request.Request, output *BundleInstanceOutput) { + op := &request.Operation{ + Name: opBundleInstance, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &BundleInstanceInput{} } - req = c.newRequest(opBundleInstance, input, output) + req = c.newRequest(op, input, output) output = &BundleInstanceOutput{} req.Data = output return @@ -595,26 +525,21 @@ func (c *EC2) BundleInstance(input *BundleInstanceInput) (*BundleInstanceOutput, return out, err } -var opBundleInstance *aws.Operation +const opCancelBundleTask = "CancelBundleTask" // CancelBundleTaskRequest generates a request for the CancelBundleTask operation. -func (c *EC2) CancelBundleTaskRequest(input *CancelBundleTaskInput) (req *aws.Request, output *CancelBundleTaskOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opCancelBundleTask == nil { - opCancelBundleTask = &aws.Operation{ - Name: "CancelBundleTask", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *EC2) CancelBundleTaskRequest(input *CancelBundleTaskInput) (req *request.Request, output *CancelBundleTaskOutput) { + op := &request.Operation{ + Name: opCancelBundleTask, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &CancelBundleTaskInput{} } - req = c.newRequest(opCancelBundleTask, input, output) + req = c.newRequest(op, input, output) output = &CancelBundleTaskOutput{} req.Data = output return @@ -627,26 +552,21 @@ func (c *EC2) CancelBundleTask(input *CancelBundleTaskInput) (*CancelBundleTaskO return out, err } -var opCancelBundleTask *aws.Operation +const opCancelConversionTask = "CancelConversionTask" // CancelConversionTaskRequest generates a request for the CancelConversionTask operation. -func (c *EC2) CancelConversionTaskRequest(input *CancelConversionTaskInput) (req *aws.Request, output *CancelConversionTaskOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opCancelConversionTask == nil { - opCancelConversionTask = &aws.Operation{ - Name: "CancelConversionTask", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *EC2) CancelConversionTaskRequest(input *CancelConversionTaskInput) (req *request.Request, output *CancelConversionTaskOutput) { + op := &request.Operation{ + Name: opCancelConversionTask, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &CancelConversionTaskInput{} } - req = c.newRequest(opCancelConversionTask, input, output) + req = c.newRequest(op, input, output) output = &CancelConversionTaskOutput{} req.Data = output return @@ -667,26 +587,21 @@ func (c *EC2) CancelConversionTask(input *CancelConversionTaskInput) (*CancelCon return out, err } -var opCancelConversionTask *aws.Operation +const opCancelExportTask = "CancelExportTask" // CancelExportTaskRequest generates a request for the CancelExportTask operation. -func (c *EC2) CancelExportTaskRequest(input *CancelExportTaskInput) (req *aws.Request, output *CancelExportTaskOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opCancelExportTask == nil { - opCancelExportTask = &aws.Operation{ - Name: "CancelExportTask", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *EC2) CancelExportTaskRequest(input *CancelExportTaskInput) (req *request.Request, output *CancelExportTaskOutput) { + op := &request.Operation{ + Name: opCancelExportTask, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &CancelExportTaskInput{} } - req = c.newRequest(opCancelExportTask, input, output) + req = c.newRequest(op, input, output) output = &CancelExportTaskOutput{} req.Data = output return @@ -702,26 +617,21 @@ func (c *EC2) CancelExportTask(input *CancelExportTaskInput) (*CancelExportTaskO return out, err } -var opCancelExportTask *aws.Operation +const opCancelImportTask = "CancelImportTask" // CancelImportTaskRequest generates a request for the CancelImportTask operation. -func (c *EC2) CancelImportTaskRequest(input *CancelImportTaskInput) (req *aws.Request, output *CancelImportTaskOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opCancelImportTask == nil { - opCancelImportTask = &aws.Operation{ - Name: "CancelImportTask", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *EC2) CancelImportTaskRequest(input *CancelImportTaskInput) (req *request.Request, output *CancelImportTaskOutput) { + op := &request.Operation{ + Name: opCancelImportTask, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &CancelImportTaskInput{} } - req = c.newRequest(opCancelImportTask, input, output) + req = c.newRequest(op, input, output) output = &CancelImportTaskOutput{} req.Data = output return @@ -734,26 +644,21 @@ func (c *EC2) CancelImportTask(input *CancelImportTaskInput) (*CancelImportTaskO return out, err } -var opCancelImportTask *aws.Operation +const opCancelReservedInstancesListing = "CancelReservedInstancesListing" // CancelReservedInstancesListingRequest generates a request for the CancelReservedInstancesListing operation. -func (c *EC2) CancelReservedInstancesListingRequest(input *CancelReservedInstancesListingInput) (req *aws.Request, output *CancelReservedInstancesListingOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opCancelReservedInstancesListing == nil { - opCancelReservedInstancesListing = &aws.Operation{ - Name: "CancelReservedInstancesListing", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *EC2) CancelReservedInstancesListingRequest(input *CancelReservedInstancesListingInput) (req *request.Request, output *CancelReservedInstancesListingOutput) { + op := &request.Operation{ + Name: opCancelReservedInstancesListing, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &CancelReservedInstancesListingInput{} } - req = c.newRequest(opCancelReservedInstancesListing, input, output) + req = c.newRequest(op, input, output) output = &CancelReservedInstancesListingOutput{} req.Data = output return @@ -770,26 +675,21 @@ func (c *EC2) CancelReservedInstancesListing(input *CancelReservedInstancesListi return out, err } -var opCancelReservedInstancesListing *aws.Operation +const opCancelSpotFleetRequests = "CancelSpotFleetRequests" // CancelSpotFleetRequestsRequest generates a request for the CancelSpotFleetRequests operation. -func (c *EC2) CancelSpotFleetRequestsRequest(input *CancelSpotFleetRequestsInput) (req *aws.Request, output *CancelSpotFleetRequestsOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opCancelSpotFleetRequests == nil { - opCancelSpotFleetRequests = &aws.Operation{ - Name: "CancelSpotFleetRequests", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *EC2) CancelSpotFleetRequestsRequest(input *CancelSpotFleetRequestsInput) (req *request.Request, output *CancelSpotFleetRequestsOutput) { + op := &request.Operation{ + Name: opCancelSpotFleetRequests, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &CancelSpotFleetRequestsInput{} } - req = c.newRequest(opCancelSpotFleetRequests, input, output) + req = c.newRequest(op, input, output) output = &CancelSpotFleetRequestsOutput{} req.Data = output return @@ -802,39 +702,34 @@ func (c *EC2) CancelSpotFleetRequests(input *CancelSpotFleetRequestsInput) (*Can return out, err } -var opCancelSpotFleetRequests *aws.Operation +const opCancelSpotInstanceRequests = "CancelSpotInstanceRequests" // CancelSpotInstanceRequestsRequest generates a request for the CancelSpotInstanceRequests operation. -func (c *EC2) CancelSpotInstanceRequestsRequest(input *CancelSpotInstanceRequestsInput) (req *aws.Request, output *CancelSpotInstanceRequestsOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opCancelSpotInstanceRequests == nil { - opCancelSpotInstanceRequests = &aws.Operation{ - Name: "CancelSpotInstanceRequests", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *EC2) CancelSpotInstanceRequestsRequest(input *CancelSpotInstanceRequestsInput) (req *request.Request, output *CancelSpotInstanceRequestsOutput) { + op := &request.Operation{ + Name: opCancelSpotInstanceRequests, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &CancelSpotInstanceRequestsInput{} } - req = c.newRequest(opCancelSpotInstanceRequests, input, output) + req = c.newRequest(op, input, output) output = &CancelSpotInstanceRequestsOutput{} req.Data = output return } -// Cancels one or more Spot Instance requests. Spot Instances are instances +// Cancels one or more Spot instance requests. Spot instances are instances // that Amazon EC2 starts on your behalf when the bid price that you specify -// exceeds the current Spot Price. Amazon EC2 periodically sets the Spot Price -// based on available Spot Instance capacity and current Spot Instance requests. +// exceeds the current Spot price. Amazon EC2 periodically sets the Spot price +// based on available Spot instance capacity and current Spot instance requests. // For more information, see Spot Instance Requests (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-requests.html) // in the Amazon Elastic Compute Cloud User Guide. // -// Canceling a Spot Instance request does not terminate running Spot Instances +// Canceling a Spot instance request does not terminate running Spot instances // associated with the request. func (c *EC2) CancelSpotInstanceRequests(input *CancelSpotInstanceRequestsInput) (*CancelSpotInstanceRequestsOutput, error) { req, out := c.CancelSpotInstanceRequestsRequest(input) @@ -842,26 +737,21 @@ func (c *EC2) CancelSpotInstanceRequests(input *CancelSpotInstanceRequestsInput) return out, err } -var opCancelSpotInstanceRequests *aws.Operation +const opConfirmProductInstance = "ConfirmProductInstance" // ConfirmProductInstanceRequest generates a request for the ConfirmProductInstance operation. -func (c *EC2) ConfirmProductInstanceRequest(input *ConfirmProductInstanceInput) (req *aws.Request, output *ConfirmProductInstanceOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opConfirmProductInstance == nil { - opConfirmProductInstance = &aws.Operation{ - Name: "ConfirmProductInstance", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *EC2) ConfirmProductInstanceRequest(input *ConfirmProductInstanceInput) (req *request.Request, output *ConfirmProductInstanceOutput) { + op := &request.Operation{ + Name: opConfirmProductInstance, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &ConfirmProductInstanceInput{} } - req = c.newRequest(opConfirmProductInstance, input, output) + req = c.newRequest(op, input, output) output = &ConfirmProductInstanceOutput{} req.Data = output return @@ -877,26 +767,21 @@ func (c *EC2) ConfirmProductInstance(input *ConfirmProductInstanceInput) (*Confi return out, err } -var opConfirmProductInstance *aws.Operation +const opCopyImage = "CopyImage" // CopyImageRequest generates a request for the CopyImage operation. -func (c *EC2) CopyImageRequest(input *CopyImageInput) (req *aws.Request, output *CopyImageOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opCopyImage == nil { - opCopyImage = &aws.Operation{ - Name: "CopyImage", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *EC2) CopyImageRequest(input *CopyImageInput) (req *request.Request, output *CopyImageOutput) { + op := &request.Operation{ + Name: opCopyImage, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &CopyImageInput{} } - req = c.newRequest(opCopyImage, input, output) + req = c.newRequest(op, input, output) output = &CopyImageOutput{} req.Data = output return @@ -915,26 +800,21 @@ func (c *EC2) CopyImage(input *CopyImageInput) (*CopyImageOutput, error) { return out, err } -var opCopyImage *aws.Operation +const opCopySnapshot = "CopySnapshot" // CopySnapshotRequest generates a request for the CopySnapshot operation. -func (c *EC2) CopySnapshotRequest(input *CopySnapshotInput) (req *aws.Request, output *CopySnapshotOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opCopySnapshot == nil { - opCopySnapshot = &aws.Operation{ - Name: "CopySnapshot", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *EC2) CopySnapshotRequest(input *CopySnapshotInput) (req *request.Request, output *CopySnapshotOutput) { + op := &request.Operation{ + Name: opCopySnapshot, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &CopySnapshotInput{} } - req = c.newRequest(opCopySnapshot, input, output) + req = c.newRequest(op, input, output) output = &CopySnapshotOutput{} req.Data = output return @@ -947,12 +827,12 @@ func (c *EC2) CopySnapshotRequest(input *CopySnapshotInput) (req *aws.Request, o // the HTTP request to. // // Copies of encrypted EBS snapshots remain encrypted. Copies of unencrypted -// snapshots remain unencrypted. +// snapshots remain unencrypted, unless the Encrypted flag is specified during +// the snapshot copy operation. By default, encrypted snapshot copies use the +// default AWS Key Management Service (AWS KMS) customer master key (CMK); however, +// you can specify a non-default CMK with the KmsKeyId parameter. // -// Copying snapshots that were encrypted with non-default AWS Key Management -// Service (KMS) master keys is not supported at this time. -// -// For more information, see Copying an Amazon EBS Snapshot (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-copy-snapshot.html) +// For more information, see Copying an Amazon EBS Snapshot (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-copy-snapshot.html) // in the Amazon Elastic Compute Cloud User Guide. func (c *EC2) CopySnapshot(input *CopySnapshotInput) (*CopySnapshotOutput, error) { req, out := c.CopySnapshotRequest(input) @@ -960,26 +840,21 @@ func (c *EC2) CopySnapshot(input *CopySnapshotInput) (*CopySnapshotOutput, error return out, err } -var opCopySnapshot *aws.Operation +const opCreateCustomerGateway = "CreateCustomerGateway" // CreateCustomerGatewayRequest generates a request for the CreateCustomerGateway operation. -func (c *EC2) CreateCustomerGatewayRequest(input *CreateCustomerGatewayInput) (req *aws.Request, output *CreateCustomerGatewayOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opCreateCustomerGateway == nil { - opCreateCustomerGateway = &aws.Operation{ - Name: "CreateCustomerGateway", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *EC2) CreateCustomerGatewayRequest(input *CreateCustomerGatewayInput) (req *request.Request, output *CreateCustomerGatewayOutput) { + op := &request.Operation{ + Name: opCreateCustomerGateway, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &CreateCustomerGatewayInput{} } - req = c.newRequest(opCreateCustomerGateway, input, output) + req = c.newRequest(op, input, output) output = &CreateCustomerGatewayOutput{} req.Data = output return @@ -1016,27 +891,22 @@ func (c *EC2) CreateCustomerGateway(input *CreateCustomerGatewayInput) (*CreateC return out, err } -var opCreateCustomerGateway *aws.Operation +const opCreateDhcpOptions = "CreateDhcpOptions" -// CreateDHCPOptionsRequest generates a request for the CreateDHCPOptions operation. -func (c *EC2) CreateDHCPOptionsRequest(input *CreateDHCPOptionsInput) (req *aws.Request, output *CreateDHCPOptionsOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opCreateDHCPOptions == nil { - opCreateDHCPOptions = &aws.Operation{ - Name: "CreateDhcpOptions", - HTTPMethod: "POST", - HTTPPath: "/", - } +// CreateDhcpOptionsRequest generates a request for the CreateDhcpOptions operation. +func (c *EC2) CreateDhcpOptionsRequest(input *CreateDhcpOptionsInput) (req *request.Request, output *CreateDhcpOptionsOutput) { + op := &request.Operation{ + Name: opCreateDhcpOptions, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { - input = &CreateDHCPOptionsInput{} + input = &CreateDhcpOptionsInput{} } - req = c.newRequest(opCreateDHCPOptions, input, output) - output = &CreateDHCPOptionsOutput{} + req = c.newRequest(op, input, output) + output = &CreateDhcpOptionsOutput{} req.Data = output return } @@ -1070,32 +940,63 @@ func (c *EC2) CreateDHCPOptionsRequest(input *CreateDHCPOptionsInput) (req *aws. // either to AmazonProvidedDNS or to a domain name server of your choice. For // more information about DHCP options, see DHCP Options Sets (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_DHCP_Options.html) // in the Amazon Virtual Private Cloud User Guide. -func (c *EC2) CreateDHCPOptions(input *CreateDHCPOptionsInput) (*CreateDHCPOptionsOutput, error) { - req, out := c.CreateDHCPOptionsRequest(input) +func (c *EC2) CreateDhcpOptions(input *CreateDhcpOptionsInput) (*CreateDhcpOptionsOutput, error) { + req, out := c.CreateDhcpOptionsRequest(input) err := req.Send() return out, err } -var opCreateDHCPOptions *aws.Operation +const opCreateFlowLogs = "CreateFlowLogs" -// CreateImageRequest generates a request for the CreateImage operation. -func (c *EC2) CreateImageRequest(input *CreateImageInput) (req *aws.Request, output *CreateImageOutput) { - oprw.Lock() - defer oprw.Unlock() +// CreateFlowLogsRequest generates a request for the CreateFlowLogs operation. +func (c *EC2) CreateFlowLogsRequest(input *CreateFlowLogsInput) (req *request.Request, output *CreateFlowLogsOutput) { + op := &request.Operation{ + Name: opCreateFlowLogs, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &CreateFlowLogsInput{} + } + + req = c.newRequest(op, input, output) + output = &CreateFlowLogsOutput{} + req.Data = output + return +} + +// Creates one or more flow logs to capture IP traffic for a specific network +// interface, subnet, or VPC. Flow logs are delivered to a specified log group +// in Amazon CloudWatch Logs. If you specify a VPC or subnet in the request, +// a log stream is created in CloudWatch Logs for each network interface in +// the subnet or VPC. Log streams can include information about accepted and +// rejected traffic to a network interface. You can view the data in your log +// streams using Amazon CloudWatch Logs. +// +// In your request, you must also specify an IAM role that has permission to +// publish logs to CloudWatch Logs. +func (c *EC2) CreateFlowLogs(input *CreateFlowLogsInput) (*CreateFlowLogsOutput, error) { + req, out := c.CreateFlowLogsRequest(input) + err := req.Send() + return out, err +} + +const opCreateImage = "CreateImage" - if opCreateImage == nil { - opCreateImage = &aws.Operation{ - Name: "CreateImage", - HTTPMethod: "POST", - HTTPPath: "/", - } +// CreateImageRequest generates a request for the CreateImage operation. +func (c *EC2) CreateImageRequest(input *CreateImageInput) (req *request.Request, output *CreateImageOutput) { + op := &request.Operation{ + Name: opCreateImage, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &CreateImageInput{} } - req = c.newRequest(opCreateImage, input, output) + req = c.newRequest(op, input, output) output = &CreateImageOutput{} req.Data = output return @@ -1117,26 +1018,21 @@ func (c *EC2) CreateImage(input *CreateImageInput) (*CreateImageOutput, error) { return out, err } -var opCreateImage *aws.Operation +const opCreateInstanceExportTask = "CreateInstanceExportTask" // CreateInstanceExportTaskRequest generates a request for the CreateInstanceExportTask operation. -func (c *EC2) CreateInstanceExportTaskRequest(input *CreateInstanceExportTaskInput) (req *aws.Request, output *CreateInstanceExportTaskOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opCreateInstanceExportTask == nil { - opCreateInstanceExportTask = &aws.Operation{ - Name: "CreateInstanceExportTask", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *EC2) CreateInstanceExportTaskRequest(input *CreateInstanceExportTaskInput) (req *request.Request, output *CreateInstanceExportTaskOutput) { + op := &request.Operation{ + Name: opCreateInstanceExportTask, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &CreateInstanceExportTaskInput{} } - req = c.newRequest(opCreateInstanceExportTask, input, output) + req = c.newRequest(op, input, output) output = &CreateInstanceExportTaskOutput{} req.Data = output return @@ -1154,26 +1050,21 @@ func (c *EC2) CreateInstanceExportTask(input *CreateInstanceExportTaskInput) (*C return out, err } -var opCreateInstanceExportTask *aws.Operation +const opCreateInternetGateway = "CreateInternetGateway" // CreateInternetGatewayRequest generates a request for the CreateInternetGateway operation. -func (c *EC2) CreateInternetGatewayRequest(input *CreateInternetGatewayInput) (req *aws.Request, output *CreateInternetGatewayOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opCreateInternetGateway == nil { - opCreateInternetGateway = &aws.Operation{ - Name: "CreateInternetGateway", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *EC2) CreateInternetGatewayRequest(input *CreateInternetGatewayInput) (req *request.Request, output *CreateInternetGatewayOutput) { + op := &request.Operation{ + Name: opCreateInternetGateway, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &CreateInternetGatewayInput{} } - req = c.newRequest(opCreateInternetGateway, input, output) + req = c.newRequest(op, input, output) output = &CreateInternetGatewayOutput{} req.Data = output return @@ -1190,26 +1081,21 @@ func (c *EC2) CreateInternetGateway(input *CreateInternetGatewayInput) (*CreateI return out, err } -var opCreateInternetGateway *aws.Operation +const opCreateKeyPair = "CreateKeyPair" // CreateKeyPairRequest generates a request for the CreateKeyPair operation. -func (c *EC2) CreateKeyPairRequest(input *CreateKeyPairInput) (req *aws.Request, output *CreateKeyPairOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opCreateKeyPair == nil { - opCreateKeyPair = &aws.Operation{ - Name: "CreateKeyPair", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *EC2) CreateKeyPairRequest(input *CreateKeyPairInput) (req *request.Request, output *CreateKeyPairOutput) { + op := &request.Operation{ + Name: opCreateKeyPair, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &CreateKeyPairInput{} } - req = c.newRequest(opCreateKeyPair, input, output) + req = c.newRequest(op, input, output) output = &CreateKeyPairOutput{} req.Data = output return @@ -1233,27 +1119,22 @@ func (c *EC2) CreateKeyPair(input *CreateKeyPairInput) (*CreateKeyPairOutput, er return out, err } -var opCreateKeyPair *aws.Operation +const opCreateNetworkAcl = "CreateNetworkAcl" -// CreateNetworkACLRequest generates a request for the CreateNetworkACL operation. -func (c *EC2) CreateNetworkACLRequest(input *CreateNetworkACLInput) (req *aws.Request, output *CreateNetworkACLOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opCreateNetworkACL == nil { - opCreateNetworkACL = &aws.Operation{ - Name: "CreateNetworkAcl", - HTTPMethod: "POST", - HTTPPath: "/", - } +// CreateNetworkAclRequest generates a request for the CreateNetworkAcl operation. +func (c *EC2) CreateNetworkAclRequest(input *CreateNetworkAclInput) (req *request.Request, output *CreateNetworkAclOutput) { + op := &request.Operation{ + Name: opCreateNetworkAcl, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { - input = &CreateNetworkACLInput{} + input = &CreateNetworkAclInput{} } - req = c.newRequest(opCreateNetworkACL, input, output) - output = &CreateNetworkACLOutput{} + req = c.newRequest(op, input, output) + output = &CreateNetworkAclOutput{} req.Data = output return } @@ -1263,33 +1144,28 @@ func (c *EC2) CreateNetworkACLRequest(input *CreateNetworkACLInput) (req *aws.Re // // For more information about network ACLs, see Network ACLs (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_ACLs.html) // in the Amazon Virtual Private Cloud User Guide. -func (c *EC2) CreateNetworkACL(input *CreateNetworkACLInput) (*CreateNetworkACLOutput, error) { - req, out := c.CreateNetworkACLRequest(input) +func (c *EC2) CreateNetworkAcl(input *CreateNetworkAclInput) (*CreateNetworkAclOutput, error) { + req, out := c.CreateNetworkAclRequest(input) err := req.Send() return out, err } -var opCreateNetworkACL *aws.Operation - -// CreateNetworkACLEntryRequest generates a request for the CreateNetworkACLEntry operation. -func (c *EC2) CreateNetworkACLEntryRequest(input *CreateNetworkACLEntryInput) (req *aws.Request, output *CreateNetworkACLEntryOutput) { - oprw.Lock() - defer oprw.Unlock() +const opCreateNetworkAclEntry = "CreateNetworkAclEntry" - if opCreateNetworkACLEntry == nil { - opCreateNetworkACLEntry = &aws.Operation{ - Name: "CreateNetworkAclEntry", - HTTPMethod: "POST", - HTTPPath: "/", - } +// CreateNetworkAclEntryRequest generates a request for the CreateNetworkAclEntry operation. +func (c *EC2) CreateNetworkAclEntryRequest(input *CreateNetworkAclEntryInput) (req *request.Request, output *CreateNetworkAclEntryOutput) { + op := &request.Operation{ + Name: opCreateNetworkAclEntry, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { - input = &CreateNetworkACLEntryInput{} + input = &CreateNetworkAclEntryInput{} } - req = c.newRequest(opCreateNetworkACLEntry, input, output) - output = &CreateNetworkACLEntryOutput{} + req = c.newRequest(op, input, output) + output = &CreateNetworkAclEntryOutput{} req.Data = output return } @@ -1311,32 +1187,27 @@ func (c *EC2) CreateNetworkACLEntryRequest(input *CreateNetworkACLEntryInput) (r // // For more information about network ACLs, see Network ACLs (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_ACLs.html) // in the Amazon Virtual Private Cloud User Guide. -func (c *EC2) CreateNetworkACLEntry(input *CreateNetworkACLEntryInput) (*CreateNetworkACLEntryOutput, error) { - req, out := c.CreateNetworkACLEntryRequest(input) +func (c *EC2) CreateNetworkAclEntry(input *CreateNetworkAclEntryInput) (*CreateNetworkAclEntryOutput, error) { + req, out := c.CreateNetworkAclEntryRequest(input) err := req.Send() return out, err } -var opCreateNetworkACLEntry *aws.Operation +const opCreateNetworkInterface = "CreateNetworkInterface" // CreateNetworkInterfaceRequest generates a request for the CreateNetworkInterface operation. -func (c *EC2) CreateNetworkInterfaceRequest(input *CreateNetworkInterfaceInput) (req *aws.Request, output *CreateNetworkInterfaceOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opCreateNetworkInterface == nil { - opCreateNetworkInterface = &aws.Operation{ - Name: "CreateNetworkInterface", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *EC2) CreateNetworkInterfaceRequest(input *CreateNetworkInterfaceInput) (req *request.Request, output *CreateNetworkInterfaceOutput) { + op := &request.Operation{ + Name: opCreateNetworkInterface, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &CreateNetworkInterfaceInput{} } - req = c.newRequest(opCreateNetworkInterface, input, output) + req = c.newRequest(op, input, output) output = &CreateNetworkInterfaceOutput{} req.Data = output return @@ -1353,26 +1224,21 @@ func (c *EC2) CreateNetworkInterface(input *CreateNetworkInterfaceInput) (*Creat return out, err } -var opCreateNetworkInterface *aws.Operation +const opCreatePlacementGroup = "CreatePlacementGroup" // CreatePlacementGroupRequest generates a request for the CreatePlacementGroup operation. -func (c *EC2) CreatePlacementGroupRequest(input *CreatePlacementGroupInput) (req *aws.Request, output *CreatePlacementGroupOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opCreatePlacementGroup == nil { - opCreatePlacementGroup = &aws.Operation{ - Name: "CreatePlacementGroup", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *EC2) CreatePlacementGroupRequest(input *CreatePlacementGroupInput) (req *request.Request, output *CreatePlacementGroupOutput) { + op := &request.Operation{ + Name: opCreatePlacementGroup, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &CreatePlacementGroupInput{} } - req = c.newRequest(opCreatePlacementGroup, input, output) + req = c.newRequest(op, input, output) output = &CreatePlacementGroupOutput{} req.Data = output return @@ -1390,26 +1256,21 @@ func (c *EC2) CreatePlacementGroup(input *CreatePlacementGroupInput) (*CreatePla return out, err } -var opCreatePlacementGroup *aws.Operation +const opCreateReservedInstancesListing = "CreateReservedInstancesListing" // CreateReservedInstancesListingRequest generates a request for the CreateReservedInstancesListing operation. -func (c *EC2) CreateReservedInstancesListingRequest(input *CreateReservedInstancesListingInput) (req *aws.Request, output *CreateReservedInstancesListingOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opCreateReservedInstancesListing == nil { - opCreateReservedInstancesListing = &aws.Operation{ - Name: "CreateReservedInstancesListing", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *EC2) CreateReservedInstancesListingRequest(input *CreateReservedInstancesListingInput) (req *request.Request, output *CreateReservedInstancesListingOutput) { + op := &request.Operation{ + Name: opCreateReservedInstancesListing, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &CreateReservedInstancesListingInput{} } - req = c.newRequest(opCreateReservedInstancesListing, input, output) + req = c.newRequest(op, input, output) output = &CreateReservedInstancesListingOutput{} req.Data = output return @@ -1425,7 +1286,7 @@ func (c *EC2) CreateReservedInstancesListingRequest(input *CreateReservedInstanc // additional capacity. Reserved Instances bought and sold through the Reserved // Instance Marketplace work like any other Reserved Instances. // -// To sell your Reserved Instances, you must first register as a Seller in +// To sell your Reserved Instances, you must first register as a seller in // the Reserved Instance Marketplace. After completing the registration process, // you can create a Reserved Instance Marketplace listing of some or all of // your Reserved Instances, and specify the upfront price to receive for them. @@ -1441,26 +1302,21 @@ func (c *EC2) CreateReservedInstancesListing(input *CreateReservedInstancesListi return out, err } -var opCreateReservedInstancesListing *aws.Operation +const opCreateRoute = "CreateRoute" // CreateRouteRequest generates a request for the CreateRoute operation. -func (c *EC2) CreateRouteRequest(input *CreateRouteInput) (req *aws.Request, output *CreateRouteOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opCreateRoute == nil { - opCreateRoute = &aws.Operation{ - Name: "CreateRoute", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *EC2) CreateRouteRequest(input *CreateRouteInput) (req *request.Request, output *CreateRouteOutput) { + op := &request.Operation{ + Name: opCreateRoute, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &CreateRouteInput{} } - req = c.newRequest(opCreateRoute, input, output) + req = c.newRequest(op, input, output) output = &CreateRouteOutput{} req.Data = output return @@ -1491,26 +1347,21 @@ func (c *EC2) CreateRoute(input *CreateRouteInput) (*CreateRouteOutput, error) { return out, err } -var opCreateRoute *aws.Operation +const opCreateRouteTable = "CreateRouteTable" // CreateRouteTableRequest generates a request for the CreateRouteTable operation. -func (c *EC2) CreateRouteTableRequest(input *CreateRouteTableInput) (req *aws.Request, output *CreateRouteTableOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opCreateRouteTable == nil { - opCreateRouteTable = &aws.Operation{ - Name: "CreateRouteTable", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *EC2) CreateRouteTableRequest(input *CreateRouteTableInput) (req *request.Request, output *CreateRouteTableOutput) { + op := &request.Operation{ + Name: opCreateRouteTable, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &CreateRouteTableInput{} } - req = c.newRequest(opCreateRouteTable, input, output) + req = c.newRequest(op, input, output) output = &CreateRouteTableOutput{} req.Data = output return @@ -1527,26 +1378,21 @@ func (c *EC2) CreateRouteTable(input *CreateRouteTableInput) (*CreateRouteTableO return out, err } -var opCreateRouteTable *aws.Operation +const opCreateSecurityGroup = "CreateSecurityGroup" // CreateSecurityGroupRequest generates a request for the CreateSecurityGroup operation. -func (c *EC2) CreateSecurityGroupRequest(input *CreateSecurityGroupInput) (req *aws.Request, output *CreateSecurityGroupOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opCreateSecurityGroup == nil { - opCreateSecurityGroup = &aws.Operation{ - Name: "CreateSecurityGroup", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *EC2) CreateSecurityGroupRequest(input *CreateSecurityGroupInput) (req *request.Request, output *CreateSecurityGroupOutput) { + op := &request.Operation{ + Name: opCreateSecurityGroup, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &CreateSecurityGroupInput{} } - req = c.newRequest(opCreateSecurityGroup, input, output) + req = c.newRequest(op, input, output) output = &CreateSecurityGroupOutput{} req.Data = output return @@ -1585,26 +1431,21 @@ func (c *EC2) CreateSecurityGroup(input *CreateSecurityGroupInput) (*CreateSecur return out, err } -var opCreateSecurityGroup *aws.Operation +const opCreateSnapshot = "CreateSnapshot" // CreateSnapshotRequest generates a request for the CreateSnapshot operation. -func (c *EC2) CreateSnapshotRequest(input *CreateSnapshotInput) (req *aws.Request, output *Snapshot) { - oprw.Lock() - defer oprw.Unlock() - - if opCreateSnapshot == nil { - opCreateSnapshot = &aws.Operation{ - Name: "CreateSnapshot", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *EC2) CreateSnapshotRequest(input *CreateSnapshotInput) (req *request.Request, output *Snapshot) { + op := &request.Operation{ + Name: opCreateSnapshot, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &CreateSnapshotInput{} } - req = c.newRequest(opCreateSnapshot, input, output) + req = c.newRequest(op, input, output) output = &Snapshot{} req.Data = output return @@ -1644,32 +1485,27 @@ func (c *EC2) CreateSnapshot(input *CreateSnapshotInput) (*Snapshot, error) { return out, err } -var opCreateSnapshot *aws.Operation +const opCreateSpotDatafeedSubscription = "CreateSpotDatafeedSubscription" // CreateSpotDatafeedSubscriptionRequest generates a request for the CreateSpotDatafeedSubscription operation. -func (c *EC2) CreateSpotDatafeedSubscriptionRequest(input *CreateSpotDatafeedSubscriptionInput) (req *aws.Request, output *CreateSpotDatafeedSubscriptionOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opCreateSpotDatafeedSubscription == nil { - opCreateSpotDatafeedSubscription = &aws.Operation{ - Name: "CreateSpotDatafeedSubscription", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *EC2) CreateSpotDatafeedSubscriptionRequest(input *CreateSpotDatafeedSubscriptionInput) (req *request.Request, output *CreateSpotDatafeedSubscriptionOutput) { + op := &request.Operation{ + Name: opCreateSpotDatafeedSubscription, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &CreateSpotDatafeedSubscriptionInput{} } - req = c.newRequest(opCreateSpotDatafeedSubscription, input, output) + req = c.newRequest(op, input, output) output = &CreateSpotDatafeedSubscriptionOutput{} req.Data = output return } -// Creates a data feed for Spot Instances, enabling you to view Spot Instance +// Creates a data feed for Spot instances, enabling you to view Spot instance // usage logs. You can create one data feed per AWS account. For more information, // see Spot Instance Data Feed (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-data-feeds.html) // in the Amazon Elastic Compute Cloud User Guide. @@ -1679,26 +1515,21 @@ func (c *EC2) CreateSpotDatafeedSubscription(input *CreateSpotDatafeedSubscripti return out, err } -var opCreateSpotDatafeedSubscription *aws.Operation +const opCreateSubnet = "CreateSubnet" // CreateSubnetRequest generates a request for the CreateSubnet operation. -func (c *EC2) CreateSubnetRequest(input *CreateSubnetInput) (req *aws.Request, output *CreateSubnetOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opCreateSubnet == nil { - opCreateSubnet = &aws.Operation{ - Name: "CreateSubnet", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *EC2) CreateSubnetRequest(input *CreateSubnetInput) (req *request.Request, output *CreateSubnetOutput) { + op := &request.Operation{ + Name: opCreateSubnet, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &CreateSubnetInput{} } - req = c.newRequest(opCreateSubnet, input, output) + req = c.newRequest(op, input, output) output = &CreateSubnetOutput{} req.Data = output return @@ -1735,26 +1566,21 @@ func (c *EC2) CreateSubnet(input *CreateSubnetInput) (*CreateSubnetOutput, error return out, err } -var opCreateSubnet *aws.Operation +const opCreateTags = "CreateTags" // CreateTagsRequest generates a request for the CreateTags operation. -func (c *EC2) CreateTagsRequest(input *CreateTagsInput) (req *aws.Request, output *CreateTagsOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opCreateTags == nil { - opCreateTags = &aws.Operation{ - Name: "CreateTags", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *EC2) CreateTagsRequest(input *CreateTagsInput) (req *request.Request, output *CreateTagsOutput) { + op := &request.Operation{ + Name: opCreateTags, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &CreateTagsInput{} } - req = c.newRequest(opCreateTags, input, output) + req = c.newRequest(op, input, output) output = &CreateTagsOutput{} req.Data = output return @@ -1772,27 +1598,64 @@ func (c *EC2) CreateTags(input *CreateTagsInput) (*CreateTagsOutput, error) { return out, err } -var opCreateTags *aws.Operation +const opCreateVolume = "CreateVolume" + +// CreateVolumeRequest generates a request for the CreateVolume operation. +func (c *EC2) CreateVolumeRequest(input *CreateVolumeInput) (req *request.Request, output *Volume) { + op := &request.Operation{ + Name: opCreateVolume, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &CreateVolumeInput{} + } + + req = c.newRequest(op, input, output) + output = &Volume{} + req.Data = output + return +} + +// Creates an EBS volume that can be attached to an instance in the same Availability +// Zone. The volume is created in the regional endpoint that you send the HTTP +// request to. For more information see Regions and Endpoints (http://docs.aws.amazon.com/general/latest/gr/rande.html). +// +// You can create a new empty volume or restore a volume from an EBS snapshot. +// Any AWS Marketplace product codes from the snapshot are propagated to the +// volume. +// +// You can create encrypted volumes with the Encrypted parameter. Encrypted +// volumes may only be attached to instances that support Amazon EBS encryption. +// Volumes that are created from encrypted snapshots are also automatically +// encrypted. For more information, see Amazon EBS Encryption (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html) +// in the Amazon Elastic Compute Cloud User Guide. +// +// For more information, see Creating or Restoring an Amazon EBS Volume (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-creating-volume.html) +// in the Amazon Elastic Compute Cloud User Guide. +func (c *EC2) CreateVolume(input *CreateVolumeInput) (*Volume, error) { + req, out := c.CreateVolumeRequest(input) + err := req.Send() + return out, err +} -// CreateVPCRequest generates a request for the CreateVPC operation. -func (c *EC2) CreateVPCRequest(input *CreateVPCInput) (req *aws.Request, output *CreateVPCOutput) { - oprw.Lock() - defer oprw.Unlock() +const opCreateVpc = "CreateVpc" - if opCreateVPC == nil { - opCreateVPC = &aws.Operation{ - Name: "CreateVpc", - HTTPMethod: "POST", - HTTPPath: "/", - } +// CreateVpcRequest generates a request for the CreateVpc operation. +func (c *EC2) CreateVpcRequest(input *CreateVpcInput) (req *request.Request, output *CreateVpcOutput) { + op := &request.Operation{ + Name: opCreateVpc, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { - input = &CreateVPCInput{} + input = &CreateVpcInput{} } - req = c.newRequest(opCreateVPC, input, output) - output = &CreateVPCOutput{} + req = c.newRequest(op, input, output) + output = &CreateVpcOutput{} req.Data = output return } @@ -1808,33 +1671,28 @@ func (c *EC2) CreateVPCRequest(input *CreateVPCInput) (req *aws.Request, output // which includes only a default DNS server that we provide (AmazonProvidedDNS). // For more information about DHCP options, see DHCP Options Sets (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_DHCP_Options.html) // in the Amazon Virtual Private Cloud User Guide. -func (c *EC2) CreateVPC(input *CreateVPCInput) (*CreateVPCOutput, error) { - req, out := c.CreateVPCRequest(input) +func (c *EC2) CreateVpc(input *CreateVpcInput) (*CreateVpcOutput, error) { + req, out := c.CreateVpcRequest(input) err := req.Send() return out, err } -var opCreateVPC *aws.Operation +const opCreateVpcEndpoint = "CreateVpcEndpoint" -// CreateVPCEndpointRequest generates a request for the CreateVPCEndpoint operation. -func (c *EC2) CreateVPCEndpointRequest(input *CreateVPCEndpointInput) (req *aws.Request, output *CreateVPCEndpointOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opCreateVPCEndpoint == nil { - opCreateVPCEndpoint = &aws.Operation{ - Name: "CreateVpcEndpoint", - HTTPMethod: "POST", - HTTPPath: "/", - } +// CreateVpcEndpointRequest generates a request for the CreateVpcEndpoint operation. +func (c *EC2) CreateVpcEndpointRequest(input *CreateVpcEndpointInput) (req *request.Request, output *CreateVpcEndpointOutput) { + op := &request.Operation{ + Name: opCreateVpcEndpoint, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { - input = &CreateVPCEndpointInput{} + input = &CreateVpcEndpointInput{} } - req = c.newRequest(opCreateVPCEndpoint, input, output) - output = &CreateVPCEndpointOutput{} + req = c.newRequest(op, input, output) + output = &CreateVpcEndpointOutput{} req.Data = output return } @@ -1846,33 +1704,28 @@ func (c *EC2) CreateVPCEndpointRequest(input *CreateVPCEndpointInput) (req *aws. // the VPC route tables that use the endpoint. // // Currently, only endpoints to Amazon S3 are supported. -func (c *EC2) CreateVPCEndpoint(input *CreateVPCEndpointInput) (*CreateVPCEndpointOutput, error) { - req, out := c.CreateVPCEndpointRequest(input) +func (c *EC2) CreateVpcEndpoint(input *CreateVpcEndpointInput) (*CreateVpcEndpointOutput, error) { + req, out := c.CreateVpcEndpointRequest(input) err := req.Send() return out, err } -var opCreateVPCEndpoint *aws.Operation - -// CreateVPCPeeringConnectionRequest generates a request for the CreateVPCPeeringConnection operation. -func (c *EC2) CreateVPCPeeringConnectionRequest(input *CreateVPCPeeringConnectionInput) (req *aws.Request, output *CreateVPCPeeringConnectionOutput) { - oprw.Lock() - defer oprw.Unlock() +const opCreateVpcPeeringConnection = "CreateVpcPeeringConnection" - if opCreateVPCPeeringConnection == nil { - opCreateVPCPeeringConnection = &aws.Operation{ - Name: "CreateVpcPeeringConnection", - HTTPMethod: "POST", - HTTPPath: "/", - } +// CreateVpcPeeringConnectionRequest generates a request for the CreateVpcPeeringConnection operation. +func (c *EC2) CreateVpcPeeringConnectionRequest(input *CreateVpcPeeringConnectionInput) (req *request.Request, output *CreateVpcPeeringConnectionOutput) { + op := &request.Operation{ + Name: opCreateVpcPeeringConnection, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { - input = &CreateVPCPeeringConnectionInput{} + input = &CreateVpcPeeringConnectionInput{} } - req = c.newRequest(opCreateVPCPeeringConnection, input, output) - output = &CreateVPCPeeringConnectionOutput{} + req = c.newRequest(op, input, output) + output = &CreateVpcPeeringConnectionOutput{} req.Data = output return } @@ -1888,33 +1741,28 @@ func (c *EC2) CreateVPCPeeringConnectionRequest(input *CreateVPCPeeringConnectio // // A CreateVpcPeeringConnection request between VPCs with overlapping CIDR // blocks results in the VPC peering connection having a status of failed. -func (c *EC2) CreateVPCPeeringConnection(input *CreateVPCPeeringConnectionInput) (*CreateVPCPeeringConnectionOutput, error) { - req, out := c.CreateVPCPeeringConnectionRequest(input) +func (c *EC2) CreateVpcPeeringConnection(input *CreateVpcPeeringConnectionInput) (*CreateVpcPeeringConnectionOutput, error) { + req, out := c.CreateVpcPeeringConnectionRequest(input) err := req.Send() return out, err } -var opCreateVPCPeeringConnection *aws.Operation +const opCreateVpnConnection = "CreateVpnConnection" -// CreateVPNConnectionRequest generates a request for the CreateVPNConnection operation. -func (c *EC2) CreateVPNConnectionRequest(input *CreateVPNConnectionInput) (req *aws.Request, output *CreateVPNConnectionOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opCreateVPNConnection == nil { - opCreateVPNConnection = &aws.Operation{ - Name: "CreateVpnConnection", - HTTPMethod: "POST", - HTTPPath: "/", - } +// CreateVpnConnectionRequest generates a request for the CreateVpnConnection operation. +func (c *EC2) CreateVpnConnectionRequest(input *CreateVpnConnectionInput) (req *request.Request, output *CreateVpnConnectionOutput) { + op := &request.Operation{ + Name: opCreateVpnConnection, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { - input = &CreateVPNConnectionInput{} + input = &CreateVpnConnectionInput{} } - req = c.newRequest(opCreateVPNConnection, input, output) - output = &CreateVPNConnectionOutput{} + req = c.newRequest(op, input, output) + output = &CreateVpnConnectionOutput{} req.Data = output return } @@ -1936,33 +1784,28 @@ func (c *EC2) CreateVPNConnectionRequest(input *CreateVPNConnectionInput) (req * // For more information about VPN connections, see Adding a Hardware Virtual // Private Gateway to Your VPC (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_VPN.html) // in the Amazon Virtual Private Cloud User Guide. -func (c *EC2) CreateVPNConnection(input *CreateVPNConnectionInput) (*CreateVPNConnectionOutput, error) { - req, out := c.CreateVPNConnectionRequest(input) +func (c *EC2) CreateVpnConnection(input *CreateVpnConnectionInput) (*CreateVpnConnectionOutput, error) { + req, out := c.CreateVpnConnectionRequest(input) err := req.Send() return out, err } -var opCreateVPNConnection *aws.Operation - -// CreateVPNConnectionRouteRequest generates a request for the CreateVPNConnectionRoute operation. -func (c *EC2) CreateVPNConnectionRouteRequest(input *CreateVPNConnectionRouteInput) (req *aws.Request, output *CreateVPNConnectionRouteOutput) { - oprw.Lock() - defer oprw.Unlock() +const opCreateVpnConnectionRoute = "CreateVpnConnectionRoute" - if opCreateVPNConnectionRoute == nil { - opCreateVPNConnectionRoute = &aws.Operation{ - Name: "CreateVpnConnectionRoute", - HTTPMethod: "POST", - HTTPPath: "/", - } +// CreateVpnConnectionRouteRequest generates a request for the CreateVpnConnectionRoute operation. +func (c *EC2) CreateVpnConnectionRouteRequest(input *CreateVpnConnectionRouteInput) (req *request.Request, output *CreateVpnConnectionRouteOutput) { + op := &request.Operation{ + Name: opCreateVpnConnectionRoute, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { - input = &CreateVPNConnectionRouteInput{} + input = &CreateVpnConnectionRouteInput{} } - req = c.newRequest(opCreateVPNConnectionRoute, input, output) - output = &CreateVPNConnectionRouteOutput{} + req = c.newRequest(op, input, output) + output = &CreateVpnConnectionRouteOutput{} req.Data = output return } @@ -1975,33 +1818,28 @@ func (c *EC2) CreateVPNConnectionRouteRequest(input *CreateVPNConnectionRouteInp // For more information about VPN connections, see Adding a Hardware Virtual // Private Gateway to Your VPC (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_VPN.html) // in the Amazon Virtual Private Cloud User Guide. -func (c *EC2) CreateVPNConnectionRoute(input *CreateVPNConnectionRouteInput) (*CreateVPNConnectionRouteOutput, error) { - req, out := c.CreateVPNConnectionRouteRequest(input) +func (c *EC2) CreateVpnConnectionRoute(input *CreateVpnConnectionRouteInput) (*CreateVpnConnectionRouteOutput, error) { + req, out := c.CreateVpnConnectionRouteRequest(input) err := req.Send() return out, err } -var opCreateVPNConnectionRoute *aws.Operation +const opCreateVpnGateway = "CreateVpnGateway" -// CreateVPNGatewayRequest generates a request for the CreateVPNGateway operation. -func (c *EC2) CreateVPNGatewayRequest(input *CreateVPNGatewayInput) (req *aws.Request, output *CreateVPNGatewayOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opCreateVPNGateway == nil { - opCreateVPNGateway = &aws.Operation{ - Name: "CreateVpnGateway", - HTTPMethod: "POST", - HTTPPath: "/", - } +// CreateVpnGatewayRequest generates a request for the CreateVpnGateway operation. +func (c *EC2) CreateVpnGatewayRequest(input *CreateVpnGatewayInput) (req *request.Request, output *CreateVpnGatewayOutput) { + op := &request.Operation{ + Name: opCreateVpnGateway, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { - input = &CreateVPNGatewayInput{} + input = &CreateVpnGatewayInput{} } - req = c.newRequest(opCreateVPNGateway, input, output) - output = &CreateVPNGatewayOutput{} + req = c.newRequest(op, input, output) + output = &CreateVpnGatewayOutput{} req.Data = output return } @@ -2013,147 +1851,112 @@ func (c *EC2) CreateVPNGatewayRequest(input *CreateVPNGatewayInput) (req *aws.Re // For more information about virtual private gateways, see Adding a Hardware // Virtual Private Gateway to Your VPC (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_VPN.html) // in the Amazon Virtual Private Cloud User Guide. -func (c *EC2) CreateVPNGateway(input *CreateVPNGatewayInput) (*CreateVPNGatewayOutput, error) { - req, out := c.CreateVPNGatewayRequest(input) +func (c *EC2) CreateVpnGateway(input *CreateVpnGatewayInput) (*CreateVpnGatewayOutput, error) { + req, out := c.CreateVpnGatewayRequest(input) err := req.Send() return out, err } -var opCreateVPNGateway *aws.Operation - -// CreateVolumeRequest generates a request for the CreateVolume operation. -func (c *EC2) CreateVolumeRequest(input *CreateVolumeInput) (req *aws.Request, output *Volume) { - oprw.Lock() - defer oprw.Unlock() +const opDeleteCustomerGateway = "DeleteCustomerGateway" - if opCreateVolume == nil { - opCreateVolume = &aws.Operation{ - Name: "CreateVolume", - HTTPMethod: "POST", - HTTPPath: "/", - } +// DeleteCustomerGatewayRequest generates a request for the DeleteCustomerGateway operation. +func (c *EC2) DeleteCustomerGatewayRequest(input *DeleteCustomerGatewayInput) (req *request.Request, output *DeleteCustomerGatewayOutput) { + op := &request.Operation{ + Name: opDeleteCustomerGateway, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { - input = &CreateVolumeInput{} + input = &DeleteCustomerGatewayInput{} } - req = c.newRequest(opCreateVolume, input, output) - output = &Volume{} + req = c.newRequest(op, input, output) + output = &DeleteCustomerGatewayOutput{} req.Data = output return } -// Creates an EBS volume that can be attached to an instance in the same Availability -// Zone. The volume is created in the regional endpoint that you send the HTTP -// request to. For more information see Regions and Endpoints (http://docs.aws.amazon.com/general/latest/gr/rande.html). -// -// You can create a new empty volume or restore a volume from an EBS snapshot. -// Any AWS Marketplace product codes from the snapshot are propagated to the -// volume. -// -// You can create encrypted volumes with the Encrypted parameter. Encrypted -// volumes may only be attached to instances that support Amazon EBS encryption. -// Volumes that are created from encrypted snapshots are also automatically -// encrypted. For more information, see Amazon EBS Encryption (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// For more information, see Creating or Restoring an Amazon EBS Volume (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-creating-volume.html) -// in the Amazon Elastic Compute Cloud User Guide. -func (c *EC2) CreateVolume(input *CreateVolumeInput) (*Volume, error) { - req, out := c.CreateVolumeRequest(input) +// Deletes the specified customer gateway. You must delete the VPN connection +// before you can delete the customer gateway. +func (c *EC2) DeleteCustomerGateway(input *DeleteCustomerGatewayInput) (*DeleteCustomerGatewayOutput, error) { + req, out := c.DeleteCustomerGatewayRequest(input) err := req.Send() return out, err } -var opCreateVolume *aws.Operation +const opDeleteDhcpOptions = "DeleteDhcpOptions" -// DeleteCustomerGatewayRequest generates a request for the DeleteCustomerGateway operation. -func (c *EC2) DeleteCustomerGatewayRequest(input *DeleteCustomerGatewayInput) (req *aws.Request, output *DeleteCustomerGatewayOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opDeleteCustomerGateway == nil { - opDeleteCustomerGateway = &aws.Operation{ - Name: "DeleteCustomerGateway", - HTTPMethod: "POST", - HTTPPath: "/", - } +// DeleteDhcpOptionsRequest generates a request for the DeleteDhcpOptions operation. +func (c *EC2) DeleteDhcpOptionsRequest(input *DeleteDhcpOptionsInput) (req *request.Request, output *DeleteDhcpOptionsOutput) { + op := &request.Operation{ + Name: opDeleteDhcpOptions, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { - input = &DeleteCustomerGatewayInput{} + input = &DeleteDhcpOptionsInput{} } - req = c.newRequest(opDeleteCustomerGateway, input, output) - output = &DeleteCustomerGatewayOutput{} + req = c.newRequest(op, input, output) + output = &DeleteDhcpOptionsOutput{} req.Data = output return } -// Deletes the specified customer gateway. You must delete the VPN connection -// before you can delete the customer gateway. -func (c *EC2) DeleteCustomerGateway(input *DeleteCustomerGatewayInput) (*DeleteCustomerGatewayOutput, error) { - req, out := c.DeleteCustomerGatewayRequest(input) +// Deletes the specified set of DHCP options. You must disassociate the set +// of DHCP options before you can delete it. You can disassociate the set of +// DHCP options by associating either a new set of options or the default set +// of options with the VPC. +func (c *EC2) DeleteDhcpOptions(input *DeleteDhcpOptionsInput) (*DeleteDhcpOptionsOutput, error) { + req, out := c.DeleteDhcpOptionsRequest(input) err := req.Send() return out, err } -var opDeleteCustomerGateway *aws.Operation +const opDeleteFlowLogs = "DeleteFlowLogs" -// DeleteDHCPOptionsRequest generates a request for the DeleteDHCPOptions operation. -func (c *EC2) DeleteDHCPOptionsRequest(input *DeleteDHCPOptionsInput) (req *aws.Request, output *DeleteDHCPOptionsOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opDeleteDHCPOptions == nil { - opDeleteDHCPOptions = &aws.Operation{ - Name: "DeleteDhcpOptions", - HTTPMethod: "POST", - HTTPPath: "/", - } +// DeleteFlowLogsRequest generates a request for the DeleteFlowLogs operation. +func (c *EC2) DeleteFlowLogsRequest(input *DeleteFlowLogsInput) (req *request.Request, output *DeleteFlowLogsOutput) { + op := &request.Operation{ + Name: opDeleteFlowLogs, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { - input = &DeleteDHCPOptionsInput{} + input = &DeleteFlowLogsInput{} } - req = c.newRequest(opDeleteDHCPOptions, input, output) - output = &DeleteDHCPOptionsOutput{} + req = c.newRequest(op, input, output) + output = &DeleteFlowLogsOutput{} req.Data = output return } -// Deletes the specified set of DHCP options. You must disassociate the set -// of DHCP options before you can delete it. You can disassociate the set of -// DHCP options by associating either a new set of options or the default set -// of options with the VPC. -func (c *EC2) DeleteDHCPOptions(input *DeleteDHCPOptionsInput) (*DeleteDHCPOptionsOutput, error) { - req, out := c.DeleteDHCPOptionsRequest(input) +// Deletes one or more flow logs. +func (c *EC2) DeleteFlowLogs(input *DeleteFlowLogsInput) (*DeleteFlowLogsOutput, error) { + req, out := c.DeleteFlowLogsRequest(input) err := req.Send() return out, err } -var opDeleteDHCPOptions *aws.Operation +const opDeleteInternetGateway = "DeleteInternetGateway" // DeleteInternetGatewayRequest generates a request for the DeleteInternetGateway operation. -func (c *EC2) DeleteInternetGatewayRequest(input *DeleteInternetGatewayInput) (req *aws.Request, output *DeleteInternetGatewayOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opDeleteInternetGateway == nil { - opDeleteInternetGateway = &aws.Operation{ - Name: "DeleteInternetGateway", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *EC2) DeleteInternetGatewayRequest(input *DeleteInternetGatewayInput) (req *request.Request, output *DeleteInternetGatewayOutput) { + op := &request.Operation{ + Name: opDeleteInternetGateway, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &DeleteInternetGatewayInput{} } - req = c.newRequest(opDeleteInternetGateway, input, output) + req = c.newRequest(op, input, output) output = &DeleteInternetGatewayOutput{} req.Data = output return @@ -2167,26 +1970,21 @@ func (c *EC2) DeleteInternetGateway(input *DeleteInternetGatewayInput) (*DeleteI return out, err } -var opDeleteInternetGateway *aws.Operation +const opDeleteKeyPair = "DeleteKeyPair" // DeleteKeyPairRequest generates a request for the DeleteKeyPair operation. -func (c *EC2) DeleteKeyPairRequest(input *DeleteKeyPairInput) (req *aws.Request, output *DeleteKeyPairOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opDeleteKeyPair == nil { - opDeleteKeyPair = &aws.Operation{ - Name: "DeleteKeyPair", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *EC2) DeleteKeyPairRequest(input *DeleteKeyPairInput) (req *request.Request, output *DeleteKeyPairOutput) { + op := &request.Operation{ + Name: opDeleteKeyPair, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &DeleteKeyPairInput{} } - req = c.newRequest(opDeleteKeyPair, input, output) + req = c.newRequest(op, input, output) output = &DeleteKeyPairOutput{} req.Data = output return @@ -2199,92 +1997,77 @@ func (c *EC2) DeleteKeyPair(input *DeleteKeyPairInput) (*DeleteKeyPairOutput, er return out, err } -var opDeleteKeyPair *aws.Operation - -// DeleteNetworkACLRequest generates a request for the DeleteNetworkACL operation. -func (c *EC2) DeleteNetworkACLRequest(input *DeleteNetworkACLInput) (req *aws.Request, output *DeleteNetworkACLOutput) { - oprw.Lock() - defer oprw.Unlock() +const opDeleteNetworkAcl = "DeleteNetworkAcl" - if opDeleteNetworkACL == nil { - opDeleteNetworkACL = &aws.Operation{ - Name: "DeleteNetworkAcl", - HTTPMethod: "POST", - HTTPPath: "/", - } +// DeleteNetworkAclRequest generates a request for the DeleteNetworkAcl operation. +func (c *EC2) DeleteNetworkAclRequest(input *DeleteNetworkAclInput) (req *request.Request, output *DeleteNetworkAclOutput) { + op := &request.Operation{ + Name: opDeleteNetworkAcl, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { - input = &DeleteNetworkACLInput{} + input = &DeleteNetworkAclInput{} } - req = c.newRequest(opDeleteNetworkACL, input, output) - output = &DeleteNetworkACLOutput{} + req = c.newRequest(op, input, output) + output = &DeleteNetworkAclOutput{} req.Data = output return } // Deletes the specified network ACL. You can't delete the ACL if it's associated // with any subnets. You can't delete the default network ACL. -func (c *EC2) DeleteNetworkACL(input *DeleteNetworkACLInput) (*DeleteNetworkACLOutput, error) { - req, out := c.DeleteNetworkACLRequest(input) +func (c *EC2) DeleteNetworkAcl(input *DeleteNetworkAclInput) (*DeleteNetworkAclOutput, error) { + req, out := c.DeleteNetworkAclRequest(input) err := req.Send() return out, err } -var opDeleteNetworkACL *aws.Operation +const opDeleteNetworkAclEntry = "DeleteNetworkAclEntry" -// DeleteNetworkACLEntryRequest generates a request for the DeleteNetworkACLEntry operation. -func (c *EC2) DeleteNetworkACLEntryRequest(input *DeleteNetworkACLEntryInput) (req *aws.Request, output *DeleteNetworkACLEntryOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opDeleteNetworkACLEntry == nil { - opDeleteNetworkACLEntry = &aws.Operation{ - Name: "DeleteNetworkAclEntry", - HTTPMethod: "POST", - HTTPPath: "/", - } +// DeleteNetworkAclEntryRequest generates a request for the DeleteNetworkAclEntry operation. +func (c *EC2) DeleteNetworkAclEntryRequest(input *DeleteNetworkAclEntryInput) (req *request.Request, output *DeleteNetworkAclEntryOutput) { + op := &request.Operation{ + Name: opDeleteNetworkAclEntry, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { - input = &DeleteNetworkACLEntryInput{} + input = &DeleteNetworkAclEntryInput{} } - req = c.newRequest(opDeleteNetworkACLEntry, input, output) - output = &DeleteNetworkACLEntryOutput{} + req = c.newRequest(op, input, output) + output = &DeleteNetworkAclEntryOutput{} req.Data = output return } // Deletes the specified ingress or egress entry (rule) from the specified network // ACL. -func (c *EC2) DeleteNetworkACLEntry(input *DeleteNetworkACLEntryInput) (*DeleteNetworkACLEntryOutput, error) { - req, out := c.DeleteNetworkACLEntryRequest(input) +func (c *EC2) DeleteNetworkAclEntry(input *DeleteNetworkAclEntryInput) (*DeleteNetworkAclEntryOutput, error) { + req, out := c.DeleteNetworkAclEntryRequest(input) err := req.Send() return out, err } -var opDeleteNetworkACLEntry *aws.Operation +const opDeleteNetworkInterface = "DeleteNetworkInterface" // DeleteNetworkInterfaceRequest generates a request for the DeleteNetworkInterface operation. -func (c *EC2) DeleteNetworkInterfaceRequest(input *DeleteNetworkInterfaceInput) (req *aws.Request, output *DeleteNetworkInterfaceOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opDeleteNetworkInterface == nil { - opDeleteNetworkInterface = &aws.Operation{ - Name: "DeleteNetworkInterface", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *EC2) DeleteNetworkInterfaceRequest(input *DeleteNetworkInterfaceInput) (req *request.Request, output *DeleteNetworkInterfaceOutput) { + op := &request.Operation{ + Name: opDeleteNetworkInterface, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &DeleteNetworkInterfaceInput{} } - req = c.newRequest(opDeleteNetworkInterface, input, output) + req = c.newRequest(op, input, output) output = &DeleteNetworkInterfaceOutput{} req.Data = output return @@ -2298,26 +2081,21 @@ func (c *EC2) DeleteNetworkInterface(input *DeleteNetworkInterfaceInput) (*Delet return out, err } -var opDeleteNetworkInterface *aws.Operation +const opDeletePlacementGroup = "DeletePlacementGroup" // DeletePlacementGroupRequest generates a request for the DeletePlacementGroup operation. -func (c *EC2) DeletePlacementGroupRequest(input *DeletePlacementGroupInput) (req *aws.Request, output *DeletePlacementGroupOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opDeletePlacementGroup == nil { - opDeletePlacementGroup = &aws.Operation{ - Name: "DeletePlacementGroup", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *EC2) DeletePlacementGroupRequest(input *DeletePlacementGroupInput) (req *request.Request, output *DeletePlacementGroupOutput) { + op := &request.Operation{ + Name: opDeletePlacementGroup, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &DeletePlacementGroupInput{} } - req = c.newRequest(opDeletePlacementGroup, input, output) + req = c.newRequest(op, input, output) output = &DeletePlacementGroupOutput{} req.Data = output return @@ -2333,26 +2111,21 @@ func (c *EC2) DeletePlacementGroup(input *DeletePlacementGroupInput) (*DeletePla return out, err } -var opDeletePlacementGroup *aws.Operation +const opDeleteRoute = "DeleteRoute" // DeleteRouteRequest generates a request for the DeleteRoute operation. -func (c *EC2) DeleteRouteRequest(input *DeleteRouteInput) (req *aws.Request, output *DeleteRouteOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opDeleteRoute == nil { - opDeleteRoute = &aws.Operation{ - Name: "DeleteRoute", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *EC2) DeleteRouteRequest(input *DeleteRouteInput) (req *request.Request, output *DeleteRouteOutput) { + op := &request.Operation{ + Name: opDeleteRoute, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &DeleteRouteInput{} } - req = c.newRequest(opDeleteRoute, input, output) + req = c.newRequest(op, input, output) output = &DeleteRouteOutput{} req.Data = output return @@ -2365,26 +2138,21 @@ func (c *EC2) DeleteRoute(input *DeleteRouteInput) (*DeleteRouteOutput, error) { return out, err } -var opDeleteRoute *aws.Operation +const opDeleteRouteTable = "DeleteRouteTable" // DeleteRouteTableRequest generates a request for the DeleteRouteTable operation. -func (c *EC2) DeleteRouteTableRequest(input *DeleteRouteTableInput) (req *aws.Request, output *DeleteRouteTableOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opDeleteRouteTable == nil { - opDeleteRouteTable = &aws.Operation{ - Name: "DeleteRouteTable", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *EC2) DeleteRouteTableRequest(input *DeleteRouteTableInput) (req *request.Request, output *DeleteRouteTableOutput) { + op := &request.Operation{ + Name: opDeleteRouteTable, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &DeleteRouteTableInput{} } - req = c.newRequest(opDeleteRouteTable, input, output) + req = c.newRequest(op, input, output) output = &DeleteRouteTableOutput{} req.Data = output return @@ -2399,26 +2167,21 @@ func (c *EC2) DeleteRouteTable(input *DeleteRouteTableInput) (*DeleteRouteTableO return out, err } -var opDeleteRouteTable *aws.Operation +const opDeleteSecurityGroup = "DeleteSecurityGroup" // DeleteSecurityGroupRequest generates a request for the DeleteSecurityGroup operation. -func (c *EC2) DeleteSecurityGroupRequest(input *DeleteSecurityGroupInput) (req *aws.Request, output *DeleteSecurityGroupOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opDeleteSecurityGroup == nil { - opDeleteSecurityGroup = &aws.Operation{ - Name: "DeleteSecurityGroup", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *EC2) DeleteSecurityGroupRequest(input *DeleteSecurityGroupInput) (req *request.Request, output *DeleteSecurityGroupOutput) { + op := &request.Operation{ + Name: opDeleteSecurityGroup, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &DeleteSecurityGroupInput{} } - req = c.newRequest(opDeleteSecurityGroup, input, output) + req = c.newRequest(op, input, output) output = &DeleteSecurityGroupOutput{} req.Data = output return @@ -2435,26 +2198,21 @@ func (c *EC2) DeleteSecurityGroup(input *DeleteSecurityGroupInput) (*DeleteSecur return out, err } -var opDeleteSecurityGroup *aws.Operation +const opDeleteSnapshot = "DeleteSnapshot" // DeleteSnapshotRequest generates a request for the DeleteSnapshot operation. -func (c *EC2) DeleteSnapshotRequest(input *DeleteSnapshotInput) (req *aws.Request, output *DeleteSnapshotOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opDeleteSnapshot == nil { - opDeleteSnapshot = &aws.Operation{ - Name: "DeleteSnapshot", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *EC2) DeleteSnapshotRequest(input *DeleteSnapshotInput) (req *request.Request, output *DeleteSnapshotOutput) { + op := &request.Operation{ + Name: opDeleteSnapshot, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &DeleteSnapshotInput{} } - req = c.newRequest(opDeleteSnapshot, input, output) + req = c.newRequest(op, input, output) output = &DeleteSnapshotOutput{} req.Data = output return @@ -2481,60 +2239,48 @@ func (c *EC2) DeleteSnapshot(input *DeleteSnapshotInput) (*DeleteSnapshotOutput, return out, err } -var opDeleteSnapshot *aws.Operation +const opDeleteSpotDatafeedSubscription = "DeleteSpotDatafeedSubscription" // DeleteSpotDatafeedSubscriptionRequest generates a request for the DeleteSpotDatafeedSubscription operation. -func (c *EC2) DeleteSpotDatafeedSubscriptionRequest(input *DeleteSpotDatafeedSubscriptionInput) (req *aws.Request, output *DeleteSpotDatafeedSubscriptionOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opDeleteSpotDatafeedSubscription == nil { - opDeleteSpotDatafeedSubscription = &aws.Operation{ - Name: "DeleteSpotDatafeedSubscription", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *EC2) DeleteSpotDatafeedSubscriptionRequest(input *DeleteSpotDatafeedSubscriptionInput) (req *request.Request, output *DeleteSpotDatafeedSubscriptionOutput) { + op := &request.Operation{ + Name: opDeleteSpotDatafeedSubscription, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &DeleteSpotDatafeedSubscriptionInput{} } - req = c.newRequest(opDeleteSpotDatafeedSubscription, input, output) + req = c.newRequest(op, input, output) output = &DeleteSpotDatafeedSubscriptionOutput{} req.Data = output return } -// Deletes the data feed for Spot Instances. For more information, see Spot -// Instance Data Feed (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-data-feeds.html) -// in the Amazon Elastic Compute Cloud User Guide. +// Deletes the data feed for Spot instances. func (c *EC2) DeleteSpotDatafeedSubscription(input *DeleteSpotDatafeedSubscriptionInput) (*DeleteSpotDatafeedSubscriptionOutput, error) { req, out := c.DeleteSpotDatafeedSubscriptionRequest(input) err := req.Send() return out, err } -var opDeleteSpotDatafeedSubscription *aws.Operation +const opDeleteSubnet = "DeleteSubnet" // DeleteSubnetRequest generates a request for the DeleteSubnet operation. -func (c *EC2) DeleteSubnetRequest(input *DeleteSubnetInput) (req *aws.Request, output *DeleteSubnetOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opDeleteSubnet == nil { - opDeleteSubnet = &aws.Operation{ - Name: "DeleteSubnet", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *EC2) DeleteSubnetRequest(input *DeleteSubnetInput) (req *request.Request, output *DeleteSubnetOutput) { + op := &request.Operation{ + Name: opDeleteSubnet, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &DeleteSubnetInput{} } - req = c.newRequest(opDeleteSubnet, input, output) + req = c.newRequest(op, input, output) output = &DeleteSubnetOutput{} req.Data = output return @@ -2548,26 +2294,21 @@ func (c *EC2) DeleteSubnet(input *DeleteSubnetInput) (*DeleteSubnetOutput, error return out, err } -var opDeleteSubnet *aws.Operation +const opDeleteTags = "DeleteTags" // DeleteTagsRequest generates a request for the DeleteTags operation. -func (c *EC2) DeleteTagsRequest(input *DeleteTagsInput) (req *aws.Request, output *DeleteTagsOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opDeleteTags == nil { - opDeleteTags = &aws.Operation{ - Name: "DeleteTags", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *EC2) DeleteTagsRequest(input *DeleteTagsInput) (req *request.Request, output *DeleteTagsOutput) { + op := &request.Operation{ + Name: opDeleteTags, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &DeleteTagsInput{} } - req = c.newRequest(opDeleteTags, input, output) + req = c.newRequest(op, input, output) output = &DeleteTagsOutput{} req.Data = output return @@ -2584,27 +2325,55 @@ func (c *EC2) DeleteTags(input *DeleteTagsInput) (*DeleteTagsOutput, error) { return out, err } -var opDeleteTags *aws.Operation +const opDeleteVolume = "DeleteVolume" -// DeleteVPCRequest generates a request for the DeleteVPC operation. -func (c *EC2) DeleteVPCRequest(input *DeleteVPCInput) (req *aws.Request, output *DeleteVPCOutput) { - oprw.Lock() - defer oprw.Unlock() +// DeleteVolumeRequest generates a request for the DeleteVolume operation. +func (c *EC2) DeleteVolumeRequest(input *DeleteVolumeInput) (req *request.Request, output *DeleteVolumeOutput) { + op := &request.Operation{ + Name: opDeleteVolume, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DeleteVolumeInput{} + } + + req = c.newRequest(op, input, output) + output = &DeleteVolumeOutput{} + req.Data = output + return +} + +// Deletes the specified EBS volume. The volume must be in the available state +// (not attached to an instance). +// +// The volume may remain in the deleting state for several minutes. +// +// For more information, see Deleting an Amazon EBS Volume (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-deleting-volume.html) +// in the Amazon Elastic Compute Cloud User Guide. +func (c *EC2) DeleteVolume(input *DeleteVolumeInput) (*DeleteVolumeOutput, error) { + req, out := c.DeleteVolumeRequest(input) + err := req.Send() + return out, err +} - if opDeleteVPC == nil { - opDeleteVPC = &aws.Operation{ - Name: "DeleteVpc", - HTTPMethod: "POST", - HTTPPath: "/", - } +const opDeleteVpc = "DeleteVpc" + +// DeleteVpcRequest generates a request for the DeleteVpc operation. +func (c *EC2) DeleteVpcRequest(input *DeleteVpcInput) (req *request.Request, output *DeleteVpcOutput) { + op := &request.Operation{ + Name: opDeleteVpc, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { - input = &DeleteVPCInput{} + input = &DeleteVpcInput{} } - req = c.newRequest(opDeleteVPC, input, output) - output = &DeleteVPCOutput{} + req = c.newRequest(op, input, output) + output = &DeleteVpcOutput{} req.Data = output return } @@ -2614,66 +2383,56 @@ func (c *EC2) DeleteVPCRequest(input *DeleteVPCInput) (req *aws.Request, output // must terminate all instances running in the VPC, delete all security groups // associated with the VPC (except the default one), delete all route tables // associated with the VPC (except the default one), and so on. -func (c *EC2) DeleteVPC(input *DeleteVPCInput) (*DeleteVPCOutput, error) { - req, out := c.DeleteVPCRequest(input) +func (c *EC2) DeleteVpc(input *DeleteVpcInput) (*DeleteVpcOutput, error) { + req, out := c.DeleteVpcRequest(input) err := req.Send() return out, err } -var opDeleteVPC *aws.Operation - -// DeleteVPCEndpointsRequest generates a request for the DeleteVPCEndpoints operation. -func (c *EC2) DeleteVPCEndpointsRequest(input *DeleteVPCEndpointsInput) (req *aws.Request, output *DeleteVPCEndpointsOutput) { - oprw.Lock() - defer oprw.Unlock() +const opDeleteVpcEndpoints = "DeleteVpcEndpoints" - if opDeleteVPCEndpoints == nil { - opDeleteVPCEndpoints = &aws.Operation{ - Name: "DeleteVpcEndpoints", - HTTPMethod: "POST", - HTTPPath: "/", - } +// DeleteVpcEndpointsRequest generates a request for the DeleteVpcEndpoints operation. +func (c *EC2) DeleteVpcEndpointsRequest(input *DeleteVpcEndpointsInput) (req *request.Request, output *DeleteVpcEndpointsOutput) { + op := &request.Operation{ + Name: opDeleteVpcEndpoints, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { - input = &DeleteVPCEndpointsInput{} + input = &DeleteVpcEndpointsInput{} } - req = c.newRequest(opDeleteVPCEndpoints, input, output) - output = &DeleteVPCEndpointsOutput{} + req = c.newRequest(op, input, output) + output = &DeleteVpcEndpointsOutput{} req.Data = output return } // Deletes one or more specified VPC endpoints. Deleting the endpoint also deletes // the endpoint routes in the route tables that were associated with the endpoint. -func (c *EC2) DeleteVPCEndpoints(input *DeleteVPCEndpointsInput) (*DeleteVPCEndpointsOutput, error) { - req, out := c.DeleteVPCEndpointsRequest(input) +func (c *EC2) DeleteVpcEndpoints(input *DeleteVpcEndpointsInput) (*DeleteVpcEndpointsOutput, error) { + req, out := c.DeleteVpcEndpointsRequest(input) err := req.Send() return out, err } -var opDeleteVPCEndpoints *aws.Operation +const opDeleteVpcPeeringConnection = "DeleteVpcPeeringConnection" -// DeleteVPCPeeringConnectionRequest generates a request for the DeleteVPCPeeringConnection operation. -func (c *EC2) DeleteVPCPeeringConnectionRequest(input *DeleteVPCPeeringConnectionInput) (req *aws.Request, output *DeleteVPCPeeringConnectionOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opDeleteVPCPeeringConnection == nil { - opDeleteVPCPeeringConnection = &aws.Operation{ - Name: "DeleteVpcPeeringConnection", - HTTPMethod: "POST", - HTTPPath: "/", - } +// DeleteVpcPeeringConnectionRequest generates a request for the DeleteVpcPeeringConnection operation. +func (c *EC2) DeleteVpcPeeringConnectionRequest(input *DeleteVpcPeeringConnectionInput) (req *request.Request, output *DeleteVpcPeeringConnectionOutput) { + op := &request.Operation{ + Name: opDeleteVpcPeeringConnection, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { - input = &DeleteVPCPeeringConnectionInput{} + input = &DeleteVpcPeeringConnectionInput{} } - req = c.newRequest(opDeleteVPCPeeringConnection, input, output) - output = &DeleteVPCPeeringConnectionOutput{} + req = c.newRequest(op, input, output) + output = &DeleteVpcPeeringConnectionOutput{} req.Data = output return } @@ -2682,33 +2441,28 @@ func (c *EC2) DeleteVPCPeeringConnectionRequest(input *DeleteVPCPeeringConnectio // the owner of the peer VPC can delete the VPC peering connection if it's in // the active state. The owner of the requester VPC can delete a VPC peering // connection in the pending-acceptance state. -func (c *EC2) DeleteVPCPeeringConnection(input *DeleteVPCPeeringConnectionInput) (*DeleteVPCPeeringConnectionOutput, error) { - req, out := c.DeleteVPCPeeringConnectionRequest(input) +func (c *EC2) DeleteVpcPeeringConnection(input *DeleteVpcPeeringConnectionInput) (*DeleteVpcPeeringConnectionOutput, error) { + req, out := c.DeleteVpcPeeringConnectionRequest(input) err := req.Send() return out, err } -var opDeleteVPCPeeringConnection *aws.Operation - -// DeleteVPNConnectionRequest generates a request for the DeleteVPNConnection operation. -func (c *EC2) DeleteVPNConnectionRequest(input *DeleteVPNConnectionInput) (req *aws.Request, output *DeleteVPNConnectionOutput) { - oprw.Lock() - defer oprw.Unlock() +const opDeleteVpnConnection = "DeleteVpnConnection" - if opDeleteVPNConnection == nil { - opDeleteVPNConnection = &aws.Operation{ - Name: "DeleteVpnConnection", - HTTPMethod: "POST", - HTTPPath: "/", - } +// DeleteVpnConnectionRequest generates a request for the DeleteVpnConnection operation. +func (c *EC2) DeleteVpnConnectionRequest(input *DeleteVpnConnectionInput) (req *request.Request, output *DeleteVpnConnectionOutput) { + op := &request.Operation{ + Name: opDeleteVpnConnection, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { - input = &DeleteVPNConnectionInput{} + input = &DeleteVpnConnectionInput{} } - req = c.newRequest(opDeleteVPNConnection, input, output) - output = &DeleteVPNConnectionOutput{} + req = c.newRequest(op, input, output) + output = &DeleteVpnConnectionOutput{} req.Data = output return } @@ -2723,33 +2477,28 @@ func (c *EC2) DeleteVPNConnectionRequest(input *DeleteVPNConnectionInput) (req * // or virtual private gateway. If you create a new VPN connection, you must // reconfigure the customer gateway using the new configuration information // returned with the new VPN connection ID. -func (c *EC2) DeleteVPNConnection(input *DeleteVPNConnectionInput) (*DeleteVPNConnectionOutput, error) { - req, out := c.DeleteVPNConnectionRequest(input) +func (c *EC2) DeleteVpnConnection(input *DeleteVpnConnectionInput) (*DeleteVpnConnectionOutput, error) { + req, out := c.DeleteVpnConnectionRequest(input) err := req.Send() return out, err } -var opDeleteVPNConnection *aws.Operation +const opDeleteVpnConnectionRoute = "DeleteVpnConnectionRoute" -// DeleteVPNConnectionRouteRequest generates a request for the DeleteVPNConnectionRoute operation. -func (c *EC2) DeleteVPNConnectionRouteRequest(input *DeleteVPNConnectionRouteInput) (req *aws.Request, output *DeleteVPNConnectionRouteOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opDeleteVPNConnectionRoute == nil { - opDeleteVPNConnectionRoute = &aws.Operation{ - Name: "DeleteVpnConnectionRoute", - HTTPMethod: "POST", - HTTPPath: "/", - } +// DeleteVpnConnectionRouteRequest generates a request for the DeleteVpnConnectionRoute operation. +func (c *EC2) DeleteVpnConnectionRouteRequest(input *DeleteVpnConnectionRouteInput) (req *request.Request, output *DeleteVpnConnectionRouteOutput) { + op := &request.Operation{ + Name: opDeleteVpnConnectionRoute, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { - input = &DeleteVPNConnectionRouteInput{} + input = &DeleteVpnConnectionRouteInput{} } - req = c.newRequest(opDeleteVPNConnectionRoute, input, output) - output = &DeleteVPNConnectionRouteOutput{} + req = c.newRequest(op, input, output) + output = &DeleteVpnConnectionRouteOutput{} req.Data = output return } @@ -2758,33 +2507,28 @@ func (c *EC2) DeleteVPNConnectionRouteRequest(input *DeleteVPNConnectionRouteInp // an existing virtual private gateway and a VPN customer gateway. The static // route allows traffic to be routed from the virtual private gateway to the // VPN customer gateway. -func (c *EC2) DeleteVPNConnectionRoute(input *DeleteVPNConnectionRouteInput) (*DeleteVPNConnectionRouteOutput, error) { - req, out := c.DeleteVPNConnectionRouteRequest(input) +func (c *EC2) DeleteVpnConnectionRoute(input *DeleteVpnConnectionRouteInput) (*DeleteVpnConnectionRouteOutput, error) { + req, out := c.DeleteVpnConnectionRouteRequest(input) err := req.Send() return out, err } -var opDeleteVPNConnectionRoute *aws.Operation - -// DeleteVPNGatewayRequest generates a request for the DeleteVPNGateway operation. -func (c *EC2) DeleteVPNGatewayRequest(input *DeleteVPNGatewayInput) (req *aws.Request, output *DeleteVPNGatewayOutput) { - oprw.Lock() - defer oprw.Unlock() +const opDeleteVpnGateway = "DeleteVpnGateway" - if opDeleteVPNGateway == nil { - opDeleteVPNGateway = &aws.Operation{ - Name: "DeleteVpnGateway", - HTTPMethod: "POST", - HTTPPath: "/", - } +// DeleteVpnGatewayRequest generates a request for the DeleteVpnGateway operation. +func (c *EC2) DeleteVpnGatewayRequest(input *DeleteVpnGatewayInput) (req *request.Request, output *DeleteVpnGatewayOutput) { + op := &request.Operation{ + Name: opDeleteVpnGateway, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { - input = &DeleteVPNGatewayInput{} + input = &DeleteVpnGatewayInput{} } - req = c.newRequest(opDeleteVPNGateway, input, output) - output = &DeleteVPNGatewayOutput{} + req = c.newRequest(op, input, output) + output = &DeleteVpnGatewayOutput{} req.Data = output return } @@ -2794,70 +2538,27 @@ func (c *EC2) DeleteVPNGatewayRequest(input *DeleteVPNGatewayInput) (req *aws.Re // VPN connection. Note that you don't need to delete the virtual private gateway // if you plan to delete and recreate the VPN connection between your VPC and // your network. -func (c *EC2) DeleteVPNGateway(input *DeleteVPNGatewayInput) (*DeleteVPNGatewayOutput, error) { - req, out := c.DeleteVPNGatewayRequest(input) - err := req.Send() - return out, err -} - -var opDeleteVPNGateway *aws.Operation - -// DeleteVolumeRequest generates a request for the DeleteVolume operation. -func (c *EC2) DeleteVolumeRequest(input *DeleteVolumeInput) (req *aws.Request, output *DeleteVolumeOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opDeleteVolume == nil { - opDeleteVolume = &aws.Operation{ - Name: "DeleteVolume", - HTTPMethod: "POST", - HTTPPath: "/", - } - } - - if input == nil { - input = &DeleteVolumeInput{} - } - - req = c.newRequest(opDeleteVolume, input, output) - output = &DeleteVolumeOutput{} - req.Data = output - return -} - -// Deletes the specified EBS volume. The volume must be in the available state -// (not attached to an instance). -// -// The volume may remain in the deleting state for several minutes. -// -// For more information, see Deleting an Amazon EBS Volume (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-deleting-volume.html) -// in the Amazon Elastic Compute Cloud User Guide. -func (c *EC2) DeleteVolume(input *DeleteVolumeInput) (*DeleteVolumeOutput, error) { - req, out := c.DeleteVolumeRequest(input) +func (c *EC2) DeleteVpnGateway(input *DeleteVpnGatewayInput) (*DeleteVpnGatewayOutput, error) { + req, out := c.DeleteVpnGatewayRequest(input) err := req.Send() return out, err } -var opDeleteVolume *aws.Operation +const opDeregisterImage = "DeregisterImage" // DeregisterImageRequest generates a request for the DeregisterImage operation. -func (c *EC2) DeregisterImageRequest(input *DeregisterImageInput) (req *aws.Request, output *DeregisterImageOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opDeregisterImage == nil { - opDeregisterImage = &aws.Operation{ - Name: "DeregisterImage", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *EC2) DeregisterImageRequest(input *DeregisterImageInput) (req *request.Request, output *DeregisterImageOutput) { + op := &request.Operation{ + Name: opDeregisterImage, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &DeregisterImageInput{} } - req = c.newRequest(opDeregisterImage, input, output) + req = c.newRequest(op, input, output) output = &DeregisterImageOutput{} req.Data = output return @@ -2873,26 +2574,21 @@ func (c *EC2) DeregisterImage(input *DeregisterImageInput) (*DeregisterImageOutp return out, err } -var opDeregisterImage *aws.Operation +const opDescribeAccountAttributes = "DescribeAccountAttributes" // DescribeAccountAttributesRequest generates a request for the DescribeAccountAttributes operation. -func (c *EC2) DescribeAccountAttributesRequest(input *DescribeAccountAttributesInput) (req *aws.Request, output *DescribeAccountAttributesOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opDescribeAccountAttributes == nil { - opDescribeAccountAttributes = &aws.Operation{ - Name: "DescribeAccountAttributes", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *EC2) DescribeAccountAttributesRequest(input *DescribeAccountAttributesInput) (req *request.Request, output *DescribeAccountAttributesOutput) { + op := &request.Operation{ + Name: opDescribeAccountAttributes, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &DescribeAccountAttributesInput{} } - req = c.newRequest(opDescribeAccountAttributes, input, output) + req = c.newRequest(op, input, output) output = &DescribeAccountAttributesOutput{} req.Data = output return @@ -2923,26 +2619,21 @@ func (c *EC2) DescribeAccountAttributes(input *DescribeAccountAttributesInput) ( return out, err } -var opDescribeAccountAttributes *aws.Operation +const opDescribeAddresses = "DescribeAddresses" // DescribeAddressesRequest generates a request for the DescribeAddresses operation. -func (c *EC2) DescribeAddressesRequest(input *DescribeAddressesInput) (req *aws.Request, output *DescribeAddressesOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opDescribeAddresses == nil { - opDescribeAddresses = &aws.Operation{ - Name: "DescribeAddresses", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *EC2) DescribeAddressesRequest(input *DescribeAddressesInput) (req *request.Request, output *DescribeAddressesOutput) { + op := &request.Operation{ + Name: opDescribeAddresses, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &DescribeAddressesInput{} } - req = c.newRequest(opDescribeAddresses, input, output) + req = c.newRequest(op, input, output) output = &DescribeAddressesOutput{} req.Data = output return @@ -2959,26 +2650,21 @@ func (c *EC2) DescribeAddresses(input *DescribeAddressesInput) (*DescribeAddress return out, err } -var opDescribeAddresses *aws.Operation +const opDescribeAvailabilityZones = "DescribeAvailabilityZones" // DescribeAvailabilityZonesRequest generates a request for the DescribeAvailabilityZones operation. -func (c *EC2) DescribeAvailabilityZonesRequest(input *DescribeAvailabilityZonesInput) (req *aws.Request, output *DescribeAvailabilityZonesOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opDescribeAvailabilityZones == nil { - opDescribeAvailabilityZones = &aws.Operation{ - Name: "DescribeAvailabilityZones", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *EC2) DescribeAvailabilityZonesRequest(input *DescribeAvailabilityZonesInput) (req *request.Request, output *DescribeAvailabilityZonesOutput) { + op := &request.Operation{ + Name: opDescribeAvailabilityZones, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &DescribeAvailabilityZonesInput{} } - req = c.newRequest(opDescribeAvailabilityZones, input, output) + req = c.newRequest(op, input, output) output = &DescribeAvailabilityZonesOutput{} req.Data = output return @@ -2997,26 +2683,21 @@ func (c *EC2) DescribeAvailabilityZones(input *DescribeAvailabilityZonesInput) ( return out, err } -var opDescribeAvailabilityZones *aws.Operation +const opDescribeBundleTasks = "DescribeBundleTasks" // DescribeBundleTasksRequest generates a request for the DescribeBundleTasks operation. -func (c *EC2) DescribeBundleTasksRequest(input *DescribeBundleTasksInput) (req *aws.Request, output *DescribeBundleTasksOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opDescribeBundleTasks == nil { - opDescribeBundleTasks = &aws.Operation{ - Name: "DescribeBundleTasks", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *EC2) DescribeBundleTasksRequest(input *DescribeBundleTasksInput) (req *request.Request, output *DescribeBundleTasksOutput) { + op := &request.Operation{ + Name: opDescribeBundleTasks, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &DescribeBundleTasksInput{} } - req = c.newRequest(opDescribeBundleTasks, input, output) + req = c.newRequest(op, input, output) output = &DescribeBundleTasksOutput{} req.Data = output return @@ -3034,26 +2715,21 @@ func (c *EC2) DescribeBundleTasks(input *DescribeBundleTasksInput) (*DescribeBun return out, err } -var opDescribeBundleTasks *aws.Operation +const opDescribeClassicLinkInstances = "DescribeClassicLinkInstances" // DescribeClassicLinkInstancesRequest generates a request for the DescribeClassicLinkInstances operation. -func (c *EC2) DescribeClassicLinkInstancesRequest(input *DescribeClassicLinkInstancesInput) (req *aws.Request, output *DescribeClassicLinkInstancesOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opDescribeClassicLinkInstances == nil { - opDescribeClassicLinkInstances = &aws.Operation{ - Name: "DescribeClassicLinkInstances", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *EC2) DescribeClassicLinkInstancesRequest(input *DescribeClassicLinkInstancesInput) (req *request.Request, output *DescribeClassicLinkInstancesOutput) { + op := &request.Operation{ + Name: opDescribeClassicLinkInstances, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &DescribeClassicLinkInstancesInput{} } - req = c.newRequest(opDescribeClassicLinkInstances, input, output) + req = c.newRequest(op, input, output) output = &DescribeClassicLinkInstancesOutput{} req.Data = output return @@ -3069,26 +2745,21 @@ func (c *EC2) DescribeClassicLinkInstances(input *DescribeClassicLinkInstancesIn return out, err } -var opDescribeClassicLinkInstances *aws.Operation +const opDescribeConversionTasks = "DescribeConversionTasks" // DescribeConversionTasksRequest generates a request for the DescribeConversionTasks operation. -func (c *EC2) DescribeConversionTasksRequest(input *DescribeConversionTasksInput) (req *aws.Request, output *DescribeConversionTasksOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opDescribeConversionTasks == nil { - opDescribeConversionTasks = &aws.Operation{ - Name: "DescribeConversionTasks", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *EC2) DescribeConversionTasksRequest(input *DescribeConversionTasksInput) (req *request.Request, output *DescribeConversionTasksOutput) { + op := &request.Operation{ + Name: opDescribeConversionTasks, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &DescribeConversionTasksInput{} } - req = c.newRequest(opDescribeConversionTasks, input, output) + req = c.newRequest(op, input, output) output = &DescribeConversionTasksOutput{} req.Data = output return @@ -3104,26 +2775,21 @@ func (c *EC2) DescribeConversionTasks(input *DescribeConversionTasksInput) (*Des return out, err } -var opDescribeConversionTasks *aws.Operation +const opDescribeCustomerGateways = "DescribeCustomerGateways" // DescribeCustomerGatewaysRequest generates a request for the DescribeCustomerGateways operation. -func (c *EC2) DescribeCustomerGatewaysRequest(input *DescribeCustomerGatewaysInput) (req *aws.Request, output *DescribeCustomerGatewaysOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opDescribeCustomerGateways == nil { - opDescribeCustomerGateways = &aws.Operation{ - Name: "DescribeCustomerGateways", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *EC2) DescribeCustomerGatewaysRequest(input *DescribeCustomerGatewaysInput) (req *request.Request, output *DescribeCustomerGatewaysOutput) { + op := &request.Operation{ + Name: opDescribeCustomerGateways, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &DescribeCustomerGatewaysInput{} } - req = c.newRequest(opDescribeCustomerGateways, input, output) + req = c.newRequest(op, input, output) output = &DescribeCustomerGatewaysOutput{} req.Data = output return @@ -3140,27 +2806,22 @@ func (c *EC2) DescribeCustomerGateways(input *DescribeCustomerGatewaysInput) (*D return out, err } -var opDescribeCustomerGateways *aws.Operation - -// DescribeDHCPOptionsRequest generates a request for the DescribeDHCPOptions operation. -func (c *EC2) DescribeDHCPOptionsRequest(input *DescribeDHCPOptionsInput) (req *aws.Request, output *DescribeDHCPOptionsOutput) { - oprw.Lock() - defer oprw.Unlock() +const opDescribeDhcpOptions = "DescribeDhcpOptions" - if opDescribeDHCPOptions == nil { - opDescribeDHCPOptions = &aws.Operation{ - Name: "DescribeDhcpOptions", - HTTPMethod: "POST", - HTTPPath: "/", - } +// DescribeDhcpOptionsRequest generates a request for the DescribeDhcpOptions operation. +func (c *EC2) DescribeDhcpOptionsRequest(input *DescribeDhcpOptionsInput) (req *request.Request, output *DescribeDhcpOptionsOutput) { + op := &request.Operation{ + Name: opDescribeDhcpOptions, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { - input = &DescribeDHCPOptionsInput{} + input = &DescribeDhcpOptionsInput{} } - req = c.newRequest(opDescribeDHCPOptions, input, output) - output = &DescribeDHCPOptionsOutput{} + req = c.newRequest(op, input, output) + output = &DescribeDhcpOptionsOutput{} req.Data = output return } @@ -3169,32 +2830,27 @@ func (c *EC2) DescribeDHCPOptionsRequest(input *DescribeDHCPOptionsInput) (req * // // For more information about DHCP options sets, see DHCP Options Sets (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_DHCP_Options.html) // in the Amazon Virtual Private Cloud User Guide. -func (c *EC2) DescribeDHCPOptions(input *DescribeDHCPOptionsInput) (*DescribeDHCPOptionsOutput, error) { - req, out := c.DescribeDHCPOptionsRequest(input) +func (c *EC2) DescribeDhcpOptions(input *DescribeDhcpOptionsInput) (*DescribeDhcpOptionsOutput, error) { + req, out := c.DescribeDhcpOptionsRequest(input) err := req.Send() return out, err } -var opDescribeDHCPOptions *aws.Operation +const opDescribeExportTasks = "DescribeExportTasks" // DescribeExportTasksRequest generates a request for the DescribeExportTasks operation. -func (c *EC2) DescribeExportTasksRequest(input *DescribeExportTasksInput) (req *aws.Request, output *DescribeExportTasksOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opDescribeExportTasks == nil { - opDescribeExportTasks = &aws.Operation{ - Name: "DescribeExportTasks", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *EC2) DescribeExportTasksRequest(input *DescribeExportTasksInput) (req *request.Request, output *DescribeExportTasksOutput) { + op := &request.Operation{ + Name: opDescribeExportTasks, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &DescribeExportTasksInput{} } - req = c.newRequest(opDescribeExportTasks, input, output) + req = c.newRequest(op, input, output) output = &DescribeExportTasksOutput{} req.Data = output return @@ -3207,26 +2863,50 @@ func (c *EC2) DescribeExportTasks(input *DescribeExportTasksInput) (*DescribeExp return out, err } -var opDescribeExportTasks *aws.Operation +const opDescribeFlowLogs = "DescribeFlowLogs" -// DescribeImageAttributeRequest generates a request for the DescribeImageAttribute operation. -func (c *EC2) DescribeImageAttributeRequest(input *DescribeImageAttributeInput) (req *aws.Request, output *DescribeImageAttributeOutput) { - oprw.Lock() - defer oprw.Unlock() +// DescribeFlowLogsRequest generates a request for the DescribeFlowLogs operation. +func (c *EC2) DescribeFlowLogsRequest(input *DescribeFlowLogsInput) (req *request.Request, output *DescribeFlowLogsOutput) { + op := &request.Operation{ + Name: opDescribeFlowLogs, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DescribeFlowLogsInput{} + } + + req = c.newRequest(op, input, output) + output = &DescribeFlowLogsOutput{} + req.Data = output + return +} + +// Describes one or more flow logs. To view the information in your flow logs +// (the log streams for the network interfaces), you must use the CloudWatch +// Logs console or the CloudWatch Logs API. +func (c *EC2) DescribeFlowLogs(input *DescribeFlowLogsInput) (*DescribeFlowLogsOutput, error) { + req, out := c.DescribeFlowLogsRequest(input) + err := req.Send() + return out, err +} - if opDescribeImageAttribute == nil { - opDescribeImageAttribute = &aws.Operation{ - Name: "DescribeImageAttribute", - HTTPMethod: "POST", - HTTPPath: "/", - } +const opDescribeImageAttribute = "DescribeImageAttribute" + +// DescribeImageAttributeRequest generates a request for the DescribeImageAttribute operation. +func (c *EC2) DescribeImageAttributeRequest(input *DescribeImageAttributeInput) (req *request.Request, output *DescribeImageAttributeOutput) { + op := &request.Operation{ + Name: opDescribeImageAttribute, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &DescribeImageAttributeInput{} } - req = c.newRequest(opDescribeImageAttribute, input, output) + req = c.newRequest(op, input, output) output = &DescribeImageAttributeOutput{} req.Data = output return @@ -3240,26 +2920,21 @@ func (c *EC2) DescribeImageAttribute(input *DescribeImageAttributeInput) (*Descr return out, err } -var opDescribeImageAttribute *aws.Operation +const opDescribeImages = "DescribeImages" // DescribeImagesRequest generates a request for the DescribeImages operation. -func (c *EC2) DescribeImagesRequest(input *DescribeImagesInput) (req *aws.Request, output *DescribeImagesOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opDescribeImages == nil { - opDescribeImages = &aws.Operation{ - Name: "DescribeImages", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *EC2) DescribeImagesRequest(input *DescribeImagesInput) (req *request.Request, output *DescribeImagesOutput) { + op := &request.Operation{ + Name: opDescribeImages, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &DescribeImagesInput{} } - req = c.newRequest(opDescribeImages, input, output) + req = c.newRequest(op, input, output) output = &DescribeImagesOutput{} req.Data = output return @@ -3278,26 +2953,21 @@ func (c *EC2) DescribeImages(input *DescribeImagesInput) (*DescribeImagesOutput, return out, err } -var opDescribeImages *aws.Operation +const opDescribeImportImageTasks = "DescribeImportImageTasks" // DescribeImportImageTasksRequest generates a request for the DescribeImportImageTasks operation. -func (c *EC2) DescribeImportImageTasksRequest(input *DescribeImportImageTasksInput) (req *aws.Request, output *DescribeImportImageTasksOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opDescribeImportImageTasks == nil { - opDescribeImportImageTasks = &aws.Operation{ - Name: "DescribeImportImageTasks", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *EC2) DescribeImportImageTasksRequest(input *DescribeImportImageTasksInput) (req *request.Request, output *DescribeImportImageTasksOutput) { + op := &request.Operation{ + Name: opDescribeImportImageTasks, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &DescribeImportImageTasksInput{} } - req = c.newRequest(opDescribeImportImageTasks, input, output) + req = c.newRequest(op, input, output) output = &DescribeImportImageTasksOutput{} req.Data = output return @@ -3311,26 +2981,21 @@ func (c *EC2) DescribeImportImageTasks(input *DescribeImportImageTasksInput) (*D return out, err } -var opDescribeImportImageTasks *aws.Operation +const opDescribeImportSnapshotTasks = "DescribeImportSnapshotTasks" // DescribeImportSnapshotTasksRequest generates a request for the DescribeImportSnapshotTasks operation. -func (c *EC2) DescribeImportSnapshotTasksRequest(input *DescribeImportSnapshotTasksInput) (req *aws.Request, output *DescribeImportSnapshotTasksOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opDescribeImportSnapshotTasks == nil { - opDescribeImportSnapshotTasks = &aws.Operation{ - Name: "DescribeImportSnapshotTasks", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *EC2) DescribeImportSnapshotTasksRequest(input *DescribeImportSnapshotTasksInput) (req *request.Request, output *DescribeImportSnapshotTasksOutput) { + op := &request.Operation{ + Name: opDescribeImportSnapshotTasks, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &DescribeImportSnapshotTasksInput{} } - req = c.newRequest(opDescribeImportSnapshotTasks, input, output) + req = c.newRequest(op, input, output) output = &DescribeImportSnapshotTasksOutput{} req.Data = output return @@ -3343,26 +3008,21 @@ func (c *EC2) DescribeImportSnapshotTasks(input *DescribeImportSnapshotTasksInpu return out, err } -var opDescribeImportSnapshotTasks *aws.Operation +const opDescribeInstanceAttribute = "DescribeInstanceAttribute" // DescribeInstanceAttributeRequest generates a request for the DescribeInstanceAttribute operation. -func (c *EC2) DescribeInstanceAttributeRequest(input *DescribeInstanceAttributeInput) (req *aws.Request, output *DescribeInstanceAttributeOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opDescribeInstanceAttribute == nil { - opDescribeInstanceAttribute = &aws.Operation{ - Name: "DescribeInstanceAttribute", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *EC2) DescribeInstanceAttributeRequest(input *DescribeInstanceAttributeInput) (req *request.Request, output *DescribeInstanceAttributeOutput) { + op := &request.Operation{ + Name: opDescribeInstanceAttribute, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &DescribeInstanceAttributeInput{} } - req = c.newRequest(opDescribeInstanceAttribute, input, output) + req = c.newRequest(op, input, output) output = &DescribeInstanceAttributeOutput{} req.Data = output return @@ -3379,32 +3039,27 @@ func (c *EC2) DescribeInstanceAttribute(input *DescribeInstanceAttributeInput) ( return out, err } -var opDescribeInstanceAttribute *aws.Operation +const opDescribeInstanceStatus = "DescribeInstanceStatus" // DescribeInstanceStatusRequest generates a request for the DescribeInstanceStatus operation. -func (c *EC2) DescribeInstanceStatusRequest(input *DescribeInstanceStatusInput) (req *aws.Request, output *DescribeInstanceStatusOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opDescribeInstanceStatus == nil { - opDescribeInstanceStatus = &aws.Operation{ - Name: "DescribeInstanceStatus", - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &aws.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } +func (c *EC2) DescribeInstanceStatusRequest(input *DescribeInstanceStatusInput) (req *request.Request, output *DescribeInstanceStatusOutput) { + op := &request.Operation{ + Name: opDescribeInstanceStatus, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { input = &DescribeInstanceStatusInput{} } - req = c.newRequest(opDescribeInstanceStatus, input, output) + req = c.newRequest(op, input, output) output = &DescribeInstanceStatusOutput{} req.Data = output return @@ -3443,32 +3098,27 @@ func (c *EC2) DescribeInstanceStatusPages(input *DescribeInstanceStatusInput, fn }) } -var opDescribeInstanceStatus *aws.Operation +const opDescribeInstances = "DescribeInstances" // DescribeInstancesRequest generates a request for the DescribeInstances operation. -func (c *EC2) DescribeInstancesRequest(input *DescribeInstancesInput) (req *aws.Request, output *DescribeInstancesOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opDescribeInstances == nil { - opDescribeInstances = &aws.Operation{ - Name: "DescribeInstances", - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &aws.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } +func (c *EC2) DescribeInstancesRequest(input *DescribeInstancesInput) (req *request.Request, output *DescribeInstancesOutput) { + op := &request.Operation{ + Name: opDescribeInstances, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { input = &DescribeInstancesInput{} } - req = c.newRequest(opDescribeInstances, input, output) + req = c.newRequest(op, input, output) output = &DescribeInstancesOutput{} req.Data = output return @@ -3497,26 +3147,21 @@ func (c *EC2) DescribeInstancesPages(input *DescribeInstancesInput, fn func(p *D }) } -var opDescribeInstances *aws.Operation +const opDescribeInternetGateways = "DescribeInternetGateways" // DescribeInternetGatewaysRequest generates a request for the DescribeInternetGateways operation. -func (c *EC2) DescribeInternetGatewaysRequest(input *DescribeInternetGatewaysInput) (req *aws.Request, output *DescribeInternetGatewaysOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opDescribeInternetGateways == nil { - opDescribeInternetGateways = &aws.Operation{ - Name: "DescribeInternetGateways", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *EC2) DescribeInternetGatewaysRequest(input *DescribeInternetGatewaysInput) (req *request.Request, output *DescribeInternetGatewaysOutput) { + op := &request.Operation{ + Name: opDescribeInternetGateways, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &DescribeInternetGatewaysInput{} } - req = c.newRequest(opDescribeInternetGateways, input, output) + req = c.newRequest(op, input, output) output = &DescribeInternetGatewaysOutput{} req.Data = output return @@ -3529,26 +3174,21 @@ func (c *EC2) DescribeInternetGateways(input *DescribeInternetGatewaysInput) (*D return out, err } -var opDescribeInternetGateways *aws.Operation +const opDescribeKeyPairs = "DescribeKeyPairs" // DescribeKeyPairsRequest generates a request for the DescribeKeyPairs operation. -func (c *EC2) DescribeKeyPairsRequest(input *DescribeKeyPairsInput) (req *aws.Request, output *DescribeKeyPairsOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opDescribeKeyPairs == nil { - opDescribeKeyPairs = &aws.Operation{ - Name: "DescribeKeyPairs", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *EC2) DescribeKeyPairsRequest(input *DescribeKeyPairsInput) (req *request.Request, output *DescribeKeyPairsOutput) { + op := &request.Operation{ + Name: opDescribeKeyPairs, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &DescribeKeyPairsInput{} } - req = c.newRequest(opDescribeKeyPairs, input, output) + req = c.newRequest(op, input, output) output = &DescribeKeyPairsOutput{} req.Data = output return @@ -3564,26 +3204,21 @@ func (c *EC2) DescribeKeyPairs(input *DescribeKeyPairsInput) (*DescribeKeyPairsO return out, err } -var opDescribeKeyPairs *aws.Operation +const opDescribeMovingAddresses = "DescribeMovingAddresses" // DescribeMovingAddressesRequest generates a request for the DescribeMovingAddresses operation. -func (c *EC2) DescribeMovingAddressesRequest(input *DescribeMovingAddressesInput) (req *aws.Request, output *DescribeMovingAddressesOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opDescribeMovingAddresses == nil { - opDescribeMovingAddresses = &aws.Operation{ - Name: "DescribeMovingAddresses", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *EC2) DescribeMovingAddressesRequest(input *DescribeMovingAddressesInput) (req *request.Request, output *DescribeMovingAddressesOutput) { + op := &request.Operation{ + Name: opDescribeMovingAddresses, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &DescribeMovingAddressesInput{} } - req = c.newRequest(opDescribeMovingAddresses, input, output) + req = c.newRequest(op, input, output) output = &DescribeMovingAddressesOutput{} req.Data = output return @@ -3598,27 +3233,22 @@ func (c *EC2) DescribeMovingAddresses(input *DescribeMovingAddressesInput) (*Des return out, err } -var opDescribeMovingAddresses *aws.Operation - -// DescribeNetworkACLsRequest generates a request for the DescribeNetworkACLs operation. -func (c *EC2) DescribeNetworkACLsRequest(input *DescribeNetworkACLsInput) (req *aws.Request, output *DescribeNetworkACLsOutput) { - oprw.Lock() - defer oprw.Unlock() +const opDescribeNetworkAcls = "DescribeNetworkAcls" - if opDescribeNetworkACLs == nil { - opDescribeNetworkACLs = &aws.Operation{ - Name: "DescribeNetworkAcls", - HTTPMethod: "POST", - HTTPPath: "/", - } +// DescribeNetworkAclsRequest generates a request for the DescribeNetworkAcls operation. +func (c *EC2) DescribeNetworkAclsRequest(input *DescribeNetworkAclsInput) (req *request.Request, output *DescribeNetworkAclsOutput) { + op := &request.Operation{ + Name: opDescribeNetworkAcls, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { - input = &DescribeNetworkACLsInput{} + input = &DescribeNetworkAclsInput{} } - req = c.newRequest(opDescribeNetworkACLs, input, output) - output = &DescribeNetworkACLsOutput{} + req = c.newRequest(op, input, output) + output = &DescribeNetworkAclsOutput{} req.Data = output return } @@ -3627,32 +3257,27 @@ func (c *EC2) DescribeNetworkACLsRequest(input *DescribeNetworkACLsInput) (req * // // For more information about network ACLs, see Network ACLs (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_ACLs.html) // in the Amazon Virtual Private Cloud User Guide. -func (c *EC2) DescribeNetworkACLs(input *DescribeNetworkACLsInput) (*DescribeNetworkACLsOutput, error) { - req, out := c.DescribeNetworkACLsRequest(input) +func (c *EC2) DescribeNetworkAcls(input *DescribeNetworkAclsInput) (*DescribeNetworkAclsOutput, error) { + req, out := c.DescribeNetworkAclsRequest(input) err := req.Send() return out, err } -var opDescribeNetworkACLs *aws.Operation +const opDescribeNetworkInterfaceAttribute = "DescribeNetworkInterfaceAttribute" // DescribeNetworkInterfaceAttributeRequest generates a request for the DescribeNetworkInterfaceAttribute operation. -func (c *EC2) DescribeNetworkInterfaceAttributeRequest(input *DescribeNetworkInterfaceAttributeInput) (req *aws.Request, output *DescribeNetworkInterfaceAttributeOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opDescribeNetworkInterfaceAttribute == nil { - opDescribeNetworkInterfaceAttribute = &aws.Operation{ - Name: "DescribeNetworkInterfaceAttribute", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *EC2) DescribeNetworkInterfaceAttributeRequest(input *DescribeNetworkInterfaceAttributeInput) (req *request.Request, output *DescribeNetworkInterfaceAttributeOutput) { + op := &request.Operation{ + Name: opDescribeNetworkInterfaceAttribute, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &DescribeNetworkInterfaceAttributeInput{} } - req = c.newRequest(opDescribeNetworkInterfaceAttribute, input, output) + req = c.newRequest(op, input, output) output = &DescribeNetworkInterfaceAttributeOutput{} req.Data = output return @@ -3666,26 +3291,21 @@ func (c *EC2) DescribeNetworkInterfaceAttribute(input *DescribeNetworkInterfaceA return out, err } -var opDescribeNetworkInterfaceAttribute *aws.Operation +const opDescribeNetworkInterfaces = "DescribeNetworkInterfaces" // DescribeNetworkInterfacesRequest generates a request for the DescribeNetworkInterfaces operation. -func (c *EC2) DescribeNetworkInterfacesRequest(input *DescribeNetworkInterfacesInput) (req *aws.Request, output *DescribeNetworkInterfacesOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opDescribeNetworkInterfaces == nil { - opDescribeNetworkInterfaces = &aws.Operation{ - Name: "DescribeNetworkInterfaces", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *EC2) DescribeNetworkInterfacesRequest(input *DescribeNetworkInterfacesInput) (req *request.Request, output *DescribeNetworkInterfacesOutput) { + op := &request.Operation{ + Name: opDescribeNetworkInterfaces, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &DescribeNetworkInterfacesInput{} } - req = c.newRequest(opDescribeNetworkInterfaces, input, output) + req = c.newRequest(op, input, output) output = &DescribeNetworkInterfacesOutput{} req.Data = output return @@ -3698,26 +3318,21 @@ func (c *EC2) DescribeNetworkInterfaces(input *DescribeNetworkInterfacesInput) ( return out, err } -var opDescribeNetworkInterfaces *aws.Operation +const opDescribePlacementGroups = "DescribePlacementGroups" // DescribePlacementGroupsRequest generates a request for the DescribePlacementGroups operation. -func (c *EC2) DescribePlacementGroupsRequest(input *DescribePlacementGroupsInput) (req *aws.Request, output *DescribePlacementGroupsOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opDescribePlacementGroups == nil { - opDescribePlacementGroups = &aws.Operation{ - Name: "DescribePlacementGroups", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *EC2) DescribePlacementGroupsRequest(input *DescribePlacementGroupsInput) (req *request.Request, output *DescribePlacementGroupsOutput) { + op := &request.Operation{ + Name: opDescribePlacementGroups, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &DescribePlacementGroupsInput{} } - req = c.newRequest(opDescribePlacementGroups, input, output) + req = c.newRequest(op, input, output) output = &DescribePlacementGroupsOutput{} req.Data = output return @@ -3732,26 +3347,21 @@ func (c *EC2) DescribePlacementGroups(input *DescribePlacementGroupsInput) (*Des return out, err } -var opDescribePlacementGroups *aws.Operation +const opDescribePrefixLists = "DescribePrefixLists" // DescribePrefixListsRequest generates a request for the DescribePrefixLists operation. -func (c *EC2) DescribePrefixListsRequest(input *DescribePrefixListsInput) (req *aws.Request, output *DescribePrefixListsOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opDescribePrefixLists == nil { - opDescribePrefixLists = &aws.Operation{ - Name: "DescribePrefixLists", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *EC2) DescribePrefixListsRequest(input *DescribePrefixListsInput) (req *request.Request, output *DescribePrefixListsOutput) { + op := &request.Operation{ + Name: opDescribePrefixLists, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &DescribePrefixListsInput{} } - req = c.newRequest(opDescribePrefixLists, input, output) + req = c.newRequest(op, input, output) output = &DescribePrefixListsOutput{} req.Data = output return @@ -3768,26 +3378,21 @@ func (c *EC2) DescribePrefixLists(input *DescribePrefixListsInput) (*DescribePre return out, err } -var opDescribePrefixLists *aws.Operation +const opDescribeRegions = "DescribeRegions" // DescribeRegionsRequest generates a request for the DescribeRegions operation. -func (c *EC2) DescribeRegionsRequest(input *DescribeRegionsInput) (req *aws.Request, output *DescribeRegionsOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opDescribeRegions == nil { - opDescribeRegions = &aws.Operation{ - Name: "DescribeRegions", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *EC2) DescribeRegionsRequest(input *DescribeRegionsInput) (req *request.Request, output *DescribeRegionsOutput) { + op := &request.Operation{ + Name: opDescribeRegions, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &DescribeRegionsInput{} } - req = c.newRequest(opDescribeRegions, input, output) + req = c.newRequest(op, input, output) output = &DescribeRegionsOutput{} req.Data = output return @@ -3803,26 +3408,21 @@ func (c *EC2) DescribeRegions(input *DescribeRegionsInput) (*DescribeRegionsOutp return out, err } -var opDescribeRegions *aws.Operation +const opDescribeReservedInstances = "DescribeReservedInstances" // DescribeReservedInstancesRequest generates a request for the DescribeReservedInstances operation. -func (c *EC2) DescribeReservedInstancesRequest(input *DescribeReservedInstancesInput) (req *aws.Request, output *DescribeReservedInstancesOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opDescribeReservedInstances == nil { - opDescribeReservedInstances = &aws.Operation{ - Name: "DescribeReservedInstances", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *EC2) DescribeReservedInstancesRequest(input *DescribeReservedInstancesInput) (req *request.Request, output *DescribeReservedInstancesOutput) { + op := &request.Operation{ + Name: opDescribeReservedInstances, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &DescribeReservedInstancesInput{} } - req = c.newRequest(opDescribeReservedInstances, input, output) + req = c.newRequest(op, input, output) output = &DescribeReservedInstancesOutput{} req.Data = output return @@ -3838,26 +3438,21 @@ func (c *EC2) DescribeReservedInstances(input *DescribeReservedInstancesInput) ( return out, err } -var opDescribeReservedInstances *aws.Operation +const opDescribeReservedInstancesListings = "DescribeReservedInstancesListings" // DescribeReservedInstancesListingsRequest generates a request for the DescribeReservedInstancesListings operation. -func (c *EC2) DescribeReservedInstancesListingsRequest(input *DescribeReservedInstancesListingsInput) (req *aws.Request, output *DescribeReservedInstancesListingsOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opDescribeReservedInstancesListings == nil { - opDescribeReservedInstancesListings = &aws.Operation{ - Name: "DescribeReservedInstancesListings", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *EC2) DescribeReservedInstancesListingsRequest(input *DescribeReservedInstancesListingsInput) (req *request.Request, output *DescribeReservedInstancesListingsOutput) { + op := &request.Operation{ + Name: opDescribeReservedInstancesListings, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &DescribeReservedInstancesListingsInput{} } - req = c.newRequest(opDescribeReservedInstancesListings, input, output) + req = c.newRequest(op, input, output) output = &DescribeReservedInstancesListingsOutput{} req.Data = output return @@ -3891,32 +3486,27 @@ func (c *EC2) DescribeReservedInstancesListings(input *DescribeReservedInstances return out, err } -var opDescribeReservedInstancesListings *aws.Operation +const opDescribeReservedInstancesModifications = "DescribeReservedInstancesModifications" // DescribeReservedInstancesModificationsRequest generates a request for the DescribeReservedInstancesModifications operation. -func (c *EC2) DescribeReservedInstancesModificationsRequest(input *DescribeReservedInstancesModificationsInput) (req *aws.Request, output *DescribeReservedInstancesModificationsOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opDescribeReservedInstancesModifications == nil { - opDescribeReservedInstancesModifications = &aws.Operation{ - Name: "DescribeReservedInstancesModifications", - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &aws.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "", - TruncationToken: "", - }, - } +func (c *EC2) DescribeReservedInstancesModificationsRequest(input *DescribeReservedInstancesModificationsInput) (req *request.Request, output *DescribeReservedInstancesModificationsOutput) { + op := &request.Operation{ + Name: opDescribeReservedInstancesModifications, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "", + TruncationToken: "", + }, } if input == nil { input = &DescribeReservedInstancesModificationsInput{} } - req = c.newRequest(opDescribeReservedInstancesModifications, input, output) + req = c.newRequest(op, input, output) output = &DescribeReservedInstancesModificationsOutput{} req.Data = output return @@ -3942,32 +3532,27 @@ func (c *EC2) DescribeReservedInstancesModificationsPages(input *DescribeReserve }) } -var opDescribeReservedInstancesModifications *aws.Operation +const opDescribeReservedInstancesOfferings = "DescribeReservedInstancesOfferings" // DescribeReservedInstancesOfferingsRequest generates a request for the DescribeReservedInstancesOfferings operation. -func (c *EC2) DescribeReservedInstancesOfferingsRequest(input *DescribeReservedInstancesOfferingsInput) (req *aws.Request, output *DescribeReservedInstancesOfferingsOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opDescribeReservedInstancesOfferings == nil { - opDescribeReservedInstancesOfferings = &aws.Operation{ - Name: "DescribeReservedInstancesOfferings", - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &aws.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } +func (c *EC2) DescribeReservedInstancesOfferingsRequest(input *DescribeReservedInstancesOfferingsInput) (req *request.Request, output *DescribeReservedInstancesOfferingsOutput) { + op := &request.Operation{ + Name: opDescribeReservedInstancesOfferings, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { input = &DescribeReservedInstancesOfferingsInput{} } - req = c.newRequest(opDescribeReservedInstancesOfferings, input, output) + req = c.newRequest(op, input, output) output = &DescribeReservedInstancesOfferingsOutput{} req.Data = output return @@ -3994,26 +3579,21 @@ func (c *EC2) DescribeReservedInstancesOfferingsPages(input *DescribeReservedIns }) } -var opDescribeReservedInstancesOfferings *aws.Operation +const opDescribeRouteTables = "DescribeRouteTables" // DescribeRouteTablesRequest generates a request for the DescribeRouteTables operation. -func (c *EC2) DescribeRouteTablesRequest(input *DescribeRouteTablesInput) (req *aws.Request, output *DescribeRouteTablesOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opDescribeRouteTables == nil { - opDescribeRouteTables = &aws.Operation{ - Name: "DescribeRouteTables", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *EC2) DescribeRouteTablesRequest(input *DescribeRouteTablesInput) (req *request.Request, output *DescribeRouteTablesOutput) { + op := &request.Operation{ + Name: opDescribeRouteTables, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &DescribeRouteTablesInput{} } - req = c.newRequest(opDescribeRouteTables, input, output) + req = c.newRequest(op, input, output) output = &DescribeRouteTablesOutput{} req.Data = output return @@ -4021,6 +3601,11 @@ func (c *EC2) DescribeRouteTablesRequest(input *DescribeRouteTablesInput) (req * // Describes one or more of your route tables. // +// Each subnet in your VPC must be associated with a route table. If a subnet +// is not explicitly associated with any route table, it is implicitly associated +// with the main route table. This command does not return the subnet ID for +// implicit associations. +// // For more information about route tables, see Route Tables (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_Route_Tables.html) // in the Amazon Virtual Private Cloud User Guide. func (c *EC2) DescribeRouteTables(input *DescribeRouteTablesInput) (*DescribeRouteTablesOutput, error) { @@ -4029,26 +3614,21 @@ func (c *EC2) DescribeRouteTables(input *DescribeRouteTablesInput) (*DescribeRou return out, err } -var opDescribeRouteTables *aws.Operation +const opDescribeSecurityGroups = "DescribeSecurityGroups" // DescribeSecurityGroupsRequest generates a request for the DescribeSecurityGroups operation. -func (c *EC2) DescribeSecurityGroupsRequest(input *DescribeSecurityGroupsInput) (req *aws.Request, output *DescribeSecurityGroupsOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opDescribeSecurityGroups == nil { - opDescribeSecurityGroups = &aws.Operation{ - Name: "DescribeSecurityGroups", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *EC2) DescribeSecurityGroupsRequest(input *DescribeSecurityGroupsInput) (req *request.Request, output *DescribeSecurityGroupsOutput) { + op := &request.Operation{ + Name: opDescribeSecurityGroups, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &DescribeSecurityGroupsInput{} } - req = c.newRequest(opDescribeSecurityGroups, input, output) + req = c.newRequest(op, input, output) output = &DescribeSecurityGroupsOutput{} req.Data = output return @@ -4068,26 +3648,21 @@ func (c *EC2) DescribeSecurityGroups(input *DescribeSecurityGroupsInput) (*Descr return out, err } -var opDescribeSecurityGroups *aws.Operation +const opDescribeSnapshotAttribute = "DescribeSnapshotAttribute" // DescribeSnapshotAttributeRequest generates a request for the DescribeSnapshotAttribute operation. -func (c *EC2) DescribeSnapshotAttributeRequest(input *DescribeSnapshotAttributeInput) (req *aws.Request, output *DescribeSnapshotAttributeOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opDescribeSnapshotAttribute == nil { - opDescribeSnapshotAttribute = &aws.Operation{ - Name: "DescribeSnapshotAttribute", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *EC2) DescribeSnapshotAttributeRequest(input *DescribeSnapshotAttributeInput) (req *request.Request, output *DescribeSnapshotAttributeOutput) { + op := &request.Operation{ + Name: opDescribeSnapshotAttribute, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &DescribeSnapshotAttributeInput{} } - req = c.newRequest(opDescribeSnapshotAttribute, input, output) + req = c.newRequest(op, input, output) output = &DescribeSnapshotAttributeOutput{} req.Data = output return @@ -4104,32 +3679,27 @@ func (c *EC2) DescribeSnapshotAttribute(input *DescribeSnapshotAttributeInput) ( return out, err } -var opDescribeSnapshotAttribute *aws.Operation +const opDescribeSnapshots = "DescribeSnapshots" // DescribeSnapshotsRequest generates a request for the DescribeSnapshots operation. -func (c *EC2) DescribeSnapshotsRequest(input *DescribeSnapshotsInput) (req *aws.Request, output *DescribeSnapshotsOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opDescribeSnapshots == nil { - opDescribeSnapshots = &aws.Operation{ - Name: "DescribeSnapshots", - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &aws.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "", - TruncationToken: "", - }, - } +func (c *EC2) DescribeSnapshotsRequest(input *DescribeSnapshotsInput) (req *request.Request, output *DescribeSnapshotsOutput) { + op := &request.Operation{ + Name: opDescribeSnapshots, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "", + TruncationToken: "", + }, } if input == nil { input = &DescribeSnapshotsInput{} } - req = c.newRequest(opDescribeSnapshots, input, output) + req = c.newRequest(op, input, output) output = &DescribeSnapshotsOutput{} req.Data = output return @@ -4188,32 +3758,27 @@ func (c *EC2) DescribeSnapshotsPages(input *DescribeSnapshotsInput, fn func(p *D }) } -var opDescribeSnapshots *aws.Operation +const opDescribeSpotDatafeedSubscription = "DescribeSpotDatafeedSubscription" // DescribeSpotDatafeedSubscriptionRequest generates a request for the DescribeSpotDatafeedSubscription operation. -func (c *EC2) DescribeSpotDatafeedSubscriptionRequest(input *DescribeSpotDatafeedSubscriptionInput) (req *aws.Request, output *DescribeSpotDatafeedSubscriptionOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opDescribeSpotDatafeedSubscription == nil { - opDescribeSpotDatafeedSubscription = &aws.Operation{ - Name: "DescribeSpotDatafeedSubscription", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *EC2) DescribeSpotDatafeedSubscriptionRequest(input *DescribeSpotDatafeedSubscriptionInput) (req *request.Request, output *DescribeSpotDatafeedSubscriptionOutput) { + op := &request.Operation{ + Name: opDescribeSpotDatafeedSubscription, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &DescribeSpotDatafeedSubscriptionInput{} } - req = c.newRequest(opDescribeSpotDatafeedSubscription, input, output) + req = c.newRequest(op, input, output) output = &DescribeSpotDatafeedSubscriptionOutput{} req.Data = output return } -// Describes the data feed for Spot Instances. For more information, see Spot +// Describes the data feed for Spot instances. For more information, see Spot // Instance Data Feed (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-data-feeds.html) // in the Amazon Elastic Compute Cloud User Guide. func (c *EC2) DescribeSpotDatafeedSubscription(input *DescribeSpotDatafeedSubscriptionInput) (*DescribeSpotDatafeedSubscriptionOutput, error) { @@ -4222,26 +3787,21 @@ func (c *EC2) DescribeSpotDatafeedSubscription(input *DescribeSpotDatafeedSubscr return out, err } -var opDescribeSpotDatafeedSubscription *aws.Operation +const opDescribeSpotFleetInstances = "DescribeSpotFleetInstances" // DescribeSpotFleetInstancesRequest generates a request for the DescribeSpotFleetInstances operation. -func (c *EC2) DescribeSpotFleetInstancesRequest(input *DescribeSpotFleetInstancesInput) (req *aws.Request, output *DescribeSpotFleetInstancesOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opDescribeSpotFleetInstances == nil { - opDescribeSpotFleetInstances = &aws.Operation{ - Name: "DescribeSpotFleetInstances", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *EC2) DescribeSpotFleetInstancesRequest(input *DescribeSpotFleetInstancesInput) (req *request.Request, output *DescribeSpotFleetInstancesOutput) { + op := &request.Operation{ + Name: opDescribeSpotFleetInstances, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &DescribeSpotFleetInstancesInput{} } - req = c.newRequest(opDescribeSpotFleetInstances, input, output) + req = c.newRequest(op, input, output) output = &DescribeSpotFleetInstancesOutput{} req.Data = output return @@ -4254,26 +3814,21 @@ func (c *EC2) DescribeSpotFleetInstances(input *DescribeSpotFleetInstancesInput) return out, err } -var opDescribeSpotFleetInstances *aws.Operation +const opDescribeSpotFleetRequestHistory = "DescribeSpotFleetRequestHistory" // DescribeSpotFleetRequestHistoryRequest generates a request for the DescribeSpotFleetRequestHistory operation. -func (c *EC2) DescribeSpotFleetRequestHistoryRequest(input *DescribeSpotFleetRequestHistoryInput) (req *aws.Request, output *DescribeSpotFleetRequestHistoryOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opDescribeSpotFleetRequestHistory == nil { - opDescribeSpotFleetRequestHistory = &aws.Operation{ - Name: "DescribeSpotFleetRequestHistory", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *EC2) DescribeSpotFleetRequestHistoryRequest(input *DescribeSpotFleetRequestHistoryInput) (req *request.Request, output *DescribeSpotFleetRequestHistoryOutput) { + op := &request.Operation{ + Name: opDescribeSpotFleetRequestHistory, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &DescribeSpotFleetRequestHistoryInput{} } - req = c.newRequest(opDescribeSpotFleetRequestHistory, input, output) + req = c.newRequest(op, input, output) output = &DescribeSpotFleetRequestHistoryOutput{} req.Data = output return @@ -4291,26 +3846,21 @@ func (c *EC2) DescribeSpotFleetRequestHistory(input *DescribeSpotFleetRequestHis return out, err } -var opDescribeSpotFleetRequestHistory *aws.Operation +const opDescribeSpotFleetRequests = "DescribeSpotFleetRequests" // DescribeSpotFleetRequestsRequest generates a request for the DescribeSpotFleetRequests operation. -func (c *EC2) DescribeSpotFleetRequestsRequest(input *DescribeSpotFleetRequestsInput) (req *aws.Request, output *DescribeSpotFleetRequestsOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opDescribeSpotFleetRequests == nil { - opDescribeSpotFleetRequests = &aws.Operation{ - Name: "DescribeSpotFleetRequests", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *EC2) DescribeSpotFleetRequestsRequest(input *DescribeSpotFleetRequestsInput) (req *request.Request, output *DescribeSpotFleetRequestsOutput) { + op := &request.Operation{ + Name: opDescribeSpotFleetRequests, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &DescribeSpotFleetRequestsInput{} } - req = c.newRequest(opDescribeSpotFleetRequests, input, output) + req = c.newRequest(op, input, output) output = &DescribeSpotFleetRequestsOutput{} req.Data = output return @@ -4323,40 +3873,35 @@ func (c *EC2) DescribeSpotFleetRequests(input *DescribeSpotFleetRequestsInput) ( return out, err } -var opDescribeSpotFleetRequests *aws.Operation +const opDescribeSpotInstanceRequests = "DescribeSpotInstanceRequests" // DescribeSpotInstanceRequestsRequest generates a request for the DescribeSpotInstanceRequests operation. -func (c *EC2) DescribeSpotInstanceRequestsRequest(input *DescribeSpotInstanceRequestsInput) (req *aws.Request, output *DescribeSpotInstanceRequestsOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opDescribeSpotInstanceRequests == nil { - opDescribeSpotInstanceRequests = &aws.Operation{ - Name: "DescribeSpotInstanceRequests", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *EC2) DescribeSpotInstanceRequestsRequest(input *DescribeSpotInstanceRequestsInput) (req *request.Request, output *DescribeSpotInstanceRequestsOutput) { + op := &request.Operation{ + Name: opDescribeSpotInstanceRequests, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &DescribeSpotInstanceRequestsInput{} } - req = c.newRequest(opDescribeSpotInstanceRequests, input, output) + req = c.newRequest(op, input, output) output = &DescribeSpotInstanceRequestsOutput{} req.Data = output return } -// Describes the Spot Instance requests that belong to your account. Spot Instances +// Describes the Spot instance requests that belong to your account. Spot instances // are instances that Amazon EC2 launches when the bid price that you specify -// exceeds the current Spot Price. Amazon EC2 periodically sets the Spot Price -// based on available Spot Instance capacity and current Spot Instance requests. +// exceeds the current Spot price. Amazon EC2 periodically sets the Spot price +// based on available Spot instance capacity and current Spot instance requests. // For more information, see Spot Instance Requests (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-requests.html) // in the Amazon Elastic Compute Cloud User Guide. // -// You can use DescribeSpotInstanceRequests to find a running Spot Instance -// by examining the response. If the status of the Spot Instance is fulfilled, +// You can use DescribeSpotInstanceRequests to find a running Spot instance +// by examining the response. If the status of the Spot instance is fulfilled, // the instance ID appears in the response and contains the identifier of the // instance. Alternatively, you can use DescribeInstances with a filter to look // for instances where the instance lifecycle is spot. @@ -4366,38 +3911,33 @@ func (c *EC2) DescribeSpotInstanceRequests(input *DescribeSpotInstanceRequestsIn return out, err } -var opDescribeSpotInstanceRequests *aws.Operation +const opDescribeSpotPriceHistory = "DescribeSpotPriceHistory" // DescribeSpotPriceHistoryRequest generates a request for the DescribeSpotPriceHistory operation. -func (c *EC2) DescribeSpotPriceHistoryRequest(input *DescribeSpotPriceHistoryInput) (req *aws.Request, output *DescribeSpotPriceHistoryOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opDescribeSpotPriceHistory == nil { - opDescribeSpotPriceHistory = &aws.Operation{ - Name: "DescribeSpotPriceHistory", - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &aws.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } +func (c *EC2) DescribeSpotPriceHistoryRequest(input *DescribeSpotPriceHistoryInput) (req *request.Request, output *DescribeSpotPriceHistoryOutput) { + op := &request.Operation{ + Name: opDescribeSpotPriceHistory, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { input = &DescribeSpotPriceHistoryInput{} } - req = c.newRequest(opDescribeSpotPriceHistory, input, output) + req = c.newRequest(op, input, output) output = &DescribeSpotPriceHistoryOutput{} req.Data = output return } -// Describes the Spot Price history. The prices returned are listed in chronological +// Describes the Spot price history. The prices returned are listed in chronological // order, from the oldest to the most recent, for up to the past 90 days. For // more information, see Spot Instance Pricing History (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-spot-instances-history.html) // in the Amazon Elastic Compute Cloud User Guide. @@ -4419,26 +3959,21 @@ func (c *EC2) DescribeSpotPriceHistoryPages(input *DescribeSpotPriceHistoryInput }) } -var opDescribeSpotPriceHistory *aws.Operation +const opDescribeSubnets = "DescribeSubnets" // DescribeSubnetsRequest generates a request for the DescribeSubnets operation. -func (c *EC2) DescribeSubnetsRequest(input *DescribeSubnetsInput) (req *aws.Request, output *DescribeSubnetsOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opDescribeSubnets == nil { - opDescribeSubnets = &aws.Operation{ - Name: "DescribeSubnets", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *EC2) DescribeSubnetsRequest(input *DescribeSubnetsInput) (req *request.Request, output *DescribeSubnetsOutput) { + op := &request.Operation{ + Name: opDescribeSubnets, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &DescribeSubnetsInput{} } - req = c.newRequest(opDescribeSubnets, input, output) + req = c.newRequest(op, input, output) output = &DescribeSubnetsOutput{} req.Data = output return @@ -4454,26 +3989,21 @@ func (c *EC2) DescribeSubnets(input *DescribeSubnetsInput) (*DescribeSubnetsOutp return out, err } -var opDescribeSubnets *aws.Operation +const opDescribeTags = "DescribeTags" // DescribeTagsRequest generates a request for the DescribeTags operation. -func (c *EC2) DescribeTagsRequest(input *DescribeTagsInput) (req *aws.Request, output *DescribeTagsOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opDescribeTags == nil { - opDescribeTags = &aws.Operation{ - Name: "DescribeTags", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *EC2) DescribeTagsRequest(input *DescribeTagsInput) (req *request.Request, output *DescribeTagsOutput) { + op := &request.Operation{ + Name: opDescribeTags, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &DescribeTagsInput{} } - req = c.newRequest(opDescribeTags, input, output) + req = c.newRequest(op, input, output) output = &DescribeTagsOutput{} req.Data = output return @@ -4489,292 +4019,21 @@ func (c *EC2) DescribeTags(input *DescribeTagsInput) (*DescribeTagsOutput, error return out, err } -var opDescribeTags *aws.Operation - -// DescribeVPCAttributeRequest generates a request for the DescribeVPCAttribute operation. -func (c *EC2) DescribeVPCAttributeRequest(input *DescribeVPCAttributeInput) (req *aws.Request, output *DescribeVPCAttributeOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opDescribeVPCAttribute == nil { - opDescribeVPCAttribute = &aws.Operation{ - Name: "DescribeVpcAttribute", - HTTPMethod: "POST", - HTTPPath: "/", - } - } - - if input == nil { - input = &DescribeVPCAttributeInput{} - } - - req = c.newRequest(opDescribeVPCAttribute, input, output) - output = &DescribeVPCAttributeOutput{} - req.Data = output - return -} - -// Describes the specified attribute of the specified VPC. You can specify only -// one attribute at a time. -func (c *EC2) DescribeVPCAttribute(input *DescribeVPCAttributeInput) (*DescribeVPCAttributeOutput, error) { - req, out := c.DescribeVPCAttributeRequest(input) - err := req.Send() - return out, err -} - -var opDescribeVPCAttribute *aws.Operation - -// DescribeVPCClassicLinkRequest generates a request for the DescribeVPCClassicLink operation. -func (c *EC2) DescribeVPCClassicLinkRequest(input *DescribeVPCClassicLinkInput) (req *aws.Request, output *DescribeVPCClassicLinkOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opDescribeVPCClassicLink == nil { - opDescribeVPCClassicLink = &aws.Operation{ - Name: "DescribeVpcClassicLink", - HTTPMethod: "POST", - HTTPPath: "/", - } - } - - if input == nil { - input = &DescribeVPCClassicLinkInput{} - } - - req = c.newRequest(opDescribeVPCClassicLink, input, output) - output = &DescribeVPCClassicLinkOutput{} - req.Data = output - return -} - -// Describes the ClassicLink status of one or more VPCs. -func (c *EC2) DescribeVPCClassicLink(input *DescribeVPCClassicLinkInput) (*DescribeVPCClassicLinkOutput, error) { - req, out := c.DescribeVPCClassicLinkRequest(input) - err := req.Send() - return out, err -} - -var opDescribeVPCClassicLink *aws.Operation - -// DescribeVPCEndpointServicesRequest generates a request for the DescribeVPCEndpointServices operation. -func (c *EC2) DescribeVPCEndpointServicesRequest(input *DescribeVPCEndpointServicesInput) (req *aws.Request, output *DescribeVPCEndpointServicesOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opDescribeVPCEndpointServices == nil { - opDescribeVPCEndpointServices = &aws.Operation{ - Name: "DescribeVpcEndpointServices", - HTTPMethod: "POST", - HTTPPath: "/", - } - } - - if input == nil { - input = &DescribeVPCEndpointServicesInput{} - } - - req = c.newRequest(opDescribeVPCEndpointServices, input, output) - output = &DescribeVPCEndpointServicesOutput{} - req.Data = output - return -} - -// Describes all supported AWS services that can be specified when creating -// a VPC endpoint. -func (c *EC2) DescribeVPCEndpointServices(input *DescribeVPCEndpointServicesInput) (*DescribeVPCEndpointServicesOutput, error) { - req, out := c.DescribeVPCEndpointServicesRequest(input) - err := req.Send() - return out, err -} - -var opDescribeVPCEndpointServices *aws.Operation - -// DescribeVPCEndpointsRequest generates a request for the DescribeVPCEndpoints operation. -func (c *EC2) DescribeVPCEndpointsRequest(input *DescribeVPCEndpointsInput) (req *aws.Request, output *DescribeVPCEndpointsOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opDescribeVPCEndpoints == nil { - opDescribeVPCEndpoints = &aws.Operation{ - Name: "DescribeVpcEndpoints", - HTTPMethod: "POST", - HTTPPath: "/", - } - } - - if input == nil { - input = &DescribeVPCEndpointsInput{} - } - - req = c.newRequest(opDescribeVPCEndpoints, input, output) - output = &DescribeVPCEndpointsOutput{} - req.Data = output - return -} - -// Describes one or more of your VPC endpoints. -func (c *EC2) DescribeVPCEndpoints(input *DescribeVPCEndpointsInput) (*DescribeVPCEndpointsOutput, error) { - req, out := c.DescribeVPCEndpointsRequest(input) - err := req.Send() - return out, err -} - -var opDescribeVPCEndpoints *aws.Operation - -// DescribeVPCPeeringConnectionsRequest generates a request for the DescribeVPCPeeringConnections operation. -func (c *EC2) DescribeVPCPeeringConnectionsRequest(input *DescribeVPCPeeringConnectionsInput) (req *aws.Request, output *DescribeVPCPeeringConnectionsOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opDescribeVPCPeeringConnections == nil { - opDescribeVPCPeeringConnections = &aws.Operation{ - Name: "DescribeVpcPeeringConnections", - HTTPMethod: "POST", - HTTPPath: "/", - } - } - - if input == nil { - input = &DescribeVPCPeeringConnectionsInput{} - } - - req = c.newRequest(opDescribeVPCPeeringConnections, input, output) - output = &DescribeVPCPeeringConnectionsOutput{} - req.Data = output - return -} - -// Describes one or more of your VPC peering connections. -func (c *EC2) DescribeVPCPeeringConnections(input *DescribeVPCPeeringConnectionsInput) (*DescribeVPCPeeringConnectionsOutput, error) { - req, out := c.DescribeVPCPeeringConnectionsRequest(input) - err := req.Send() - return out, err -} - -var opDescribeVPCPeeringConnections *aws.Operation - -// DescribeVPCsRequest generates a request for the DescribeVPCs operation. -func (c *EC2) DescribeVPCsRequest(input *DescribeVPCsInput) (req *aws.Request, output *DescribeVPCsOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opDescribeVPCs == nil { - opDescribeVPCs = &aws.Operation{ - Name: "DescribeVpcs", - HTTPMethod: "POST", - HTTPPath: "/", - } - } - - if input == nil { - input = &DescribeVPCsInput{} - } - - req = c.newRequest(opDescribeVPCs, input, output) - output = &DescribeVPCsOutput{} - req.Data = output - return -} - -// Describes one or more of your VPCs. -func (c *EC2) DescribeVPCs(input *DescribeVPCsInput) (*DescribeVPCsOutput, error) { - req, out := c.DescribeVPCsRequest(input) - err := req.Send() - return out, err -} - -var opDescribeVPCs *aws.Operation - -// DescribeVPNConnectionsRequest generates a request for the DescribeVPNConnections operation. -func (c *EC2) DescribeVPNConnectionsRequest(input *DescribeVPNConnectionsInput) (req *aws.Request, output *DescribeVPNConnectionsOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opDescribeVPNConnections == nil { - opDescribeVPNConnections = &aws.Operation{ - Name: "DescribeVpnConnections", - HTTPMethod: "POST", - HTTPPath: "/", - } - } - - if input == nil { - input = &DescribeVPNConnectionsInput{} - } - - req = c.newRequest(opDescribeVPNConnections, input, output) - output = &DescribeVPNConnectionsOutput{} - req.Data = output - return -} - -// Describes one or more of your VPN connections. -// -// For more information about VPN connections, see Adding a Hardware Virtual -// Private Gateway to Your VPC (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_VPN.html) -// in the Amazon Virtual Private Cloud User Guide. -func (c *EC2) DescribeVPNConnections(input *DescribeVPNConnectionsInput) (*DescribeVPNConnectionsOutput, error) { - req, out := c.DescribeVPNConnectionsRequest(input) - err := req.Send() - return out, err -} - -var opDescribeVPNConnections *aws.Operation - -// DescribeVPNGatewaysRequest generates a request for the DescribeVPNGateways operation. -func (c *EC2) DescribeVPNGatewaysRequest(input *DescribeVPNGatewaysInput) (req *aws.Request, output *DescribeVPNGatewaysOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opDescribeVPNGateways == nil { - opDescribeVPNGateways = &aws.Operation{ - Name: "DescribeVpnGateways", - HTTPMethod: "POST", - HTTPPath: "/", - } - } - - if input == nil { - input = &DescribeVPNGatewaysInput{} - } - - req = c.newRequest(opDescribeVPNGateways, input, output) - output = &DescribeVPNGatewaysOutput{} - req.Data = output - return -} - -// Describes one or more of your virtual private gateways. -// -// For more information about virtual private gateways, see Adding an IPsec -// Hardware VPN to Your VPC (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_VPN.html) -// in the Amazon Virtual Private Cloud User Guide. -func (c *EC2) DescribeVPNGateways(input *DescribeVPNGatewaysInput) (*DescribeVPNGatewaysOutput, error) { - req, out := c.DescribeVPNGatewaysRequest(input) - err := req.Send() - return out, err -} - -var opDescribeVPNGateways *aws.Operation +const opDescribeVolumeAttribute = "DescribeVolumeAttribute" // DescribeVolumeAttributeRequest generates a request for the DescribeVolumeAttribute operation. -func (c *EC2) DescribeVolumeAttributeRequest(input *DescribeVolumeAttributeInput) (req *aws.Request, output *DescribeVolumeAttributeOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opDescribeVolumeAttribute == nil { - opDescribeVolumeAttribute = &aws.Operation{ - Name: "DescribeVolumeAttribute", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *EC2) DescribeVolumeAttributeRequest(input *DescribeVolumeAttributeInput) (req *request.Request, output *DescribeVolumeAttributeOutput) { + op := &request.Operation{ + Name: opDescribeVolumeAttribute, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &DescribeVolumeAttributeInput{} } - req = c.newRequest(opDescribeVolumeAttribute, input, output) + req = c.newRequest(op, input, output) output = &DescribeVolumeAttributeOutput{} req.Data = output return @@ -4791,32 +4050,27 @@ func (c *EC2) DescribeVolumeAttribute(input *DescribeVolumeAttributeInput) (*Des return out, err } -var opDescribeVolumeAttribute *aws.Operation +const opDescribeVolumeStatus = "DescribeVolumeStatus" // DescribeVolumeStatusRequest generates a request for the DescribeVolumeStatus operation. -func (c *EC2) DescribeVolumeStatusRequest(input *DescribeVolumeStatusInput) (req *aws.Request, output *DescribeVolumeStatusOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opDescribeVolumeStatus == nil { - opDescribeVolumeStatus = &aws.Operation{ - Name: "DescribeVolumeStatus", - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &aws.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } +func (c *EC2) DescribeVolumeStatusRequest(input *DescribeVolumeStatusInput) (req *request.Request, output *DescribeVolumeStatusOutput) { + op := &request.Operation{ + Name: opDescribeVolumeStatus, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { input = &DescribeVolumeStatusInput{} } - req = c.newRequest(opDescribeVolumeStatus, input, output) + req = c.newRequest(op, input, output) output = &DescribeVolumeStatusOutput{} req.Data = output return @@ -4870,32 +4124,27 @@ func (c *EC2) DescribeVolumeStatusPages(input *DescribeVolumeStatusInput, fn fun }) } -var opDescribeVolumeStatus *aws.Operation +const opDescribeVolumes = "DescribeVolumes" // DescribeVolumesRequest generates a request for the DescribeVolumes operation. -func (c *EC2) DescribeVolumesRequest(input *DescribeVolumesInput) (req *aws.Request, output *DescribeVolumesOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opDescribeVolumes == nil { - opDescribeVolumes = &aws.Operation{ - Name: "DescribeVolumes", - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &aws.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } +func (c *EC2) DescribeVolumesRequest(input *DescribeVolumesInput) (req *request.Request, output *DescribeVolumesOutput) { + op := &request.Operation{ + Name: opDescribeVolumes, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { input = &DescribeVolumesInput{} } - req = c.newRequest(opDescribeVolumes, input, output) + req = c.newRequest(op, input, output) output = &DescribeVolumesOutput{} req.Data = output return @@ -4925,282 +4174,468 @@ func (c *EC2) DescribeVolumesPages(input *DescribeVolumesInput, fn func(p *Descr }) } -var opDescribeVolumes *aws.Operation - -// DetachClassicLinkVPCRequest generates a request for the DetachClassicLinkVPC operation. -func (c *EC2) DetachClassicLinkVPCRequest(input *DetachClassicLinkVPCInput) (req *aws.Request, output *DetachClassicLinkVPCOutput) { - oprw.Lock() - defer oprw.Unlock() +const opDescribeVpcAttribute = "DescribeVpcAttribute" - if opDetachClassicLinkVPC == nil { - opDetachClassicLinkVPC = &aws.Operation{ - Name: "DetachClassicLinkVpc", - HTTPMethod: "POST", - HTTPPath: "/", - } +// DescribeVpcAttributeRequest generates a request for the DescribeVpcAttribute operation. +func (c *EC2) DescribeVpcAttributeRequest(input *DescribeVpcAttributeInput) (req *request.Request, output *DescribeVpcAttributeOutput) { + op := &request.Operation{ + Name: opDescribeVpcAttribute, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { - input = &DetachClassicLinkVPCInput{} + input = &DescribeVpcAttributeInput{} } - req = c.newRequest(opDetachClassicLinkVPC, input, output) - output = &DetachClassicLinkVPCOutput{} + req = c.newRequest(op, input, output) + output = &DescribeVpcAttributeOutput{} req.Data = output return } -// Unlinks (detaches) a linked EC2-Classic instance from a VPC. After the instance -// has been unlinked, the VPC security groups are no longer associated with -// it. An instance is automatically unlinked from a VPC when it's stopped. -func (c *EC2) DetachClassicLinkVPC(input *DetachClassicLinkVPCInput) (*DetachClassicLinkVPCOutput, error) { - req, out := c.DetachClassicLinkVPCRequest(input) +// Describes the specified attribute of the specified VPC. You can specify only +// one attribute at a time. +func (c *EC2) DescribeVpcAttribute(input *DescribeVpcAttributeInput) (*DescribeVpcAttributeOutput, error) { + req, out := c.DescribeVpcAttributeRequest(input) err := req.Send() return out, err } -var opDetachClassicLinkVPC *aws.Operation - -// DetachInternetGatewayRequest generates a request for the DetachInternetGateway operation. -func (c *EC2) DetachInternetGatewayRequest(input *DetachInternetGatewayInput) (req *aws.Request, output *DetachInternetGatewayOutput) { - oprw.Lock() - defer oprw.Unlock() +const opDescribeVpcClassicLink = "DescribeVpcClassicLink" - if opDetachInternetGateway == nil { - opDetachInternetGateway = &aws.Operation{ - Name: "DetachInternetGateway", - HTTPMethod: "POST", - HTTPPath: "/", - } +// DescribeVpcClassicLinkRequest generates a request for the DescribeVpcClassicLink operation. +func (c *EC2) DescribeVpcClassicLinkRequest(input *DescribeVpcClassicLinkInput) (req *request.Request, output *DescribeVpcClassicLinkOutput) { + op := &request.Operation{ + Name: opDescribeVpcClassicLink, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { - input = &DetachInternetGatewayInput{} + input = &DescribeVpcClassicLinkInput{} } - req = c.newRequest(opDetachInternetGateway, input, output) - output = &DetachInternetGatewayOutput{} + req = c.newRequest(op, input, output) + output = &DescribeVpcClassicLinkOutput{} req.Data = output return } -// Detaches an Internet gateway from a VPC, disabling connectivity between the -// Internet and the VPC. The VPC must not contain any running instances with -// Elastic IP addresses. -func (c *EC2) DetachInternetGateway(input *DetachInternetGatewayInput) (*DetachInternetGatewayOutput, error) { - req, out := c.DetachInternetGatewayRequest(input) +// Describes the ClassicLink status of one or more VPCs. +func (c *EC2) DescribeVpcClassicLink(input *DescribeVpcClassicLinkInput) (*DescribeVpcClassicLinkOutput, error) { + req, out := c.DescribeVpcClassicLinkRequest(input) err := req.Send() return out, err } -var opDetachInternetGateway *aws.Operation - -// DetachNetworkInterfaceRequest generates a request for the DetachNetworkInterface operation. -func (c *EC2) DetachNetworkInterfaceRequest(input *DetachNetworkInterfaceInput) (req *aws.Request, output *DetachNetworkInterfaceOutput) { - oprw.Lock() - defer oprw.Unlock() +const opDescribeVpcEndpointServices = "DescribeVpcEndpointServices" - if opDetachNetworkInterface == nil { - opDetachNetworkInterface = &aws.Operation{ - Name: "DetachNetworkInterface", - HTTPMethod: "POST", - HTTPPath: "/", - } +// DescribeVpcEndpointServicesRequest generates a request for the DescribeVpcEndpointServices operation. +func (c *EC2) DescribeVpcEndpointServicesRequest(input *DescribeVpcEndpointServicesInput) (req *request.Request, output *DescribeVpcEndpointServicesOutput) { + op := &request.Operation{ + Name: opDescribeVpcEndpointServices, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { - input = &DetachNetworkInterfaceInput{} + input = &DescribeVpcEndpointServicesInput{} } - req = c.newRequest(opDetachNetworkInterface, input, output) - output = &DetachNetworkInterfaceOutput{} + req = c.newRequest(op, input, output) + output = &DescribeVpcEndpointServicesOutput{} req.Data = output return } -// Detaches a network interface from an instance. -func (c *EC2) DetachNetworkInterface(input *DetachNetworkInterfaceInput) (*DetachNetworkInterfaceOutput, error) { - req, out := c.DetachNetworkInterfaceRequest(input) +// Describes all supported AWS services that can be specified when creating +// a VPC endpoint. +func (c *EC2) DescribeVpcEndpointServices(input *DescribeVpcEndpointServicesInput) (*DescribeVpcEndpointServicesOutput, error) { + req, out := c.DescribeVpcEndpointServicesRequest(input) err := req.Send() return out, err } -var opDetachNetworkInterface *aws.Operation +const opDescribeVpcEndpoints = "DescribeVpcEndpoints" -// DetachVPNGatewayRequest generates a request for the DetachVPNGateway operation. -func (c *EC2) DetachVPNGatewayRequest(input *DetachVPNGatewayInput) (req *aws.Request, output *DetachVPNGatewayOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opDetachVPNGateway == nil { - opDetachVPNGateway = &aws.Operation{ - Name: "DetachVpnGateway", - HTTPMethod: "POST", - HTTPPath: "/", - } +// DescribeVpcEndpointsRequest generates a request for the DescribeVpcEndpoints operation. +func (c *EC2) DescribeVpcEndpointsRequest(input *DescribeVpcEndpointsInput) (req *request.Request, output *DescribeVpcEndpointsOutput) { + op := &request.Operation{ + Name: opDescribeVpcEndpoints, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { - input = &DetachVPNGatewayInput{} + input = &DescribeVpcEndpointsInput{} } - req = c.newRequest(opDetachVPNGateway, input, output) - output = &DetachVPNGatewayOutput{} + req = c.newRequest(op, input, output) + output = &DescribeVpcEndpointsOutput{} req.Data = output return } -// Detaches a virtual private gateway from a VPC. You do this if you're planning -// to turn off the VPC and not use it anymore. You can confirm a virtual private -// gateway has been completely detached from a VPC by describing the virtual -// private gateway (any attachments to the virtual private gateway are also -// described). -// -// You must wait for the attachment's state to switch to detached before you -// can delete the VPC or attach a different VPC to the virtual private gateway. -func (c *EC2) DetachVPNGateway(input *DetachVPNGatewayInput) (*DetachVPNGatewayOutput, error) { - req, out := c.DetachVPNGatewayRequest(input) +// Describes one or more of your VPC endpoints. +func (c *EC2) DescribeVpcEndpoints(input *DescribeVpcEndpointsInput) (*DescribeVpcEndpointsOutput, error) { + req, out := c.DescribeVpcEndpointsRequest(input) err := req.Send() return out, err } -var opDetachVPNGateway *aws.Operation - -// DetachVolumeRequest generates a request for the DetachVolume operation. -func (c *EC2) DetachVolumeRequest(input *DetachVolumeInput) (req *aws.Request, output *VolumeAttachment) { - oprw.Lock() - defer oprw.Unlock() +const opDescribeVpcPeeringConnections = "DescribeVpcPeeringConnections" - if opDetachVolume == nil { - opDetachVolume = &aws.Operation{ - Name: "DetachVolume", - HTTPMethod: "POST", - HTTPPath: "/", - } +// DescribeVpcPeeringConnectionsRequest generates a request for the DescribeVpcPeeringConnections operation. +func (c *EC2) DescribeVpcPeeringConnectionsRequest(input *DescribeVpcPeeringConnectionsInput) (req *request.Request, output *DescribeVpcPeeringConnectionsOutput) { + op := &request.Operation{ + Name: opDescribeVpcPeeringConnections, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { - input = &DetachVolumeInput{} + input = &DescribeVpcPeeringConnectionsInput{} } - req = c.newRequest(opDetachVolume, input, output) - output = &VolumeAttachment{} + req = c.newRequest(op, input, output) + output = &DescribeVpcPeeringConnectionsOutput{} req.Data = output return } -// Detaches an EBS volume from an instance. Make sure to unmount any file systems -// on the device within your operating system before detaching the volume. Failure -// to do so results in the volume being stuck in a busy state while detaching. -// -// If an Amazon EBS volume is the root device of an instance, it can't be detached -// while the instance is running. To detach the root volume, stop the instance -// first. -// -// When a volume with an AWS Marketplace product code is detached from an instance, -// the product code is no longer associated with the instance. -// -// For more information, see Detaching an Amazon EBS Volume (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-detaching-volume.html) -// in the Amazon Elastic Compute Cloud User Guide. -func (c *EC2) DetachVolume(input *DetachVolumeInput) (*VolumeAttachment, error) { - req, out := c.DetachVolumeRequest(input) +// Describes one or more of your VPC peering connections. +func (c *EC2) DescribeVpcPeeringConnections(input *DescribeVpcPeeringConnectionsInput) (*DescribeVpcPeeringConnectionsOutput, error) { + req, out := c.DescribeVpcPeeringConnectionsRequest(input) err := req.Send() return out, err } -var opDetachVolume *aws.Operation +const opDescribeVpcs = "DescribeVpcs" -// DisableVGWRoutePropagationRequest generates a request for the DisableVGWRoutePropagation operation. -func (c *EC2) DisableVGWRoutePropagationRequest(input *DisableVGWRoutePropagationInput) (req *aws.Request, output *DisableVGWRoutePropagationOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opDisableVGWRoutePropagation == nil { - opDisableVGWRoutePropagation = &aws.Operation{ - Name: "DisableVgwRoutePropagation", - HTTPMethod: "POST", - HTTPPath: "/", - } +// DescribeVpcsRequest generates a request for the DescribeVpcs operation. +func (c *EC2) DescribeVpcsRequest(input *DescribeVpcsInput) (req *request.Request, output *DescribeVpcsOutput) { + op := &request.Operation{ + Name: opDescribeVpcs, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { - input = &DisableVGWRoutePropagationInput{} + input = &DescribeVpcsInput{} } - req = c.newRequest(opDisableVGWRoutePropagation, input, output) - output = &DisableVGWRoutePropagationOutput{} + req = c.newRequest(op, input, output) + output = &DescribeVpcsOutput{} req.Data = output return } -// Disables a virtual private gateway (VGW) from propagating routes to a specified -// route table of a VPC. -func (c *EC2) DisableVGWRoutePropagation(input *DisableVGWRoutePropagationInput) (*DisableVGWRoutePropagationOutput, error) { - req, out := c.DisableVGWRoutePropagationRequest(input) +// Describes one or more of your VPCs. +func (c *EC2) DescribeVpcs(input *DescribeVpcsInput) (*DescribeVpcsOutput, error) { + req, out := c.DescribeVpcsRequest(input) err := req.Send() return out, err } -var opDisableVGWRoutePropagation *aws.Operation +const opDescribeVpnConnections = "DescribeVpnConnections" -// DisableVPCClassicLinkRequest generates a request for the DisableVPCClassicLink operation. -func (c *EC2) DisableVPCClassicLinkRequest(input *DisableVPCClassicLinkInput) (req *aws.Request, output *DisableVPCClassicLinkOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opDisableVPCClassicLink == nil { - opDisableVPCClassicLink = &aws.Operation{ - Name: "DisableVpcClassicLink", - HTTPMethod: "POST", - HTTPPath: "/", - } +// DescribeVpnConnectionsRequest generates a request for the DescribeVpnConnections operation. +func (c *EC2) DescribeVpnConnectionsRequest(input *DescribeVpnConnectionsInput) (req *request.Request, output *DescribeVpnConnectionsOutput) { + op := &request.Operation{ + Name: opDescribeVpnConnections, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { - input = &DisableVPCClassicLinkInput{} + input = &DescribeVpnConnectionsInput{} } - req = c.newRequest(opDisableVPCClassicLink, input, output) - output = &DisableVPCClassicLinkOutput{} + req = c.newRequest(op, input, output) + output = &DescribeVpnConnectionsOutput{} req.Data = output return } -// Disables ClassicLink for a VPC. You cannot disable ClassicLink for a VPC -// that has EC2-Classic instances linked to it. -func (c *EC2) DisableVPCClassicLink(input *DisableVPCClassicLinkInput) (*DisableVPCClassicLinkOutput, error) { - req, out := c.DisableVPCClassicLinkRequest(input) +// Describes one or more of your VPN connections. +// +// For more information about VPN connections, see Adding a Hardware Virtual +// Private Gateway to Your VPC (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_VPN.html) +// in the Amazon Virtual Private Cloud User Guide. +func (c *EC2) DescribeVpnConnections(input *DescribeVpnConnectionsInput) (*DescribeVpnConnectionsOutput, error) { + req, out := c.DescribeVpnConnectionsRequest(input) err := req.Send() return out, err } -var opDisableVPCClassicLink *aws.Operation - -// DisassociateAddressRequest generates a request for the DisassociateAddress operation. -func (c *EC2) DisassociateAddressRequest(input *DisassociateAddressInput) (req *aws.Request, output *DisassociateAddressOutput) { - oprw.Lock() - defer oprw.Unlock() +const opDescribeVpnGateways = "DescribeVpnGateways" - if opDisassociateAddress == nil { - opDisassociateAddress = &aws.Operation{ - Name: "DisassociateAddress", - HTTPMethod: "POST", - HTTPPath: "/", - } +// DescribeVpnGatewaysRequest generates a request for the DescribeVpnGateways operation. +func (c *EC2) DescribeVpnGatewaysRequest(input *DescribeVpnGatewaysInput) (req *request.Request, output *DescribeVpnGatewaysOutput) { + op := &request.Operation{ + Name: opDescribeVpnGateways, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { - input = &DisassociateAddressInput{} + input = &DescribeVpnGatewaysInput{} } - req = c.newRequest(opDisassociateAddress, input, output) - output = &DisassociateAddressOutput{} + req = c.newRequest(op, input, output) + output = &DescribeVpnGatewaysOutput{} req.Data = output return } -// Disassociates an Elastic IP address from the instance or network interface -// it's associated with. +// Describes one or more of your virtual private gateways. +// +// For more information about virtual private gateways, see Adding an IPsec +// Hardware VPN to Your VPC (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_VPN.html) +// in the Amazon Virtual Private Cloud User Guide. +func (c *EC2) DescribeVpnGateways(input *DescribeVpnGatewaysInput) (*DescribeVpnGatewaysOutput, error) { + req, out := c.DescribeVpnGatewaysRequest(input) + err := req.Send() + return out, err +} + +const opDetachClassicLinkVpc = "DetachClassicLinkVpc" + +// DetachClassicLinkVpcRequest generates a request for the DetachClassicLinkVpc operation. +func (c *EC2) DetachClassicLinkVpcRequest(input *DetachClassicLinkVpcInput) (req *request.Request, output *DetachClassicLinkVpcOutput) { + op := &request.Operation{ + Name: opDetachClassicLinkVpc, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DetachClassicLinkVpcInput{} + } + + req = c.newRequest(op, input, output) + output = &DetachClassicLinkVpcOutput{} + req.Data = output + return +} + +// Unlinks (detaches) a linked EC2-Classic instance from a VPC. After the instance +// has been unlinked, the VPC security groups are no longer associated with +// it. An instance is automatically unlinked from a VPC when it's stopped. +func (c *EC2) DetachClassicLinkVpc(input *DetachClassicLinkVpcInput) (*DetachClassicLinkVpcOutput, error) { + req, out := c.DetachClassicLinkVpcRequest(input) + err := req.Send() + return out, err +} + +const opDetachInternetGateway = "DetachInternetGateway" + +// DetachInternetGatewayRequest generates a request for the DetachInternetGateway operation. +func (c *EC2) DetachInternetGatewayRequest(input *DetachInternetGatewayInput) (req *request.Request, output *DetachInternetGatewayOutput) { + op := &request.Operation{ + Name: opDetachInternetGateway, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DetachInternetGatewayInput{} + } + + req = c.newRequest(op, input, output) + output = &DetachInternetGatewayOutput{} + req.Data = output + return +} + +// Detaches an Internet gateway from a VPC, disabling connectivity between the +// Internet and the VPC. The VPC must not contain any running instances with +// Elastic IP addresses. +func (c *EC2) DetachInternetGateway(input *DetachInternetGatewayInput) (*DetachInternetGatewayOutput, error) { + req, out := c.DetachInternetGatewayRequest(input) + err := req.Send() + return out, err +} + +const opDetachNetworkInterface = "DetachNetworkInterface" + +// DetachNetworkInterfaceRequest generates a request for the DetachNetworkInterface operation. +func (c *EC2) DetachNetworkInterfaceRequest(input *DetachNetworkInterfaceInput) (req *request.Request, output *DetachNetworkInterfaceOutput) { + op := &request.Operation{ + Name: opDetachNetworkInterface, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DetachNetworkInterfaceInput{} + } + + req = c.newRequest(op, input, output) + output = &DetachNetworkInterfaceOutput{} + req.Data = output + return +} + +// Detaches a network interface from an instance. +func (c *EC2) DetachNetworkInterface(input *DetachNetworkInterfaceInput) (*DetachNetworkInterfaceOutput, error) { + req, out := c.DetachNetworkInterfaceRequest(input) + err := req.Send() + return out, err +} + +const opDetachVolume = "DetachVolume" + +// DetachVolumeRequest generates a request for the DetachVolume operation. +func (c *EC2) DetachVolumeRequest(input *DetachVolumeInput) (req *request.Request, output *VolumeAttachment) { + op := &request.Operation{ + Name: opDetachVolume, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DetachVolumeInput{} + } + + req = c.newRequest(op, input, output) + output = &VolumeAttachment{} + req.Data = output + return +} + +// Detaches an EBS volume from an instance. Make sure to unmount any file systems +// on the device within your operating system before detaching the volume. Failure +// to do so results in the volume being stuck in a busy state while detaching. +// +// If an Amazon EBS volume is the root device of an instance, it can't be detached +// while the instance is running. To detach the root volume, stop the instance +// first. +// +// When a volume with an AWS Marketplace product code is detached from an instance, +// the product code is no longer associated with the instance. +// +// For more information, see Detaching an Amazon EBS Volume (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-detaching-volume.html) +// in the Amazon Elastic Compute Cloud User Guide. +func (c *EC2) DetachVolume(input *DetachVolumeInput) (*VolumeAttachment, error) { + req, out := c.DetachVolumeRequest(input) + err := req.Send() + return out, err +} + +const opDetachVpnGateway = "DetachVpnGateway" + +// DetachVpnGatewayRequest generates a request for the DetachVpnGateway operation. +func (c *EC2) DetachVpnGatewayRequest(input *DetachVpnGatewayInput) (req *request.Request, output *DetachVpnGatewayOutput) { + op := &request.Operation{ + Name: opDetachVpnGateway, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DetachVpnGatewayInput{} + } + + req = c.newRequest(op, input, output) + output = &DetachVpnGatewayOutput{} + req.Data = output + return +} + +// Detaches a virtual private gateway from a VPC. You do this if you're planning +// to turn off the VPC and not use it anymore. You can confirm a virtual private +// gateway has been completely detached from a VPC by describing the virtual +// private gateway (any attachments to the virtual private gateway are also +// described). +// +// You must wait for the attachment's state to switch to detached before you +// can delete the VPC or attach a different VPC to the virtual private gateway. +func (c *EC2) DetachVpnGateway(input *DetachVpnGatewayInput) (*DetachVpnGatewayOutput, error) { + req, out := c.DetachVpnGatewayRequest(input) + err := req.Send() + return out, err +} + +const opDisableVgwRoutePropagation = "DisableVgwRoutePropagation" + +// DisableVgwRoutePropagationRequest generates a request for the DisableVgwRoutePropagation operation. +func (c *EC2) DisableVgwRoutePropagationRequest(input *DisableVgwRoutePropagationInput) (req *request.Request, output *DisableVgwRoutePropagationOutput) { + op := &request.Operation{ + Name: opDisableVgwRoutePropagation, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DisableVgwRoutePropagationInput{} + } + + req = c.newRequest(op, input, output) + output = &DisableVgwRoutePropagationOutput{} + req.Data = output + return +} + +// Disables a virtual private gateway (VGW) from propagating routes to a specified +// route table of a VPC. +func (c *EC2) DisableVgwRoutePropagation(input *DisableVgwRoutePropagationInput) (*DisableVgwRoutePropagationOutput, error) { + req, out := c.DisableVgwRoutePropagationRequest(input) + err := req.Send() + return out, err +} + +const opDisableVpcClassicLink = "DisableVpcClassicLink" + +// DisableVpcClassicLinkRequest generates a request for the DisableVpcClassicLink operation. +func (c *EC2) DisableVpcClassicLinkRequest(input *DisableVpcClassicLinkInput) (req *request.Request, output *DisableVpcClassicLinkOutput) { + op := &request.Operation{ + Name: opDisableVpcClassicLink, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DisableVpcClassicLinkInput{} + } + + req = c.newRequest(op, input, output) + output = &DisableVpcClassicLinkOutput{} + req.Data = output + return +} + +// Disables ClassicLink for a VPC. You cannot disable ClassicLink for a VPC +// that has EC2-Classic instances linked to it. +func (c *EC2) DisableVpcClassicLink(input *DisableVpcClassicLinkInput) (*DisableVpcClassicLinkOutput, error) { + req, out := c.DisableVpcClassicLinkRequest(input) + err := req.Send() + return out, err +} + +const opDisassociateAddress = "DisassociateAddress" + +// DisassociateAddressRequest generates a request for the DisassociateAddress operation. +func (c *EC2) DisassociateAddressRequest(input *DisassociateAddressInput) (req *request.Request, output *DisassociateAddressOutput) { + op := &request.Operation{ + Name: opDisassociateAddress, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DisassociateAddressInput{} + } + + req = c.newRequest(op, input, output) + output = &DisassociateAddressOutput{} + req.Data = output + return +} + +// Disassociates an Elastic IP address from the instance or network interface +// it's associated with. // // An Elastic IP address is for use in either the EC2-Classic platform or in // a VPC. For more information, see Elastic IP Addresses (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html) @@ -5214,26 +4649,21 @@ func (c *EC2) DisassociateAddress(input *DisassociateAddressInput) (*Disassociat return out, err } -var opDisassociateAddress *aws.Operation +const opDisassociateRouteTable = "DisassociateRouteTable" // DisassociateRouteTableRequest generates a request for the DisassociateRouteTable operation. -func (c *EC2) DisassociateRouteTableRequest(input *DisassociateRouteTableInput) (req *aws.Request, output *DisassociateRouteTableOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opDisassociateRouteTable == nil { - opDisassociateRouteTable = &aws.Operation{ - Name: "DisassociateRouteTable", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *EC2) DisassociateRouteTableRequest(input *DisassociateRouteTableInput) (req *request.Request, output *DisassociateRouteTableOutput) { + op := &request.Operation{ + Name: opDisassociateRouteTable, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &DisassociateRouteTableInput{} } - req = c.newRequest(opDisassociateRouteTable, input, output) + req = c.newRequest(op, input, output) output = &DisassociateRouteTableOutput{} req.Data = output return @@ -5251,130 +4681,110 @@ func (c *EC2) DisassociateRouteTable(input *DisassociateRouteTableInput) (*Disas return out, err } -var opDisassociateRouteTable *aws.Operation +const opEnableVgwRoutePropagation = "EnableVgwRoutePropagation" -// EnableVGWRoutePropagationRequest generates a request for the EnableVGWRoutePropagation operation. -func (c *EC2) EnableVGWRoutePropagationRequest(input *EnableVGWRoutePropagationInput) (req *aws.Request, output *EnableVGWRoutePropagationOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opEnableVGWRoutePropagation == nil { - opEnableVGWRoutePropagation = &aws.Operation{ - Name: "EnableVgwRoutePropagation", - HTTPMethod: "POST", - HTTPPath: "/", - } +// EnableVgwRoutePropagationRequest generates a request for the EnableVgwRoutePropagation operation. +func (c *EC2) EnableVgwRoutePropagationRequest(input *EnableVgwRoutePropagationInput) (req *request.Request, output *EnableVgwRoutePropagationOutput) { + op := &request.Operation{ + Name: opEnableVgwRoutePropagation, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { - input = &EnableVGWRoutePropagationInput{} + input = &EnableVgwRoutePropagationInput{} } - req = c.newRequest(opEnableVGWRoutePropagation, input, output) - output = &EnableVGWRoutePropagationOutput{} + req = c.newRequest(op, input, output) + output = &EnableVgwRoutePropagationOutput{} req.Data = output return } // Enables a virtual private gateway (VGW) to propagate routes to the specified // route table of a VPC. -func (c *EC2) EnableVGWRoutePropagation(input *EnableVGWRoutePropagationInput) (*EnableVGWRoutePropagationOutput, error) { - req, out := c.EnableVGWRoutePropagationRequest(input) +func (c *EC2) EnableVgwRoutePropagation(input *EnableVgwRoutePropagationInput) (*EnableVgwRoutePropagationOutput, error) { + req, out := c.EnableVgwRoutePropagationRequest(input) err := req.Send() return out, err } -var opEnableVGWRoutePropagation *aws.Operation - -// EnableVPCClassicLinkRequest generates a request for the EnableVPCClassicLink operation. -func (c *EC2) EnableVPCClassicLinkRequest(input *EnableVPCClassicLinkInput) (req *aws.Request, output *EnableVPCClassicLinkOutput) { - oprw.Lock() - defer oprw.Unlock() +const opEnableVolumeIO = "EnableVolumeIO" - if opEnableVPCClassicLink == nil { - opEnableVPCClassicLink = &aws.Operation{ - Name: "EnableVpcClassicLink", - HTTPMethod: "POST", - HTTPPath: "/", - } +// EnableVolumeIORequest generates a request for the EnableVolumeIO operation. +func (c *EC2) EnableVolumeIORequest(input *EnableVolumeIOInput) (req *request.Request, output *EnableVolumeIOOutput) { + op := &request.Operation{ + Name: opEnableVolumeIO, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { - input = &EnableVPCClassicLinkInput{} + input = &EnableVolumeIOInput{} } - req = c.newRequest(opEnableVPCClassicLink, input, output) - output = &EnableVPCClassicLinkOutput{} + req = c.newRequest(op, input, output) + output = &EnableVolumeIOOutput{} req.Data = output return } -// Enables a VPC for ClassicLink. You can then link EC2-Classic instances to -// your ClassicLink-enabled VPC to allow communication over private IP addresses. -// You cannot enable your VPC for ClassicLink if any of your VPC's route tables -// have existing routes for address ranges within the 10.0.0.0/8 IP address -// range, excluding local routes for VPCs in the 10.0.0.0/16 and 10.1.0.0/16 -// IP address ranges. For more information, see ClassicLink (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/vpc-classiclink.html) -// in the Amazon Elastic Compute Cloud User Guide. -func (c *EC2) EnableVPCClassicLink(input *EnableVPCClassicLinkInput) (*EnableVPCClassicLinkOutput, error) { - req, out := c.EnableVPCClassicLinkRequest(input) +// Enables I/O operations for a volume that had I/O operations disabled because +// the data on the volume was potentially inconsistent. +func (c *EC2) EnableVolumeIO(input *EnableVolumeIOInput) (*EnableVolumeIOOutput, error) { + req, out := c.EnableVolumeIORequest(input) err := req.Send() return out, err } -var opEnableVPCClassicLink *aws.Operation - -// EnableVolumeIORequest generates a request for the EnableVolumeIO operation. -func (c *EC2) EnableVolumeIORequest(input *EnableVolumeIOInput) (req *aws.Request, output *EnableVolumeIOOutput) { - oprw.Lock() - defer oprw.Unlock() +const opEnableVpcClassicLink = "EnableVpcClassicLink" - if opEnableVolumeIO == nil { - opEnableVolumeIO = &aws.Operation{ - Name: "EnableVolumeIO", - HTTPMethod: "POST", - HTTPPath: "/", - } +// EnableVpcClassicLinkRequest generates a request for the EnableVpcClassicLink operation. +func (c *EC2) EnableVpcClassicLinkRequest(input *EnableVpcClassicLinkInput) (req *request.Request, output *EnableVpcClassicLinkOutput) { + op := &request.Operation{ + Name: opEnableVpcClassicLink, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { - input = &EnableVolumeIOInput{} + input = &EnableVpcClassicLinkInput{} } - req = c.newRequest(opEnableVolumeIO, input, output) - output = &EnableVolumeIOOutput{} + req = c.newRequest(op, input, output) + output = &EnableVpcClassicLinkOutput{} req.Data = output return } -// Enables I/O operations for a volume that had I/O operations disabled because -// the data on the volume was potentially inconsistent. -func (c *EC2) EnableVolumeIO(input *EnableVolumeIOInput) (*EnableVolumeIOOutput, error) { - req, out := c.EnableVolumeIORequest(input) +// Enables a VPC for ClassicLink. You can then link EC2-Classic instances to +// your ClassicLink-enabled VPC to allow communication over private IP addresses. +// You cannot enable your VPC for ClassicLink if any of your VPC's route tables +// have existing routes for address ranges within the 10.0.0.0/8 IP address +// range, excluding local routes for VPCs in the 10.0.0.0/16 and 10.1.0.0/16 +// IP address ranges. For more information, see ClassicLink (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/vpc-classiclink.html) +// in the Amazon Elastic Compute Cloud User Guide. +func (c *EC2) EnableVpcClassicLink(input *EnableVpcClassicLinkInput) (*EnableVpcClassicLinkOutput, error) { + req, out := c.EnableVpcClassicLinkRequest(input) err := req.Send() return out, err } -var opEnableVolumeIO *aws.Operation +const opGetConsoleOutput = "GetConsoleOutput" // GetConsoleOutputRequest generates a request for the GetConsoleOutput operation. -func (c *EC2) GetConsoleOutputRequest(input *GetConsoleOutputInput) (req *aws.Request, output *GetConsoleOutputOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opGetConsoleOutput == nil { - opGetConsoleOutput = &aws.Operation{ - Name: "GetConsoleOutput", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *EC2) GetConsoleOutputRequest(input *GetConsoleOutputInput) (req *request.Request, output *GetConsoleOutputOutput) { + op := &request.Operation{ + Name: opGetConsoleOutput, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &GetConsoleOutputInput{} } - req = c.newRequest(opGetConsoleOutput, input, output) + req = c.newRequest(op, input, output) output = &GetConsoleOutputOutput{} req.Data = output return @@ -5404,26 +4814,21 @@ func (c *EC2) GetConsoleOutput(input *GetConsoleOutputInput) (*GetConsoleOutputO return out, err } -var opGetConsoleOutput *aws.Operation +const opGetPasswordData = "GetPasswordData" // GetPasswordDataRequest generates a request for the GetPasswordData operation. -func (c *EC2) GetPasswordDataRequest(input *GetPasswordDataInput) (req *aws.Request, output *GetPasswordDataOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opGetPasswordData == nil { - opGetPasswordData = &aws.Operation{ - Name: "GetPasswordData", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *EC2) GetPasswordDataRequest(input *GetPasswordDataInput) (req *request.Request, output *GetPasswordDataOutput) { + op := &request.Operation{ + Name: opGetPasswordData, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &GetPasswordDataInput{} } - req = c.newRequest(opGetPasswordData, input, output) + req = c.newRequest(op, input, output) output = &GetPasswordDataOutput{} req.Data = output return @@ -5449,26 +4854,21 @@ func (c *EC2) GetPasswordData(input *GetPasswordDataInput) (*GetPasswordDataOutp return out, err } -var opGetPasswordData *aws.Operation +const opImportImage = "ImportImage" // ImportImageRequest generates a request for the ImportImage operation. -func (c *EC2) ImportImageRequest(input *ImportImageInput) (req *aws.Request, output *ImportImageOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opImportImage == nil { - opImportImage = &aws.Operation{ - Name: "ImportImage", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *EC2) ImportImageRequest(input *ImportImageInput) (req *request.Request, output *ImportImageOutput) { + op := &request.Operation{ + Name: opImportImage, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &ImportImageInput{} } - req = c.newRequest(opImportImage, input, output) + req = c.newRequest(op, input, output) output = &ImportImageOutput{} req.Data = output return @@ -5482,26 +4882,21 @@ func (c *EC2) ImportImage(input *ImportImageInput) (*ImportImageOutput, error) { return out, err } -var opImportImage *aws.Operation +const opImportInstance = "ImportInstance" // ImportInstanceRequest generates a request for the ImportInstance operation. -func (c *EC2) ImportInstanceRequest(input *ImportInstanceInput) (req *aws.Request, output *ImportInstanceOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opImportInstance == nil { - opImportInstance = &aws.Operation{ - Name: "ImportInstance", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *EC2) ImportInstanceRequest(input *ImportInstanceInput) (req *request.Request, output *ImportInstanceOutput) { + op := &request.Operation{ + Name: opImportInstance, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &ImportInstanceInput{} } - req = c.newRequest(opImportInstance, input, output) + req = c.newRequest(op, input, output) output = &ImportInstanceOutput{} req.Data = output return @@ -5520,26 +4915,21 @@ func (c *EC2) ImportInstance(input *ImportInstanceInput) (*ImportInstanceOutput, return out, err } -var opImportInstance *aws.Operation +const opImportKeyPair = "ImportKeyPair" // ImportKeyPairRequest generates a request for the ImportKeyPair operation. -func (c *EC2) ImportKeyPairRequest(input *ImportKeyPairInput) (req *aws.Request, output *ImportKeyPairOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opImportKeyPair == nil { - opImportKeyPair = &aws.Operation{ - Name: "ImportKeyPair", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *EC2) ImportKeyPairRequest(input *ImportKeyPairInput) (req *request.Request, output *ImportKeyPairOutput) { + op := &request.Operation{ + Name: opImportKeyPair, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &ImportKeyPairInput{} } - req = c.newRequest(opImportKeyPair, input, output) + req = c.newRequest(op, input, output) output = &ImportKeyPairOutput{} req.Data = output return @@ -5559,26 +4949,21 @@ func (c *EC2) ImportKeyPair(input *ImportKeyPairInput) (*ImportKeyPairOutput, er return out, err } -var opImportKeyPair *aws.Operation +const opImportSnapshot = "ImportSnapshot" // ImportSnapshotRequest generates a request for the ImportSnapshot operation. -func (c *EC2) ImportSnapshotRequest(input *ImportSnapshotInput) (req *aws.Request, output *ImportSnapshotOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opImportSnapshot == nil { - opImportSnapshot = &aws.Operation{ - Name: "ImportSnapshot", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *EC2) ImportSnapshotRequest(input *ImportSnapshotInput) (req *request.Request, output *ImportSnapshotOutput) { + op := &request.Operation{ + Name: opImportSnapshot, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &ImportSnapshotInput{} } - req = c.newRequest(opImportSnapshot, input, output) + req = c.newRequest(op, input, output) output = &ImportSnapshotOutput{} req.Data = output return @@ -5591,26 +4976,21 @@ func (c *EC2) ImportSnapshot(input *ImportSnapshotInput) (*ImportSnapshotOutput, return out, err } -var opImportSnapshot *aws.Operation +const opImportVolume = "ImportVolume" // ImportVolumeRequest generates a request for the ImportVolume operation. -func (c *EC2) ImportVolumeRequest(input *ImportVolumeInput) (req *aws.Request, output *ImportVolumeOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opImportVolume == nil { - opImportVolume = &aws.Operation{ - Name: "ImportVolume", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *EC2) ImportVolumeRequest(input *ImportVolumeInput) (req *request.Request, output *ImportVolumeOutput) { + op := &request.Operation{ + Name: opImportVolume, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &ImportVolumeInput{} } - req = c.newRequest(opImportVolume, input, output) + req = c.newRequest(op, input, output) output = &ImportVolumeOutput{} req.Data = output return @@ -5628,26 +5008,21 @@ func (c *EC2) ImportVolume(input *ImportVolumeInput) (*ImportVolumeOutput, error return out, err } -var opImportVolume *aws.Operation +const opModifyImageAttribute = "ModifyImageAttribute" // ModifyImageAttributeRequest generates a request for the ModifyImageAttribute operation. -func (c *EC2) ModifyImageAttributeRequest(input *ModifyImageAttributeInput) (req *aws.Request, output *ModifyImageAttributeOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opModifyImageAttribute == nil { - opModifyImageAttribute = &aws.Operation{ - Name: "ModifyImageAttribute", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *EC2) ModifyImageAttributeRequest(input *ModifyImageAttributeInput) (req *request.Request, output *ModifyImageAttributeOutput) { + op := &request.Operation{ + Name: opModifyImageAttribute, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &ModifyImageAttributeInput{} } - req = c.newRequest(opModifyImageAttribute, input, output) + req = c.newRequest(op, input, output) output = &ModifyImageAttributeOutput{} req.Data = output return @@ -5664,26 +5039,21 @@ func (c *EC2) ModifyImageAttribute(input *ModifyImageAttributeInput) (*ModifyIma return out, err } -var opModifyImageAttribute *aws.Operation +const opModifyInstanceAttribute = "ModifyInstanceAttribute" // ModifyInstanceAttributeRequest generates a request for the ModifyInstanceAttribute operation. -func (c *EC2) ModifyInstanceAttributeRequest(input *ModifyInstanceAttributeInput) (req *aws.Request, output *ModifyInstanceAttributeOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opModifyInstanceAttribute == nil { - opModifyInstanceAttribute = &aws.Operation{ - Name: "ModifyInstanceAttribute", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *EC2) ModifyInstanceAttributeRequest(input *ModifyInstanceAttributeInput) (req *request.Request, output *ModifyInstanceAttributeOutput) { + op := &request.Operation{ + Name: opModifyInstanceAttribute, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &ModifyInstanceAttributeInput{} } - req = c.newRequest(opModifyInstanceAttribute, input, output) + req = c.newRequest(op, input, output) output = &ModifyInstanceAttributeOutput{} req.Data = output return @@ -5701,26 +5071,21 @@ func (c *EC2) ModifyInstanceAttribute(input *ModifyInstanceAttributeInput) (*Mod return out, err } -var opModifyInstanceAttribute *aws.Operation +const opModifyNetworkInterfaceAttribute = "ModifyNetworkInterfaceAttribute" // ModifyNetworkInterfaceAttributeRequest generates a request for the ModifyNetworkInterfaceAttribute operation. -func (c *EC2) ModifyNetworkInterfaceAttributeRequest(input *ModifyNetworkInterfaceAttributeInput) (req *aws.Request, output *ModifyNetworkInterfaceAttributeOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opModifyNetworkInterfaceAttribute == nil { - opModifyNetworkInterfaceAttribute = &aws.Operation{ - Name: "ModifyNetworkInterfaceAttribute", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *EC2) ModifyNetworkInterfaceAttributeRequest(input *ModifyNetworkInterfaceAttributeInput) (req *request.Request, output *ModifyNetworkInterfaceAttributeOutput) { + op := &request.Operation{ + Name: opModifyNetworkInterfaceAttribute, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &ModifyNetworkInterfaceAttributeInput{} } - req = c.newRequest(opModifyNetworkInterfaceAttribute, input, output) + req = c.newRequest(op, input, output) output = &ModifyNetworkInterfaceAttributeOutput{} req.Data = output return @@ -5734,26 +5099,21 @@ func (c *EC2) ModifyNetworkInterfaceAttribute(input *ModifyNetworkInterfaceAttri return out, err } -var opModifyNetworkInterfaceAttribute *aws.Operation +const opModifyReservedInstances = "ModifyReservedInstances" // ModifyReservedInstancesRequest generates a request for the ModifyReservedInstances operation. -func (c *EC2) ModifyReservedInstancesRequest(input *ModifyReservedInstancesInput) (req *aws.Request, output *ModifyReservedInstancesOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opModifyReservedInstances == nil { - opModifyReservedInstances = &aws.Operation{ - Name: "ModifyReservedInstances", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *EC2) ModifyReservedInstancesRequest(input *ModifyReservedInstancesInput) (req *request.Request, output *ModifyReservedInstancesOutput) { + op := &request.Operation{ + Name: opModifyReservedInstances, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &ModifyReservedInstancesInput{} } - req = c.newRequest(opModifyReservedInstances, input, output) + req = c.newRequest(op, input, output) output = &ModifyReservedInstancesOutput{} req.Data = output return @@ -5772,26 +5132,21 @@ func (c *EC2) ModifyReservedInstances(input *ModifyReservedInstancesInput) (*Mod return out, err } -var opModifyReservedInstances *aws.Operation +const opModifySnapshotAttribute = "ModifySnapshotAttribute" // ModifySnapshotAttributeRequest generates a request for the ModifySnapshotAttribute operation. -func (c *EC2) ModifySnapshotAttributeRequest(input *ModifySnapshotAttributeInput) (req *aws.Request, output *ModifySnapshotAttributeOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opModifySnapshotAttribute == nil { - opModifySnapshotAttribute = &aws.Operation{ - Name: "ModifySnapshotAttribute", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *EC2) ModifySnapshotAttributeRequest(input *ModifySnapshotAttributeInput) (req *request.Request, output *ModifySnapshotAttributeOutput) { + op := &request.Operation{ + Name: opModifySnapshotAttribute, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &ModifySnapshotAttributeInput{} } - req = c.newRequest(opModifySnapshotAttribute, input, output) + req = c.newRequest(op, input, output) output = &ModifySnapshotAttributeOutput{} req.Data = output return @@ -5814,26 +5169,21 @@ func (c *EC2) ModifySnapshotAttribute(input *ModifySnapshotAttributeInput) (*Mod return out, err } -var opModifySnapshotAttribute *aws.Operation +const opModifySubnetAttribute = "ModifySubnetAttribute" // ModifySubnetAttributeRequest generates a request for the ModifySubnetAttribute operation. -func (c *EC2) ModifySubnetAttributeRequest(input *ModifySubnetAttributeInput) (req *aws.Request, output *ModifySubnetAttributeOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opModifySubnetAttribute == nil { - opModifySubnetAttribute = &aws.Operation{ - Name: "ModifySubnetAttribute", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *EC2) ModifySubnetAttributeRequest(input *ModifySubnetAttributeInput) (req *request.Request, output *ModifySubnetAttributeOutput) { + op := &request.Operation{ + Name: opModifySubnetAttribute, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &ModifySubnetAttributeInput{} } - req = c.newRequest(opModifySubnetAttribute, input, output) + req = c.newRequest(op, input, output) output = &ModifySubnetAttributeOutput{} req.Data = output return @@ -5846,133 +5196,113 @@ func (c *EC2) ModifySubnetAttribute(input *ModifySubnetAttributeInput) (*ModifyS return out, err } -var opModifySubnetAttribute *aws.Operation +const opModifyVolumeAttribute = "ModifyVolumeAttribute" -// ModifyVPCAttributeRequest generates a request for the ModifyVPCAttribute operation. -func (c *EC2) ModifyVPCAttributeRequest(input *ModifyVPCAttributeInput) (req *aws.Request, output *ModifyVPCAttributeOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opModifyVPCAttribute == nil { - opModifyVPCAttribute = &aws.Operation{ - Name: "ModifyVpcAttribute", - HTTPMethod: "POST", - HTTPPath: "/", - } +// ModifyVolumeAttributeRequest generates a request for the ModifyVolumeAttribute operation. +func (c *EC2) ModifyVolumeAttributeRequest(input *ModifyVolumeAttributeInput) (req *request.Request, output *ModifyVolumeAttributeOutput) { + op := &request.Operation{ + Name: opModifyVolumeAttribute, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { - input = &ModifyVPCAttributeInput{} + input = &ModifyVolumeAttributeInput{} } - req = c.newRequest(opModifyVPCAttribute, input, output) - output = &ModifyVPCAttributeOutput{} + req = c.newRequest(op, input, output) + output = &ModifyVolumeAttributeOutput{} req.Data = output return } -// Modifies the specified attribute of the specified VPC. -func (c *EC2) ModifyVPCAttribute(input *ModifyVPCAttributeInput) (*ModifyVPCAttributeOutput, error) { - req, out := c.ModifyVPCAttributeRequest(input) +// Modifies a volume attribute. +// +// By default, all I/O operations for the volume are suspended when the data +// on the volume is determined to be potentially inconsistent, to prevent undetectable, +// latent data corruption. The I/O access to the volume can be resumed by first +// enabling I/O access and then checking the data consistency on your volume. +// +// You can change the default behavior to resume I/O operations. We recommend +// that you change this only for boot volumes or for volumes that are stateless +// or disposable. +func (c *EC2) ModifyVolumeAttribute(input *ModifyVolumeAttributeInput) (*ModifyVolumeAttributeOutput, error) { + req, out := c.ModifyVolumeAttributeRequest(input) err := req.Send() return out, err } -var opModifyVPCAttribute *aws.Operation - -// ModifyVPCEndpointRequest generates a request for the ModifyVPCEndpoint operation. -func (c *EC2) ModifyVPCEndpointRequest(input *ModifyVPCEndpointInput) (req *aws.Request, output *ModifyVPCEndpointOutput) { - oprw.Lock() - defer oprw.Unlock() +const opModifyVpcAttribute = "ModifyVpcAttribute" - if opModifyVPCEndpoint == nil { - opModifyVPCEndpoint = &aws.Operation{ - Name: "ModifyVpcEndpoint", - HTTPMethod: "POST", - HTTPPath: "/", - } +// ModifyVpcAttributeRequest generates a request for the ModifyVpcAttribute operation. +func (c *EC2) ModifyVpcAttributeRequest(input *ModifyVpcAttributeInput) (req *request.Request, output *ModifyVpcAttributeOutput) { + op := &request.Operation{ + Name: opModifyVpcAttribute, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { - input = &ModifyVPCEndpointInput{} + input = &ModifyVpcAttributeInput{} } - req = c.newRequest(opModifyVPCEndpoint, input, output) - output = &ModifyVPCEndpointOutput{} + req = c.newRequest(op, input, output) + output = &ModifyVpcAttributeOutput{} req.Data = output return } -// Modifies attributes of a specified VPC endpoint. You can modify the policy -// associated with the endpoint, and you can add and remove route tables associated -// with the endpoint. -func (c *EC2) ModifyVPCEndpoint(input *ModifyVPCEndpointInput) (*ModifyVPCEndpointOutput, error) { - req, out := c.ModifyVPCEndpointRequest(input) +// Modifies the specified attribute of the specified VPC. +func (c *EC2) ModifyVpcAttribute(input *ModifyVpcAttributeInput) (*ModifyVpcAttributeOutput, error) { + req, out := c.ModifyVpcAttributeRequest(input) err := req.Send() return out, err } -var opModifyVPCEndpoint *aws.Operation +const opModifyVpcEndpoint = "ModifyVpcEndpoint" -// ModifyVolumeAttributeRequest generates a request for the ModifyVolumeAttribute operation. -func (c *EC2) ModifyVolumeAttributeRequest(input *ModifyVolumeAttributeInput) (req *aws.Request, output *ModifyVolumeAttributeOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opModifyVolumeAttribute == nil { - opModifyVolumeAttribute = &aws.Operation{ - Name: "ModifyVolumeAttribute", - HTTPMethod: "POST", - HTTPPath: "/", - } +// ModifyVpcEndpointRequest generates a request for the ModifyVpcEndpoint operation. +func (c *EC2) ModifyVpcEndpointRequest(input *ModifyVpcEndpointInput) (req *request.Request, output *ModifyVpcEndpointOutput) { + op := &request.Operation{ + Name: opModifyVpcEndpoint, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { - input = &ModifyVolumeAttributeInput{} + input = &ModifyVpcEndpointInput{} } - req = c.newRequest(opModifyVolumeAttribute, input, output) - output = &ModifyVolumeAttributeOutput{} + req = c.newRequest(op, input, output) + output = &ModifyVpcEndpointOutput{} req.Data = output return } -// Modifies a volume attribute. -// -// By default, all I/O operations for the volume are suspended when the data -// on the volume is determined to be potentially inconsistent, to prevent undetectable, -// latent data corruption. The I/O access to the volume can be resumed by first -// enabling I/O access and then checking the data consistency on your volume. -// -// You can change the default behavior to resume I/O operations. We recommend -// that you change this only for boot volumes or for volumes that are stateless -// or disposable. -func (c *EC2) ModifyVolumeAttribute(input *ModifyVolumeAttributeInput) (*ModifyVolumeAttributeOutput, error) { - req, out := c.ModifyVolumeAttributeRequest(input) +// Modifies attributes of a specified VPC endpoint. You can modify the policy +// associated with the endpoint, and you can add and remove route tables associated +// with the endpoint. +func (c *EC2) ModifyVpcEndpoint(input *ModifyVpcEndpointInput) (*ModifyVpcEndpointOutput, error) { + req, out := c.ModifyVpcEndpointRequest(input) err := req.Send() return out, err } -var opModifyVolumeAttribute *aws.Operation +const opMonitorInstances = "MonitorInstances" // MonitorInstancesRequest generates a request for the MonitorInstances operation. -func (c *EC2) MonitorInstancesRequest(input *MonitorInstancesInput) (req *aws.Request, output *MonitorInstancesOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opMonitorInstances == nil { - opMonitorInstances = &aws.Operation{ - Name: "MonitorInstances", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *EC2) MonitorInstancesRequest(input *MonitorInstancesInput) (req *request.Request, output *MonitorInstancesOutput) { + op := &request.Operation{ + Name: opMonitorInstances, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &MonitorInstancesInput{} } - req = c.newRequest(opMonitorInstances, input, output) + req = c.newRequest(op, input, output) output = &MonitorInstancesOutput{} req.Data = output return @@ -5987,27 +5317,22 @@ func (c *EC2) MonitorInstances(input *MonitorInstancesInput) (*MonitorInstancesO return out, err } -var opMonitorInstances *aws.Operation +const opMoveAddressToVpc = "MoveAddressToVpc" -// MoveAddressToVPCRequest generates a request for the MoveAddressToVPC operation. -func (c *EC2) MoveAddressToVPCRequest(input *MoveAddressToVPCInput) (req *aws.Request, output *MoveAddressToVPCOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opMoveAddressToVPC == nil { - opMoveAddressToVPC = &aws.Operation{ - Name: "MoveAddressToVpc", - HTTPMethod: "POST", - HTTPPath: "/", - } +// MoveAddressToVpcRequest generates a request for the MoveAddressToVpc operation. +func (c *EC2) MoveAddressToVpcRequest(input *MoveAddressToVpcInput) (req *request.Request, output *MoveAddressToVpcOutput) { + op := &request.Operation{ + Name: opMoveAddressToVpc, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { - input = &MoveAddressToVPCInput{} + input = &MoveAddressToVpcInput{} } - req = c.newRequest(opMoveAddressToVPC, input, output) - output = &MoveAddressToVPCOutput{} + req = c.newRequest(op, input, output) + output = &MoveAddressToVpcOutput{} req.Data = output return } @@ -6019,32 +5344,27 @@ func (c *EC2) MoveAddressToVPCRequest(input *MoveAddressToVPCInput) (req *aws.Re // you move it back using the RestoreAddressToClassic request. You cannot move // an Elastic IP address that's allocated for use in the EC2-VPC platform to // the EC2-Classic platform. -func (c *EC2) MoveAddressToVPC(input *MoveAddressToVPCInput) (*MoveAddressToVPCOutput, error) { - req, out := c.MoveAddressToVPCRequest(input) +func (c *EC2) MoveAddressToVpc(input *MoveAddressToVpcInput) (*MoveAddressToVpcOutput, error) { + req, out := c.MoveAddressToVpcRequest(input) err := req.Send() return out, err } -var opMoveAddressToVPC *aws.Operation +const opPurchaseReservedInstancesOffering = "PurchaseReservedInstancesOffering" // PurchaseReservedInstancesOfferingRequest generates a request for the PurchaseReservedInstancesOffering operation. -func (c *EC2) PurchaseReservedInstancesOfferingRequest(input *PurchaseReservedInstancesOfferingInput) (req *aws.Request, output *PurchaseReservedInstancesOfferingOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opPurchaseReservedInstancesOffering == nil { - opPurchaseReservedInstancesOffering = &aws.Operation{ - Name: "PurchaseReservedInstancesOffering", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *EC2) PurchaseReservedInstancesOfferingRequest(input *PurchaseReservedInstancesOfferingInput) (req *request.Request, output *PurchaseReservedInstancesOfferingOutput) { + op := &request.Operation{ + Name: opPurchaseReservedInstancesOffering, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &PurchaseReservedInstancesOfferingInput{} } - req = c.newRequest(opPurchaseReservedInstancesOffering, input, output) + req = c.newRequest(op, input, output) output = &PurchaseReservedInstancesOfferingOutput{} req.Data = output return @@ -6052,9 +5372,8 @@ func (c *EC2) PurchaseReservedInstancesOfferingRequest(input *PurchaseReservedIn // Purchases a Reserved Instance for use with your account. With Amazon EC2 // Reserved Instances, you obtain a capacity reservation for a certain instance -// configuration over a specified period of time. You pay a lower usage rate -// than with On-Demand instances for the time that you actually use the capacity -// reservation. +// configuration over a specified period of time and pay a lower hourly rate +// compared to on-Demand Instance pricing. // // Use DescribeReservedInstancesOfferings to get a list of Reserved Instance // offerings that match your specifications. After you've purchased a Reserved @@ -6069,26 +5388,21 @@ func (c *EC2) PurchaseReservedInstancesOffering(input *PurchaseReservedInstances return out, err } -var opPurchaseReservedInstancesOffering *aws.Operation +const opRebootInstances = "RebootInstances" // RebootInstancesRequest generates a request for the RebootInstances operation. -func (c *EC2) RebootInstancesRequest(input *RebootInstancesInput) (req *aws.Request, output *RebootInstancesOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opRebootInstances == nil { - opRebootInstances = &aws.Operation{ - Name: "RebootInstances", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *EC2) RebootInstancesRequest(input *RebootInstancesInput) (req *request.Request, output *RebootInstancesOutput) { + op := &request.Operation{ + Name: opRebootInstances, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &RebootInstancesInput{} } - req = c.newRequest(opRebootInstances, input, output) + req = c.newRequest(op, input, output) output = &RebootInstancesOutput{} req.Data = output return @@ -6111,26 +5425,21 @@ func (c *EC2) RebootInstances(input *RebootInstancesInput) (*RebootInstancesOutp return out, err } -var opRebootInstances *aws.Operation +const opRegisterImage = "RegisterImage" // RegisterImageRequest generates a request for the RegisterImage operation. -func (c *EC2) RegisterImageRequest(input *RegisterImageInput) (req *aws.Request, output *RegisterImageOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opRegisterImage == nil { - opRegisterImage = &aws.Operation{ - Name: "RegisterImage", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *EC2) RegisterImageRequest(input *RegisterImageInput) (req *request.Request, output *RegisterImageOutput) { + op := &request.Operation{ + Name: opRegisterImage, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &RegisterImageInput{} } - req = c.newRequest(opRegisterImage, input, output) + req = c.newRequest(op, input, output) output = &RegisterImageOutput{} req.Data = output return @@ -6144,12 +5453,25 @@ func (c *EC2) RegisterImageRequest(input *RegisterImageInput) (req *aws.Request, // For Amazon EBS-backed instances, CreateImage creates and registers the AMI // in a single request, so you don't have to register the AMI yourself. // -// You can also use RegisterImage to create an Amazon EBS-backed AMI from a -// snapshot of a root device volume. For more information, see Launching an -// Instance from a Snapshot (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_LaunchingInstanceFromSnapshot.html) +// You can also use RegisterImage to create an Amazon EBS-backed Linux AMI +// from a snapshot of a root device volume. For more information, see Launching +// an Instance from a Snapshot (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_LaunchingInstanceFromSnapshot.html) // in the Amazon Elastic Compute Cloud User Guide. // -// If needed, you can deregister an AMI at any time. Any modifications you +// Some Linux distributions, such as Red Hat Enterprise Linux (RHEL) and SUSE +// Linux Enterprise Server (SLES), use the EC2 billingProduct code associated +// with an AMI to verify subscription status for package updates. Creating an +// AMI from an EBS snapshot does not maintain this billing code, and subsequent +// instances launched from such an AMI will not be able to connect to package +// update infrastructure. +// +// Similarly, although you can create a Windows AMI from a snapshot, you can't +// successfully launch an instance from the AMI. +// +// To create Windows AMIs or to create AMIs for Linux operating systems that +// must retain AMI billing codes to work properly, see CreateImage. +// +// If needed, you can deregister an AMI at any time. Any modifications you // make to an AMI backed by an instance store volume invalidates its registration. // If you make changes to an image, deregister the previous image and register // the new image. @@ -6162,27 +5484,22 @@ func (c *EC2) RegisterImage(input *RegisterImageInput) (*RegisterImageOutput, er return out, err } -var opRegisterImage *aws.Operation - -// RejectVPCPeeringConnectionRequest generates a request for the RejectVPCPeeringConnection operation. -func (c *EC2) RejectVPCPeeringConnectionRequest(input *RejectVPCPeeringConnectionInput) (req *aws.Request, output *RejectVPCPeeringConnectionOutput) { - oprw.Lock() - defer oprw.Unlock() +const opRejectVpcPeeringConnection = "RejectVpcPeeringConnection" - if opRejectVPCPeeringConnection == nil { - opRejectVPCPeeringConnection = &aws.Operation{ - Name: "RejectVpcPeeringConnection", - HTTPMethod: "POST", - HTTPPath: "/", - } +// RejectVpcPeeringConnectionRequest generates a request for the RejectVpcPeeringConnection operation. +func (c *EC2) RejectVpcPeeringConnectionRequest(input *RejectVpcPeeringConnectionInput) (req *request.Request, output *RejectVpcPeeringConnectionOutput) { + op := &request.Operation{ + Name: opRejectVpcPeeringConnection, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { - input = &RejectVPCPeeringConnectionInput{} + input = &RejectVpcPeeringConnectionInput{} } - req = c.newRequest(opRejectVPCPeeringConnection, input, output) - output = &RejectVPCPeeringConnectionOutput{} + req = c.newRequest(op, input, output) + output = &RejectVpcPeeringConnectionOutput{} req.Data = output return } @@ -6192,32 +5509,27 @@ func (c *EC2) RejectVPCPeeringConnectionRequest(input *RejectVPCPeeringConnectio // request to view your outstanding VPC peering connection requests. To delete // an active VPC peering connection, or to delete a VPC peering connection request // that you initiated, use DeleteVpcPeeringConnection. -func (c *EC2) RejectVPCPeeringConnection(input *RejectVPCPeeringConnectionInput) (*RejectVPCPeeringConnectionOutput, error) { - req, out := c.RejectVPCPeeringConnectionRequest(input) +func (c *EC2) RejectVpcPeeringConnection(input *RejectVpcPeeringConnectionInput) (*RejectVpcPeeringConnectionOutput, error) { + req, out := c.RejectVpcPeeringConnectionRequest(input) err := req.Send() return out, err } -var opRejectVPCPeeringConnection *aws.Operation +const opReleaseAddress = "ReleaseAddress" // ReleaseAddressRequest generates a request for the ReleaseAddress operation. -func (c *EC2) ReleaseAddressRequest(input *ReleaseAddressInput) (req *aws.Request, output *ReleaseAddressOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opReleaseAddress == nil { - opReleaseAddress = &aws.Operation{ - Name: "ReleaseAddress", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *EC2) ReleaseAddressRequest(input *ReleaseAddressInput) (req *request.Request, output *ReleaseAddressOutput) { + op := &request.Operation{ + Name: opReleaseAddress, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &ReleaseAddressInput{} } - req = c.newRequest(opReleaseAddress, input, output) + req = c.newRequest(op, input, output) output = &ReleaseAddressOutput{} req.Data = output return @@ -6244,27 +5556,22 @@ func (c *EC2) ReleaseAddress(input *ReleaseAddressInput) (*ReleaseAddressOutput, return out, err } -var opReleaseAddress *aws.Operation - -// ReplaceNetworkACLAssociationRequest generates a request for the ReplaceNetworkACLAssociation operation. -func (c *EC2) ReplaceNetworkACLAssociationRequest(input *ReplaceNetworkACLAssociationInput) (req *aws.Request, output *ReplaceNetworkACLAssociationOutput) { - oprw.Lock() - defer oprw.Unlock() +const opReplaceNetworkAclAssociation = "ReplaceNetworkAclAssociation" - if opReplaceNetworkACLAssociation == nil { - opReplaceNetworkACLAssociation = &aws.Operation{ - Name: "ReplaceNetworkAclAssociation", - HTTPMethod: "POST", - HTTPPath: "/", - } +// ReplaceNetworkAclAssociationRequest generates a request for the ReplaceNetworkAclAssociation operation. +func (c *EC2) ReplaceNetworkAclAssociationRequest(input *ReplaceNetworkAclAssociationInput) (req *request.Request, output *ReplaceNetworkAclAssociationOutput) { + op := &request.Operation{ + Name: opReplaceNetworkAclAssociation, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { - input = &ReplaceNetworkACLAssociationInput{} + input = &ReplaceNetworkAclAssociationInput{} } - req = c.newRequest(opReplaceNetworkACLAssociation, input, output) - output = &ReplaceNetworkACLAssociationOutput{} + req = c.newRequest(op, input, output) + output = &ReplaceNetworkAclAssociationOutput{} req.Data = output return } @@ -6273,33 +5580,28 @@ func (c *EC2) ReplaceNetworkACLAssociationRequest(input *ReplaceNetworkACLAssoci // create a subnet, it's automatically associated with the default network ACL. // For more information about network ACLs, see Network ACLs (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_ACLs.html) // in the Amazon Virtual Private Cloud User Guide. -func (c *EC2) ReplaceNetworkACLAssociation(input *ReplaceNetworkACLAssociationInput) (*ReplaceNetworkACLAssociationOutput, error) { - req, out := c.ReplaceNetworkACLAssociationRequest(input) +func (c *EC2) ReplaceNetworkAclAssociation(input *ReplaceNetworkAclAssociationInput) (*ReplaceNetworkAclAssociationOutput, error) { + req, out := c.ReplaceNetworkAclAssociationRequest(input) err := req.Send() return out, err } -var opReplaceNetworkACLAssociation *aws.Operation +const opReplaceNetworkAclEntry = "ReplaceNetworkAclEntry" -// ReplaceNetworkACLEntryRequest generates a request for the ReplaceNetworkACLEntry operation. -func (c *EC2) ReplaceNetworkACLEntryRequest(input *ReplaceNetworkACLEntryInput) (req *aws.Request, output *ReplaceNetworkACLEntryOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opReplaceNetworkACLEntry == nil { - opReplaceNetworkACLEntry = &aws.Operation{ - Name: "ReplaceNetworkAclEntry", - HTTPMethod: "POST", - HTTPPath: "/", - } +// ReplaceNetworkAclEntryRequest generates a request for the ReplaceNetworkAclEntry operation. +func (c *EC2) ReplaceNetworkAclEntryRequest(input *ReplaceNetworkAclEntryInput) (req *request.Request, output *ReplaceNetworkAclEntryOutput) { + op := &request.Operation{ + Name: opReplaceNetworkAclEntry, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { - input = &ReplaceNetworkACLEntryInput{} + input = &ReplaceNetworkAclEntryInput{} } - req = c.newRequest(opReplaceNetworkACLEntry, input, output) - output = &ReplaceNetworkACLEntryOutput{} + req = c.newRequest(op, input, output) + output = &ReplaceNetworkAclEntryOutput{} req.Data = output return } @@ -6307,32 +5609,27 @@ func (c *EC2) ReplaceNetworkACLEntryRequest(input *ReplaceNetworkACLEntryInput) // Replaces an entry (rule) in a network ACL. For more information about network // ACLs, see Network ACLs (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_ACLs.html) // in the Amazon Virtual Private Cloud User Guide. -func (c *EC2) ReplaceNetworkACLEntry(input *ReplaceNetworkACLEntryInput) (*ReplaceNetworkACLEntryOutput, error) { - req, out := c.ReplaceNetworkACLEntryRequest(input) +func (c *EC2) ReplaceNetworkAclEntry(input *ReplaceNetworkAclEntryInput) (*ReplaceNetworkAclEntryOutput, error) { + req, out := c.ReplaceNetworkAclEntryRequest(input) err := req.Send() return out, err } -var opReplaceNetworkACLEntry *aws.Operation +const opReplaceRoute = "ReplaceRoute" // ReplaceRouteRequest generates a request for the ReplaceRoute operation. -func (c *EC2) ReplaceRouteRequest(input *ReplaceRouteInput) (req *aws.Request, output *ReplaceRouteOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opReplaceRoute == nil { - opReplaceRoute = &aws.Operation{ - Name: "ReplaceRoute", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *EC2) ReplaceRouteRequest(input *ReplaceRouteInput) (req *request.Request, output *ReplaceRouteOutput) { + op := &request.Operation{ + Name: opReplaceRoute, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &ReplaceRouteInput{} } - req = c.newRequest(opReplaceRoute, input, output) + req = c.newRequest(op, input, output) output = &ReplaceRouteOutput{} req.Data = output return @@ -6350,26 +5647,21 @@ func (c *EC2) ReplaceRoute(input *ReplaceRouteInput) (*ReplaceRouteOutput, error return out, err } -var opReplaceRoute *aws.Operation +const opReplaceRouteTableAssociation = "ReplaceRouteTableAssociation" // ReplaceRouteTableAssociationRequest generates a request for the ReplaceRouteTableAssociation operation. -func (c *EC2) ReplaceRouteTableAssociationRequest(input *ReplaceRouteTableAssociationInput) (req *aws.Request, output *ReplaceRouteTableAssociationOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opReplaceRouteTableAssociation == nil { - opReplaceRouteTableAssociation = &aws.Operation{ - Name: "ReplaceRouteTableAssociation", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *EC2) ReplaceRouteTableAssociationRequest(input *ReplaceRouteTableAssociationInput) (req *request.Request, output *ReplaceRouteTableAssociationOutput) { + op := &request.Operation{ + Name: opReplaceRouteTableAssociation, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &ReplaceRouteTableAssociationInput{} } - req = c.newRequest(opReplaceRouteTableAssociation, input, output) + req = c.newRequest(op, input, output) output = &ReplaceRouteTableAssociationOutput{} req.Data = output return @@ -6390,26 +5682,21 @@ func (c *EC2) ReplaceRouteTableAssociation(input *ReplaceRouteTableAssociationIn return out, err } -var opReplaceRouteTableAssociation *aws.Operation +const opReportInstanceStatus = "ReportInstanceStatus" // ReportInstanceStatusRequest generates a request for the ReportInstanceStatus operation. -func (c *EC2) ReportInstanceStatusRequest(input *ReportInstanceStatusInput) (req *aws.Request, output *ReportInstanceStatusOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opReportInstanceStatus == nil { - opReportInstanceStatus = &aws.Operation{ - Name: "ReportInstanceStatus", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *EC2) ReportInstanceStatusRequest(input *ReportInstanceStatusInput) (req *request.Request, output *ReportInstanceStatusOutput) { + op := &request.Operation{ + Name: opReportInstanceStatus, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &ReportInstanceStatusInput{} } - req = c.newRequest(opReportInstanceStatus, input, output) + req = c.newRequest(op, input, output) output = &ReportInstanceStatusOutput{} req.Data = output return @@ -6428,26 +5715,21 @@ func (c *EC2) ReportInstanceStatus(input *ReportInstanceStatusInput) (*ReportIns return out, err } -var opReportInstanceStatus *aws.Operation +const opRequestSpotFleet = "RequestSpotFleet" // RequestSpotFleetRequest generates a request for the RequestSpotFleet operation. -func (c *EC2) RequestSpotFleetRequest(input *RequestSpotFleetInput) (req *aws.Request, output *RequestSpotFleetOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opRequestSpotFleet == nil { - opRequestSpotFleet = &aws.Operation{ - Name: "RequestSpotFleet", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *EC2) RequestSpotFleetRequest(input *RequestSpotFleetInput) (req *request.Request, output *RequestSpotFleetOutput) { + op := &request.Operation{ + Name: opRequestSpotFleet, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &RequestSpotFleetInput{} } - req = c.newRequest(opRequestSpotFleet, input, output) + req = c.newRequest(op, input, output) output = &RequestSpotFleetOutput{} req.Data = output return @@ -6455,7 +5737,20 @@ func (c *EC2) RequestSpotFleetRequest(input *RequestSpotFleetInput) (req *aws.Re // Creates a Spot fleet request. // -// For more information, see Spot Fleets (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-fleet.html) +// You can submit a single request that includes multiple launch specifications +// that vary by instance type, AMI, Availability Zone, or subnet. +// +// By default, the Spot fleet requests Spot instances in the Spot pool where +// the price per unit is the lowest. Each launch specification can include its +// own instance weighting that reflects the value of the instance type to your +// application workload. +// +// Alternatively, you can specify that the Spot fleet distribute the target +// capacity across the Spot pools included in its launch specifications. By +// ensuring that the Spot instances in your Spot fleet are in different Spot +// pools, you can improve the availability of your fleet. +// +// For more information, see Spot Fleet Requests (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-fleet-requests.html) // in the Amazon Elastic Compute Cloud User Guide. func (c *EC2) RequestSpotFleet(input *RequestSpotFleetInput) (*RequestSpotFleetOutput, error) { req, out := c.RequestSpotFleetRequest(input) @@ -6463,35 +5758,30 @@ func (c *EC2) RequestSpotFleet(input *RequestSpotFleetInput) (*RequestSpotFleetO return out, err } -var opRequestSpotFleet *aws.Operation +const opRequestSpotInstances = "RequestSpotInstances" // RequestSpotInstancesRequest generates a request for the RequestSpotInstances operation. -func (c *EC2) RequestSpotInstancesRequest(input *RequestSpotInstancesInput) (req *aws.Request, output *RequestSpotInstancesOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opRequestSpotInstances == nil { - opRequestSpotInstances = &aws.Operation{ - Name: "RequestSpotInstances", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *EC2) RequestSpotInstancesRequest(input *RequestSpotInstancesInput) (req *request.Request, output *RequestSpotInstancesOutput) { + op := &request.Operation{ + Name: opRequestSpotInstances, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &RequestSpotInstancesInput{} } - req = c.newRequest(opRequestSpotInstances, input, output) + req = c.newRequest(op, input, output) output = &RequestSpotInstancesOutput{} req.Data = output return } -// Creates a Spot Instance request. Spot Instances are instances that Amazon +// Creates a Spot instance request. Spot instances are instances that Amazon // EC2 launches when the bid price that you specify exceeds the current Spot -// Price. Amazon EC2 periodically sets the Spot Price based on available Spot -// Instance capacity and current Spot Instance requests. For more information, +// price. Amazon EC2 periodically sets the Spot price based on available Spot +// Instance capacity and current Spot instance requests. For more information, // see Spot Instance Requests (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-requests.html) // in the Amazon Elastic Compute Cloud User Guide. func (c *EC2) RequestSpotInstances(input *RequestSpotInstancesInput) (*RequestSpotInstancesOutput, error) { @@ -6500,26 +5790,21 @@ func (c *EC2) RequestSpotInstances(input *RequestSpotInstancesInput) (*RequestSp return out, err } -var opRequestSpotInstances *aws.Operation +const opResetImageAttribute = "ResetImageAttribute" // ResetImageAttributeRequest generates a request for the ResetImageAttribute operation. -func (c *EC2) ResetImageAttributeRequest(input *ResetImageAttributeInput) (req *aws.Request, output *ResetImageAttributeOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opResetImageAttribute == nil { - opResetImageAttribute = &aws.Operation{ - Name: "ResetImageAttribute", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *EC2) ResetImageAttributeRequest(input *ResetImageAttributeInput) (req *request.Request, output *ResetImageAttributeOutput) { + op := &request.Operation{ + Name: opResetImageAttribute, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &ResetImageAttributeInput{} } - req = c.newRequest(opResetImageAttribute, input, output) + req = c.newRequest(op, input, output) output = &ResetImageAttributeOutput{} req.Data = output return @@ -6534,26 +5819,21 @@ func (c *EC2) ResetImageAttribute(input *ResetImageAttributeInput) (*ResetImageA return out, err } -var opResetImageAttribute *aws.Operation +const opResetInstanceAttribute = "ResetInstanceAttribute" // ResetInstanceAttributeRequest generates a request for the ResetInstanceAttribute operation. -func (c *EC2) ResetInstanceAttributeRequest(input *ResetInstanceAttributeInput) (req *aws.Request, output *ResetInstanceAttributeOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opResetInstanceAttribute == nil { - opResetInstanceAttribute = &aws.Operation{ - Name: "ResetInstanceAttribute", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *EC2) ResetInstanceAttributeRequest(input *ResetInstanceAttributeInput) (req *request.Request, output *ResetInstanceAttributeOutput) { + op := &request.Operation{ + Name: opResetInstanceAttribute, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &ResetInstanceAttributeInput{} } - req = c.newRequest(opResetInstanceAttribute, input, output) + req = c.newRequest(op, input, output) output = &ResetInstanceAttributeOutput{} req.Data = output return @@ -6574,26 +5854,21 @@ func (c *EC2) ResetInstanceAttribute(input *ResetInstanceAttributeInput) (*Reset return out, err } -var opResetInstanceAttribute *aws.Operation +const opResetNetworkInterfaceAttribute = "ResetNetworkInterfaceAttribute" // ResetNetworkInterfaceAttributeRequest generates a request for the ResetNetworkInterfaceAttribute operation. -func (c *EC2) ResetNetworkInterfaceAttributeRequest(input *ResetNetworkInterfaceAttributeInput) (req *aws.Request, output *ResetNetworkInterfaceAttributeOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opResetNetworkInterfaceAttribute == nil { - opResetNetworkInterfaceAttribute = &aws.Operation{ - Name: "ResetNetworkInterfaceAttribute", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *EC2) ResetNetworkInterfaceAttributeRequest(input *ResetNetworkInterfaceAttributeInput) (req *request.Request, output *ResetNetworkInterfaceAttributeOutput) { + op := &request.Operation{ + Name: opResetNetworkInterfaceAttribute, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &ResetNetworkInterfaceAttributeInput{} } - req = c.newRequest(opResetNetworkInterfaceAttribute, input, output) + req = c.newRequest(op, input, output) output = &ResetNetworkInterfaceAttributeOutput{} req.Data = output return @@ -6607,26 +5882,21 @@ func (c *EC2) ResetNetworkInterfaceAttribute(input *ResetNetworkInterfaceAttribu return out, err } -var opResetNetworkInterfaceAttribute *aws.Operation +const opResetSnapshotAttribute = "ResetSnapshotAttribute" // ResetSnapshotAttributeRequest generates a request for the ResetSnapshotAttribute operation. -func (c *EC2) ResetSnapshotAttributeRequest(input *ResetSnapshotAttributeInput) (req *aws.Request, output *ResetSnapshotAttributeOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opResetSnapshotAttribute == nil { - opResetSnapshotAttribute = &aws.Operation{ - Name: "ResetSnapshotAttribute", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *EC2) ResetSnapshotAttributeRequest(input *ResetSnapshotAttributeInput) (req *request.Request, output *ResetSnapshotAttributeOutput) { + op := &request.Operation{ + Name: opResetSnapshotAttribute, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &ResetSnapshotAttributeInput{} } - req = c.newRequest(opResetSnapshotAttribute, input, output) + req = c.newRequest(op, input, output) output = &ResetSnapshotAttributeOutput{} req.Data = output return @@ -6643,26 +5913,21 @@ func (c *EC2) ResetSnapshotAttribute(input *ResetSnapshotAttributeInput) (*Reset return out, err } -var opResetSnapshotAttribute *aws.Operation +const opRestoreAddressToClassic = "RestoreAddressToClassic" // RestoreAddressToClassicRequest generates a request for the RestoreAddressToClassic operation. -func (c *EC2) RestoreAddressToClassicRequest(input *RestoreAddressToClassicInput) (req *aws.Request, output *RestoreAddressToClassicOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opRestoreAddressToClassic == nil { - opRestoreAddressToClassic = &aws.Operation{ - Name: "RestoreAddressToClassic", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *EC2) RestoreAddressToClassicRequest(input *RestoreAddressToClassicInput) (req *request.Request, output *RestoreAddressToClassicOutput) { + op := &request.Operation{ + Name: opRestoreAddressToClassic, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &RestoreAddressToClassicInput{} } - req = c.newRequest(opRestoreAddressToClassic, input, output) + req = c.newRequest(op, input, output) output = &RestoreAddressToClassicOutput{} req.Data = output return @@ -6678,26 +5943,21 @@ func (c *EC2) RestoreAddressToClassic(input *RestoreAddressToClassicInput) (*Res return out, err } -var opRestoreAddressToClassic *aws.Operation +const opRevokeSecurityGroupEgress = "RevokeSecurityGroupEgress" // RevokeSecurityGroupEgressRequest generates a request for the RevokeSecurityGroupEgress operation. -func (c *EC2) RevokeSecurityGroupEgressRequest(input *RevokeSecurityGroupEgressInput) (req *aws.Request, output *RevokeSecurityGroupEgressOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opRevokeSecurityGroupEgress == nil { - opRevokeSecurityGroupEgress = &aws.Operation{ - Name: "RevokeSecurityGroupEgress", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *EC2) RevokeSecurityGroupEgressRequest(input *RevokeSecurityGroupEgressInput) (req *request.Request, output *RevokeSecurityGroupEgressOutput) { + op := &request.Operation{ + Name: opRevokeSecurityGroupEgress, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &RevokeSecurityGroupEgressInput{} } - req = c.newRequest(opRevokeSecurityGroupEgress, input, output) + req = c.newRequest(op, input, output) output = &RevokeSecurityGroupEgressOutput{} req.Data = output return @@ -6720,26 +5980,21 @@ func (c *EC2) RevokeSecurityGroupEgress(input *RevokeSecurityGroupEgressInput) ( return out, err } -var opRevokeSecurityGroupEgress *aws.Operation +const opRevokeSecurityGroupIngress = "RevokeSecurityGroupIngress" // RevokeSecurityGroupIngressRequest generates a request for the RevokeSecurityGroupIngress operation. -func (c *EC2) RevokeSecurityGroupIngressRequest(input *RevokeSecurityGroupIngressInput) (req *aws.Request, output *RevokeSecurityGroupIngressOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opRevokeSecurityGroupIngress == nil { - opRevokeSecurityGroupIngress = &aws.Operation{ - Name: "RevokeSecurityGroupIngress", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *EC2) RevokeSecurityGroupIngressRequest(input *RevokeSecurityGroupIngressInput) (req *request.Request, output *RevokeSecurityGroupIngressOutput) { + op := &request.Operation{ + Name: opRevokeSecurityGroupIngress, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &RevokeSecurityGroupIngressInput{} } - req = c.newRequest(opRevokeSecurityGroupIngress, input, output) + req = c.newRequest(op, input, output) output = &RevokeSecurityGroupIngressOutput{} req.Data = output return @@ -6762,26 +6017,21 @@ func (c *EC2) RevokeSecurityGroupIngress(input *RevokeSecurityGroupIngressInput) return out, err } -var opRevokeSecurityGroupIngress *aws.Operation +const opRunInstances = "RunInstances" // RunInstancesRequest generates a request for the RunInstances operation. -func (c *EC2) RunInstancesRequest(input *RunInstancesInput) (req *aws.Request, output *Reservation) { - oprw.Lock() - defer oprw.Unlock() - - if opRunInstances == nil { - opRunInstances = &aws.Operation{ - Name: "RunInstances", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *EC2) RunInstancesRequest(input *RunInstancesInput) (req *request.Request, output *Reservation) { + op := &request.Operation{ + Name: opRunInstances, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &RunInstancesInput{} } - req = c.newRequest(opRunInstances, input, output) + req = c.newRequest(op, input, output) output = &Reservation{} req.Data = output return @@ -6799,6 +6049,12 @@ func (c *EC2) RunInstancesRequest(input *RunInstancesInput) (req *aws.Request, o // (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-network-security.html) // in the Amazon Elastic Compute Cloud User Guide. // +// [EC2-VPC only accounts] If you don't specify a subnet in the request, we +// choose a default subnet from your default VPC for you. +// +// [EC2-Classic accounts] If you're launching into EC2-Classic and you don't +// specify an Availability Zone, we choose one for you. +// // Linux instances have access to the public key of the key pair at boot. You // can use this key to provide secure access to the instance. Amazon EC2 public // images use this feature to provide secure access without passwords. For more @@ -6826,26 +6082,21 @@ func (c *EC2) RunInstances(input *RunInstancesInput) (*Reservation, error) { return out, err } -var opRunInstances *aws.Operation +const opStartInstances = "StartInstances" // StartInstancesRequest generates a request for the StartInstances operation. -func (c *EC2) StartInstancesRequest(input *StartInstancesInput) (req *aws.Request, output *StartInstancesOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opStartInstances == nil { - opStartInstances = &aws.Operation{ - Name: "StartInstances", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *EC2) StartInstancesRequest(input *StartInstancesInput) (req *request.Request, output *StartInstancesOutput) { + op := &request.Operation{ + Name: opStartInstances, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &StartInstancesInput{} } - req = c.newRequest(opStartInstances, input, output) + req = c.newRequest(op, input, output) output = &StartInstancesOutput{} req.Data = output return @@ -6876,26 +6127,21 @@ func (c *EC2) StartInstances(input *StartInstancesInput) (*StartInstancesOutput, return out, err } -var opStartInstances *aws.Operation +const opStopInstances = "StopInstances" // StopInstancesRequest generates a request for the StopInstances operation. -func (c *EC2) StopInstancesRequest(input *StopInstancesInput) (req *aws.Request, output *StopInstancesOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opStopInstances == nil { - opStopInstances = &aws.Operation{ - Name: "StopInstances", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *EC2) StopInstancesRequest(input *StopInstancesInput) (req *request.Request, output *StopInstancesOutput) { + op := &request.Operation{ + Name: opStopInstances, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &StopInstancesInput{} } - req = c.newRequest(opStopInstances, input, output) + req = c.newRequest(op, input, output) output = &StopInstancesOutput{} req.Data = output return @@ -6938,26 +6184,21 @@ func (c *EC2) StopInstances(input *StopInstancesInput) (*StopInstancesOutput, er return out, err } -var opStopInstances *aws.Operation +const opTerminateInstances = "TerminateInstances" // TerminateInstancesRequest generates a request for the TerminateInstances operation. -func (c *EC2) TerminateInstancesRequest(input *TerminateInstancesInput) (req *aws.Request, output *TerminateInstancesOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opTerminateInstances == nil { - opTerminateInstances = &aws.Operation{ - Name: "TerminateInstances", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *EC2) TerminateInstancesRequest(input *TerminateInstancesInput) (req *request.Request, output *TerminateInstancesOutput) { + op := &request.Operation{ + Name: opTerminateInstances, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &TerminateInstancesInput{} } - req = c.newRequest(opTerminateInstances, input, output) + req = c.newRequest(op, input, output) output = &TerminateInstancesOutput{} req.Data = output return @@ -6976,9 +6217,10 @@ func (c *EC2) TerminateInstancesRequest(input *TerminateInstancesInput) (req *aw // instance store-backed instances. What happens to an instance differs if you // stop it or terminate it. For example, when you stop an instance, the root // device and any other devices attached to the instance persist. When you terminate -// an instance, the root device and any other devices attached during the instance -// launch are automatically deleted. For more information about the differences -// between stopping and terminating instances, see Instance Lifecycle (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-lifecycle.html) +// an instance, any attached EBS volumes with the DeleteOnTermination block +// device mapping parameter set to true are automatically deleted. For more +// information about the differences between stopping and terminating instances, +// see Instance Lifecycle (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-lifecycle.html) // in the Amazon Elastic Compute Cloud User Guide. // // For more information about troubleshooting, see Troubleshooting Terminating @@ -6990,58 +6232,48 @@ func (c *EC2) TerminateInstances(input *TerminateInstancesInput) (*TerminateInst return out, err } -var opTerminateInstances *aws.Operation - -// UnassignPrivateIPAddressesRequest generates a request for the UnassignPrivateIPAddresses operation. -func (c *EC2) UnassignPrivateIPAddressesRequest(input *UnassignPrivateIPAddressesInput) (req *aws.Request, output *UnassignPrivateIPAddressesOutput) { - oprw.Lock() - defer oprw.Unlock() +const opUnassignPrivateIpAddresses = "UnassignPrivateIpAddresses" - if opUnassignPrivateIPAddresses == nil { - opUnassignPrivateIPAddresses = &aws.Operation{ - Name: "UnassignPrivateIpAddresses", - HTTPMethod: "POST", - HTTPPath: "/", - } +// UnassignPrivateIpAddressesRequest generates a request for the UnassignPrivateIpAddresses operation. +func (c *EC2) UnassignPrivateIpAddressesRequest(input *UnassignPrivateIpAddressesInput) (req *request.Request, output *UnassignPrivateIpAddressesOutput) { + op := &request.Operation{ + Name: opUnassignPrivateIpAddresses, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { - input = &UnassignPrivateIPAddressesInput{} + input = &UnassignPrivateIpAddressesInput{} } - req = c.newRequest(opUnassignPrivateIPAddresses, input, output) - output = &UnassignPrivateIPAddressesOutput{} + req = c.newRequest(op, input, output) + output = &UnassignPrivateIpAddressesOutput{} req.Data = output return } // Unassigns one or more secondary private IP addresses from a network interface. -func (c *EC2) UnassignPrivateIPAddresses(input *UnassignPrivateIPAddressesInput) (*UnassignPrivateIPAddressesOutput, error) { - req, out := c.UnassignPrivateIPAddressesRequest(input) +func (c *EC2) UnassignPrivateIpAddresses(input *UnassignPrivateIpAddressesInput) (*UnassignPrivateIpAddressesOutput, error) { + req, out := c.UnassignPrivateIpAddressesRequest(input) err := req.Send() return out, err } -var opUnassignPrivateIPAddresses *aws.Operation +const opUnmonitorInstances = "UnmonitorInstances" // UnmonitorInstancesRequest generates a request for the UnmonitorInstances operation. -func (c *EC2) UnmonitorInstancesRequest(input *UnmonitorInstancesInput) (req *aws.Request, output *UnmonitorInstancesOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opUnmonitorInstances == nil { - opUnmonitorInstances = &aws.Operation{ - Name: "UnmonitorInstances", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *EC2) UnmonitorInstancesRequest(input *UnmonitorInstancesInput) (req *request.Request, output *UnmonitorInstancesOutput) { + op := &request.Operation{ + Name: opUnmonitorInstances, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &UnmonitorInstancesInput{} } - req = c.newRequest(opUnmonitorInstances, input, output) + req = c.newRequest(op, input, output) output = &UnmonitorInstancesOutput{} req.Data = output return @@ -7056,9 +6288,7 @@ func (c *EC2) UnmonitorInstances(input *UnmonitorInstancesInput) (*UnmonitorInst return out, err } -var opUnmonitorInstances *aws.Operation - -type AcceptVPCPeeringConnectionInput struct { +type AcceptVpcPeeringConnectionInput struct { // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have // the required permissions, the error response is DryRunOperation. Otherwise, @@ -7066,26 +6296,46 @@ type AcceptVPCPeeringConnectionInput struct { DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the VPC peering connection. - VPCPeeringConnectionID *string `locationName:"vpcPeeringConnectionId" type:"string"` + VpcPeeringConnectionId *string `locationName:"vpcPeeringConnectionId" type:"string"` - metadataAcceptVPCPeeringConnectionInput `json:"-" xml:"-"` + metadataAcceptVpcPeeringConnectionInput `json:"-" xml:"-"` } -type metadataAcceptVPCPeeringConnectionInput struct { +type metadataAcceptVpcPeeringConnectionInput struct { SDKShapeTraits bool `type:"structure"` } -type AcceptVPCPeeringConnectionOutput struct { +// String returns the string representation +func (s AcceptVpcPeeringConnectionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AcceptVpcPeeringConnectionInput) GoString() string { + return s.String() +} + +type AcceptVpcPeeringConnectionOutput struct { // Information about the VPC peering connection. - VPCPeeringConnection *VPCPeeringConnection `locationName:"vpcPeeringConnection" type:"structure"` + VpcPeeringConnection *VpcPeeringConnection `locationName:"vpcPeeringConnection" type:"structure"` - metadataAcceptVPCPeeringConnectionOutput `json:"-" xml:"-"` + metadataAcceptVpcPeeringConnectionOutput `json:"-" xml:"-"` } -type metadataAcceptVPCPeeringConnectionOutput struct { +type metadataAcceptVpcPeeringConnectionOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s AcceptVpcPeeringConnectionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AcceptVpcPeeringConnectionOutput) GoString() string { + return s.String() +} + // Describes an account attribute. type AccountAttribute struct { // The name of the account attribute. @@ -7101,6 +6351,16 @@ type metadataAccountAttribute struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s AccountAttribute) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AccountAttribute) GoString() string { + return s.String() +} + // Describes a value of an account attribute. type AccountAttributeValue struct { // The value of the attribute. @@ -7113,16 +6373,26 @@ type metadataAccountAttributeValue struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s AccountAttributeValue) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AccountAttributeValue) GoString() string { + return s.String() +} + // Describes a running instance in a Spot fleet. type ActiveInstance struct { // The ID of the instance. - InstanceID *string `locationName:"instanceId" type:"string"` + InstanceId *string `locationName:"instanceId" type:"string"` // The instance type. InstanceType *string `locationName:"instanceType" type:"string"` - // The ID of the Spot Instance request. - SpotInstanceRequestID *string `locationName:"spotInstanceRequestId" type:"string"` + // The ID of the Spot instance request. + SpotInstanceRequestId *string `locationName:"spotInstanceRequestId" type:"string"` metadataActiveInstance `json:"-" xml:"-"` } @@ -7131,33 +6401,43 @@ type metadataActiveInstance struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s ActiveInstance) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ActiveInstance) GoString() string { + return s.String() +} + // Describes an Elastic IP address. type Address struct { // The ID representing the allocation of the address for use with EC2-VPC. - AllocationID *string `locationName:"allocationId" type:"string"` + AllocationId *string `locationName:"allocationId" type:"string"` // The ID representing the association of the address with an instance in a // VPC. - AssociationID *string `locationName:"associationId" type:"string"` + AssociationId *string `locationName:"associationId" type:"string"` // Indicates whether this Elastic IP address is for use with instances in EC2-Classic // (standard) or instances in a VPC (vpc). - Domain *string `locationName:"domain" type:"string"` + Domain *string `locationName:"domain" type:"string" enum:"DomainType"` // The ID of the instance that the address is associated with (if any). - InstanceID *string `locationName:"instanceId" type:"string"` + InstanceId *string `locationName:"instanceId" type:"string"` // The ID of the network interface. - NetworkInterfaceID *string `locationName:"networkInterfaceId" type:"string"` + NetworkInterfaceId *string `locationName:"networkInterfaceId" type:"string"` // The ID of the AWS account that owns the network interface. - NetworkInterfaceOwnerID *string `locationName:"networkInterfaceOwnerId" type:"string"` + NetworkInterfaceOwnerId *string `locationName:"networkInterfaceOwnerId" type:"string"` // The private IP address associated with the Elastic IP address. - PrivateIPAddress *string `locationName:"privateIpAddress" type:"string"` + PrivateIpAddress *string `locationName:"privateIpAddress" type:"string"` // The Elastic IP address. - PublicIP *string `locationName:"publicIp" type:"string"` + PublicIp *string `locationName:"publicIp" type:"string"` metadataAddress `json:"-" xml:"-"` } @@ -7166,11 +6446,21 @@ type metadataAddress struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s Address) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Address) GoString() string { + return s.String() +} + type AllocateAddressInput struct { // Set to vpc to allocate the address for use with instances in a VPC. // // Default: The address is for use with instances in EC2-Classic. - Domain *string `type:"string"` + Domain *string `type:"string" enum:"DomainType"` // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have @@ -7185,17 +6475,27 @@ type metadataAllocateAddressInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s AllocateAddressInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AllocateAddressInput) GoString() string { + return s.String() +} + type AllocateAddressOutput struct { // [EC2-VPC] The ID that AWS assigns to represent the allocation of the Elastic // IP address for use with instances in a VPC. - AllocationID *string `locationName:"allocationId" type:"string"` + AllocationId *string `locationName:"allocationId" type:"string"` // Indicates whether this Elastic IP address is for use with instances in EC2-Classic // (standard) or instances in a VPC (vpc). - Domain *string `locationName:"domain" type:"string"` + Domain *string `locationName:"domain" type:"string" enum:"DomainType"` // The Elastic IP address. - PublicIP *string `locationName:"publicIp" type:"string"` + PublicIp *string `locationName:"publicIp" type:"string"` metadataAllocateAddressOutput `json:"-" xml:"-"` } @@ -7204,13 +6504,23 @@ type metadataAllocateAddressOutput struct { SDKShapeTraits bool `type:"structure"` } -type AssignPrivateIPAddressesInput struct { +// String returns the string representation +func (s AllocateAddressOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AllocateAddressOutput) GoString() string { + return s.String() +} + +type AssignPrivateIpAddressesInput struct { // Indicates whether to allow an IP address that is already assigned to another // network interface or instance to be reassigned to the specified network interface. AllowReassignment *bool `locationName:"allowReassignment" type:"boolean"` // The ID of the network interface. - NetworkInterfaceID *string `locationName:"networkInterfaceId" type:"string" required:"true"` + NetworkInterfaceId *string `locationName:"networkInterfaceId" type:"string" required:"true"` // One or more IP addresses to be assigned as a secondary private IP address // to the network interface. You can't specify this parameter when also specifying @@ -7218,30 +6528,50 @@ type AssignPrivateIPAddressesInput struct { // // If you don't specify an IP address, Amazon EC2 automatically selects an // IP address within the subnet range. - PrivateIPAddresses []*string `locationName:"privateIpAddress" locationNameList:"PrivateIpAddress" type:"list"` + PrivateIpAddresses []*string `locationName:"privateIpAddress" locationNameList:"PrivateIpAddress" type:"list"` // The number of secondary IP addresses to assign to the network interface. // You can't specify this parameter when also specifying private IP addresses. - SecondaryPrivateIPAddressCount *int64 `locationName:"secondaryPrivateIpAddressCount" type:"integer"` + SecondaryPrivateIpAddressCount *int64 `locationName:"secondaryPrivateIpAddressCount" type:"integer"` - metadataAssignPrivateIPAddressesInput `json:"-" xml:"-"` + metadataAssignPrivateIpAddressesInput `json:"-" xml:"-"` } -type metadataAssignPrivateIPAddressesInput struct { +type metadataAssignPrivateIpAddressesInput struct { SDKShapeTraits bool `type:"structure"` } -type AssignPrivateIPAddressesOutput struct { - metadataAssignPrivateIPAddressesOutput `json:"-" xml:"-"` +// String returns the string representation +func (s AssignPrivateIpAddressesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AssignPrivateIpAddressesInput) GoString() string { + return s.String() +} + +type AssignPrivateIpAddressesOutput struct { + metadataAssignPrivateIpAddressesOutput `json:"-" xml:"-"` } -type metadataAssignPrivateIPAddressesOutput struct { +type metadataAssignPrivateIpAddressesOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s AssignPrivateIpAddressesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AssignPrivateIpAddressesOutput) GoString() string { + return s.String() +} + type AssociateAddressInput struct { // [EC2-VPC] The allocation ID. This is required for EC2-VPC. - AllocationID *string `locationName:"AllocationId" type:"string"` + AllocationId *string `type:"string"` // [EC2-VPC] Allows an Elastic IP address that is already associated with an // instance or network interface to be re-associated with the specified instance @@ -7260,19 +6590,19 @@ type AssociateAddressInput struct { // can specify either the instance ID or the network interface ID, but not both. // The operation fails if you specify an instance ID unless exactly one network // interface is attached. - InstanceID *string `locationName:"InstanceId" type:"string"` + InstanceId *string `type:"string"` // [EC2-VPC] The ID of the network interface. If the instance has more than // one network interface, you must specify a network interface ID. - NetworkInterfaceID *string `locationName:"networkInterfaceId" type:"string"` + NetworkInterfaceId *string `locationName:"networkInterfaceId" type:"string"` // [EC2-VPC] The primary or secondary private IP address to associate with the // Elastic IP address. If no private IP address is specified, the Elastic IP // address is associated with the primary private IP address. - PrivateIPAddress *string `locationName:"privateIpAddress" type:"string"` + PrivateIpAddress *string `locationName:"privateIpAddress" type:"string"` // The Elastic IP address. This is required for EC2-Classic. - PublicIP *string `locationName:"PublicIp" type:"string"` + PublicIp *string `type:"string"` metadataAssociateAddressInput `json:"-" xml:"-"` } @@ -7281,10 +6611,20 @@ type metadataAssociateAddressInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s AssociateAddressInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AssociateAddressInput) GoString() string { + return s.String() +} + type AssociateAddressOutput struct { // [EC2-VPC] The ID that represents the association of the Elastic IP address // with an instance. - AssociationID *string `locationName:"associationId" type:"string"` + AssociationId *string `locationName:"associationId" type:"string"` metadataAssociateAddressOutput `json:"-" xml:"-"` } @@ -7293,10 +6633,20 @@ type metadataAssociateAddressOutput struct { SDKShapeTraits bool `type:"structure"` } -type AssociateDHCPOptionsInput struct { +// String returns the string representation +func (s AssociateAddressOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AssociateAddressOutput) GoString() string { + return s.String() +} + +type AssociateDhcpOptionsInput struct { // The ID of the DHCP options set, or default to associate no DHCP options with // the VPC. - DHCPOptionsID *string `locationName:"DhcpOptionsId" type:"string" required:"true"` + DhcpOptionsId *string `type:"string" required:"true"` // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have @@ -7305,23 +6655,43 @@ type AssociateDHCPOptionsInput struct { DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the VPC. - VPCID *string `locationName:"VpcId" type:"string" required:"true"` + VpcId *string `type:"string" required:"true"` - metadataAssociateDHCPOptionsInput `json:"-" xml:"-"` + metadataAssociateDhcpOptionsInput `json:"-" xml:"-"` } -type metadataAssociateDHCPOptionsInput struct { +type metadataAssociateDhcpOptionsInput struct { SDKShapeTraits bool `type:"structure"` } -type AssociateDHCPOptionsOutput struct { - metadataAssociateDHCPOptionsOutput `json:"-" xml:"-"` +// String returns the string representation +func (s AssociateDhcpOptionsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AssociateDhcpOptionsInput) GoString() string { + return s.String() +} + +type AssociateDhcpOptionsOutput struct { + metadataAssociateDhcpOptionsOutput `json:"-" xml:"-"` } -type metadataAssociateDHCPOptionsOutput struct { +type metadataAssociateDhcpOptionsOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s AssociateDhcpOptionsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AssociateDhcpOptionsOutput) GoString() string { + return s.String() +} + type AssociateRouteTableInput struct { // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have @@ -7330,10 +6700,10 @@ type AssociateRouteTableInput struct { DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the route table. - RouteTableID *string `locationName:"routeTableId" type:"string" required:"true"` + RouteTableId *string `locationName:"routeTableId" type:"string" required:"true"` // The ID of the subnet. - SubnetID *string `locationName:"subnetId" type:"string" required:"true"` + SubnetId *string `locationName:"subnetId" type:"string" required:"true"` metadataAssociateRouteTableInput `json:"-" xml:"-"` } @@ -7342,9 +6712,19 @@ type metadataAssociateRouteTableInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s AssociateRouteTableInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AssociateRouteTableInput) GoString() string { + return s.String() +} + type AssociateRouteTableOutput struct { // The route table association ID (needed to disassociate the route table). - AssociationID *string `locationName:"associationId" type:"string"` + AssociationId *string `locationName:"associationId" type:"string"` metadataAssociateRouteTableOutput `json:"-" xml:"-"` } @@ -7353,7 +6733,17 @@ type metadataAssociateRouteTableOutput struct { SDKShapeTraits bool `type:"structure"` } -type AttachClassicLinkVPCInput struct { +// String returns the string representation +func (s AssociateRouteTableOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AssociateRouteTableOutput) GoString() string { + return s.String() +} + +type AttachClassicLinkVpcInput struct { // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have // the required permissions, the error response is DryRunOperation. Otherwise, @@ -7365,29 +6755,49 @@ type AttachClassicLinkVPCInput struct { Groups []*string `locationName:"SecurityGroupId" locationNameList:"groupId" type:"list" required:"true"` // The ID of an EC2-Classic instance to link to the ClassicLink-enabled VPC. - InstanceID *string `locationName:"instanceId" type:"string" required:"true"` + InstanceId *string `locationName:"instanceId" type:"string" required:"true"` // The ID of a ClassicLink-enabled VPC. - VPCID *string `locationName:"vpcId" type:"string" required:"true"` + VpcId *string `locationName:"vpcId" type:"string" required:"true"` - metadataAttachClassicLinkVPCInput `json:"-" xml:"-"` + metadataAttachClassicLinkVpcInput `json:"-" xml:"-"` } -type metadataAttachClassicLinkVPCInput struct { +type metadataAttachClassicLinkVpcInput struct { SDKShapeTraits bool `type:"structure"` } -type AttachClassicLinkVPCOutput struct { +// String returns the string representation +func (s AttachClassicLinkVpcInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AttachClassicLinkVpcInput) GoString() string { + return s.String() +} + +type AttachClassicLinkVpcOutput struct { // Returns true if the request succeeds; otherwise, it returns an error. Return *bool `locationName:"return" type:"boolean"` - metadataAttachClassicLinkVPCOutput `json:"-" xml:"-"` + metadataAttachClassicLinkVpcOutput `json:"-" xml:"-"` } -type metadataAttachClassicLinkVPCOutput struct { +type metadataAttachClassicLinkVpcOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s AttachClassicLinkVpcOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AttachClassicLinkVpcOutput) GoString() string { + return s.String() +} + type AttachInternetGatewayInput struct { // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have @@ -7396,10 +6806,10 @@ type AttachInternetGatewayInput struct { DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the Internet gateway. - InternetGatewayID *string `locationName:"internetGatewayId" type:"string" required:"true"` + InternetGatewayId *string `locationName:"internetGatewayId" type:"string" required:"true"` // The ID of the VPC. - VPCID *string `locationName:"vpcId" type:"string" required:"true"` + VpcId *string `locationName:"vpcId" type:"string" required:"true"` metadataAttachInternetGatewayInput `json:"-" xml:"-"` } @@ -7408,6 +6818,16 @@ type metadataAttachInternetGatewayInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s AttachInternetGatewayInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AttachInternetGatewayInput) GoString() string { + return s.String() +} + type AttachInternetGatewayOutput struct { metadataAttachInternetGatewayOutput `json:"-" xml:"-"` } @@ -7416,6 +6836,16 @@ type metadataAttachInternetGatewayOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s AttachInternetGatewayOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AttachInternetGatewayOutput) GoString() string { + return s.String() +} + type AttachNetworkInterfaceInput struct { // The index of the device for the network interface attachment. DeviceIndex *int64 `locationName:"deviceIndex" type:"integer" required:"true"` @@ -7427,10 +6857,10 @@ type AttachNetworkInterfaceInput struct { DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the instance. - InstanceID *string `locationName:"instanceId" type:"string" required:"true"` + InstanceId *string `locationName:"instanceId" type:"string" required:"true"` // The ID of the network interface. - NetworkInterfaceID *string `locationName:"networkInterfaceId" type:"string" required:"true"` + NetworkInterfaceId *string `locationName:"networkInterfaceId" type:"string" required:"true"` metadataAttachNetworkInterfaceInput `json:"-" xml:"-"` } @@ -7439,9 +6869,19 @@ type metadataAttachNetworkInterfaceInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s AttachNetworkInterfaceInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AttachNetworkInterfaceInput) GoString() string { + return s.String() +} + type AttachNetworkInterfaceOutput struct { // The ID of the network interface attachment. - AttachmentID *string `locationName:"attachmentId" type:"string"` + AttachmentId *string `locationName:"attachmentId" type:"string"` metadataAttachNetworkInterfaceOutput `json:"-" xml:"-"` } @@ -7450,61 +6890,101 @@ type metadataAttachNetworkInterfaceOutput struct { SDKShapeTraits bool `type:"structure"` } -type AttachVPNGatewayInput struct { +// String returns the string representation +func (s AttachNetworkInterfaceOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AttachNetworkInterfaceOutput) GoString() string { + return s.String() +} + +type AttachVolumeInput struct { + // The device name to expose to the instance (for example, /dev/sdh or xvdh). + Device *string `type:"string" required:"true"` + // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have // the required permissions, the error response is DryRunOperation. Otherwise, // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` - // The ID of the VPC. - VPCID *string `locationName:"VpcId" type:"string" required:"true"` + // The ID of the instance. + InstanceId *string `type:"string" required:"true"` - // The ID of the virtual private gateway. - VPNGatewayID *string `locationName:"VpnGatewayId" type:"string" required:"true"` + // The ID of the EBS volume. The volume and instance must be within the same + // Availability Zone. + VolumeId *string `type:"string" required:"true"` - metadataAttachVPNGatewayInput `json:"-" xml:"-"` + metadataAttachVolumeInput `json:"-" xml:"-"` } -type metadataAttachVPNGatewayInput struct { +type metadataAttachVolumeInput struct { SDKShapeTraits bool `type:"structure"` } -type AttachVPNGatewayOutput struct { - // Information about the attachment. - VPCAttachment *VPCAttachment `locationName:"attachment" type:"structure"` - - metadataAttachVPNGatewayOutput `json:"-" xml:"-"` +// String returns the string representation +func (s AttachVolumeInput) String() string { + return awsutil.Prettify(s) } -type metadataAttachVPNGatewayOutput struct { - SDKShapeTraits bool `type:"structure"` +// GoString returns the string representation +func (s AttachVolumeInput) GoString() string { + return s.String() } -type AttachVolumeInput struct { - // The device name to expose to the instance (for example, /dev/sdh or xvdh). - Device *string `type:"string" required:"true"` - +type AttachVpnGatewayInput struct { // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have // the required permissions, the error response is DryRunOperation. Otherwise, // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` - // The ID of the instance. - InstanceID *string `locationName:"InstanceId" type:"string" required:"true"` + // The ID of the VPC. + VpcId *string `type:"string" required:"true"` - // The ID of the EBS volume. The volume and instance must be within the same - // Availability Zone. - VolumeID *string `locationName:"VolumeId" type:"string" required:"true"` + // The ID of the virtual private gateway. + VpnGatewayId *string `type:"string" required:"true"` - metadataAttachVolumeInput `json:"-" xml:"-"` + metadataAttachVpnGatewayInput `json:"-" xml:"-"` } -type metadataAttachVolumeInput struct { +type metadataAttachVpnGatewayInput struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s AttachVpnGatewayInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AttachVpnGatewayInput) GoString() string { + return s.String() +} + +type AttachVpnGatewayOutput struct { + // Information about the attachment. + VpcAttachment *VpcAttachment `locationName:"attachment" type:"structure"` + + metadataAttachVpnGatewayOutput `json:"-" xml:"-"` +} + +type metadataAttachVpnGatewayOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s AttachVpnGatewayOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AttachVpnGatewayOutput) GoString() string { + return s.String() +} + // The value to use when a resource attribute accepts a Boolean value. type AttributeBooleanValue struct { // Valid values are true or false. @@ -7517,6 +6997,16 @@ type metadataAttributeBooleanValue struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s AttributeBooleanValue) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AttributeBooleanValue) GoString() string { + return s.String() +} + // The value to use for a resource attribute. type AttributeValue struct { // Valid values are case-sensitive and vary by action. @@ -7529,10 +7019,20 @@ type metadataAttributeValue struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s AttributeValue) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AttributeValue) GoString() string { + return s.String() +} + type AuthorizeSecurityGroupEgressInput struct { // The CIDR IP address range. You can't specify this parameter when specifying // a source security group. - CIDRIP *string `locationName:"cidrIp" type:"string"` + CidrIp *string `locationName:"cidrIp" type:"string"` // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have @@ -7545,23 +7045,25 @@ type AuthorizeSecurityGroupEgressInput struct { FromPort *int64 `locationName:"fromPort" type:"integer"` // The ID of the security group. - GroupID *string `locationName:"groupId" type:"string" required:"true"` + GroupId *string `locationName:"groupId" type:"string" required:"true"` // A set of IP permissions. You can't specify a destination security group and // a CIDR IP address range. - IPPermissions []*IPPermission `locationName:"ipPermissions" locationNameList:"item" type:"list"` + IpPermissions []*IpPermission `locationName:"ipPermissions" locationNameList:"item" type:"list"` // The IP protocol name (tcp, udp, icmp) or number (see Protocol Numbers (http://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml)). // Use -1 to specify all. - IPProtocol *string `locationName:"ipProtocol" type:"string"` + IpProtocol *string `locationName:"ipProtocol" type:"string"` - // [EC2-Classic, default VPC] The name of the destination security group. You - // can't specify a destination security group and a CIDR IP address range. + // The name of a destination security group. To authorize outbound access to + // a destination security group, we recommend that you use a set of IP permissions + // instead. SourceSecurityGroupName *string `locationName:"sourceSecurityGroupName" type:"string"` - // The ID of the destination security group. You can't specify a destination - // security group and a CIDR IP address range. - SourceSecurityGroupOwnerID *string `locationName:"sourceSecurityGroupOwnerId" type:"string"` + // The AWS account number for a destination security group. To authorize outbound + // access to a destination security group, we recommend that you use a set of + // IP permissions instead. + SourceSecurityGroupOwnerId *string `locationName:"sourceSecurityGroupOwnerId" type:"string"` // The end of port range for the TCP and UDP protocols, or an ICMP code number. // For the ICMP code number, use -1 to specify all ICMP codes for the ICMP type. @@ -7574,6 +7076,16 @@ type metadataAuthorizeSecurityGroupEgressInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s AuthorizeSecurityGroupEgressInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AuthorizeSecurityGroupEgressInput) GoString() string { + return s.String() +} + type AuthorizeSecurityGroupEgressOutput struct { metadataAuthorizeSecurityGroupEgressOutput `json:"-" xml:"-"` } @@ -7582,10 +7094,20 @@ type metadataAuthorizeSecurityGroupEgressOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s AuthorizeSecurityGroupEgressOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AuthorizeSecurityGroupEgressOutput) GoString() string { + return s.String() +} + type AuthorizeSecurityGroupIngressInput struct { // The CIDR IP address range. You can't specify this parameter when specifying // a source security group. - CIDRIP *string `locationName:"CidrIp" type:"string"` + CidrIp *string `type:"string"` // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have @@ -7598,26 +7120,34 @@ type AuthorizeSecurityGroupIngressInput struct { FromPort *int64 `type:"integer"` // The ID of the security group. Required for a nondefault VPC. - GroupID *string `locationName:"GroupId" type:"string"` + GroupId *string `type:"string"` // [EC2-Classic, default VPC] The name of the security group. GroupName *string `type:"string"` // A set of IP permissions. Can be used to specify multiple rules in a single // command. - IPPermissions []*IPPermission `locationName:"IpPermissions" locationNameList:"item" type:"list"` + IpPermissions []*IpPermission `locationNameList:"item" type:"list"` // The IP protocol name (tcp, udp, icmp) or number (see Protocol Numbers (http://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml)). // (VPC only) Use -1 to specify all. - IPProtocol *string `locationName:"IpProtocol" type:"string"` + IpProtocol *string `type:"string"` // [EC2-Classic, default VPC] The name of the source security group. You can't - // specify a source security group and a CIDR IP address range. + // specify this parameter in combination with the following parameters: the + // CIDR IP address range, the start of the port range, the IP protocol, and + // the end of the port range. For EC2-VPC, the source security group must be + // in the same VPC. SourceSecurityGroupName *string `type:"string"` - // The ID of the source security group. You can't specify a source security - // group and a CIDR IP address range. - SourceSecurityGroupOwnerID *string `locationName:"SourceSecurityGroupOwnerId" type:"string"` + // [EC2-Classic, default VPC] The AWS account number for the source security + // group. For EC2-VPC, the source security group must be in the same VPC. You + // can't specify this parameter in combination with the following parameters: + // the CIDR IP address range, the IP protocol, the start of the port range, + // and the end of the port range. Creates rules that grant full ICMP, UDP, and + // TCP access. To create a rule with a specific IP protocol and port range, + // use a set of IP permissions instead. + SourceSecurityGroupOwnerId *string `type:"string"` // The end of port range for the TCP and UDP protocols, or an ICMP code number. // For the ICMP code number, use -1 to specify all ICMP codes for the ICMP type. @@ -7630,6 +7160,16 @@ type metadataAuthorizeSecurityGroupIngressInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s AuthorizeSecurityGroupIngressInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AuthorizeSecurityGroupIngressInput) GoString() string { + return s.String() +} + type AuthorizeSecurityGroupIngressOutput struct { metadataAuthorizeSecurityGroupIngressOutput `json:"-" xml:"-"` } @@ -7638,6 +7178,16 @@ type metadataAuthorizeSecurityGroupIngressOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s AuthorizeSecurityGroupIngressOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AuthorizeSecurityGroupIngressOutput) GoString() string { + return s.String() +} + // Describes an Availability Zone. type AvailabilityZone struct { // Any messages about the Availability Zone. @@ -7647,7 +7197,7 @@ type AvailabilityZone struct { RegionName *string `locationName:"regionName" type:"string"` // The state of the Availability Zone (available | impaired | unavailable). - State *string `locationName:"zoneState" type:"string"` + State *string `locationName:"zoneState" type:"string" enum:"AvailabilityZoneState"` // The name of the Availability Zone. ZoneName *string `locationName:"zoneName" type:"string"` @@ -7659,6 +7209,16 @@ type metadataAvailabilityZone struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s AvailabilityZone) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AvailabilityZone) GoString() string { + return s.String() +} + // Describes a message about an Availability Zone. type AvailabilityZoneMessage struct { // The message about the Availability Zone. @@ -7671,6 +7231,16 @@ type metadataAvailabilityZoneMessage struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s AvailabilityZoneMessage) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AvailabilityZoneMessage) GoString() string { + return s.String() +} + type BlobAttributeValue struct { Value []byte `locationName:"value" type:"blob"` @@ -7681,6 +7251,16 @@ type metadataBlobAttributeValue struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s BlobAttributeValue) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s BlobAttributeValue) GoString() string { + return s.String() +} + // Describes a block device mapping. type BlockDeviceMapping struct { // The device name exposed to the instance (for example, /dev/sdh or xvdh). @@ -7688,7 +7268,7 @@ type BlockDeviceMapping struct { // Parameters used to automatically set up EBS volumes when the instance is // launched. - EBS *EBSBlockDevice `locationName:"ebs" type:"structure"` + Ebs *EbsBlockDevice `locationName:"ebs" type:"structure"` // Suppresses the specified device included in the block device mapping of the // AMI. @@ -7713,6 +7293,16 @@ type metadataBlockDeviceMapping struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s BlockDeviceMapping) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s BlockDeviceMapping) GoString() string { + return s.String() +} + type BundleInstanceInput struct { // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have @@ -7727,7 +7317,7 @@ type BundleInstanceInput struct { // Default: None // // Required: Yes - InstanceID *string `locationName:"InstanceId" type:"string" required:"true"` + InstanceId *string `type:"string" required:"true"` // The bucket in which to store the AMI. You can specify a bucket that you already // own or a new bucket that Amazon EC2 creates on your behalf. If you specify @@ -7741,6 +7331,16 @@ type metadataBundleInstanceInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s BundleInstanceInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s BundleInstanceInput) GoString() string { + return s.String() +} + type BundleInstanceOutput struct { // Information about the bundle task. BundleTask *BundleTask `locationName:"bundleInstanceTask" type:"structure"` @@ -7752,16 +7352,26 @@ type metadataBundleInstanceOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s BundleInstanceOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s BundleInstanceOutput) GoString() string { + return s.String() +} + // Describes a bundle task. type BundleTask struct { // The ID of the bundle task. - BundleID *string `locationName:"bundleId" type:"string"` + BundleId *string `locationName:"bundleId" type:"string"` // If the task fails, a description of the error. BundleTaskError *BundleTaskError `locationName:"error" type:"structure"` // The ID of the instance associated with this bundle task. - InstanceID *string `locationName:"instanceId" type:"string"` + InstanceId *string `locationName:"instanceId" type:"string"` // The level of task completion, as a percent (for example, 20%). Progress *string `locationName:"progress" type:"string"` @@ -7770,7 +7380,7 @@ type BundleTask struct { StartTime *time.Time `locationName:"startTime" type:"timestamp" timestampFormat:"iso8601"` // The state of the task. - State *string `locationName:"state" type:"string"` + State *string `locationName:"state" type:"string" enum:"BundleTaskState"` // The Amazon S3 storage locations. Storage *Storage `locationName:"storage" type:"structure"` @@ -7785,6 +7395,16 @@ type metadataBundleTask struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s BundleTask) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s BundleTask) GoString() string { + return s.String() +} + // Describes an error for BundleInstance. type BundleTaskError struct { // The error code. @@ -7800,9 +7420,19 @@ type metadataBundleTaskError struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s BundleTaskError) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s BundleTaskError) GoString() string { + return s.String() +} + type CancelBundleTaskInput struct { // The ID of the bundle task. - BundleID *string `locationName:"BundleId" type:"string" required:"true"` + BundleId *string `type:"string" required:"true"` // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have @@ -7817,6 +7447,16 @@ type metadataCancelBundleTaskInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s CancelBundleTaskInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CancelBundleTaskInput) GoString() string { + return s.String() +} + type CancelBundleTaskOutput struct { // Information about the bundle task. BundleTask *BundleTask `locationName:"bundleInstanceTask" type:"structure"` @@ -7828,9 +7468,19 @@ type metadataCancelBundleTaskOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s CancelBundleTaskOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CancelBundleTaskOutput) GoString() string { + return s.String() +} + type CancelConversionTaskInput struct { // The ID of the conversion task. - ConversionTaskID *string `locationName:"conversionTaskId" type:"string" required:"true"` + ConversionTaskId *string `locationName:"conversionTaskId" type:"string" required:"true"` // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have @@ -7848,6 +7498,16 @@ type metadataCancelConversionTaskInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s CancelConversionTaskInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CancelConversionTaskInput) GoString() string { + return s.String() +} + type CancelConversionTaskOutput struct { metadataCancelConversionTaskOutput `json:"-" xml:"-"` } @@ -7856,9 +7516,19 @@ type metadataCancelConversionTaskOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s CancelConversionTaskOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CancelConversionTaskOutput) GoString() string { + return s.String() +} + type CancelExportTaskInput struct { // The ID of the export task. This is the ID returned by CreateInstanceExportTask. - ExportTaskID *string `locationName:"exportTaskId" type:"string" required:"true"` + ExportTaskId *string `locationName:"exportTaskId" type:"string" required:"true"` metadataCancelExportTaskInput `json:"-" xml:"-"` } @@ -7867,6 +7537,16 @@ type metadataCancelExportTaskInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s CancelExportTaskInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CancelExportTaskInput) GoString() string { + return s.String() +} + type CancelExportTaskOutput struct { metadataCancelExportTaskOutput `json:"-" xml:"-"` } @@ -7875,6 +7555,16 @@ type metadataCancelExportTaskOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s CancelExportTaskOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CancelExportTaskOutput) GoString() string { + return s.String() +} + type CancelImportTaskInput struct { // The reason for canceling the task. CancelReason *string `type:"string"` @@ -7886,7 +7576,7 @@ type CancelImportTaskInput struct { DryRun *bool `type:"boolean"` // The ID of the import image or import snapshot task to be canceled. - ImportTaskID *string `locationName:"ImportTaskId" type:"string"` + ImportTaskId *string `type:"string"` metadataCancelImportTaskInput `json:"-" xml:"-"` } @@ -7895,9 +7585,19 @@ type metadataCancelImportTaskInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s CancelImportTaskInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CancelImportTaskInput) GoString() string { + return s.String() +} + type CancelImportTaskOutput struct { // The ID of the task being canceled. - ImportTaskID *string `locationName:"importTaskId" type:"string"` + ImportTaskId *string `locationName:"importTaskId" type:"string"` // The current state of the task being canceled. PreviousState *string `locationName:"previousState" type:"string"` @@ -7912,9 +7612,19 @@ type metadataCancelImportTaskOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s CancelImportTaskOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CancelImportTaskOutput) GoString() string { + return s.String() +} + type CancelReservedInstancesListingInput struct { // The ID of the Reserved Instance listing. - ReservedInstancesListingID *string `locationName:"reservedInstancesListingId" type:"string" required:"true"` + ReservedInstancesListingId *string `locationName:"reservedInstancesListingId" type:"string" required:"true"` metadataCancelReservedInstancesListingInput `json:"-" xml:"-"` } @@ -7923,6 +7633,16 @@ type metadataCancelReservedInstancesListingInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s CancelReservedInstancesListingInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CancelReservedInstancesListingInput) GoString() string { + return s.String() +} + type CancelReservedInstancesListingOutput struct { // The Reserved Instance listing. ReservedInstancesListings []*ReservedInstancesListing `locationName:"reservedInstancesListingsSet" locationNameList:"item" type:"list"` @@ -7934,10 +7654,20 @@ type metadataCancelReservedInstancesListingOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s CancelReservedInstancesListingOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CancelReservedInstancesListingOutput) GoString() string { + return s.String() +} + // Describes a Spot fleet error. type CancelSpotFleetRequestsError struct { // The error code. - Code *string `locationName:"code" type:"string" required:"true"` + Code *string `locationName:"code" type:"string" required:"true" enum:"CancelBatchErrorCode"` // The description for the error code. Message *string `locationName:"message" type:"string" required:"true"` @@ -7949,13 +7679,23 @@ type metadataCancelSpotFleetRequestsError struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s CancelSpotFleetRequestsError) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CancelSpotFleetRequestsError) GoString() string { + return s.String() +} + // Describes a Spot fleet request that was not successfully canceled. type CancelSpotFleetRequestsErrorItem struct { // The error. Error *CancelSpotFleetRequestsError `locationName:"error" type:"structure" required:"true"` // The ID of the Spot fleet request. - SpotFleetRequestID *string `locationName:"spotFleetRequestId" type:"string" required:"true"` + SpotFleetRequestId *string `locationName:"spotFleetRequestId" type:"string" required:"true"` metadataCancelSpotFleetRequestsErrorItem `json:"-" xml:"-"` } @@ -7964,6 +7704,16 @@ type metadataCancelSpotFleetRequestsErrorItem struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s CancelSpotFleetRequestsErrorItem) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CancelSpotFleetRequestsErrorItem) GoString() string { + return s.String() +} + // Contains the parameters for CancelSpotFleetRequests. type CancelSpotFleetRequestsInput struct { // Checks whether you have the required permissions for the action, without @@ -7973,7 +7723,7 @@ type CancelSpotFleetRequestsInput struct { DryRun *bool `locationName:"dryRun" type:"boolean"` // The IDs of the Spot fleet requests. - SpotFleetRequestIDs []*string `locationName:"spotFleetRequestId" locationNameList:"item" type:"list" required:"true"` + SpotFleetRequestIds []*string `locationName:"spotFleetRequestId" locationNameList:"item" type:"list" required:"true"` // Indicates whether to terminate instances for a Spot fleet request if it is // canceled successfully. @@ -7986,6 +7736,16 @@ type metadataCancelSpotFleetRequestsInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s CancelSpotFleetRequestsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CancelSpotFleetRequestsInput) GoString() string { + return s.String() +} + // Contains the output of CancelSpotFleetRequests. type CancelSpotFleetRequestsOutput struct { // Information about the Spot fleet requests that are successfully canceled. @@ -8001,16 +7761,26 @@ type metadataCancelSpotFleetRequestsOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s CancelSpotFleetRequestsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CancelSpotFleetRequestsOutput) GoString() string { + return s.String() +} + // Describes a Spot fleet request that was successfully canceled. type CancelSpotFleetRequestsSuccessItem struct { // The current state of the Spot fleet request. - CurrentSpotFleetRequestState *string `locationName:"currentSpotFleetRequestState" type:"string" required:"true"` + CurrentSpotFleetRequestState *string `locationName:"currentSpotFleetRequestState" type:"string" required:"true" enum:"BatchState"` // The previous state of the Spot fleet request. - PreviousSpotFleetRequestState *string `locationName:"previousSpotFleetRequestState" type:"string" required:"true"` + PreviousSpotFleetRequestState *string `locationName:"previousSpotFleetRequestState" type:"string" required:"true" enum:"BatchState"` // The ID of the Spot fleet request. - SpotFleetRequestID *string `locationName:"spotFleetRequestId" type:"string" required:"true"` + SpotFleetRequestId *string `locationName:"spotFleetRequestId" type:"string" required:"true"` metadataCancelSpotFleetRequestsSuccessItem `json:"-" xml:"-"` } @@ -8019,6 +7789,16 @@ type metadataCancelSpotFleetRequestsSuccessItem struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s CancelSpotFleetRequestsSuccessItem) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CancelSpotFleetRequestsSuccessItem) GoString() string { + return s.String() +} + // Contains the parameters for CancelSpotInstanceRequests. type CancelSpotInstanceRequestsInput struct { // Checks whether you have the required permissions for the action, without @@ -8027,8 +7807,8 @@ type CancelSpotInstanceRequestsInput struct { // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` - // One or more Spot Instance request IDs. - SpotInstanceRequestIDs []*string `locationName:"SpotInstanceRequestId" locationNameList:"SpotInstanceRequestId" type:"list" required:"true"` + // One or more Spot instance request IDs. + SpotInstanceRequestIds []*string `locationName:"SpotInstanceRequestId" locationNameList:"SpotInstanceRequestId" type:"list" required:"true"` metadataCancelSpotInstanceRequestsInput `json:"-" xml:"-"` } @@ -8037,9 +7817,19 @@ type metadataCancelSpotInstanceRequestsInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s CancelSpotInstanceRequestsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CancelSpotInstanceRequestsInput) GoString() string { + return s.String() +} + // Contains the output of CancelSpotInstanceRequests. type CancelSpotInstanceRequestsOutput struct { - // One or more Spot Instance requests. + // One or more Spot instance requests. CancelledSpotInstanceRequests []*CancelledSpotInstanceRequest `locationName:"spotInstanceRequestSet" locationNameList:"item" type:"list"` metadataCancelSpotInstanceRequestsOutput `json:"-" xml:"-"` @@ -8049,13 +7839,23 @@ type metadataCancelSpotInstanceRequestsOutput struct { SDKShapeTraits bool `type:"structure"` } -// Describes a request to cancel a Spot Instance. +// String returns the string representation +func (s CancelSpotInstanceRequestsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CancelSpotInstanceRequestsOutput) GoString() string { + return s.String() +} + +// Describes a request to cancel a Spot instance. type CancelledSpotInstanceRequest struct { - // The ID of the Spot Instance request. - SpotInstanceRequestID *string `locationName:"spotInstanceRequestId" type:"string"` + // The ID of the Spot instance request. + SpotInstanceRequestId *string `locationName:"spotInstanceRequestId" type:"string"` - // The state of the Spot Instance request. - State *string `locationName:"state" type:"string"` + // The state of the Spot instance request. + State *string `locationName:"state" type:"string" enum:"CancelSpotInstanceRequestState"` metadataCancelledSpotInstanceRequest `json:"-" xml:"-"` } @@ -8064,19 +7864,29 @@ type metadataCancelledSpotInstanceRequest struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s CancelledSpotInstanceRequest) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CancelledSpotInstanceRequest) GoString() string { + return s.String() +} + // Describes a linked EC2-Classic instance. type ClassicLinkInstance struct { // A list of security groups. Groups []*GroupIdentifier `locationName:"groupSet" locationNameList:"item" type:"list"` // The ID of the instance. - InstanceID *string `locationName:"instanceId" type:"string"` + InstanceId *string `locationName:"instanceId" type:"string"` // Any tags assigned to the instance. Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` // The ID of the VPC. - VPCID *string `locationName:"vpcId" type:"string"` + VpcId *string `locationName:"vpcId" type:"string"` metadataClassicLinkInstance `json:"-" xml:"-"` } @@ -8085,6 +7895,16 @@ type metadataClassicLinkInstance struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s ClassicLinkInstance) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ClassicLinkInstance) GoString() string { + return s.String() +} + // Describes the client-specific data. type ClientData struct { // A user-defined comment about the disk upload. @@ -8106,6 +7926,16 @@ type metadataClientData struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s ClientData) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ClientData) GoString() string { + return s.String() +} + type ConfirmProductInstanceInput struct { // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have @@ -8114,7 +7944,7 @@ type ConfirmProductInstanceInput struct { DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the instance. - InstanceID *string `locationName:"InstanceId" type:"string" required:"true"` + InstanceId *string `type:"string" required:"true"` // The product code. This must be a product code that you own. ProductCode *string `type:"string" required:"true"` @@ -8126,10 +7956,24 @@ type metadataConfirmProductInstanceInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s ConfirmProductInstanceInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ConfirmProductInstanceInput) GoString() string { + return s.String() +} + type ConfirmProductInstanceOutput struct { // The AWS account ID of the instance owner. This is only present if the product // code is attached to the instance. - OwnerID *string `locationName:"ownerId" type:"string"` + OwnerId *string `locationName:"ownerId" type:"string"` + + // The return value of the request. Returns true if the specified product code + // is owned by the requester and associated with the specified instance. + Return *bool `locationName:"return" type:"boolean"` metadataConfirmProductInstanceOutput `json:"-" xml:"-"` } @@ -8138,10 +7982,20 @@ type metadataConfirmProductInstanceOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s ConfirmProductInstanceOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ConfirmProductInstanceOutput) GoString() string { + return s.String() +} + // Describes a conversion task. type ConversionTask struct { // The ID of the conversion task. - ConversionTaskID *string `locationName:"conversionTaskId" type:"string" required:"true"` + ConversionTaskId *string `locationName:"conversionTaskId" type:"string" required:"true"` // The time when the task expires. If the upload isn't complete before the expiration // time, we automatically cancel the task. @@ -8156,7 +8010,7 @@ type ConversionTask struct { ImportVolume *ImportVolumeTaskDetails `locationName:"importVolume" type:"structure"` // The state of the conversion task. - State *string `locationName:"state" type:"string" required:"true"` + State *string `locationName:"state" type:"string" required:"true" enum:"ConversionTaskState"` // The status message related to the conversion task. StatusMessage *string `locationName:"statusMessage" type:"string"` @@ -8171,6 +8025,16 @@ type metadataConversionTask struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s ConversionTask) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ConversionTask) GoString() string { + return s.String() +} + type CopyImageInput struct { // Unique, case-sensitive identifier you provide to ensure idempotency of the // request. For more information, see How to Ensure Idempotency (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Run_Instance_Idempotency.html) @@ -8190,7 +8054,7 @@ type CopyImageInput struct { Name *string `type:"string" required:"true"` // The ID of the AMI to copy. - SourceImageID *string `locationName:"SourceImageId" type:"string" required:"true"` + SourceImageId *string `type:"string" required:"true"` // The name of the region that contains the AMI to copy. SourceRegion *string `type:"string" required:"true"` @@ -8202,9 +8066,19 @@ type metadataCopyImageInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s CopyImageInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CopyImageInput) GoString() string { + return s.String() +} + type CopyImageOutput struct { // The ID of the new AMI. - ImageID *string `locationName:"imageId" type:"string"` + ImageId *string `locationName:"imageId" type:"string"` metadataCopyImageOutput `json:"-" xml:"-"` } @@ -8213,6 +8087,16 @@ type metadataCopyImageOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s CopyImageOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CopyImageOutput) GoString() string { + return s.String() +} + type CopySnapshotInput struct { // A description for the EBS snapshot. Description *string `type:"string"` @@ -8233,6 +8117,25 @@ type CopySnapshotInput struct { // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` + // Specifies whether the destination snapshot should be encrypted. There is + // no way to create an unencrypted snapshot copy from an encrypted snapshot; + // however, you can encrypt a copy of an unencrypted snapshot with this flag. + // The default CMK for EBS is used unless a non-default AWS Key Management Service + // (AWS KMS) CMK is specified with KmsKeyId. For more information, see Amazon + // EBS Encryption (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html) + // in the Amazon Elastic Compute Cloud User Guide. + Encrypted *bool `locationName:"encrypted" type:"boolean"` + + // The full ARN of the AWS Key Management Service (AWS KMS) CMK to use when + // creating the snapshot copy. This parameter is only required if you want to + // use a non-default CMK; if this parameter is not specified, the default CMK + // for EBS is used. The ARN contains the arn:aws:kms namespace, followed by + // the region of the CMK, the AWS account ID of the CMK owner, the key namespace, + // and then the CMK ID. For example, arn:aws:kms:us-east-1:012345678910:key/abcd1234-a123-456a-a12b-a123b4cd56ef. + // The specified CMK must exist in the region that the snapshot is being copied + // to. If a KmsKeyId is specified, the Encrypted flag must also be set. + KmsKeyId *string `locationName:"kmsKeyId" type:"string"` + // The pre-signed URL that facilitates copying an encrypted snapshot. This parameter // is only required when copying an encrypted snapshot with the Amazon EC2 Query // API; it is available as an optional parameter in all other cases. The PresignedUrl @@ -8245,13 +8148,13 @@ type CopySnapshotInput struct { // in the Amazon Simple Storage Service API Reference. An invalid or improperly // signed PresignedUrl will cause the copy operation to fail asynchronously, // and the snapshot will move to an error state. - PresignedURL *string `locationName:"presignedUrl" type:"string"` + PresignedUrl *string `locationName:"presignedUrl" type:"string"` // The ID of the region that contains the snapshot to be copied. SourceRegion *string `type:"string" required:"true"` // The ID of the EBS snapshot to copy. - SourceSnapshotID *string `locationName:"SourceSnapshotId" type:"string" required:"true"` + SourceSnapshotId *string `type:"string" required:"true"` metadataCopySnapshotInput `json:"-" xml:"-"` } @@ -8260,9 +8163,19 @@ type metadataCopySnapshotInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s CopySnapshotInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CopySnapshotInput) GoString() string { + return s.String() +} + type CopySnapshotOutput struct { // The ID of the new snapshot. - SnapshotID *string `locationName:"snapshotId" type:"string"` + SnapshotId *string `locationName:"snapshotId" type:"string"` metadataCopySnapshotOutput `json:"-" xml:"-"` } @@ -8271,11 +8184,21 @@ type metadataCopySnapshotOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s CopySnapshotOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CopySnapshotOutput) GoString() string { + return s.String() +} + type CreateCustomerGatewayInput struct { // For devices that support BGP, the customer gateway's BGP ASN. // // Default: 65000 - BGPASN *int64 `locationName:"BgpAsn" type:"integer" required:"true"` + BgpAsn *int64 `type:"integer" required:"true"` // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have @@ -8285,10 +8208,10 @@ type CreateCustomerGatewayInput struct { // The Internet-routable IP address for the customer gateway's outside interface. // The address must be static. - PublicIP *string `locationName:"IpAddress" type:"string" required:"true"` + PublicIp *string `locationName:"IpAddress" type:"string" required:"true"` // The type of VPN connection that this customer gateway supports (ipsec.1). - Type *string `type:"string" required:"true"` + Type *string `type:"string" required:"true" enum:"GatewayType"` metadataCreateCustomerGatewayInput `json:"-" xml:"-"` } @@ -8297,6 +8220,16 @@ type metadataCreateCustomerGatewayInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s CreateCustomerGatewayInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateCustomerGatewayInput) GoString() string { + return s.String() +} + type CreateCustomerGatewayOutput struct { // Information about the customer gateway. CustomerGateway *CustomerGateway `locationName:"customerGateway" type:"structure"` @@ -8308,9 +8241,19 @@ type metadataCreateCustomerGatewayOutput struct { SDKShapeTraits bool `type:"structure"` } -type CreateDHCPOptionsInput struct { +// String returns the string representation +func (s CreateCustomerGatewayOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateCustomerGatewayOutput) GoString() string { + return s.String() +} + +type CreateDhcpOptionsInput struct { // A DHCP configuration option. - DHCPConfigurations []*NewDHCPConfiguration `locationName:"dhcpConfiguration" locationNameList:"item" type:"list" required:"true"` + DhcpConfigurations []*NewDhcpConfiguration `locationName:"dhcpConfiguration" locationNameList:"item" type:"list" required:"true"` // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have @@ -8318,24 +8261,110 @@ type CreateDHCPOptionsInput struct { // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` - metadataCreateDHCPOptionsInput `json:"-" xml:"-"` + metadataCreateDhcpOptionsInput `json:"-" xml:"-"` } -type metadataCreateDHCPOptionsInput struct { +type metadataCreateDhcpOptionsInput struct { SDKShapeTraits bool `type:"structure"` } -type CreateDHCPOptionsOutput struct { +// String returns the string representation +func (s CreateDhcpOptionsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateDhcpOptionsInput) GoString() string { + return s.String() +} + +type CreateDhcpOptionsOutput struct { // A set of DHCP options. - DHCPOptions *DHCPOptions `locationName:"dhcpOptions" type:"structure"` + DhcpOptions *DhcpOptions `locationName:"dhcpOptions" type:"structure"` + + metadataCreateDhcpOptionsOutput `json:"-" xml:"-"` +} + +type metadataCreateDhcpOptionsOutput struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s CreateDhcpOptionsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateDhcpOptionsOutput) GoString() string { + return s.String() +} + +type CreateFlowLogsInput struct { + // Unique, case-sensitive identifier you provide to ensure the idempotency of + // the request. For more information, see How to Ensure Idempotency (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Run_Instance_Idempotency.html). + ClientToken *string `type:"string"` + + // The ARN for the IAM role that's used to post flow logs to a CloudWatch Logs + // log group. + DeliverLogsPermissionArn *string `type:"string" required:"true"` + + // The name of the CloudWatch log group. + LogGroupName *string `type:"string" required:"true"` + + // One or more subnet, network interface, or VPC IDs. + ResourceIds []*string `locationName:"ResourceId" locationNameList:"item" type:"list" required:"true"` + + // The type of resource on which to create the flow log. + ResourceType *string `type:"string" required:"true" enum:"FlowLogsResourceType"` + + // The type of traffic to log. + TrafficType *string `type:"string" required:"true" enum:"TrafficType"` + + metadataCreateFlowLogsInput `json:"-" xml:"-"` +} + +type metadataCreateFlowLogsInput struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s CreateFlowLogsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateFlowLogsInput) GoString() string { + return s.String() +} + +type CreateFlowLogsOutput struct { + // Unique, case-sensitive identifier you provide to ensure the idempotency of + // the request. + ClientToken *string `locationName:"clientToken" type:"string"` - metadataCreateDHCPOptionsOutput `json:"-" xml:"-"` + // The IDs of the flow logs. + FlowLogIds []*string `locationName:"flowLogIdSet" locationNameList:"item" type:"list"` + + // Information about the flow logs that could not be created successfully. + Unsuccessful []*UnsuccessfulItem `locationName:"unsuccessful" locationNameList:"item" type:"list"` + + metadataCreateFlowLogsOutput `json:"-" xml:"-"` } -type metadataCreateDHCPOptionsOutput struct { +type metadataCreateFlowLogsOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s CreateFlowLogsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateFlowLogsOutput) GoString() string { + return s.String() +} + type CreateImageInput struct { // Information about one or more block device mappings. BlockDeviceMappings []*BlockDeviceMapping `locationName:"blockDeviceMapping" locationNameList:"BlockDeviceMapping" type:"list"` @@ -8350,7 +8379,7 @@ type CreateImageInput struct { DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the instance. - InstanceID *string `locationName:"instanceId" type:"string" required:"true"` + InstanceId *string `locationName:"instanceId" type:"string" required:"true"` // A name for the new image. // @@ -8373,9 +8402,19 @@ type metadataCreateImageInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s CreateImageInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateImageInput) GoString() string { + return s.String() +} + type CreateImageOutput struct { // The ID of the new AMI. - ImageID *string `locationName:"imageId" type:"string"` + ImageId *string `locationName:"imageId" type:"string"` metadataCreateImageOutput `json:"-" xml:"-"` } @@ -8384,6 +8423,16 @@ type metadataCreateImageOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s CreateImageOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateImageOutput) GoString() string { + return s.String() +} + type CreateInstanceExportTaskInput struct { // A description for the conversion task or the resource being exported. The // maximum length is 255 bytes. @@ -8393,10 +8442,10 @@ type CreateInstanceExportTaskInput struct { ExportToS3Task *ExportToS3TaskSpecification `locationName:"exportToS3" type:"structure"` // The ID of the instance. - InstanceID *string `locationName:"instanceId" type:"string" required:"true"` + InstanceId *string `locationName:"instanceId" type:"string" required:"true"` // The target virtualization environment. - TargetEnvironment *string `locationName:"targetEnvironment" type:"string"` + TargetEnvironment *string `locationName:"targetEnvironment" type:"string" enum:"ExportEnvironment"` metadataCreateInstanceExportTaskInput `json:"-" xml:"-"` } @@ -8405,6 +8454,16 @@ type metadataCreateInstanceExportTaskInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s CreateInstanceExportTaskInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateInstanceExportTaskInput) GoString() string { + return s.String() +} + type CreateInstanceExportTaskOutput struct { // Information about the instance export task. ExportTask *ExportTask `locationName:"exportTask" type:"structure"` @@ -8416,6 +8475,16 @@ type metadataCreateInstanceExportTaskOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s CreateInstanceExportTaskOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateInstanceExportTaskOutput) GoString() string { + return s.String() +} + type CreateInternetGatewayInput struct { // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have @@ -8430,6 +8499,16 @@ type metadataCreateInternetGatewayInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s CreateInternetGatewayInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateInternetGatewayInput) GoString() string { + return s.String() +} + type CreateInternetGatewayOutput struct { // Information about the Internet gateway. InternetGateway *InternetGateway `locationName:"internetGateway" type:"structure"` @@ -8441,6 +8520,16 @@ type metadataCreateInternetGatewayOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s CreateInternetGatewayOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateInternetGatewayOutput) GoString() string { + return s.String() +} + type CreateKeyPairInput struct { // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have @@ -8460,6 +8549,16 @@ type metadataCreateKeyPairInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s CreateKeyPairInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateKeyPairInput) GoString() string { + return s.String() +} + // Describes a key pair. type CreateKeyPairOutput struct { // The SHA-1 digest of the DER encoded private key. @@ -8478,9 +8577,19 @@ type metadataCreateKeyPairOutput struct { SDKShapeTraits bool `type:"structure"` } -type CreateNetworkACLEntryInput struct { +// String returns the string representation +func (s CreateKeyPairOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateKeyPairOutput) GoString() string { + return s.String() +} + +type CreateNetworkAclEntryInput struct { // The network range to allow or deny, in CIDR notation (for example 172.16.0.0/24). - CIDRBlock *string `locationName:"cidrBlock" type:"string" required:"true"` + CidrBlock *string `locationName:"cidrBlock" type:"string" required:"true"` // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have @@ -8494,10 +8603,10 @@ type CreateNetworkACLEntryInput struct { // ICMP protocol: The ICMP type and code. Required if specifying ICMP for the // protocol. - ICMPTypeCode *ICMPTypeCode `locationName:"Icmp" type:"structure"` + IcmpTypeCode *IcmpTypeCode `locationName:"Icmp" type:"structure"` // The ID of the network ACL. - NetworkACLID *string `locationName:"networkAclId" type:"string" required:"true"` + NetworkAclId *string `locationName:"networkAclId" type:"string" required:"true"` // TCP or UDP protocols: The range of ports the rule applies to. PortRange *PortRange `locationName:"portRange" type:"structure"` @@ -8506,7 +8615,7 @@ type CreateNetworkACLEntryInput struct { Protocol *string `locationName:"protocol" type:"string" required:"true"` // Indicates whether to allow or deny the traffic that matches the rule. - RuleAction *string `locationName:"ruleAction" type:"string" required:"true"` + RuleAction *string `locationName:"ruleAction" type:"string" required:"true" enum:"RuleAction"` // The rule number for the entry (for example, 100). ACL entries are processed // in ascending order by rule number. @@ -8514,22 +8623,42 @@ type CreateNetworkACLEntryInput struct { // Constraints: Positive integer from 1 to 32766 RuleNumber *int64 `locationName:"ruleNumber" type:"integer" required:"true"` - metadataCreateNetworkACLEntryInput `json:"-" xml:"-"` + metadataCreateNetworkAclEntryInput `json:"-" xml:"-"` } -type metadataCreateNetworkACLEntryInput struct { +type metadataCreateNetworkAclEntryInput struct { SDKShapeTraits bool `type:"structure"` } -type CreateNetworkACLEntryOutput struct { - metadataCreateNetworkACLEntryOutput `json:"-" xml:"-"` +// String returns the string representation +func (s CreateNetworkAclEntryInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateNetworkAclEntryInput) GoString() string { + return s.String() +} + +type CreateNetworkAclEntryOutput struct { + metadataCreateNetworkAclEntryOutput `json:"-" xml:"-"` } -type metadataCreateNetworkACLEntryOutput struct { +type metadataCreateNetworkAclEntryOutput struct { SDKShapeTraits bool `type:"structure"` } -type CreateNetworkACLInput struct { +// String returns the string representation +func (s CreateNetworkAclEntryOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateNetworkAclEntryOutput) GoString() string { + return s.String() +} + +type CreateNetworkAclInput struct { // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have // the required permissions, the error response is DryRunOperation. Otherwise, @@ -8537,26 +8666,46 @@ type CreateNetworkACLInput struct { DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the VPC. - VPCID *string `locationName:"vpcId" type:"string" required:"true"` + VpcId *string `locationName:"vpcId" type:"string" required:"true"` - metadataCreateNetworkACLInput `json:"-" xml:"-"` + metadataCreateNetworkAclInput `json:"-" xml:"-"` } -type metadataCreateNetworkACLInput struct { +type metadataCreateNetworkAclInput struct { SDKShapeTraits bool `type:"structure"` } -type CreateNetworkACLOutput struct { +// String returns the string representation +func (s CreateNetworkAclInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateNetworkAclInput) GoString() string { + return s.String() +} + +type CreateNetworkAclOutput struct { // Information about the network ACL. - NetworkACL *NetworkACL `locationName:"networkAcl" type:"structure"` + NetworkAcl *NetworkAcl `locationName:"networkAcl" type:"structure"` - metadataCreateNetworkACLOutput `json:"-" xml:"-"` + metadataCreateNetworkAclOutput `json:"-" xml:"-"` } -type metadataCreateNetworkACLOutput struct { +type metadataCreateNetworkAclOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s CreateNetworkAclOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateNetworkAclOutput) GoString() string { + return s.String() +} + type CreateNetworkInterfaceInput struct { // A description for the network interface. Description *string `locationName:"description" type:"string"` @@ -8574,10 +8723,10 @@ type CreateNetworkInterfaceInput struct { // an IP address, Amazon EC2 selects one for you from the subnet range. If you // specify an IP address, you cannot indicate any IP addresses specified in // privateIpAddresses as primary (only one IP address can be designated as primary). - PrivateIPAddress *string `locationName:"privateIpAddress" type:"string"` + PrivateIpAddress *string `locationName:"privateIpAddress" type:"string"` // One or more private IP addresses. - PrivateIPAddresses []*PrivateIPAddressSpecification `locationName:"privateIpAddresses" locationNameList:"item" type:"list"` + PrivateIpAddresses []*PrivateIpAddressSpecification `locationName:"privateIpAddresses" locationNameList:"item" type:"list"` // The number of secondary private IP addresses to assign to a network interface. // When you specify a number of secondary IP addresses, Amazon EC2 selects these @@ -8588,10 +8737,10 @@ type CreateNetworkInterfaceInput struct { // by instance type. For more information, see Private IP Addresses Per ENI // Per Instance Type (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-eni.html#AvailableIpPerENI) // in the Amazon Elastic Compute Cloud User Guide. - SecondaryPrivateIPAddressCount *int64 `locationName:"secondaryPrivateIpAddressCount" type:"integer"` + SecondaryPrivateIpAddressCount *int64 `locationName:"secondaryPrivateIpAddressCount" type:"integer"` // The ID of the subnet to associate with the network interface. - SubnetID *string `locationName:"subnetId" type:"string" required:"true"` + SubnetId *string `locationName:"subnetId" type:"string" required:"true"` metadataCreateNetworkInterfaceInput `json:"-" xml:"-"` } @@ -8600,6 +8749,16 @@ type metadataCreateNetworkInterfaceInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s CreateNetworkInterfaceInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateNetworkInterfaceInput) GoString() string { + return s.String() +} + type CreateNetworkInterfaceOutput struct { // Information about the network interface. NetworkInterface *NetworkInterface `locationName:"networkInterface" type:"structure"` @@ -8611,6 +8770,16 @@ type metadataCreateNetworkInterfaceOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s CreateNetworkInterfaceOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateNetworkInterfaceOutput) GoString() string { + return s.String() +} + type CreatePlacementGroupInput struct { // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have @@ -8624,7 +8793,7 @@ type CreatePlacementGroupInput struct { GroupName *string `locationName:"groupName" type:"string" required:"true"` // The placement strategy. - Strategy *string `locationName:"strategy" type:"string" required:"true"` + Strategy *string `locationName:"strategy" type:"string" required:"true" enum:"PlacementStrategy"` metadataCreatePlacementGroupInput `json:"-" xml:"-"` } @@ -8633,6 +8802,16 @@ type metadataCreatePlacementGroupInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s CreatePlacementGroupInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreatePlacementGroupInput) GoString() string { + return s.String() +} + type CreatePlacementGroupOutput struct { metadataCreatePlacementGroupOutput `json:"-" xml:"-"` } @@ -8641,6 +8820,16 @@ type metadataCreatePlacementGroupOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s CreatePlacementGroupOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreatePlacementGroupOutput) GoString() string { + return s.String() +} + type CreateReservedInstancesListingInput struct { // Unique, case-sensitive identifier you provide to ensure idempotency of your // listings. This helps avoid duplicate listings. For more information, see @@ -8658,7 +8847,7 @@ type CreateReservedInstancesListingInput struct { PriceSchedules []*PriceScheduleSpecification `locationName:"priceSchedules" locationNameList:"item" type:"list" required:"true"` // The ID of the active Reserved Instance. - ReservedInstancesID *string `locationName:"reservedInstancesId" type:"string" required:"true"` + ReservedInstancesId *string `locationName:"reservedInstancesId" type:"string" required:"true"` metadataCreateReservedInstancesListingInput `json:"-" xml:"-"` } @@ -8667,6 +8856,16 @@ type metadataCreateReservedInstancesListingInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s CreateReservedInstancesListingInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateReservedInstancesListingInput) GoString() string { + return s.String() +} + type CreateReservedInstancesListingOutput struct { // Information about the Reserved Instances listing. ReservedInstancesListings []*ReservedInstancesListing `locationName:"reservedInstancesListingsSet" locationNameList:"item" type:"list"` @@ -8678,14 +8877,20 @@ type metadataCreateReservedInstancesListingOutput struct { SDKShapeTraits bool `type:"structure"` } -type CreateRouteInput struct { - // Unique, case-sensitive identifier you provide to ensure the idempotency of - // the request. For more information, see How to Ensure Idempotency (http://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). - ClientToken *string `locationName:"clientToken" type:"string"` +// String returns the string representation +func (s CreateReservedInstancesListingOutput) String() string { + return awsutil.Prettify(s) +} +// GoString returns the string representation +func (s CreateReservedInstancesListingOutput) GoString() string { + return s.String() +} + +type CreateRouteInput struct { // The CIDR address block used for the destination match. Routing decisions // are based on the most specific match. - DestinationCIDRBlock *string `locationName:"destinationCidrBlock" type:"string" required:"true"` + DestinationCidrBlock *string `locationName:"destinationCidrBlock" type:"string" required:"true"` // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have @@ -8695,20 +8900,20 @@ type CreateRouteInput struct { // The ID of an Internet gateway or virtual private gateway attached to your // VPC. - GatewayID *string `locationName:"gatewayId" type:"string"` + GatewayId *string `locationName:"gatewayId" type:"string"` // The ID of a NAT instance in your VPC. The operation fails if you specify // an instance ID unless exactly one network interface is attached. - InstanceID *string `locationName:"instanceId" type:"string"` + InstanceId *string `locationName:"instanceId" type:"string"` // The ID of a network interface. - NetworkInterfaceID *string `locationName:"networkInterfaceId" type:"string"` + NetworkInterfaceId *string `locationName:"networkInterfaceId" type:"string"` // The ID of the route table for the route. - RouteTableID *string `locationName:"routeTableId" type:"string" required:"true"` + RouteTableId *string `locationName:"routeTableId" type:"string" required:"true"` // The ID of a VPC peering connection. - VPCPeeringConnectionID *string `locationName:"vpcPeeringConnectionId" type:"string"` + VpcPeeringConnectionId *string `locationName:"vpcPeeringConnectionId" type:"string"` metadataCreateRouteInput `json:"-" xml:"-"` } @@ -8717,11 +8922,17 @@ type metadataCreateRouteInput struct { SDKShapeTraits bool `type:"structure"` } -type CreateRouteOutput struct { - // Unique, case-sensitive identifier you provide to ensure the idempotency of - // the request. - ClientToken *string `locationName:"clientToken" type:"string"` +// String returns the string representation +func (s CreateRouteInput) String() string { + return awsutil.Prettify(s) +} +// GoString returns the string representation +func (s CreateRouteInput) GoString() string { + return s.String() +} + +type CreateRouteOutput struct { // Returns true if the request succeeds; otherwise, it returns an error. Return *bool `locationName:"return" type:"boolean"` @@ -8732,6 +8943,16 @@ type metadataCreateRouteOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s CreateRouteOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateRouteOutput) GoString() string { + return s.String() +} + type CreateRouteTableInput struct { // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have @@ -8740,7 +8961,7 @@ type CreateRouteTableInput struct { DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the VPC. - VPCID *string `locationName:"vpcId" type:"string" required:"true"` + VpcId *string `locationName:"vpcId" type:"string" required:"true"` metadataCreateRouteTableInput `json:"-" xml:"-"` } @@ -8749,6 +8970,16 @@ type metadataCreateRouteTableInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s CreateRouteTableInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateRouteTableInput) GoString() string { + return s.String() +} + type CreateRouteTableOutput struct { // Information about the route table. RouteTable *RouteTable `locationName:"routeTable" type:"structure"` @@ -8760,6 +8991,16 @@ type metadataCreateRouteTableOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s CreateRouteTableOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateRouteTableOutput) GoString() string { + return s.String() +} + type CreateSecurityGroupInput struct { // A description for the security group. This is informational only. // @@ -8786,7 +9027,7 @@ type CreateSecurityGroupInput struct { GroupName *string `type:"string" required:"true"` // [EC2-VPC] The ID of the VPC. Required for EC2-VPC. - VPCID *string `locationName:"VpcId" type:"string"` + VpcId *string `type:"string"` metadataCreateSecurityGroupInput `json:"-" xml:"-"` } @@ -8795,9 +9036,19 @@ type metadataCreateSecurityGroupInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s CreateSecurityGroupInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateSecurityGroupInput) GoString() string { + return s.String() +} + type CreateSecurityGroupOutput struct { // The ID of the security group. - GroupID *string `locationName:"groupId" type:"string"` + GroupId *string `locationName:"groupId" type:"string"` metadataCreateSecurityGroupOutput `json:"-" xml:"-"` } @@ -8806,6 +9057,16 @@ type metadataCreateSecurityGroupOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s CreateSecurityGroupOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateSecurityGroupOutput) GoString() string { + return s.String() +} + type CreateSnapshotInput struct { // A description for the snapshot. Description *string `type:"string"` @@ -8817,7 +9078,7 @@ type CreateSnapshotInput struct { DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the EBS volume. - VolumeID *string `locationName:"VolumeId" type:"string" required:"true"` + VolumeId *string `type:"string" required:"true"` metadataCreateSnapshotInput `json:"-" xml:"-"` } @@ -8826,9 +9087,19 @@ type metadataCreateSnapshotInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s CreateSnapshotInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateSnapshotInput) GoString() string { + return s.String() +} + // Contains the parameters for CreateSpotDatafeedSubscription. type CreateSpotDatafeedSubscriptionInput struct { - // The Amazon S3 bucket in which to store the Spot Instance data feed. + // The Amazon S3 bucket in which to store the Spot instance data feed. Bucket *string `locationName:"bucket" type:"string" required:"true"` // Checks whether you have the required permissions for the action, without @@ -8847,9 +9118,19 @@ type metadataCreateSpotDatafeedSubscriptionInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s CreateSpotDatafeedSubscriptionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateSpotDatafeedSubscriptionInput) GoString() string { + return s.String() +} + // Contains the output of CreateSpotDatafeedSubscription. type CreateSpotDatafeedSubscriptionOutput struct { - // The Spot Instance data feed subscription. + // The Spot instance data feed subscription. SpotDatafeedSubscription *SpotDatafeedSubscription `locationName:"spotDatafeedSubscription" type:"structure"` metadataCreateSpotDatafeedSubscriptionOutput `json:"-" xml:"-"` @@ -8859,6 +9140,16 @@ type metadataCreateSpotDatafeedSubscriptionOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s CreateSpotDatafeedSubscriptionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateSpotDatafeedSubscriptionOutput) GoString() string { + return s.String() +} + type CreateSubnetInput struct { // The Availability Zone for the subnet. // @@ -8866,7 +9157,7 @@ type CreateSubnetInput struct { AvailabilityZone *string `type:"string"` // The network range for the subnet, in CIDR notation. For example, 10.0.0.0/24. - CIDRBlock *string `locationName:"CidrBlock" type:"string" required:"true"` + CidrBlock *string `type:"string" required:"true"` // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have @@ -8875,7 +9166,7 @@ type CreateSubnetInput struct { DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the VPC. - VPCID *string `locationName:"VpcId" type:"string" required:"true"` + VpcId *string `type:"string" required:"true"` metadataCreateSubnetInput `json:"-" xml:"-"` } @@ -8884,6 +9175,16 @@ type metadataCreateSubnetInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s CreateSubnetInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateSubnetInput) GoString() string { + return s.String() +} + type CreateSubnetOutput struct { // Information about the subnet. Subnet *Subnet `locationName:"subnet" type:"structure"` @@ -8895,7 +9196,17 @@ type metadataCreateSubnetOutput struct { SDKShapeTraits bool `type:"structure"` } -type CreateTagsInput struct { +// String returns the string representation +func (s CreateSubnetOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateSubnetOutput) GoString() string { + return s.String() +} + +type CreateTagsInput struct { // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have // the required permissions, the error response is DryRunOperation. Otherwise, @@ -8917,6 +9228,16 @@ type metadataCreateTagsInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s CreateTagsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateTagsInput) GoString() string { + return s.String() +} + type CreateTagsOutput struct { metadataCreateTagsOutput `json:"-" xml:"-"` } @@ -8925,7 +9246,144 @@ type metadataCreateTagsOutput struct { SDKShapeTraits bool `type:"structure"` } -type CreateVPCEndpointInput struct { +// String returns the string representation +func (s CreateTagsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateTagsOutput) GoString() string { + return s.String() +} + +type CreateVolumeInput struct { + // The Availability Zone in which to create the volume. Use DescribeAvailabilityZones + // to list the Availability Zones that are currently available to you. + AvailabilityZone *string `type:"string" required:"true"` + + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. + DryRun *bool `locationName:"dryRun" type:"boolean"` + + // Specifies whether the volume should be encrypted. Encrypted Amazon EBS volumes + // may only be attached to instances that support Amazon EBS encryption. Volumes + // that are created from encrypted snapshots are automatically encrypted. There + // is no way to create an encrypted volume from an unencrypted snapshot or vice + // versa. If your AMI uses encrypted volumes, you can only launch it on supported + // instance types. For more information, see Amazon EBS Encryption (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html) + // in the Amazon Elastic Compute Cloud User Guide. + Encrypted *bool `locationName:"encrypted" type:"boolean"` + + // Only valid for Provisioned IOPS (SSD) volumes. The number of I/O operations + // per second (IOPS) to provision for the volume, with a maximum ratio of 30 + // IOPS/GiB. + // + // Constraint: Range is 100 to 20000 for Provisioned IOPS (SSD) volumes + Iops *int64 `type:"integer"` + + // The full ARN of the AWS Key Management Service (AWS KMS) customer master + // key (CMK) to use when creating the encrypted volume. This parameter is only + // required if you want to use a non-default CMK; if this parameter is not specified, + // the default CMK for EBS is used. The ARN contains the arn:aws:kms namespace, + // followed by the region of the CMK, the AWS account ID of the CMK owner, the + // key namespace, and then the CMK ID. For example, arn:aws:kms:us-east-1:012345678910:key/abcd1234-a123-456a-a12b-a123b4cd56ef. + // If a KmsKeyId is specified, the Encrypted flag must also be set. + KmsKeyId *string `type:"string"` + + // The size of the volume, in GiBs. + // + // Constraints: 1-1024 for standard volumes, 1-16384 for gp2 volumes, and 4-16384 + // for io1 volumes. If you specify a snapshot, the volume size must be equal + // to or larger than the snapshot size. + // + // Default: If you're creating the volume from a snapshot and don't specify + // a volume size, the default is the snapshot size. + Size *int64 `type:"integer"` + + // The snapshot from which to create the volume. + SnapshotId *string `type:"string"` + + // The volume type. This can be gp2 for General Purpose (SSD) volumes, io1 for + // Provisioned IOPS (SSD) volumes, or standard for Magnetic volumes. + // + // Default: standard + VolumeType *string `type:"string" enum:"VolumeType"` + + metadataCreateVolumeInput `json:"-" xml:"-"` +} + +type metadataCreateVolumeInput struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s CreateVolumeInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateVolumeInput) GoString() string { + return s.String() +} + +// Describes the user or group to be added or removed from the permissions for +// a volume. +type CreateVolumePermission struct { + // The specific group that is to be added or removed from a volume's list of + // create volume permissions. + Group *string `locationName:"group" type:"string" enum:"PermissionGroup"` + + // The specific AWS account ID that is to be added or removed from a volume's + // list of create volume permissions. + UserId *string `locationName:"userId" type:"string"` + + metadataCreateVolumePermission `json:"-" xml:"-"` +} + +type metadataCreateVolumePermission struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s CreateVolumePermission) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateVolumePermission) GoString() string { + return s.String() +} + +// Describes modifications to the permissions for a volume. +type CreateVolumePermissionModifications struct { + // Adds a specific AWS account ID or group to a volume's list of create volume + // permissions. + Add []*CreateVolumePermission `locationNameList:"item" type:"list"` + + // Removes a specific AWS account ID or group from a volume's list of create + // volume permissions. + Remove []*CreateVolumePermission `locationNameList:"item" type:"list"` + + metadataCreateVolumePermissionModifications `json:"-" xml:"-"` +} + +type metadataCreateVolumePermissionModifications struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s CreateVolumePermissionModifications) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateVolumePermissionModifications) GoString() string { + return s.String() +} + +type CreateVpcEndpointInput struct { // Unique, case-sensitive identifier you provide to ensure the idempotency of // the request. For more information, see How to Ensure Idempotency (http://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). ClientToken *string `type:"string"` @@ -8942,40 +9400,60 @@ type CreateVPCEndpointInput struct { PolicyDocument *string `type:"string"` // One or more route table IDs. - RouteTableIDs []*string `locationName:"RouteTableId" locationNameList:"item" type:"list"` + RouteTableIds []*string `locationName:"RouteTableId" locationNameList:"item" type:"list"` - // The AWS service name, in the form com.amazonaws... To get - // a list of available services, use the DescribeVpcEndpointServices request. + // The AWS service name, in the form com.amazonaws.region.service. To get a + // list of available services, use the DescribeVpcEndpointServices request. ServiceName *string `type:"string" required:"true"` // The ID of the VPC in which the endpoint will be used. - VPCID *string `locationName:"VpcId" type:"string" required:"true"` + VpcId *string `type:"string" required:"true"` - metadataCreateVPCEndpointInput `json:"-" xml:"-"` + metadataCreateVpcEndpointInput `json:"-" xml:"-"` } -type metadataCreateVPCEndpointInput struct { +type metadataCreateVpcEndpointInput struct { SDKShapeTraits bool `type:"structure"` } -type CreateVPCEndpointOutput struct { +// String returns the string representation +func (s CreateVpcEndpointInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateVpcEndpointInput) GoString() string { + return s.String() +} + +type CreateVpcEndpointOutput struct { // Unique, case-sensitive identifier you provide to ensure the idempotency of // the request. ClientToken *string `locationName:"clientToken" type:"string"` // Information about the endpoint. - VPCEndpoint *VPCEndpoint `locationName:"vpcEndpoint" type:"structure"` + VpcEndpoint *VpcEndpoint `locationName:"vpcEndpoint" type:"structure"` - metadataCreateVPCEndpointOutput `json:"-" xml:"-"` + metadataCreateVpcEndpointOutput `json:"-" xml:"-"` } -type metadataCreateVPCEndpointOutput struct { +type metadataCreateVpcEndpointOutput struct { SDKShapeTraits bool `type:"structure"` } -type CreateVPCInput struct { +// String returns the string representation +func (s CreateVpcEndpointOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateVpcEndpointOutput) GoString() string { + return s.String() +} + +type CreateVpcInput struct { // The network range for the VPC, in CIDR notation. For example, 10.0.0.0/16. - CIDRBlock *string `locationName:"CidrBlock" type:"string" required:"true"` + CidrBlock *string `type:"string" required:"true"` // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have @@ -8990,27 +9468,47 @@ type CreateVPCInput struct { // Dedicated tenancy instances run on single-tenant hardware. // // Default: default - InstanceTenancy *string `locationName:"instanceTenancy" type:"string"` + InstanceTenancy *string `locationName:"instanceTenancy" type:"string" enum:"Tenancy"` - metadataCreateVPCInput `json:"-" xml:"-"` + metadataCreateVpcInput `json:"-" xml:"-"` } -type metadataCreateVPCInput struct { +type metadataCreateVpcInput struct { SDKShapeTraits bool `type:"structure"` } -type CreateVPCOutput struct { +// String returns the string representation +func (s CreateVpcInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateVpcInput) GoString() string { + return s.String() +} + +type CreateVpcOutput struct { // Information about the VPC. - VPC *VPC `locationName:"vpc" type:"structure"` + Vpc *Vpc `locationName:"vpc" type:"structure"` - metadataCreateVPCOutput `json:"-" xml:"-"` + metadataCreateVpcOutput `json:"-" xml:"-"` } -type metadataCreateVPCOutput struct { +type metadataCreateVpcOutput struct { SDKShapeTraits bool `type:"structure"` } -type CreateVPCPeeringConnectionInput struct { +// String returns the string representation +func (s CreateVpcOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateVpcOutput) GoString() string { + return s.String() +} + +type CreateVpcPeeringConnectionInput struct { // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have // the required permissions, the error response is DryRunOperation. Otherwise, @@ -9020,35 +9518,55 @@ type CreateVPCPeeringConnectionInput struct { // The AWS account ID of the owner of the peer VPC. // // Default: Your AWS account ID - PeerOwnerID *string `locationName:"peerOwnerId" type:"string"` + PeerOwnerId *string `locationName:"peerOwnerId" type:"string"` // The ID of the VPC with which you are creating the VPC peering connection. - PeerVPCID *string `locationName:"peerVpcId" type:"string"` + PeerVpcId *string `locationName:"peerVpcId" type:"string"` // The ID of the requester VPC. - VPCID *string `locationName:"vpcId" type:"string"` + VpcId *string `locationName:"vpcId" type:"string"` - metadataCreateVPCPeeringConnectionInput `json:"-" xml:"-"` + metadataCreateVpcPeeringConnectionInput `json:"-" xml:"-"` } -type metadataCreateVPCPeeringConnectionInput struct { +type metadataCreateVpcPeeringConnectionInput struct { SDKShapeTraits bool `type:"structure"` } -type CreateVPCPeeringConnectionOutput struct { +// String returns the string representation +func (s CreateVpcPeeringConnectionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateVpcPeeringConnectionInput) GoString() string { + return s.String() +} + +type CreateVpcPeeringConnectionOutput struct { // Information about the VPC peering connection. - VPCPeeringConnection *VPCPeeringConnection `locationName:"vpcPeeringConnection" type:"structure"` + VpcPeeringConnection *VpcPeeringConnection `locationName:"vpcPeeringConnection" type:"structure"` - metadataCreateVPCPeeringConnectionOutput `json:"-" xml:"-"` + metadataCreateVpcPeeringConnectionOutput `json:"-" xml:"-"` } -type metadataCreateVPCPeeringConnectionOutput struct { +type metadataCreateVpcPeeringConnectionOutput struct { SDKShapeTraits bool `type:"structure"` } -type CreateVPNConnectionInput struct { +// String returns the string representation +func (s CreateVpcPeeringConnectionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateVpcPeeringConnectionOutput) GoString() string { + return s.String() +} + +type CreateVpnConnectionInput struct { // The ID of the customer gateway. - CustomerGatewayID *string `locationName:"CustomerGatewayId" type:"string" required:"true"` + CustomerGatewayId *string `type:"string" required:"true"` // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have @@ -9061,89 +9579,97 @@ type CreateVPNConnectionInput struct { // true. // // Default: false - Options *VPNConnectionOptionsSpecification `locationName:"options" type:"structure"` + Options *VpnConnectionOptionsSpecification `locationName:"options" type:"structure"` // The type of VPN connection (ipsec.1). Type *string `type:"string" required:"true"` // The ID of the virtual private gateway. - VPNGatewayID *string `locationName:"VpnGatewayId" type:"string" required:"true"` + VpnGatewayId *string `type:"string" required:"true"` - metadataCreateVPNConnectionInput `json:"-" xml:"-"` + metadataCreateVpnConnectionInput `json:"-" xml:"-"` } -type metadataCreateVPNConnectionInput struct { +type metadataCreateVpnConnectionInput struct { SDKShapeTraits bool `type:"structure"` } -type CreateVPNConnectionOutput struct { +// String returns the string representation +func (s CreateVpnConnectionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateVpnConnectionInput) GoString() string { + return s.String() +} + +type CreateVpnConnectionOutput struct { // Information about the VPN connection. - VPNConnection *VPNConnection `locationName:"vpnConnection" type:"structure"` + VpnConnection *VpnConnection `locationName:"vpnConnection" type:"structure"` - metadataCreateVPNConnectionOutput `json:"-" xml:"-"` + metadataCreateVpnConnectionOutput `json:"-" xml:"-"` } -type metadataCreateVPNConnectionOutput struct { +type metadataCreateVpnConnectionOutput struct { SDKShapeTraits bool `type:"structure"` } -type CreateVPNConnectionRouteInput struct { +// String returns the string representation +func (s CreateVpnConnectionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateVpnConnectionOutput) GoString() string { + return s.String() +} + +type CreateVpnConnectionRouteInput struct { // The CIDR block associated with the local subnet of the customer network. - DestinationCIDRBlock *string `locationName:"DestinationCidrBlock" type:"string" required:"true"` + DestinationCidrBlock *string `type:"string" required:"true"` // The ID of the VPN connection. - VPNConnectionID *string `locationName:"VpnConnectionId" type:"string" required:"true"` + VpnConnectionId *string `type:"string" required:"true"` - metadataCreateVPNConnectionRouteInput `json:"-" xml:"-"` + metadataCreateVpnConnectionRouteInput `json:"-" xml:"-"` } -type metadataCreateVPNConnectionRouteInput struct { +type metadataCreateVpnConnectionRouteInput struct { SDKShapeTraits bool `type:"structure"` } -type CreateVPNConnectionRouteOutput struct { - metadataCreateVPNConnectionRouteOutput `json:"-" xml:"-"` +// String returns the string representation +func (s CreateVpnConnectionRouteInput) String() string { + return awsutil.Prettify(s) } -type metadataCreateVPNConnectionRouteOutput struct { - SDKShapeTraits bool `type:"structure"` +// GoString returns the string representation +func (s CreateVpnConnectionRouteInput) GoString() string { + return s.String() } -type CreateVPNGatewayInput struct { - // The Availability Zone for the virtual private gateway. - AvailabilityZone *string `type:"string"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The type of VPN connection this virtual private gateway supports. - Type *string `type:"string" required:"true"` - - metadataCreateVPNGatewayInput `json:"-" xml:"-"` +type CreateVpnConnectionRouteOutput struct { + metadataCreateVpnConnectionRouteOutput `json:"-" xml:"-"` } -type metadataCreateVPNGatewayInput struct { +type metadataCreateVpnConnectionRouteOutput struct { SDKShapeTraits bool `type:"structure"` } -type CreateVPNGatewayOutput struct { - // Information about the virtual private gateway. - VPNGateway *VPNGateway `locationName:"vpnGateway" type:"structure"` - - metadataCreateVPNGatewayOutput `json:"-" xml:"-"` +// String returns the string representation +func (s CreateVpnConnectionRouteOutput) String() string { + return awsutil.Prettify(s) } -type metadataCreateVPNGatewayOutput struct { - SDKShapeTraits bool `type:"structure"` +// GoString returns the string representation +func (s CreateVpnConnectionRouteOutput) GoString() string { + return s.String() } -type CreateVolumeInput struct { - // The Availability Zone in which to create the volume. Use DescribeAvailabilityZones - // to list the Availability Zones that are currently available to you. - AvailabilityZone *string `type:"string" required:"true"` +type CreateVpnGatewayInput struct { + // The Availability Zone for the virtual private gateway. + AvailabilityZone *string `type:"string"` // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have @@ -9151,102 +9677,58 @@ type CreateVolumeInput struct { // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` - // Specifies whether the volume should be encrypted. Encrypted Amazon EBS volumes - // may only be attached to instances that support Amazon EBS encryption. Volumes - // that are created from encrypted snapshots are automatically encrypted. There - // is no way to create an encrypted volume from an unencrypted snapshot or vice - // versa. If your AMI uses encrypted volumes, you can only launch it on supported - // instance types. For more information, see Amazon EBS Encryption (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html) - // in the Amazon Elastic Compute Cloud User Guide. - Encrypted *bool `locationName:"encrypted" type:"boolean"` - - // Only valid for Provisioned IOPS (SSD) volumes. The number of I/O operations - // per second (IOPS) to provision for the volume, with a maximum ratio of 30 - // IOPS/GiB. - // - // Constraint: Range is 100 to 20000 for Provisioned IOPS (SSD) volumes - IOPS *int64 `locationName:"Iops" type:"integer"` - - // The full ARN of the AWS Key Management Service (KMS) master key to use when - // creating the encrypted volume. This parameter is only required if you want - // to use a non-default master key; if this parameter is not specified, the - // default master key is used. The ARN contains the arn:aws:kms namespace, followed - // by the region of the master key, the AWS account ID of the master key owner, - // the key namespace, and then the master key ID. For example, arn:aws:kms:us-east-1:012345678910:key/abcd1234-a123-456a-a12b-a123b4cd56ef. - KMSKeyID *string `locationName:"KmsKeyId" type:"string"` - - // The size of the volume, in GiBs. - // - // Constraints: 1-1024 for standard volumes, 1-16384 for gp2 volumes, and 4-16384 - // for io1 volumes. If you specify a snapshot, the volume size must be equal - // to or larger than the snapshot size. - // - // Default: If you're creating the volume from a snapshot and don't specify - // a volume size, the default is the snapshot size. - Size *int64 `type:"integer"` - - // The snapshot from which to create the volume. - SnapshotID *string `locationName:"SnapshotId" type:"string"` - - // The volume type. This can be gp2 for General Purpose (SSD) volumes, io1 for - // Provisioned IOPS (SSD) volumes, or standard for Magnetic volumes. - // - // Default: standard - VolumeType *string `type:"string"` + // The type of VPN connection this virtual private gateway supports. + Type *string `type:"string" required:"true" enum:"GatewayType"` - metadataCreateVolumeInput `json:"-" xml:"-"` + metadataCreateVpnGatewayInput `json:"-" xml:"-"` } -type metadataCreateVolumeInput struct { +type metadataCreateVpnGatewayInput struct { SDKShapeTraits bool `type:"structure"` } -// Describes the user or group to be added or removed from the permissions for -// a volume. -type CreateVolumePermission struct { - // The specific group that is to be added or removed from a volume's list of - // create volume permissions. - Group *string `locationName:"group" type:"string"` +// String returns the string representation +func (s CreateVpnGatewayInput) String() string { + return awsutil.Prettify(s) +} - // The specific AWS account ID that is to be added or removed from a volume's - // list of create volume permissions. - UserID *string `locationName:"userId" type:"string"` +// GoString returns the string representation +func (s CreateVpnGatewayInput) GoString() string { + return s.String() +} - metadataCreateVolumePermission `json:"-" xml:"-"` +type CreateVpnGatewayOutput struct { + // Information about the virtual private gateway. + VpnGateway *VpnGateway `locationName:"vpnGateway" type:"structure"` + + metadataCreateVpnGatewayOutput `json:"-" xml:"-"` } -type metadataCreateVolumePermission struct { +type metadataCreateVpnGatewayOutput struct { SDKShapeTraits bool `type:"structure"` } -// Describes modifications to the permissions for a volume. -type CreateVolumePermissionModifications struct { - // Adds a specific AWS account ID or group to a volume's list of create volume - // permissions. - Add []*CreateVolumePermission `locationNameList:"item" type:"list"` - - // Removes a specific AWS account ID or group from a volume's list of create - // volume permissions. - Remove []*CreateVolumePermission `locationNameList:"item" type:"list"` - - metadataCreateVolumePermissionModifications `json:"-" xml:"-"` +// String returns the string representation +func (s CreateVpnGatewayOutput) String() string { + return awsutil.Prettify(s) } -type metadataCreateVolumePermissionModifications struct { - SDKShapeTraits bool `type:"structure"` +// GoString returns the string representation +func (s CreateVpnGatewayOutput) GoString() string { + return s.String() } // Describes a customer gateway. type CustomerGateway struct { // The customer gateway's Border Gateway Protocol (BGP) Autonomous System Number // (ASN). - BGPASN *string `locationName:"bgpAsn" type:"string"` + BgpAsn *string `locationName:"bgpAsn" type:"string"` // The ID of the customer gateway. - CustomerGatewayID *string `locationName:"customerGatewayId" type:"string"` + CustomerGatewayId *string `locationName:"customerGatewayId" type:"string"` // The Internet-routable IP address of the customer gateway's outside interface. - IPAddress *string `locationName:"ipAddress" type:"string"` + IpAddress *string `locationName:"ipAddress" type:"string"` // The current state of the customer gateway (pending | available | deleting // | deleted). @@ -9265,42 +9747,19 @@ type metadataCustomerGateway struct { SDKShapeTraits bool `type:"structure"` } -// Describes a DHCP configuration option. -type DHCPConfiguration struct { - // The name of a DHCP option. - Key *string `locationName:"key" type:"string"` - - // One or more values for the DHCP option. - Values []*AttributeValue `locationName:"valueSet" locationNameList:"item" type:"list"` - - metadataDHCPConfiguration `json:"-" xml:"-"` -} - -type metadataDHCPConfiguration struct { - SDKShapeTraits bool `type:"structure"` -} - -// Describes a set of DHCP options. -type DHCPOptions struct { - // One or more DHCP options in the set. - DHCPConfigurations []*DHCPConfiguration `locationName:"dhcpConfigurationSet" locationNameList:"item" type:"list"` - - // The ID of the set of DHCP options. - DHCPOptionsID *string `locationName:"dhcpOptionsId" type:"string"` - - // Any tags assigned to the DHCP options set. - Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` - - metadataDHCPOptions `json:"-" xml:"-"` +// String returns the string representation +func (s CustomerGateway) String() string { + return awsutil.Prettify(s) } -type metadataDHCPOptions struct { - SDKShapeTraits bool `type:"structure"` +// GoString returns the string representation +func (s CustomerGateway) GoString() string { + return s.String() } type DeleteCustomerGatewayInput struct { // The ID of the customer gateway. - CustomerGatewayID *string `locationName:"CustomerGatewayId" type:"string" required:"true"` + CustomerGatewayId *string `type:"string" required:"true"` // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have @@ -9315,6 +9774,16 @@ type metadataDeleteCustomerGatewayInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DeleteCustomerGatewayInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteCustomerGatewayInput) GoString() string { + return s.String() +} + type DeleteCustomerGatewayOutput struct { metadataDeleteCustomerGatewayOutput `json:"-" xml:"-"` } @@ -9323,9 +9792,19 @@ type metadataDeleteCustomerGatewayOutput struct { SDKShapeTraits bool `type:"structure"` } -type DeleteDHCPOptionsInput struct { +// String returns the string representation +func (s DeleteCustomerGatewayOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteCustomerGatewayOutput) GoString() string { + return s.String() +} + +type DeleteDhcpOptionsInput struct { // The ID of the DHCP options set. - DHCPOptionsID *string `locationName:"DhcpOptionsId" type:"string" required:"true"` + DhcpOptionsId *string `type:"string" required:"true"` // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have @@ -9333,30 +9812,92 @@ type DeleteDHCPOptionsInput struct { // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` - metadataDeleteDHCPOptionsInput `json:"-" xml:"-"` + metadataDeleteDhcpOptionsInput `json:"-" xml:"-"` } -type metadataDeleteDHCPOptionsInput struct { +type metadataDeleteDhcpOptionsInput struct { SDKShapeTraits bool `type:"structure"` } -type DeleteDHCPOptionsOutput struct { - metadataDeleteDHCPOptionsOutput `json:"-" xml:"-"` +// String returns the string representation +func (s DeleteDhcpOptionsInput) String() string { + return awsutil.Prettify(s) } -type metadataDeleteDHCPOptionsOutput struct { - SDKShapeTraits bool `type:"structure"` +// GoString returns the string representation +func (s DeleteDhcpOptionsInput) GoString() string { + return s.String() } -type DeleteInternetGatewayInput struct { - // Checks whether you have the required permissions for the action, without +type DeleteDhcpOptionsOutput struct { + metadataDeleteDhcpOptionsOutput `json:"-" xml:"-"` +} + +type metadataDeleteDhcpOptionsOutput struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s DeleteDhcpOptionsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteDhcpOptionsOutput) GoString() string { + return s.String() +} + +type DeleteFlowLogsInput struct { + // One or more flow log IDs. + FlowLogIds []*string `locationName:"FlowLogId" locationNameList:"item" type:"list" required:"true"` + + metadataDeleteFlowLogsInput `json:"-" xml:"-"` +} + +type metadataDeleteFlowLogsInput struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s DeleteFlowLogsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteFlowLogsInput) GoString() string { + return s.String() +} + +type DeleteFlowLogsOutput struct { + // Information about the flow logs that could not be deleted successfully. + Unsuccessful []*UnsuccessfulItem `locationName:"unsuccessful" locationNameList:"item" type:"list"` + + metadataDeleteFlowLogsOutput `json:"-" xml:"-"` +} + +type metadataDeleteFlowLogsOutput struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s DeleteFlowLogsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteFlowLogsOutput) GoString() string { + return s.String() +} + +type DeleteInternetGatewayInput struct { + // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have // the required permissions, the error response is DryRunOperation. Otherwise, // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the Internet gateway. - InternetGatewayID *string `locationName:"internetGatewayId" type:"string" required:"true"` + InternetGatewayId *string `locationName:"internetGatewayId" type:"string" required:"true"` metadataDeleteInternetGatewayInput `json:"-" xml:"-"` } @@ -9365,6 +9906,16 @@ type metadataDeleteInternetGatewayInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DeleteInternetGatewayInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteInternetGatewayInput) GoString() string { + return s.String() +} + type DeleteInternetGatewayOutput struct { metadataDeleteInternetGatewayOutput `json:"-" xml:"-"` } @@ -9373,6 +9924,16 @@ type metadataDeleteInternetGatewayOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DeleteInternetGatewayOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteInternetGatewayOutput) GoString() string { + return s.String() +} + type DeleteKeyPairInput struct { // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have @@ -9390,6 +9951,16 @@ type metadataDeleteKeyPairInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DeleteKeyPairInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteKeyPairInput) GoString() string { + return s.String() +} + type DeleteKeyPairOutput struct { metadataDeleteKeyPairOutput `json:"-" xml:"-"` } @@ -9398,7 +9969,17 @@ type metadataDeleteKeyPairOutput struct { SDKShapeTraits bool `type:"structure"` } -type DeleteNetworkACLEntryInput struct { +// String returns the string representation +func (s DeleteKeyPairOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteKeyPairOutput) GoString() string { + return s.String() +} + +type DeleteNetworkAclEntryInput struct { // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have // the required permissions, the error response is DryRunOperation. Otherwise, @@ -9409,27 +9990,47 @@ type DeleteNetworkACLEntryInput struct { Egress *bool `locationName:"egress" type:"boolean" required:"true"` // The ID of the network ACL. - NetworkACLID *string `locationName:"networkAclId" type:"string" required:"true"` + NetworkAclId *string `locationName:"networkAclId" type:"string" required:"true"` // The rule number of the entry to delete. RuleNumber *int64 `locationName:"ruleNumber" type:"integer" required:"true"` - metadataDeleteNetworkACLEntryInput `json:"-" xml:"-"` + metadataDeleteNetworkAclEntryInput `json:"-" xml:"-"` } -type metadataDeleteNetworkACLEntryInput struct { +type metadataDeleteNetworkAclEntryInput struct { SDKShapeTraits bool `type:"structure"` } -type DeleteNetworkACLEntryOutput struct { - metadataDeleteNetworkACLEntryOutput `json:"-" xml:"-"` +// String returns the string representation +func (s DeleteNetworkAclEntryInput) String() string { + return awsutil.Prettify(s) } -type metadataDeleteNetworkACLEntryOutput struct { +// GoString returns the string representation +func (s DeleteNetworkAclEntryInput) GoString() string { + return s.String() +} + +type DeleteNetworkAclEntryOutput struct { + metadataDeleteNetworkAclEntryOutput `json:"-" xml:"-"` +} + +type metadataDeleteNetworkAclEntryOutput struct { SDKShapeTraits bool `type:"structure"` } -type DeleteNetworkACLInput struct { +// String returns the string representation +func (s DeleteNetworkAclEntryOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteNetworkAclEntryOutput) GoString() string { + return s.String() +} + +type DeleteNetworkAclInput struct { // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have // the required permissions, the error response is DryRunOperation. Otherwise, @@ -9437,23 +10038,43 @@ type DeleteNetworkACLInput struct { DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the network ACL. - NetworkACLID *string `locationName:"networkAclId" type:"string" required:"true"` + NetworkAclId *string `locationName:"networkAclId" type:"string" required:"true"` - metadataDeleteNetworkACLInput `json:"-" xml:"-"` + metadataDeleteNetworkAclInput `json:"-" xml:"-"` } -type metadataDeleteNetworkACLInput struct { +type metadataDeleteNetworkAclInput struct { SDKShapeTraits bool `type:"structure"` } -type DeleteNetworkACLOutput struct { - metadataDeleteNetworkACLOutput `json:"-" xml:"-"` +// String returns the string representation +func (s DeleteNetworkAclInput) String() string { + return awsutil.Prettify(s) } -type metadataDeleteNetworkACLOutput struct { +// GoString returns the string representation +func (s DeleteNetworkAclInput) GoString() string { + return s.String() +} + +type DeleteNetworkAclOutput struct { + metadataDeleteNetworkAclOutput `json:"-" xml:"-"` +} + +type metadataDeleteNetworkAclOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DeleteNetworkAclOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteNetworkAclOutput) GoString() string { + return s.String() +} + type DeleteNetworkInterfaceInput struct { // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have @@ -9462,7 +10083,7 @@ type DeleteNetworkInterfaceInput struct { DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the network interface. - NetworkInterfaceID *string `locationName:"networkInterfaceId" type:"string" required:"true"` + NetworkInterfaceId *string `locationName:"networkInterfaceId" type:"string" required:"true"` metadataDeleteNetworkInterfaceInput `json:"-" xml:"-"` } @@ -9471,6 +10092,16 @@ type metadataDeleteNetworkInterfaceInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DeleteNetworkInterfaceInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteNetworkInterfaceInput) GoString() string { + return s.String() +} + type DeleteNetworkInterfaceOutput struct { metadataDeleteNetworkInterfaceOutput `json:"-" xml:"-"` } @@ -9479,6 +10110,16 @@ type metadataDeleteNetworkInterfaceOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DeleteNetworkInterfaceOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteNetworkInterfaceOutput) GoString() string { + return s.String() +} + type DeletePlacementGroupInput struct { // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have @@ -9496,6 +10137,16 @@ type metadataDeletePlacementGroupInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DeletePlacementGroupInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeletePlacementGroupInput) GoString() string { + return s.String() +} + type DeletePlacementGroupOutput struct { metadataDeletePlacementGroupOutput `json:"-" xml:"-"` } @@ -9504,10 +10155,20 @@ type metadataDeletePlacementGroupOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DeletePlacementGroupOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeletePlacementGroupOutput) GoString() string { + return s.String() +} + type DeleteRouteInput struct { // The CIDR range for the route. The value you specify must match the CIDR for // the route exactly. - DestinationCIDRBlock *string `locationName:"destinationCidrBlock" type:"string" required:"true"` + DestinationCidrBlock *string `locationName:"destinationCidrBlock" type:"string" required:"true"` // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have @@ -9516,7 +10177,7 @@ type DeleteRouteInput struct { DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the route table. - RouteTableID *string `locationName:"routeTableId" type:"string" required:"true"` + RouteTableId *string `locationName:"routeTableId" type:"string" required:"true"` metadataDeleteRouteInput `json:"-" xml:"-"` } @@ -9525,6 +10186,16 @@ type metadataDeleteRouteInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DeleteRouteInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteRouteInput) GoString() string { + return s.String() +} + type DeleteRouteOutput struct { metadataDeleteRouteOutput `json:"-" xml:"-"` } @@ -9533,6 +10204,16 @@ type metadataDeleteRouteOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DeleteRouteOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteRouteOutput) GoString() string { + return s.String() +} + type DeleteRouteTableInput struct { // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have @@ -9541,7 +10222,7 @@ type DeleteRouteTableInput struct { DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the route table. - RouteTableID *string `locationName:"routeTableId" type:"string" required:"true"` + RouteTableId *string `locationName:"routeTableId" type:"string" required:"true"` metadataDeleteRouteTableInput `json:"-" xml:"-"` } @@ -9550,6 +10231,16 @@ type metadataDeleteRouteTableInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DeleteRouteTableInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteRouteTableInput) GoString() string { + return s.String() +} + type DeleteRouteTableOutput struct { metadataDeleteRouteTableOutput `json:"-" xml:"-"` } @@ -9558,6 +10249,16 @@ type metadataDeleteRouteTableOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DeleteRouteTableOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteRouteTableOutput) GoString() string { + return s.String() +} + type DeleteSecurityGroupInput struct { // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have @@ -9566,7 +10267,7 @@ type DeleteSecurityGroupInput struct { DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the security group. Required for a nondefault VPC. - GroupID *string `locationName:"GroupId" type:"string"` + GroupId *string `type:"string"` // [EC2-Classic, default VPC] The name of the security group. You can specify // either the security group name or the security group ID. @@ -9579,6 +10280,16 @@ type metadataDeleteSecurityGroupInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DeleteSecurityGroupInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteSecurityGroupInput) GoString() string { + return s.String() +} + type DeleteSecurityGroupOutput struct { metadataDeleteSecurityGroupOutput `json:"-" xml:"-"` } @@ -9587,6 +10298,16 @@ type metadataDeleteSecurityGroupOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DeleteSecurityGroupOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteSecurityGroupOutput) GoString() string { + return s.String() +} + type DeleteSnapshotInput struct { // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have @@ -9595,7 +10316,7 @@ type DeleteSnapshotInput struct { DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the EBS snapshot. - SnapshotID *string `locationName:"SnapshotId" type:"string" required:"true"` + SnapshotId *string `type:"string" required:"true"` metadataDeleteSnapshotInput `json:"-" xml:"-"` } @@ -9604,6 +10325,16 @@ type metadataDeleteSnapshotInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DeleteSnapshotInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteSnapshotInput) GoString() string { + return s.String() +} + type DeleteSnapshotOutput struct { metadataDeleteSnapshotOutput `json:"-" xml:"-"` } @@ -9612,6 +10343,16 @@ type metadataDeleteSnapshotOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DeleteSnapshotOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteSnapshotOutput) GoString() string { + return s.String() +} + // Contains the parameters for DeleteSpotDatafeedSubscription. type DeleteSpotDatafeedSubscriptionInput struct { // Checks whether you have the required permissions for the action, without @@ -9627,6 +10368,16 @@ type metadataDeleteSpotDatafeedSubscriptionInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DeleteSpotDatafeedSubscriptionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteSpotDatafeedSubscriptionInput) GoString() string { + return s.String() +} + type DeleteSpotDatafeedSubscriptionOutput struct { metadataDeleteSpotDatafeedSubscriptionOutput `json:"-" xml:"-"` } @@ -9635,6 +10386,16 @@ type metadataDeleteSpotDatafeedSubscriptionOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DeleteSpotDatafeedSubscriptionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteSpotDatafeedSubscriptionOutput) GoString() string { + return s.String() +} + type DeleteSubnetInput struct { // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have @@ -9643,7 +10404,7 @@ type DeleteSubnetInput struct { DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the subnet. - SubnetID *string `locationName:"SubnetId" type:"string" required:"true"` + SubnetId *string `type:"string" required:"true"` metadataDeleteSubnetInput `json:"-" xml:"-"` } @@ -9652,6 +10413,16 @@ type metadataDeleteSubnetInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DeleteSubnetInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteSubnetInput) GoString() string { + return s.String() +} + type DeleteSubnetOutput struct { metadataDeleteSubnetOutput `json:"-" xml:"-"` } @@ -9660,6 +10431,16 @@ type metadataDeleteSubnetOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DeleteSubnetOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteSubnetOutput) GoString() string { + return s.String() +} + type DeleteTagsInput struct { // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have @@ -9683,6 +10464,16 @@ type metadataDeleteTagsInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DeleteTagsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteTagsInput) GoString() string { + return s.String() +} + type DeleteTagsOutput struct { metadataDeleteTagsOutput `json:"-" xml:"-"` } @@ -9691,7 +10482,62 @@ type metadataDeleteTagsOutput struct { SDKShapeTraits bool `type:"structure"` } -type DeleteVPCEndpointsInput struct { +// String returns the string representation +func (s DeleteTagsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteTagsOutput) GoString() string { + return s.String() +} + +type DeleteVolumeInput struct { + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. + DryRun *bool `locationName:"dryRun" type:"boolean"` + + // The ID of the volume. + VolumeId *string `type:"string" required:"true"` + + metadataDeleteVolumeInput `json:"-" xml:"-"` +} + +type metadataDeleteVolumeInput struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s DeleteVolumeInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteVolumeInput) GoString() string { + return s.String() +} + +type DeleteVolumeOutput struct { + metadataDeleteVolumeOutput `json:"-" xml:"-"` +} + +type metadataDeleteVolumeOutput struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s DeleteVolumeOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteVolumeOutput) GoString() string { + return s.String() +} + +type DeleteVpcEndpointsInput struct { // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have // the required permissions, the error response is DryRunOperation. Otherwise, @@ -9699,27 +10545,47 @@ type DeleteVPCEndpointsInput struct { DryRun *bool `type:"boolean"` // One or more endpoint IDs. - VPCEndpointIDs []*string `locationName:"VpcEndpointId" locationNameList:"item" type:"list" required:"true"` + VpcEndpointIds []*string `locationName:"VpcEndpointId" locationNameList:"item" type:"list" required:"true"` - metadataDeleteVPCEndpointsInput `json:"-" xml:"-"` + metadataDeleteVpcEndpointsInput `json:"-" xml:"-"` } -type metadataDeleteVPCEndpointsInput struct { +type metadataDeleteVpcEndpointsInput struct { SDKShapeTraits bool `type:"structure"` } -type DeleteVPCEndpointsOutput struct { +// String returns the string representation +func (s DeleteVpcEndpointsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteVpcEndpointsInput) GoString() string { + return s.String() +} + +type DeleteVpcEndpointsOutput struct { // Information about the endpoints that were not successfully deleted. Unsuccessful []*UnsuccessfulItem `locationName:"unsuccessful" locationNameList:"item" type:"list"` - metadataDeleteVPCEndpointsOutput `json:"-" xml:"-"` + metadataDeleteVpcEndpointsOutput `json:"-" xml:"-"` } -type metadataDeleteVPCEndpointsOutput struct { +type metadataDeleteVpcEndpointsOutput struct { SDKShapeTraits bool `type:"structure"` } -type DeleteVPCInput struct { +// String returns the string representation +func (s DeleteVpcEndpointsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteVpcEndpointsOutput) GoString() string { + return s.String() +} + +type DeleteVpcInput struct { // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have // the required permissions, the error response is DryRunOperation. Otherwise, @@ -9727,24 +10593,44 @@ type DeleteVPCInput struct { DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the VPC. - VPCID *string `locationName:"VpcId" type:"string" required:"true"` + VpcId *string `type:"string" required:"true"` - metadataDeleteVPCInput `json:"-" xml:"-"` + metadataDeleteVpcInput `json:"-" xml:"-"` } -type metadataDeleteVPCInput struct { +type metadataDeleteVpcInput struct { SDKShapeTraits bool `type:"structure"` } -type DeleteVPCOutput struct { - metadataDeleteVPCOutput `json:"-" xml:"-"` +// String returns the string representation +func (s DeleteVpcInput) String() string { + return awsutil.Prettify(s) } -type metadataDeleteVPCOutput struct { +// GoString returns the string representation +func (s DeleteVpcInput) GoString() string { + return s.String() +} + +type DeleteVpcOutput struct { + metadataDeleteVpcOutput `json:"-" xml:"-"` +} + +type metadataDeleteVpcOutput struct { SDKShapeTraits bool `type:"structure"` } -type DeleteVPCPeeringConnectionInput struct { +// String returns the string representation +func (s DeleteVpcOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteVpcOutput) GoString() string { + return s.String() +} + +type DeleteVpcPeeringConnectionInput struct { // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have // the required permissions, the error response is DryRunOperation. Otherwise, @@ -9752,27 +10638,47 @@ type DeleteVPCPeeringConnectionInput struct { DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the VPC peering connection. - VPCPeeringConnectionID *string `locationName:"vpcPeeringConnectionId" type:"string" required:"true"` + VpcPeeringConnectionId *string `locationName:"vpcPeeringConnectionId" type:"string" required:"true"` - metadataDeleteVPCPeeringConnectionInput `json:"-" xml:"-"` + metadataDeleteVpcPeeringConnectionInput `json:"-" xml:"-"` } -type metadataDeleteVPCPeeringConnectionInput struct { +type metadataDeleteVpcPeeringConnectionInput struct { SDKShapeTraits bool `type:"structure"` } -type DeleteVPCPeeringConnectionOutput struct { +// String returns the string representation +func (s DeleteVpcPeeringConnectionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteVpcPeeringConnectionInput) GoString() string { + return s.String() +} + +type DeleteVpcPeeringConnectionOutput struct { // Returns true if the request succeeds; otherwise, it returns an error. Return *bool `locationName:"return" type:"boolean"` - metadataDeleteVPCPeeringConnectionOutput `json:"-" xml:"-"` + metadataDeleteVpcPeeringConnectionOutput `json:"-" xml:"-"` } -type metadataDeleteVPCPeeringConnectionOutput struct { +type metadataDeleteVpcPeeringConnectionOutput struct { SDKShapeTraits bool `type:"structure"` } -type DeleteVPNConnectionInput struct { +// String returns the string representation +func (s DeleteVpcPeeringConnectionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteVpcPeeringConnectionOutput) GoString() string { + return s.String() +} + +type DeleteVpnConnectionInput struct { // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have // the required permissions, the error response is DryRunOperation. Otherwise, @@ -9780,46 +10686,86 @@ type DeleteVPNConnectionInput struct { DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the VPN connection. - VPNConnectionID *string `locationName:"VpnConnectionId" type:"string" required:"true"` + VpnConnectionId *string `type:"string" required:"true"` - metadataDeleteVPNConnectionInput `json:"-" xml:"-"` + metadataDeleteVpnConnectionInput `json:"-" xml:"-"` } -type metadataDeleteVPNConnectionInput struct { +type metadataDeleteVpnConnectionInput struct { SDKShapeTraits bool `type:"structure"` } -type DeleteVPNConnectionOutput struct { - metadataDeleteVPNConnectionOutput `json:"-" xml:"-"` +// String returns the string representation +func (s DeleteVpnConnectionInput) String() string { + return awsutil.Prettify(s) } -type metadataDeleteVPNConnectionOutput struct { +// GoString returns the string representation +func (s DeleteVpnConnectionInput) GoString() string { + return s.String() +} + +type DeleteVpnConnectionOutput struct { + metadataDeleteVpnConnectionOutput `json:"-" xml:"-"` +} + +type metadataDeleteVpnConnectionOutput struct { SDKShapeTraits bool `type:"structure"` } -type DeleteVPNConnectionRouteInput struct { +// String returns the string representation +func (s DeleteVpnConnectionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteVpnConnectionOutput) GoString() string { + return s.String() +} + +type DeleteVpnConnectionRouteInput struct { // The CIDR block associated with the local subnet of the customer network. - DestinationCIDRBlock *string `locationName:"DestinationCidrBlock" type:"string" required:"true"` + DestinationCidrBlock *string `type:"string" required:"true"` // The ID of the VPN connection. - VPNConnectionID *string `locationName:"VpnConnectionId" type:"string" required:"true"` + VpnConnectionId *string `type:"string" required:"true"` - metadataDeleteVPNConnectionRouteInput `json:"-" xml:"-"` + metadataDeleteVpnConnectionRouteInput `json:"-" xml:"-"` } -type metadataDeleteVPNConnectionRouteInput struct { +type metadataDeleteVpnConnectionRouteInput struct { SDKShapeTraits bool `type:"structure"` } -type DeleteVPNConnectionRouteOutput struct { - metadataDeleteVPNConnectionRouteOutput `json:"-" xml:"-"` +// String returns the string representation +func (s DeleteVpnConnectionRouteInput) String() string { + return awsutil.Prettify(s) } -type metadataDeleteVPNConnectionRouteOutput struct { +// GoString returns the string representation +func (s DeleteVpnConnectionRouteInput) GoString() string { + return s.String() +} + +type DeleteVpnConnectionRouteOutput struct { + metadataDeleteVpnConnectionRouteOutput `json:"-" xml:"-"` +} + +type metadataDeleteVpnConnectionRouteOutput struct { SDKShapeTraits bool `type:"structure"` } -type DeleteVPNGatewayInput struct { +// String returns the string representation +func (s DeleteVpnConnectionRouteOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteVpnConnectionRouteOutput) GoString() string { + return s.String() +} + +type DeleteVpnGatewayInput struct { // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have // the required permissions, the error response is DryRunOperation. Otherwise, @@ -9827,46 +10773,41 @@ type DeleteVPNGatewayInput struct { DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the virtual private gateway. - VPNGatewayID *string `locationName:"VpnGatewayId" type:"string" required:"true"` + VpnGatewayId *string `type:"string" required:"true"` - metadataDeleteVPNGatewayInput `json:"-" xml:"-"` + metadataDeleteVpnGatewayInput `json:"-" xml:"-"` } -type metadataDeleteVPNGatewayInput struct { +type metadataDeleteVpnGatewayInput struct { SDKShapeTraits bool `type:"structure"` } -type DeleteVPNGatewayOutput struct { - metadataDeleteVPNGatewayOutput `json:"-" xml:"-"` +// String returns the string representation +func (s DeleteVpnGatewayInput) String() string { + return awsutil.Prettify(s) } -type metadataDeleteVPNGatewayOutput struct { - SDKShapeTraits bool `type:"structure"` +// GoString returns the string representation +func (s DeleteVpnGatewayInput) GoString() string { + return s.String() } -type DeleteVolumeInput struct { - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The ID of the volume. - VolumeID *string `locationName:"VolumeId" type:"string" required:"true"` - - metadataDeleteVolumeInput `json:"-" xml:"-"` +type DeleteVpnGatewayOutput struct { + metadataDeleteVpnGatewayOutput `json:"-" xml:"-"` } -type metadataDeleteVolumeInput struct { +type metadataDeleteVpnGatewayOutput struct { SDKShapeTraits bool `type:"structure"` } -type DeleteVolumeOutput struct { - metadataDeleteVolumeOutput `json:"-" xml:"-"` +// String returns the string representation +func (s DeleteVpnGatewayOutput) String() string { + return awsutil.Prettify(s) } -type metadataDeleteVolumeOutput struct { - SDKShapeTraits bool `type:"structure"` +// GoString returns the string representation +func (s DeleteVpnGatewayOutput) GoString() string { + return s.String() } type DeregisterImageInput struct { @@ -9877,7 +10818,7 @@ type DeregisterImageInput struct { DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the AMI. - ImageID *string `locationName:"ImageId" type:"string" required:"true"` + ImageId *string `type:"string" required:"true"` metadataDeregisterImageInput `json:"-" xml:"-"` } @@ -9886,6 +10827,16 @@ type metadataDeregisterImageInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DeregisterImageInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeregisterImageInput) GoString() string { + return s.String() +} + type DeregisterImageOutput struct { metadataDeregisterImageOutput `json:"-" xml:"-"` } @@ -9894,6 +10845,16 @@ type metadataDeregisterImageOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DeregisterImageOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeregisterImageOutput) GoString() string { + return s.String() +} + type DescribeAccountAttributesInput struct { // One or more account attribute names. AttributeNames []*string `locationName:"attributeName" locationNameList:"attributeName" type:"list"` @@ -9911,6 +10872,16 @@ type metadataDescribeAccountAttributesInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeAccountAttributesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeAccountAttributesInput) GoString() string { + return s.String() +} + type DescribeAccountAttributesOutput struct { // Information about one or more account attributes. AccountAttributes []*AccountAttribute `locationName:"accountAttributeSet" locationNameList:"item" type:"list"` @@ -9922,11 +10893,21 @@ type metadataDescribeAccountAttributesOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeAccountAttributesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeAccountAttributesOutput) GoString() string { + return s.String() +} + type DescribeAddressesInput struct { // [EC2-VPC] One or more allocation IDs. // // Default: Describes all your Elastic IP addresses. - AllocationIDs []*string `locationName:"AllocationId" locationNameList:"AllocationId" type:"list"` + AllocationIds []*string `locationName:"AllocationId" locationNameList:"AllocationId" type:"list"` // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have @@ -9960,7 +10941,7 @@ type DescribeAddressesInput struct { // [EC2-Classic] One or more Elastic IP addresses. // // Default: Describes all your Elastic IP addresses. - PublicIPs []*string `locationName:"PublicIp" locationNameList:"PublicIp" type:"list"` + PublicIps []*string `locationName:"PublicIp" locationNameList:"PublicIp" type:"list"` metadataDescribeAddressesInput `json:"-" xml:"-"` } @@ -9969,6 +10950,16 @@ type metadataDescribeAddressesInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeAddressesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeAddressesInput) GoString() string { + return s.String() +} + type DescribeAddressesOutput struct { // Information about one or more Elastic IP addresses. Addresses []*Address `locationName:"addressesSet" locationNameList:"item" type:"list"` @@ -9980,6 +10971,16 @@ type metadataDescribeAddressesOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeAddressesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeAddressesOutput) GoString() string { + return s.String() +} + type DescribeAvailabilityZonesInput struct { // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have @@ -10009,6 +11010,16 @@ type metadataDescribeAvailabilityZonesInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeAvailabilityZonesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeAvailabilityZonesInput) GoString() string { + return s.String() +} + type DescribeAvailabilityZonesOutput struct { // Information about one or more Availability Zones. AvailabilityZones []*AvailabilityZone `locationName:"availabilityZoneInfo" locationNameList:"item" type:"list"` @@ -10020,11 +11031,21 @@ type metadataDescribeAvailabilityZonesOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeAvailabilityZonesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeAvailabilityZonesOutput) GoString() string { + return s.String() +} + type DescribeBundleTasksInput struct { // One or more bundle task IDs. // // Default: Describes all your bundle tasks. - BundleIDs []*string `locationName:"BundleId" locationNameList:"BundleId" type:"list"` + BundleIds []*string `locationName:"BundleId" locationNameList:"BundleId" type:"list"` // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have @@ -10064,6 +11085,16 @@ type metadataDescribeBundleTasksInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeBundleTasksInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeBundleTasksInput) GoString() string { + return s.String() +} + type DescribeBundleTasksOutput struct { // Information about one or more bundle tasks. BundleTasks []*BundleTask `locationName:"bundleInstanceTasksSet" locationNameList:"item" type:"list"` @@ -10075,6 +11106,16 @@ type metadataDescribeBundleTasksOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeBundleTasksOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeBundleTasksOutput) GoString() string { + return s.String() +} + type DescribeClassicLinkInstancesInput struct { // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have @@ -10104,7 +11145,7 @@ type DescribeClassicLinkInstancesInput struct { Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` // One or more instance IDs. Must be instances linked to a VPC through ClassicLink. - InstanceIDs []*string `locationName:"InstanceId" locationNameList:"InstanceId" type:"list"` + InstanceIds []*string `locationName:"InstanceId" locationNameList:"InstanceId" type:"list"` // The maximum number of results to return for the request in a single page. // The remaining results of the initial request can be seen by sending another @@ -10126,6 +11167,16 @@ type metadataDescribeClassicLinkInstancesInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeClassicLinkInstancesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeClassicLinkInstancesInput) GoString() string { + return s.String() +} + type DescribeClassicLinkInstancesOutput struct { // Information about one or more linked EC2-Classic instances. Instances []*ClassicLinkInstance `locationName:"instancesSet" locationNameList:"item" type:"list"` @@ -10141,9 +11192,19 @@ type metadataDescribeClassicLinkInstancesOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeClassicLinkInstancesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeClassicLinkInstancesOutput) GoString() string { + return s.String() +} + type DescribeConversionTasksInput struct { // One or more conversion task IDs. - ConversionTaskIDs []*string `locationName:"conversionTaskId" locationNameList:"item" type:"list"` + ConversionTaskIds []*string `locationName:"conversionTaskId" locationNameList:"item" type:"list"` // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have @@ -10161,6 +11222,16 @@ type metadataDescribeConversionTasksInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeConversionTasksInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeConversionTasksInput) GoString() string { + return s.String() +} + type DescribeConversionTasksOutput struct { // Information about the conversion tasks. ConversionTasks []*ConversionTask `locationName:"conversionTasks" locationNameList:"item" type:"list"` @@ -10172,11 +11243,21 @@ type metadataDescribeConversionTasksOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeConversionTasksOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeConversionTasksOutput) GoString() string { + return s.String() +} + type DescribeCustomerGatewaysInput struct { // One or more customer gateway IDs. // // Default: Describes all your customer gateways. - CustomerGatewayIDs []*string `locationName:"CustomerGatewayId" locationNameList:"CustomerGatewayId" type:"list"` + CustomerGatewayIds []*string `locationName:"CustomerGatewayId" locationNameList:"CustomerGatewayId" type:"list"` // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have @@ -10220,6 +11301,16 @@ type metadataDescribeCustomerGatewaysInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeCustomerGatewaysInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeCustomerGatewaysInput) GoString() string { + return s.String() +} + type DescribeCustomerGatewaysOutput struct { // Information about one or more customer gateways. CustomerGateways []*CustomerGateway `locationName:"customerGatewaySet" locationNameList:"item" type:"list"` @@ -10231,11 +11322,21 @@ type metadataDescribeCustomerGatewaysOutput struct { SDKShapeTraits bool `type:"structure"` } -type DescribeDHCPOptionsInput struct { +// String returns the string representation +func (s DescribeCustomerGatewaysOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeCustomerGatewaysOutput) GoString() string { + return s.String() +} + +type DescribeDhcpOptionsInput struct { // The IDs of one or more DHCP options sets. // // Default: Describes all your DHCP options sets. - DHCPOptionsIDs []*string `locationName:"DhcpOptionsId" locationNameList:"DhcpOptionsId" type:"list"` + DhcpOptionsIds []*string `locationName:"DhcpOptionsId" locationNameList:"DhcpOptionsId" type:"list"` // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have @@ -10264,27 +11365,47 @@ type DescribeDHCPOptionsInput struct { // independent of the tag-key filter. Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - metadataDescribeDHCPOptionsInput `json:"-" xml:"-"` + metadataDescribeDhcpOptionsInput `json:"-" xml:"-"` } -type metadataDescribeDHCPOptionsInput struct { +type metadataDescribeDhcpOptionsInput struct { SDKShapeTraits bool `type:"structure"` } -type DescribeDHCPOptionsOutput struct { +// String returns the string representation +func (s DescribeDhcpOptionsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeDhcpOptionsInput) GoString() string { + return s.String() +} + +type DescribeDhcpOptionsOutput struct { // Information about one or more DHCP options sets. - DHCPOptions []*DHCPOptions `locationName:"dhcpOptionsSet" locationNameList:"item" type:"list"` + DhcpOptions []*DhcpOptions `locationName:"dhcpOptionsSet" locationNameList:"item" type:"list"` - metadataDescribeDHCPOptionsOutput `json:"-" xml:"-"` + metadataDescribeDhcpOptionsOutput `json:"-" xml:"-"` } -type metadataDescribeDHCPOptionsOutput struct { +type metadataDescribeDhcpOptionsOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeDhcpOptionsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeDhcpOptionsOutput) GoString() string { + return s.String() +} + type DescribeExportTasksInput struct { // One or more export task IDs. - ExportTaskIDs []*string `locationName:"exportTaskId" locationNameList:"ExportTaskId" type:"list"` + ExportTaskIds []*string `locationName:"exportTaskId" locationNameList:"ExportTaskId" type:"list"` metadataDescribeExportTasksInput `json:"-" xml:"-"` } @@ -10293,6 +11414,16 @@ type metadataDescribeExportTasksInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeExportTasksInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeExportTasksInput) GoString() string { + return s.String() +} + type DescribeExportTasksOutput struct { // Information about the export tasks. ExportTasks []*ExportTask `locationName:"exportTaskSet" locationNameList:"item" type:"list"` @@ -10304,13 +11435,92 @@ type metadataDescribeExportTasksOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeExportTasksOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeExportTasksOutput) GoString() string { + return s.String() +} + +type DescribeFlowLogsInput struct { + // One or more filters. + // + // deliver-log-status - The status of the logs delivery (SUCCESS | FAILED). + // + // flow-log-id - The ID of the flow log. + // + // log-group-name - The name of the log group. + // + // resource-id - The ID of the VPC, subnet, or network interface. + // + // traffic-type - The type of traffic (ACCEPT | REJECT | ALL) + Filter []*Filter `locationNameList:"Filter" type:"list"` + + // One or more flow log IDs. + FlowLogIds []*string `locationName:"FlowLogId" locationNameList:"item" type:"list"` + + // The maximum number of results to return for the request in a single page. + // The remaining results can be seen by sending another request with the returned + // NextToken value. This value can be between 5 and 1000; if MaxResults is given + // a value larger than 1000, only 1000 results are returned. You cannot specify + // this parameter and the flow log IDs parameter in the same request. + MaxResults *int64 `type:"integer"` + + // The token to retrieve the next page of results. + NextToken *string `type:"string"` + + metadataDescribeFlowLogsInput `json:"-" xml:"-"` +} + +type metadataDescribeFlowLogsInput struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s DescribeFlowLogsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeFlowLogsInput) GoString() string { + return s.String() +} + +type DescribeFlowLogsOutput struct { + // Information about the flow logs. + FlowLogs []*FlowLog `locationName:"flowLogSet" locationNameList:"item" type:"list"` + + // The token to use to retrieve the next page of results. This value is null + // when there are no more results to return. + NextToken *string `locationName:"nextToken" type:"string"` + + metadataDescribeFlowLogsOutput `json:"-" xml:"-"` +} + +type metadataDescribeFlowLogsOutput struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s DescribeFlowLogsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeFlowLogsOutput) GoString() string { + return s.String() +} + type DescribeImageAttributeInput struct { // The AMI attribute. // // Note: Depending on your account privileges, the blockDeviceMapping attribute // may return a Client.AuthFailure error. If this happens, use DescribeImages // to get information about the block device mapping for the AMI. - Attribute *string `type:"string" required:"true"` + Attribute *string `type:"string" required:"true" enum:"ImageAttributeName"` // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have @@ -10319,7 +11529,7 @@ type DescribeImageAttributeInput struct { DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the AMI. - ImageID *string `locationName:"ImageId" type:"string" required:"true"` + ImageId *string `type:"string" required:"true"` metadataDescribeImageAttributeInput `json:"-" xml:"-"` } @@ -10328,6 +11538,16 @@ type metadataDescribeImageAttributeInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeImageAttributeInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeImageAttributeInput) GoString() string { + return s.String() +} + // Describes an image attribute. type DescribeImageAttributeOutput struct { // One or more block device mapping entries. @@ -10337,10 +11557,10 @@ type DescribeImageAttributeOutput struct { Description *AttributeValue `locationName:"description" type:"structure"` // The ID of the AMI. - ImageID *string `locationName:"imageId" type:"string"` + ImageId *string `locationName:"imageId" type:"string"` // The kernel ID. - KernelID *AttributeValue `locationName:"kernel" type:"structure"` + KernelId *AttributeValue `locationName:"kernel" type:"structure"` // One or more launch permissions. LaunchPermissions []*LaunchPermission `locationName:"launchPermission" locationNameList:"item" type:"list"` @@ -10349,10 +11569,10 @@ type DescribeImageAttributeOutput struct { ProductCodes []*ProductCode `locationName:"productCodes" locationNameList:"item" type:"list"` // The RAM disk ID. - RAMDiskID *AttributeValue `locationName:"ramdisk" type:"structure"` + RamdiskId *AttributeValue `locationName:"ramdisk" type:"structure"` // The value to use for a resource attribute. - SRIOVNetSupport *AttributeValue `locationName:"sriovNetSupport" type:"structure"` + SriovNetSupport *AttributeValue `locationName:"sriovNetSupport" type:"structure"` metadataDescribeImageAttributeOutput `json:"-" xml:"-"` } @@ -10361,6 +11581,16 @@ type metadataDescribeImageAttributeOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeImageAttributeOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeImageAttributeOutput) GoString() string { + return s.String() +} + type DescribeImagesInput struct { // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have @@ -10447,7 +11677,7 @@ type DescribeImagesInput struct { // One or more image IDs. // // Default: Describes all images available to you. - ImageIDs []*string `locationName:"ImageId" locationNameList:"ImageId" type:"list"` + ImageIds []*string `locationName:"ImageId" locationNameList:"ImageId" type:"list"` // Filters the images by the owner. Specify an AWS account ID, amazon (owner // is Amazon), aws-marketplace (owner is AWS Marketplace), self (owner is the @@ -10462,6 +11692,16 @@ type metadataDescribeImagesInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeImagesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeImagesInput) GoString() string { + return s.String() +} + type DescribeImagesOutput struct { // Information about one or more images. Images []*Image `locationName:"imagesSet" locationNameList:"item" type:"list"` @@ -10473,6 +11713,16 @@ type metadataDescribeImagesOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeImagesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeImagesOutput) GoString() string { + return s.String() +} + type DescribeImportImageTasksInput struct { // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have @@ -10484,7 +11734,7 @@ type DescribeImportImageTasksInput struct { Filters []*Filter `locationNameList:"Filter" type:"list"` // A list of import image task IDs. - ImportTaskIDs []*string `locationName:"ImportTaskId" locationNameList:"ImportTaskId" type:"list"` + ImportTaskIds []*string `locationName:"ImportTaskId" locationNameList:"ImportTaskId" type:"list"` // The maximum number of results to return in a single request. MaxResults *int64 `type:"integer"` @@ -10499,6 +11749,16 @@ type metadataDescribeImportImageTasksInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeImportImageTasksInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeImportImageTasksInput) GoString() string { + return s.String() +} + type DescribeImportImageTasksOutput struct { // A list of zero or more import image tasks that are currently active or were // completed or canceled in the previous 7 days. @@ -10515,6 +11775,16 @@ type metadataDescribeImportImageTasksOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeImportImageTasksOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeImportImageTasksOutput) GoString() string { + return s.String() +} + type DescribeImportSnapshotTasksInput struct { // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have @@ -10526,7 +11796,7 @@ type DescribeImportSnapshotTasksInput struct { Filters []*Filter `locationNameList:"Filter" type:"list"` // A list of import snapshot task IDs. - ImportTaskIDs []*string `locationName:"ImportTaskId" locationNameList:"ImportTaskId" type:"list"` + ImportTaskIds []*string `locationName:"ImportTaskId" locationNameList:"ImportTaskId" type:"list"` // The maximum number of results to return in a single request. MaxResults *int64 `type:"integer"` @@ -10541,6 +11811,16 @@ type metadataDescribeImportSnapshotTasksInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeImportSnapshotTasksInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeImportSnapshotTasksInput) GoString() string { + return s.String() +} + type DescribeImportSnapshotTasksOutput struct { // A list of zero or more import snapshot tasks that are currently active or // were completed or canceled in the previous 7 days. @@ -10557,9 +11837,19 @@ type metadataDescribeImportSnapshotTasksOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeImportSnapshotTasksOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeImportSnapshotTasksOutput) GoString() string { + return s.String() +} + type DescribeInstanceAttributeInput struct { // The instance attribute. - Attribute *string `locationName:"attribute" type:"string" required:"true"` + Attribute *string `locationName:"attribute" type:"string" required:"true" enum:"InstanceAttributeName"` // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have @@ -10568,7 +11858,7 @@ type DescribeInstanceAttributeInput struct { DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the instance. - InstanceID *string `locationName:"instanceId" type:"string" required:"true"` + InstanceId *string `locationName:"instanceId" type:"string" required:"true"` metadataDescribeInstanceAttributeInput `json:"-" xml:"-"` } @@ -10577,6 +11867,16 @@ type metadataDescribeInstanceAttributeInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeInstanceAttributeInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeInstanceAttributeInput) GoString() string { + return s.String() +} + // Describes an instance attribute. type DescribeInstanceAttributeOutput struct { // The block device mapping of the instance. @@ -10584,16 +11884,16 @@ type DescribeInstanceAttributeOutput struct { // If the value is true, you can't terminate the instance through the Amazon // EC2 console, CLI, or API; otherwise, you can. - DisableAPITermination *AttributeBooleanValue `locationName:"disableApiTermination" type:"structure"` + DisableApiTermination *AttributeBooleanValue `locationName:"disableApiTermination" type:"structure"` // Indicates whether the instance is optimized for EBS I/O. - EBSOptimized *AttributeBooleanValue `locationName:"ebsOptimized" type:"structure"` + EbsOptimized *AttributeBooleanValue `locationName:"ebsOptimized" type:"structure"` // The security groups associated with the instance. Groups []*GroupIdentifier `locationName:"groupSet" locationNameList:"item" type:"list"` // The ID of the instance. - InstanceID *string `locationName:"instanceId" type:"string"` + InstanceId *string `locationName:"instanceId" type:"string"` // Indicates whether an instance stops or terminates when you initiate shutdown // from the instance (using the operating system command for system shutdown). @@ -10603,25 +11903,25 @@ type DescribeInstanceAttributeOutput struct { InstanceType *AttributeValue `locationName:"instanceType" type:"structure"` // The kernel ID. - KernelID *AttributeValue `locationName:"kernel" type:"structure"` + KernelId *AttributeValue `locationName:"kernel" type:"structure"` // A list of product codes. ProductCodes []*ProductCode `locationName:"productCodes" locationNameList:"item" type:"list"` // The RAM disk ID. - RAMDiskID *AttributeValue `locationName:"ramdisk" type:"structure"` + RamdiskId *AttributeValue `locationName:"ramdisk" type:"structure"` // The name of the root device (for example, /dev/sda1 or /dev/xvda). RootDeviceName *AttributeValue `locationName:"rootDeviceName" type:"structure"` - // The value to use for a resource attribute. - SRIOVNetSupport *AttributeValue `locationName:"sriovNetSupport" type:"structure"` - // Indicates whether source/destination checking is enabled. A value of true // means checking is enabled, and false means checking is disabled. This value // must be false for a NAT instance to perform NAT. SourceDestCheck *AttributeBooleanValue `locationName:"sourceDestCheck" type:"structure"` + // The value to use for a resource attribute. + SriovNetSupport *AttributeValue `locationName:"sriovNetSupport" type:"structure"` + // The Base64-encoded MIME user data. UserData *AttributeValue `locationName:"userData" type:"structure"` @@ -10632,6 +11932,16 @@ type metadataDescribeInstanceAttributeOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeInstanceAttributeOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeInstanceAttributeOutput) GoString() string { + return s.String() +} + type DescribeInstanceStatusInput struct { // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have @@ -10687,7 +11997,7 @@ type DescribeInstanceStatusInput struct { // Default: Describes all your instances. // // Constraints: Maximum 100 explicitly specified instance IDs. - InstanceIDs []*string `locationName:"InstanceId" locationNameList:"InstanceId" type:"list"` + InstanceIds []*string `locationName:"InstanceId" locationNameList:"InstanceId" type:"list"` // The maximum number of results to return for the request in a single page. // The remaining results of the initial request can be seen by sending another @@ -10707,6 +12017,16 @@ type metadataDescribeInstanceStatusInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeInstanceStatusInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeInstanceStatusInput) GoString() string { + return s.String() +} + type DescribeInstanceStatusOutput struct { // One or more instance status descriptions. InstanceStatuses []*InstanceStatus `locationName:"instanceStatusSet" locationNameList:"item" type:"list"` @@ -10722,6 +12042,16 @@ type metadataDescribeInstanceStatusOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeInstanceStatusOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeInstanceStatusOutput) GoString() string { + return s.String() +} + type DescribeInstancesInput struct { // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have @@ -10957,7 +12287,7 @@ type DescribeInstancesInput struct { // One or more instance IDs. // // Default: Describes all your instances. - InstanceIDs []*string `locationName:"InstanceId" locationNameList:"InstanceId" type:"list"` + InstanceIds []*string `locationName:"InstanceId" locationNameList:"InstanceId" type:"list"` // The maximum number of results to return for the request in a single page. // The remaining results of the initial request can be seen by sending another @@ -10977,6 +12307,16 @@ type metadataDescribeInstancesInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeInstancesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeInstancesInput) GoString() string { + return s.String() +} + type DescribeInstancesOutput struct { // The token to use to retrieve the next page of results. This value is null // when there are no more results to return. @@ -10992,6 +12332,16 @@ type metadataDescribeInstancesOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeInstancesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeInstancesOutput) GoString() string { + return s.String() +} + type DescribeInternetGatewaysInput struct { // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have @@ -11024,7 +12374,7 @@ type DescribeInternetGatewaysInput struct { // One or more Internet gateway IDs. // // Default: Describes all your Internet gateways. - InternetGatewayIDs []*string `locationName:"internetGatewayId" locationNameList:"item" type:"list"` + InternetGatewayIds []*string `locationName:"internetGatewayId" locationNameList:"item" type:"list"` metadataDescribeInternetGatewaysInput `json:"-" xml:"-"` } @@ -11033,6 +12383,16 @@ type metadataDescribeInternetGatewaysInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeInternetGatewaysInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeInternetGatewaysInput) GoString() string { + return s.String() +} + type DescribeInternetGatewaysOutput struct { // Information about one or more Internet gateways. InternetGateways []*InternetGateway `locationName:"internetGatewaySet" locationNameList:"item" type:"list"` @@ -11044,6 +12404,16 @@ type metadataDescribeInternetGatewaysOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeInternetGatewaysOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeInternetGatewaysOutput) GoString() string { + return s.String() +} + type DescribeKeyPairsInput struct { // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have @@ -11070,6 +12440,16 @@ type metadataDescribeKeyPairsInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeKeyPairsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeKeyPairsInput) GoString() string { + return s.String() +} + type DescribeKeyPairsOutput struct { // Information about one or more key pairs. KeyPairs []*KeyPairInfo `locationName:"keySet" locationNameList:"item" type:"list"` @@ -11081,6 +12461,16 @@ type metadataDescribeKeyPairsOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeKeyPairsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeKeyPairsOutput) GoString() string { + return s.String() +} + type DescribeMovingAddressesInput struct { // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have @@ -11105,7 +12495,7 @@ type DescribeMovingAddressesInput struct { NextToken *string `locationName:"nextToken" type:"string"` // One or more Elastic IP addresses. - PublicIPs []*string `locationName:"publicIp" locationNameList:"item" type:"list"` + PublicIps []*string `locationName:"publicIp" locationNameList:"item" type:"list"` metadataDescribeMovingAddressesInput `json:"-" xml:"-"` } @@ -11114,6 +12504,16 @@ type metadataDescribeMovingAddressesInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeMovingAddressesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeMovingAddressesInput) GoString() string { + return s.String() +} + type DescribeMovingAddressesOutput struct { // The status for each Elastic IP address. MovingAddressStatuses []*MovingAddressStatus `locationName:"movingAddressStatusSet" locationNameList:"item" type:"list"` @@ -11129,7 +12529,17 @@ type metadataDescribeMovingAddressesOutput struct { SDKShapeTraits bool `type:"structure"` } -type DescribeNetworkACLsInput struct { +// String returns the string representation +func (s DescribeMovingAddressesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeMovingAddressesOutput) GoString() string { + return s.String() +} + +type DescribeNetworkAclsInput struct { // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have // the required permissions, the error response is DryRunOperation. Otherwise, @@ -11188,29 +12598,49 @@ type DescribeNetworkACLsInput struct { // One or more network ACL IDs. // // Default: Describes all your network ACLs. - NetworkACLIDs []*string `locationName:"NetworkAclId" locationNameList:"item" type:"list"` + NetworkAclIds []*string `locationName:"NetworkAclId" locationNameList:"item" type:"list"` - metadataDescribeNetworkACLsInput `json:"-" xml:"-"` + metadataDescribeNetworkAclsInput `json:"-" xml:"-"` } -type metadataDescribeNetworkACLsInput struct { +type metadataDescribeNetworkAclsInput struct { SDKShapeTraits bool `type:"structure"` } -type DescribeNetworkACLsOutput struct { +// String returns the string representation +func (s DescribeNetworkAclsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeNetworkAclsInput) GoString() string { + return s.String() +} + +type DescribeNetworkAclsOutput struct { // Information about one or more network ACLs. - NetworkACLs []*NetworkACL `locationName:"networkAclSet" locationNameList:"item" type:"list"` + NetworkAcls []*NetworkAcl `locationName:"networkAclSet" locationNameList:"item" type:"list"` - metadataDescribeNetworkACLsOutput `json:"-" xml:"-"` + metadataDescribeNetworkAclsOutput `json:"-" xml:"-"` } -type metadataDescribeNetworkACLsOutput struct { +type metadataDescribeNetworkAclsOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeNetworkAclsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeNetworkAclsOutput) GoString() string { + return s.String() +} + type DescribeNetworkInterfaceAttributeInput struct { // The attribute of the network interface. - Attribute *string `locationName:"attribute" type:"string"` + Attribute *string `locationName:"attribute" type:"string" enum:"NetworkInterfaceAttribute"` // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have @@ -11219,7 +12649,7 @@ type DescribeNetworkInterfaceAttributeInput struct { DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the network interface. - NetworkInterfaceID *string `locationName:"networkInterfaceId" type:"string" required:"true"` + NetworkInterfaceId *string `locationName:"networkInterfaceId" type:"string" required:"true"` metadataDescribeNetworkInterfaceAttributeInput `json:"-" xml:"-"` } @@ -11228,6 +12658,16 @@ type metadataDescribeNetworkInterfaceAttributeInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeNetworkInterfaceAttributeInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeNetworkInterfaceAttributeInput) GoString() string { + return s.String() +} + type DescribeNetworkInterfaceAttributeOutput struct { // The attachment (if any) of the network interface. Attachment *NetworkInterfaceAttachment `locationName:"attachment" type:"structure"` @@ -11239,7 +12679,7 @@ type DescribeNetworkInterfaceAttributeOutput struct { Groups []*GroupIdentifier `locationName:"groupSet" locationNameList:"item" type:"list"` // The ID of the network interface. - NetworkInterfaceID *string `locationName:"networkInterfaceId" type:"string"` + NetworkInterfaceId *string `locationName:"networkInterfaceId" type:"string"` // Indicates whether source/destination checking is enabled. SourceDestCheck *AttributeBooleanValue `locationName:"sourceDestCheck" type:"structure"` @@ -11251,6 +12691,16 @@ type metadataDescribeNetworkInterfaceAttributeOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeNetworkInterfaceAttributeOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeNetworkInterfaceAttributeOutput) GoString() string { + return s.String() +} + type DescribeNetworkInterfacesInput struct { // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have @@ -11362,7 +12812,7 @@ type DescribeNetworkInterfacesInput struct { // One or more network interface IDs. // // Default: Describes all your network interfaces. - NetworkInterfaceIDs []*string `locationName:"NetworkInterfaceId" locationNameList:"item" type:"list"` + NetworkInterfaceIds []*string `locationName:"NetworkInterfaceId" locationNameList:"item" type:"list"` metadataDescribeNetworkInterfacesInput `json:"-" xml:"-"` } @@ -11371,6 +12821,16 @@ type metadataDescribeNetworkInterfacesInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeNetworkInterfacesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeNetworkInterfacesInput) GoString() string { + return s.String() +} + type DescribeNetworkInterfacesOutput struct { // Information about one or more network interfaces. NetworkInterfaces []*NetworkInterface `locationName:"networkInterfaceSet" locationNameList:"item" type:"list"` @@ -11382,6 +12842,16 @@ type metadataDescribeNetworkInterfacesOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeNetworkInterfacesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeNetworkInterfacesOutput) GoString() string { + return s.String() +} + type DescribePlacementGroupsInput struct { // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have @@ -11411,6 +12881,16 @@ type metadataDescribePlacementGroupsInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribePlacementGroupsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribePlacementGroupsInput) GoString() string { + return s.String() +} + type DescribePlacementGroupsOutput struct { // One or more placement groups. PlacementGroups []*PlacementGroup `locationName:"placementGroupSet" locationNameList:"item" type:"list"` @@ -11422,6 +12902,16 @@ type metadataDescribePlacementGroupsOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribePlacementGroupsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribePlacementGroupsOutput) GoString() string { + return s.String() +} + type DescribePrefixListsInput struct { // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have @@ -11449,7 +12939,7 @@ type DescribePrefixListsInput struct { NextToken *string `type:"string"` // One or more prefix list IDs. - PrefixListIDs []*string `locationName:"PrefixListId" locationNameList:"item" type:"list"` + PrefixListIds []*string `locationName:"PrefixListId" locationNameList:"item" type:"list"` metadataDescribePrefixListsInput `json:"-" xml:"-"` } @@ -11458,6 +12948,16 @@ type metadataDescribePrefixListsInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribePrefixListsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribePrefixListsInput) GoString() string { + return s.String() +} + type DescribePrefixListsOutput struct { // The token to use when requesting the next set of items. If there are no additional // items to return, the string is empty. @@ -11473,6 +12973,16 @@ type metadataDescribePrefixListsOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribePrefixListsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribePrefixListsOutput) GoString() string { + return s.String() +} + type DescribeRegionsInput struct { // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have @@ -11497,6 +13007,16 @@ type metadataDescribeRegionsInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeRegionsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeRegionsInput) GoString() string { + return s.String() +} + type DescribeRegionsOutput struct { // Information about one or more regions. Regions []*Region `locationName:"regionInfo" locationNameList:"item" type:"list"` @@ -11508,6 +13028,16 @@ type metadataDescribeRegionsOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeRegionsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeRegionsOutput) GoString() string { + return s.String() +} + type DescribeReservedInstancesInput struct { // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have @@ -11523,7 +13053,7 @@ type DescribeReservedInstancesInput struct { // duration - The duration of the Reserved Instance (one year or three years), // in seconds (31536000 | 94608000). // - // end - The time when the Reserved Instance expires (for example, 2014-08-07T11:54:42.000Z). + // end - The time when the Reserved Instance expires (for example, 2015-08-07T11:54:42.000Z). // // fixed-price - The purchase price of the Reserved Instance (for example, // 9800.0). @@ -11531,8 +13061,15 @@ type DescribeReservedInstancesInput struct { // instance-type - The instance type on which the Reserved Instance can be // used. // - // product-description - The product description of the Reserved Instance - // (Linux/UNIX | Linux/UNIX (Amazon VPC) | Windows | Windows (Amazon VPC)). + // product-description - The Reserved Instance product platform description. + // Instances that include (Amazon VPC) in the product platform description will + // only be displayed to EC2-Classic account holders and are for use with Amazon + // VPC. (Linux/UNIX | Linux/UNIX (Amazon VPC) | SUSE Linux | SUSE Linux (Amazon + // VPC) | Red Hat Enterprise Linux | Red Hat Enterprise Linux (Amazon VPC) | + // Windows | Windows (Amazon VPC) | Windows with SQL Server Standard | Windows + // with SQL Server Standard (Amazon VPC) | Windows with SQL Server Web | Windows + // with SQL Server Web (Amazon VPC) | Windows with SQL Server Enterprise | Windows + // with SQL Server Enterprise (Amazon VPC)). // // reserved-instances-id - The ID of the Reserved Instance. // @@ -11561,13 +13098,13 @@ type DescribeReservedInstancesInput struct { // The Reserved Instance offering type. If you are using tools that predate // the 2011-11-01 API version, you only have access to the Medium Utilization // Reserved Instance offering type. - OfferingType *string `locationName:"offeringType" type:"string"` + OfferingType *string `locationName:"offeringType" type:"string" enum:"OfferingTypeValues"` // One or more Reserved Instance IDs. // // Default: Describes all your Reserved Instances, or only those otherwise // specified. - ReservedInstancesIDs []*string `locationName:"ReservedInstancesId" locationNameList:"ReservedInstancesId" type:"list"` + ReservedInstancesIds []*string `locationName:"ReservedInstancesId" locationNameList:"ReservedInstancesId" type:"list"` metadataDescribeReservedInstancesInput `json:"-" xml:"-"` } @@ -11576,6 +13113,16 @@ type metadataDescribeReservedInstancesInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeReservedInstancesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeReservedInstancesInput) GoString() string { + return s.String() +} + type DescribeReservedInstancesListingsInput struct { // One or more filters. // @@ -11590,10 +13137,10 @@ type DescribeReservedInstancesListingsInput struct { Filters []*Filter `locationName:"filters" locationNameList:"Filter" type:"list"` // One or more Reserved Instance IDs. - ReservedInstancesID *string `locationName:"reservedInstancesId" type:"string"` + ReservedInstancesId *string `locationName:"reservedInstancesId" type:"string"` // One or more Reserved Instance Listing IDs. - ReservedInstancesListingID *string `locationName:"reservedInstancesListingId" type:"string"` + ReservedInstancesListingId *string `locationName:"reservedInstancesListingId" type:"string"` metadataDescribeReservedInstancesListingsInput `json:"-" xml:"-"` } @@ -11602,6 +13149,16 @@ type metadataDescribeReservedInstancesListingsInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeReservedInstancesListingsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeReservedInstancesListingsInput) GoString() string { + return s.String() +} + type DescribeReservedInstancesListingsOutput struct { // Information about the Reserved Instance listing. ReservedInstancesListings []*ReservedInstancesListing `locationName:"reservedInstancesListingsSet" locationNameList:"item" type:"list"` @@ -11613,6 +13170,16 @@ type metadataDescribeReservedInstancesListingsOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeReservedInstancesListingsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeReservedInstancesListingsOutput) GoString() string { + return s.String() +} + type DescribeReservedInstancesModificationsInput struct { // One or more filters. // @@ -11654,7 +13221,7 @@ type DescribeReservedInstancesModificationsInput struct { NextToken *string `locationName:"nextToken" type:"string"` // IDs for the submitted modification request. - ReservedInstancesModificationIDs []*string `locationName:"ReservedInstancesModificationId" locationNameList:"ReservedInstancesModificationId" type:"list"` + ReservedInstancesModificationIds []*string `locationName:"ReservedInstancesModificationId" locationNameList:"ReservedInstancesModificationId" type:"list"` metadataDescribeReservedInstancesModificationsInput `json:"-" xml:"-"` } @@ -11663,6 +13230,16 @@ type metadataDescribeReservedInstancesModificationsInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeReservedInstancesModificationsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeReservedInstancesModificationsInput) GoString() string { + return s.String() +} + type DescribeReservedInstancesModificationsOutput struct { // The token to use to retrieve the next page of results. This value is null // when there are no more results to return. @@ -11678,6 +13255,16 @@ type metadataDescribeReservedInstancesModificationsOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeReservedInstancesModificationsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeReservedInstancesModificationsOutput) GoString() string { + return s.String() +} + type DescribeReservedInstancesOfferingsInput struct { // The Availability Zone in which the Reserved Instance can be used. AvailabilityZone *string `type:"string"` @@ -11706,8 +13293,15 @@ type DescribeReservedInstancesOfferingsInput struct { // When this filter is not used, which is the default behavior, all offerings // from AWS and Reserved Instance Marketplace are listed. // - // product-description - The description of the Reserved Instance (Linux/UNIX - // | Linux/UNIX (Amazon VPC) | Windows | Windows (Amazon VPC)). + // product-description - The Reserved Instance product platform description. + // Instances that include (Amazon VPC) in the product platform description will + // only be displayed to EC2-Classic account holders and are for use with Amazon + // VPC. (Linux/UNIX | Linux/UNIX (Amazon VPC) | SUSE Linux | SUSE Linux (Amazon + // VPC) | Red Hat Enterprise Linux | Red Hat Enterprise Linux (Amazon VPC) | + // Windows | Windows (Amazon VPC) | Windows with SQL Server Standard | Windows + // with SQL Server Standard (Amazon VPC) | Windows with SQL Server Web | Windows + // with SQL Server Web (Amazon VPC) | Windows with SQL Server Enterprise | Windows + // with SQL Server Enterprise (Amazon VPC)) // // reserved-instances-offering-id - The Reserved Instances offering ID. // @@ -11723,12 +13317,12 @@ type DescribeReservedInstancesOfferingsInput struct { // VPC. // // Default: default - InstanceTenancy *string `locationName:"instanceTenancy" type:"string"` + InstanceTenancy *string `locationName:"instanceTenancy" type:"string" enum:"Tenancy"` // The instance type on which the Reserved Instance can be used. For more information, // see Instance Types (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html) // in the Amazon Elastic Compute Cloud User Guide. - InstanceType *string `type:"string"` + InstanceType *string `type:"string" enum:"InstanceType"` // The maximum duration (in seconds) to filter when searching for offerings. // @@ -11758,14 +13352,14 @@ type DescribeReservedInstancesOfferingsInput struct { // The Reserved Instance offering type. If you are using tools that predate // the 2011-11-01 API version, you only have access to the Medium Utilization // Reserved Instance offering type. - OfferingType *string `locationName:"offeringType" type:"string"` + OfferingType *string `locationName:"offeringType" type:"string" enum:"OfferingTypeValues"` - // The Reserved Instance description. Instances that include (Amazon VPC) in - // the description are for use with Amazon VPC. - ProductDescription *string `type:"string"` + // The Reserved Instance product platform description. Instances that include + // (Amazon VPC) in the description are for use with Amazon VPC. + ProductDescription *string `type:"string" enum:"RIProductDescription"` // One or more Reserved Instances offering IDs. - ReservedInstancesOfferingIDs []*string `locationName:"ReservedInstancesOfferingId" type:"list"` + ReservedInstancesOfferingIds []*string `locationName:"ReservedInstancesOfferingId" type:"list"` metadataDescribeReservedInstancesOfferingsInput `json:"-" xml:"-"` } @@ -11774,6 +13368,16 @@ type metadataDescribeReservedInstancesOfferingsInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeReservedInstancesOfferingsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeReservedInstancesOfferingsInput) GoString() string { + return s.String() +} + type DescribeReservedInstancesOfferingsOutput struct { // The token to use to retrieve the next page of results. This value is null // when there are no more results to return. @@ -11789,6 +13393,16 @@ type metadataDescribeReservedInstancesOfferingsOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeReservedInstancesOfferingsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeReservedInstancesOfferingsOutput) GoString() string { + return s.String() +} + type DescribeReservedInstancesOutput struct { // A list of Reserved Instances. ReservedInstances []*ReservedInstances `locationName:"reservedInstancesSet" locationNameList:"item" type:"list"` @@ -11800,6 +13414,16 @@ type metadataDescribeReservedInstancesOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeReservedInstancesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeReservedInstancesOutput) GoString() string { + return s.String() +} + type DescribeRouteTablesInput struct { // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have @@ -11865,7 +13489,7 @@ type DescribeRouteTablesInput struct { // One or more route table IDs. // // Default: Describes all your route tables. - RouteTableIDs []*string `locationName:"RouteTableId" locationNameList:"item" type:"list"` + RouteTableIds []*string `locationName:"RouteTableId" locationNameList:"item" type:"list"` metadataDescribeRouteTablesInput `json:"-" xml:"-"` } @@ -11874,6 +13498,16 @@ type metadataDescribeRouteTablesInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeRouteTablesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeRouteTablesInput) GoString() string { + return s.String() +} + type DescribeRouteTablesOutput struct { // Information about one or more route tables. RouteTables []*RouteTable `locationName:"routeTableSet" locationNameList:"item" type:"list"` @@ -11885,14 +13519,26 @@ type metadataDescribeRouteTablesOutput struct { SDKShapeTraits bool `type:"structure"` } -type DescribeSecurityGroupsInput struct { - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have +// String returns the string representation +func (s DescribeRouteTablesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeRouteTablesOutput) GoString() string { + return s.String() +} + +type DescribeSecurityGroupsInput struct { + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have // the required permissions, the error response is DryRunOperation. Otherwise, // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` - // One or more filters. + // One or more filters. If using multiple filters for rules, the results include + // security groups for which any combination of rules - not necessarily a single + // rule - match all filters. // // description - The description of the security group. // @@ -11936,7 +13582,7 @@ type DescribeSecurityGroupsInput struct { // VPC. // // Default: Describes all your security groups. - GroupIDs []*string `locationName:"GroupId" locationNameList:"groupId" type:"list"` + GroupIds []*string `locationName:"GroupId" locationNameList:"groupId" type:"list"` // [EC2-Classic and default VPC only] One or more security group names. You // can specify either the security group name or the security group ID. For @@ -11953,6 +13599,16 @@ type metadataDescribeSecurityGroupsInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeSecurityGroupsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeSecurityGroupsInput) GoString() string { + return s.String() +} + type DescribeSecurityGroupsOutput struct { // Information about one or more security groups. SecurityGroups []*SecurityGroup `locationName:"securityGroupInfo" locationNameList:"item" type:"list"` @@ -11964,9 +13620,19 @@ type metadataDescribeSecurityGroupsOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeSecurityGroupsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeSecurityGroupsOutput) GoString() string { + return s.String() +} + type DescribeSnapshotAttributeInput struct { // The snapshot attribute you would like to view. - Attribute *string `type:"string" required:"true"` + Attribute *string `type:"string" required:"true" enum:"SnapshotAttributeName"` // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have @@ -11975,7 +13641,7 @@ type DescribeSnapshotAttributeInput struct { DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the EBS snapshot. - SnapshotID *string `locationName:"SnapshotId" type:"string" required:"true"` + SnapshotId *string `type:"string" required:"true"` metadataDescribeSnapshotAttributeInput `json:"-" xml:"-"` } @@ -11984,6 +13650,16 @@ type metadataDescribeSnapshotAttributeInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeSnapshotAttributeInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeSnapshotAttributeInput) GoString() string { + return s.String() +} + type DescribeSnapshotAttributeOutput struct { // A list of permissions for creating volumes from the snapshot. CreateVolumePermissions []*CreateVolumePermission `locationName:"createVolumePermission" locationNameList:"item" type:"list"` @@ -11992,7 +13668,7 @@ type DescribeSnapshotAttributeOutput struct { ProductCodes []*ProductCode `locationName:"productCodes" locationNameList:"item" type:"list"` // The ID of the EBS snapshot. - SnapshotID *string `locationName:"snapshotId" type:"string"` + SnapshotId *string `locationName:"snapshotId" type:"string"` metadataDescribeSnapshotAttributeOutput `json:"-" xml:"-"` } @@ -12001,6 +13677,16 @@ type metadataDescribeSnapshotAttributeOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeSnapshotAttributeOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeSnapshotAttributeOutput) GoString() string { + return s.String() +} + type DescribeSnapshotsInput struct { // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have @@ -12063,15 +13749,15 @@ type DescribeSnapshotsInput struct { // Returns the snapshots owned by the specified owner. Multiple owners can be // specified. - OwnerIDs []*string `locationName:"Owner" locationNameList:"Owner" type:"list"` + OwnerIds []*string `locationName:"Owner" locationNameList:"Owner" type:"list"` // One or more AWS accounts IDs that can create volumes from the snapshot. - RestorableByUserIDs []*string `locationName:"RestorableBy" type:"list"` + RestorableByUserIds []*string `locationName:"RestorableBy" type:"list"` // One or more snapshot IDs. // // Default: Describes snapshots for which you have launch permissions. - SnapshotIDs []*string `locationName:"SnapshotId" locationNameList:"SnapshotId" type:"list"` + SnapshotIds []*string `locationName:"SnapshotId" locationNameList:"SnapshotId" type:"list"` metadataDescribeSnapshotsInput `json:"-" xml:"-"` } @@ -12080,6 +13766,16 @@ type metadataDescribeSnapshotsInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeSnapshotsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeSnapshotsInput) GoString() string { + return s.String() +} + type DescribeSnapshotsOutput struct { // The NextToken value to include in a future DescribeSnapshots request. When // the results of a DescribeSnapshots request exceed MaxResults, this value @@ -12097,6 +13793,16 @@ type metadataDescribeSnapshotsOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeSnapshotsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeSnapshotsOutput) GoString() string { + return s.String() +} + // Contains the parameters for DescribeSpotDatafeedSubscription. type DescribeSpotDatafeedSubscriptionInput struct { // Checks whether you have the required permissions for the action, without @@ -12112,9 +13818,19 @@ type metadataDescribeSpotDatafeedSubscriptionInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeSpotDatafeedSubscriptionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeSpotDatafeedSubscriptionInput) GoString() string { + return s.String() +} + // Contains the output of DescribeSpotDatafeedSubscription. type DescribeSpotDatafeedSubscriptionOutput struct { - // The Spot Instance data feed subscription. + // The Spot instance data feed subscription. SpotDatafeedSubscription *SpotDatafeedSubscription `locationName:"spotDatafeedSubscription" type:"structure"` metadataDescribeSpotDatafeedSubscriptionOutput `json:"-" xml:"-"` @@ -12124,6 +13840,16 @@ type metadataDescribeSpotDatafeedSubscriptionOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeSpotDatafeedSubscriptionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeSpotDatafeedSubscriptionOutput) GoString() string { + return s.String() +} + // Contains the parameters for DescribeSpotFleetInstances. type DescribeSpotFleetInstancesInput struct { // Checks whether you have the required permissions for the action, without @@ -12141,7 +13867,7 @@ type DescribeSpotFleetInstancesInput struct { NextToken *string `locationName:"nextToken" type:"string"` // The ID of the Spot fleet request. - SpotFleetRequestID *string `locationName:"spotFleetRequestId" type:"string" required:"true"` + SpotFleetRequestId *string `locationName:"spotFleetRequestId" type:"string" required:"true"` metadataDescribeSpotFleetInstancesInput `json:"-" xml:"-"` } @@ -12150,6 +13876,16 @@ type metadataDescribeSpotFleetInstancesInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeSpotFleetInstancesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeSpotFleetInstancesInput) GoString() string { + return s.String() +} + // Contains the output of DescribeSpotFleetInstances. type DescribeSpotFleetInstancesOutput struct { // The running instances. Note that this list is refreshed periodically and @@ -12161,7 +13897,7 @@ type DescribeSpotFleetInstancesOutput struct { NextToken *string `locationName:"nextToken" type:"string"` // The ID of the Spot fleet request. - SpotFleetRequestID *string `locationName:"spotFleetRequestId" type:"string" required:"true"` + SpotFleetRequestId *string `locationName:"spotFleetRequestId" type:"string" required:"true"` metadataDescribeSpotFleetInstancesOutput `json:"-" xml:"-"` } @@ -12170,6 +13906,16 @@ type metadataDescribeSpotFleetInstancesOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeSpotFleetInstancesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeSpotFleetInstancesOutput) GoString() string { + return s.String() +} + // Contains the parameters for DescribeSpotFleetRequestHistory. type DescribeSpotFleetRequestHistoryInput struct { // Checks whether you have the required permissions for the action, without @@ -12179,7 +13925,7 @@ type DescribeSpotFleetRequestHistoryInput struct { DryRun *bool `locationName:"dryRun" type:"boolean"` // The type of events to describe. By default, all events are described. - EventType *string `locationName:"eventType" type:"string"` + EventType *string `locationName:"eventType" type:"string" enum:"EventType"` // The maximum number of results to return in a single call. Specify a value // between 1 and 1000. The default value is 1000. To retrieve the remaining @@ -12190,7 +13936,7 @@ type DescribeSpotFleetRequestHistoryInput struct { NextToken *string `locationName:"nextToken" type:"string"` // The ID of the Spot fleet request. - SpotFleetRequestID *string `locationName:"spotFleetRequestId" type:"string" required:"true"` + SpotFleetRequestId *string `locationName:"spotFleetRequestId" type:"string" required:"true"` // The starting date and time for the events, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ). StartTime *time.Time `locationName:"startTime" type:"timestamp" timestampFormat:"iso8601" required:"true"` @@ -12202,6 +13948,16 @@ type metadataDescribeSpotFleetRequestHistoryInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeSpotFleetRequestHistoryInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeSpotFleetRequestHistoryInput) GoString() string { + return s.String() +} + // Contains the output of DescribeSpotFleetRequestHistory. type DescribeSpotFleetRequestHistoryOutput struct { // Information about the events in the history of the Spot fleet request. @@ -12218,7 +13974,7 @@ type DescribeSpotFleetRequestHistoryOutput struct { NextToken *string `locationName:"nextToken" type:"string"` // The ID of the Spot fleet request. - SpotFleetRequestID *string `locationName:"spotFleetRequestId" type:"string" required:"true"` + SpotFleetRequestId *string `locationName:"spotFleetRequestId" type:"string" required:"true"` // The starting date and time for the events, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ). StartTime *time.Time `locationName:"startTime" type:"timestamp" timestampFormat:"iso8601" required:"true"` @@ -12230,6 +13986,16 @@ type metadataDescribeSpotFleetRequestHistoryOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeSpotFleetRequestHistoryOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeSpotFleetRequestHistoryOutput) GoString() string { + return s.String() +} + // Contains the parameters for DescribeSpotFleetRequests. type DescribeSpotFleetRequestsInput struct { // Checks whether you have the required permissions for the action, without @@ -12247,7 +14013,7 @@ type DescribeSpotFleetRequestsInput struct { NextToken *string `locationName:"nextToken" type:"string"` // The IDs of the Spot fleet requests. - SpotFleetRequestIDs []*string `locationName:"spotFleetRequestId" locationNameList:"item" type:"list"` + SpotFleetRequestIds []*string `locationName:"spotFleetRequestId" locationNameList:"item" type:"list"` metadataDescribeSpotFleetRequestsInput `json:"-" xml:"-"` } @@ -12256,6 +14022,16 @@ type metadataDescribeSpotFleetRequestsInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeSpotFleetRequestsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeSpotFleetRequestsInput) GoString() string { + return s.String() +} + // Contains the output of DescribeSpotFleetRequests. type DescribeSpotFleetRequestsOutput struct { // The token required to retrieve the next set of results. This value is null @@ -12272,6 +14048,16 @@ type metadataDescribeSpotFleetRequestsOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeSpotFleetRequestsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeSpotFleetRequestsOutput) GoString() string { + return s.String() +} + // Contains the parameters for DescribeSpotInstanceRequests. type DescribeSpotInstanceRequestsInput struct { // Checks whether you have the required permissions for the action, without @@ -12284,7 +14070,7 @@ type DescribeSpotInstanceRequestsInput struct { // // availability-zone-group - The Availability Zone group. // - // create-time - The time stamp when the Spot Instance request was created. + // create-time - The time stamp when the Spot instance request was created. // // fault-code - The fault code related to the request. // @@ -12292,7 +14078,7 @@ type DescribeSpotInstanceRequestsInput struct { // // instance-id - The ID of the instance that fulfilled the request. // - // launch-group - The Spot Instance launch group. + // launch-group - The Spot instance launch group. // // launch.block-device-mapping.delete-on-termination - Indicates whether // the Amazon EBS volume is deleted on instance termination. @@ -12320,7 +14106,7 @@ type DescribeSpotInstanceRequestsInput struct { // launch.key-name - The name of the key pair the instance launched with. // // launch.monitoring-enabled - Whether monitoring is enabled for the Spot - // Instance. + // instance. // // launch.ramdisk-id - The RAM disk ID. // @@ -12351,21 +14137,21 @@ type DescribeSpotInstanceRequestsInput struct { // product-description - The product description associated with the instance // (Linux/UNIX | Windows). // - // spot-instance-request-id - The Spot Instance request ID. + // spot-instance-request-id - The Spot instance request ID. // - // spot-price - The maximum hourly price for any Spot Instance launched to + // spot-price - The maximum hourly price for any Spot instance launched to // fulfill the request. // - // state - The state of the Spot Instance request (open | active | closed + // state - The state of the Spot instance request (open | active | closed // | cancelled | failed). Spot bid status information can help you track your - // Amazon EC2 Spot Instance requests. For more information, see Spot Bid Status + // Amazon EC2 Spot instance requests. For more information, see Spot Bid Status // (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-bid-status.html) // in the Amazon Elastic Compute Cloud User Guide. // // status-code - The short code describing the most recent evaluation of - // your Spot Instance request. + // your Spot instance request. // - // status-message - The message explaining the status of the Spot Instance + // status-message - The message explaining the status of the Spot instance // request. // // tag:key=value - The key/value combination of a tag assigned to the resource. @@ -12380,7 +14166,7 @@ type DescribeSpotInstanceRequestsInput struct { // tag-value - The value of a tag assigned to the resource. This filter is // independent of the tag-key filter. // - // type - The type of Spot Instance request (one-time | persistent). + // type - The type of Spot instance request (one-time | persistent). // // launched-availability-zone - The Availability Zone in which the bid is // launched. @@ -12390,8 +14176,8 @@ type DescribeSpotInstanceRequestsInput struct { // valid-until - The end date of the request. Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - // One or more Spot Instance request IDs. - SpotInstanceRequestIDs []*string `locationName:"SpotInstanceRequestId" locationNameList:"SpotInstanceRequestId" type:"list"` + // One or more Spot instance request IDs. + SpotInstanceRequestIds []*string `locationName:"SpotInstanceRequestId" locationNameList:"SpotInstanceRequestId" type:"list"` metadataDescribeSpotInstanceRequestsInput `json:"-" xml:"-"` } @@ -12400,9 +14186,19 @@ type metadataDescribeSpotInstanceRequestsInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeSpotInstanceRequestsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeSpotInstanceRequestsInput) GoString() string { + return s.String() +} + // Contains the output of DescribeSpotInstanceRequests. type DescribeSpotInstanceRequestsOutput struct { - // One or more Spot Instance requests. + // One or more Spot instance requests. SpotInstanceRequests []*SpotInstanceRequest `locationName:"spotInstanceRequestSet" locationNameList:"item" type:"list"` metadataDescribeSpotInstanceRequestsOutput `json:"-" xml:"-"` @@ -12412,6 +14208,16 @@ type metadataDescribeSpotInstanceRequestsOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeSpotInstanceRequestsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeSpotInstanceRequestsOutput) GoString() string { + return s.String() +} + // Contains the parameters for DescribeSpotPriceHistory. type DescribeSpotPriceHistoryInput struct { // Filters the results by the specified Availability Zone. @@ -12433,14 +14239,14 @@ type DescribeSpotPriceHistoryInput struct { // // instance-type - The type of instance (for example, m1.small). // - // product-description - The product description for the Spot Price (Linux/UNIX + // product-description - The product description for the Spot price (Linux/UNIX // | SUSE Linux | Windows | Linux/UNIX (Amazon VPC) | SUSE Linux (Amazon VPC) // | Windows (Amazon VPC)). // - // spot-price - The Spot Price. The value must match exactly (or use wildcards; + // spot-price - The Spot price. The value must match exactly (or use wildcards; // greater than or less than comparison is not supported). // - // timestamp - The timestamp of the Spot Price history, in UTC format (for + // timestamp - The timestamp of the Spot price history, in UTC format (for // example, YYYY-MM-DDTHH:MM:SSZ). You can use wildcards (* and ?). Greater // than or less than comparison is not supported. Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` @@ -12470,13 +14276,23 @@ type metadataDescribeSpotPriceHistoryInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeSpotPriceHistoryInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeSpotPriceHistoryInput) GoString() string { + return s.String() +} + // Contains the output of DescribeSpotPriceHistory. type DescribeSpotPriceHistoryOutput struct { // The token required to retrieve the next set of results. This value is null // when there are no more results to return. NextToken *string `locationName:"nextToken" type:"string"` - // The historical Spot Prices. + // The historical Spot prices. SpotPriceHistory []*SpotPrice `locationName:"spotPriceHistorySet" locationNameList:"item" type:"list"` metadataDescribeSpotPriceHistoryOutput `json:"-" xml:"-"` @@ -12486,6 +14302,16 @@ type metadataDescribeSpotPriceHistoryOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeSpotPriceHistoryOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeSpotPriceHistoryOutput) GoString() string { + return s.String() +} + type DescribeSubnetsInput struct { // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have @@ -12530,7 +14356,7 @@ type DescribeSubnetsInput struct { // One or more subnet IDs. // // Default: Describes all your subnets. - SubnetIDs []*string `locationName:"SubnetId" locationNameList:"SubnetId" type:"list"` + SubnetIds []*string `locationName:"SubnetId" locationNameList:"SubnetId" type:"list"` metadataDescribeSubnetsInput `json:"-" xml:"-"` } @@ -12539,6 +14365,16 @@ type metadataDescribeSubnetsInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeSubnetsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeSubnetsInput) GoString() string { + return s.String() +} + type DescribeSubnetsOutput struct { // Information about one or more subnets. Subnets []*Subnet `locationName:"subnetSet" locationNameList:"item" type:"list"` @@ -12550,6 +14386,16 @@ type metadataDescribeSubnetsOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeSubnetsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeSubnetsOutput) GoString() string { + return s.String() +} + type DescribeTagsInput struct { // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have @@ -12588,6 +14434,16 @@ type metadataDescribeTagsInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeTagsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeTagsInput) GoString() string { + return s.String() +} + type DescribeTagsOutput struct { // The token to use to retrieve the next page of results. This value is null // when there are no more results to return.. @@ -12603,189 +14459,177 @@ type metadataDescribeTagsOutput struct { SDKShapeTraits bool `type:"structure"` } -type DescribeVPCAttributeInput struct { - // The VPC attribute. - Attribute *string `type:"string"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The ID of the VPC. - VPCID *string `locationName:"VpcId" type:"string" required:"true"` - - metadataDescribeVPCAttributeInput `json:"-" xml:"-"` -} - -type metadataDescribeVPCAttributeInput struct { - SDKShapeTraits bool `type:"structure"` +// String returns the string representation +func (s DescribeTagsOutput) String() string { + return awsutil.Prettify(s) } -type DescribeVPCAttributeOutput struct { - // Indicates whether the instances launched in the VPC get DNS hostnames. If - // this attribute is true, instances in the VPC get DNS hostnames; otherwise, - // they do not. - EnableDNSHostnames *AttributeBooleanValue `locationName:"enableDnsHostnames" type:"structure"` - - // Indicates whether DNS resolution is enabled for the VPC. If this attribute - // is true, the Amazon DNS server resolves DNS hostnames for your instances - // to their corresponding IP addresses; otherwise, it does not. - EnableDNSSupport *AttributeBooleanValue `locationName:"enableDnsSupport" type:"structure"` - - // The ID of the VPC. - VPCID *string `locationName:"vpcId" type:"string"` - - metadataDescribeVPCAttributeOutput `json:"-" xml:"-"` +// GoString returns the string representation +func (s DescribeTagsOutput) GoString() string { + return s.String() } -type metadataDescribeVPCAttributeOutput struct { - SDKShapeTraits bool `type:"structure"` -} +type DescribeVolumeAttributeInput struct { + // The instance attribute. + Attribute *string `type:"string" enum:"VolumeAttributeName"` -type DescribeVPCClassicLinkInput struct { // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have // the required permissions, the error response is DryRunOperation. Otherwise, // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` - // One or more filters. - // - // is-classic-link-enabled - Whether the VPC is enabled for ClassicLink (true - // | false). - // - // tag:key=value - The key/value combination of a tag assigned to the resource. - // - // tag-key - The key of a tag assigned to the resource. This filter is independent - // of the tag-value filter. For example, if you use both the filter "tag-key=Purpose" - // and the filter "tag-value=X", you get any resources assigned both the tag - // key Purpose (regardless of what the tag's value is), and the tag value X - // (regardless of what the tag's key is). If you want to list only resources - // where Purpose is X, see the tag:key=value filter. - // - // tag-value - The value of a tag assigned to the resource. This filter is - // independent of the tag-key filter. - Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - - // One or more VPCs for which you want to describe the ClassicLink status. - VPCIDs []*string `locationName:"VpcId" locationNameList:"VpcId" type:"list"` + // The ID of the volume. + VolumeId *string `type:"string" required:"true"` - metadataDescribeVPCClassicLinkInput `json:"-" xml:"-"` + metadataDescribeVolumeAttributeInput `json:"-" xml:"-"` } -type metadataDescribeVPCClassicLinkInput struct { +type metadataDescribeVolumeAttributeInput struct { SDKShapeTraits bool `type:"structure"` } -type DescribeVPCClassicLinkOutput struct { - // The ClassicLink status of one or more VPCs. - VPCs []*VPCClassicLink `locationName:"vpcSet" locationNameList:"item" type:"list"` - - metadataDescribeVPCClassicLinkOutput `json:"-" xml:"-"` +// String returns the string representation +func (s DescribeVolumeAttributeInput) String() string { + return awsutil.Prettify(s) } -type metadataDescribeVPCClassicLinkOutput struct { - SDKShapeTraits bool `type:"structure"` +// GoString returns the string representation +func (s DescribeVolumeAttributeInput) GoString() string { + return s.String() } -type DescribeVPCEndpointServicesInput struct { - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `type:"boolean"` +type DescribeVolumeAttributeOutput struct { + // The state of autoEnableIO attribute. + AutoEnableIO *AttributeBooleanValue `locationName:"autoEnableIO" type:"structure"` - // The maximum number of items to return for this request. The request returns - // a token that you can specify in a subsequent call to get the next set of - // results. - // - // Constraint: If the value is greater than 1000, we return only 1000 items. - MaxResults *int64 `type:"integer"` + // A list of product codes. + ProductCodes []*ProductCode `locationName:"productCodes" locationNameList:"item" type:"list"` - // The token for the next set of items to return. (You received this token from - // a prior call.) - NextToken *string `type:"string"` + // The ID of the volume. + VolumeId *string `locationName:"volumeId" type:"string"` - metadataDescribeVPCEndpointServicesInput `json:"-" xml:"-"` + metadataDescribeVolumeAttributeOutput `json:"-" xml:"-"` } -type metadataDescribeVPCEndpointServicesInput struct { +type metadataDescribeVolumeAttributeOutput struct { SDKShapeTraits bool `type:"structure"` } -type DescribeVPCEndpointServicesOutput struct { - // The token to use when requesting the next set of items. If there are no additional - // items to return, the string is empty. - NextToken *string `locationName:"nextToken" type:"string"` - - // A list of supported AWS services. - ServiceNames []*string `locationName:"serviceNameSet" locationNameList:"item" type:"list"` - - metadataDescribeVPCEndpointServicesOutput `json:"-" xml:"-"` +// String returns the string representation +func (s DescribeVolumeAttributeOutput) String() string { + return awsutil.Prettify(s) } -type metadataDescribeVPCEndpointServicesOutput struct { - SDKShapeTraits bool `type:"structure"` +// GoString returns the string representation +func (s DescribeVolumeAttributeOutput) GoString() string { + return s.String() } -type DescribeVPCEndpointsInput struct { +type DescribeVolumeStatusInput struct { // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have // the required permissions, the error response is DryRunOperation. Otherwise, // it is UnauthorizedOperation. - DryRun *bool `type:"boolean"` + DryRun *bool `locationName:"dryRun" type:"boolean"` // One or more filters. // - // service-name: The name of the AWS service. + // action.code - The action code for the event (for example, enable-volume-io). // - // vpc-id: The ID of the VPC in which the endpoint resides. + // action.description - A description of the action. // - // vpc-endpoint-id: The ID of the endpoint. + // action.event-id - The event ID associated with the action. // - // vpc-endpoint-state: The state of the endpoint. (pending | available | - // deleting | deleted) + // availability-zone - The Availability Zone of the instance. + // + // event.description - A description of the event. + // + // event.event-id - The event ID. + // + // event.event-type - The event type (for io-enabled: passed | failed; for + // io-performance: io-performance:degraded | io-performance:severely-degraded + // | io-performance:stalled). + // + // event.not-after - The latest end time for the event. + // + // event.not-before - The earliest start time for the event. + // + // volume-status.details-name - The cause for volume-status.status (io-enabled + // | io-performance). + // + // volume-status.details-status - The status of volume-status.details-name + // (for io-enabled: passed | failed; for io-performance: normal | degraded | + // severely-degraded | stalled). + // + // volume-status.status - The status of the volume (ok | impaired | warning + // | insufficient-data). Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - // The maximum number of items to return for this request. The request returns - // a token that you can specify in a subsequent call to get the next set of - // results. - // - // Constraint: If the value is greater than 1000, we return only 1000 items. + // The maximum number of volume results returned by DescribeVolumeStatus in + // paginated output. When this parameter is used, the request only returns MaxResults + // results in a single page along with a NextToken response element. The remaining + // results of the initial request can be seen by sending another request with + // the returned NextToken value. This value can be between 5 and 1000; if MaxResults + // is given a value larger than 1000, only 1000 results are returned. If this + // parameter is not used, then DescribeVolumeStatus returns all results. You + // cannot specify this parameter and the volume IDs parameter in the same request. MaxResults *int64 `type:"integer"` - // The token for the next set of items to return. (You received this token from - // a prior call.) + // The NextToken value to include in a future DescribeVolumeStatus request. + // When the results of the request exceed MaxResults, this value can be used + // to retrieve the next page of results. This value is null when there are no + // more results to return. NextToken *string `type:"string"` - // One or more endpoint IDs. - VPCEndpointIDs []*string `locationName:"VpcEndpointId" locationNameList:"item" type:"list"` + // One or more volume IDs. + // + // Default: Describes all your volumes. + VolumeIds []*string `locationName:"VolumeId" locationNameList:"VolumeId" type:"list"` - metadataDescribeVPCEndpointsInput `json:"-" xml:"-"` + metadataDescribeVolumeStatusInput `json:"-" xml:"-"` } -type metadataDescribeVPCEndpointsInput struct { +type metadataDescribeVolumeStatusInput struct { SDKShapeTraits bool `type:"structure"` } -type DescribeVPCEndpointsOutput struct { - // The token to use when requesting the next set of items. If there are no additional - // items to return, the string is empty. +// String returns the string representation +func (s DescribeVolumeStatusInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeVolumeStatusInput) GoString() string { + return s.String() +} + +type DescribeVolumeStatusOutput struct { + // The token to use to retrieve the next page of results. This value is null + // when there are no more results to return. NextToken *string `locationName:"nextToken" type:"string"` - // Information about the endpoints. - VPCEndpoints []*VPCEndpoint `locationName:"vpcEndpointSet" locationNameList:"item" type:"list"` + // A list of volumes. + VolumeStatuses []*VolumeStatusItem `locationName:"volumeStatusSet" locationNameList:"item" type:"list"` - metadataDescribeVPCEndpointsOutput `json:"-" xml:"-"` + metadataDescribeVolumeStatusOutput `json:"-" xml:"-"` } -type metadataDescribeVPCEndpointsOutput struct { +type metadataDescribeVolumeStatusOutput struct { SDKShapeTraits bool `type:"structure"` } -type DescribeVPCPeeringConnectionsInput struct { +// String returns the string representation +func (s DescribeVolumeStatusOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeVolumeStatusOutput) GoString() string { + return s.String() +} + +type DescribeVolumesInput struct { // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have // the required permissions, the error response is DryRunOperation. Otherwise, @@ -12794,27 +14638,32 @@ type DescribeVPCPeeringConnectionsInput struct { // One or more filters. // - // accepter-vpc-info.cidr-block - The CIDR block of the peer VPC. + // attachment.attach-time - The time stamp when the attachment initiated. // - // accepter-vpc-info.owner-id - The AWS account ID of the owner of the peer - // VPC. + // attachment.delete-on-termination - Whether the volume is deleted on instance + // termination. // - // accepter-vpc-info.vpc-id - The ID of the peer VPC. + // attachment.device - The device name that is exposed to the instance (for + // example, /dev/sda1). // - // expiration-time - The expiration date and time for the VPC peering connection. + // attachment.instance-id - The ID of the instance the volume is attached + // to. // - // requester-vpc-info.cidr-block - The CIDR block of the requester's VPC. + // attachment.status - The attachment state (attaching | attached | detaching + // | detached). // - // requester-vpc-info.owner-id - The AWS account ID of the owner of the requester - // VPC. + // availability-zone - The Availability Zone in which the volume was created. // - // requester-vpc-info.vpc-id - The ID of the requester VPC. + // create-time - The time stamp when the volume was created. // - // status-code - The status of the VPC peering connection (pending-acceptance - // | failed | expired | provisioning | active | deleted | rejected). + // encrypted - The encryption status of the volume. // - // status-message - A message that provides more information about the status - // of the VPC peering connection, if applicable. + // size - The size of the volume, in GiB. + // + // snapshot-id - The snapshot from which the volume was created. + // + // status - The status of the volume (creating | available | in-use | deleting + // | deleted | error). // // tag:key=value - The key/value combination of a tag assigned to the resource. // @@ -12828,162 +14677,139 @@ type DescribeVPCPeeringConnectionsInput struct { // tag-value - The value of a tag assigned to the resource. This filter is // independent of the tag-key filter. // - // vpc-peering-connection-id - The ID of the VPC peering connection. + // volume-id - The volume ID. + // + // volume-type - The Amazon EBS volume type. This can be gp2 for General + // Purpose (SSD) volumes, io1 for Provisioned IOPS (SSD) volumes, or standard + // for Magnetic volumes. Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - // One or more VPC peering connection IDs. - // - // Default: Describes all your VPC peering connections. - VPCPeeringConnectionIDs []*string `locationName:"VpcPeeringConnectionId" locationNameList:"item" type:"list"` + // The maximum number of volume results returned by DescribeVolumes in paginated + // output. When this parameter is used, DescribeVolumes only returns MaxResults + // results in a single page along with a NextToken response element. The remaining + // results of the initial request can be seen by sending another DescribeVolumes + // request with the returned NextToken value. This value can be between 5 and + // 1000; if MaxResults is given a value larger than 1000, only 1000 results + // are returned. If this parameter is not used, then DescribeVolumes returns + // all results. You cannot specify this parameter and the volume IDs parameter + // in the same request. + MaxResults *int64 `locationName:"maxResults" type:"integer"` + + // The NextToken value returned from a previous paginated DescribeVolumes request + // where MaxResults was used and the results exceeded the value of that parameter. + // Pagination continues from the end of the previous results that returned the + // NextToken value. This value is null when there are no more results to return. + NextToken *string `locationName:"nextToken" type:"string"` + + // One or more volume IDs. + VolumeIds []*string `locationName:"VolumeId" locationNameList:"VolumeId" type:"list"` - metadataDescribeVPCPeeringConnectionsInput `json:"-" xml:"-"` + metadataDescribeVolumesInput `json:"-" xml:"-"` } -type metadataDescribeVPCPeeringConnectionsInput struct { +type metadataDescribeVolumesInput struct { SDKShapeTraits bool `type:"structure"` } -type DescribeVPCPeeringConnectionsOutput struct { - // Information about the VPC peering connections. - VPCPeeringConnections []*VPCPeeringConnection `locationName:"vpcPeeringConnectionSet" locationNameList:"item" type:"list"` +// String returns the string representation +func (s DescribeVolumesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeVolumesInput) GoString() string { + return s.String() +} + +type DescribeVolumesOutput struct { + // The NextToken value to include in a future DescribeVolumes request. When + // the results of a DescribeVolumes request exceed MaxResults, this value can + // be used to retrieve the next page of results. This value is null when there + // are no more results to return. + NextToken *string `locationName:"nextToken" type:"string"` + + // Information about the volumes. + Volumes []*Volume `locationName:"volumeSet" locationNameList:"item" type:"list"` - metadataDescribeVPCPeeringConnectionsOutput `json:"-" xml:"-"` + metadataDescribeVolumesOutput `json:"-" xml:"-"` } -type metadataDescribeVPCPeeringConnectionsOutput struct { +type metadataDescribeVolumesOutput struct { SDKShapeTraits bool `type:"structure"` } -type DescribeVPCsInput struct { +// String returns the string representation +func (s DescribeVolumesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeVolumesOutput) GoString() string { + return s.String() +} + +type DescribeVpcAttributeInput struct { + // The VPC attribute. + Attribute *string `type:"string" enum:"VpcAttributeName"` + // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have // the required permissions, the error response is DryRunOperation. Otherwise, // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` - // One or more filters. - // - // cidr - The CIDR block of the VPC. The CIDR block you specify must exactly - // match the VPC's CIDR block for information to be returned for the VPC. Must - // contain the slash followed by one or two digits (for example, /28). - // - // dhcp-options-id - The ID of a set of DHCP options. - // - // isDefault - Indicates whether the VPC is the default VPC. - // - // state - The state of the VPC (pending | available). - // - // tag:key=value - The key/value combination of a tag assigned to the resource. - // - // tag-key - The key of a tag assigned to the resource. This filter is independent - // of the tag-value filter. For example, if you use both the filter "tag-key=Purpose" - // and the filter "tag-value=X", you get any resources assigned both the tag - // key Purpose (regardless of what the tag's value is), and the tag value X - // (regardless of what the tag's key is). If you want to list only resources - // where Purpose is X, see the tag:key=value filter. - // - // tag-value - The value of a tag assigned to the resource. This filter is - // independent of the tag-key filter. - // - // vpc-id - The ID of the VPC. - Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - - // One or more VPC IDs. - // - // Default: Describes all your VPCs. - VPCIDs []*string `locationName:"VpcId" locationNameList:"VpcId" type:"list"` + // The ID of the VPC. + VpcId *string `type:"string" required:"true"` - metadataDescribeVPCsInput `json:"-" xml:"-"` + metadataDescribeVpcAttributeInput `json:"-" xml:"-"` } -type metadataDescribeVPCsInput struct { +type metadataDescribeVpcAttributeInput struct { SDKShapeTraits bool `type:"structure"` } -type DescribeVPCsOutput struct { - // Information about one or more VPCs. - VPCs []*VPC `locationName:"vpcSet" locationNameList:"item" type:"list"` - - metadataDescribeVPCsOutput `json:"-" xml:"-"` +// String returns the string representation +func (s DescribeVpcAttributeInput) String() string { + return awsutil.Prettify(s) } -type metadataDescribeVPCsOutput struct { - SDKShapeTraits bool `type:"structure"` +// GoString returns the string representation +func (s DescribeVpcAttributeInput) GoString() string { + return s.String() } -type DescribeVPNConnectionsInput struct { - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` +type DescribeVpcAttributeOutput struct { + // Indicates whether the instances launched in the VPC get DNS hostnames. If + // this attribute is true, instances in the VPC get DNS hostnames; otherwise, + // they do not. + EnableDnsHostnames *AttributeBooleanValue `locationName:"enableDnsHostnames" type:"structure"` - // One or more filters. - // - // customer-gateway-configuration - The configuration information for the - // customer gateway. - // - // customer-gateway-id - The ID of a customer gateway associated with the - // VPN connection. - // - // state - The state of the VPN connection (pending | available | deleting - // | deleted). - // - // option.static-routes-only - Indicates whether the connection has static - // routes only. Used for devices that do not support Border Gateway Protocol - // (BGP). - // - // route.destination-cidr-block - The destination CIDR block. This corresponds - // to the subnet used in a customer data center. - // - // bgp-asn - The BGP Autonomous System Number (ASN) associated with a BGP - // device. - // - // tag:key=value - The key/value combination of a tag assigned to the resource. - // - // tag-key - The key of a tag assigned to the resource. This filter is independent - // of the tag-value filter. For example, if you use both the filter "tag-key=Purpose" - // and the filter "tag-value=X", you get any resources assigned both the tag - // key Purpose (regardless of what the tag's value is), and the tag value X - // (regardless of what the tag's key is). If you want to list only resources - // where Purpose is X, see the tag:key=value filter. - // - // tag-value - The value of a tag assigned to the resource. This filter is - // independent of the tag-key filter. - // - // type - The type of VPN connection. Currently the only supported type is - // ipsec.1. - // - // vpn-connection-id - The ID of the VPN connection. - // - // vpn-gateway-id - The ID of a virtual private gateway associated with the - // VPN connection. - Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` + // Indicates whether DNS resolution is enabled for the VPC. If this attribute + // is true, the Amazon DNS server resolves DNS hostnames for your instances + // to their corresponding IP addresses; otherwise, it does not. + EnableDnsSupport *AttributeBooleanValue `locationName:"enableDnsSupport" type:"structure"` - // One or more VPN connection IDs. - // - // Default: Describes your VPN connections. - VPNConnectionIDs []*string `locationName:"VpnConnectionId" locationNameList:"VpnConnectionId" type:"list"` + // The ID of the VPC. + VpcId *string `locationName:"vpcId" type:"string"` - metadataDescribeVPNConnectionsInput `json:"-" xml:"-"` + metadataDescribeVpcAttributeOutput `json:"-" xml:"-"` } -type metadataDescribeVPNConnectionsInput struct { +type metadataDescribeVpcAttributeOutput struct { SDKShapeTraits bool `type:"structure"` } -type DescribeVPNConnectionsOutput struct { - // Information about one or more VPN connections. - VPNConnections []*VPNConnection `locationName:"vpnConnectionSet" locationNameList:"item" type:"list"` - - metadataDescribeVPNConnectionsOutput `json:"-" xml:"-"` +// String returns the string representation +func (s DescribeVpcAttributeOutput) String() string { + return awsutil.Prettify(s) } -type metadataDescribeVPNConnectionsOutput struct { - SDKShapeTraits bool `type:"structure"` +// GoString returns the string representation +func (s DescribeVpcAttributeOutput) GoString() string { + return s.String() } -type DescribeVPNGatewaysInput struct { +type DescribeVpcClassicLinkInput struct { // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have // the required permissions, the error response is DryRunOperation. Otherwise, @@ -12992,15 +14818,8 @@ type DescribeVPNGatewaysInput struct { // One or more filters. // - // attachment.state - The current state of the attachment between the gateway - // and the VPC (attaching | attached | detaching | detached). - // - // attachment.vpc-id - The ID of an attached VPC. - // - // availability-zone - The Availability Zone for the virtual private gateway. - // - // state - The state of the virtual private gateway (pending | available - // | deleting | deleted). + // is-classic-link-enabled - Whether the VPC is enabled for ClassicLink (true + // | false). // // tag:key=value - The key/value combination of a tag assigned to the resource. // @@ -13013,157 +14832,185 @@ type DescribeVPNGatewaysInput struct { // // tag-value - The value of a tag assigned to the resource. This filter is // independent of the tag-key filter. - // - // type - The type of virtual private gateway. Currently the only supported - // type is ipsec.1. - // - // vpn-gateway-id - The ID of the virtual private gateway. Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - // One or more virtual private gateway IDs. - // - // Default: Describes all your virtual private gateways. - VPNGatewayIDs []*string `locationName:"VpnGatewayId" locationNameList:"VpnGatewayId" type:"list"` + // One or more VPCs for which you want to describe the ClassicLink status. + VpcIds []*string `locationName:"VpcId" locationNameList:"VpcId" type:"list"` - metadataDescribeVPNGatewaysInput `json:"-" xml:"-"` + metadataDescribeVpcClassicLinkInput `json:"-" xml:"-"` } -type metadataDescribeVPNGatewaysInput struct { +type metadataDescribeVpcClassicLinkInput struct { SDKShapeTraits bool `type:"structure"` } -type DescribeVPNGatewaysOutput struct { - // Information about one or more virtual private gateways. - VPNGateways []*VPNGateway `locationName:"vpnGatewaySet" locationNameList:"item" type:"list"` +// String returns the string representation +func (s DescribeVpcClassicLinkInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeVpcClassicLinkInput) GoString() string { + return s.String() +} + +type DescribeVpcClassicLinkOutput struct { + // The ClassicLink status of one or more VPCs. + Vpcs []*VpcClassicLink `locationName:"vpcSet" locationNameList:"item" type:"list"` - metadataDescribeVPNGatewaysOutput `json:"-" xml:"-"` + metadataDescribeVpcClassicLinkOutput `json:"-" xml:"-"` } -type metadataDescribeVPNGatewaysOutput struct { +type metadataDescribeVpcClassicLinkOutput struct { SDKShapeTraits bool `type:"structure"` } -type DescribeVolumeAttributeInput struct { - // The instance attribute. - Attribute *string `type:"string"` +// String returns the string representation +func (s DescribeVpcClassicLinkOutput) String() string { + return awsutil.Prettify(s) +} +// GoString returns the string representation +func (s DescribeVpcClassicLinkOutput) GoString() string { + return s.String() +} + +type DescribeVpcEndpointServicesInput struct { // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have // the required permissions, the error response is DryRunOperation. Otherwise, // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` + DryRun *bool `type:"boolean"` - // The ID of the volume. - VolumeID *string `locationName:"VolumeId" type:"string" required:"true"` + // The maximum number of items to return for this request. The request returns + // a token that you can specify in a subsequent call to get the next set of + // results. + // + // Constraint: If the value is greater than 1000, we return only 1000 items. + MaxResults *int64 `type:"integer"` - metadataDescribeVolumeAttributeInput `json:"-" xml:"-"` + // The token for the next set of items to return. (You received this token from + // a prior call.) + NextToken *string `type:"string"` + + metadataDescribeVpcEndpointServicesInput `json:"-" xml:"-"` } -type metadataDescribeVolumeAttributeInput struct { +type metadataDescribeVpcEndpointServicesInput struct { SDKShapeTraits bool `type:"structure"` } -type DescribeVolumeAttributeOutput struct { - // The state of autoEnableIO attribute. - AutoEnableIO *AttributeBooleanValue `locationName:"autoEnableIO" type:"structure"` +// String returns the string representation +func (s DescribeVpcEndpointServicesInput) String() string { + return awsutil.Prettify(s) +} - // A list of product codes. - ProductCodes []*ProductCode `locationName:"productCodes" locationNameList:"item" type:"list"` +// GoString returns the string representation +func (s DescribeVpcEndpointServicesInput) GoString() string { + return s.String() +} - // The ID of the volume. - VolumeID *string `locationName:"volumeId" type:"string"` +type DescribeVpcEndpointServicesOutput struct { + // The token to use when requesting the next set of items. If there are no additional + // items to return, the string is empty. + NextToken *string `locationName:"nextToken" type:"string"` - metadataDescribeVolumeAttributeOutput `json:"-" xml:"-"` + // A list of supported AWS services. + ServiceNames []*string `locationName:"serviceNameSet" locationNameList:"item" type:"list"` + + metadataDescribeVpcEndpointServicesOutput `json:"-" xml:"-"` } -type metadataDescribeVolumeAttributeOutput struct { +type metadataDescribeVpcEndpointServicesOutput struct { SDKShapeTraits bool `type:"structure"` } -type DescribeVolumeStatusInput struct { +// String returns the string representation +func (s DescribeVpcEndpointServicesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeVpcEndpointServicesOutput) GoString() string { + return s.String() +} + +type DescribeVpcEndpointsInput struct { // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have // the required permissions, the error response is DryRunOperation. Otherwise, // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` + DryRun *bool `type:"boolean"` // One or more filters. // - // action.code - The action code for the event (for example, enable-volume-io). - // - // action.description - A description of the action. - // - // action.event-id - The event ID associated with the action. - // - // availability-zone - The Availability Zone of the instance. + // service-name: The name of the AWS service. // - // event.description - A description of the event. + // vpc-id: The ID of the VPC in which the endpoint resides. // - // event.event-id - The event ID. + // vpc-endpoint-id: The ID of the endpoint. // - // event.event-type - The event type (for io-enabled: passed | failed; for - // io-performance: io-performance:degraded | io-performance:severely-degraded - // | io-performance:stalled). - // - // event.not-after - The latest end time for the event. - // - // event.not-before - The earliest start time for the event. - // - // volume-status.details-name - The cause for volume-status.status (io-enabled - // | io-performance). - // - // volume-status.details-status - The status of volume-status.details-name - // (for io-enabled: passed | failed; for io-performance: normal | degraded | - // severely-degraded | stalled). - // - // volume-status.status - The status of the volume (ok | impaired | warning - // | insufficient-data). + // vpc-endpoint-state: The state of the endpoint. (pending | available | + // deleting | deleted) Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - // The maximum number of volume results returned by DescribeVolumeStatus in - // paginated output. When this parameter is used, the request only returns MaxResults - // results in a single page along with a NextToken response element. The remaining - // results of the initial request can be seen by sending another request with - // the returned NextToken value. This value can be between 5 and 1000; if MaxResults - // is given a value larger than 1000, only 1000 results are returned. If this - // parameter is not used, then DescribeVolumeStatus returns all results. You - // cannot specify this parameter and the volume IDs parameter in the same request. + // The maximum number of items to return for this request. The request returns + // a token that you can specify in a subsequent call to get the next set of + // results. + // + // Constraint: If the value is greater than 1000, we return only 1000 items. MaxResults *int64 `type:"integer"` - // The NextToken value to include in a future DescribeVolumeStatus request. - // When the results of the request exceed MaxResults, this value can be used - // to retrieve the next page of results. This value is null when there are no - // more results to return. + // The token for the next set of items to return. (You received this token from + // a prior call.) NextToken *string `type:"string"` - // One or more volume IDs. - // - // Default: Describes all your volumes. - VolumeIDs []*string `locationName:"VolumeId" locationNameList:"VolumeId" type:"list"` + // One or more endpoint IDs. + VpcEndpointIds []*string `locationName:"VpcEndpointId" locationNameList:"item" type:"list"` - metadataDescribeVolumeStatusInput `json:"-" xml:"-"` + metadataDescribeVpcEndpointsInput `json:"-" xml:"-"` } -type metadataDescribeVolumeStatusInput struct { +type metadataDescribeVpcEndpointsInput struct { SDKShapeTraits bool `type:"structure"` } -type DescribeVolumeStatusOutput struct { - // The token to use to retrieve the next page of results. This value is null - // when there are no more results to return. +// String returns the string representation +func (s DescribeVpcEndpointsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeVpcEndpointsInput) GoString() string { + return s.String() +} + +type DescribeVpcEndpointsOutput struct { + // The token to use when requesting the next set of items. If there are no additional + // items to return, the string is empty. NextToken *string `locationName:"nextToken" type:"string"` - // A list of volumes. - VolumeStatuses []*VolumeStatusItem `locationName:"volumeStatusSet" locationNameList:"item" type:"list"` + // Information about the endpoints. + VpcEndpoints []*VpcEndpoint `locationName:"vpcEndpointSet" locationNameList:"item" type:"list"` - metadataDescribeVolumeStatusOutput `json:"-" xml:"-"` + metadataDescribeVpcEndpointsOutput `json:"-" xml:"-"` } -type metadataDescribeVolumeStatusOutput struct { +type metadataDescribeVpcEndpointsOutput struct { SDKShapeTraits bool `type:"structure"` } -type DescribeVolumesInput struct { +// String returns the string representation +func (s DescribeVpcEndpointsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeVpcEndpointsOutput) GoString() string { + return s.String() +} + +type DescribeVpcPeeringConnectionsInput struct { // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have // the required permissions, the error response is DryRunOperation. Otherwise, @@ -13172,32 +15019,27 @@ type DescribeVolumesInput struct { // One or more filters. // - // attachment.attach-time - The time stamp when the attachment initiated. - // - // attachment.delete-on-termination - Whether the volume is deleted on instance - // termination. - // - // attachment.device - The device name that is exposed to the instance (for - // example, /dev/sda1). + // accepter-vpc-info.cidr-block - The CIDR block of the peer VPC. // - // attachment.instance-id - The ID of the instance the volume is attached - // to. + // accepter-vpc-info.owner-id - The AWS account ID of the owner of the peer + // VPC. // - // attachment.status - The attachment state (attaching | attached | detaching - // | detached). + // accepter-vpc-info.vpc-id - The ID of the peer VPC. // - // availability-zone - The Availability Zone in which the volume was created. + // expiration-time - The expiration date and time for the VPC peering connection. // - // create-time - The time stamp when the volume was created. + // requester-vpc-info.cidr-block - The CIDR block of the requester's VPC. // - // encrypted - The encryption status of the volume. + // requester-vpc-info.owner-id - The AWS account ID of the owner of the requester + // VPC. // - // size - The size of the volume, in GiB. + // requester-vpc-info.vpc-id - The ID of the requester VPC. // - // snapshot-id - The snapshot from which the volume was created. + // status-code - The status of the VPC peering connection (pending-acceptance + // | failed | expired | provisioning | active | deleted | rejected). // - // status - The status of the volume (creating | available | in-use | deleting - // | deleted | error). + // status-message - A message that provides more information about the status + // of the VPC peering connection, if applicable. // // tag:key=value - The key/value combination of a tag assigned to the resource. // @@ -13211,172 +15053,448 @@ type DescribeVolumesInput struct { // tag-value - The value of a tag assigned to the resource. This filter is // independent of the tag-key filter. // - // volume-id - The volume ID. - // - // volume-type - The Amazon EBS volume type. This can be gp2 for General - // Purpose (SSD) volumes, io1 for Provisioned IOPS (SSD) volumes, or standard - // for Magnetic volumes. + // vpc-peering-connection-id - The ID of the VPC peering connection. Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - // The maximum number of volume results returned by DescribeVolumes in paginated - // output. When this parameter is used, DescribeVolumes only returns MaxResults - // results in a single page along with a NextToken response element. The remaining - // results of the initial request can be seen by sending another DescribeVolumes - // request with the returned NextToken value. This value can be between 5 and - // 1000; if MaxResults is given a value larger than 1000, only 1000 results - // are returned. If this parameter is not used, then DescribeVolumes returns - // all results. You cannot specify this parameter and the volume IDs parameter - // in the same request. - MaxResults *int64 `locationName:"maxResults" type:"integer"` - - // The NextToken value returned from a previous paginated DescribeVolumes request - // where MaxResults was used and the results exceeded the value of that parameter. - // Pagination continues from the end of the previous results that returned the - // NextToken value. This value is null when there are no more results to return. - NextToken *string `locationName:"nextToken" type:"string"` - - // One or more volume IDs. - VolumeIDs []*string `locationName:"VolumeId" locationNameList:"VolumeId" type:"list"` + // One or more VPC peering connection IDs. + // + // Default: Describes all your VPC peering connections. + VpcPeeringConnectionIds []*string `locationName:"VpcPeeringConnectionId" locationNameList:"item" type:"list"` - metadataDescribeVolumesInput `json:"-" xml:"-"` + metadataDescribeVpcPeeringConnectionsInput `json:"-" xml:"-"` } -type metadataDescribeVolumesInput struct { +type metadataDescribeVpcPeeringConnectionsInput struct { SDKShapeTraits bool `type:"structure"` } -type DescribeVolumesOutput struct { - // The NextToken value to include in a future DescribeVolumes request. When - // the results of a DescribeVolumes request exceed MaxResults, this value can - // be used to retrieve the next page of results. This value is null when there - // are no more results to return. - NextToken *string `locationName:"nextToken" type:"string"` +// String returns the string representation +func (s DescribeVpcPeeringConnectionsInput) String() string { + return awsutil.Prettify(s) +} - // Information about the volumes. - Volumes []*Volume `locationName:"volumeSet" locationNameList:"item" type:"list"` +// GoString returns the string representation +func (s DescribeVpcPeeringConnectionsInput) GoString() string { + return s.String() +} - metadataDescribeVolumesOutput `json:"-" xml:"-"` +type DescribeVpcPeeringConnectionsOutput struct { + // Information about the VPC peering connections. + VpcPeeringConnections []*VpcPeeringConnection `locationName:"vpcPeeringConnectionSet" locationNameList:"item" type:"list"` + + metadataDescribeVpcPeeringConnectionsOutput `json:"-" xml:"-"` } -type metadataDescribeVolumesOutput struct { +type metadataDescribeVpcPeeringConnectionsOutput struct { SDKShapeTraits bool `type:"structure"` } -type DetachClassicLinkVPCInput struct { +// String returns the string representation +func (s DescribeVpcPeeringConnectionsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeVpcPeeringConnectionsOutput) GoString() string { + return s.String() +} + +type DescribeVpcsInput struct { // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have // the required permissions, the error response is DryRunOperation. Otherwise, // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` - // The ID of the instance to unlink from the VPC. - InstanceID *string `locationName:"instanceId" type:"string" required:"true"` + // One or more filters. + // + // cidr - The CIDR block of the VPC. The CIDR block you specify must exactly + // match the VPC's CIDR block for information to be returned for the VPC. Must + // contain the slash followed by one or two digits (for example, /28). + // + // dhcp-options-id - The ID of a set of DHCP options. + // + // isDefault - Indicates whether the VPC is the default VPC. + // + // state - The state of the VPC (pending | available). + // + // tag:key=value - The key/value combination of a tag assigned to the resource. + // + // tag-key - The key of a tag assigned to the resource. This filter is independent + // of the tag-value filter. For example, if you use both the filter "tag-key=Purpose" + // and the filter "tag-value=X", you get any resources assigned both the tag + // key Purpose (regardless of what the tag's value is), and the tag value X + // (regardless of what the tag's key is). If you want to list only resources + // where Purpose is X, see the tag:key=value filter. + // + // tag-value - The value of a tag assigned to the resource. This filter is + // independent of the tag-key filter. + // + // vpc-id - The ID of the VPC. + Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - // The ID of the VPC to which the instance is linked. - VPCID *string `locationName:"vpcId" type:"string" required:"true"` + // One or more VPC IDs. + // + // Default: Describes all your VPCs. + VpcIds []*string `locationName:"VpcId" locationNameList:"VpcId" type:"list"` - metadataDetachClassicLinkVPCInput `json:"-" xml:"-"` + metadataDescribeVpcsInput `json:"-" xml:"-"` } -type metadataDetachClassicLinkVPCInput struct { +type metadataDescribeVpcsInput struct { SDKShapeTraits bool `type:"structure"` } -type DetachClassicLinkVPCOutput struct { - // Returns true if the request succeeds; otherwise, it returns an error. - Return *bool `locationName:"return" type:"boolean"` +// String returns the string representation +func (s DescribeVpcsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeVpcsInput) GoString() string { + return s.String() +} + +type DescribeVpcsOutput struct { + // Information about one or more VPCs. + Vpcs []*Vpc `locationName:"vpcSet" locationNameList:"item" type:"list"` - metadataDetachClassicLinkVPCOutput `json:"-" xml:"-"` + metadataDescribeVpcsOutput `json:"-" xml:"-"` } -type metadataDetachClassicLinkVPCOutput struct { +type metadataDescribeVpcsOutput struct { SDKShapeTraits bool `type:"structure"` } -type DetachInternetGatewayInput struct { +// String returns the string representation +func (s DescribeVpcsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeVpcsOutput) GoString() string { + return s.String() +} + +type DescribeVpnConnectionsInput struct { // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have // the required permissions, the error response is DryRunOperation. Otherwise, // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` - // The ID of the Internet gateway. - InternetGatewayID *string `locationName:"internetGatewayId" type:"string" required:"true"` + // One or more filters. + // + // customer-gateway-configuration - The configuration information for the + // customer gateway. + // + // customer-gateway-id - The ID of a customer gateway associated with the + // VPN connection. + // + // state - The state of the VPN connection (pending | available | deleting + // | deleted). + // + // option.static-routes-only - Indicates whether the connection has static + // routes only. Used for devices that do not support Border Gateway Protocol + // (BGP). + // + // route.destination-cidr-block - The destination CIDR block. This corresponds + // to the subnet used in a customer data center. + // + // bgp-asn - The BGP Autonomous System Number (ASN) associated with a BGP + // device. + // + // tag:key=value - The key/value combination of a tag assigned to the resource. + // + // tag-key - The key of a tag assigned to the resource. This filter is independent + // of the tag-value filter. For example, if you use both the filter "tag-key=Purpose" + // and the filter "tag-value=X", you get any resources assigned both the tag + // key Purpose (regardless of what the tag's value is), and the tag value X + // (regardless of what the tag's key is). If you want to list only resources + // where Purpose is X, see the tag:key=value filter. + // + // tag-value - The value of a tag assigned to the resource. This filter is + // independent of the tag-key filter. + // + // type - The type of VPN connection. Currently the only supported type is + // ipsec.1. + // + // vpn-connection-id - The ID of the VPN connection. + // + // vpn-gateway-id - The ID of a virtual private gateway associated with the + // VPN connection. + Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - // The ID of the VPC. - VPCID *string `locationName:"vpcId" type:"string" required:"true"` + // One or more VPN connection IDs. + // + // Default: Describes your VPN connections. + VpnConnectionIds []*string `locationName:"VpnConnectionId" locationNameList:"VpnConnectionId" type:"list"` - metadataDetachInternetGatewayInput `json:"-" xml:"-"` + metadataDescribeVpnConnectionsInput `json:"-" xml:"-"` } -type metadataDetachInternetGatewayInput struct { +type metadataDescribeVpnConnectionsInput struct { SDKShapeTraits bool `type:"structure"` } -type DetachInternetGatewayOutput struct { - metadataDetachInternetGatewayOutput `json:"-" xml:"-"` +// String returns the string representation +func (s DescribeVpnConnectionsInput) String() string { + return awsutil.Prettify(s) } -type metadataDetachInternetGatewayOutput struct { - SDKShapeTraits bool `type:"structure"` +// GoString returns the string representation +func (s DescribeVpnConnectionsInput) GoString() string { + return s.String() } -type DetachNetworkInterfaceInput struct { - // The ID of the attachment. - AttachmentID *string `locationName:"attachmentId" type:"string" required:"true"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // Specifies whether to force a detachment. - Force *bool `locationName:"force" type:"boolean"` +type DescribeVpnConnectionsOutput struct { + // Information about one or more VPN connections. + VpnConnections []*VpnConnection `locationName:"vpnConnectionSet" locationNameList:"item" type:"list"` - metadataDetachNetworkInterfaceInput `json:"-" xml:"-"` + metadataDescribeVpnConnectionsOutput `json:"-" xml:"-"` } -type metadataDetachNetworkInterfaceInput struct { +type metadataDescribeVpnConnectionsOutput struct { SDKShapeTraits bool `type:"structure"` } -type DetachNetworkInterfaceOutput struct { - metadataDetachNetworkInterfaceOutput `json:"-" xml:"-"` +// String returns the string representation +func (s DescribeVpnConnectionsOutput) String() string { + return awsutil.Prettify(s) } -type metadataDetachNetworkInterfaceOutput struct { - SDKShapeTraits bool `type:"structure"` +// GoString returns the string representation +func (s DescribeVpnConnectionsOutput) GoString() string { + return s.String() } -type DetachVPNGatewayInput struct { +type DescribeVpnGatewaysInput struct { // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have // the required permissions, the error response is DryRunOperation. Otherwise, // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` - // The ID of the VPC. - VPCID *string `locationName:"VpcId" type:"string" required:"true"` - - // The ID of the virtual private gateway. - VPNGatewayID *string `locationName:"VpnGatewayId" type:"string" required:"true"` + // One or more filters. + // + // attachment.state - The current state of the attachment between the gateway + // and the VPC (attaching | attached | detaching | detached). + // + // attachment.vpc-id - The ID of an attached VPC. + // + // availability-zone - The Availability Zone for the virtual private gateway. + // + // state - The state of the virtual private gateway (pending | available + // | deleting | deleted). + // + // tag:key=value - The key/value combination of a tag assigned to the resource. + // + // tag-key - The key of a tag assigned to the resource. This filter is independent + // of the tag-value filter. For example, if you use both the filter "tag-key=Purpose" + // and the filter "tag-value=X", you get any resources assigned both the tag + // key Purpose (regardless of what the tag's value is), and the tag value X + // (regardless of what the tag's key is). If you want to list only resources + // where Purpose is X, see the tag:key=value filter. + // + // tag-value - The value of a tag assigned to the resource. This filter is + // independent of the tag-key filter. + // + // type - The type of virtual private gateway. Currently the only supported + // type is ipsec.1. + // + // vpn-gateway-id - The ID of the virtual private gateway. + Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` + + // One or more virtual private gateway IDs. + // + // Default: Describes all your virtual private gateways. + VpnGatewayIds []*string `locationName:"VpnGatewayId" locationNameList:"VpnGatewayId" type:"list"` + + metadataDescribeVpnGatewaysInput `json:"-" xml:"-"` +} + +type metadataDescribeVpnGatewaysInput struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s DescribeVpnGatewaysInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeVpnGatewaysInput) GoString() string { + return s.String() +} + +type DescribeVpnGatewaysOutput struct { + // Information about one or more virtual private gateways. + VpnGateways []*VpnGateway `locationName:"vpnGatewaySet" locationNameList:"item" type:"list"` + + metadataDescribeVpnGatewaysOutput `json:"-" xml:"-"` +} + +type metadataDescribeVpnGatewaysOutput struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s DescribeVpnGatewaysOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeVpnGatewaysOutput) GoString() string { + return s.String() +} + +type DetachClassicLinkVpcInput struct { + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. + DryRun *bool `locationName:"dryRun" type:"boolean"` + + // The ID of the instance to unlink from the VPC. + InstanceId *string `locationName:"instanceId" type:"string" required:"true"` + + // The ID of the VPC to which the instance is linked. + VpcId *string `locationName:"vpcId" type:"string" required:"true"` + + metadataDetachClassicLinkVpcInput `json:"-" xml:"-"` +} + +type metadataDetachClassicLinkVpcInput struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s DetachClassicLinkVpcInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DetachClassicLinkVpcInput) GoString() string { + return s.String() +} + +type DetachClassicLinkVpcOutput struct { + // Returns true if the request succeeds; otherwise, it returns an error. + Return *bool `locationName:"return" type:"boolean"` + + metadataDetachClassicLinkVpcOutput `json:"-" xml:"-"` +} + +type metadataDetachClassicLinkVpcOutput struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s DetachClassicLinkVpcOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DetachClassicLinkVpcOutput) GoString() string { + return s.String() +} + +type DetachInternetGatewayInput struct { + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. + DryRun *bool `locationName:"dryRun" type:"boolean"` + + // The ID of the Internet gateway. + InternetGatewayId *string `locationName:"internetGatewayId" type:"string" required:"true"` + + // The ID of the VPC. + VpcId *string `locationName:"vpcId" type:"string" required:"true"` + + metadataDetachInternetGatewayInput `json:"-" xml:"-"` +} + +type metadataDetachInternetGatewayInput struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s DetachInternetGatewayInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DetachInternetGatewayInput) GoString() string { + return s.String() +} + +type DetachInternetGatewayOutput struct { + metadataDetachInternetGatewayOutput `json:"-" xml:"-"` +} + +type metadataDetachInternetGatewayOutput struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s DetachInternetGatewayOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DetachInternetGatewayOutput) GoString() string { + return s.String() +} + +type DetachNetworkInterfaceInput struct { + // The ID of the attachment. + AttachmentId *string `locationName:"attachmentId" type:"string" required:"true"` + + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. + DryRun *bool `locationName:"dryRun" type:"boolean"` - metadataDetachVPNGatewayInput `json:"-" xml:"-"` + // Specifies whether to force a detachment. + Force *bool `locationName:"force" type:"boolean"` + + metadataDetachNetworkInterfaceInput `json:"-" xml:"-"` } -type metadataDetachVPNGatewayInput struct { +type metadataDetachNetworkInterfaceInput struct { SDKShapeTraits bool `type:"structure"` } -type DetachVPNGatewayOutput struct { - metadataDetachVPNGatewayOutput `json:"-" xml:"-"` +// String returns the string representation +func (s DetachNetworkInterfaceInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DetachNetworkInterfaceInput) GoString() string { + return s.String() +} + +type DetachNetworkInterfaceOutput struct { + metadataDetachNetworkInterfaceOutput `json:"-" xml:"-"` } -type metadataDetachVPNGatewayOutput struct { +type metadataDetachNetworkInterfaceOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DetachNetworkInterfaceOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DetachNetworkInterfaceOutput) GoString() string { + return s.String() +} + type DetachVolumeInput struct { // The device name. Device *string `type:"string"` @@ -13397,10 +15515,10 @@ type DetachVolumeInput struct { Force *bool `type:"boolean"` // The ID of the instance. - InstanceID *string `locationName:"InstanceId" type:"string"` + InstanceId *string `type:"string"` // The ID of the volume. - VolumeID *string `locationName:"VolumeId" type:"string" required:"true"` + VolumeId *string `type:"string" required:"true"` metadataDetachVolumeInput `json:"-" xml:"-"` } @@ -13409,29 +15527,160 @@ type metadataDetachVolumeInput struct { SDKShapeTraits bool `type:"structure"` } -type DisableVGWRoutePropagationInput struct { +// String returns the string representation +func (s DetachVolumeInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DetachVolumeInput) GoString() string { + return s.String() +} + +type DetachVpnGatewayInput struct { + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. + DryRun *bool `locationName:"dryRun" type:"boolean"` + + // The ID of the VPC. + VpcId *string `type:"string" required:"true"` + + // The ID of the virtual private gateway. + VpnGatewayId *string `type:"string" required:"true"` + + metadataDetachVpnGatewayInput `json:"-" xml:"-"` +} + +type metadataDetachVpnGatewayInput struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s DetachVpnGatewayInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DetachVpnGatewayInput) GoString() string { + return s.String() +} + +type DetachVpnGatewayOutput struct { + metadataDetachVpnGatewayOutput `json:"-" xml:"-"` +} + +type metadataDetachVpnGatewayOutput struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s DetachVpnGatewayOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DetachVpnGatewayOutput) GoString() string { + return s.String() +} + +// Describes a DHCP configuration option. +type DhcpConfiguration struct { + // The name of a DHCP option. + Key *string `locationName:"key" type:"string"` + + // One or more values for the DHCP option. + Values []*AttributeValue `locationName:"valueSet" locationNameList:"item" type:"list"` + + metadataDhcpConfiguration `json:"-" xml:"-"` +} + +type metadataDhcpConfiguration struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s DhcpConfiguration) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DhcpConfiguration) GoString() string { + return s.String() +} + +// Describes a set of DHCP options. +type DhcpOptions struct { + // One or more DHCP options in the set. + DhcpConfigurations []*DhcpConfiguration `locationName:"dhcpConfigurationSet" locationNameList:"item" type:"list"` + + // The ID of the set of DHCP options. + DhcpOptionsId *string `locationName:"dhcpOptionsId" type:"string"` + + // Any tags assigned to the DHCP options set. + Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` + + metadataDhcpOptions `json:"-" xml:"-"` +} + +type metadataDhcpOptions struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s DhcpOptions) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DhcpOptions) GoString() string { + return s.String() +} + +type DisableVgwRoutePropagationInput struct { // The ID of the virtual private gateway. - GatewayID *string `locationName:"GatewayId" type:"string" required:"true"` + GatewayId *string `type:"string" required:"true"` // The ID of the route table. - RouteTableID *string `locationName:"RouteTableId" type:"string" required:"true"` + RouteTableId *string `type:"string" required:"true"` - metadataDisableVGWRoutePropagationInput `json:"-" xml:"-"` + metadataDisableVgwRoutePropagationInput `json:"-" xml:"-"` } -type metadataDisableVGWRoutePropagationInput struct { +type metadataDisableVgwRoutePropagationInput struct { SDKShapeTraits bool `type:"structure"` } -type DisableVGWRoutePropagationOutput struct { - metadataDisableVGWRoutePropagationOutput `json:"-" xml:"-"` +// String returns the string representation +func (s DisableVgwRoutePropagationInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DisableVgwRoutePropagationInput) GoString() string { + return s.String() +} + +type DisableVgwRoutePropagationOutput struct { + metadataDisableVgwRoutePropagationOutput `json:"-" xml:"-"` } -type metadataDisableVGWRoutePropagationOutput struct { +type metadataDisableVgwRoutePropagationOutput struct { SDKShapeTraits bool `type:"structure"` } -type DisableVPCClassicLinkInput struct { +// String returns the string representation +func (s DisableVgwRoutePropagationOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DisableVgwRoutePropagationOutput) GoString() string { + return s.String() +} + +type DisableVpcClassicLinkInput struct { // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have // the required permissions, the error response is DryRunOperation. Otherwise, @@ -13439,29 +15688,49 @@ type DisableVPCClassicLinkInput struct { DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the VPC. - VPCID *string `locationName:"vpcId" type:"string" required:"true"` + VpcId *string `locationName:"vpcId" type:"string" required:"true"` - metadataDisableVPCClassicLinkInput `json:"-" xml:"-"` + metadataDisableVpcClassicLinkInput `json:"-" xml:"-"` } -type metadataDisableVPCClassicLinkInput struct { +type metadataDisableVpcClassicLinkInput struct { SDKShapeTraits bool `type:"structure"` } -type DisableVPCClassicLinkOutput struct { +// String returns the string representation +func (s DisableVpcClassicLinkInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DisableVpcClassicLinkInput) GoString() string { + return s.String() +} + +type DisableVpcClassicLinkOutput struct { // Returns true if the request succeeds; otherwise, it returns an error. Return *bool `locationName:"return" type:"boolean"` - metadataDisableVPCClassicLinkOutput `json:"-" xml:"-"` + metadataDisableVpcClassicLinkOutput `json:"-" xml:"-"` } -type metadataDisableVPCClassicLinkOutput struct { +type metadataDisableVpcClassicLinkOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DisableVpcClassicLinkOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DisableVpcClassicLinkOutput) GoString() string { + return s.String() +} + type DisassociateAddressInput struct { // [EC2-VPC] The association ID. Required for EC2-VPC. - AssociationID *string `locationName:"AssociationId" type:"string"` + AssociationId *string `type:"string"` // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have @@ -13470,7 +15739,7 @@ type DisassociateAddressInput struct { DryRun *bool `locationName:"dryRun" type:"boolean"` // [EC2-Classic] The Elastic IP address. Required for EC2-Classic. - PublicIP *string `locationName:"PublicIp" type:"string"` + PublicIp *string `type:"string"` metadataDisassociateAddressInput `json:"-" xml:"-"` } @@ -13479,6 +15748,16 @@ type metadataDisassociateAddressInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DisassociateAddressInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DisassociateAddressInput) GoString() string { + return s.String() +} + type DisassociateAddressOutput struct { metadataDisassociateAddressOutput `json:"-" xml:"-"` } @@ -13487,10 +15766,20 @@ type metadataDisassociateAddressOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DisassociateAddressOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DisassociateAddressOutput) GoString() string { + return s.String() +} + type DisassociateRouteTableInput struct { // The association ID representing the current association between the route // table and subnet. - AssociationID *string `locationName:"associationId" type:"string" required:"true"` + AssociationId *string `locationName:"associationId" type:"string" required:"true"` // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have @@ -13505,6 +15794,16 @@ type metadataDisassociateRouteTableInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DisassociateRouteTableInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DisassociateRouteTableInput) GoString() string { + return s.String() +} + type DisassociateRouteTableOutput struct { metadataDisassociateRouteTableOutput `json:"-" xml:"-"` } @@ -13513,6 +15812,16 @@ type metadataDisassociateRouteTableOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DisassociateRouteTableOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DisassociateRouteTableOutput) GoString() string { + return s.String() +} + // Describes a disk image. type DiskImage struct { // A description of the disk image. @@ -13531,20 +15840,30 @@ type metadataDiskImage struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DiskImage) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DiskImage) GoString() string { + return s.String() +} + // Describes a disk image. type DiskImageDescription struct { // The checksum computed for the disk image. Checksum *string `locationName:"checksum" type:"string"` // The disk image format. - Format *string `locationName:"format" type:"string" required:"true"` + Format *string `locationName:"format" type:"string" required:"true" enum:"DiskImageFormat"` // A presigned URL for the import manifest stored in Amazon S3. For information // about creating a presigned URL for an Amazon S3 object, read the "Query String // Request Authentication Alternative" section of the Authenticating REST Requests // (http://docs.aws.amazon.com/AmazonS3/latest/dev/RESTAuthentication.html) // topic in the Amazon Simple Storage Service Developer Guide. - ImportManifestURL *string `locationName:"importManifestUrl" type:"string" required:"true"` + ImportManifestUrl *string `locationName:"importManifestUrl" type:"string" required:"true"` // The size of the disk image, in GiB. Size *int64 `locationName:"size" type:"long" required:"true"` @@ -13556,20 +15875,30 @@ type metadataDiskImageDescription struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DiskImageDescription) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DiskImageDescription) GoString() string { + return s.String() +} + // Describes a disk image. type DiskImageDetail struct { // The size of the disk image, in GiB. Bytes *int64 `locationName:"bytes" type:"long" required:"true"` // The disk image format. - Format *string `locationName:"format" type:"string" required:"true"` + Format *string `locationName:"format" type:"string" required:"true" enum:"DiskImageFormat"` // A presigned URL for the import manifest stored in Amazon S3 and presented // here as an Amazon S3 presigned URL. For information about creating a presigned // URL for an Amazon S3 object, read the "Query String Request Authentication // Alternative" section of the Authenticating REST Requests (http://docs.aws.amazon.com/AmazonS3/latest/dev/RESTAuthentication.html) // topic in the Amazon Simple Storage Service Developer Guide. - ImportManifestURL *string `locationName:"importManifestUrl" type:"string" required:"true"` + ImportManifestUrl *string `locationName:"importManifestUrl" type:"string" required:"true"` metadataDiskImageDetail `json:"-" xml:"-"` } @@ -13578,10 +15907,20 @@ type metadataDiskImageDetail struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DiskImageDetail) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DiskImageDetail) GoString() string { + return s.String() +} + // Describes a disk image volume. type DiskImageVolumeDescription struct { // The volume identifier. - ID *string `locationName:"id" type:"string" required:"true"` + Id *string `locationName:"id" type:"string" required:"true"` // The size of the volume, in GiB. Size *int64 `locationName:"size" type:"long"` @@ -13593,10 +15932,20 @@ type metadataDiskImageVolumeDescription struct { SDKShapeTraits bool `type:"structure"` } -// Describes a block device for an EBS volume. -type EBSBlockDevice struct { - // Indicates whether the EBS volume is deleted on instance termination. - DeleteOnTermination *bool `locationName:"deleteOnTermination" type:"boolean"` +// String returns the string representation +func (s DiskImageVolumeDescription) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DiskImageVolumeDescription) GoString() string { + return s.String() +} + +// Describes a block device for an EBS volume. +type EbsBlockDevice struct { + // Indicates whether the EBS volume is deleted on instance termination. + DeleteOnTermination *bool `locationName:"deleteOnTermination" type:"boolean"` // Indicates whether the EBS volume is encrypted. Encrypted Amazon EBS volumes // may only be attached to instances that support Amazon EBS encryption. @@ -13615,10 +15964,10 @@ type EBSBlockDevice struct { // // Condition: This parameter is required for requests to create io1 volumes; // it is not used in requests to create standard or gp2 volumes. - IOPS *int64 `locationName:"iops" type:"integer"` + Iops *int64 `locationName:"iops" type:"integer"` // The ID of the snapshot. - SnapshotID *string `locationName:"snapshotId" type:"string"` + SnapshotId *string `locationName:"snapshotId" type:"string"` // The size of the volume, in GiB. // @@ -13634,17 +15983,27 @@ type EBSBlockDevice struct { // IOPS (SSD) volumes, and standard for Magnetic volumes. // // Default: standard - VolumeType *string `locationName:"volumeType" type:"string"` + VolumeType *string `locationName:"volumeType" type:"string" enum:"VolumeType"` - metadataEBSBlockDevice `json:"-" xml:"-"` + metadataEbsBlockDevice `json:"-" xml:"-"` } -type metadataEBSBlockDevice struct { +type metadataEbsBlockDevice struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s EbsBlockDevice) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s EbsBlockDevice) GoString() string { + return s.String() +} + // Describes a parameter used to set up an EBS volume in a block device mapping. -type EBSInstanceBlockDevice struct { +type EbsInstanceBlockDevice struct { // The time stamp when the attachment initiated. AttachTime *time.Time `locationName:"attachTime" type:"timestamp" timestampFormat:"iso8601"` @@ -13652,107 +16011,187 @@ type EBSInstanceBlockDevice struct { DeleteOnTermination *bool `locationName:"deleteOnTermination" type:"boolean"` // The attachment state. - Status *string `locationName:"status" type:"string"` + Status *string `locationName:"status" type:"string" enum:"AttachmentStatus"` // The ID of the EBS volume. - VolumeID *string `locationName:"volumeId" type:"string"` + VolumeId *string `locationName:"volumeId" type:"string"` - metadataEBSInstanceBlockDevice `json:"-" xml:"-"` + metadataEbsInstanceBlockDevice `json:"-" xml:"-"` } -type metadataEBSInstanceBlockDevice struct { +type metadataEbsInstanceBlockDevice struct { SDKShapeTraits bool `type:"structure"` } -type EBSInstanceBlockDeviceSpecification struct { +// String returns the string representation +func (s EbsInstanceBlockDevice) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s EbsInstanceBlockDevice) GoString() string { + return s.String() +} + +type EbsInstanceBlockDeviceSpecification struct { // Indicates whether the volume is deleted on instance termination. DeleteOnTermination *bool `locationName:"deleteOnTermination" type:"boolean"` // The ID of the EBS volume. - VolumeID *string `locationName:"volumeId" type:"string"` + VolumeId *string `locationName:"volumeId" type:"string"` - metadataEBSInstanceBlockDeviceSpecification `json:"-" xml:"-"` + metadataEbsInstanceBlockDeviceSpecification `json:"-" xml:"-"` } -type metadataEBSInstanceBlockDeviceSpecification struct { +type metadataEbsInstanceBlockDeviceSpecification struct { SDKShapeTraits bool `type:"structure"` } -type EnableVGWRoutePropagationInput struct { +// String returns the string representation +func (s EbsInstanceBlockDeviceSpecification) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s EbsInstanceBlockDeviceSpecification) GoString() string { + return s.String() +} + +type EnableVgwRoutePropagationInput struct { // The ID of the virtual private gateway. - GatewayID *string `locationName:"GatewayId" type:"string" required:"true"` + GatewayId *string `type:"string" required:"true"` // The ID of the route table. - RouteTableID *string `locationName:"RouteTableId" type:"string" required:"true"` + RouteTableId *string `type:"string" required:"true"` - metadataEnableVGWRoutePropagationInput `json:"-" xml:"-"` + metadataEnableVgwRoutePropagationInput `json:"-" xml:"-"` } -type metadataEnableVGWRoutePropagationInput struct { +type metadataEnableVgwRoutePropagationInput struct { SDKShapeTraits bool `type:"structure"` } -type EnableVGWRoutePropagationOutput struct { - metadataEnableVGWRoutePropagationOutput `json:"-" xml:"-"` +// String returns the string representation +func (s EnableVgwRoutePropagationInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s EnableVgwRoutePropagationInput) GoString() string { + return s.String() +} + +type EnableVgwRoutePropagationOutput struct { + metadataEnableVgwRoutePropagationOutput `json:"-" xml:"-"` } -type metadataEnableVGWRoutePropagationOutput struct { +type metadataEnableVgwRoutePropagationOutput struct { SDKShapeTraits bool `type:"structure"` } -type EnableVPCClassicLinkInput struct { +// String returns the string representation +func (s EnableVgwRoutePropagationOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s EnableVgwRoutePropagationOutput) GoString() string { + return s.String() +} + +type EnableVolumeIOInput struct { // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have // the required permissions, the error response is DryRunOperation. Otherwise, // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` - // The ID of the VPC. - VPCID *string `locationName:"vpcId" type:"string" required:"true"` + // The ID of the volume. + VolumeId *string `locationName:"volumeId" type:"string" required:"true"` - metadataEnableVPCClassicLinkInput `json:"-" xml:"-"` + metadataEnableVolumeIOInput `json:"-" xml:"-"` } -type metadataEnableVPCClassicLinkInput struct { +type metadataEnableVolumeIOInput struct { SDKShapeTraits bool `type:"structure"` } -type EnableVPCClassicLinkOutput struct { - // Returns true if the request succeeds; otherwise, it returns an error. - Return *bool `locationName:"return" type:"boolean"` +// String returns the string representation +func (s EnableVolumeIOInput) String() string { + return awsutil.Prettify(s) +} - metadataEnableVPCClassicLinkOutput `json:"-" xml:"-"` +// GoString returns the string representation +func (s EnableVolumeIOInput) GoString() string { + return s.String() +} + +type EnableVolumeIOOutput struct { + metadataEnableVolumeIOOutput `json:"-" xml:"-"` } -type metadataEnableVPCClassicLinkOutput struct { +type metadataEnableVolumeIOOutput struct { SDKShapeTraits bool `type:"structure"` } -type EnableVolumeIOInput struct { +// String returns the string representation +func (s EnableVolumeIOOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s EnableVolumeIOOutput) GoString() string { + return s.String() +} + +type EnableVpcClassicLinkInput struct { // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have // the required permissions, the error response is DryRunOperation. Otherwise, // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` - // The ID of the volume. - VolumeID *string `locationName:"volumeId" type:"string" required:"true"` + // The ID of the VPC. + VpcId *string `locationName:"vpcId" type:"string" required:"true"` - metadataEnableVolumeIOInput `json:"-" xml:"-"` + metadataEnableVpcClassicLinkInput `json:"-" xml:"-"` } -type metadataEnableVolumeIOInput struct { +type metadataEnableVpcClassicLinkInput struct { SDKShapeTraits bool `type:"structure"` } -type EnableVolumeIOOutput struct { - metadataEnableVolumeIOOutput `json:"-" xml:"-"` +// String returns the string representation +func (s EnableVpcClassicLinkInput) String() string { + return awsutil.Prettify(s) } -type metadataEnableVolumeIOOutput struct { +// GoString returns the string representation +func (s EnableVpcClassicLinkInput) GoString() string { + return s.String() +} + +type EnableVpcClassicLinkOutput struct { + // Returns true if the request succeeds; otherwise, it returns an error. + Return *bool `locationName:"return" type:"boolean"` + + metadataEnableVpcClassicLinkOutput `json:"-" xml:"-"` +} + +type metadataEnableVpcClassicLinkOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s EnableVpcClassicLinkOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s EnableVpcClassicLinkOutput) GoString() string { + return s.String() +} + // Describes a Spot fleet event. type EventInformation struct { // The description of the event. @@ -13766,33 +16205,35 @@ type EventInformation struct { // either to launch or terminate an instance. // // spotFleetRequestConfigurationInvalid - The configuration is not valid. - // For more information, see the description. spotInstanceCountLimitExceeded - // - You've reached the limit on the number of Spot Instances that you can launch. + // For more information, see the description. + // + // spotInstanceCountLimitExceeded - You've reached the limit on the number + // of Spot instances that you can launch. // // The following are the fleetRequestChange events. // // active - The Spot fleet has been validated and Amazon EC2 is attempting - // to maintain the target number of running Spot Instances. + // to maintain the target number of running Spot instances. // - // cancelled - The Spot fleet is canceled and has no running Spot Instances. + // cancelled - The Spot fleet is canceled and has no running Spot instances. // The Spot fleet will be deleted two days after its instances were terminated. // // cancelled_running - The Spot fleet is canceled and will not launch additional - // Spot Instances, but its existing Spot Instances will continue to run until - // they are interrupted or terminated. + // Spot instances, but its existing Spot instances continue to run until they + // are interrupted or terminated. // - // cancelled_terminating - The Spot fleet is canceled and its Spot Instances + // cancelled_terminating - The Spot fleet is canceled and its Spot instances // are terminating. // // expired - The Spot fleet request has expired. A subsequent event indicates - // that the instances were terminated, if the request was created with terminateInstancesWithExpiration + // that the instances were terminated, if the request was created with TerminateInstancesWithExpiration // set. // // price_update - The bid price for a launch configuration was adjusted because // it was too high. This change is permanent. // // submitted - The Spot fleet request is being evaluated and Amazon EC2 is - // preparing to launch the target number of Spot Instances. + // preparing to launch the target number of Spot instances. // // The following are the instanceChange events. // @@ -13803,7 +16244,7 @@ type EventInformation struct { // The ID of the instance. This information is available only for instanceChange // events. - InstanceID *string `locationName:"instanceId" type:"string"` + InstanceId *string `locationName:"instanceId" type:"string"` metadataEventInformation `json:"-" xml:"-"` } @@ -13812,13 +16253,23 @@ type metadataEventInformation struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s EventInformation) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s EventInformation) GoString() string { + return s.String() +} + // Describes an instance export task. type ExportTask struct { // A description of the resource being exported. Description *string `locationName:"description" type:"string"` // The ID of the export task. - ExportTaskID *string `locationName:"exportTaskId" type:"string"` + ExportTaskId *string `locationName:"exportTaskId" type:"string"` // Information about the export task. ExportToS3Task *ExportToS3Task `locationName:"exportToS3" type:"structure"` @@ -13827,7 +16278,7 @@ type ExportTask struct { InstanceExportDetails *InstanceExportDetails `locationName:"instanceExport" type:"structure"` // The state of the export task. - State *string `locationName:"state" type:"string"` + State *string `locationName:"state" type:"string" enum:"ExportTaskState"` // The status message related to the export task. StatusMessage *string `locationName:"statusMessage" type:"string"` @@ -13839,14 +16290,24 @@ type metadataExportTask struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s ExportTask) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ExportTask) GoString() string { + return s.String() +} + // Describes the format and location for an instance export task. type ExportToS3Task struct { // The container format used to combine disk images with metadata (such as OVF). // If absent, only the disk image is exported. - ContainerFormat *string `locationName:"containerFormat" type:"string"` + ContainerFormat *string `locationName:"containerFormat" type:"string" enum:"ContainerFormat"` // The format for the exported image. - DiskImageFormat *string `locationName:"diskImageFormat" type:"string"` + DiskImageFormat *string `locationName:"diskImageFormat" type:"string" enum:"DiskImageFormat"` // The S3 bucket for the destination image. The destination bucket must exist // and grant WRITE and READ_ACP permissions to the AWS account vm-import-export@amazon.com. @@ -13862,14 +16323,24 @@ type metadataExportToS3Task struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s ExportToS3Task) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ExportToS3Task) GoString() string { + return s.String() +} + // Describes an instance export task. type ExportToS3TaskSpecification struct { // The container format used to combine disk images with metadata (such as OVF). // If absent, only the disk image is exported. - ContainerFormat *string `locationName:"containerFormat" type:"string"` + ContainerFormat *string `locationName:"containerFormat" type:"string" enum:"ContainerFormat"` // The format for the exported image. - DiskImageFormat *string `locationName:"diskImageFormat" type:"string"` + DiskImageFormat *string `locationName:"diskImageFormat" type:"string" enum:"DiskImageFormat"` // The S3 bucket for the destination image. The destination bucket must exist // and grant WRITE and READ_ACP permissions to the AWS account vm-import-export@amazon.com. @@ -13886,6 +16357,16 @@ type metadataExportToS3TaskSpecification struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s ExportToS3TaskSpecification) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ExportToS3TaskSpecification) GoString() string { + return s.String() +} + // A filter name and value pair that is used to return a more specific list // of results. Filters can be used to match a set of resources by various criteria, // such as tags, attributes, or IDs. @@ -13903,6 +16384,66 @@ type metadataFilter struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s Filter) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Filter) GoString() string { + return s.String() +} + +// Describes a flow log. +type FlowLog struct { + // The date and time the flow log was created. + CreationTime *time.Time `locationName:"creationTime" type:"timestamp" timestampFormat:"iso8601"` + + // Information about the error that occurred. Rate limited indicates that CloudWatch + // logs throttling has been applied for one or more network interfaces. Access + // error indicates that the IAM role associated with the flow log does not have + // sufficient permissions to publish to CloudWatch Logs. Unknown error indicates + // an internal error. + DeliverLogsErrorMessage *string `locationName:"deliverLogsErrorMessage" type:"string"` + + // The ARN of the IAM role that posts logs to CloudWatch Logs. + DeliverLogsPermissionArn *string `locationName:"deliverLogsPermissionArn" type:"string"` + + // The status of the logs delivery (SUCCESS | FAILED). + DeliverLogsStatus *string `locationName:"deliverLogsStatus" type:"string"` + + // The flow log ID. + FlowLogId *string `locationName:"flowLogId" type:"string"` + + // The status of the flow log (ACTIVE). + FlowLogStatus *string `locationName:"flowLogStatus" type:"string"` + + // The name of the flow log group. + LogGroupName *string `locationName:"logGroupName" type:"string"` + + // The ID of the resource on which the flow log was created. + ResourceId *string `locationName:"resourceId" type:"string"` + + // The type of traffic captured for the flow log. + TrafficType *string `locationName:"trafficType" type:"string" enum:"TrafficType"` + + metadataFlowLog `json:"-" xml:"-"` +} + +type metadataFlowLog struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s FlowLog) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s FlowLog) GoString() string { + return s.String() +} + type GetConsoleOutputInput struct { // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have @@ -13911,7 +16452,7 @@ type GetConsoleOutputInput struct { DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the instance. - InstanceID *string `locationName:"InstanceId" type:"string" required:"true"` + InstanceId *string `type:"string" required:"true"` metadataGetConsoleOutputInput `json:"-" xml:"-"` } @@ -13920,9 +16461,19 @@ type metadataGetConsoleOutputInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s GetConsoleOutputInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetConsoleOutputInput) GoString() string { + return s.String() +} + type GetConsoleOutputOutput struct { // The ID of the instance. - InstanceID *string `locationName:"instanceId" type:"string"` + InstanceId *string `locationName:"instanceId" type:"string"` // The console output, Base64 encoded. Output *string `locationName:"output" type:"string"` @@ -13937,6 +16488,16 @@ type metadataGetConsoleOutputOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s GetConsoleOutputOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetConsoleOutputOutput) GoString() string { + return s.String() +} + type GetPasswordDataInput struct { // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have @@ -13945,7 +16506,7 @@ type GetPasswordDataInput struct { DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the Windows instance. - InstanceID *string `locationName:"InstanceId" type:"string" required:"true"` + InstanceId *string `type:"string" required:"true"` metadataGetPasswordDataInput `json:"-" xml:"-"` } @@ -13954,9 +16515,19 @@ type metadataGetPasswordDataInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s GetPasswordDataInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetPasswordDataInput) GoString() string { + return s.String() +} + type GetPasswordDataOutput struct { // The ID of the Windows instance. - InstanceID *string `locationName:"instanceId" type:"string"` + InstanceId *string `locationName:"instanceId" type:"string"` // The password of the instance. PasswordData *string `locationName:"passwordData" type:"string"` @@ -13971,10 +16542,20 @@ type metadataGetPasswordDataOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s GetPasswordDataOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetPasswordDataOutput) GoString() string { + return s.String() +} + // Describes a security group. type GroupIdentifier struct { // The ID of the security group. - GroupID *string `locationName:"groupId" type:"string"` + GroupId *string `locationName:"groupId" type:"string"` // The name of the security group. GroupName *string `locationName:"groupName" type:"string"` @@ -13986,6 +16567,16 @@ type metadataGroupIdentifier struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s GroupIdentifier) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GroupIdentifier) GoString() string { + return s.String() +} + // Describes an event in the history of the Spot fleet request. type HistoryRecord struct { // Information about the event. @@ -13999,7 +16590,7 @@ type HistoryRecord struct { // of the Spot fleet request. // // instanceChange - Indicates that an instance was launched or terminated. - EventType *string `locationName:"eventType" type:"string" required:"true"` + EventType *string `locationName:"eventType" type:"string" required:"true" enum:"EventType"` // The date and time of the event, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ). Timestamp *time.Time `locationName:"timestamp" type:"timestamp" timestampFormat:"iso8601" required:"true"` @@ -14011,107 +16602,95 @@ type metadataHistoryRecord struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s HistoryRecord) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s HistoryRecord) GoString() string { + return s.String() +} + // Describes an IAM instance profile. -type IAMInstanceProfile struct { +type IamInstanceProfile struct { // The Amazon Resource Name (ARN) of the instance profile. - ARN *string `locationName:"arn" type:"string"` + Arn *string `locationName:"arn" type:"string"` // The ID of the instance profile. - ID *string `locationName:"id" type:"string"` + Id *string `locationName:"id" type:"string"` - metadataIAMInstanceProfile `json:"-" xml:"-"` + metadataIamInstanceProfile `json:"-" xml:"-"` } -type metadataIAMInstanceProfile struct { +type metadataIamInstanceProfile struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s IamInstanceProfile) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s IamInstanceProfile) GoString() string { + return s.String() +} + // Describes an IAM instance profile. -type IAMInstanceProfileSpecification struct { +type IamInstanceProfileSpecification struct { // The Amazon Resource Name (ARN) of the instance profile. - ARN *string `locationName:"arn" type:"string"` + Arn *string `locationName:"arn" type:"string"` // The name of the instance profile. Name *string `locationName:"name" type:"string"` - metadataIAMInstanceProfileSpecification `json:"-" xml:"-"` + metadataIamInstanceProfileSpecification `json:"-" xml:"-"` } -type metadataIAMInstanceProfileSpecification struct { +type metadataIamInstanceProfileSpecification struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s IamInstanceProfileSpecification) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s IamInstanceProfileSpecification) GoString() string { + return s.String() +} + // Describes the ICMP type and code. -type ICMPTypeCode struct { +type IcmpTypeCode struct { // The ICMP type. A value of -1 means all types. Code *int64 `locationName:"code" type:"integer"` // The ICMP code. A value of -1 means all codes for the specified ICMP type. Type *int64 `locationName:"type" type:"integer"` - metadataICMPTypeCode `json:"-" xml:"-"` -} - -type metadataICMPTypeCode struct { - SDKShapeTraits bool `type:"structure"` -} - -// Describes a security group rule. -type IPPermission struct { - // The start of port range for the TCP and UDP protocols, or an ICMP type number. - // A value of -1 indicates all ICMP types. - FromPort *int64 `locationName:"fromPort" type:"integer"` - - // The protocol. - // - // When you call DescribeSecurityGroups, the protocol value returned is the - // number. Exception: For TCP, UDP, and ICMP, the value returned is the name - // (for example, tcp, udp, or icmp). For a list of protocol numbers, see Protocol - // Numbers (http://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml). - // (VPC only) When you call AuthorizeSecurityGroupIngress, you can use -1 to - // specify all. - IPProtocol *string `locationName:"ipProtocol" type:"string"` - - // One or more IP ranges. - IPRanges []*IPRange `locationName:"ipRanges" locationNameList:"item" type:"list"` - - // (Valid for AuthorizeSecurityGroupEgress, RevokeSecurityGroupEgress and DescribeSecurityGroups - // only) One or more prefix list IDs for an AWS service. In an AuthorizeSecurityGroupEgress - // request, this is the AWS service that you want to access through a VPC endpoint - // from instances associated with the security group. - PrefixListIDs []*PrefixListID `locationName:"prefixListIds" locationNameList:"item" type:"list"` - - // The end of port range for the TCP and UDP protocols, or an ICMP code. A value - // of -1 indicates all ICMP codes for the specified ICMP type. - ToPort *int64 `locationName:"toPort" type:"integer"` - - // One or more security group and AWS account ID pairs. - UserIDGroupPairs []*UserIDGroupPair `locationName:"groups" locationNameList:"item" type:"list"` - - metadataIPPermission `json:"-" xml:"-"` + metadataIcmpTypeCode `json:"-" xml:"-"` } -type metadataIPPermission struct { +type metadataIcmpTypeCode struct { SDKShapeTraits bool `type:"structure"` } -// Describes an IP range. -type IPRange struct { - // The CIDR range. You can either specify a CIDR range or a source security - // group, not both. - CIDRIP *string `locationName:"cidrIp" type:"string"` - - metadataIPRange `json:"-" xml:"-"` +// String returns the string representation +func (s IcmpTypeCode) String() string { + return awsutil.Prettify(s) } -type metadataIPRange struct { - SDKShapeTraits bool `type:"structure"` +// GoString returns the string representation +func (s IcmpTypeCode) GoString() string { + return s.String() } // Describes an image. type Image struct { // The architecture of the image. - Architecture *string `locationName:"architecture" type:"string"` + Architecture *string `locationName:"architecture" type:"string" enum:"ArchitectureValues"` // Any block device mapping entries. BlockDeviceMappings []*BlockDeviceMapping `locationName:"blockDeviceMapping" locationNameList:"item" type:"list"` @@ -14123,10 +16702,10 @@ type Image struct { Description *string `locationName:"description" type:"string"` // The hypervisor type of the image. - Hypervisor *string `locationName:"hypervisor" type:"string"` + Hypervisor *string `locationName:"hypervisor" type:"string" enum:"HypervisorType"` // The ID of the AMI. - ImageID *string `locationName:"imageId" type:"string"` + ImageId *string `locationName:"imageId" type:"string"` // The location of the AMI. ImageLocation *string `locationName:"imageLocation" type:"string"` @@ -14136,20 +16715,20 @@ type Image struct { ImageOwnerAlias *string `locationName:"imageOwnerAlias" type:"string"` // The type of image. - ImageType *string `locationName:"imageType" type:"string"` + ImageType *string `locationName:"imageType" type:"string" enum:"ImageTypeValues"` // The kernel associated with the image, if any. Only applicable for machine // images. - KernelID *string `locationName:"kernelId" type:"string"` + KernelId *string `locationName:"kernelId" type:"string"` // The name of the AMI that was provided during image creation. Name *string `locationName:"name" type:"string"` // The AWS account ID of the image owner. - OwnerID *string `locationName:"imageOwnerId" type:"string"` + OwnerId *string `locationName:"imageOwnerId" type:"string"` // The value is Windows for Windows AMIs; otherwise blank. - Platform *string `locationName:"platform" type:"string"` + Platform *string `locationName:"platform" type:"string" enum:"PlatformValues"` // Any product codes associated with the AMI. ProductCodes []*ProductCode `locationName:"productCodes" locationNameList:"item" type:"list"` @@ -14161,21 +16740,21 @@ type Image struct { // The RAM disk associated with the image, if any. Only applicable for machine // images. - RAMDiskID *string `locationName:"ramdiskId" type:"string"` + RamdiskId *string `locationName:"ramdiskId" type:"string"` // The device name of the root device (for example, /dev/sda1 or /dev/xvda). RootDeviceName *string `locationName:"rootDeviceName" type:"string"` // The type of root device used by the AMI. The AMI can use an EBS volume or // an instance store volume. - RootDeviceType *string `locationName:"rootDeviceType" type:"string"` + RootDeviceType *string `locationName:"rootDeviceType" type:"string" enum:"DeviceType"` // Specifies whether enhanced networking is enabled. - SRIOVNetSupport *string `locationName:"sriovNetSupport" type:"string"` + SriovNetSupport *string `locationName:"sriovNetSupport" type:"string"` // The current state of the AMI. If the state is available, the image is successfully // registered and can be used to launch an instance. - State *string `locationName:"imageState" type:"string"` + State *string `locationName:"imageState" type:"string" enum:"ImageState"` // The reason for the state change. StateReason *StateReason `locationName:"stateReason" type:"structure"` @@ -14184,7 +16763,7 @@ type Image struct { Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` // The type of virtualization of the AMI. - VirtualizationType *string `locationName:"virtualizationType" type:"string"` + VirtualizationType *string `locationName:"virtualizationType" type:"string" enum:"VirtualizationType"` metadataImage `json:"-" xml:"-"` } @@ -14193,6 +16772,16 @@ type metadataImage struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s Image) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Image) GoString() string { + return s.String() +} + // Describes the disk container object for an import image task. type ImageDiskContainer struct { // The description of the disk image. @@ -14207,11 +16796,11 @@ type ImageDiskContainer struct { Format *string `type:"string"` // The ID of the EBS snapshot to be used for importing the snapshot. - SnapshotID *string `locationName:"SnapshotId" type:"string"` + SnapshotId *string `type:"string"` // The URL to the Amazon S3-based disk image being imported. The URL can either // be a https URL (https://..) or an Amazon S3 URL (s3://..) - URL *string `locationName:"Url" type:"string"` + Url *string `type:"string"` // The S3 bucket for the disk image. UserBucket *UserBucket `type:"structure"` @@ -14223,6 +16812,16 @@ type metadataImageDiskContainer struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s ImageDiskContainer) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ImageDiskContainer) GoString() string { + return s.String() +} + type ImportImageInput struct { // The architecture of the virtual machine. // @@ -14277,6 +16876,16 @@ type metadataImportImageInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s ImportImageInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ImportImageInput) GoString() string { + return s.String() +} + type ImportImageOutput struct { // The architecture of the virtual machine. Architecture *string `locationName:"architecture" type:"string"` @@ -14288,10 +16897,10 @@ type ImportImageOutput struct { Hypervisor *string `locationName:"hypervisor" type:"string"` // The ID of the Amazon Machine Image (AMI) created by the import task. - ImageID *string `locationName:"imageId" type:"string"` + ImageId *string `locationName:"imageId" type:"string"` // The task ID of the import image task. - ImportTaskID *string `locationName:"importTaskId" type:"string"` + ImportTaskId *string `locationName:"importTaskId" type:"string"` // The license type of the virtual machine. LicenseType *string `locationName:"licenseType" type:"string"` @@ -14318,6 +16927,16 @@ type metadataImportImageOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s ImportImageOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ImportImageOutput) GoString() string { + return s.String() +} + // Describes an import image task. type ImportImageTask struct { // The architecture of the virtual machine. @@ -14334,10 +16953,10 @@ type ImportImageTask struct { Hypervisor *string `locationName:"hypervisor" type:"string"` // The ID of the Amazon Machine Image (AMI) of the imported virtual machine. - ImageID *string `locationName:"imageId" type:"string"` + ImageId *string `locationName:"imageId" type:"string"` // The ID of the import image task. - ImportTaskID *string `locationName:"importTaskId" type:"string"` + ImportTaskId *string `locationName:"importTaskId" type:"string"` // The license type of the virtual machine. LicenseType *string `locationName:"licenseType" type:"string"` @@ -14364,6 +16983,16 @@ type metadataImportImageTask struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s ImportImageTask) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ImportImageTask) GoString() string { + return s.String() +} + type ImportInstanceInput struct { // A description for the instance being imported. Description *string `locationName:"description" type:"string"` @@ -14381,7 +17010,7 @@ type ImportInstanceInput struct { LaunchSpecification *ImportInstanceLaunchSpecification `locationName:"launchSpecification" type:"structure"` // The instance operating system. - Platform *string `locationName:"platform" type:"string" required:"true"` + Platform *string `locationName:"platform" type:"string" required:"true" enum:"PlatformValues"` metadataImportInstanceInput `json:"-" xml:"-"` } @@ -14390,28 +17019,38 @@ type metadataImportInstanceInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s ImportInstanceInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ImportInstanceInput) GoString() string { + return s.String() +} + // Describes the launch specification for VM import. type ImportInstanceLaunchSpecification struct { // Reserved. AdditionalInfo *string `locationName:"additionalInfo" type:"string"` // The architecture of the instance. - Architecture *string `locationName:"architecture" type:"string"` + Architecture *string `locationName:"architecture" type:"string" enum:"ArchitectureValues"` // One or more security group IDs. - GroupIDs []*string `locationName:"GroupId" locationNameList:"SecurityGroupId" type:"list"` + GroupIds []*string `locationName:"GroupId" locationNameList:"SecurityGroupId" type:"list"` // One or more security group names. GroupNames []*string `locationName:"GroupName" locationNameList:"SecurityGroup" type:"list"` // Indicates whether an instance stops or terminates when you initiate shutdown // from the instance (using the operating system command for system shutdown). - InstanceInitiatedShutdownBehavior *string `locationName:"instanceInitiatedShutdownBehavior" type:"string"` + InstanceInitiatedShutdownBehavior *string `locationName:"instanceInitiatedShutdownBehavior" type:"string" enum:"ShutdownBehavior"` // The instance type. For more information about the instance types that you // can import, see Before You Get Started (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/VMImportPrerequisites.html) // in the Amazon Elastic Compute Cloud User Guide. - InstanceType *string `locationName:"instanceType" type:"string"` + InstanceType *string `locationName:"instanceType" type:"string" enum:"InstanceType"` // Indicates whether monitoring is enabled. Monitoring *bool `locationName:"monitoring" type:"boolean"` @@ -14420,10 +17059,10 @@ type ImportInstanceLaunchSpecification struct { Placement *Placement `locationName:"placement" type:"structure"` // [EC2-VPC] An available IP address from the IP address range of the subnet. - PrivateIPAddress *string `locationName:"privateIpAddress" type:"string"` + PrivateIpAddress *string `locationName:"privateIpAddress" type:"string"` // [EC2-VPC] The ID of the subnet in which to launch the instance. - SubnetID *string `locationName:"subnetId" type:"string"` + SubnetId *string `locationName:"subnetId" type:"string"` // The Base64-encoded MIME user data to be made available to the instance. UserData *UserData `locationName:"userData" type:"structure"` @@ -14435,6 +17074,16 @@ type metadataImportInstanceLaunchSpecification struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s ImportInstanceLaunchSpecification) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ImportInstanceLaunchSpecification) GoString() string { + return s.String() +} + type ImportInstanceOutput struct { // Information about the conversion task. ConversionTask *ConversionTask `locationName:"conversionTask" type:"structure"` @@ -14446,16 +17095,26 @@ type metadataImportInstanceOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s ImportInstanceOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ImportInstanceOutput) GoString() string { + return s.String() +} + // Describes an import instance task. type ImportInstanceTaskDetails struct { // A description of the task. Description *string `locationName:"description" type:"string"` // The ID of the instance. - InstanceID *string `locationName:"instanceId" type:"string"` + InstanceId *string `locationName:"instanceId" type:"string"` // The instance operating system. - Platform *string `locationName:"platform" type:"string"` + Platform *string `locationName:"platform" type:"string" enum:"PlatformValues"` // One or more volumes. Volumes []*ImportInstanceVolumeDetailItem `locationName:"volumes" locationNameList:"item" type:"list" required:"true"` @@ -14467,6 +17126,16 @@ type metadataImportInstanceTaskDetails struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s ImportInstanceTaskDetails) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ImportInstanceTaskDetails) GoString() string { + return s.String() +} + // Describes an import volume task. type ImportInstanceVolumeDetailItem struct { // The Availability Zone where the resulting instance will reside. @@ -14497,6 +17166,16 @@ type metadataImportInstanceVolumeDetailItem struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s ImportInstanceVolumeDetailItem) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ImportInstanceVolumeDetailItem) GoString() string { + return s.String() +} + type ImportKeyPairInput struct { // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have @@ -14518,6 +17197,16 @@ type metadataImportKeyPairInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s ImportKeyPairInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ImportKeyPairInput) GoString() string { + return s.String() +} + type ImportKeyPairOutput struct { // The MD5 public key fingerprint as specified in section 4 of RFC 4716. KeyFingerprint *string `locationName:"keyFingerprint" type:"string"` @@ -14532,6 +17221,16 @@ type metadataImportKeyPairOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s ImportKeyPairOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ImportKeyPairOutput) GoString() string { + return s.String() +} + type ImportSnapshotInput struct { // The client-specific data. ClientData *ClientData `type:"structure"` @@ -14561,12 +17260,22 @@ type metadataImportSnapshotInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s ImportSnapshotInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ImportSnapshotInput) GoString() string { + return s.String() +} + type ImportSnapshotOutput struct { // A description of the import snapshot task. Description *string `locationName:"description" type:"string"` // The ID of the import snapshot task. - ImportTaskID *string `locationName:"importTaskId" type:"string"` + ImportTaskId *string `locationName:"importTaskId" type:"string"` // Information about the import snapshot task. SnapshotTaskDetail *SnapshotTaskDetail `locationName:"snapshotTaskDetail" type:"structure"` @@ -14578,13 +17287,23 @@ type metadataImportSnapshotOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s ImportSnapshotOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ImportSnapshotOutput) GoString() string { + return s.String() +} + // Describes an import snapshot task. type ImportSnapshotTask struct { // A description of the import snapshot task. Description *string `locationName:"description" type:"string"` // The ID of the import snapshot task. - ImportTaskID *string `locationName:"importTaskId" type:"string"` + ImportTaskId *string `locationName:"importTaskId" type:"string"` // Describes an import snapshot task. SnapshotTaskDetail *SnapshotTaskDetail `locationName:"snapshotTaskDetail" type:"structure"` @@ -14596,6 +17315,16 @@ type metadataImportSnapshotTask struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s ImportSnapshotTask) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ImportSnapshotTask) GoString() string { + return s.String() +} + type ImportVolumeInput struct { // The Availability Zone for the resulting EBS volume. AvailabilityZone *string `locationName:"availabilityZone" type:"string" required:"true"` @@ -14622,6 +17351,16 @@ type metadataImportVolumeInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s ImportVolumeInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ImportVolumeInput) GoString() string { + return s.String() +} + type ImportVolumeOutput struct { // Information about the conversion task. ConversionTask *ConversionTask `locationName:"conversionTask" type:"structure"` @@ -14633,6 +17372,16 @@ type metadataImportVolumeOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s ImportVolumeOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ImportVolumeOutput) GoString() string { + return s.String() +} + // Describes an import volume task. type ImportVolumeTaskDetails struct { // The Availability Zone where the resulting volume will reside. @@ -14657,14 +17406,24 @@ type metadataImportVolumeTaskDetails struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s ImportVolumeTaskDetails) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ImportVolumeTaskDetails) GoString() string { + return s.String() +} + // Describes an instance. type Instance struct { // The AMI launch index, which can be used to find this instance in the launch // group. - AMILaunchIndex *int64 `locationName:"amiLaunchIndex" type:"integer"` + AmiLaunchIndex *int64 `locationName:"amiLaunchIndex" type:"integer"` // The architecture of the image. - Architecture *string `locationName:"architecture" type:"string"` + Architecture *string `locationName:"architecture" type:"string" enum:"ArchitectureValues"` // Any block device mapping entries for the instance. BlockDeviceMappings []*InstanceBlockDeviceMapping `locationName:"blockDeviceMapping" locationNameList:"item" type:"list"` @@ -14677,28 +17436,28 @@ type Instance struct { // stack to provide optimal I/O performance. This optimization isn't available // with all instance types. Additional usage charges apply when using an EBS // Optimized instance. - EBSOptimized *bool `locationName:"ebsOptimized" type:"boolean"` + EbsOptimized *bool `locationName:"ebsOptimized" type:"boolean"` // The hypervisor type of the instance. - Hypervisor *string `locationName:"hypervisor" type:"string"` + Hypervisor *string `locationName:"hypervisor" type:"string" enum:"HypervisorType"` // The IAM instance profile associated with the instance. - IAMInstanceProfile *IAMInstanceProfile `locationName:"iamInstanceProfile" type:"structure"` + IamInstanceProfile *IamInstanceProfile `locationName:"iamInstanceProfile" type:"structure"` // The ID of the AMI used to launch the instance. - ImageID *string `locationName:"imageId" type:"string"` + ImageId *string `locationName:"imageId" type:"string"` // The ID of the instance. - InstanceID *string `locationName:"instanceId" type:"string"` + InstanceId *string `locationName:"instanceId" type:"string"` // Indicates whether this is a Spot Instance. - InstanceLifecycle *string `locationName:"instanceLifecycle" type:"string"` + InstanceLifecycle *string `locationName:"instanceLifecycle" type:"string" enum:"InstanceLifecycleType"` // The instance type. - InstanceType *string `locationName:"instanceType" type:"string"` + InstanceType *string `locationName:"instanceType" type:"string" enum:"InstanceType"` // The kernel associated with this instance. - KernelID *string `locationName:"kernelId" type:"string"` + KernelId *string `locationName:"kernelId" type:"string"` // The name of the key pair, if this instance was launched with an associated // key pair. @@ -14717,38 +17476,35 @@ type Instance struct { Placement *Placement `locationName:"placement" type:"structure"` // The value is Windows for Windows instances; otherwise blank. - Platform *string `locationName:"platform" type:"string"` + Platform *string `locationName:"platform" type:"string" enum:"PlatformValues"` // The private DNS name assigned to the instance. This DNS name can only be // used inside the Amazon EC2 network. This name is not available until the // instance enters the running state. - PrivateDNSName *string `locationName:"privateDnsName" type:"string"` + PrivateDnsName *string `locationName:"privateDnsName" type:"string"` // The private IP address assigned to the instance. - PrivateIPAddress *string `locationName:"privateIpAddress" type:"string"` + PrivateIpAddress *string `locationName:"privateIpAddress" type:"string"` // The product codes attached to this instance. ProductCodes []*ProductCode `locationName:"productCodes" locationNameList:"item" type:"list"` // The public DNS name assigned to the instance. This name is not available // until the instance enters the running state. - PublicDNSName *string `locationName:"dnsName" type:"string"` + PublicDnsName *string `locationName:"dnsName" type:"string"` // The public IP address assigned to the instance. - PublicIPAddress *string `locationName:"ipAddress" type:"string"` + PublicIpAddress *string `locationName:"ipAddress" type:"string"` // The RAM disk associated with this instance. - RAMDiskID *string `locationName:"ramdiskId" type:"string"` + RamdiskId *string `locationName:"ramdiskId" type:"string"` // The root device name (for example, /dev/sda1 or /dev/xvda). RootDeviceName *string `locationName:"rootDeviceName" type:"string"` // The root device type used by the AMI. The AMI can use an EBS volume or an // instance store volume. - RootDeviceType *string `locationName:"rootDeviceType" type:"string"` - - // Specifies whether enhanced networking is enabled. - SRIOVNetSupport *string `locationName:"sriovNetSupport" type:"string"` + RootDeviceType *string `locationName:"rootDeviceType" type:"string" enum:"DeviceType"` // One or more security groups for the instance. SecurityGroups []*GroupIdentifier `locationName:"groupSet" locationNameList:"item" type:"list"` @@ -14762,7 +17518,10 @@ type Instance struct { SourceDestCheck *bool `locationName:"sourceDestCheck" type:"boolean"` // The ID of the Spot Instance request. - SpotInstanceRequestID *string `locationName:"spotInstanceRequestId" type:"string"` + SpotInstanceRequestId *string `locationName:"spotInstanceRequestId" type:"string"` + + // Specifies whether enhanced networking is enabled. + SriovNetSupport *string `locationName:"sriovNetSupport" type:"string"` // The current state of the instance. State *InstanceState `locationName:"instanceState" type:"structure"` @@ -14774,16 +17533,16 @@ type Instance struct { StateTransitionReason *string `locationName:"reason" type:"string"` // The ID of the subnet in which the instance is running. - SubnetID *string `locationName:"subnetId" type:"string"` + SubnetId *string `locationName:"subnetId" type:"string"` // Any tags assigned to the instance. Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` - // The ID of the VPC in which the instance is running. - VPCID *string `locationName:"vpcId" type:"string"` - // The virtualization type of the instance. - VirtualizationType *string `locationName:"virtualizationType" type:"string"` + VirtualizationType *string `locationName:"virtualizationType" type:"string" enum:"VirtualizationType"` + + // The ID of the VPC in which the instance is running. + VpcId *string `locationName:"vpcId" type:"string"` metadataInstance `json:"-" xml:"-"` } @@ -14792,6 +17551,16 @@ type metadataInstance struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s Instance) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Instance) GoString() string { + return s.String() +} + // Describes a block device mapping. type InstanceBlockDeviceMapping struct { // The device name exposed to the instance (for example, /dev/sdh or xvdh). @@ -14799,7 +17568,7 @@ type InstanceBlockDeviceMapping struct { // Parameters used to automatically set up EBS volumes when the instance is // launched. - EBS *EBSInstanceBlockDevice `locationName:"ebs" type:"structure"` + Ebs *EbsInstanceBlockDevice `locationName:"ebs" type:"structure"` metadataInstanceBlockDeviceMapping `json:"-" xml:"-"` } @@ -14808,6 +17577,16 @@ type metadataInstanceBlockDeviceMapping struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s InstanceBlockDeviceMapping) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InstanceBlockDeviceMapping) GoString() string { + return s.String() +} + // Describes a block device mapping entry. type InstanceBlockDeviceMappingSpecification struct { // The device name exposed to the instance (for example, /dev/sdh or xvdh). @@ -14815,7 +17594,7 @@ type InstanceBlockDeviceMappingSpecification struct { // Parameters used to automatically set up EBS volumes when the instance is // launched. - EBS *EBSInstanceBlockDeviceSpecification `locationName:"ebs" type:"structure"` + Ebs *EbsInstanceBlockDeviceSpecification `locationName:"ebs" type:"structure"` // suppress the specified device included in the block device mapping. NoDevice *string `locationName:"noDevice" type:"string"` @@ -14830,13 +17609,23 @@ type metadataInstanceBlockDeviceMappingSpecification struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s InstanceBlockDeviceMappingSpecification) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InstanceBlockDeviceMappingSpecification) GoString() string { + return s.String() +} + // Describes a Reserved Instance listing state. type InstanceCount struct { // The number of listed Reserved Instances in the state specified by the state. InstanceCount *int64 `locationName:"instanceCount" type:"integer"` // The states of the listed Reserved Instances. - State *string `locationName:"state" type:"string"` + State *string `locationName:"state" type:"string" enum:"ListingState"` metadataInstanceCount `json:"-" xml:"-"` } @@ -14845,13 +17634,23 @@ type metadataInstanceCount struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s InstanceCount) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InstanceCount) GoString() string { + return s.String() +} + // Describes an instance to export. type InstanceExportDetails struct { // The ID of the resource being exported. - InstanceID *string `locationName:"instanceId" type:"string"` + InstanceId *string `locationName:"instanceId" type:"string"` // The target virtualization environment. - TargetEnvironment *string `locationName:"targetEnvironment" type:"string"` + TargetEnvironment *string `locationName:"targetEnvironment" type:"string" enum:"ExportEnvironment"` metadataInstanceExportDetails `json:"-" xml:"-"` } @@ -14860,10 +17659,20 @@ type metadataInstanceExportDetails struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s InstanceExportDetails) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InstanceExportDetails) GoString() string { + return s.String() +} + // Describes the monitoring information of the instance. type InstanceMonitoring struct { // The ID of the instance. - InstanceID *string `locationName:"instanceId" type:"string"` + InstanceId *string `locationName:"instanceId" type:"string"` // The monitoring information. Monitoring *Monitoring `locationName:"monitoring" type:"structure"` @@ -14875,6 +17684,16 @@ type metadataInstanceMonitoring struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s InstanceMonitoring) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InstanceMonitoring) GoString() string { + return s.String() +} + // Describes a network interface. type InstanceNetworkInterface struct { // The association information for an Elastic IP associated with the network @@ -14891,34 +17710,34 @@ type InstanceNetworkInterface struct { Groups []*GroupIdentifier `locationName:"groupSet" locationNameList:"item" type:"list"` // The MAC address. - MACAddress *string `locationName:"macAddress" type:"string"` + MacAddress *string `locationName:"macAddress" type:"string"` // The ID of the network interface. - NetworkInterfaceID *string `locationName:"networkInterfaceId" type:"string"` + NetworkInterfaceId *string `locationName:"networkInterfaceId" type:"string"` // The ID of the AWS account that created the network interface. - OwnerID *string `locationName:"ownerId" type:"string"` + OwnerId *string `locationName:"ownerId" type:"string"` // The private DNS name. - PrivateDNSName *string `locationName:"privateDnsName" type:"string"` + PrivateDnsName *string `locationName:"privateDnsName" type:"string"` // The IP address of the network interface within the subnet. - PrivateIPAddress *string `locationName:"privateIpAddress" type:"string"` + PrivateIpAddress *string `locationName:"privateIpAddress" type:"string"` // The private IP addresses associated with the network interface. - PrivateIPAddresses []*InstancePrivateIPAddress `locationName:"privateIpAddressesSet" locationNameList:"item" type:"list"` + PrivateIpAddresses []*InstancePrivateIpAddress `locationName:"privateIpAddressesSet" locationNameList:"item" type:"list"` // Indicates whether to validate network traffic to or from this network interface. SourceDestCheck *bool `locationName:"sourceDestCheck" type:"boolean"` // The status of the network interface. - Status *string `locationName:"status" type:"string"` + Status *string `locationName:"status" type:"string" enum:"NetworkInterfaceStatus"` // The ID of the subnet. - SubnetID *string `locationName:"subnetId" type:"string"` + SubnetId *string `locationName:"subnetId" type:"string"` // The ID of the VPC. - VPCID *string `locationName:"vpcId" type:"string"` + VpcId *string `locationName:"vpcId" type:"string"` metadataInstanceNetworkInterface `json:"-" xml:"-"` } @@ -14927,16 +17746,26 @@ type metadataInstanceNetworkInterface struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s InstanceNetworkInterface) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InstanceNetworkInterface) GoString() string { + return s.String() +} + // Describes association information for an Elastic IP address. type InstanceNetworkInterfaceAssociation struct { // The ID of the owner of the Elastic IP address. - IPOwnerID *string `locationName:"ipOwnerId" type:"string"` + IpOwnerId *string `locationName:"ipOwnerId" type:"string"` // The public DNS name. - PublicDNSName *string `locationName:"publicDnsName" type:"string"` + PublicDnsName *string `locationName:"publicDnsName" type:"string"` // The public IP address or Elastic IP address bound to the network interface. - PublicIP *string `locationName:"publicIp" type:"string"` + PublicIp *string `locationName:"publicIp" type:"string"` metadataInstanceNetworkInterfaceAssociation `json:"-" xml:"-"` } @@ -14945,13 +17774,23 @@ type metadataInstanceNetworkInterfaceAssociation struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s InstanceNetworkInterfaceAssociation) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InstanceNetworkInterfaceAssociation) GoString() string { + return s.String() +} + // Describes a network interface attachment. type InstanceNetworkInterfaceAttachment struct { // The time stamp when the attachment initiated. AttachTime *time.Time `locationName:"attachTime" type:"timestamp" timestampFormat:"iso8601"` // The ID of the network interface attachment. - AttachmentID *string `locationName:"attachmentId" type:"string"` + AttachmentId *string `locationName:"attachmentId" type:"string"` // Indicates whether the network interface is deleted when the instance is terminated. DeleteOnTermination *bool `locationName:"deleteOnTermination" type:"boolean"` @@ -14960,7 +17799,7 @@ type InstanceNetworkInterfaceAttachment struct { DeviceIndex *int64 `locationName:"deviceIndex" type:"integer"` // The attachment state. - Status *string `locationName:"status" type:"string"` + Status *string `locationName:"status" type:"string" enum:"AttachmentStatus"` metadataInstanceNetworkInterfaceAttachment `json:"-" xml:"-"` } @@ -14969,6 +17808,16 @@ type metadataInstanceNetworkInterfaceAttachment struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s InstanceNetworkInterfaceAttachment) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InstanceNetworkInterfaceAttachment) GoString() string { + return s.String() +} + // Describes a network interface. type InstanceNetworkInterfaceSpecification struct { // Indicates whether to assign a public IP address to an instance you launch @@ -14976,7 +17825,7 @@ type InstanceNetworkInterfaceSpecification struct { // for eth0, and can only be assigned to a new network interface, not an existing // one. You cannot specify more than one network interface in the request. If // launching into a default subnet, the default value is true. - AssociatePublicIPAddress *bool `locationName:"associatePublicIpAddress" type:"boolean"` + AssociatePublicIpAddress *bool `locationName:"associatePublicIpAddress" type:"boolean"` // If set to true, the interface is deleted when the instance is terminated. // You can specify true only if creating a new network interface when launching @@ -14997,24 +17846,24 @@ type InstanceNetworkInterfaceSpecification struct { Groups []*string `locationName:"SecurityGroupId" locationNameList:"SecurityGroupId" type:"list"` // The ID of the network interface. - NetworkInterfaceID *string `locationName:"networkInterfaceId" type:"string"` + NetworkInterfaceId *string `locationName:"networkInterfaceId" type:"string"` // The private IP address of the network interface. Applies only if creating // a network interface when launching an instance. - PrivateIPAddress *string `locationName:"privateIpAddress" type:"string"` + PrivateIpAddress *string `locationName:"privateIpAddress" type:"string"` // One or more private IP addresses to assign to the network interface. Only // one private IP address can be designated as primary. - PrivateIPAddresses []*PrivateIPAddressSpecification `locationName:"privateIpAddressesSet" queryName:"PrivateIpAddresses" locationNameList:"item" type:"list"` + PrivateIpAddresses []*PrivateIpAddressSpecification `locationName:"privateIpAddressesSet" queryName:"PrivateIpAddresses" locationNameList:"item" type:"list"` // The number of secondary private IP addresses. You can't specify this option // and specify more than one private IP address using the private IP addresses // option. - SecondaryPrivateIPAddressCount *int64 `locationName:"secondaryPrivateIpAddressCount" type:"integer"` + SecondaryPrivateIpAddressCount *int64 `locationName:"secondaryPrivateIpAddressCount" type:"integer"` // The ID of the subnet associated with the network string. Applies only if // creating a network interface when launching an instance. - SubnetID *string `locationName:"subnetId" type:"string"` + SubnetId *string `locationName:"subnetId" type:"string"` metadataInstanceNetworkInterfaceSpecification `json:"-" xml:"-"` } @@ -15023,8 +17872,18 @@ type metadataInstanceNetworkInterfaceSpecification struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s InstanceNetworkInterfaceSpecification) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InstanceNetworkInterfaceSpecification) GoString() string { + return s.String() +} + // Describes a private IP address. -type InstancePrivateIPAddress struct { +type InstancePrivateIpAddress struct { // The association information for an Elastic IP address for the network interface. Association *InstanceNetworkInterfaceAssociation `locationName:"association" type:"structure"` @@ -15033,18 +17892,28 @@ type InstancePrivateIPAddress struct { Primary *bool `locationName:"primary" type:"boolean"` // The private DNS name. - PrivateDNSName *string `locationName:"privateDnsName" type:"string"` + PrivateDnsName *string `locationName:"privateDnsName" type:"string"` // The private IP address of the network interface. - PrivateIPAddress *string `locationName:"privateIpAddress" type:"string"` + PrivateIpAddress *string `locationName:"privateIpAddress" type:"string"` - metadataInstancePrivateIPAddress `json:"-" xml:"-"` + metadataInstancePrivateIpAddress `json:"-" xml:"-"` } -type metadataInstancePrivateIPAddress struct { +type metadataInstancePrivateIpAddress struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s InstancePrivateIpAddress) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InstancePrivateIpAddress) GoString() string { + return s.String() +} + // Describes the current state of the instance. type InstanceState struct { // The low byte represents the state. The high byte is an opaque internal value @@ -15064,7 +17933,7 @@ type InstanceState struct { Code *int64 `locationName:"code" type:"integer"` // The current state of the instance. - Name *string `locationName:"name" type:"string"` + Name *string `locationName:"name" type:"string" enum:"InstanceStateName"` metadataInstanceState `json:"-" xml:"-"` } @@ -15073,13 +17942,23 @@ type metadataInstanceState struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s InstanceState) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InstanceState) GoString() string { + return s.String() +} + // Describes an instance state change. type InstanceStateChange struct { // The current state of the instance. CurrentState *InstanceState `locationName:"currentState" type:"structure"` // The ID of the instance. - InstanceID *string `locationName:"instanceId" type:"string"` + InstanceId *string `locationName:"instanceId" type:"string"` // The previous state of the instance. PreviousState *InstanceState `locationName:"previousState" type:"structure"` @@ -15091,6 +17970,16 @@ type metadataInstanceStateChange struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s InstanceStateChange) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InstanceStateChange) GoString() string { + return s.String() +} + // Describes the status of an instance. type InstanceStatus struct { // The Availability Zone of the instance. @@ -15100,7 +17989,7 @@ type InstanceStatus struct { Events []*InstanceStatusEvent `locationName:"eventsSet" locationNameList:"item" type:"list"` // The ID of the instance. - InstanceID *string `locationName:"instanceId" type:"string"` + InstanceId *string `locationName:"instanceId" type:"string"` // The intended state of the instance. DescribeInstanceStatus requires that // an instance be in the running state. @@ -15122,6 +18011,16 @@ type metadataInstanceStatus struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s InstanceStatus) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InstanceStatus) GoString() string { + return s.String() +} + // Describes the instance status. type InstanceStatusDetails struct { // The time when a status check failed. For an instance that was launched and @@ -15129,10 +18028,10 @@ type InstanceStatusDetails struct { ImpairedSince *time.Time `locationName:"impairedSince" type:"timestamp" timestampFormat:"iso8601"` // The type of instance status. - Name *string `locationName:"name" type:"string"` + Name *string `locationName:"name" type:"string" enum:"StatusName"` // The status. - Status *string `locationName:"status" type:"string"` + Status *string `locationName:"status" type:"string" enum:"StatusType"` metadataInstanceStatusDetails `json:"-" xml:"-"` } @@ -15141,10 +18040,20 @@ type metadataInstanceStatusDetails struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s InstanceStatusDetails) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InstanceStatusDetails) GoString() string { + return s.String() +} + // Describes a scheduled event for an instance. type InstanceStatusEvent struct { // The event code. - Code *string `locationName:"code" type:"string"` + Code *string `locationName:"code" type:"string" enum:"EventCode"` // A description of the event. // @@ -15166,13 +18075,23 @@ type metadataInstanceStatusEvent struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s InstanceStatusEvent) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InstanceStatusEvent) GoString() string { + return s.String() +} + // Describes the status of an instance. type InstanceStatusSummary struct { // The system instance health or application instance health. Details []*InstanceStatusDetails `locationName:"details" locationNameList:"item" type:"list"` // The status. - Status *string `locationName:"status" type:"string"` + Status *string `locationName:"status" type:"string" enum:"SummaryStatus"` metadataInstanceStatusSummary `json:"-" xml:"-"` } @@ -15181,13 +18100,23 @@ type metadataInstanceStatusSummary struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s InstanceStatusSummary) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InstanceStatusSummary) GoString() string { + return s.String() +} + // Describes an Internet gateway. type InternetGateway struct { // Any VPCs attached to the Internet gateway. Attachments []*InternetGatewayAttachment `locationName:"attachmentSet" locationNameList:"item" type:"list"` // The ID of the Internet gateway. - InternetGatewayID *string `locationName:"internetGatewayId" type:"string"` + InternetGatewayId *string `locationName:"internetGatewayId" type:"string"` // Any tags assigned to the Internet gateway. Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` @@ -15199,13 +18128,23 @@ type metadataInternetGateway struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s InternetGateway) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InternetGateway) GoString() string { + return s.String() +} + // Describes the attachment of a VPC to an Internet gateway. type InternetGatewayAttachment struct { // The current state of the attachment. - State *string `locationName:"state" type:"string"` + State *string `locationName:"state" type:"string" enum:"AttachmentStatus"` // The ID of the VPC. - VPCID *string `locationName:"vpcId" type:"string"` + VpcId *string `locationName:"vpcId" type:"string"` metadataInternetGatewayAttachment `json:"-" xml:"-"` } @@ -15214,6 +18153,88 @@ type metadataInternetGatewayAttachment struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s InternetGatewayAttachment) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InternetGatewayAttachment) GoString() string { + return s.String() +} + +// Describes a security group rule. +type IpPermission struct { + // The start of port range for the TCP and UDP protocols, or an ICMP type number. + // A value of -1 indicates all ICMP types. + FromPort *int64 `locationName:"fromPort" type:"integer"` + + // The protocol. + // + // When you call DescribeSecurityGroups, the protocol value returned is the + // number. Exception: For TCP, UDP, and ICMP, the value returned is the name + // (for example, tcp, udp, or icmp). For a list of protocol numbers, see Protocol + // Numbers (http://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml). + // (VPC only) When you call AuthorizeSecurityGroupIngress, you can use -1 to + // specify all. + IpProtocol *string `locationName:"ipProtocol" type:"string"` + + // One or more IP ranges. + IpRanges []*IpRange `locationName:"ipRanges" locationNameList:"item" type:"list"` + + // (Valid for AuthorizeSecurityGroupEgress, RevokeSecurityGroupEgress and DescribeSecurityGroups + // only) One or more prefix list IDs for an AWS service. In an AuthorizeSecurityGroupEgress + // request, this is the AWS service that you want to access through a VPC endpoint + // from instances associated with the security group. + PrefixListIds []*PrefixListId `locationName:"prefixListIds" locationNameList:"item" type:"list"` + + // The end of port range for the TCP and UDP protocols, or an ICMP code. A value + // of -1 indicates all ICMP codes for the specified ICMP type. + ToPort *int64 `locationName:"toPort" type:"integer"` + + // One or more security group and AWS account ID pairs. + UserIdGroupPairs []*UserIdGroupPair `locationName:"groups" locationNameList:"item" type:"list"` + + metadataIpPermission `json:"-" xml:"-"` +} + +type metadataIpPermission struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s IpPermission) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s IpPermission) GoString() string { + return s.String() +} + +// Describes an IP range. +type IpRange struct { + // The CIDR range. You can either specify a CIDR range or a source security + // group, not both. + CidrIp *string `locationName:"cidrIp" type:"string"` + + metadataIpRange `json:"-" xml:"-"` +} + +type metadataIpRange struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s IpRange) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s IpRange) GoString() string { + return s.String() +} + // Describes a key pair. type KeyPairInfo struct { // If you used CreateKeyPair to create the key pair, this is the SHA-1 digest @@ -15232,13 +18253,23 @@ type metadataKeyPairInfo struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s KeyPairInfo) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s KeyPairInfo) GoString() string { + return s.String() +} + // Describes a launch permission. type LaunchPermission struct { // The name of the group. - Group *string `locationName:"group" type:"string"` + Group *string `locationName:"group" type:"string" enum:"PermissionGroup"` // The AWS account ID. - UserID *string `locationName:"userId" type:"string"` + UserId *string `locationName:"userId" type:"string"` metadataLaunchPermission `json:"-" xml:"-"` } @@ -15247,6 +18278,16 @@ type metadataLaunchPermission struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s LaunchPermission) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LaunchPermission) GoString() string { + return s.String() +} + // Describes a launch permission modification. type LaunchPermissionModifications struct { // The AWS account ID to add to the list of launch permissions for the AMI. @@ -15263,6 +18304,16 @@ type metadataLaunchPermissionModifications struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s LaunchPermissionModifications) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LaunchPermissionModifications) GoString() string { + return s.String() +} + // Describes the launch specification for an instance. type LaunchSpecification struct { // Deprecated. @@ -15278,19 +18329,19 @@ type LaunchSpecification struct { // Optimized instance. // // Default: false - EBSOptimized *bool `locationName:"ebsOptimized" type:"boolean"` + EbsOptimized *bool `locationName:"ebsOptimized" type:"boolean"` // The IAM instance profile. - IAMInstanceProfile *IAMInstanceProfileSpecification `locationName:"iamInstanceProfile" type:"structure"` + IamInstanceProfile *IamInstanceProfileSpecification `locationName:"iamInstanceProfile" type:"structure"` // The ID of the AMI. - ImageID *string `locationName:"imageId" type:"string"` + ImageId *string `locationName:"imageId" type:"string"` // The instance type. - InstanceType *string `locationName:"instanceType" type:"string"` + InstanceType *string `locationName:"instanceType" type:"string" enum:"InstanceType"` // The ID of the kernel. - KernelID *string `locationName:"kernelId" type:"string"` + KernelId *string `locationName:"kernelId" type:"string"` // The name of the key pair. KeyName *string `locationName:"keyName" type:"string"` @@ -15305,7 +18356,7 @@ type LaunchSpecification struct { Placement *SpotPlacement `locationName:"placement" type:"structure"` // The ID of the RAM disk. - RAMDiskID *string `locationName:"ramdiskId" type:"string"` + RamdiskId *string `locationName:"ramdiskId" type:"string"` // One or more security groups. To request an instance in a nondefault VPC, // you must specify the ID of the security group. To request an instance in @@ -15314,7 +18365,7 @@ type LaunchSpecification struct { SecurityGroups []*GroupIdentifier `locationName:"groupSet" locationNameList:"item" type:"list"` // The ID of the subnet in which to launch the instance. - SubnetID *string `locationName:"subnetId" type:"string"` + SubnetId *string `locationName:"subnetId" type:"string"` // The Base64-encoded MIME user data to make available to the instances. UserData *string `locationName:"userData" type:"string"` @@ -15326,6 +18377,16 @@ type metadataLaunchSpecification struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s LaunchSpecification) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LaunchSpecification) GoString() string { + return s.String() +} + type ModifyImageAttributeInput struct { // The name of the attribute to modify. Attribute *string `type:"string"` @@ -15340,13 +18401,13 @@ type ModifyImageAttributeInput struct { DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the AMI. - ImageID *string `locationName:"ImageId" type:"string" required:"true"` + ImageId *string `type:"string" required:"true"` // A launch permission modification. LaunchPermission *LaunchPermissionModifications `type:"structure"` // The operation type. - OperationType *string `type:"string"` + OperationType *string `type:"string" enum:"OperationType"` // One or more product codes. After you add a product code to an AMI, it can't // be removed. This is only valid when modifying the productCodes attribute. @@ -15358,7 +18419,7 @@ type ModifyImageAttributeInput struct { // One or more AWS account IDs. This is only valid when modifying the launchPermission // attribute. - UserIDs []*string `locationName:"UserId" locationNameList:"UserId" type:"list"` + UserIds []*string `locationName:"UserId" locationNameList:"UserId" type:"list"` // The value of the attribute being modified. This is only valid when modifying // the description attribute. @@ -15371,6 +18432,16 @@ type metadataModifyImageAttributeInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s ModifyImageAttributeInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ModifyImageAttributeInput) GoString() string { + return s.String() +} + type ModifyImageAttributeOutput struct { metadataModifyImageAttributeOutput `json:"-" xml:"-"` } @@ -15379,9 +18450,19 @@ type metadataModifyImageAttributeOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s ModifyImageAttributeOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ModifyImageAttributeOutput) GoString() string { + return s.String() +} + type ModifyInstanceAttributeInput struct { // The name of the attribute. - Attribute *string `locationName:"attribute" type:"string"` + Attribute *string `locationName:"attribute" type:"string" enum:"InstanceAttributeName"` // Modifies the DeleteOnTermination attribute for volumes that are currently // attached. The volume must be owned by the caller. If no value is specified @@ -15395,8 +18476,9 @@ type ModifyInstanceAttributeInput struct { BlockDeviceMappings []*InstanceBlockDeviceMappingSpecification `locationName:"blockDeviceMapping" locationNameList:"item" type:"list"` // If the value is true, you can't terminate the instance using the Amazon EC2 - // console, CLI, or API; otherwise, you can. - DisableAPITermination *AttributeBooleanValue `locationName:"disableApiTermination" type:"structure"` + // console, CLI, or API; otherwise, you can. You cannot use this paramater for + // Spot Instances. + DisableApiTermination *AttributeBooleanValue `locationName:"disableApiTermination" type:"structure"` // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have @@ -15409,7 +18491,7 @@ type ModifyInstanceAttributeInput struct { // stack to provide optimal EBS I/O performance. This optimization isn't available // with all instance types. Additional usage charges apply when using an EBS // Optimized instance. - EBSOptimized *AttributeBooleanValue `locationName:"ebsOptimized" type:"structure"` + EbsOptimized *AttributeBooleanValue `locationName:"ebsOptimized" type:"structure"` // [EC2-VPC] Changes the security groups of the instance. You must specify at // least one security group, even if it's just the default security group for @@ -15417,7 +18499,7 @@ type ModifyInstanceAttributeInput struct { Groups []*string `locationName:"GroupId" locationNameList:"groupId" type:"list"` // The ID of the instance. - InstanceID *string `locationName:"instanceId" type:"string" required:"true"` + InstanceId *string `locationName:"instanceId" type:"string" required:"true"` // Specifies whether an instance stops or terminates when you initiate shutdown // from the instance (using the operating system command for system shutdown). @@ -15436,7 +18518,12 @@ type ModifyInstanceAttributeInput struct { // Changes the instance's RAM disk to the specified value. We recommend that // you use PV-GRUB instead of kernels and RAM disks. For more information, see // PV-GRUB (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/UserProvidedKernels.html). - RAMDisk *AttributeValue `locationName:"ramdisk" type:"structure"` + Ramdisk *AttributeValue `locationName:"ramdisk" type:"structure"` + + // Specifies whether source/destination checking is enabled. A value of true + // means that checking is enabled, and false means checking is disabled. This + // value must be false for a NAT instance to perform NAT. + SourceDestCheck *AttributeBooleanValue `type:"structure"` // Set to simple to enable enhanced networking for the instance. // @@ -15444,18 +18531,13 @@ type ModifyInstanceAttributeInput struct { // // This option is supported only for HVM instances. Specifying this option // with a PV instance can make it unreachable. - SRIOVNetSupport *AttributeValue `locationName:"sriovNetSupport" type:"structure"` - - // Specifies whether source/destination checking is enabled. A value of true - // means that checking is enabled, and false means checking is disabled. This - // value must be false for a NAT instance to perform NAT. - SourceDestCheck *AttributeBooleanValue `type:"structure"` + SriovNetSupport *AttributeValue `locationName:"sriovNetSupport" type:"structure"` // Changes the instance's user data to the specified value. UserData *BlobAttributeValue `locationName:"userData" type:"structure"` // A new value for the attribute. Use only with the kernel, ramdisk, userData, - // disableApiTermination, or intanceInitiateShutdownBehavior attribute. + // disableApiTermination, or instanceInitiatedShutdownBehavior attribute. Value *string `locationName:"value" type:"string"` metadataModifyInstanceAttributeInput `json:"-" xml:"-"` @@ -15465,6 +18547,16 @@ type metadataModifyInstanceAttributeInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s ModifyInstanceAttributeInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ModifyInstanceAttributeInput) GoString() string { + return s.String() +} + type ModifyInstanceAttributeOutput struct { metadataModifyInstanceAttributeOutput `json:"-" xml:"-"` } @@ -15473,6 +18565,16 @@ type metadataModifyInstanceAttributeOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s ModifyInstanceAttributeOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ModifyInstanceAttributeOutput) GoString() string { + return s.String() +} + type ModifyNetworkInterfaceAttributeInput struct { // Information about the interface attachment. If modifying the 'delete on termination' // attribute, you must specify the ID of the interface attachment. @@ -15494,7 +18596,7 @@ type ModifyNetworkInterfaceAttributeInput struct { Groups []*string `locationName:"SecurityGroupId" locationNameList:"SecurityGroupId" type:"list"` // The ID of the network interface. - NetworkInterfaceID *string `locationName:"networkInterfaceId" type:"string" required:"true"` + NetworkInterfaceId *string `locationName:"networkInterfaceId" type:"string" required:"true"` // Indicates whether source/destination checking is enabled. A value of true // means checking is enabled, and false means checking is disabled. This value @@ -15510,6 +18612,16 @@ type metadataModifyNetworkInterfaceAttributeInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s ModifyNetworkInterfaceAttributeInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ModifyNetworkInterfaceAttributeInput) GoString() string { + return s.String() +} + type ModifyNetworkInterfaceAttributeOutput struct { metadataModifyNetworkInterfaceAttributeOutput `json:"-" xml:"-"` } @@ -15518,13 +18630,23 @@ type metadataModifyNetworkInterfaceAttributeOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s ModifyNetworkInterfaceAttributeOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ModifyNetworkInterfaceAttributeOutput) GoString() string { + return s.String() +} + type ModifyReservedInstancesInput struct { // A unique, case-sensitive token you provide to ensure idempotency of your // modification request. For more information, see Ensuring Idempotency (http://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). ClientToken *string `locationName:"clientToken" type:"string"` // The IDs of the Reserved Instances to modify. - ReservedInstancesIDs []*string `locationName:"ReservedInstancesId" locationNameList:"ReservedInstancesId" type:"list" required:"true"` + ReservedInstancesIds []*string `locationName:"ReservedInstancesId" locationNameList:"ReservedInstancesId" type:"list" required:"true"` // The configuration settings for the Reserved Instances to modify. TargetConfigurations []*ReservedInstancesConfiguration `locationName:"ReservedInstancesConfigurationSetItemType" locationNameList:"item" type:"list" required:"true"` @@ -15536,9 +18658,19 @@ type metadataModifyReservedInstancesInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s ModifyReservedInstancesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ModifyReservedInstancesInput) GoString() string { + return s.String() +} + type ModifyReservedInstancesOutput struct { // The ID for the modification. - ReservedInstancesModificationID *string `locationName:"reservedInstancesModificationId" type:"string"` + ReservedInstancesModificationId *string `locationName:"reservedInstancesModificationId" type:"string"` metadataModifyReservedInstancesOutput `json:"-" xml:"-"` } @@ -15547,9 +18679,21 @@ type metadataModifyReservedInstancesOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s ModifyReservedInstancesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ModifyReservedInstancesOutput) GoString() string { + return s.String() +} + type ModifySnapshotAttributeInput struct { // The snapshot attribute to modify. - Attribute *string `type:"string"` + // + // Only volume creation permissions may be modified at the customer level. + Attribute *string `type:"string" enum:"SnapshotAttributeName"` // A JSON representation of the snapshot attribute modification. CreateVolumePermission *CreateVolumePermissionModifications `type:"structure"` @@ -15564,13 +18708,13 @@ type ModifySnapshotAttributeInput struct { GroupNames []*string `locationName:"UserGroup" locationNameList:"GroupName" type:"list"` // The type of operation to perform to the attribute. - OperationType *string `type:"string"` + OperationType *string `type:"string" enum:"OperationType"` // The ID of the snapshot. - SnapshotID *string `locationName:"SnapshotId" type:"string" required:"true"` + SnapshotId *string `type:"string" required:"true"` // The account ID to modify for the snapshot. - UserIDs []*string `locationName:"UserId" locationNameList:"UserId" type:"list"` + UserIds []*string `locationName:"UserId" locationNameList:"UserId" type:"list"` metadataModifySnapshotAttributeInput `json:"-" xml:"-"` } @@ -15579,6 +18723,16 @@ type metadataModifySnapshotAttributeInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s ModifySnapshotAttributeInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ModifySnapshotAttributeInput) GoString() string { + return s.String() +} + type ModifySnapshotAttributeOutput struct { metadataModifySnapshotAttributeOutput `json:"-" xml:"-"` } @@ -15587,13 +18741,23 @@ type metadataModifySnapshotAttributeOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s ModifySnapshotAttributeOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ModifySnapshotAttributeOutput) GoString() string { + return s.String() +} + type ModifySubnetAttributeInput struct { // Specify true to indicate that instances launched into the specified subnet // should be assigned public IP address. - MapPublicIPOnLaunch *AttributeBooleanValue `locationName:"MapPublicIpOnLaunch" type:"structure"` + MapPublicIpOnLaunch *AttributeBooleanValue `type:"structure"` // The ID of the subnet. - SubnetID *string `locationName:"subnetId" type:"string" required:"true"` + SubnetId *string `locationName:"subnetId" type:"string" required:"true"` metadataModifySubnetAttributeInput `json:"-" xml:"-"` } @@ -15602,6 +18766,16 @@ type metadataModifySubnetAttributeInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s ModifySubnetAttributeInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ModifySubnetAttributeInput) GoString() string { + return s.String() +} + type ModifySubnetAttributeOutput struct { metadataModifySubnetAttributeOutput `json:"-" xml:"-"` } @@ -15610,41 +18784,119 @@ type metadataModifySubnetAttributeOutput struct { SDKShapeTraits bool `type:"structure"` } -type ModifyVPCAttributeInput struct { +// String returns the string representation +func (s ModifySubnetAttributeOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ModifySubnetAttributeOutput) GoString() string { + return s.String() +} + +type ModifyVolumeAttributeInput struct { + // Indicates whether the volume should be auto-enabled for I/O operations. + AutoEnableIO *AttributeBooleanValue `type:"structure"` + + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. + DryRun *bool `locationName:"dryRun" type:"boolean"` + + // The ID of the volume. + VolumeId *string `type:"string" required:"true"` + + metadataModifyVolumeAttributeInput `json:"-" xml:"-"` +} + +type metadataModifyVolumeAttributeInput struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s ModifyVolumeAttributeInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ModifyVolumeAttributeInput) GoString() string { + return s.String() +} + +type ModifyVolumeAttributeOutput struct { + metadataModifyVolumeAttributeOutput `json:"-" xml:"-"` +} + +type metadataModifyVolumeAttributeOutput struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s ModifyVolumeAttributeOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ModifyVolumeAttributeOutput) GoString() string { + return s.String() +} + +type ModifyVpcAttributeInput struct { // Indicates whether the instances launched in the VPC get DNS hostnames. If // enabled, instances in the VPC get DNS hostnames; otherwise, they do not. // // You can only enable DNS hostnames if you also enable DNS support. - EnableDNSHostnames *AttributeBooleanValue `locationName:"EnableDnsHostnames" type:"structure"` + EnableDnsHostnames *AttributeBooleanValue `type:"structure"` // Indicates whether the DNS resolution is supported for the VPC. If enabled, // queries to the Amazon provided DNS server at the 169.254.169.253 IP address, // or the reserved IP address at the base of the VPC network range "plus two" // will succeed. If disabled, the Amazon provided DNS service in the VPC that // resolves public DNS hostnames to IP addresses is not enabled. - EnableDNSSupport *AttributeBooleanValue `locationName:"EnableDnsSupport" type:"structure"` + EnableDnsSupport *AttributeBooleanValue `type:"structure"` // The ID of the VPC. - VPCID *string `locationName:"vpcId" type:"string" required:"true"` + VpcId *string `locationName:"vpcId" type:"string" required:"true"` - metadataModifyVPCAttributeInput `json:"-" xml:"-"` + metadataModifyVpcAttributeInput `json:"-" xml:"-"` } -type metadataModifyVPCAttributeInput struct { +type metadataModifyVpcAttributeInput struct { SDKShapeTraits bool `type:"structure"` } -type ModifyVPCAttributeOutput struct { - metadataModifyVPCAttributeOutput `json:"-" xml:"-"` +// String returns the string representation +func (s ModifyVpcAttributeInput) String() string { + return awsutil.Prettify(s) } -type metadataModifyVPCAttributeOutput struct { - SDKShapeTraits bool `type:"structure"` +// GoString returns the string representation +func (s ModifyVpcAttributeInput) GoString() string { + return s.String() } -type ModifyVPCEndpointInput struct { +type ModifyVpcAttributeOutput struct { + metadataModifyVpcAttributeOutput `json:"-" xml:"-"` +} + +type metadataModifyVpcAttributeOutput struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s ModifyVpcAttributeOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ModifyVpcAttributeOutput) GoString() string { + return s.String() +} + +type ModifyVpcEndpointInput struct { // One or more route tables IDs to associate with the endpoint. - AddRouteTableIDs []*string `locationName:"AddRouteTableId" locationNameList:"item" type:"list"` + AddRouteTableIds []*string `locationName:"AddRouteTableId" locationNameList:"item" type:"list"` // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have @@ -15657,59 +18909,51 @@ type ModifyVPCEndpointInput struct { PolicyDocument *string `type:"string"` // One or more route table IDs to disassociate from the endpoint. - RemoveRouteTableIDs []*string `locationName:"RemoveRouteTableId" locationNameList:"item" type:"list"` + RemoveRouteTableIds []*string `locationName:"RemoveRouteTableId" locationNameList:"item" type:"list"` // Specify true to reset the policy document to the default policy. The default // policy allows access to the service. ResetPolicy *bool `type:"boolean"` // The ID of the endpoint. - VPCEndpointID *string `locationName:"VpcEndpointId" type:"string" required:"true"` + VpcEndpointId *string `type:"string" required:"true"` - metadataModifyVPCEndpointInput `json:"-" xml:"-"` + metadataModifyVpcEndpointInput `json:"-" xml:"-"` } -type metadataModifyVPCEndpointInput struct { +type metadataModifyVpcEndpointInput struct { SDKShapeTraits bool `type:"structure"` } -type ModifyVPCEndpointOutput struct { - // Returns true if the request succeeds; otherwise, it returns an error. - Return *bool `locationName:"return" type:"boolean"` - - metadataModifyVPCEndpointOutput `json:"-" xml:"-"` +// String returns the string representation +func (s ModifyVpcEndpointInput) String() string { + return awsutil.Prettify(s) } -type metadataModifyVPCEndpointOutput struct { - SDKShapeTraits bool `type:"structure"` +// GoString returns the string representation +func (s ModifyVpcEndpointInput) GoString() string { + return s.String() } -type ModifyVolumeAttributeInput struct { - // Indicates whether the volume should be auto-enabled for I/O operations. - AutoEnableIO *AttributeBooleanValue `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The ID of the volume. - VolumeID *string `locationName:"VolumeId" type:"string" required:"true"` +type ModifyVpcEndpointOutput struct { + // Returns true if the request succeeds; otherwise, it returns an error. + Return *bool `locationName:"return" type:"boolean"` - metadataModifyVolumeAttributeInput `json:"-" xml:"-"` + metadataModifyVpcEndpointOutput `json:"-" xml:"-"` } -type metadataModifyVolumeAttributeInput struct { +type metadataModifyVpcEndpointOutput struct { SDKShapeTraits bool `type:"structure"` } -type ModifyVolumeAttributeOutput struct { - metadataModifyVolumeAttributeOutput `json:"-" xml:"-"` +// String returns the string representation +func (s ModifyVpcEndpointOutput) String() string { + return awsutil.Prettify(s) } -type metadataModifyVolumeAttributeOutput struct { - SDKShapeTraits bool `type:"structure"` +// GoString returns the string representation +func (s ModifyVpcEndpointOutput) GoString() string { + return s.String() } type MonitorInstancesInput struct { @@ -15720,7 +18964,7 @@ type MonitorInstancesInput struct { DryRun *bool `locationName:"dryRun" type:"boolean"` // One or more instance IDs. - InstanceIDs []*string `locationName:"InstanceId" locationNameList:"InstanceId" type:"list" required:"true"` + InstanceIds []*string `locationName:"InstanceId" locationNameList:"InstanceId" type:"list" required:"true"` metadataMonitorInstancesInput `json:"-" xml:"-"` } @@ -15729,6 +18973,16 @@ type metadataMonitorInstancesInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s MonitorInstancesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s MonitorInstancesInput) GoString() string { + return s.String() +} + type MonitorInstancesOutput struct { // Monitoring information for one or more instances. InstanceMonitorings []*InstanceMonitoring `locationName:"instancesSet" locationNameList:"item" type:"list"` @@ -15740,10 +18994,20 @@ type metadataMonitorInstancesOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s MonitorInstancesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s MonitorInstancesOutput) GoString() string { + return s.String() +} + // Describes the monitoring for the instance. type Monitoring struct { // Indicates whether monitoring is enabled for the instance. - State *string `locationName:"state" type:"string"` + State *string `locationName:"state" type:"string" enum:"MonitoringState"` metadataMonitoring `json:"-" xml:"-"` } @@ -15752,7 +19016,17 @@ type metadataMonitoring struct { SDKShapeTraits bool `type:"structure"` } -type MoveAddressToVPCInput struct { +// String returns the string representation +func (s Monitoring) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Monitoring) GoString() string { + return s.String() +} + +type MoveAddressToVpcInput struct { // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have // the required permissions, the error response is DryRunOperation. Otherwise, @@ -15760,37 +19034,57 @@ type MoveAddressToVPCInput struct { DryRun *bool `locationName:"dryRun" type:"boolean"` // The Elastic IP address. - PublicIP *string `locationName:"publicIp" type:"string" required:"true"` + PublicIp *string `locationName:"publicIp" type:"string" required:"true"` - metadataMoveAddressToVPCInput `json:"-" xml:"-"` + metadataMoveAddressToVpcInput `json:"-" xml:"-"` } -type metadataMoveAddressToVPCInput struct { +type metadataMoveAddressToVpcInput struct { SDKShapeTraits bool `type:"structure"` } -type MoveAddressToVPCOutput struct { +// String returns the string representation +func (s MoveAddressToVpcInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s MoveAddressToVpcInput) GoString() string { + return s.String() +} + +type MoveAddressToVpcOutput struct { // The allocation ID for the Elastic IP address. - AllocationID *string `locationName:"allocationId" type:"string"` + AllocationId *string `locationName:"allocationId" type:"string"` // The status of the move of the IP address. - Status *string `locationName:"status" type:"string"` + Status *string `locationName:"status" type:"string" enum:"Status"` - metadataMoveAddressToVPCOutput `json:"-" xml:"-"` + metadataMoveAddressToVpcOutput `json:"-" xml:"-"` } -type metadataMoveAddressToVPCOutput struct { +type metadataMoveAddressToVpcOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s MoveAddressToVpcOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s MoveAddressToVpcOutput) GoString() string { + return s.String() +} + // Describes the status of a moving Elastic IP address. type MovingAddressStatus struct { // The status of the Elastic IP address that's being moved to the EC2-VPC platform, // or restored to the EC2-Classic platform. - MoveStatus *string `locationName:"moveStatus" type:"string"` + MoveStatus *string `locationName:"moveStatus" type:"string" enum:"MoveStatus"` // The Elastic IP address. - PublicIP *string `locationName:"publicIp" type:"string"` + PublicIp *string `locationName:"publicIp" type:"string"` metadataMovingAddressStatus `json:"-" xml:"-"` } @@ -15799,62 +19093,92 @@ type metadataMovingAddressStatus struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s MovingAddressStatus) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s MovingAddressStatus) GoString() string { + return s.String() +} + // Describes a network ACL. -type NetworkACL struct { +type NetworkAcl struct { // Any associations between the network ACL and one or more subnets - Associations []*NetworkACLAssociation `locationName:"associationSet" locationNameList:"item" type:"list"` + Associations []*NetworkAclAssociation `locationName:"associationSet" locationNameList:"item" type:"list"` // One or more entries (rules) in the network ACL. - Entries []*NetworkACLEntry `locationName:"entrySet" locationNameList:"item" type:"list"` + Entries []*NetworkAclEntry `locationName:"entrySet" locationNameList:"item" type:"list"` // Indicates whether this is the default network ACL for the VPC. IsDefault *bool `locationName:"default" type:"boolean"` // The ID of the network ACL. - NetworkACLID *string `locationName:"networkAclId" type:"string"` + NetworkAclId *string `locationName:"networkAclId" type:"string"` // Any tags assigned to the network ACL. Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` // The ID of the VPC for the network ACL. - VPCID *string `locationName:"vpcId" type:"string"` + VpcId *string `locationName:"vpcId" type:"string"` - metadataNetworkACL `json:"-" xml:"-"` + metadataNetworkAcl `json:"-" xml:"-"` } -type metadataNetworkACL struct { +type metadataNetworkAcl struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s NetworkAcl) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s NetworkAcl) GoString() string { + return s.String() +} + // Describes an association between a network ACL and a subnet. -type NetworkACLAssociation struct { +type NetworkAclAssociation struct { // The ID of the association between a network ACL and a subnet. - NetworkACLAssociationID *string `locationName:"networkAclAssociationId" type:"string"` + NetworkAclAssociationId *string `locationName:"networkAclAssociationId" type:"string"` // The ID of the network ACL. - NetworkACLID *string `locationName:"networkAclId" type:"string"` + NetworkAclId *string `locationName:"networkAclId" type:"string"` // The ID of the subnet. - SubnetID *string `locationName:"subnetId" type:"string"` + SubnetId *string `locationName:"subnetId" type:"string"` - metadataNetworkACLAssociation `json:"-" xml:"-"` + metadataNetworkAclAssociation `json:"-" xml:"-"` } -type metadataNetworkACLAssociation struct { +type metadataNetworkAclAssociation struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s NetworkAclAssociation) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s NetworkAclAssociation) GoString() string { + return s.String() +} + // Describes an entry in a network ACL. -type NetworkACLEntry struct { +type NetworkAclEntry struct { // The network range to allow or deny, in CIDR notation. - CIDRBlock *string `locationName:"cidrBlock" type:"string"` + CidrBlock *string `locationName:"cidrBlock" type:"string"` // Indicates whether the rule is an egress rule (applied to traffic leaving // the subnet). Egress *bool `locationName:"egress" type:"boolean"` // ICMP protocol: The ICMP type and code. - ICMPTypeCode *ICMPTypeCode `locationName:"icmpTypeCode" type:"structure"` + IcmpTypeCode *IcmpTypeCode `locationName:"icmpTypeCode" type:"structure"` // TCP or UDP protocols: The range of ports the rule applies to. PortRange *PortRange `locationName:"portRange" type:"structure"` @@ -15863,19 +19187,29 @@ type NetworkACLEntry struct { Protocol *string `locationName:"protocol" type:"string"` // Indicates whether to allow or deny the traffic that matches the rule. - RuleAction *string `locationName:"ruleAction" type:"string"` + RuleAction *string `locationName:"ruleAction" type:"string" enum:"RuleAction"` // The rule number for the entry. ACL entries are processed in ascending order // by rule number. RuleNumber *int64 `locationName:"ruleNumber" type:"integer"` - metadataNetworkACLEntry `json:"-" xml:"-"` + metadataNetworkAclEntry `json:"-" xml:"-"` } -type metadataNetworkACLEntry struct { +type metadataNetworkAclEntry struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s NetworkAclEntry) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s NetworkAclEntry) GoString() string { + return s.String() +} + // Describes a network interface. type NetworkInterface struct { // The association information for an Elastic IP associated with the network @@ -15895,26 +19229,26 @@ type NetworkInterface struct { Groups []*GroupIdentifier `locationName:"groupSet" locationNameList:"item" type:"list"` // The MAC address. - MACAddress *string `locationName:"macAddress" type:"string"` + MacAddress *string `locationName:"macAddress" type:"string"` // The ID of the network interface. - NetworkInterfaceID *string `locationName:"networkInterfaceId" type:"string"` + NetworkInterfaceId *string `locationName:"networkInterfaceId" type:"string"` // The AWS account ID of the owner of the network interface. - OwnerID *string `locationName:"ownerId" type:"string"` + OwnerId *string `locationName:"ownerId" type:"string"` // The private DNS name. - PrivateDNSName *string `locationName:"privateDnsName" type:"string"` + PrivateDnsName *string `locationName:"privateDnsName" type:"string"` // The IP address of the network interface within the subnet. - PrivateIPAddress *string `locationName:"privateIpAddress" type:"string"` + PrivateIpAddress *string `locationName:"privateIpAddress" type:"string"` // The private IP addresses associated with the network interface. - PrivateIPAddresses []*NetworkInterfacePrivateIPAddress `locationName:"privateIpAddressesSet" locationNameList:"item" type:"list"` + PrivateIpAddresses []*NetworkInterfacePrivateIpAddress `locationName:"privateIpAddressesSet" locationNameList:"item" type:"list"` // The ID of the entity that launched the instance on your behalf (for example, // AWS Management Console or Auto Scaling). - RequesterID *string `locationName:"requesterId" type:"string"` + RequesterId *string `locationName:"requesterId" type:"string"` // Indicates whether the network interface is being managed by AWS. RequesterManaged *bool `locationName:"requesterManaged" type:"boolean"` @@ -15923,16 +19257,16 @@ type NetworkInterface struct { SourceDestCheck *bool `locationName:"sourceDestCheck" type:"boolean"` // The status of the network interface. - Status *string `locationName:"status" type:"string"` + Status *string `locationName:"status" type:"string" enum:"NetworkInterfaceStatus"` // The ID of the subnet. - SubnetID *string `locationName:"subnetId" type:"string"` + SubnetId *string `locationName:"subnetId" type:"string"` // Any tags assigned to the network interface. TagSet []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` // The ID of the VPC. - VPCID *string `locationName:"vpcId" type:"string"` + VpcId *string `locationName:"vpcId" type:"string"` metadataNetworkInterface `json:"-" xml:"-"` } @@ -15941,22 +19275,32 @@ type metadataNetworkInterface struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s NetworkInterface) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s NetworkInterface) GoString() string { + return s.String() +} + // Describes association information for an Elastic IP address. type NetworkInterfaceAssociation struct { // The allocation ID. - AllocationID *string `locationName:"allocationId" type:"string"` + AllocationId *string `locationName:"allocationId" type:"string"` // The association ID. - AssociationID *string `locationName:"associationId" type:"string"` + AssociationId *string `locationName:"associationId" type:"string"` // The ID of the Elastic IP address owner. - IPOwnerID *string `locationName:"ipOwnerId" type:"string"` + IpOwnerId *string `locationName:"ipOwnerId" type:"string"` // The public DNS name. - PublicDNSName *string `locationName:"publicDnsName" type:"string"` + PublicDnsName *string `locationName:"publicDnsName" type:"string"` // The address of the Elastic IP address bound to the network interface. - PublicIP *string `locationName:"publicIp" type:"string"` + PublicIp *string `locationName:"publicIp" type:"string"` metadataNetworkInterfaceAssociation `json:"-" xml:"-"` } @@ -15965,13 +19309,23 @@ type metadataNetworkInterfaceAssociation struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s NetworkInterfaceAssociation) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s NetworkInterfaceAssociation) GoString() string { + return s.String() +} + // Describes a network interface attachment. type NetworkInterfaceAttachment struct { // The timestamp indicating when the attachment initiated. AttachTime *time.Time `locationName:"attachTime" type:"timestamp" timestampFormat:"iso8601"` // The ID of the network interface attachment. - AttachmentID *string `locationName:"attachmentId" type:"string"` + AttachmentId *string `locationName:"attachmentId" type:"string"` // Indicates whether the network interface is deleted when the instance is terminated. DeleteOnTermination *bool `locationName:"deleteOnTermination" type:"boolean"` @@ -15980,13 +19334,13 @@ type NetworkInterfaceAttachment struct { DeviceIndex *int64 `locationName:"deviceIndex" type:"integer"` // The ID of the instance. - InstanceID *string `locationName:"instanceId" type:"string"` + InstanceId *string `locationName:"instanceId" type:"string"` // The AWS account ID of the owner of the instance. - InstanceOwnerID *string `locationName:"instanceOwnerId" type:"string"` + InstanceOwnerId *string `locationName:"instanceOwnerId" type:"string"` // The attachment state. - Status *string `locationName:"status" type:"string"` + Status *string `locationName:"status" type:"string" enum:"AttachmentStatus"` metadataNetworkInterfaceAttachment `json:"-" xml:"-"` } @@ -15995,10 +19349,20 @@ type metadataNetworkInterfaceAttachment struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s NetworkInterfaceAttachment) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s NetworkInterfaceAttachment) GoString() string { + return s.String() +} + // Describes an attachment change. type NetworkInterfaceAttachmentChanges struct { // The ID of the network interface attachment. - AttachmentID *string `locationName:"attachmentId" type:"string"` + AttachmentId *string `locationName:"attachmentId" type:"string"` // Indicates whether the network interface is deleted when the instance is terminated. DeleteOnTermination *bool `locationName:"deleteOnTermination" type:"boolean"` @@ -16010,8 +19374,18 @@ type metadataNetworkInterfaceAttachmentChanges struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s NetworkInterfaceAttachmentChanges) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s NetworkInterfaceAttachmentChanges) GoString() string { + return s.String() +} + // Describes the private IP address of a network interface. -type NetworkInterfacePrivateIPAddress struct { +type NetworkInterfacePrivateIpAddress struct { // The association information for an Elastic IP address associated with the // network interface. Association *NetworkInterfaceAssociation `locationName:"association" type:"structure"` @@ -16021,30 +19395,50 @@ type NetworkInterfacePrivateIPAddress struct { Primary *bool `locationName:"primary" type:"boolean"` // The private DNS name. - PrivateDNSName *string `locationName:"privateDnsName" type:"string"` + PrivateDnsName *string `locationName:"privateDnsName" type:"string"` // The private IP address. - PrivateIPAddress *string `locationName:"privateIpAddress" type:"string"` + PrivateIpAddress *string `locationName:"privateIpAddress" type:"string"` - metadataNetworkInterfacePrivateIPAddress `json:"-" xml:"-"` + metadataNetworkInterfacePrivateIpAddress `json:"-" xml:"-"` } -type metadataNetworkInterfacePrivateIPAddress struct { +type metadataNetworkInterfacePrivateIpAddress struct { SDKShapeTraits bool `type:"structure"` } -type NewDHCPConfiguration struct { +// String returns the string representation +func (s NetworkInterfacePrivateIpAddress) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s NetworkInterfacePrivateIpAddress) GoString() string { + return s.String() +} + +type NewDhcpConfiguration struct { Key *string `locationName:"key" type:"string"` Values []*string `locationName:"Value" locationNameList:"item" type:"list"` - metadataNewDHCPConfiguration `json:"-" xml:"-"` + metadataNewDhcpConfiguration `json:"-" xml:"-"` } -type metadataNewDHCPConfiguration struct { +type metadataNewDhcpConfiguration struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s NewDhcpConfiguration) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s NewDhcpConfiguration) GoString() string { + return s.String() +} + // Describes the placement for the instance. type Placement struct { // The Availability Zone of the instance. @@ -16055,7 +19449,7 @@ type Placement struct { // The tenancy of the instance (if the instance is running in a VPC). An instance // with a tenancy of dedicated runs on single-tenant hardware. - Tenancy *string `locationName:"tenancy" type:"string"` + Tenancy *string `locationName:"tenancy" type:"string" enum:"Tenancy"` metadataPlacement `json:"-" xml:"-"` } @@ -16064,16 +19458,26 @@ type metadataPlacement struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s Placement) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Placement) GoString() string { + return s.String() +} + // Describes a placement group. type PlacementGroup struct { // The name of the placement group. GroupName *string `locationName:"groupName" type:"string"` // The state of the placement group. - State *string `locationName:"state" type:"string"` + State *string `locationName:"state" type:"string" enum:"PlacementGroupState"` // The placement strategy. - Strategy *string `locationName:"strategy" type:"string"` + Strategy *string `locationName:"strategy" type:"string" enum:"PlacementStrategy"` metadataPlacementGroup `json:"-" xml:"-"` } @@ -16082,6 +19486,16 @@ type metadataPlacementGroup struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s PlacementGroup) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PlacementGroup) GoString() string { + return s.String() +} + // Describes a range of ports. type PortRange struct { // The first port in the range. @@ -16097,13 +19511,23 @@ type metadataPortRange struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s PortRange) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PortRange) GoString() string { + return s.String() +} + // Describes prefixes for AWS services. type PrefixList struct { // The IP address range of the AWS service. - CIDRs []*string `locationName:"cidrSet" locationNameList:"item" type:"list"` + Cidrs []*string `locationName:"cidrSet" locationNameList:"item" type:"list"` // The ID of the prefix. - PrefixListID *string `locationName:"prefixListId" type:"string"` + PrefixListId *string `locationName:"prefixListId" type:"string"` // The name of the prefix. PrefixListName *string `locationName:"prefixListName" type:"string"` @@ -16115,18 +19539,38 @@ type metadataPrefixList struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s PrefixList) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PrefixList) GoString() string { + return s.String() +} + // The ID of the prefix. -type PrefixListID struct { +type PrefixListId struct { // The ID of the prefix. - PrefixListID *string `locationName:"prefixListId" type:"string"` + PrefixListId *string `locationName:"prefixListId" type:"string"` - metadataPrefixListID `json:"-" xml:"-"` + metadataPrefixListId `json:"-" xml:"-"` } -type metadataPrefixListID struct { +type metadataPrefixListId struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s PrefixListId) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PrefixListId) GoString() string { + return s.String() +} + // Describes the price for a Reserved Instance. type PriceSchedule struct { // The current price schedule, as determined by the term remaining for the Reserved @@ -16143,7 +19587,7 @@ type PriceSchedule struct { // The currency for transacting the Reserved Instance resale. At this time, // the only supported currency is USD. - CurrencyCode *string `locationName:"currencyCode" type:"string"` + CurrencyCode *string `locationName:"currencyCode" type:"string" enum:"CurrencyCodeValues"` // The fixed price for the term. Price *float64 `locationName:"price" type:"double"` @@ -16159,11 +19603,21 @@ type metadataPriceSchedule struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s PriceSchedule) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PriceSchedule) GoString() string { + return s.String() +} + // Describes the price for a Reserved Instance. type PriceScheduleSpecification struct { // The currency for transacting the Reserved Instance resale. At this time, // the only supported currency is USD. - CurrencyCode *string `locationName:"currencyCode" type:"string"` + CurrencyCode *string `locationName:"currencyCode" type:"string" enum:"CurrencyCodeValues"` // The fixed price for the term. Price *float64 `locationName:"price" type:"double"` @@ -16179,6 +19633,16 @@ type metadataPriceScheduleSpecification struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s PriceScheduleSpecification) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PriceScheduleSpecification) GoString() string { + return s.String() +} + // Describes a Reserved Instance offering. type PricingDetail struct { // The number of instances available for the price. @@ -16194,29 +19658,49 @@ type metadataPricingDetail struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s PricingDetail) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PricingDetail) GoString() string { + return s.String() +} + // Describes a secondary private IP address for a network interface. -type PrivateIPAddressSpecification struct { +type PrivateIpAddressSpecification struct { // Indicates whether the private IP address is the primary private IP address. // Only one IP address can be designated as primary. Primary *bool `locationName:"primary" type:"boolean"` // The private IP addresses. - PrivateIPAddress *string `locationName:"privateIpAddress" type:"string" required:"true"` + PrivateIpAddress *string `locationName:"privateIpAddress" type:"string" required:"true"` - metadataPrivateIPAddressSpecification `json:"-" xml:"-"` + metadataPrivateIpAddressSpecification `json:"-" xml:"-"` } -type metadataPrivateIPAddressSpecification struct { +type metadataPrivateIpAddressSpecification struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s PrivateIpAddressSpecification) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PrivateIpAddressSpecification) GoString() string { + return s.String() +} + // Describes a product code. type ProductCode struct { // The product code. - ProductCodeID *string `locationName:"productCode" type:"string"` + ProductCodeId *string `locationName:"productCode" type:"string"` // The type of product code. - ProductCodeType *string `locationName:"type" type:"string"` + ProductCodeType *string `locationName:"type" type:"string" enum:"ProductCodeValues"` metadataProductCode `json:"-" xml:"-"` } @@ -16225,18 +19709,38 @@ type metadataProductCode struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s ProductCode) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ProductCode) GoString() string { + return s.String() +} + // Describes a virtual private gateway propagating route. -type PropagatingVGW struct { +type PropagatingVgw struct { // The ID of the virtual private gateway (VGW). - GatewayID *string `locationName:"gatewayId" type:"string"` + GatewayId *string `locationName:"gatewayId" type:"string"` - metadataPropagatingVGW `json:"-" xml:"-"` + metadataPropagatingVgw `json:"-" xml:"-"` } -type metadataPropagatingVGW struct { +type metadataPropagatingVgw struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s PropagatingVgw) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PropagatingVgw) GoString() string { + return s.String() +} + type PurchaseReservedInstancesOfferingInput struct { // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have @@ -16253,7 +19757,7 @@ type PurchaseReservedInstancesOfferingInput struct { LimitPrice *ReservedInstanceLimitPrice `locationName:"limitPrice" type:"structure"` // The ID of the Reserved Instance offering to purchase. - ReservedInstancesOfferingID *string `locationName:"ReservedInstancesOfferingId" type:"string" required:"true"` + ReservedInstancesOfferingId *string `type:"string" required:"true"` metadataPurchaseReservedInstancesOfferingInput `json:"-" xml:"-"` } @@ -16262,9 +19766,19 @@ type metadataPurchaseReservedInstancesOfferingInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s PurchaseReservedInstancesOfferingInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PurchaseReservedInstancesOfferingInput) GoString() string { + return s.String() +} + type PurchaseReservedInstancesOfferingOutput struct { // The IDs of the purchased Reserved Instances. - ReservedInstancesID *string `locationName:"reservedInstancesId" type:"string"` + ReservedInstancesId *string `locationName:"reservedInstancesId" type:"string"` metadataPurchaseReservedInstancesOfferingOutput `json:"-" xml:"-"` } @@ -16273,6 +19787,16 @@ type metadataPurchaseReservedInstancesOfferingOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s PurchaseReservedInstancesOfferingOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PurchaseReservedInstancesOfferingOutput) GoString() string { + return s.String() +} + type RebootInstancesInput struct { // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have @@ -16281,7 +19805,7 @@ type RebootInstancesInput struct { DryRun *bool `locationName:"dryRun" type:"boolean"` // One or more instance IDs. - InstanceIDs []*string `locationName:"InstanceId" locationNameList:"InstanceId" type:"list" required:"true"` + InstanceIds []*string `locationName:"InstanceId" locationNameList:"InstanceId" type:"list" required:"true"` metadataRebootInstancesInput `json:"-" xml:"-"` } @@ -16290,6 +19814,16 @@ type metadataRebootInstancesInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s RebootInstancesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RebootInstancesInput) GoString() string { + return s.String() +} + type RebootInstancesOutput struct { metadataRebootInstancesOutput `json:"-" xml:"-"` } @@ -16298,13 +19832,23 @@ type metadataRebootInstancesOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s RebootInstancesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RebootInstancesOutput) GoString() string { + return s.String() +} + // Describes a recurring charge. type RecurringCharge struct { // The amount of the recurring charge. Amount *float64 `locationName:"amount" type:"double"` // The frequency of the recurring charge. - Frequency *string `locationName:"frequency" type:"string"` + Frequency *string `locationName:"frequency" type:"string" enum:"RecurringChargeFrequency"` metadataRecurringCharge `json:"-" xml:"-"` } @@ -16313,6 +19857,16 @@ type metadataRecurringCharge struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s RecurringCharge) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RecurringCharge) GoString() string { + return s.String() +} + // Describes a region. type Region struct { // The region service endpoint. @@ -16328,12 +19882,22 @@ type metadataRegion struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s Region) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Region) GoString() string { + return s.String() +} + type RegisterImageInput struct { // The architecture of the AMI. // // Default: For Amazon EBS-backed AMIs, i386. For instance store-backed AMIs, // the architecture specified in the manifest file. - Architecture *string `locationName:"architecture" type:"string"` + Architecture *string `locationName:"architecture" type:"string" enum:"ArchitectureValues"` // One or more block device mapping entries. BlockDeviceMappings []*BlockDeviceMapping `locationName:"BlockDeviceMapping" locationNameList:"BlockDeviceMapping" type:"list"` @@ -16351,7 +19915,7 @@ type RegisterImageInput struct { ImageLocation *string `type:"string"` // The ID of the kernel. - KernelID *string `locationName:"kernelId" type:"string"` + KernelId *string `locationName:"kernelId" type:"string"` // A name for your AMI. // @@ -16361,7 +19925,7 @@ type RegisterImageInput struct { Name *string `locationName:"name" type:"string" required:"true"` // The ID of the RAM disk. - RAMDiskID *string `locationName:"ramdiskId" type:"string"` + RamdiskId *string `locationName:"ramdiskId" type:"string"` // The name of the root device (for example, /dev/sda1, or /dev/xvda). RootDeviceName *string `locationName:"rootDeviceName" type:"string"` @@ -16373,7 +19937,7 @@ type RegisterImageInput struct { // // This option is supported only for HVM AMIs. Specifying this option with // a PV AMI can make instances launched from the AMI unreachable. - SRIOVNetSupport *string `locationName:"sriovNetSupport" type:"string"` + SriovNetSupport *string `locationName:"sriovNetSupport" type:"string"` // The type of virtualization. // @@ -16387,9 +19951,19 @@ type metadataRegisterImageInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s RegisterImageInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RegisterImageInput) GoString() string { + return s.String() +} + type RegisterImageOutput struct { // The ID of the newly registered AMI. - ImageID *string `locationName:"imageId" type:"string"` + ImageId *string `locationName:"imageId" type:"string"` metadataRegisterImageOutput `json:"-" xml:"-"` } @@ -16398,7 +19972,17 @@ type metadataRegisterImageOutput struct { SDKShapeTraits bool `type:"structure"` } -type RejectVPCPeeringConnectionInput struct { +// String returns the string representation +func (s RegisterImageOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RegisterImageOutput) GoString() string { + return s.String() +} + +type RejectVpcPeeringConnectionInput struct { // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have // the required permissions, the error response is DryRunOperation. Otherwise, @@ -16406,29 +19990,49 @@ type RejectVPCPeeringConnectionInput struct { DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the VPC peering connection. - VPCPeeringConnectionID *string `locationName:"vpcPeeringConnectionId" type:"string" required:"true"` + VpcPeeringConnectionId *string `locationName:"vpcPeeringConnectionId" type:"string" required:"true"` - metadataRejectVPCPeeringConnectionInput `json:"-" xml:"-"` + metadataRejectVpcPeeringConnectionInput `json:"-" xml:"-"` } -type metadataRejectVPCPeeringConnectionInput struct { +type metadataRejectVpcPeeringConnectionInput struct { SDKShapeTraits bool `type:"structure"` } -type RejectVPCPeeringConnectionOutput struct { +// String returns the string representation +func (s RejectVpcPeeringConnectionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RejectVpcPeeringConnectionInput) GoString() string { + return s.String() +} + +type RejectVpcPeeringConnectionOutput struct { // Returns true if the request succeeds; otherwise, it returns an error. Return *bool `locationName:"return" type:"boolean"` - metadataRejectVPCPeeringConnectionOutput `json:"-" xml:"-"` + metadataRejectVpcPeeringConnectionOutput `json:"-" xml:"-"` } -type metadataRejectVPCPeeringConnectionOutput struct { +type metadataRejectVpcPeeringConnectionOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s RejectVpcPeeringConnectionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RejectVpcPeeringConnectionOutput) GoString() string { + return s.String() +} + type ReleaseAddressInput struct { // [EC2-VPC] The allocation ID. Required for EC2-VPC. - AllocationID *string `locationName:"AllocationId" type:"string"` + AllocationId *string `type:"string"` // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have @@ -16437,7 +20041,7 @@ type ReleaseAddressInput struct { DryRun *bool `locationName:"dryRun" type:"boolean"` // [EC2-Classic] The Elastic IP address. Required for EC2-Classic. - PublicIP *string `locationName:"PublicIp" type:"string"` + PublicIp *string `type:"string"` metadataReleaseAddressInput `json:"-" xml:"-"` } @@ -16446,6 +20050,16 @@ type metadataReleaseAddressInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s ReleaseAddressInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ReleaseAddressInput) GoString() string { + return s.String() +} + type ReleaseAddressOutput struct { metadataReleaseAddressOutput `json:"-" xml:"-"` } @@ -16454,10 +20068,20 @@ type metadataReleaseAddressOutput struct { SDKShapeTraits bool `type:"structure"` } -type ReplaceNetworkACLAssociationInput struct { +// String returns the string representation +func (s ReleaseAddressOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ReleaseAddressOutput) GoString() string { + return s.String() +} + +type ReplaceNetworkAclAssociationInput struct { // The ID of the current association between the original network ACL and the // subnet. - AssociationID *string `locationName:"associationId" type:"string" required:"true"` + AssociationId *string `locationName:"associationId" type:"string" required:"true"` // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have @@ -16466,29 +20090,49 @@ type ReplaceNetworkACLAssociationInput struct { DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the new network ACL to associate with the subnet. - NetworkACLID *string `locationName:"networkAclId" type:"string" required:"true"` + NetworkAclId *string `locationName:"networkAclId" type:"string" required:"true"` - metadataReplaceNetworkACLAssociationInput `json:"-" xml:"-"` + metadataReplaceNetworkAclAssociationInput `json:"-" xml:"-"` } -type metadataReplaceNetworkACLAssociationInput struct { +type metadataReplaceNetworkAclAssociationInput struct { SDKShapeTraits bool `type:"structure"` } -type ReplaceNetworkACLAssociationOutput struct { +// String returns the string representation +func (s ReplaceNetworkAclAssociationInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ReplaceNetworkAclAssociationInput) GoString() string { + return s.String() +} + +type ReplaceNetworkAclAssociationOutput struct { // The ID of the new association. - NewAssociationID *string `locationName:"newAssociationId" type:"string"` + NewAssociationId *string `locationName:"newAssociationId" type:"string"` - metadataReplaceNetworkACLAssociationOutput `json:"-" xml:"-"` + metadataReplaceNetworkAclAssociationOutput `json:"-" xml:"-"` } -type metadataReplaceNetworkACLAssociationOutput struct { +type metadataReplaceNetworkAclAssociationOutput struct { SDKShapeTraits bool `type:"structure"` } -type ReplaceNetworkACLEntryInput struct { +// String returns the string representation +func (s ReplaceNetworkAclAssociationOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ReplaceNetworkAclAssociationOutput) GoString() string { + return s.String() +} + +type ReplaceNetworkAclEntryInput struct { // The network range to allow or deny, in CIDR notation. - CIDRBlock *string `locationName:"cidrBlock" type:"string" required:"true"` + CidrBlock *string `locationName:"cidrBlock" type:"string" required:"true"` // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have @@ -16503,10 +20147,10 @@ type ReplaceNetworkACLEntryInput struct { // ICMP protocol: The ICMP type and code. Required if specifying 1 (ICMP) for // the protocol. - ICMPTypeCode *ICMPTypeCode `locationName:"Icmp" type:"structure"` + IcmpTypeCode *IcmpTypeCode `locationName:"Icmp" type:"structure"` // The ID of the ACL. - NetworkACLID *string `locationName:"networkAclId" type:"string" required:"true"` + NetworkAclId *string `locationName:"networkAclId" type:"string" required:"true"` // TCP or UDP protocols: The range of ports the rule applies to. Required if // specifying 6 (TCP) or 17 (UDP) for the protocol. @@ -16516,30 +20160,50 @@ type ReplaceNetworkACLEntryInput struct { Protocol *string `locationName:"protocol" type:"string" required:"true"` // Indicates whether to allow or deny the traffic that matches the rule. - RuleAction *string `locationName:"ruleAction" type:"string" required:"true"` + RuleAction *string `locationName:"ruleAction" type:"string" required:"true" enum:"RuleAction"` // The rule number of the entry to replace. RuleNumber *int64 `locationName:"ruleNumber" type:"integer" required:"true"` - metadataReplaceNetworkACLEntryInput `json:"-" xml:"-"` + metadataReplaceNetworkAclEntryInput `json:"-" xml:"-"` } -type metadataReplaceNetworkACLEntryInput struct { +type metadataReplaceNetworkAclEntryInput struct { SDKShapeTraits bool `type:"structure"` } -type ReplaceNetworkACLEntryOutput struct { - metadataReplaceNetworkACLEntryOutput `json:"-" xml:"-"` +// String returns the string representation +func (s ReplaceNetworkAclEntryInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ReplaceNetworkAclEntryInput) GoString() string { + return s.String() } -type metadataReplaceNetworkACLEntryOutput struct { +type ReplaceNetworkAclEntryOutput struct { + metadataReplaceNetworkAclEntryOutput `json:"-" xml:"-"` +} + +type metadataReplaceNetworkAclEntryOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s ReplaceNetworkAclEntryOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ReplaceNetworkAclEntryOutput) GoString() string { + return s.String() +} + type ReplaceRouteInput struct { // The CIDR address block used for the destination match. The value you provide // must match the CIDR of an existing route in the table. - DestinationCIDRBlock *string `locationName:"destinationCidrBlock" type:"string" required:"true"` + DestinationCidrBlock *string `locationName:"destinationCidrBlock" type:"string" required:"true"` // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have @@ -16548,19 +20212,19 @@ type ReplaceRouteInput struct { DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of an Internet gateway or virtual private gateway. - GatewayID *string `locationName:"gatewayId" type:"string"` + GatewayId *string `locationName:"gatewayId" type:"string"` // The ID of a NAT instance in your VPC. - InstanceID *string `locationName:"instanceId" type:"string"` + InstanceId *string `locationName:"instanceId" type:"string"` // The ID of a network interface. - NetworkInterfaceID *string `locationName:"networkInterfaceId" type:"string"` + NetworkInterfaceId *string `locationName:"networkInterfaceId" type:"string"` // The ID of the route table. - RouteTableID *string `locationName:"routeTableId" type:"string" required:"true"` + RouteTableId *string `locationName:"routeTableId" type:"string" required:"true"` // The ID of a VPC peering connection. - VPCPeeringConnectionID *string `locationName:"vpcPeeringConnectionId" type:"string"` + VpcPeeringConnectionId *string `locationName:"vpcPeeringConnectionId" type:"string"` metadataReplaceRouteInput `json:"-" xml:"-"` } @@ -16569,6 +20233,16 @@ type metadataReplaceRouteInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s ReplaceRouteInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ReplaceRouteInput) GoString() string { + return s.String() +} + type ReplaceRouteOutput struct { metadataReplaceRouteOutput `json:"-" xml:"-"` } @@ -16577,9 +20251,19 @@ type metadataReplaceRouteOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s ReplaceRouteOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ReplaceRouteOutput) GoString() string { + return s.String() +} + type ReplaceRouteTableAssociationInput struct { // The association ID. - AssociationID *string `locationName:"associationId" type:"string" required:"true"` + AssociationId *string `locationName:"associationId" type:"string" required:"true"` // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have @@ -16588,7 +20272,7 @@ type ReplaceRouteTableAssociationInput struct { DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the new route table to associate with the subnet. - RouteTableID *string `locationName:"routeTableId" type:"string" required:"true"` + RouteTableId *string `locationName:"routeTableId" type:"string" required:"true"` metadataReplaceRouteTableAssociationInput `json:"-" xml:"-"` } @@ -16597,9 +20281,19 @@ type metadataReplaceRouteTableAssociationInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s ReplaceRouteTableAssociationInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ReplaceRouteTableAssociationInput) GoString() string { + return s.String() +} + type ReplaceRouteTableAssociationOutput struct { // The ID of the new association. - NewAssociationID *string `locationName:"newAssociationId" type:"string"` + NewAssociationId *string `locationName:"newAssociationId" type:"string"` metadataReplaceRouteTableAssociationOutput `json:"-" xml:"-"` } @@ -16608,6 +20302,16 @@ type metadataReplaceRouteTableAssociationOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s ReplaceRouteTableAssociationOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ReplaceRouteTableAssociationOutput) GoString() string { + return s.String() +} + type ReportInstanceStatusInput struct { // Descriptive text about the health state of your instance. Description *string `locationName:"description" type:"string"` @@ -16652,7 +20356,7 @@ type ReportInstanceStatusInput struct { StartTime *time.Time `locationName:"startTime" type:"timestamp" timestampFormat:"iso8601"` // The status of all instances listed. - Status *string `locationName:"status" type:"string" required:"true"` + Status *string `locationName:"status" type:"string" required:"true" enum:"ReportStatusType"` metadataReportInstanceStatusInput `json:"-" xml:"-"` } @@ -16661,6 +20365,16 @@ type metadataReportInstanceStatusInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s ReportInstanceStatusInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ReportInstanceStatusInput) GoString() string { + return s.String() +} + type ReportInstanceStatusOutput struct { metadataReportInstanceStatusOutput `json:"-" xml:"-"` } @@ -16669,6 +20383,16 @@ type metadataReportInstanceStatusOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s ReportInstanceStatusOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ReportInstanceStatusOutput) GoString() string { + return s.String() +} + // Contains the parameters for RequestSpotFleet. type RequestSpotFleetInput struct { // Checks whether you have the required permissions for the action, without @@ -16687,10 +20411,20 @@ type metadataRequestSpotFleetInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s RequestSpotFleetInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RequestSpotFleetInput) GoString() string { + return s.String() +} + // Contains the output of RequestSpotFleet. type RequestSpotFleetOutput struct { // The ID of the Spot fleet request. - SpotFleetRequestID *string `locationName:"spotFleetRequestId" type:"string" required:"true"` + SpotFleetRequestId *string `locationName:"spotFleetRequestId" type:"string" required:"true"` metadataRequestSpotFleetOutput `json:"-" xml:"-"` } @@ -16699,23 +20433,33 @@ type metadataRequestSpotFleetOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s RequestSpotFleetOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RequestSpotFleetOutput) GoString() string { + return s.String() +} + // Contains the parameters for RequestSpotInstances. type RequestSpotInstancesInput struct { // The user-specified name for a logical grouping of bids. // // When you specify an Availability Zone group in a Spot Instance request, - // all Spot Instances in the request are launched in the same Availability Zone. + // all Spot instances in the request are launched in the same Availability Zone. // Instance proximity is maintained with this parameter, but the choice of Availability // Zone is not. The group applies only to bids for Spot Instances of the same - // instance type. Any additional Spot Instance requests that are specified with + // instance type. Any additional Spot instance requests that are specified with // the same Availability Zone group name are launched in that same Availability // Zone, as long as at least one instance from the group is still active. // // If there is no active instance running in the Availability Zone group that - // you specify for a new Spot Instance request (all instances are terminated, + // you specify for a new Spot instance request (all instances are terminated, // the bid is expired, or the bid falls below current market), then Amazon EC2 // launches the instance in any Availability Zone where the constraint can be - // met. Consequently, the subsequent set of Spot Instances could be placed in + // met. Consequently, the subsequent set of Spot instances could be placed in // a different zone from the original request, even if you specified the same // Availability Zone group. // @@ -16733,12 +20477,12 @@ type RequestSpotInstancesInput struct { // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` - // The maximum number of Spot Instances to launch. + // The maximum number of Spot instances to launch. // // Default: 1 InstanceCount *int64 `locationName:"instanceCount" type:"integer"` - // The instance launch group. Launch groups are Spot Instances that launch together + // The instance launch group. Launch groups are Spot instances that launch together // and terminate together. // // Default: Instances are launched and terminated individually @@ -16747,14 +20491,14 @@ type RequestSpotInstancesInput struct { // Describes the launch specification for an instance. LaunchSpecification *RequestSpotLaunchSpecification `type:"structure"` - // The maximum hourly price (bid) for any Spot Instance launched to fulfill + // The maximum hourly price (bid) for any Spot instance launched to fulfill // the request. SpotPrice *string `locationName:"spotPrice" type:"string" required:"true"` - // The Spot Instance request type. + // The Spot instance request type. // // Default: one-time - Type *string `locationName:"type" type:"string"` + Type *string `locationName:"type" type:"string" enum:"SpotInstanceType"` // The start date of the request. If this is a one-time request, the request // becomes active at this date and time and remains active until all instances @@ -16780,9 +20524,19 @@ type metadataRequestSpotInstancesInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s RequestSpotInstancesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RequestSpotInstancesInput) GoString() string { + return s.String() +} + // Contains the output of RequestSpotInstances. type RequestSpotInstancesOutput struct { - // One or more Spot Instance requests. + // One or more Spot instance requests. SpotInstanceRequests []*SpotInstanceRequest `locationName:"spotInstanceRequestSet" locationNameList:"item" type:"list"` metadataRequestSpotInstancesOutput `json:"-" xml:"-"` @@ -16792,6 +20546,16 @@ type metadataRequestSpotInstancesOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s RequestSpotInstancesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RequestSpotInstancesOutput) GoString() string { + return s.String() +} + // Describes the launch specification for an instance. type RequestSpotLaunchSpecification struct { // Deprecated. @@ -16807,19 +20571,19 @@ type RequestSpotLaunchSpecification struct { // Optimized instance. // // Default: false - EBSOptimized *bool `locationName:"ebsOptimized" type:"boolean"` + EbsOptimized *bool `locationName:"ebsOptimized" type:"boolean"` // The IAM instance profile. - IAMInstanceProfile *IAMInstanceProfileSpecification `locationName:"iamInstanceProfile" type:"structure"` + IamInstanceProfile *IamInstanceProfileSpecification `locationName:"iamInstanceProfile" type:"structure"` // The ID of the AMI. - ImageID *string `locationName:"imageId" type:"string"` + ImageId *string `locationName:"imageId" type:"string"` // The instance type. - InstanceType *string `locationName:"instanceType" type:"string"` + InstanceType *string `locationName:"instanceType" type:"string" enum:"InstanceType"` // The ID of the kernel. - KernelID *string `locationName:"kernelId" type:"string"` + KernelId *string `locationName:"kernelId" type:"string"` // The name of the key pair. KeyName *string `locationName:"keyName" type:"string"` @@ -16834,14 +20598,14 @@ type RequestSpotLaunchSpecification struct { Placement *SpotPlacement `locationName:"placement" type:"structure"` // The ID of the RAM disk. - RAMDiskID *string `locationName:"ramdiskId" type:"string"` + RamdiskId *string `locationName:"ramdiskId" type:"string"` - SecurityGroupIDs []*string `locationName:"SecurityGroupId" locationNameList:"item" type:"list"` + SecurityGroupIds []*string `locationName:"SecurityGroupId" locationNameList:"item" type:"list"` SecurityGroups []*string `locationName:"SecurityGroup" locationNameList:"item" type:"list"` // The ID of the subnet in which to launch the instance. - SubnetID *string `locationName:"subnetId" type:"string"` + SubnetId *string `locationName:"subnetId" type:"string"` // The Base64-encoded MIME user data to make available to the instances. UserData *string `locationName:"userData" type:"string"` @@ -16853,6 +20617,16 @@ type metadataRequestSpotLaunchSpecification struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s RequestSpotLaunchSpecification) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RequestSpotLaunchSpecification) GoString() string { + return s.String() +} + // Describes a reservation. type Reservation struct { // One or more security groups. @@ -16862,14 +20636,14 @@ type Reservation struct { Instances []*Instance `locationName:"instancesSet" locationNameList:"item" type:"list"` // The ID of the AWS account that owns the reservation. - OwnerID *string `locationName:"ownerId" type:"string"` + OwnerId *string `locationName:"ownerId" type:"string"` // The ID of the requester that launched the instances on your behalf (for example, // AWS Management Console or Auto Scaling). - RequesterID *string `locationName:"requesterId" type:"string"` + RequesterId *string `locationName:"requesterId" type:"string"` // The ID of the reservation. - ReservationID *string `locationName:"reservationId" type:"string"` + ReservationId *string `locationName:"reservationId" type:"string"` metadataReservation `json:"-" xml:"-"` } @@ -16878,15 +20652,25 @@ type metadataReservation struct { SDKShapeTraits bool `type:"structure"` } -// Describes the limit price of a Reserved Instance offering. -type ReservedInstanceLimitPrice struct { - // Used for Reserved Instance Marketplace offerings. Specifies the limit price +// String returns the string representation +func (s Reservation) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Reservation) GoString() string { + return s.String() +} + +// Describes the limit price of a Reserved Instance offering. +type ReservedInstanceLimitPrice struct { + // Used for Reserved Instance Marketplace offerings. Specifies the limit price // on the total order (instanceCount * price). Amount *float64 `locationName:"amount" type:"double"` // The currency in which the limitPrice amount is specified. At this time, the // only supported currency is USD. - CurrencyCode *string `locationName:"currencyCode" type:"string"` + CurrencyCode *string `locationName:"currencyCode" type:"string" enum:"CurrencyCodeValues"` metadataReservedInstanceLimitPrice `json:"-" xml:"-"` } @@ -16895,6 +20679,16 @@ type metadataReservedInstanceLimitPrice struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s ReservedInstanceLimitPrice) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ReservedInstanceLimitPrice) GoString() string { + return s.String() +} + // Describes a Reserved Instance. type ReservedInstances struct { // The Availability Zone in which the Reserved Instance can be used. @@ -16902,7 +20696,7 @@ type ReservedInstances struct { // The currency of the Reserved Instance. It's specified using ISO 4217 standard // currency codes. At this time, the only supported currency is USD. - CurrencyCode *string `locationName:"currencyCode" type:"string"` + CurrencyCode *string `locationName:"currencyCode" type:"string" enum:"CurrencyCodeValues"` // The duration of the Reserved Instance, in seconds. Duration *int64 `locationName:"duration" type:"long"` @@ -16917,28 +20711,28 @@ type ReservedInstances struct { InstanceCount *int64 `locationName:"instanceCount" type:"integer"` // The tenancy of the reserved instance. - InstanceTenancy *string `locationName:"instanceTenancy" type:"string"` + InstanceTenancy *string `locationName:"instanceTenancy" type:"string" enum:"Tenancy"` // The instance type on which the Reserved Instance can be used. - InstanceType *string `locationName:"instanceType" type:"string"` + InstanceType *string `locationName:"instanceType" type:"string" enum:"InstanceType"` // The Reserved Instance offering type. - OfferingType *string `locationName:"offeringType" type:"string"` + OfferingType *string `locationName:"offeringType" type:"string" enum:"OfferingTypeValues"` - // The Reserved Instance description. - ProductDescription *string `locationName:"productDescription" type:"string"` + // The Reserved Instance product platform description. + ProductDescription *string `locationName:"productDescription" type:"string" enum:"RIProductDescription"` // The recurring charge tag assigned to the resource. RecurringCharges []*RecurringCharge `locationName:"recurringCharges" locationNameList:"item" type:"list"` // The ID of the Reserved Instance. - ReservedInstancesID *string `locationName:"reservedInstancesId" type:"string"` + ReservedInstancesId *string `locationName:"reservedInstancesId" type:"string"` // The date and time the Reserved Instance started. Start *time.Time `locationName:"start" type:"timestamp" timestampFormat:"iso8601"` // The state of the Reserved Instance purchase. - State *string `locationName:"state" type:"string"` + State *string `locationName:"state" type:"string" enum:"ReservedInstanceState"` // Any tags assigned to the resource. Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` @@ -16953,6 +20747,16 @@ type metadataReservedInstances struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s ReservedInstances) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ReservedInstances) GoString() string { + return s.String() +} + // Describes the configuration settings for the modified Reserved Instances. type ReservedInstancesConfiguration struct { // The Availability Zone for the modified Reserved Instances. @@ -16962,7 +20766,7 @@ type ReservedInstancesConfiguration struct { InstanceCount *int64 `locationName:"instanceCount" type:"integer"` // The instance type for the modified Reserved Instances. - InstanceType *string `locationName:"instanceType" type:"string"` + InstanceType *string `locationName:"instanceType" type:"string" enum:"InstanceType"` // The network platform of the modified Reserved Instances, which is either // EC2-Classic or EC2-VPC. @@ -16975,18 +20779,38 @@ type metadataReservedInstancesConfiguration struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s ReservedInstancesConfiguration) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ReservedInstancesConfiguration) GoString() string { + return s.String() +} + // Describes the ID of a Reserved Instance. -type ReservedInstancesID struct { +type ReservedInstancesId struct { // The ID of the Reserved Instance. - ReservedInstancesID *string `locationName:"reservedInstancesId" type:"string"` + ReservedInstancesId *string `locationName:"reservedInstancesId" type:"string"` - metadataReservedInstancesID `json:"-" xml:"-"` + metadataReservedInstancesId `json:"-" xml:"-"` } -type metadataReservedInstancesID struct { +type metadataReservedInstancesId struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s ReservedInstancesId) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ReservedInstancesId) GoString() string { + return s.String() +} + // Describes a Reserved Instance listing. type ReservedInstancesListing struct { // A unique, case-sensitive key supplied by the client to ensure that the request @@ -17003,13 +20827,13 @@ type ReservedInstancesListing struct { PriceSchedules []*PriceSchedule `locationName:"priceSchedules" locationNameList:"item" type:"list"` // The ID of the Reserved Instance. - ReservedInstancesID *string `locationName:"reservedInstancesId" type:"string"` + ReservedInstancesId *string `locationName:"reservedInstancesId" type:"string"` // The ID of the Reserved Instance listing. - ReservedInstancesListingID *string `locationName:"reservedInstancesListingId" type:"string"` + ReservedInstancesListingId *string `locationName:"reservedInstancesListingId" type:"string"` // The status of the Reserved Instance listing. - Status *string `locationName:"status" type:"string"` + Status *string `locationName:"status" type:"string" enum:"ListingStatus"` // The reason for the current status of the Reserved Instance listing. The response // can be blank. @@ -17028,6 +20852,16 @@ type metadataReservedInstancesListing struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s ReservedInstancesListing) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ReservedInstancesListing) GoString() string { + return s.String() +} + // Describes a Reserved Instance modification. type ReservedInstancesModification struct { // A unique, case-sensitive key supplied by the client to ensure that the request @@ -17045,10 +20879,10 @@ type ReservedInstancesModification struct { ModificationResults []*ReservedInstancesModificationResult `locationName:"modificationResultSet" locationNameList:"item" type:"list"` // The IDs of one or more Reserved Instances. - ReservedInstancesIDs []*ReservedInstancesID `locationName:"reservedInstancesSet" locationNameList:"item" type:"list"` + ReservedInstancesIds []*ReservedInstancesId `locationName:"reservedInstancesSet" locationNameList:"item" type:"list"` // A unique ID for the Reserved Instance modification. - ReservedInstancesModificationID *string `locationName:"reservedInstancesModificationId" type:"string"` + ReservedInstancesModificationId *string `locationName:"reservedInstancesModificationId" type:"string"` // The status of the Reserved Instances modification request. Status *string `locationName:"status" type:"string"` @@ -17066,10 +20900,20 @@ type metadataReservedInstancesModification struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s ReservedInstancesModification) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ReservedInstancesModification) GoString() string { + return s.String() +} + type ReservedInstancesModificationResult struct { // The ID for the Reserved Instances that were created as part of the modification // request. This field is only available when the modification is fulfilled. - ReservedInstancesID *string `locationName:"reservedInstancesId" type:"string"` + ReservedInstancesId *string `locationName:"reservedInstancesId" type:"string"` // The target Reserved Instances configurations supplied as part of the modification // request. @@ -17082,6 +20926,16 @@ type metadataReservedInstancesModificationResult struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s ReservedInstancesModificationResult) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ReservedInstancesModificationResult) GoString() string { + return s.String() +} + // Describes a Reserved Instance offering. type ReservedInstancesOffering struct { // The Availability Zone in which the Reserved Instance can be used. @@ -17090,7 +20944,7 @@ type ReservedInstancesOffering struct { // The currency of the Reserved Instance offering you are purchasing. It's specified // using ISO 4217 standard currency codes. At this time, the only supported // currency is USD. - CurrencyCode *string `locationName:"currencyCode" type:"string"` + CurrencyCode *string `locationName:"currencyCode" type:"string" enum:"CurrencyCodeValues"` // The duration of the Reserved Instance, in seconds. Duration *int64 `locationName:"duration" type:"long"` @@ -17099,10 +20953,10 @@ type ReservedInstancesOffering struct { FixedPrice *float64 `locationName:"fixedPrice" type:"float"` // The tenancy of the reserved instance. - InstanceTenancy *string `locationName:"instanceTenancy" type:"string"` + InstanceTenancy *string `locationName:"instanceTenancy" type:"string" enum:"Tenancy"` // The instance type on which the Reserved Instance can be used. - InstanceType *string `locationName:"instanceType" type:"string"` + InstanceType *string `locationName:"instanceType" type:"string" enum:"InstanceType"` // Indicates whether the offering is available through the Reserved Instance // Marketplace (resale) or AWS. If it's a Reserved Instance Marketplace offering, @@ -17110,19 +20964,19 @@ type ReservedInstancesOffering struct { Marketplace *bool `locationName:"marketplace" type:"boolean"` // The Reserved Instance offering type. - OfferingType *string `locationName:"offeringType" type:"string"` + OfferingType *string `locationName:"offeringType" type:"string" enum:"OfferingTypeValues"` // The pricing details of the Reserved Instance offering. PricingDetails []*PricingDetail `locationName:"pricingDetailsSet" locationNameList:"item" type:"list"` - // The Reserved Instance description. - ProductDescription *string `locationName:"productDescription" type:"string"` + // The Reserved Instance product platform description. + ProductDescription *string `locationName:"productDescription" type:"string" enum:"RIProductDescription"` // The recurring charge tag assigned to the resource. RecurringCharges []*RecurringCharge `locationName:"recurringCharges" locationNameList:"item" type:"list"` // The ID of the Reserved Instance offering. - ReservedInstancesOfferingID *string `locationName:"reservedInstancesOfferingId" type:"string"` + ReservedInstancesOfferingId *string `locationName:"reservedInstancesOfferingId" type:"string"` // The usage price of the Reserved Instance, per hour. UsagePrice *float64 `locationName:"usagePrice" type:"float"` @@ -17134,10 +20988,20 @@ type metadataReservedInstancesOffering struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s ReservedInstancesOffering) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ReservedInstancesOffering) GoString() string { + return s.String() +} + type ResetImageAttributeInput struct { // The attribute to reset (currently you can only reset the launch permission // attribute). - Attribute *string `type:"string" required:"true"` + Attribute *string `type:"string" required:"true" enum:"ResetImageAttributeName"` // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have @@ -17146,7 +21010,7 @@ type ResetImageAttributeInput struct { DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the AMI. - ImageID *string `locationName:"ImageId" type:"string" required:"true"` + ImageId *string `type:"string" required:"true"` metadataResetImageAttributeInput `json:"-" xml:"-"` } @@ -17155,6 +21019,16 @@ type metadataResetImageAttributeInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s ResetImageAttributeInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResetImageAttributeInput) GoString() string { + return s.String() +} + type ResetImageAttributeOutput struct { metadataResetImageAttributeOutput `json:"-" xml:"-"` } @@ -17163,9 +21037,19 @@ type metadataResetImageAttributeOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s ResetImageAttributeOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResetImageAttributeOutput) GoString() string { + return s.String() +} + type ResetInstanceAttributeInput struct { // The attribute to reset. - Attribute *string `locationName:"attribute" type:"string" required:"true"` + Attribute *string `locationName:"attribute" type:"string" required:"true" enum:"InstanceAttributeName"` // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have @@ -17174,7 +21058,7 @@ type ResetInstanceAttributeInput struct { DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the instance. - InstanceID *string `locationName:"instanceId" type:"string" required:"true"` + InstanceId *string `locationName:"instanceId" type:"string" required:"true"` metadataResetInstanceAttributeInput `json:"-" xml:"-"` } @@ -17183,6 +21067,16 @@ type metadataResetInstanceAttributeInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s ResetInstanceAttributeInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResetInstanceAttributeInput) GoString() string { + return s.String() +} + type ResetInstanceAttributeOutput struct { metadataResetInstanceAttributeOutput `json:"-" xml:"-"` } @@ -17191,6 +21085,16 @@ type metadataResetInstanceAttributeOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s ResetInstanceAttributeOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResetInstanceAttributeOutput) GoString() string { + return s.String() +} + type ResetNetworkInterfaceAttributeInput struct { // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have @@ -17199,7 +21103,7 @@ type ResetNetworkInterfaceAttributeInput struct { DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the network interface. - NetworkInterfaceID *string `locationName:"networkInterfaceId" type:"string" required:"true"` + NetworkInterfaceId *string `locationName:"networkInterfaceId" type:"string" required:"true"` // The source/destination checking attribute. Resets the value to true. SourceDestCheck *string `locationName:"sourceDestCheck" type:"string"` @@ -17211,6 +21115,16 @@ type metadataResetNetworkInterfaceAttributeInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s ResetNetworkInterfaceAttributeInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResetNetworkInterfaceAttributeInput) GoString() string { + return s.String() +} + type ResetNetworkInterfaceAttributeOutput struct { metadataResetNetworkInterfaceAttributeOutput `json:"-" xml:"-"` } @@ -17219,10 +21133,20 @@ type metadataResetNetworkInterfaceAttributeOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s ResetNetworkInterfaceAttributeOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResetNetworkInterfaceAttributeOutput) GoString() string { + return s.String() +} + type ResetSnapshotAttributeInput struct { - // The attribute to reset (currently only the attribute for permission to create - // volumes can be reset). - Attribute *string `type:"string" required:"true"` + // The attribute to reset. Currently, only the attribute for permission to create + // volumes can be reset. + Attribute *string `type:"string" required:"true" enum:"SnapshotAttributeName"` // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have @@ -17231,7 +21155,7 @@ type ResetSnapshotAttributeInput struct { DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the snapshot. - SnapshotID *string `locationName:"SnapshotId" type:"string" required:"true"` + SnapshotId *string `type:"string" required:"true"` metadataResetSnapshotAttributeInput `json:"-" xml:"-"` } @@ -17240,6 +21164,16 @@ type metadataResetSnapshotAttributeInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s ResetSnapshotAttributeInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResetSnapshotAttributeInput) GoString() string { + return s.String() +} + type ResetSnapshotAttributeOutput struct { metadataResetSnapshotAttributeOutput `json:"-" xml:"-"` } @@ -17248,6 +21182,16 @@ type metadataResetSnapshotAttributeOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s ResetSnapshotAttributeOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResetSnapshotAttributeOutput) GoString() string { + return s.String() +} + type RestoreAddressToClassicInput struct { // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have @@ -17256,7 +21200,7 @@ type RestoreAddressToClassicInput struct { DryRun *bool `locationName:"dryRun" type:"boolean"` // The Elastic IP address. - PublicIP *string `locationName:"publicIp" type:"string" required:"true"` + PublicIp *string `locationName:"publicIp" type:"string" required:"true"` metadataRestoreAddressToClassicInput `json:"-" xml:"-"` } @@ -17265,12 +21209,22 @@ type metadataRestoreAddressToClassicInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s RestoreAddressToClassicInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RestoreAddressToClassicInput) GoString() string { + return s.String() +} + type RestoreAddressToClassicOutput struct { // The Elastic IP address. - PublicIP *string `locationName:"publicIp" type:"string"` + PublicIp *string `locationName:"publicIp" type:"string"` // The move status for the IP address. - Status *string `locationName:"status" type:"string"` + Status *string `locationName:"status" type:"string" enum:"Status"` metadataRestoreAddressToClassicOutput `json:"-" xml:"-"` } @@ -17279,10 +21233,20 @@ type metadataRestoreAddressToClassicOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s RestoreAddressToClassicOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RestoreAddressToClassicOutput) GoString() string { + return s.String() +} + type RevokeSecurityGroupEgressInput struct { // The CIDR IP address range. You can't specify this parameter when specifying // a source security group. - CIDRIP *string `locationName:"cidrIp" type:"string"` + CidrIp *string `locationName:"cidrIp" type:"string"` // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have @@ -17295,23 +21259,25 @@ type RevokeSecurityGroupEgressInput struct { FromPort *int64 `locationName:"fromPort" type:"integer"` // The ID of the security group. - GroupID *string `locationName:"groupId" type:"string" required:"true"` + GroupId *string `locationName:"groupId" type:"string" required:"true"` // A set of IP permissions. You can't specify a destination security group and // a CIDR IP address range. - IPPermissions []*IPPermission `locationName:"ipPermissions" locationNameList:"item" type:"list"` + IpPermissions []*IpPermission `locationName:"ipPermissions" locationNameList:"item" type:"list"` // The IP protocol name (tcp, udp, icmp) or number (see Protocol Numbers (http://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml)). // Use -1 to specify all. - IPProtocol *string `locationName:"ipProtocol" type:"string"` + IpProtocol *string `locationName:"ipProtocol" type:"string"` - // [EC2-Classic, default VPC] The name of the destination security group. You - // can't specify a destination security group and a CIDR IP address range. + // The name of a destination security group. To revoke outbound access to a + // destination security group, we recommend that you use a set of IP permissions + // instead. SourceSecurityGroupName *string `locationName:"sourceSecurityGroupName" type:"string"` - // The ID of the destination security group. You can't specify a destination - // security group and a CIDR IP address range. - SourceSecurityGroupOwnerID *string `locationName:"sourceSecurityGroupOwnerId" type:"string"` + // The AWS account number for a destination security group. To revoke outbound + // access to a destination security group, we recommend that you use a set of + // IP permissions instead. + SourceSecurityGroupOwnerId *string `locationName:"sourceSecurityGroupOwnerId" type:"string"` // The end of port range for the TCP and UDP protocols, or an ICMP code number. // For the ICMP code number, use -1 to specify all ICMP codes for the ICMP type. @@ -17324,6 +21290,16 @@ type metadataRevokeSecurityGroupEgressInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s RevokeSecurityGroupEgressInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RevokeSecurityGroupEgressInput) GoString() string { + return s.String() +} + type RevokeSecurityGroupEgressOutput struct { metadataRevokeSecurityGroupEgressOutput `json:"-" xml:"-"` } @@ -17332,10 +21308,20 @@ type metadataRevokeSecurityGroupEgressOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s RevokeSecurityGroupEgressOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RevokeSecurityGroupEgressOutput) GoString() string { + return s.String() +} + type RevokeSecurityGroupIngressInput struct { // The CIDR IP address range. You can't specify this parameter when specifying // a source security group. - CIDRIP *string `locationName:"CidrIp" type:"string"` + CidrIp *string `type:"string"` // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have @@ -17347,27 +21333,35 @@ type RevokeSecurityGroupIngressInput struct { // For the ICMP type number, use -1 to specify all ICMP types. FromPort *int64 `type:"integer"` - // The ID of the security group. - GroupID *string `locationName:"GroupId" type:"string"` + // The ID of the security group. Required for a security group in a nondefault + // VPC. + GroupId *string `type:"string"` // [EC2-Classic, default VPC] The name of the security group. GroupName *string `type:"string"` // A set of IP permissions. You can't specify a source security group and a // CIDR IP address range. - IPPermissions []*IPPermission `locationName:"IpPermissions" locationNameList:"item" type:"list"` + IpPermissions []*IpPermission `locationNameList:"item" type:"list"` // The IP protocol name (tcp, udp, icmp) or number (see Protocol Numbers (http://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml)). // Use -1 to specify all. - IPProtocol *string `locationName:"IpProtocol" type:"string"` + IpProtocol *string `type:"string"` // [EC2-Classic, default VPC] The name of the source security group. You can't - // specify a source security group and a CIDR IP address range. + // specify this parameter in combination with the following parameters: the + // CIDR IP address range, the start of the port range, the IP protocol, and + // the end of the port range. For EC2-VPC, the source security group must be + // in the same VPC. SourceSecurityGroupName *string `type:"string"` - // The ID of the source security group. You can't specify a source security - // group and a CIDR IP address range. - SourceSecurityGroupOwnerID *string `locationName:"SourceSecurityGroupOwnerId" type:"string"` + // [EC2-Classic, default VPC] The AWS account ID of the source security group. + // For EC2-VPC, the source security group must be in the same VPC. You can't + // specify this parameter in combination with the following parameters: the + // CIDR IP address range, the IP protocol, the start of the port range, and + // the end of the port range. To revoke a specific rule for an IP protocol and + // port range, use a set of IP permissions instead. + SourceSecurityGroupOwnerId *string `type:"string"` // The end of port range for the TCP and UDP protocols, or an ICMP code number. // For the ICMP code number, use -1 to specify all ICMP codes for the ICMP type. @@ -17380,6 +21374,16 @@ type metadataRevokeSecurityGroupIngressInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s RevokeSecurityGroupIngressInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RevokeSecurityGroupIngressInput) GoString() string { + return s.String() +} + type RevokeSecurityGroupIngressOutput struct { metadataRevokeSecurityGroupIngressOutput `json:"-" xml:"-"` } @@ -17388,25 +21392,35 @@ type metadataRevokeSecurityGroupIngressOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s RevokeSecurityGroupIngressOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RevokeSecurityGroupIngressOutput) GoString() string { + return s.String() +} + // Describes a route in a route table. type Route struct { // The CIDR block used for the destination match. - DestinationCIDRBlock *string `locationName:"destinationCidrBlock" type:"string"` + DestinationCidrBlock *string `locationName:"destinationCidrBlock" type:"string"` // The prefix of the AWS service. - DestinationPrefixListID *string `locationName:"destinationPrefixListId" type:"string"` + DestinationPrefixListId *string `locationName:"destinationPrefixListId" type:"string"` // The ID of a gateway attached to your VPC. - GatewayID *string `locationName:"gatewayId" type:"string"` + GatewayId *string `locationName:"gatewayId" type:"string"` // The ID of a NAT instance in your VPC. - InstanceID *string `locationName:"instanceId" type:"string"` + InstanceId *string `locationName:"instanceId" type:"string"` // The AWS account ID of the owner of the instance. - InstanceOwnerID *string `locationName:"instanceOwnerId" type:"string"` + InstanceOwnerId *string `locationName:"instanceOwnerId" type:"string"` // The ID of the network interface. - NetworkInterfaceID *string `locationName:"networkInterfaceId" type:"string"` + NetworkInterfaceId *string `locationName:"networkInterfaceId" type:"string"` // Describes how the route was created. // @@ -17414,15 +21428,15 @@ type Route struct { // route table was created. CreateRoute indicates that the route was manually // added to the route table. EnableVgwRoutePropagation indicates that the route // was propagated by route propagation. - Origin *string `locationName:"origin" type:"string"` + Origin *string `locationName:"origin" type:"string" enum:"RouteOrigin"` // The state of the route. The blackhole state indicates that the route's target // isn't available (for example, the specified gateway isn't attached to the // VPC, or the specified NAT instance has been terminated). - State *string `locationName:"state" type:"string"` + State *string `locationName:"state" type:"string" enum:"RouteState"` // The ID of the VPC peering connection. - VPCPeeringConnectionID *string `locationName:"vpcPeeringConnectionId" type:"string"` + VpcPeeringConnectionId *string `locationName:"vpcPeeringConnectionId" type:"string"` metadataRoute `json:"-" xml:"-"` } @@ -17431,16 +21445,26 @@ type metadataRoute struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s Route) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Route) GoString() string { + return s.String() +} + // Describes a route table. type RouteTable struct { // The associations between the route table and one or more subnets. Associations []*RouteTableAssociation `locationName:"associationSet" locationNameList:"item" type:"list"` // Any virtual private gateway (VGW) propagating routes. - PropagatingVGWs []*PropagatingVGW `locationName:"propagatingVgwSet" locationNameList:"item" type:"list"` + PropagatingVgws []*PropagatingVgw `locationName:"propagatingVgwSet" locationNameList:"item" type:"list"` // The ID of the route table. - RouteTableID *string `locationName:"routeTableId" type:"string"` + RouteTableId *string `locationName:"routeTableId" type:"string"` // The routes in the route table. Routes []*Route `locationName:"routeSet" locationNameList:"item" type:"list"` @@ -17449,7 +21473,7 @@ type RouteTable struct { Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` // The ID of the VPC. - VPCID *string `locationName:"vpcId" type:"string"` + VpcId *string `locationName:"vpcId" type:"string"` metadataRouteTable `json:"-" xml:"-"` } @@ -17458,19 +21482,29 @@ type metadataRouteTable struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s RouteTable) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RouteTable) GoString() string { + return s.String() +} + // Describes an association between a route table and a subnet. type RouteTableAssociation struct { // Indicates whether this is the main route table. Main *bool `locationName:"main" type:"boolean"` // The ID of the association between a route table and a subnet. - RouteTableAssociationID *string `locationName:"routeTableAssociationId" type:"string"` + RouteTableAssociationId *string `locationName:"routeTableAssociationId" type:"string"` // The ID of the route table. - RouteTableID *string `locationName:"routeTableId" type:"string"` + RouteTableId *string `locationName:"routeTableId" type:"string"` - // The ID of the subnet. - SubnetID *string `locationName:"subnetId" type:"string"` + // The ID of the subnet. A subnet ID is not returned for an implicit association. + SubnetId *string `locationName:"subnetId" type:"string"` metadataRouteTableAssociation `json:"-" xml:"-"` } @@ -17479,6 +21513,16 @@ type metadataRouteTableAssociation struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s RouteTableAssociation) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RouteTableAssociation) GoString() string { + return s.String() +} + type RunInstancesInput struct { // Reserved. AdditionalInfo *string `locationName:"additionalInfo" type:"string"` @@ -17501,7 +21545,7 @@ type RunInstancesInput struct { // from the instance. // // Default: false - DisableAPITermination *bool `locationName:"disableApiTermination" type:"boolean"` + DisableApiTermination *bool `locationName:"disableApiTermination" type:"boolean"` // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have @@ -17516,32 +21560,32 @@ type RunInstancesInput struct { // instance. // // Default: false - EBSOptimized *bool `locationName:"ebsOptimized" type:"boolean"` + EbsOptimized *bool `locationName:"ebsOptimized" type:"boolean"` // The IAM instance profile. - IAMInstanceProfile *IAMInstanceProfileSpecification `locationName:"iamInstanceProfile" type:"structure"` + IamInstanceProfile *IamInstanceProfileSpecification `locationName:"iamInstanceProfile" type:"structure"` // The ID of the AMI, which you can get by calling DescribeImages. - ImageID *string `locationName:"ImageId" type:"string" required:"true"` + ImageId *string `type:"string" required:"true"` // Indicates whether an instance stops or terminates when you initiate shutdown // from the instance (using the operating system command for system shutdown). // // Default: stop - InstanceInitiatedShutdownBehavior *string `locationName:"instanceInitiatedShutdownBehavior" type:"string"` + InstanceInitiatedShutdownBehavior *string `locationName:"instanceInitiatedShutdownBehavior" type:"string" enum:"ShutdownBehavior"` // The instance type. For more information, see Instance Types (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html) // in the Amazon Elastic Compute Cloud User Guide. // // Default: m1.small - InstanceType *string `type:"string"` + InstanceType *string `type:"string" enum:"InstanceType"` // The ID of the kernel. // // We recommend that you use PV-GRUB instead of kernels and RAM disks. For // more information, see PV-GRUB (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/UserProvidedkernels.html) // in the Amazon Elastic Compute Cloud User Guide. - KernelID *string `locationName:"KernelId" type:"string"` + KernelId *string `type:"string"` // The name of the key pair. You can create a key pair using CreateKeyPair or // ImportKeyPair. @@ -17587,19 +21631,19 @@ type RunInstancesInput struct { // and PrivateIpAddresses.n.PrivateIpAddress is set to an IP address. // // Default: We select an IP address from the IP address range of the subnet. - PrivateIPAddress *string `locationName:"privateIpAddress" type:"string"` + PrivateIpAddress *string `locationName:"privateIpAddress" type:"string"` // The ID of the RAM disk. // // We recommend that you use PV-GRUB instead of kernels and RAM disks. For // more information, see PV-GRUB (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/UserProvidedkernels.html) // in the Amazon Elastic Compute Cloud User Guide. - RAMDiskID *string `locationName:"RamdiskId" type:"string"` + RamdiskId *string `type:"string"` // One or more security group IDs. You can create a security group using CreateSecurityGroup. // // Default: Amazon EC2 uses the default security group. - SecurityGroupIDs []*string `locationName:"SecurityGroupId" locationNameList:"SecurityGroupId" type:"list"` + SecurityGroupIds []*string `locationName:"SecurityGroupId" locationNameList:"SecurityGroupId" type:"list"` // [EC2-Classic, default VPC] One or more security group names. For a nondefault // VPC, you must use security group IDs instead. @@ -17608,7 +21652,7 @@ type RunInstancesInput struct { SecurityGroups []*string `locationName:"SecurityGroup" locationNameList:"SecurityGroup" type:"list"` // [EC2-VPC] The ID of the subnet to launch the instance into. - SubnetID *string `locationName:"SubnetId" type:"string"` + SubnetId *string `type:"string"` // The Base64-encoded MIME user data for the instances. UserData *string `type:"string"` @@ -17620,6 +21664,16 @@ type metadataRunInstancesInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s RunInstancesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RunInstancesInput) GoString() string { + return s.String() +} + // Describes the monitoring for the instance. type RunInstancesMonitoringEnabled struct { // Indicates whether monitoring is enabled for the instance. @@ -17632,13 +21686,23 @@ type metadataRunInstancesMonitoringEnabled struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s RunInstancesMonitoringEnabled) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RunInstancesMonitoringEnabled) GoString() string { + return s.String() +} + // Describes the storage parameters for S3 and S3 buckets for an instance store-backed // AMI. type S3Storage struct { // The access key ID of the owner of the bucket. Before you specify a value // for your access key ID, review and follow the guidance in Best Practices // for Managing AWS Access Keys (http://docs.aws.amazon.com/general/latest/gr/aws-access-keys-best-practices.html). - AWSAccessKeyID *string `locationName:"AWSAccessKeyId" type:"string"` + AWSAccessKeyId *string `type:"string"` // The bucket in which to store the AMI. You can specify a bucket that you already // own or a new bucket that Amazon EC2 creates on your behalf. If you specify @@ -17662,31 +21726,41 @@ type metadataS3Storage struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s S3Storage) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s S3Storage) GoString() string { + return s.String() +} + // Describes a security group type SecurityGroup struct { // A description of the security group. Description *string `locationName:"groupDescription" type:"string"` // The ID of the security group. - GroupID *string `locationName:"groupId" type:"string"` + GroupId *string `locationName:"groupId" type:"string"` // The name of the security group. GroupName *string `locationName:"groupName" type:"string"` // One or more inbound rules associated with the security group. - IPPermissions []*IPPermission `locationName:"ipPermissions" locationNameList:"item" type:"list"` + IpPermissions []*IpPermission `locationName:"ipPermissions" locationNameList:"item" type:"list"` // [EC2-VPC] One or more outbound rules associated with the security group. - IPPermissionsEgress []*IPPermission `locationName:"ipPermissionsEgress" locationNameList:"item" type:"list"` + IpPermissionsEgress []*IpPermission `locationName:"ipPermissionsEgress" locationNameList:"item" type:"list"` // The AWS account ID of the owner of the security group. - OwnerID *string `locationName:"ownerId" type:"string"` + OwnerId *string `locationName:"ownerId" type:"string"` // Any tags assigned to the security group. Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` // [EC2-VPC] The ID of the VPC for the security group. - VPCID *string `locationName:"vpcId" type:"string"` + VpcId *string `locationName:"vpcId" type:"string"` metadataSecurityGroup `json:"-" xml:"-"` } @@ -17695,42 +21769,69 @@ type metadataSecurityGroup struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s SecurityGroup) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SecurityGroup) GoString() string { + return s.String() +} + // Describes a snapshot. type Snapshot struct { + // The data encryption key identifier for the snapshot. This value is a unique + // identifier that corresponds to the data encryption key that was used to encrypt + // the original volume or snapshot copy. Because data encryption keys are inherited + // by volumes created from snapshots, and vice versa, if snapshots share the + // same data encryption key identifier, then they belong to the same volume/snapshot + // lineage. This parameter is only returned by the DescribeSnapshots API operation. + DataEncryptionKeyId *string `locationName:"dataEncryptionKeyId" type:"string"` + // The description for the snapshot. Description *string `locationName:"description" type:"string"` // Indicates whether the snapshot is encrypted. Encrypted *bool `locationName:"encrypted" type:"boolean"` - // The full ARN of the AWS Key Management Service (KMS) master key that was - // used to protect the volume encryption key for the parent volume. - KMSKeyID *string `locationName:"kmsKeyId" type:"string"` + // The full ARN of the AWS Key Management Service (AWS KMS) customer master + // key (CMK) that was used to protect the volume encryption key for the parent + // volume. + KmsKeyId *string `locationName:"kmsKeyId" type:"string"` // The AWS account alias (for example, amazon, self) or AWS account ID that // owns the snapshot. OwnerAlias *string `locationName:"ownerAlias" type:"string"` // The AWS account ID of the EBS snapshot owner. - OwnerID *string `locationName:"ownerId" type:"string"` + OwnerId *string `locationName:"ownerId" type:"string"` // The progress of the snapshot, as a percentage. Progress *string `locationName:"progress" type:"string"` - // The ID of the snapshot. - SnapshotID *string `locationName:"snapshotId" type:"string"` + // The ID of the snapshot. Each snapshot receives a unique identifier when it + // is created. + SnapshotId *string `locationName:"snapshotId" type:"string"` // The time stamp when the snapshot was initiated. StartTime *time.Time `locationName:"startTime" type:"timestamp" timestampFormat:"iso8601"` // The snapshot state. - State *string `locationName:"status" type:"string"` + State *string `locationName:"status" type:"string" enum:"SnapshotState"` + + // Encrypted Amazon EBS snapshots are copied asynchronously. If a snapshot copy + // operation fails (for example, if the proper AWS Key Management Service (AWS + // KMS) permissions are not obtained) this field displays error state details + // to help you diagnose why the error occurred. This parameter is only returned + // by the DescribeSnapshots API operation. + StateMessage *string `locationName:"statusMessage" type:"string"` // Any tags assigned to the snapshot. Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` - // The ID of the volume. - VolumeID *string `locationName:"volumeId" type:"string"` + // The ID of the volume that was used to create the snapshot. + VolumeId *string `locationName:"volumeId" type:"string"` // The size of the volume, in GiB. VolumeSize *int64 `locationName:"volumeSize" type:"integer"` @@ -17742,6 +21843,16 @@ type metadataSnapshot struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s Snapshot) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Snapshot) GoString() string { + return s.String() +} + // Describes the snapshot created from the imported disk. type SnapshotDetail struct { // A description for the snapshot. @@ -17760,7 +21871,7 @@ type SnapshotDetail struct { Progress *string `locationName:"progress" type:"string"` // The snapshot ID of the disk being imported. - SnapshotID *string `locationName:"snapshotId" type:"string"` + SnapshotId *string `locationName:"snapshotId" type:"string"` // A brief status of the snapshot creation. Status *string `locationName:"status" type:"string"` @@ -17769,7 +21880,7 @@ type SnapshotDetail struct { StatusMessage *string `locationName:"statusMessage" type:"string"` // The URL used to access the disk image. - URL *string `locationName:"url" type:"string"` + Url *string `locationName:"url" type:"string"` // Describes the S3 bucket for the disk image. UserBucket *UserBucketDetails `locationName:"userBucket" type:"structure"` @@ -17781,6 +21892,16 @@ type metadataSnapshotDetail struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s SnapshotDetail) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SnapshotDetail) GoString() string { + return s.String() +} + // The disk container object for the import snapshot request. type SnapshotDiskContainer struct { // The description of the disk image being imported. @@ -17793,7 +21914,7 @@ type SnapshotDiskContainer struct { // The URL to the Amazon S3-based disk image being imported. It can either be // a https URL (https://..) or an Amazon S3 URL (s3://..). - URL *string `locationName:"Url" type:"string"` + Url *string `type:"string"` // Describes the S3 bucket for the disk image. UserBucket *UserBucket `type:"structure"` @@ -17805,6 +21926,16 @@ type metadataSnapshotDiskContainer struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s SnapshotDiskContainer) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SnapshotDiskContainer) GoString() string { + return s.String() +} + // Details about the import snapshot task. type SnapshotTaskDetail struct { // The description of the snapshot. @@ -17820,7 +21951,7 @@ type SnapshotTaskDetail struct { Progress *string `locationName:"progress" type:"string"` // The snapshot ID of the disk being imported. - SnapshotID *string `locationName:"snapshotId" type:"string"` + SnapshotId *string `locationName:"snapshotId" type:"string"` // A brief status for the import snapshot task. Status *string `locationName:"status" type:"string"` @@ -17829,7 +21960,7 @@ type SnapshotTaskDetail struct { StatusMessage *string `locationName:"statusMessage" type:"string"` // The URL of the disk image from which the snapshot is created. - URL *string `locationName:"url" type:"string"` + Url *string `locationName:"url" type:"string"` // The S3 bucket for the disk image. UserBucket *UserBucketDetails `locationName:"userBucket" type:"structure"` @@ -17841,22 +21972,32 @@ type metadataSnapshotTaskDetail struct { SDKShapeTraits bool `type:"structure"` } -// Describes the data feed for a Spot Instance. +// String returns the string representation +func (s SnapshotTaskDetail) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SnapshotTaskDetail) GoString() string { + return s.String() +} + +// Describes the data feed for a Spot instance. type SpotDatafeedSubscription struct { - // The Amazon S3 bucket where the Spot Instance data feed is located. + // The Amazon S3 bucket where the Spot instance data feed is located. Bucket *string `locationName:"bucket" type:"string"` - // The fault codes for the Spot Instance request, if any. + // The fault codes for the Spot instance request, if any. Fault *SpotInstanceStateFault `locationName:"fault" type:"structure"` // The AWS account ID of the account. - OwnerID *string `locationName:"ownerId" type:"string"` + OwnerId *string `locationName:"ownerId" type:"string"` // The prefix that is prepended to data feed files. Prefix *string `locationName:"prefix" type:"string"` - // The state of the Spot Instance data feed subscription. - State *string `locationName:"state" type:"string"` + // The state of the Spot instance data feed subscription. + State *string `locationName:"state" type:"string" enum:"DatafeedSubscriptionState"` metadataSpotDatafeedSubscription `json:"-" xml:"-"` } @@ -17865,16 +22006,138 @@ type metadataSpotDatafeedSubscription struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s SpotDatafeedSubscription) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SpotDatafeedSubscription) GoString() string { + return s.String() +} + +// Describes the launch specification for one or more Spot instances. +type SpotFleetLaunchSpecification struct { + // Deprecated. + AddressingType *string `locationName:"addressingType" type:"string"` + + // One or more block device mapping entries. + BlockDeviceMappings []*BlockDeviceMapping `locationName:"blockDeviceMapping" locationNameList:"item" type:"list"` + + // Indicates whether the instances are optimized for EBS I/O. This optimization + // provides dedicated throughput to Amazon EBS and an optimized configuration + // stack to provide optimal EBS I/O performance. This optimization isn't available + // with all instance types. Additional usage charges apply when using an EBS + // Optimized instance. + // + // Default: false + EbsOptimized *bool `locationName:"ebsOptimized" type:"boolean"` + + // The IAM instance profile. + IamInstanceProfile *IamInstanceProfileSpecification `locationName:"iamInstanceProfile" type:"structure"` + + // The ID of the AMI. + ImageId *string `locationName:"imageId" type:"string"` + + // The instance type. + InstanceType *string `locationName:"instanceType" type:"string" enum:"InstanceType"` + + // The ID of the kernel. + KernelId *string `locationName:"kernelId" type:"string"` + + // The name of the key pair. + KeyName *string `locationName:"keyName" type:"string"` + + // Enable or disable monitoring for the instances. + Monitoring *SpotFleetMonitoring `locationName:"monitoring" type:"structure"` + + // One or more network interfaces. + NetworkInterfaces []*InstanceNetworkInterfaceSpecification `locationName:"networkInterfaceSet" locationNameList:"item" type:"list"` + + // The placement information. + Placement *SpotPlacement `locationName:"placement" type:"structure"` + + // The ID of the RAM disk. + RamdiskId *string `locationName:"ramdiskId" type:"string"` + + // One or more security groups. To request an instance in a nondefault VPC, + // you must specify the ID of the security group. To request an instance in + // EC2-Classic or a default VPC, you can specify the name or the ID of the security + // group. + SecurityGroups []*GroupIdentifier `locationName:"groupSet" locationNameList:"item" type:"list"` + + // The bid price per unit hour for the specified instance type. If this value + // is not specified, the default is the Spot bid price specified for the fleet. + // To determine the bid price per unit hour, divide the Spot bid price by the + // value of WeightedCapacity. + SpotPrice *string `locationName:"spotPrice" type:"string"` + + // The ID of the subnet in which to launch the instances. + SubnetId *string `locationName:"subnetId" type:"string"` + + // The Base64-encoded MIME user data to make available to the instances. + UserData *string `locationName:"userData" type:"string"` + + // The number of units provided by the specified instance type. These are the + // same units that you chose to set the target capacity in terms (instances + // or a performance characteristic such as vCPUs, memory, or I/O). + // + // If the target capacity divided by this value is not a whole number, we round + // the number of instances to the next whole number. If this value is not specified, + // the default is 1. + WeightedCapacity *float64 `locationName:"weightedCapacity" type:"double"` + + metadataSpotFleetLaunchSpecification `json:"-" xml:"-"` +} + +type metadataSpotFleetLaunchSpecification struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s SpotFleetLaunchSpecification) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SpotFleetLaunchSpecification) GoString() string { + return s.String() +} + +// Describes whether monitoring is enabled. +type SpotFleetMonitoring struct { + // Enables monitoring for the instance. + // + // Default: false + Enabled *bool `locationName:"enabled" type:"boolean"` + + metadataSpotFleetMonitoring `json:"-" xml:"-"` +} + +type metadataSpotFleetMonitoring struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s SpotFleetMonitoring) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SpotFleetMonitoring) GoString() string { + return s.String() +} + // Describes a Spot fleet request. type SpotFleetRequestConfig struct { // Information about the configuration of the Spot fleet request. SpotFleetRequestConfig *SpotFleetRequestConfigData `locationName:"spotFleetRequestConfig" type:"structure" required:"true"` // The ID of the Spot fleet request. - SpotFleetRequestID *string `locationName:"spotFleetRequestId" type:"string" required:"true"` + SpotFleetRequestId *string `locationName:"spotFleetRequestId" type:"string" required:"true"` // The state of the Spot fleet request. - SpotFleetRequestState *string `locationName:"spotFleetRequestState" type:"string" required:"true"` + SpotFleetRequestState *string `locationName:"spotFleetRequestState" type:"string" required:"true" enum:"BatchState"` metadataSpotFleetRequestConfig `json:"-" xml:"-"` } @@ -17883,30 +22146,45 @@ type metadataSpotFleetRequestConfig struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s SpotFleetRequestConfig) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SpotFleetRequestConfig) GoString() string { + return s.String() +} + // Describes the configuration of a Spot fleet request. type SpotFleetRequestConfigData struct { + // Determines how to allocate the target capacity across the Spot pools specified + // by the Spot fleet request. The default is lowestPrice. + AllocationStrategy *string `locationName:"allocationStrategy" type:"string" enum:"AllocationStrategy"` + // A unique, case-sensitive identifier you provide to ensure idempotency of // your listings. This helps avoid duplicate listings. For more information, // see Ensuring Idempotency (http://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). ClientToken *string `locationName:"clientToken" type:"string"` - // Grants the Spot fleet service permission to terminate instances on your behalf - // when you cancel a Spot fleet request using CancelSpotFleetRequests or when + // Grants the Spot fleet permission to terminate Spot instances on your behalf + // when you cancel its Spot fleet request using CancelSpotFleetRequests or when // the Spot fleet request expires, if you set terminateInstancesWithExpiration. - IAMFleetRole *string `locationName:"iamFleetRole" type:"string" required:"true"` + IamFleetRole *string `locationName:"iamFleetRole" type:"string" required:"true"` - // Information about the launch specifications for the instances. - LaunchSpecifications []*LaunchSpecification `locationName:"launchSpecifications" locationNameList:"item" type:"list" required:"true"` + // Information about the launch specifications for the Spot fleet request. + LaunchSpecifications []*SpotFleetLaunchSpecification `locationName:"launchSpecifications" locationNameList:"item" min:"1" type:"list" required:"true"` - // The maximum hourly price (bid) for any Spot Instance launched to fulfill - // the request. + // The bid price per unit hour. SpotPrice *string `locationName:"spotPrice" type:"string" required:"true"` - // The maximum number of Spot Instances to launch. + // The number of units to request. You can choose to set the target capacity + // in terms of instances or a performance characteristic that is important to + // your application workload, such as vCPUs, memory, or I/O. TargetCapacity *int64 `locationName:"targetCapacity" type:"integer" required:"true"` - // Indicates whether running instances should be terminated when the Spot fleet - // request expires. + // Indicates whether running Spot instances should be terminated when the Spot + // fleet request expires. TerminateInstancesWithExpiration *bool `locationName:"terminateInstancesWithExpiration" type:"boolean"` // The start date and time of the request, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ). @@ -17914,7 +22192,7 @@ type SpotFleetRequestConfigData struct { ValidFrom *time.Time `locationName:"validFrom" type:"timestamp" timestampFormat:"iso8601"` // The end date and time of the request, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ). - // At this point, no new Spot Instance requests are placed or enabled to fulfill + // At this point, no new Spot instance requests are placed or enabled to fulfill // the request. ValidUntil *time.Time `locationName:"validUntil" type:"timestamp" timestampFormat:"iso8601"` @@ -17925,25 +22203,35 @@ type metadataSpotFleetRequestConfigData struct { SDKShapeTraits bool `type:"structure"` } -// Describe a Spot Instance request. +// String returns the string representation +func (s SpotFleetRequestConfigData) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SpotFleetRequestConfigData) GoString() string { + return s.String() +} + +// Describe a Spot instance request. type SpotInstanceRequest struct { // The Availability Zone group. If you specify the same Availability Zone group - // for all Spot Instance requests, all Spot Instances are launched in the same + // for all Spot instance requests, all Spot instances are launched in the same // Availability Zone. AvailabilityZoneGroup *string `locationName:"availabilityZoneGroup" type:"string"` - // The date and time when the Spot Instance request was created, in UTC format + // The date and time when the Spot instance request was created, in UTC format // (for example, YYYY-MM-DDTHH:MM:SSZ). CreateTime *time.Time `locationName:"createTime" type:"timestamp" timestampFormat:"iso8601"` - // The fault codes for the Spot Instance request, if any. + // The fault codes for the Spot instance request, if any. Fault *SpotInstanceStateFault `locationName:"fault" type:"structure"` - // The instance ID, if an instance has been launched to fulfill the Spot Instance + // The instance ID, if an instance has been launched to fulfill the Spot instance // request. - InstanceID *string `locationName:"instanceId" type:"string"` + InstanceId *string `locationName:"instanceId" type:"string"` - // The instance launch group. Launch groups are Spot Instances that launch together + // The instance launch group. Launch groups are Spot instances that launch together // and terminate together. LaunchGroup *string `locationName:"launchGroup" type:"string"` @@ -17953,30 +22241,30 @@ type SpotInstanceRequest struct { // The Availability Zone in which the bid is launched. LaunchedAvailabilityZone *string `locationName:"launchedAvailabilityZone" type:"string"` - // The product description associated with the Spot Instance. - ProductDescription *string `locationName:"productDescription" type:"string"` + // The product description associated with the Spot instance. + ProductDescription *string `locationName:"productDescription" type:"string" enum:"RIProductDescription"` - // The ID of the Spot Instance request. - SpotInstanceRequestID *string `locationName:"spotInstanceRequestId" type:"string"` + // The ID of the Spot instance request. + SpotInstanceRequestId *string `locationName:"spotInstanceRequestId" type:"string"` - // The maximum hourly price (bid) for any Spot Instance launched to fulfill + // The maximum hourly price (bid) for any Spot instance launched to fulfill // the request. SpotPrice *string `locationName:"spotPrice" type:"string"` - // The state of the Spot Instance request. Spot bid status information can help - // you track your Spot Instance requests. For more information, see Spot Bid + // The state of the Spot instance request. Spot bid status information can help + // you track your Spot instance requests. For more information, see Spot Bid // Status (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-bid-status.html) // in the Amazon Elastic Compute Cloud User Guide. - State *string `locationName:"state" type:"string"` + State *string `locationName:"state" type:"string" enum:"SpotInstanceState"` - // The status code and status message describing the Spot Instance request. + // The status code and status message describing the Spot instance request. Status *SpotInstanceStatus `locationName:"status" type:"structure"` // Any tags assigned to the resource. Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` - // The Spot Instance request type. - Type *string `locationName:"type" type:"string"` + // The Spot instance request type. + Type *string `locationName:"type" type:"string" enum:"SpotInstanceType"` // The start date of the request, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ). // If this is a one-time request, the request becomes active at this date and @@ -17998,12 +22286,22 @@ type metadataSpotInstanceRequest struct { SDKShapeTraits bool `type:"structure"` } -// Describes a Spot Instance state change. +// String returns the string representation +func (s SpotInstanceRequest) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SpotInstanceRequest) GoString() string { + return s.String() +} + +// Describes a Spot instance state change. type SpotInstanceStateFault struct { - // The reason code for the Spot Instance state change. + // The reason code for the Spot instance state change. Code *string `locationName:"code" type:"string"` - // The message for the Spot Instance state change. + // The message for the Spot instance state change. Message *string `locationName:"message" type:"string"` metadataSpotInstanceStateFault `json:"-" xml:"-"` @@ -18013,7 +22311,17 @@ type metadataSpotInstanceStateFault struct { SDKShapeTraits bool `type:"structure"` } -// Describes the status of a Spot Instance request. +// String returns the string representation +func (s SpotInstanceStateFault) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SpotInstanceStateFault) GoString() string { + return s.String() +} + +// Describes the status of a Spot instance request. type SpotInstanceStatus struct { // The status code. Code *string `locationName:"code" type:"string"` @@ -18032,7 +22340,17 @@ type metadataSpotInstanceStatus struct { SDKShapeTraits bool `type:"structure"` } -// Describes Spot Instance placement. +// String returns the string representation +func (s SpotInstanceStatus) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SpotInstanceStatus) GoString() string { + return s.String() +} + +// Describes Spot instance placement. type SpotPlacement struct { // The Availability Zone. AvailabilityZone *string `locationName:"availabilityZone" type:"string"` @@ -18047,19 +22365,29 @@ type metadataSpotPlacement struct { SDKShapeTraits bool `type:"structure"` } -// Describes the maximum hourly price (bid) for any Spot Instance launched to +// String returns the string representation +func (s SpotPlacement) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SpotPlacement) GoString() string { + return s.String() +} + +// Describes the maximum hourly price (bid) for any Spot instance launched to // fulfill the request. type SpotPrice struct { // The Availability Zone. AvailabilityZone *string `locationName:"availabilityZone" type:"string"` // The instance type. - InstanceType *string `locationName:"instanceType" type:"string"` + InstanceType *string `locationName:"instanceType" type:"string" enum:"InstanceType"` // A general description of the AMI. - ProductDescription *string `locationName:"productDescription" type:"string"` + ProductDescription *string `locationName:"productDescription" type:"string" enum:"RIProductDescription"` - // The maximum price (bid) that you are willing to pay for a Spot Instance. + // The maximum price (bid) that you are willing to pay for a Spot instance. SpotPrice *string `locationName:"spotPrice" type:"string"` // The date and time the request was created, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ). @@ -18072,7 +22400,17 @@ type metadataSpotPrice struct { SDKShapeTraits bool `type:"structure"` } -type StartInstancesInput struct { +// String returns the string representation +func (s SpotPrice) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SpotPrice) GoString() string { + return s.String() +} + +type StartInstancesInput struct { // Reserved. AdditionalInfo *string `locationName:"additionalInfo" type:"string"` @@ -18083,7 +22421,7 @@ type StartInstancesInput struct { DryRun *bool `locationName:"dryRun" type:"boolean"` // One or more instance IDs. - InstanceIDs []*string `locationName:"InstanceId" locationNameList:"InstanceId" type:"list" required:"true"` + InstanceIds []*string `locationName:"InstanceId" locationNameList:"InstanceId" type:"list" required:"true"` metadataStartInstancesInput `json:"-" xml:"-"` } @@ -18092,6 +22430,16 @@ type metadataStartInstancesInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s StartInstancesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s StartInstancesInput) GoString() string { + return s.String() +} + type StartInstancesOutput struct { // Information about one or more started instances. StartingInstances []*InstanceStateChange `locationName:"instancesSet" locationNameList:"item" type:"list"` @@ -18103,6 +22451,16 @@ type metadataStartInstancesOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s StartInstancesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s StartInstancesOutput) GoString() string { + return s.String() +} + // Describes a state change. type StateReason struct { // The reason code for the state change. @@ -18140,6 +22498,16 @@ type metadataStateReason struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s StateReason) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s StateReason) GoString() string { + return s.String() +} + type StopInstancesInput struct { // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have @@ -18156,7 +22524,7 @@ type StopInstancesInput struct { Force *bool `locationName:"force" type:"boolean"` // One or more instance IDs. - InstanceIDs []*string `locationName:"InstanceId" locationNameList:"InstanceId" type:"list" required:"true"` + InstanceIds []*string `locationName:"InstanceId" locationNameList:"InstanceId" type:"list" required:"true"` metadataStopInstancesInput `json:"-" xml:"-"` } @@ -18165,6 +22533,16 @@ type metadataStopInstancesInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s StopInstancesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s StopInstancesInput) GoString() string { + return s.String() +} + type StopInstancesOutput struct { // Information about one or more stopped instances. StoppingInstances []*InstanceStateChange `locationName:"instancesSet" locationNameList:"item" type:"list"` @@ -18176,6 +22554,16 @@ type metadataStopInstancesOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s StopInstancesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s StopInstancesOutput) GoString() string { + return s.String() +} + // Describes the storage location for an instance store-backed AMI. type Storage struct { // An Amazon S3 storage location. @@ -18188,6 +22576,16 @@ type metadataStorage struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s Storage) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Storage) GoString() string { + return s.String() +} + // Describes a subnet. type Subnet struct { // The Availability Zone of the subnet. @@ -18195,28 +22593,28 @@ type Subnet struct { // The number of unused IP addresses in the subnet. Note that the IP addresses // for any stopped instances are considered unavailable. - AvailableIPAddressCount *int64 `locationName:"availableIpAddressCount" type:"integer"` + AvailableIpAddressCount *int64 `locationName:"availableIpAddressCount" type:"integer"` // The CIDR block assigned to the subnet. - CIDRBlock *string `locationName:"cidrBlock" type:"string"` + CidrBlock *string `locationName:"cidrBlock" type:"string"` // Indicates whether this is the default subnet for the Availability Zone. - DefaultForAZ *bool `locationName:"defaultForAz" type:"boolean"` + DefaultForAz *bool `locationName:"defaultForAz" type:"boolean"` // Indicates whether instances launched in this subnet receive a public IP address. - MapPublicIPOnLaunch *bool `locationName:"mapPublicIpOnLaunch" type:"boolean"` + MapPublicIpOnLaunch *bool `locationName:"mapPublicIpOnLaunch" type:"boolean"` // The current state of the subnet. - State *string `locationName:"state" type:"string"` + State *string `locationName:"state" type:"string" enum:"SubnetState"` // The ID of the subnet. - SubnetID *string `locationName:"subnetId" type:"string"` + SubnetId *string `locationName:"subnetId" type:"string"` // Any tags assigned to the subnet. Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` // The ID of the VPC the subnet is in. - VPCID *string `locationName:"vpcId" type:"string"` + VpcId *string `locationName:"vpcId" type:"string"` metadataSubnet `json:"-" xml:"-"` } @@ -18225,6 +22623,16 @@ type metadataSubnet struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s Subnet) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Subnet) GoString() string { + return s.String() +} + // Describes a tag. type Tag struct { // The key of the tag. @@ -18246,16 +22654,26 @@ type metadataTag struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s Tag) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Tag) GoString() string { + return s.String() +} + // Describes a tag. type TagDescription struct { // The tag key. Key *string `locationName:"key" type:"string"` // The ID of the resource. For example, ami-1a2b3c4d. - ResourceID *string `locationName:"resourceId" type:"string"` + ResourceId *string `locationName:"resourceId" type:"string"` // The resource type. - ResourceType *string `locationName:"resourceType" type:"string"` + ResourceType *string `locationName:"resourceType" type:"string" enum:"ResourceType"` // The tag value. Value *string `locationName:"value" type:"string"` @@ -18267,6 +22685,16 @@ type metadataTagDescription struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s TagDescription) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TagDescription) GoString() string { + return s.String() +} + type TerminateInstancesInput struct { // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have @@ -18275,7 +22703,7 @@ type TerminateInstancesInput struct { DryRun *bool `locationName:"dryRun" type:"boolean"` // One or more instance IDs. - InstanceIDs []*string `locationName:"InstanceId" locationNameList:"InstanceId" type:"list" required:"true"` + InstanceIds []*string `locationName:"InstanceId" locationNameList:"InstanceId" type:"list" required:"true"` metadataTerminateInstancesInput `json:"-" xml:"-"` } @@ -18284,6 +22712,16 @@ type metadataTerminateInstancesInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s TerminateInstancesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TerminateInstancesInput) GoString() string { + return s.String() +} + type TerminateInstancesOutput struct { // Information about one or more terminated instances. TerminatingInstances []*InstanceStateChange `locationName:"instancesSet" locationNameList:"item" type:"list"` @@ -18295,29 +22733,59 @@ type metadataTerminateInstancesOutput struct { SDKShapeTraits bool `type:"structure"` } -type UnassignPrivateIPAddressesInput struct { +// String returns the string representation +func (s TerminateInstancesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TerminateInstancesOutput) GoString() string { + return s.String() +} + +type UnassignPrivateIpAddressesInput struct { // The ID of the network interface. - NetworkInterfaceID *string `locationName:"networkInterfaceId" type:"string" required:"true"` + NetworkInterfaceId *string `locationName:"networkInterfaceId" type:"string" required:"true"` // The secondary private IP addresses to unassign from the network interface. // You can specify this option multiple times to unassign more than one IP address. - PrivateIPAddresses []*string `locationName:"privateIpAddress" locationNameList:"PrivateIpAddress" type:"list" required:"true"` + PrivateIpAddresses []*string `locationName:"privateIpAddress" locationNameList:"PrivateIpAddress" type:"list" required:"true"` - metadataUnassignPrivateIPAddressesInput `json:"-" xml:"-"` + metadataUnassignPrivateIpAddressesInput `json:"-" xml:"-"` } -type metadataUnassignPrivateIPAddressesInput struct { +type metadataUnassignPrivateIpAddressesInput struct { SDKShapeTraits bool `type:"structure"` } -type UnassignPrivateIPAddressesOutput struct { - metadataUnassignPrivateIPAddressesOutput `json:"-" xml:"-"` +// String returns the string representation +func (s UnassignPrivateIpAddressesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UnassignPrivateIpAddressesInput) GoString() string { + return s.String() } -type metadataUnassignPrivateIPAddressesOutput struct { +type UnassignPrivateIpAddressesOutput struct { + metadataUnassignPrivateIpAddressesOutput `json:"-" xml:"-"` +} + +type metadataUnassignPrivateIpAddressesOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s UnassignPrivateIpAddressesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UnassignPrivateIpAddressesOutput) GoString() string { + return s.String() +} + type UnmonitorInstancesInput struct { // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have @@ -18326,7 +22794,7 @@ type UnmonitorInstancesInput struct { DryRun *bool `locationName:"dryRun" type:"boolean"` // One or more instance IDs. - InstanceIDs []*string `locationName:"InstanceId" locationNameList:"InstanceId" type:"list" required:"true"` + InstanceIds []*string `locationName:"InstanceId" locationNameList:"InstanceId" type:"list" required:"true"` metadataUnmonitorInstancesInput `json:"-" xml:"-"` } @@ -18335,6 +22803,16 @@ type metadataUnmonitorInstancesInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s UnmonitorInstancesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UnmonitorInstancesInput) GoString() string { + return s.String() +} + type UnmonitorInstancesOutput struct { // Monitoring information for one or more instances. InstanceMonitorings []*InstanceMonitoring `locationName:"instancesSet" locationNameList:"item" type:"list"` @@ -18346,13 +22824,23 @@ type metadataUnmonitorInstancesOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s UnmonitorInstancesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UnmonitorInstancesOutput) GoString() string { + return s.String() +} + // Information about items that were not successfully processed in a batch call. type UnsuccessfulItem struct { // Information about the error. Error *UnsuccessfulItemError `locationName:"error" type:"structure" required:"true"` // The ID of the resource. - ResourceID *string `locationName:"resourceId" type:"string"` + ResourceId *string `locationName:"resourceId" type:"string"` metadataUnsuccessfulItem `json:"-" xml:"-"` } @@ -18361,7 +22849,17 @@ type metadataUnsuccessfulItem struct { SDKShapeTraits bool `type:"structure"` } -// Information about the error that occured. For more information about errors, +// String returns the string representation +func (s UnsuccessfulItem) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UnsuccessfulItem) GoString() string { + return s.String() +} + +// Information about the error that occurred. For more information about errors, // see Error Codes (http://docs.aws.amazon.com/AWSEC2/latest/APIReference/errors-overview.html). type UnsuccessfulItemError struct { // The error code. @@ -18377,6 +22875,16 @@ type metadataUnsuccessfulItemError struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s UnsuccessfulItemError) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UnsuccessfulItemError) GoString() string { + return s.String() +} + // Describes the S3 bucket for the disk image. type UserBucket struct { // The name of the S3 bucket where the disk image is located. @@ -18392,6 +22900,16 @@ type metadataUserBucket struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s UserBucket) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UserBucket) GoString() string { + return s.String() +} + // Describes the S3 bucket for the disk image. type UserBucketDetails struct { // The S3 bucket from which the disk image was created. @@ -18407,6 +22925,16 @@ type metadataUserBucketDetails struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s UserBucketDetails) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UserBucketDetails) GoString() string { + return s.String() +} + // Describes the user data to be made available to an instance. type UserData struct { // The Base64-encoded MIME user data for the instance. @@ -18419,10 +22947,20 @@ type metadataUserData struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s UserData) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UserData) GoString() string { + return s.String() +} + // Describes a security group and AWS account ID pair. -type UserIDGroupPair struct { +type UserIdGroupPair struct { // The ID of the security group. - GroupID *string `locationName:"groupId" type:"string"` + GroupId *string `locationName:"groupId" type:"string"` // The name of the security group. In a request, use this parameter for a security // group in EC2-Classic or a default VPC only. For a security group in a nondefault @@ -18430,17 +22968,27 @@ type UserIDGroupPair struct { GroupName *string `locationName:"groupName" type:"string"` // The ID of an AWS account. EC2-Classic only. - UserID *string `locationName:"userId" type:"string"` + UserId *string `locationName:"userId" type:"string"` - metadataUserIDGroupPair `json:"-" xml:"-"` + metadataUserIdGroupPair `json:"-" xml:"-"` } -type metadataUserIDGroupPair struct { +type metadataUserIdGroupPair struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s UserIdGroupPair) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UserIdGroupPair) GoString() string { + return s.String() +} + // Describes telemetry for a VPN tunnel. -type VGWTelemetry struct { +type VgwTelemetry struct { // The number of accepted routes. AcceptedRouteCount *int64 `locationName:"acceptedRouteCount" type:"integer"` @@ -18449,481 +22997,1574 @@ type VGWTelemetry struct { // The Internet-routable IP address of the virtual private gateway's outside // interface. - OutsideIPAddress *string `locationName:"outsideIpAddress" type:"string"` + OutsideIpAddress *string `locationName:"outsideIpAddress" type:"string"` // The status of the VPN tunnel. - Status *string `locationName:"status" type:"string"` + Status *string `locationName:"status" type:"string" enum:"TelemetryStatus"` // If an error occurs, a description of the error. StatusMessage *string `locationName:"statusMessage" type:"string"` - metadataVGWTelemetry `json:"-" xml:"-"` + metadataVgwTelemetry `json:"-" xml:"-"` } -type metadataVGWTelemetry struct { +type metadataVgwTelemetry struct { SDKShapeTraits bool `type:"structure"` } -// Describes a VPC. -type VPC struct { - // The CIDR block for the VPC. - CIDRBlock *string `locationName:"cidrBlock" type:"string"` - - // The ID of the set of DHCP options you've associated with the VPC (or default - // if the default options are associated with the VPC). - DHCPOptionsID *string `locationName:"dhcpOptionsId" type:"string"` - - // The allowed tenancy of instances launched into the VPC. - InstanceTenancy *string `locationName:"instanceTenancy" type:"string"` - - // Indicates whether the VPC is the default VPC. - IsDefault *bool `locationName:"isDefault" type:"boolean"` +// String returns the string representation +func (s VgwTelemetry) String() string { + return awsutil.Prettify(s) +} - // The current state of the VPC. - State *string `locationName:"state" type:"string"` +// GoString returns the string representation +func (s VgwTelemetry) GoString() string { + return s.String() +} - // Any tags assigned to the VPC. - Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` +// Describes a volume. +type Volume struct { + // Information about the volume attachments. + Attachments []*VolumeAttachment `locationName:"attachmentSet" locationNameList:"item" type:"list"` - // The ID of the VPC. - VPCID *string `locationName:"vpcId" type:"string"` + // The Availability Zone for the volume. + AvailabilityZone *string `locationName:"availabilityZone" type:"string"` - metadataVPC `json:"-" xml:"-"` -} + // The time stamp when volume creation was initiated. + CreateTime *time.Time `locationName:"createTime" type:"timestamp" timestampFormat:"iso8601"` -type metadataVPC struct { - SDKShapeTraits bool `type:"structure"` -} + // Indicates whether the volume will be encrypted. + Encrypted *bool `locationName:"encrypted" type:"boolean"` -// Describes an attachment between a virtual private gateway and a VPC. -type VPCAttachment struct { - // The current state of the attachment. - State *string `locationName:"state" type:"string"` + // The number of I/O operations per second (IOPS) that the volume supports. + // For Provisioned IOPS (SSD) volumes, this represents the number of IOPS that + // are provisioned for the volume. For General Purpose (SSD) volumes, this represents + // the baseline performance of the volume and the rate at which the volume accumulates + // I/O credits for bursting. For more information on General Purpose (SSD) baseline + // performance, I/O credits, and bursting, see Amazon EBS Volume Types (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html) + // in the Amazon Elastic Compute Cloud User Guide. + // + // Constraint: Range is 100 to 20000 for Provisioned IOPS (SSD) volumes and + // 3 to 10000 for General Purpose (SSD) volumes. + // + // Condition: This parameter is required for requests to create io1 volumes; + // it is not used in requests to create standard or gp2 volumes. + Iops *int64 `locationName:"iops" type:"integer"` - // The ID of the VPC. - VPCID *string `locationName:"vpcId" type:"string"` + // The full ARN of the AWS Key Management Service (AWS KMS) customer master + // key (CMK) that was used to protect the volume encryption key for the volume. + KmsKeyId *string `locationName:"kmsKeyId" type:"string"` - metadataVPCAttachment `json:"-" xml:"-"` -} + // The size of the volume, in GiBs. + Size *int64 `locationName:"size" type:"integer"` -type metadataVPCAttachment struct { - SDKShapeTraits bool `type:"structure"` -} + // The snapshot from which the volume was created, if applicable. + SnapshotId *string `locationName:"snapshotId" type:"string"` -// Describes whether a VPC is enabled for ClassicLink. -type VPCClassicLink struct { - // Indicates whether the VPC is enabled for ClassicLink. - ClassicLinkEnabled *bool `locationName:"classicLinkEnabled" type:"boolean"` + // The volume state. + State *string `locationName:"status" type:"string" enum:"VolumeState"` - // Any tags assigned to the VPC. + // Any tags assigned to the volume. Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` - // The ID of the VPC. - VPCID *string `locationName:"vpcId" type:"string"` + // The ID of the volume. + VolumeId *string `locationName:"volumeId" type:"string"` - metadataVPCClassicLink `json:"-" xml:"-"` + // The volume type. This can be gp2 for General Purpose (SSD) volumes, io1 for + // Provisioned IOPS (SSD) volumes, or standard for Magnetic volumes. + VolumeType *string `locationName:"volumeType" type:"string" enum:"VolumeType"` + + metadataVolume `json:"-" xml:"-"` } -type metadataVPCClassicLink struct { +type metadataVolume struct { SDKShapeTraits bool `type:"structure"` } -// Describes a VPC endpoint. -type VPCEndpoint struct { - // The date and time the VPC endpoint was created. - CreationTimestamp *time.Time `locationName:"creationTimestamp" type:"timestamp" timestampFormat:"iso8601"` +// String returns the string representation +func (s Volume) String() string { + return awsutil.Prettify(s) +} - // The policy document associated with the endpoint. - PolicyDocument *string `locationName:"policyDocument" type:"string"` +// GoString returns the string representation +func (s Volume) GoString() string { + return s.String() +} - // One or more route tables associated with the endpoint. - RouteTableIDs []*string `locationName:"routeTableIdSet" locationNameList:"item" type:"list"` +// Describes volume attachment details. +type VolumeAttachment struct { + // The time stamp when the attachment initiated. + AttachTime *time.Time `locationName:"attachTime" type:"timestamp" timestampFormat:"iso8601"` - // The name of the AWS service to which the endpoint is associated. - ServiceName *string `locationName:"serviceName" type:"string"` + // Indicates whether the EBS volume is deleted on instance termination. + DeleteOnTermination *bool `locationName:"deleteOnTermination" type:"boolean"` - // The state of the VPC endpoint. - State *string `locationName:"state" type:"string"` + // The device name. + Device *string `locationName:"device" type:"string"` - // The ID of the VPC endpoint. - VPCEndpointID *string `locationName:"vpcEndpointId" type:"string"` + // The ID of the instance. + InstanceId *string `locationName:"instanceId" type:"string"` - // The ID of the VPC to which the endpoint is associated. - VPCID *string `locationName:"vpcId" type:"string"` + // The attachment state of the volume. + State *string `locationName:"status" type:"string" enum:"VolumeAttachmentState"` + + // The ID of the volume. + VolumeId *string `locationName:"volumeId" type:"string"` - metadataVPCEndpoint `json:"-" xml:"-"` + metadataVolumeAttachment `json:"-" xml:"-"` } -type metadataVPCEndpoint struct { +type metadataVolumeAttachment struct { SDKShapeTraits bool `type:"structure"` } -// Describes a VPC peering connection. -type VPCPeeringConnection struct { - // The information of the peer VPC. - AccepterVPCInfo *VPCPeeringConnectionVPCInfo `locationName:"accepterVpcInfo" type:"structure"` - - // The time that an unaccepted VPC peering connection will expire. - ExpirationTime *time.Time `locationName:"expirationTime" type:"timestamp" timestampFormat:"iso8601"` +// String returns the string representation +func (s VolumeAttachment) String() string { + return awsutil.Prettify(s) +} - // The information of the requester VPC. - RequesterVPCInfo *VPCPeeringConnectionVPCInfo `locationName:"requesterVpcInfo" type:"structure"` +// GoString returns the string representation +func (s VolumeAttachment) GoString() string { + return s.String() +} - // The status of the VPC peering connection. - Status *VPCPeeringConnectionStateReason `locationName:"status" type:"structure"` +// Describes an EBS volume. +type VolumeDetail struct { + // The size of the volume, in GiB. + Size *int64 `locationName:"size" type:"long" required:"true"` - // Any tags assigned to the resource. - Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` + metadataVolumeDetail `json:"-" xml:"-"` +} - // The ID of the VPC peering connection. - VPCPeeringConnectionID *string `locationName:"vpcPeeringConnectionId" type:"string"` +type metadataVolumeDetail struct { + SDKShapeTraits bool `type:"structure"` +} - metadataVPCPeeringConnection `json:"-" xml:"-"` +// String returns the string representation +func (s VolumeDetail) String() string { + return awsutil.Prettify(s) } -type metadataVPCPeeringConnection struct { - SDKShapeTraits bool `type:"structure"` +// GoString returns the string representation +func (s VolumeDetail) GoString() string { + return s.String() } -// Describes the status of a VPC peering connection. -type VPCPeeringConnectionStateReason struct { - // The status of the VPC peering connection. +// Describes a volume status operation code. +type VolumeStatusAction struct { + // The code identifying the operation, for example, enable-volume-io. Code *string `locationName:"code" type:"string"` - // A message that provides more information about the status, if applicable. - Message *string `locationName:"message" type:"string"` + // A description of the operation. + Description *string `locationName:"description" type:"string"` - metadataVPCPeeringConnectionStateReason `json:"-" xml:"-"` + // The ID of the event associated with this operation. + EventId *string `locationName:"eventId" type:"string"` + + // The event type associated with this operation. + EventType *string `locationName:"eventType" type:"string"` + + metadataVolumeStatusAction `json:"-" xml:"-"` } -type metadataVPCPeeringConnectionStateReason struct { +type metadataVolumeStatusAction struct { SDKShapeTraits bool `type:"structure"` } -// Describes a VPC in a VPC peering connection. -type VPCPeeringConnectionVPCInfo struct { - // The CIDR block for the VPC. - CIDRBlock *string `locationName:"cidrBlock" type:"string"` +// String returns the string representation +func (s VolumeStatusAction) String() string { + return awsutil.Prettify(s) +} - // The AWS account ID of the VPC owner. - OwnerID *string `locationName:"ownerId" type:"string"` +// GoString returns the string representation +func (s VolumeStatusAction) GoString() string { + return s.String() +} - // The ID of the VPC. - VPCID *string `locationName:"vpcId" type:"string"` +// Describes a volume status. +type VolumeStatusDetails struct { + // The name of the volume status. + Name *string `locationName:"name" type:"string" enum:"VolumeStatusName"` - metadataVPCPeeringConnectionVPCInfo `json:"-" xml:"-"` + // The intended status of the volume status. + Status *string `locationName:"status" type:"string"` + + metadataVolumeStatusDetails `json:"-" xml:"-"` } -type metadataVPCPeeringConnectionVPCInfo struct { +type metadataVolumeStatusDetails struct { SDKShapeTraits bool `type:"structure"` } -// Describes a VPN connection. -type VPNConnection struct { - // The configuration information for the VPN connection's customer gateway (in - // the native XML format). This element is always present in the CreateVpnConnection - // response; however, it's present in the DescribeVpnConnections response only - // if the VPN connection is in the pending or available state. - CustomerGatewayConfiguration *string `locationName:"customerGatewayConfiguration" type:"string"` - - // The ID of the customer gateway at your end of the VPN connection. - CustomerGatewayID *string `locationName:"customerGatewayId" type:"string"` +// String returns the string representation +func (s VolumeStatusDetails) String() string { + return awsutil.Prettify(s) +} - // The VPN connection options. - Options *VPNConnectionOptions `locationName:"options" type:"structure"` +// GoString returns the string representation +func (s VolumeStatusDetails) GoString() string { + return s.String() +} - // The static routes associated with the VPN connection. - Routes []*VPNStaticRoute `locationName:"routes" locationNameList:"item" type:"list"` +// Describes a volume status event. +type VolumeStatusEvent struct { + // A description of the event. + Description *string `locationName:"description" type:"string"` - // The current state of the VPN connection. - State *string `locationName:"state" type:"string"` + // The ID of this event. + EventId *string `locationName:"eventId" type:"string"` + + // The type of this event. + EventType *string `locationName:"eventType" type:"string"` + + // The latest end time of the event. + NotAfter *time.Time `locationName:"notAfter" type:"timestamp" timestampFormat:"iso8601"` + + // The earliest start time of the event. + NotBefore *time.Time `locationName:"notBefore" type:"timestamp" timestampFormat:"iso8601"` + + metadataVolumeStatusEvent `json:"-" xml:"-"` +} + +type metadataVolumeStatusEvent struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s VolumeStatusEvent) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s VolumeStatusEvent) GoString() string { + return s.String() +} + +// Describes the status of a volume. +type VolumeStatusInfo struct { + // The details of the volume status. + Details []*VolumeStatusDetails `locationName:"details" locationNameList:"item" type:"list"` + + // The status of the volume. + Status *string `locationName:"status" type:"string" enum:"VolumeStatusInfoStatus"` + + metadataVolumeStatusInfo `json:"-" xml:"-"` +} + +type metadataVolumeStatusInfo struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s VolumeStatusInfo) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s VolumeStatusInfo) GoString() string { + return s.String() +} + +// Describes the volume status. +type VolumeStatusItem struct { + // The details of the operation. + Actions []*VolumeStatusAction `locationName:"actionsSet" locationNameList:"item" type:"list"` + + // The Availability Zone of the volume. + AvailabilityZone *string `locationName:"availabilityZone" type:"string"` + + // A list of events associated with the volume. + Events []*VolumeStatusEvent `locationName:"eventsSet" locationNameList:"item" type:"list"` + + // The volume ID. + VolumeId *string `locationName:"volumeId" type:"string"` + + // The volume status. + VolumeStatus *VolumeStatusInfo `locationName:"volumeStatus" type:"structure"` + + metadataVolumeStatusItem `json:"-" xml:"-"` +} + +type metadataVolumeStatusItem struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s VolumeStatusItem) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s VolumeStatusItem) GoString() string { + return s.String() +} + +// Describes a VPC. +type Vpc struct { + // The CIDR block for the VPC. + CidrBlock *string `locationName:"cidrBlock" type:"string"` + + // The ID of the set of DHCP options you've associated with the VPC (or default + // if the default options are associated with the VPC). + DhcpOptionsId *string `locationName:"dhcpOptionsId" type:"string"` + + // The allowed tenancy of instances launched into the VPC. + InstanceTenancy *string `locationName:"instanceTenancy" type:"string" enum:"Tenancy"` + + // Indicates whether the VPC is the default VPC. + IsDefault *bool `locationName:"isDefault" type:"boolean"` + + // The current state of the VPC. + State *string `locationName:"state" type:"string" enum:"VpcState"` + + // Any tags assigned to the VPC. + Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` + + // The ID of the VPC. + VpcId *string `locationName:"vpcId" type:"string"` + + metadataVpc `json:"-" xml:"-"` +} + +type metadataVpc struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s Vpc) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Vpc) GoString() string { + return s.String() +} + +// Describes an attachment between a virtual private gateway and a VPC. +type VpcAttachment struct { + // The current state of the attachment. + State *string `locationName:"state" type:"string" enum:"AttachmentStatus"` + + // The ID of the VPC. + VpcId *string `locationName:"vpcId" type:"string"` + + metadataVpcAttachment `json:"-" xml:"-"` +} + +type metadataVpcAttachment struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s VpcAttachment) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s VpcAttachment) GoString() string { + return s.String() +} + +// Describes whether a VPC is enabled for ClassicLink. +type VpcClassicLink struct { + // Indicates whether the VPC is enabled for ClassicLink. + ClassicLinkEnabled *bool `locationName:"classicLinkEnabled" type:"boolean"` + + // Any tags assigned to the VPC. + Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` + + // The ID of the VPC. + VpcId *string `locationName:"vpcId" type:"string"` + + metadataVpcClassicLink `json:"-" xml:"-"` +} + +type metadataVpcClassicLink struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s VpcClassicLink) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s VpcClassicLink) GoString() string { + return s.String() +} + +// Describes a VPC endpoint. +type VpcEndpoint struct { + // The date and time the VPC endpoint was created. + CreationTimestamp *time.Time `locationName:"creationTimestamp" type:"timestamp" timestampFormat:"iso8601"` + + // The policy document associated with the endpoint. + PolicyDocument *string `locationName:"policyDocument" type:"string"` + + // One or more route tables associated with the endpoint. + RouteTableIds []*string `locationName:"routeTableIdSet" locationNameList:"item" type:"list"` + + // The name of the AWS service to which the endpoint is associated. + ServiceName *string `locationName:"serviceName" type:"string"` + + // The state of the VPC endpoint. + State *string `locationName:"state" type:"string" enum:"State"` + + // The ID of the VPC endpoint. + VpcEndpointId *string `locationName:"vpcEndpointId" type:"string"` + + // The ID of the VPC to which the endpoint is associated. + VpcId *string `locationName:"vpcId" type:"string"` + + metadataVpcEndpoint `json:"-" xml:"-"` +} + +type metadataVpcEndpoint struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s VpcEndpoint) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s VpcEndpoint) GoString() string { + return s.String() +} + +// Describes a VPC peering connection. +type VpcPeeringConnection struct { + // The information of the peer VPC. + AccepterVpcInfo *VpcPeeringConnectionVpcInfo `locationName:"accepterVpcInfo" type:"structure"` + + // The time that an unaccepted VPC peering connection will expire. + ExpirationTime *time.Time `locationName:"expirationTime" type:"timestamp" timestampFormat:"iso8601"` + + // The information of the requester VPC. + RequesterVpcInfo *VpcPeeringConnectionVpcInfo `locationName:"requesterVpcInfo" type:"structure"` + + // The status of the VPC peering connection. + Status *VpcPeeringConnectionStateReason `locationName:"status" type:"structure"` + + // Any tags assigned to the resource. + Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` + + // The ID of the VPC peering connection. + VpcPeeringConnectionId *string `locationName:"vpcPeeringConnectionId" type:"string"` + + metadataVpcPeeringConnection `json:"-" xml:"-"` +} + +type metadataVpcPeeringConnection struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s VpcPeeringConnection) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s VpcPeeringConnection) GoString() string { + return s.String() +} + +// Describes the status of a VPC peering connection. +type VpcPeeringConnectionStateReason struct { + // The status of the VPC peering connection. + Code *string `locationName:"code" type:"string" enum:"VpcPeeringConnectionStateReasonCode"` + + // A message that provides more information about the status, if applicable. + Message *string `locationName:"message" type:"string"` + + metadataVpcPeeringConnectionStateReason `json:"-" xml:"-"` +} + +type metadataVpcPeeringConnectionStateReason struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s VpcPeeringConnectionStateReason) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s VpcPeeringConnectionStateReason) GoString() string { + return s.String() +} + +// Describes a VPC in a VPC peering connection. +type VpcPeeringConnectionVpcInfo struct { + // The CIDR block for the VPC. + CidrBlock *string `locationName:"cidrBlock" type:"string"` + + // The AWS account ID of the VPC owner. + OwnerId *string `locationName:"ownerId" type:"string"` + + // The ID of the VPC. + VpcId *string `locationName:"vpcId" type:"string"` + + metadataVpcPeeringConnectionVpcInfo `json:"-" xml:"-"` +} + +type metadataVpcPeeringConnectionVpcInfo struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s VpcPeeringConnectionVpcInfo) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s VpcPeeringConnectionVpcInfo) GoString() string { + return s.String() +} + +// Describes a VPN connection. +type VpnConnection struct { + // The configuration information for the VPN connection's customer gateway (in + // the native XML format). This element is always present in the CreateVpnConnection + // response; however, it's present in the DescribeVpnConnections response only + // if the VPN connection is in the pending or available state. + CustomerGatewayConfiguration *string `locationName:"customerGatewayConfiguration" type:"string"` + + // The ID of the customer gateway at your end of the VPN connection. + CustomerGatewayId *string `locationName:"customerGatewayId" type:"string"` + + // The VPN connection options. + Options *VpnConnectionOptions `locationName:"options" type:"structure"` + + // The static routes associated with the VPN connection. + Routes []*VpnStaticRoute `locationName:"routes" locationNameList:"item" type:"list"` + + // The current state of the VPN connection. + State *string `locationName:"state" type:"string" enum:"VpnState"` // Any tags assigned to the VPN connection. Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` // The type of VPN connection. - Type *string `locationName:"type" type:"string"` + Type *string `locationName:"type" type:"string" enum:"GatewayType"` // Information about the VPN tunnel. - VGWTelemetry []*VGWTelemetry `locationName:"vgwTelemetry" locationNameList:"item" type:"list"` + VgwTelemetry []*VgwTelemetry `locationName:"vgwTelemetry" locationNameList:"item" type:"list"` // The ID of the VPN connection. - VPNConnectionID *string `locationName:"vpnConnectionId" type:"string"` + VpnConnectionId *string `locationName:"vpnConnectionId" type:"string"` // The ID of the virtual private gateway at the AWS side of the VPN connection. - VPNGatewayID *string `locationName:"vpnGatewayId" type:"string"` + VpnGatewayId *string `locationName:"vpnGatewayId" type:"string"` - metadataVPNConnection `json:"-" xml:"-"` + metadataVpnConnection `json:"-" xml:"-"` } -type metadataVPNConnection struct { +type metadataVpnConnection struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s VpnConnection) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s VpnConnection) GoString() string { + return s.String() +} + // Describes VPN connection options. -type VPNConnectionOptions struct { +type VpnConnectionOptions struct { // Indicates whether the VPN connection uses static routes only. Static routes // must be used for devices that don't support BGP. StaticRoutesOnly *bool `locationName:"staticRoutesOnly" type:"boolean"` - metadataVPNConnectionOptions `json:"-" xml:"-"` + metadataVpnConnectionOptions `json:"-" xml:"-"` } -type metadataVPNConnectionOptions struct { +type metadataVpnConnectionOptions struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s VpnConnectionOptions) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s VpnConnectionOptions) GoString() string { + return s.String() +} + // Describes VPN connection options. -type VPNConnectionOptionsSpecification struct { +type VpnConnectionOptionsSpecification struct { // Indicates whether the VPN connection uses static routes only. Static routes // must be used for devices that don't support BGP. StaticRoutesOnly *bool `locationName:"staticRoutesOnly" type:"boolean"` - metadataVPNConnectionOptionsSpecification `json:"-" xml:"-"` + metadataVpnConnectionOptionsSpecification `json:"-" xml:"-"` } -type metadataVPNConnectionOptionsSpecification struct { +type metadataVpnConnectionOptionsSpecification struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s VpnConnectionOptionsSpecification) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s VpnConnectionOptionsSpecification) GoString() string { + return s.String() +} + // Describes a virtual private gateway. -type VPNGateway struct { +type VpnGateway struct { // The Availability Zone where the virtual private gateway was created. AvailabilityZone *string `locationName:"availabilityZone" type:"string"` // The current state of the virtual private gateway. - State *string `locationName:"state" type:"string"` + State *string `locationName:"state" type:"string" enum:"VpnState"` // Any tags assigned to the virtual private gateway. Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` // The type of VPN connection the virtual private gateway supports. - Type *string `locationName:"type" type:"string"` + Type *string `locationName:"type" type:"string" enum:"GatewayType"` // Any VPCs attached to the virtual private gateway. - VPCAttachments []*VPCAttachment `locationName:"attachments" locationNameList:"item" type:"list"` + VpcAttachments []*VpcAttachment `locationName:"attachments" locationNameList:"item" type:"list"` // The ID of the virtual private gateway. - VPNGatewayID *string `locationName:"vpnGatewayId" type:"string"` + VpnGatewayId *string `locationName:"vpnGatewayId" type:"string"` - metadataVPNGateway `json:"-" xml:"-"` + metadataVpnGateway `json:"-" xml:"-"` } -type metadataVPNGateway struct { +type metadataVpnGateway struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s VpnGateway) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s VpnGateway) GoString() string { + return s.String() +} + // Describes a static route for a VPN connection. -type VPNStaticRoute struct { +type VpnStaticRoute struct { // The CIDR block associated with the local subnet of the customer data center. - DestinationCIDRBlock *string `locationName:"destinationCidrBlock" type:"string"` + DestinationCidrBlock *string `locationName:"destinationCidrBlock" type:"string"` // Indicates how the routes were provided. - Source *string `locationName:"source" type:"string"` + Source *string `locationName:"source" type:"string" enum:"VpnStaticRouteSource"` // The current state of the static route. - State *string `locationName:"state" type:"string"` + State *string `locationName:"state" type:"string" enum:"VpnState"` - metadataVPNStaticRoute `json:"-" xml:"-"` + metadataVpnStaticRoute `json:"-" xml:"-"` } -type metadataVPNStaticRoute struct { +type metadataVpnStaticRoute struct { SDKShapeTraits bool `type:"structure"` } -// Describes a volume. -type Volume struct { - // Information about the volume attachments. - Attachments []*VolumeAttachment `locationName:"attachmentSet" locationNameList:"item" type:"list"` +// String returns the string representation +func (s VpnStaticRoute) String() string { + return awsutil.Prettify(s) +} - // The Availability Zone for the volume. - AvailabilityZone *string `locationName:"availabilityZone" type:"string"` +// GoString returns the string representation +func (s VpnStaticRoute) GoString() string { + return s.String() +} - // The time stamp when volume creation was initiated. - CreateTime *time.Time `locationName:"createTime" type:"timestamp" timestampFormat:"iso8601"` +const ( + // @enum AccountAttributeName + AccountAttributeNameSupportedPlatforms = "supported-platforms" + // @enum AccountAttributeName + AccountAttributeNameDefaultVpc = "default-vpc" +) - // Indicates whether the volume will be encrypted. - Encrypted *bool `locationName:"encrypted" type:"boolean"` +const ( + // @enum AllocationStrategy + AllocationStrategyLowestPrice = "lowestPrice" + // @enum AllocationStrategy + AllocationStrategyDiversified = "diversified" +) - // The number of I/O operations per second (IOPS) that the volume supports. - // For Provisioned IOPS (SSD) volumes, this represents the number of IOPS that - // are provisioned for the volume. For General Purpose (SSD) volumes, this represents - // the baseline performance of the volume and the rate at which the volume accumulates - // I/O credits for bursting. For more information on General Purpose (SSD) baseline - // performance, I/O credits, and bursting, see Amazon EBS Volume Types (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html) - // in the Amazon Elastic Compute Cloud User Guide. - // - // Constraint: Range is 100 to 20000 for Provisioned IOPS (SSD) volumes and - // 3 to 10000 for General Purpose (SSD) volumes. - // - // Condition: This parameter is required for requests to create io1 volumes; - // it is not used in requests to create standard or gp2 volumes. - IOPS *int64 `locationName:"iops" type:"integer"` +const ( + // @enum ArchitectureValues + ArchitectureValuesI386 = "i386" + // @enum ArchitectureValues + ArchitectureValuesX8664 = "x86_64" +) - // The full ARN of the AWS Key Management Service (KMS) master key that was - // used to protect the volume encryption key for the volume. - KMSKeyID *string `locationName:"kmsKeyId" type:"string"` +const ( + // @enum AttachmentStatus + AttachmentStatusAttaching = "attaching" + // @enum AttachmentStatus + AttachmentStatusAttached = "attached" + // @enum AttachmentStatus + AttachmentStatusDetaching = "detaching" + // @enum AttachmentStatus + AttachmentStatusDetached = "detached" +) - // The size of the volume, in GiBs. - Size *int64 `locationName:"size" type:"integer"` +const ( + // @enum AvailabilityZoneState + AvailabilityZoneStateAvailable = "available" +) - // The snapshot from which the volume was created, if applicable. - SnapshotID *string `locationName:"snapshotId" type:"string"` +const ( + // @enum BatchState + BatchStateSubmitted = "submitted" + // @enum BatchState + BatchStateActive = "active" + // @enum BatchState + BatchStateCancelled = "cancelled" + // @enum BatchState + BatchStateFailed = "failed" + // @enum BatchState + BatchStateCancelledRunning = "cancelled_running" + // @enum BatchState + BatchStateCancelledTerminating = "cancelled_terminating" +) - // The volume state. - State *string `locationName:"status" type:"string"` +const ( + // @enum BundleTaskState + BundleTaskStatePending = "pending" + // @enum BundleTaskState + BundleTaskStateWaitingForShutdown = "waiting-for-shutdown" + // @enum BundleTaskState + BundleTaskStateBundling = "bundling" + // @enum BundleTaskState + BundleTaskStateStoring = "storing" + // @enum BundleTaskState + BundleTaskStateCancelling = "cancelling" + // @enum BundleTaskState + BundleTaskStateComplete = "complete" + // @enum BundleTaskState + BundleTaskStateFailed = "failed" +) - // Any tags assigned to the volume. - Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` +const ( + // @enum CancelBatchErrorCode + CancelBatchErrorCodeFleetRequestIdDoesNotExist = "fleetRequestIdDoesNotExist" + // @enum CancelBatchErrorCode + CancelBatchErrorCodeFleetRequestIdMalformed = "fleetRequestIdMalformed" + // @enum CancelBatchErrorCode + CancelBatchErrorCodeFleetRequestNotInCancellableState = "fleetRequestNotInCancellableState" + // @enum CancelBatchErrorCode + CancelBatchErrorCodeUnexpectedError = "unexpectedError" +) - // The ID of the volume. - VolumeID *string `locationName:"volumeId" type:"string"` +const ( + // @enum CancelSpotInstanceRequestState + CancelSpotInstanceRequestStateActive = "active" + // @enum CancelSpotInstanceRequestState + CancelSpotInstanceRequestStateOpen = "open" + // @enum CancelSpotInstanceRequestState + CancelSpotInstanceRequestStateClosed = "closed" + // @enum CancelSpotInstanceRequestState + CancelSpotInstanceRequestStateCancelled = "cancelled" + // @enum CancelSpotInstanceRequestState + CancelSpotInstanceRequestStateCompleted = "completed" +) - // The volume type. This can be gp2 for General Purpose (SSD) volumes, io1 for - // Provisioned IOPS (SSD) volumes, or standard for Magnetic volumes. - VolumeType *string `locationName:"volumeType" type:"string"` +const ( + // @enum ContainerFormat + ContainerFormatOva = "ova" +) - metadataVolume `json:"-" xml:"-"` -} +const ( + // @enum ConversionTaskState + ConversionTaskStateActive = "active" + // @enum ConversionTaskState + ConversionTaskStateCancelling = "cancelling" + // @enum ConversionTaskState + ConversionTaskStateCancelled = "cancelled" + // @enum ConversionTaskState + ConversionTaskStateCompleted = "completed" +) -type metadataVolume struct { - SDKShapeTraits bool `type:"structure"` -} +const ( + // @enum CurrencyCodeValues + CurrencyCodeValuesUsd = "USD" +) -// Describes volume attachment details. -type VolumeAttachment struct { - // The time stamp when the attachment initiated. - AttachTime *time.Time `locationName:"attachTime" type:"timestamp" timestampFormat:"iso8601"` +const ( + // @enum DatafeedSubscriptionState + DatafeedSubscriptionStateActive = "Active" + // @enum DatafeedSubscriptionState + DatafeedSubscriptionStateInactive = "Inactive" +) - // Indicates whether the EBS volume is deleted on instance termination. - DeleteOnTermination *bool `locationName:"deleteOnTermination" type:"boolean"` +const ( + // @enum DeviceType + DeviceTypeEbs = "ebs" + // @enum DeviceType + DeviceTypeInstanceStore = "instance-store" +) - // The device name. - Device *string `locationName:"device" type:"string"` +const ( + // @enum DiskImageFormat + DiskImageFormatVmdk = "VMDK" + // @enum DiskImageFormat + DiskImageFormatRaw = "RAW" + // @enum DiskImageFormat + DiskImageFormatVhd = "VHD" +) - // The ID of the instance. - InstanceID *string `locationName:"instanceId" type:"string"` +const ( + // @enum DomainType + DomainTypeVpc = "vpc" + // @enum DomainType + DomainTypeStandard = "standard" +) - // The attachment state of the volume. - State *string `locationName:"status" type:"string"` +const ( + // @enum EventCode + EventCodeInstanceReboot = "instance-reboot" + // @enum EventCode + EventCodeSystemReboot = "system-reboot" + // @enum EventCode + EventCodeSystemMaintenance = "system-maintenance" + // @enum EventCode + EventCodeInstanceRetirement = "instance-retirement" + // @enum EventCode + EventCodeInstanceStop = "instance-stop" +) - // The ID of the volume. - VolumeID *string `locationName:"volumeId" type:"string"` +const ( + // @enum EventType + EventTypeInstanceChange = "instanceChange" + // @enum EventType + EventTypeFleetRequestChange = "fleetRequestChange" + // @enum EventType + EventTypeError = "error" +) - metadataVolumeAttachment `json:"-" xml:"-"` -} +const ( + // @enum ExportEnvironment + ExportEnvironmentCitrix = "citrix" + // @enum ExportEnvironment + ExportEnvironmentVmware = "vmware" + // @enum ExportEnvironment + ExportEnvironmentMicrosoft = "microsoft" +) -type metadataVolumeAttachment struct { - SDKShapeTraits bool `type:"structure"` -} +const ( + // @enum ExportTaskState + ExportTaskStateActive = "active" + // @enum ExportTaskState + ExportTaskStateCancelling = "cancelling" + // @enum ExportTaskState + ExportTaskStateCancelled = "cancelled" + // @enum ExportTaskState + ExportTaskStateCompleted = "completed" +) -// Describes an EBS volume. -type VolumeDetail struct { - // The size of the volume, in GiB. - Size *int64 `locationName:"size" type:"long" required:"true"` +const ( + // @enum FlowLogsResourceType + FlowLogsResourceTypeVpc = "VPC" + // @enum FlowLogsResourceType + FlowLogsResourceTypeSubnet = "Subnet" + // @enum FlowLogsResourceType + FlowLogsResourceTypeNetworkInterface = "NetworkInterface" +) - metadataVolumeDetail `json:"-" xml:"-"` -} +const ( + // @enum GatewayType + GatewayTypeIpsec1 = "ipsec.1" +) -type metadataVolumeDetail struct { - SDKShapeTraits bool `type:"structure"` -} +const ( + // @enum HypervisorType + HypervisorTypeOvm = "ovm" + // @enum HypervisorType + HypervisorTypeXen = "xen" +) -// Describes a volume status operation code. -type VolumeStatusAction struct { - // The code identifying the operation, for example, enable-volume-io. - Code *string `locationName:"code" type:"string"` +const ( + // @enum ImageAttributeName + ImageAttributeNameDescription = "description" + // @enum ImageAttributeName + ImageAttributeNameKernel = "kernel" + // @enum ImageAttributeName + ImageAttributeNameRamdisk = "ramdisk" + // @enum ImageAttributeName + ImageAttributeNameLaunchPermission = "launchPermission" + // @enum ImageAttributeName + ImageAttributeNameProductCodes = "productCodes" + // @enum ImageAttributeName + ImageAttributeNameBlockDeviceMapping = "blockDeviceMapping" + // @enum ImageAttributeName + ImageAttributeNameSriovNetSupport = "sriovNetSupport" +) - // A description of the operation. - Description *string `locationName:"description" type:"string"` +const ( + // @enum ImageState + ImageStatePending = "pending" + // @enum ImageState + ImageStateAvailable = "available" + // @enum ImageState + ImageStateInvalid = "invalid" + // @enum ImageState + ImageStateDeregistered = "deregistered" + // @enum ImageState + ImageStateTransient = "transient" + // @enum ImageState + ImageStateFailed = "failed" + // @enum ImageState + ImageStateError = "error" +) - // The ID of the event associated with this operation. - EventID *string `locationName:"eventId" type:"string"` +const ( + // @enum ImageTypeValues + ImageTypeValuesMachine = "machine" + // @enum ImageTypeValues + ImageTypeValuesKernel = "kernel" + // @enum ImageTypeValues + ImageTypeValuesRamdisk = "ramdisk" +) - // The event type associated with this operation. - EventType *string `locationName:"eventType" type:"string"` +const ( + // @enum InstanceAttributeName + InstanceAttributeNameInstanceType = "instanceType" + // @enum InstanceAttributeName + InstanceAttributeNameKernel = "kernel" + // @enum InstanceAttributeName + InstanceAttributeNameRamdisk = "ramdisk" + // @enum InstanceAttributeName + InstanceAttributeNameUserData = "userData" + // @enum InstanceAttributeName + InstanceAttributeNameDisableApiTermination = "disableApiTermination" + // @enum InstanceAttributeName + InstanceAttributeNameInstanceInitiatedShutdownBehavior = "instanceInitiatedShutdownBehavior" + // @enum InstanceAttributeName + InstanceAttributeNameRootDeviceName = "rootDeviceName" + // @enum InstanceAttributeName + InstanceAttributeNameBlockDeviceMapping = "blockDeviceMapping" + // @enum InstanceAttributeName + InstanceAttributeNameProductCodes = "productCodes" + // @enum InstanceAttributeName + InstanceAttributeNameSourceDestCheck = "sourceDestCheck" + // @enum InstanceAttributeName + InstanceAttributeNameGroupSet = "groupSet" + // @enum InstanceAttributeName + InstanceAttributeNameEbsOptimized = "ebsOptimized" + // @enum InstanceAttributeName + InstanceAttributeNameSriovNetSupport = "sriovNetSupport" +) - metadataVolumeStatusAction `json:"-" xml:"-"` -} +const ( + // @enum InstanceLifecycleType + InstanceLifecycleTypeSpot = "spot" +) -type metadataVolumeStatusAction struct { - SDKShapeTraits bool `type:"structure"` -} +const ( + // @enum InstanceStateName + InstanceStateNamePending = "pending" + // @enum InstanceStateName + InstanceStateNameRunning = "running" + // @enum InstanceStateName + InstanceStateNameShuttingDown = "shutting-down" + // @enum InstanceStateName + InstanceStateNameTerminated = "terminated" + // @enum InstanceStateName + InstanceStateNameStopping = "stopping" + // @enum InstanceStateName + InstanceStateNameStopped = "stopped" +) -// Describes a volume status. -type VolumeStatusDetails struct { - // The name of the volume status. - Name *string `locationName:"name" type:"string"` +const ( + // @enum InstanceType + InstanceTypeT1Micro = "t1.micro" + // @enum InstanceType + InstanceTypeM1Small = "m1.small" + // @enum InstanceType + InstanceTypeM1Medium = "m1.medium" + // @enum InstanceType + InstanceTypeM1Large = "m1.large" + // @enum InstanceType + InstanceTypeM1Xlarge = "m1.xlarge" + // @enum InstanceType + InstanceTypeM3Medium = "m3.medium" + // @enum InstanceType + InstanceTypeM3Large = "m3.large" + // @enum InstanceType + InstanceTypeM3Xlarge = "m3.xlarge" + // @enum InstanceType + InstanceTypeM32xlarge = "m3.2xlarge" + // @enum InstanceType + InstanceTypeM4Large = "m4.large" + // @enum InstanceType + InstanceTypeM4Xlarge = "m4.xlarge" + // @enum InstanceType + InstanceTypeM42xlarge = "m4.2xlarge" + // @enum InstanceType + InstanceTypeM44xlarge = "m4.4xlarge" + // @enum InstanceType + InstanceTypeM410xlarge = "m4.10xlarge" + // @enum InstanceType + InstanceTypeT2Micro = "t2.micro" + // @enum InstanceType + InstanceTypeT2Small = "t2.small" + // @enum InstanceType + InstanceTypeT2Medium = "t2.medium" + // @enum InstanceType + InstanceTypeT2Large = "t2.large" + // @enum InstanceType + InstanceTypeM2Xlarge = "m2.xlarge" + // @enum InstanceType + InstanceTypeM22xlarge = "m2.2xlarge" + // @enum InstanceType + InstanceTypeM24xlarge = "m2.4xlarge" + // @enum InstanceType + InstanceTypeCr18xlarge = "cr1.8xlarge" + // @enum InstanceType + InstanceTypeI2Xlarge = "i2.xlarge" + // @enum InstanceType + InstanceTypeI22xlarge = "i2.2xlarge" + // @enum InstanceType + InstanceTypeI24xlarge = "i2.4xlarge" + // @enum InstanceType + InstanceTypeI28xlarge = "i2.8xlarge" + // @enum InstanceType + InstanceTypeHi14xlarge = "hi1.4xlarge" + // @enum InstanceType + InstanceTypeHs18xlarge = "hs1.8xlarge" + // @enum InstanceType + InstanceTypeC1Medium = "c1.medium" + // @enum InstanceType + InstanceTypeC1Xlarge = "c1.xlarge" + // @enum InstanceType + InstanceTypeC3Large = "c3.large" + // @enum InstanceType + InstanceTypeC3Xlarge = "c3.xlarge" + // @enum InstanceType + InstanceTypeC32xlarge = "c3.2xlarge" + // @enum InstanceType + InstanceTypeC34xlarge = "c3.4xlarge" + // @enum InstanceType + InstanceTypeC38xlarge = "c3.8xlarge" + // @enum InstanceType + InstanceTypeC4Large = "c4.large" + // @enum InstanceType + InstanceTypeC4Xlarge = "c4.xlarge" + // @enum InstanceType + InstanceTypeC42xlarge = "c4.2xlarge" + // @enum InstanceType + InstanceTypeC44xlarge = "c4.4xlarge" + // @enum InstanceType + InstanceTypeC48xlarge = "c4.8xlarge" + // @enum InstanceType + InstanceTypeCc14xlarge = "cc1.4xlarge" + // @enum InstanceType + InstanceTypeCc28xlarge = "cc2.8xlarge" + // @enum InstanceType + InstanceTypeG22xlarge = "g2.2xlarge" + // @enum InstanceType + InstanceTypeCg14xlarge = "cg1.4xlarge" + // @enum InstanceType + InstanceTypeR3Large = "r3.large" + // @enum InstanceType + InstanceTypeR3Xlarge = "r3.xlarge" + // @enum InstanceType + InstanceTypeR32xlarge = "r3.2xlarge" + // @enum InstanceType + InstanceTypeR34xlarge = "r3.4xlarge" + // @enum InstanceType + InstanceTypeR38xlarge = "r3.8xlarge" + // @enum InstanceType + InstanceTypeD2Xlarge = "d2.xlarge" + // @enum InstanceType + InstanceTypeD22xlarge = "d2.2xlarge" + // @enum InstanceType + InstanceTypeD24xlarge = "d2.4xlarge" + // @enum InstanceType + InstanceTypeD28xlarge = "d2.8xlarge" +) - // The intended status of the volume status. - Status *string `locationName:"status" type:"string"` +const ( + // @enum ListingState + ListingStateAvailable = "available" + // @enum ListingState + ListingStateSold = "sold" + // @enum ListingState + ListingStateCancelled = "cancelled" + // @enum ListingState + ListingStatePending = "pending" +) - metadataVolumeStatusDetails `json:"-" xml:"-"` -} +const ( + // @enum ListingStatus + ListingStatusActive = "active" + // @enum ListingStatus + ListingStatusPending = "pending" + // @enum ListingStatus + ListingStatusCancelled = "cancelled" + // @enum ListingStatus + ListingStatusClosed = "closed" +) -type metadataVolumeStatusDetails struct { - SDKShapeTraits bool `type:"structure"` -} +const ( + // @enum MonitoringState + MonitoringStateDisabled = "disabled" + // @enum MonitoringState + MonitoringStateDisabling = "disabling" + // @enum MonitoringState + MonitoringStateEnabled = "enabled" + // @enum MonitoringState + MonitoringStatePending = "pending" +) -// Describes a volume status event. -type VolumeStatusEvent struct { - // A description of the event. - Description *string `locationName:"description" type:"string"` +const ( + // @enum MoveStatus + MoveStatusMovingToVpc = "movingToVpc" + // @enum MoveStatus + MoveStatusRestoringToClassic = "restoringToClassic" +) - // The ID of this event. - EventID *string `locationName:"eventId" type:"string"` +const ( + // @enum NetworkInterfaceAttribute + NetworkInterfaceAttributeDescription = "description" + // @enum NetworkInterfaceAttribute + NetworkInterfaceAttributeGroupSet = "groupSet" + // @enum NetworkInterfaceAttribute + NetworkInterfaceAttributeSourceDestCheck = "sourceDestCheck" + // @enum NetworkInterfaceAttribute + NetworkInterfaceAttributeAttachment = "attachment" +) - // The type of this event. - EventType *string `locationName:"eventType" type:"string"` +const ( + // @enum NetworkInterfaceStatus + NetworkInterfaceStatusAvailable = "available" + // @enum NetworkInterfaceStatus + NetworkInterfaceStatusAttaching = "attaching" + // @enum NetworkInterfaceStatus + NetworkInterfaceStatusInUse = "in-use" + // @enum NetworkInterfaceStatus + NetworkInterfaceStatusDetaching = "detaching" +) - // The latest end time of the event. - NotAfter *time.Time `locationName:"notAfter" type:"timestamp" timestampFormat:"iso8601"` +const ( + // @enum OfferingTypeValues + OfferingTypeValuesHeavyUtilization = "Heavy Utilization" + // @enum OfferingTypeValues + OfferingTypeValuesMediumUtilization = "Medium Utilization" + // @enum OfferingTypeValues + OfferingTypeValuesLightUtilization = "Light Utilization" + // @enum OfferingTypeValues + OfferingTypeValuesNoUpfront = "No Upfront" + // @enum OfferingTypeValues + OfferingTypeValuesPartialUpfront = "Partial Upfront" + // @enum OfferingTypeValues + OfferingTypeValuesAllUpfront = "All Upfront" +) - // The earliest start time of the event. - NotBefore *time.Time `locationName:"notBefore" type:"timestamp" timestampFormat:"iso8601"` +const ( + // @enum OperationType + OperationTypeAdd = "add" + // @enum OperationType + OperationTypeRemove = "remove" +) - metadataVolumeStatusEvent `json:"-" xml:"-"` -} +const ( + // @enum PermissionGroup + PermissionGroupAll = "all" +) -type metadataVolumeStatusEvent struct { - SDKShapeTraits bool `type:"structure"` -} +const ( + // @enum PlacementGroupState + PlacementGroupStatePending = "pending" + // @enum PlacementGroupState + PlacementGroupStateAvailable = "available" + // @enum PlacementGroupState + PlacementGroupStateDeleting = "deleting" + // @enum PlacementGroupState + PlacementGroupStateDeleted = "deleted" +) -// Describes the status of a volume. -type VolumeStatusInfo struct { - // The details of the volume status. - Details []*VolumeStatusDetails `locationName:"details" locationNameList:"item" type:"list"` +const ( + // @enum PlacementStrategy + PlacementStrategyCluster = "cluster" +) - // The status of the volume. - Status *string `locationName:"status" type:"string"` +const ( + // @enum PlatformValues + PlatformValuesWindows = "Windows" +) - metadataVolumeStatusInfo `json:"-" xml:"-"` -} +const ( + // @enum ProductCodeValues + ProductCodeValuesDevpay = "devpay" + // @enum ProductCodeValues + ProductCodeValuesMarketplace = "marketplace" +) -type metadataVolumeStatusInfo struct { - SDKShapeTraits bool `type:"structure"` -} +const ( + // @enum RIProductDescription + RIProductDescriptionLinuxUnix = "Linux/UNIX" + // @enum RIProductDescription + RIProductDescriptionLinuxUnixamazonVpc = "Linux/UNIX (Amazon VPC)" + // @enum RIProductDescription + RIProductDescriptionWindows = "Windows" + // @enum RIProductDescription + RIProductDescriptionWindowsAmazonVpc = "Windows (Amazon VPC)" +) -// Describes the volume status. -type VolumeStatusItem struct { - // The details of the operation. - Actions []*VolumeStatusAction `locationName:"actionsSet" locationNameList:"item" type:"list"` +const ( + // @enum RecurringChargeFrequency + RecurringChargeFrequencyHourly = "Hourly" +) - // The Availability Zone of the volume. - AvailabilityZone *string `locationName:"availabilityZone" type:"string"` +const ( + // @enum ReportInstanceReasonCodes + ReportInstanceReasonCodesInstanceStuckInState = "instance-stuck-in-state" + // @enum ReportInstanceReasonCodes + ReportInstanceReasonCodesUnresponsive = "unresponsive" + // @enum ReportInstanceReasonCodes + ReportInstanceReasonCodesNotAcceptingCredentials = "not-accepting-credentials" + // @enum ReportInstanceReasonCodes + ReportInstanceReasonCodesPasswordNotAvailable = "password-not-available" + // @enum ReportInstanceReasonCodes + ReportInstanceReasonCodesPerformanceNetwork = "performance-network" + // @enum ReportInstanceReasonCodes + ReportInstanceReasonCodesPerformanceInstanceStore = "performance-instance-store" + // @enum ReportInstanceReasonCodes + ReportInstanceReasonCodesPerformanceEbsVolume = "performance-ebs-volume" + // @enum ReportInstanceReasonCodes + ReportInstanceReasonCodesPerformanceOther = "performance-other" + // @enum ReportInstanceReasonCodes + ReportInstanceReasonCodesOther = "other" +) - // A list of events associated with the volume. - Events []*VolumeStatusEvent `locationName:"eventsSet" locationNameList:"item" type:"list"` +const ( + // @enum ReportStatusType + ReportStatusTypeOk = "ok" + // @enum ReportStatusType + ReportStatusTypeImpaired = "impaired" +) - // The volume ID. - VolumeID *string `locationName:"volumeId" type:"string"` +const ( + // @enum ReservedInstanceState + ReservedInstanceStatePaymentPending = "payment-pending" + // @enum ReservedInstanceState + ReservedInstanceStateActive = "active" + // @enum ReservedInstanceState + ReservedInstanceStatePaymentFailed = "payment-failed" + // @enum ReservedInstanceState + ReservedInstanceStateRetired = "retired" +) - // The volume status. - VolumeStatus *VolumeStatusInfo `locationName:"volumeStatus" type:"structure"` +const ( + // @enum ResetImageAttributeName + ResetImageAttributeNameLaunchPermission = "launchPermission" +) - metadataVolumeStatusItem `json:"-" xml:"-"` -} +const ( + // @enum ResourceType + ResourceTypeCustomerGateway = "customer-gateway" + // @enum ResourceType + ResourceTypeDhcpOptions = "dhcp-options" + // @enum ResourceType + ResourceTypeImage = "image" + // @enum ResourceType + ResourceTypeInstance = "instance" + // @enum ResourceType + ResourceTypeInternetGateway = "internet-gateway" + // @enum ResourceType + ResourceTypeNetworkAcl = "network-acl" + // @enum ResourceType + ResourceTypeNetworkInterface = "network-interface" + // @enum ResourceType + ResourceTypeReservedInstances = "reserved-instances" + // @enum ResourceType + ResourceTypeRouteTable = "route-table" + // @enum ResourceType + ResourceTypeSnapshot = "snapshot" + // @enum ResourceType + ResourceTypeSpotInstancesRequest = "spot-instances-request" + // @enum ResourceType + ResourceTypeSubnet = "subnet" + // @enum ResourceType + ResourceTypeSecurityGroup = "security-group" + // @enum ResourceType + ResourceTypeVolume = "volume" + // @enum ResourceType + ResourceTypeVpc = "vpc" + // @enum ResourceType + ResourceTypeVpnConnection = "vpn-connection" + // @enum ResourceType + ResourceTypeVpnGateway = "vpn-gateway" +) -type metadataVolumeStatusItem struct { - SDKShapeTraits bool `type:"structure"` -} +const ( + // @enum RouteOrigin + RouteOriginCreateRouteTable = "CreateRouteTable" + // @enum RouteOrigin + RouteOriginCreateRoute = "CreateRoute" + // @enum RouteOrigin + RouteOriginEnableVgwRoutePropagation = "EnableVgwRoutePropagation" +) + +const ( + // @enum RouteState + RouteStateActive = "active" + // @enum RouteState + RouteStateBlackhole = "blackhole" +) + +const ( + // @enum RuleAction + RuleActionAllow = "allow" + // @enum RuleAction + RuleActionDeny = "deny" +) + +const ( + // @enum ShutdownBehavior + ShutdownBehaviorStop = "stop" + // @enum ShutdownBehavior + ShutdownBehaviorTerminate = "terminate" +) + +const ( + // @enum SnapshotAttributeName + SnapshotAttributeNameProductCodes = "productCodes" + // @enum SnapshotAttributeName + SnapshotAttributeNameCreateVolumePermission = "createVolumePermission" +) + +const ( + // @enum SnapshotState + SnapshotStatePending = "pending" + // @enum SnapshotState + SnapshotStateCompleted = "completed" + // @enum SnapshotState + SnapshotStateError = "error" +) + +const ( + // @enum SpotInstanceState + SpotInstanceStateOpen = "open" + // @enum SpotInstanceState + SpotInstanceStateActive = "active" + // @enum SpotInstanceState + SpotInstanceStateClosed = "closed" + // @enum SpotInstanceState + SpotInstanceStateCancelled = "cancelled" + // @enum SpotInstanceState + SpotInstanceStateFailed = "failed" +) + +const ( + // @enum SpotInstanceType + SpotInstanceTypeOneTime = "one-time" + // @enum SpotInstanceType + SpotInstanceTypePersistent = "persistent" +) + +const ( + // @enum State + StatePending = "Pending" + // @enum State + StateAvailable = "Available" + // @enum State + StateDeleting = "Deleting" + // @enum State + StateDeleted = "Deleted" +) + +const ( + // @enum Status + StatusMoveInProgress = "MoveInProgress" + // @enum Status + StatusInVpc = "InVpc" + // @enum Status + StatusInClassic = "InClassic" +) + +const ( + // @enum StatusName + StatusNameReachability = "reachability" +) + +const ( + // @enum StatusType + StatusTypePassed = "passed" + // @enum StatusType + StatusTypeFailed = "failed" + // @enum StatusType + StatusTypeInsufficientData = "insufficient-data" + // @enum StatusType + StatusTypeInitializing = "initializing" +) + +const ( + // @enum SubnetState + SubnetStatePending = "pending" + // @enum SubnetState + SubnetStateAvailable = "available" +) + +const ( + // @enum SummaryStatus + SummaryStatusOk = "ok" + // @enum SummaryStatus + SummaryStatusImpaired = "impaired" + // @enum SummaryStatus + SummaryStatusInsufficientData = "insufficient-data" + // @enum SummaryStatus + SummaryStatusNotApplicable = "not-applicable" + // @enum SummaryStatus + SummaryStatusInitializing = "initializing" +) + +const ( + // @enum TelemetryStatus + TelemetryStatusUp = "UP" + // @enum TelemetryStatus + TelemetryStatusDown = "DOWN" +) + +const ( + // @enum Tenancy + TenancyDefault = "default" + // @enum Tenancy + TenancyDedicated = "dedicated" +) + +const ( + // @enum TrafficType + TrafficTypeAccept = "ACCEPT" + // @enum TrafficType + TrafficTypeReject = "REJECT" + // @enum TrafficType + TrafficTypeAll = "ALL" +) + +const ( + // @enum VirtualizationType + VirtualizationTypeHvm = "hvm" + // @enum VirtualizationType + VirtualizationTypeParavirtual = "paravirtual" +) + +const ( + // @enum VolumeAttachmentState + VolumeAttachmentStateAttaching = "attaching" + // @enum VolumeAttachmentState + VolumeAttachmentStateAttached = "attached" + // @enum VolumeAttachmentState + VolumeAttachmentStateDetaching = "detaching" + // @enum VolumeAttachmentState + VolumeAttachmentStateDetached = "detached" +) + +const ( + // @enum VolumeAttributeName + VolumeAttributeNameAutoEnableIo = "autoEnableIO" + // @enum VolumeAttributeName + VolumeAttributeNameProductCodes = "productCodes" +) + +const ( + // @enum VolumeState + VolumeStateCreating = "creating" + // @enum VolumeState + VolumeStateAvailable = "available" + // @enum VolumeState + VolumeStateInUse = "in-use" + // @enum VolumeState + VolumeStateDeleting = "deleting" + // @enum VolumeState + VolumeStateDeleted = "deleted" + // @enum VolumeState + VolumeStateError = "error" +) + +const ( + // @enum VolumeStatusInfoStatus + VolumeStatusInfoStatusOk = "ok" + // @enum VolumeStatusInfoStatus + VolumeStatusInfoStatusImpaired = "impaired" + // @enum VolumeStatusInfoStatus + VolumeStatusInfoStatusInsufficientData = "insufficient-data" +) + +const ( + // @enum VolumeStatusName + VolumeStatusNameIoEnabled = "io-enabled" + // @enum VolumeStatusName + VolumeStatusNameIoPerformance = "io-performance" +) + +const ( + // @enum VolumeType + VolumeTypeStandard = "standard" + // @enum VolumeType + VolumeTypeIo1 = "io1" + // @enum VolumeType + VolumeTypeGp2 = "gp2" +) + +const ( + // @enum VpcAttributeName + VpcAttributeNameEnableDnsSupport = "enableDnsSupport" + // @enum VpcAttributeName + VpcAttributeNameEnableDnsHostnames = "enableDnsHostnames" +) + +const ( + // @enum VpcPeeringConnectionStateReasonCode + VpcPeeringConnectionStateReasonCodeInitiatingRequest = "initiating-request" + // @enum VpcPeeringConnectionStateReasonCode + VpcPeeringConnectionStateReasonCodePendingAcceptance = "pending-acceptance" + // @enum VpcPeeringConnectionStateReasonCode + VpcPeeringConnectionStateReasonCodeActive = "active" + // @enum VpcPeeringConnectionStateReasonCode + VpcPeeringConnectionStateReasonCodeDeleted = "deleted" + // @enum VpcPeeringConnectionStateReasonCode + VpcPeeringConnectionStateReasonCodeRejected = "rejected" + // @enum VpcPeeringConnectionStateReasonCode + VpcPeeringConnectionStateReasonCodeFailed = "failed" + // @enum VpcPeeringConnectionStateReasonCode + VpcPeeringConnectionStateReasonCodeExpired = "expired" + // @enum VpcPeeringConnectionStateReasonCode + VpcPeeringConnectionStateReasonCodeProvisioning = "provisioning" + // @enum VpcPeeringConnectionStateReasonCode + VpcPeeringConnectionStateReasonCodeDeleting = "deleting" +) + +const ( + // @enum VpcState + VpcStatePending = "pending" + // @enum VpcState + VpcStateAvailable = "available" +) + +const ( + // @enum VpnState + VpnStatePending = "pending" + // @enum VpnState + VpnStateAvailable = "available" + // @enum VpnState + VpnStateDeleting = "deleting" + // @enum VpnState + VpnStateDeleted = "deleted" +) + +const ( + // @enum VpnStaticRouteSource + VpnStaticRouteSourceStatic = "Static" +) diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/ec2/customizations.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/ec2/customizations.go index f080166e03a6..99f0820477ee 100644 --- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/ec2/customizations.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/ec2/customizations.go @@ -3,19 +3,19 @@ package ec2 import ( "time" - "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awsutil" + "github.com/aws/aws-sdk-go/aws/request" ) func init() { - initRequest = func(r *aws.Request) { - if r.Operation == opCopySnapshot { // fill the PresignedURL parameter + initRequest = func(r *request.Request) { + if r.Operation.Name == opCopySnapshot { // fill the PresignedURL parameter r.Handlers.Build.PushFront(fillPresignedURL) } } } -func fillPresignedURL(r *aws.Request) { +func fillPresignedURL(r *request.Request) { if !r.ParamsFilled() { return } @@ -23,7 +23,7 @@ func fillPresignedURL(r *aws.Request) { params := r.Params.(*CopySnapshotInput) // Stop if PresignedURL/DestinationRegion is set - if params.PresignedURL != nil || params.DestinationRegion != nil { + if params.PresignedUrl != nil || params.DestinationRegion != nil { return } @@ -33,16 +33,16 @@ func fillPresignedURL(r *aws.Request) { // Set destination region. Avoids infinite handler loop. // Also needed to sign sub-request. - params.DestinationRegion = &r.Service.Config.Region + params.DestinationRegion = r.Service.Config.Region // Create a new client pointing at source region. // We will use this to presign the CopySnapshot request against // the source region - config := r.Service.Config.Copy() + config := r.Service.Config.Copy(). + WithEndpoint(""). + WithRegion(*params.SourceRegion) - config.Endpoint = "" - config.Region = *params.SourceRegion - client := New(&config) + client := New(config) // Presign a CopySnapshot request with modified params req, _ := client.CopySnapshotRequest(params) @@ -53,5 +53,5 @@ func fillPresignedURL(r *aws.Request) { } // We have our URL, set it on params - params.PresignedURL = &url + params.PresignedUrl = &url } diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/ec2/customizations_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/ec2/customizations_test.go index 24956345a238..38617b1ffeee 100644 --- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/ec2/customizations_test.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/ec2/customizations_test.go @@ -14,7 +14,7 @@ import ( var _ = unit.Imported func TestCopySnapshotPresignedURL(t *testing.T) { - svc := ec2.New(&aws.Config{Region: "us-west-2"}) + svc := ec2.New(&aws.Config{Region: aws.String("us-west-2")}) assert.NotPanics(t, func() { // Doesn't panic on nil input @@ -24,7 +24,7 @@ func TestCopySnapshotPresignedURL(t *testing.T) { req, _ := svc.CopySnapshotRequest(&ec2.CopySnapshotInput{ SourceRegion: aws.String("us-west-1"), - SourceSnapshotID: aws.String("snap-id"), + SourceSnapshotId: aws.String("snap-id"), }) req.Sign() diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/ec2/ec2iface/interface.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/ec2/ec2iface/interface.go index aa2b112c5a70..e10a2aa1f8b5 100644 --- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/ec2/ec2iface/interface.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/ec2/ec2iface/interface.go @@ -4,366 +4,753 @@ 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 { - AcceptVPCPeeringConnection(*ec2.AcceptVPCPeeringConnectionInput) (*ec2.AcceptVPCPeeringConnectionOutput, error) + 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) - AssignPrivateIPAddresses(*ec2.AssignPrivateIPAddressesInput) (*ec2.AssignPrivateIPAddressesOutput, 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) - AssociateDHCPOptions(*ec2.AssociateDHCPOptionsInput) (*ec2.AssociateDHCPOptionsOutput, 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) - AttachClassicLinkVPC(*ec2.AttachClassicLinkVPCInput) (*ec2.AttachClassicLinkVPCOutput, 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) - AttachVPNGateway(*ec2.AttachVPNGatewayInput) (*ec2.AttachVPNGatewayOutput, 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) - CreateDHCPOptions(*ec2.CreateDHCPOptionsInput) (*ec2.CreateDHCPOptionsOutput, 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) - CreateNetworkACL(*ec2.CreateNetworkACLInput) (*ec2.CreateNetworkACLOutput, error) + CreateNetworkAclRequest(*ec2.CreateNetworkAclInput) (*request.Request, *ec2.CreateNetworkAclOutput) + + CreateNetworkAcl(*ec2.CreateNetworkAclInput) (*ec2.CreateNetworkAclOutput, error) - CreateNetworkACLEntry(*ec2.CreateNetworkACLEntryInput) (*ec2.CreateNetworkACLEntryOutput, 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) - CreateVPC(*ec2.CreateVPCInput) (*ec2.CreateVPCOutput, error) + CreateVolumeRequest(*ec2.CreateVolumeInput) (*request.Request, *ec2.Volume) - CreateVPCEndpoint(*ec2.CreateVPCEndpointInput) (*ec2.CreateVPCEndpointOutput, error) + CreateVolume(*ec2.CreateVolumeInput) (*ec2.Volume, error) - CreateVPCPeeringConnection(*ec2.CreateVPCPeeringConnectionInput) (*ec2.CreateVPCPeeringConnectionOutput, error) + CreateVpcRequest(*ec2.CreateVpcInput) (*request.Request, *ec2.CreateVpcOutput) - CreateVPNConnection(*ec2.CreateVPNConnectionInput) (*ec2.CreateVPNConnectionOutput, error) + CreateVpc(*ec2.CreateVpcInput) (*ec2.CreateVpcOutput, error) - CreateVPNConnectionRoute(*ec2.CreateVPNConnectionRouteInput) (*ec2.CreateVPNConnectionRouteOutput, error) + CreateVpcEndpointRequest(*ec2.CreateVpcEndpointInput) (*request.Request, *ec2.CreateVpcEndpointOutput) - CreateVPNGateway(*ec2.CreateVPNGatewayInput) (*ec2.CreateVPNGatewayOutput, error) + CreateVpcEndpoint(*ec2.CreateVpcEndpointInput) (*ec2.CreateVpcEndpointOutput, error) - CreateVolume(*ec2.CreateVolumeInput) (*ec2.Volume, 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) - DeleteDHCPOptions(*ec2.DeleteDHCPOptionsInput) (*ec2.DeleteDHCPOptionsOutput, 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) - DeleteNetworkACL(*ec2.DeleteNetworkACLInput) (*ec2.DeleteNetworkACLOutput, error) + DeleteNetworkAclRequest(*ec2.DeleteNetworkAclInput) (*request.Request, *ec2.DeleteNetworkAclOutput) - DeleteNetworkACLEntry(*ec2.DeleteNetworkACLEntryInput) (*ec2.DeleteNetworkACLEntryOutput, error) + 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) - DeleteVPC(*ec2.DeleteVPCInput) (*ec2.DeleteVPCOutput, error) + DeleteVolumeRequest(*ec2.DeleteVolumeInput) (*request.Request, *ec2.DeleteVolumeOutput) - DeleteVPCEndpoints(*ec2.DeleteVPCEndpointsInput) (*ec2.DeleteVPCEndpointsOutput, error) + DeleteVolume(*ec2.DeleteVolumeInput) (*ec2.DeleteVolumeOutput, error) - DeleteVPCPeeringConnection(*ec2.DeleteVPCPeeringConnectionInput) (*ec2.DeleteVPCPeeringConnectionOutput, error) + DeleteVpcRequest(*ec2.DeleteVpcInput) (*request.Request, *ec2.DeleteVpcOutput) - DeleteVPNConnection(*ec2.DeleteVPNConnectionInput) (*ec2.DeleteVPNConnectionOutput, error) + DeleteVpc(*ec2.DeleteVpcInput) (*ec2.DeleteVpcOutput, error) - DeleteVPNConnectionRoute(*ec2.DeleteVPNConnectionRouteInput) (*ec2.DeleteVPNConnectionRouteOutput, error) + DeleteVpcEndpointsRequest(*ec2.DeleteVpcEndpointsInput) (*request.Request, *ec2.DeleteVpcEndpointsOutput) - DeleteVPNGateway(*ec2.DeleteVPNGatewayInput) (*ec2.DeleteVPNGatewayOutput, error) + DeleteVpcEndpoints(*ec2.DeleteVpcEndpointsInput) (*ec2.DeleteVpcEndpointsOutput, error) - DeleteVolume(*ec2.DeleteVolumeInput) (*ec2.DeleteVolumeOutput, 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) - DescribeDHCPOptions(*ec2.DescribeDHCPOptionsInput) (*ec2.DescribeDHCPOptionsOutput, 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) + + 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) - DescribeNetworkACLs(*ec2.DescribeNetworkACLsInput) (*ec2.DescribeNetworkACLsOutput, 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) - DescribeVPCAttribute(*ec2.DescribeVPCAttributeInput) (*ec2.DescribeVPCAttributeOutput, error) + DescribeVolumeAttributeRequest(*ec2.DescribeVolumeAttributeInput) (*request.Request, *ec2.DescribeVolumeAttributeOutput) - DescribeVPCClassicLink(*ec2.DescribeVPCClassicLinkInput) (*ec2.DescribeVPCClassicLinkOutput, error) + DescribeVolumeAttribute(*ec2.DescribeVolumeAttributeInput) (*ec2.DescribeVolumeAttributeOutput, error) - DescribeVPCEndpointServices(*ec2.DescribeVPCEndpointServicesInput) (*ec2.DescribeVPCEndpointServicesOutput, error) + DescribeVolumeStatusRequest(*ec2.DescribeVolumeStatusInput) (*request.Request, *ec2.DescribeVolumeStatusOutput) - DescribeVPCEndpoints(*ec2.DescribeVPCEndpointsInput) (*ec2.DescribeVPCEndpointsOutput, error) + DescribeVolumeStatus(*ec2.DescribeVolumeStatusInput) (*ec2.DescribeVolumeStatusOutput, error) - DescribeVPCPeeringConnections(*ec2.DescribeVPCPeeringConnectionsInput) (*ec2.DescribeVPCPeeringConnectionsOutput, error) + DescribeVolumeStatusPages(*ec2.DescribeVolumeStatusInput, func(*ec2.DescribeVolumeStatusOutput, bool) bool) error - DescribeVPCs(*ec2.DescribeVPCsInput) (*ec2.DescribeVPCsOutput, error) + DescribeVolumesRequest(*ec2.DescribeVolumesInput) (*request.Request, *ec2.DescribeVolumesOutput) - DescribeVPNConnections(*ec2.DescribeVPNConnectionsInput) (*ec2.DescribeVPNConnectionsOutput, error) + DescribeVolumes(*ec2.DescribeVolumesInput) (*ec2.DescribeVolumesOutput, error) - DescribeVPNGateways(*ec2.DescribeVPNGatewaysInput) (*ec2.DescribeVPNGatewaysOutput, error) + DescribeVolumesPages(*ec2.DescribeVolumesInput, func(*ec2.DescribeVolumesOutput, bool) bool) error - DescribeVolumeAttribute(*ec2.DescribeVolumeAttributeInput) (*ec2.DescribeVolumeAttributeOutput, error) + DescribeVpcAttributeRequest(*ec2.DescribeVpcAttributeInput) (*request.Request, *ec2.DescribeVpcAttributeOutput) - DescribeVolumeStatus(*ec2.DescribeVolumeStatusInput) (*ec2.DescribeVolumeStatusOutput, error) + DescribeVpcAttribute(*ec2.DescribeVpcAttributeInput) (*ec2.DescribeVpcAttributeOutput, error) - DescribeVolumes(*ec2.DescribeVolumesInput) (*ec2.DescribeVolumesOutput, 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) - DetachClassicLinkVPC(*ec2.DetachClassicLinkVPCInput) (*ec2.DetachClassicLinkVPCOutput, 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) - DetachVPNGateway(*ec2.DetachVPNGatewayInput) (*ec2.DetachVPNGatewayOutput, error) + DetachVolumeRequest(*ec2.DetachVolumeInput) (*request.Request, *ec2.VolumeAttachment) DetachVolume(*ec2.DetachVolumeInput) (*ec2.VolumeAttachment, error) - DisableVGWRoutePropagation(*ec2.DisableVGWRoutePropagationInput) (*ec2.DisableVGWRoutePropagationOutput, 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) - DisableVPCClassicLink(*ec2.DisableVPCClassicLinkInput) (*ec2.DisableVPCClassicLinkOutput, 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) - EnableVGWRoutePropagation(*ec2.EnableVGWRoutePropagationInput) (*ec2.EnableVGWRoutePropagationOutput, error) + EnableVgwRoutePropagationRequest(*ec2.EnableVgwRoutePropagationInput) (*request.Request, *ec2.EnableVgwRoutePropagationOutput) + + EnableVgwRoutePropagation(*ec2.EnableVgwRoutePropagationInput) (*ec2.EnableVgwRoutePropagationOutput, error) - EnableVPCClassicLink(*ec2.EnableVPCClassicLinkInput) (*ec2.EnableVPCClassicLinkOutput, 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) + 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) + 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) - ModifySubnetAttribute(*ec2.ModifySubnetAttributeInput) (*ec2.ModifySubnetAttributeOutput, error) + ModifySubnetAttributeRequest(*ec2.ModifySubnetAttributeInput) (*request.Request, *ec2.ModifySubnetAttributeOutput) - ModifyVPCAttribute(*ec2.ModifyVPCAttributeInput) (*ec2.ModifyVPCAttributeOutput, error) + ModifySubnetAttribute(*ec2.ModifySubnetAttributeInput) (*ec2.ModifySubnetAttributeOutput, error) - ModifyVPCEndpoint(*ec2.ModifyVPCEndpointInput) (*ec2.ModifyVPCEndpointOutput, 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) - MoveAddressToVPC(*ec2.MoveAddressToVPCInput) (*ec2.MoveAddressToVPCOutput, 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) - RejectVPCPeeringConnection(*ec2.RejectVPCPeeringConnectionInput) (*ec2.RejectVPCPeeringConnectionOutput, 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) - ReplaceNetworkACLAssociation(*ec2.ReplaceNetworkACLAssociationInput) (*ec2.ReplaceNetworkACLAssociationOutput, 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) + 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) - UnassignPrivateIPAddresses(*ec2.UnassignPrivateIPAddressesInput) (*ec2.UnassignPrivateIPAddressesOutput, 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) } diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/ec2/examples_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/ec2/examples_test.go index 76b63320285e..6da3b190cc21 100644 --- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/ec2/examples_test.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/ec2/examples_test.go @@ -8,40 +8,30 @@ import ( "time" "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/aws/awsutil" "github.com/aws/aws-sdk-go/service/ec2" ) var _ time.Duration var _ bytes.Buffer -func ExampleEC2_AcceptVPCPeeringConnection() { +func ExampleEC2_AcceptVpcPeeringConnection() { svc := ec2.New(nil) - params := &ec2.AcceptVPCPeeringConnectionInput{ - DryRun: aws.Boolean(true), - VPCPeeringConnectionID: aws.String("String"), + params := &ec2.AcceptVpcPeeringConnectionInput{ + DryRun: aws.Bool(true), + VpcPeeringConnectionId: aws.String("String"), } - resp, err := svc.AcceptVPCPeeringConnection(params) + resp, err := svc.AcceptVpcPeeringConnection(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_AllocateAddress() { @@ -49,548 +39,420 @@ func ExampleEC2_AllocateAddress() { params := &ec2.AllocateAddressInput{ Domain: aws.String("DomainType"), - DryRun: aws.Boolean(true), + DryRun: aws.Bool(true), } resp, err := svc.AllocateAddress(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } -func ExampleEC2_AssignPrivateIPAddresses() { +func ExampleEC2_AssignPrivateIpAddresses() { svc := ec2.New(nil) - params := &ec2.AssignPrivateIPAddressesInput{ - NetworkInterfaceID: aws.String("String"), // Required - AllowReassignment: aws.Boolean(true), - PrivateIPAddresses: []*string{ + params := &ec2.AssignPrivateIpAddressesInput{ + NetworkInterfaceId: aws.String("String"), // Required + AllowReassignment: aws.Bool(true), + PrivateIpAddresses: []*string{ aws.String("String"), // Required // More values... }, - SecondaryPrivateIPAddressCount: aws.Long(1), + SecondaryPrivateIpAddressCount: aws.Int64(1), } - resp, err := svc.AssignPrivateIPAddresses(params) + resp, err := svc.AssignPrivateIpAddresses(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_AssociateAddress() { svc := ec2.New(nil) params := &ec2.AssociateAddressInput{ - AllocationID: aws.String("String"), - AllowReassociation: aws.Boolean(true), - DryRun: aws.Boolean(true), - InstanceID: aws.String("String"), - NetworkInterfaceID: aws.String("String"), - PrivateIPAddress: aws.String("String"), - PublicIP: aws.String("String"), + AllocationId: aws.String("String"), + AllowReassociation: aws.Bool(true), + DryRun: aws.Bool(true), + InstanceId: aws.String("String"), + NetworkInterfaceId: aws.String("String"), + PrivateIpAddress: aws.String("String"), + PublicIp: aws.String("String"), } resp, err := svc.AssociateAddress(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } -func ExampleEC2_AssociateDHCPOptions() { +func ExampleEC2_AssociateDhcpOptions() { svc := ec2.New(nil) - params := &ec2.AssociateDHCPOptionsInput{ - DHCPOptionsID: aws.String("String"), // Required - VPCID: aws.String("String"), // Required - DryRun: aws.Boolean(true), + params := &ec2.AssociateDhcpOptionsInput{ + DhcpOptionsId: aws.String("String"), // Required + VpcId: aws.String("String"), // Required + DryRun: aws.Bool(true), } - resp, err := svc.AssociateDHCPOptions(params) + resp, err := svc.AssociateDhcpOptions(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_AssociateRouteTable() { svc := ec2.New(nil) params := &ec2.AssociateRouteTableInput{ - RouteTableID: aws.String("String"), // Required - SubnetID: aws.String("String"), // Required - DryRun: aws.Boolean(true), + RouteTableId: aws.String("String"), // Required + SubnetId: aws.String("String"), // Required + DryRun: aws.Bool(true), } resp, err := svc.AssociateRouteTable(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } -func ExampleEC2_AttachClassicLinkVPC() { +func ExampleEC2_AttachClassicLinkVpc() { svc := ec2.New(nil) - params := &ec2.AttachClassicLinkVPCInput{ + params := &ec2.AttachClassicLinkVpcInput{ Groups: []*string{ // Required aws.String("String"), // Required // More values... }, - InstanceID: aws.String("String"), // Required - VPCID: aws.String("String"), // Required - DryRun: aws.Boolean(true), + InstanceId: aws.String("String"), // Required + VpcId: aws.String("String"), // Required + DryRun: aws.Bool(true), } - resp, err := svc.AttachClassicLinkVPC(params) + resp, err := svc.AttachClassicLinkVpc(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_AttachInternetGateway() { svc := ec2.New(nil) params := &ec2.AttachInternetGatewayInput{ - InternetGatewayID: aws.String("String"), // Required - VPCID: aws.String("String"), // Required - DryRun: aws.Boolean(true), + InternetGatewayId: aws.String("String"), // Required + VpcId: aws.String("String"), // Required + DryRun: aws.Bool(true), } resp, err := svc.AttachInternetGateway(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_AttachNetworkInterface() { svc := ec2.New(nil) params := &ec2.AttachNetworkInterfaceInput{ - DeviceIndex: aws.Long(1), // Required - InstanceID: aws.String("String"), // Required - NetworkInterfaceID: aws.String("String"), // Required - DryRun: aws.Boolean(true), + DeviceIndex: aws.Int64(1), // Required + InstanceId: aws.String("String"), // Required + NetworkInterfaceId: aws.String("String"), // Required + DryRun: aws.Bool(true), } resp, err := svc.AttachNetworkInterface(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } -func ExampleEC2_AttachVPNGateway() { +func ExampleEC2_AttachVolume() { svc := ec2.New(nil) - params := &ec2.AttachVPNGatewayInput{ - VPCID: aws.String("String"), // Required - VPNGatewayID: aws.String("String"), // Required - DryRun: aws.Boolean(true), + params := &ec2.AttachVolumeInput{ + Device: aws.String("String"), // Required + InstanceId: aws.String("String"), // Required + VolumeId: aws.String("String"), // Required + DryRun: aws.Bool(true), } - resp, err := svc.AttachVPNGateway(params) + resp, err := svc.AttachVolume(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } -func ExampleEC2_AttachVolume() { +func ExampleEC2_AttachVpnGateway() { svc := ec2.New(nil) - params := &ec2.AttachVolumeInput{ - Device: aws.String("String"), // Required - InstanceID: aws.String("String"), // Required - VolumeID: aws.String("String"), // Required - DryRun: aws.Boolean(true), + params := &ec2.AttachVpnGatewayInput{ + VpcId: aws.String("String"), // Required + VpnGatewayId: aws.String("String"), // Required + DryRun: aws.Bool(true), } - resp, err := svc.AttachVolume(params) + resp, err := svc.AttachVpnGateway(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_AuthorizeSecurityGroupEgress() { svc := ec2.New(nil) params := &ec2.AuthorizeSecurityGroupEgressInput{ - GroupID: aws.String("String"), // Required - CIDRIP: aws.String("String"), - DryRun: aws.Boolean(true), - FromPort: aws.Long(1), - IPPermissions: []*ec2.IPPermission{ - &ec2.IPPermission{ // Required - FromPort: aws.Long(1), - IPProtocol: aws.String("String"), - IPRanges: []*ec2.IPRange{ - &ec2.IPRange{ // Required - CIDRIP: aws.String("String"), + GroupId: aws.String("String"), // Required + CidrIp: aws.String("String"), + DryRun: aws.Bool(true), + FromPort: aws.Int64(1), + IpPermissions: []*ec2.IpPermission{ + { // Required + FromPort: aws.Int64(1), + IpProtocol: aws.String("String"), + IpRanges: []*ec2.IpRange{ + { // Required + CidrIp: aws.String("String"), }, // More values... }, - PrefixListIDs: []*ec2.PrefixListID{ - &ec2.PrefixListID{ // Required - PrefixListID: aws.String("String"), + PrefixListIds: []*ec2.PrefixListId{ + { // Required + PrefixListId: aws.String("String"), }, // More values... }, - ToPort: aws.Long(1), - UserIDGroupPairs: []*ec2.UserIDGroupPair{ - &ec2.UserIDGroupPair{ // Required - GroupID: aws.String("String"), + ToPort: aws.Int64(1), + UserIdGroupPairs: []*ec2.UserIdGroupPair{ + { // Required + GroupId: aws.String("String"), GroupName: aws.String("String"), - UserID: aws.String("String"), + UserId: aws.String("String"), }, // More values... }, }, // More values... }, - IPProtocol: aws.String("String"), + IpProtocol: aws.String("String"), SourceSecurityGroupName: aws.String("String"), - SourceSecurityGroupOwnerID: aws.String("String"), - ToPort: aws.Long(1), + SourceSecurityGroupOwnerId: aws.String("String"), + ToPort: aws.Int64(1), } resp, err := svc.AuthorizeSecurityGroupEgress(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_AuthorizeSecurityGroupIngress() { svc := ec2.New(nil) params := &ec2.AuthorizeSecurityGroupIngressInput{ - CIDRIP: aws.String("String"), - DryRun: aws.Boolean(true), - FromPort: aws.Long(1), - GroupID: aws.String("String"), + CidrIp: aws.String("String"), + DryRun: aws.Bool(true), + FromPort: aws.Int64(1), + GroupId: aws.String("String"), GroupName: aws.String("String"), - IPPermissions: []*ec2.IPPermission{ - &ec2.IPPermission{ // Required - FromPort: aws.Long(1), - IPProtocol: aws.String("String"), - IPRanges: []*ec2.IPRange{ - &ec2.IPRange{ // Required - CIDRIP: aws.String("String"), + IpPermissions: []*ec2.IpPermission{ + { // Required + FromPort: aws.Int64(1), + IpProtocol: aws.String("String"), + IpRanges: []*ec2.IpRange{ + { // Required + CidrIp: aws.String("String"), }, // More values... }, - PrefixListIDs: []*ec2.PrefixListID{ - &ec2.PrefixListID{ // Required - PrefixListID: aws.String("String"), + PrefixListIds: []*ec2.PrefixListId{ + { // Required + PrefixListId: aws.String("String"), }, // More values... }, - ToPort: aws.Long(1), - UserIDGroupPairs: []*ec2.UserIDGroupPair{ - &ec2.UserIDGroupPair{ // Required - GroupID: aws.String("String"), + ToPort: aws.Int64(1), + UserIdGroupPairs: []*ec2.UserIdGroupPair{ + { // Required + GroupId: aws.String("String"), GroupName: aws.String("String"), - UserID: aws.String("String"), + UserId: aws.String("String"), }, // More values... }, }, // More values... }, - IPProtocol: aws.String("String"), + IpProtocol: aws.String("String"), SourceSecurityGroupName: aws.String("String"), - SourceSecurityGroupOwnerID: aws.String("String"), - ToPort: aws.Long(1), + SourceSecurityGroupOwnerId: aws.String("String"), + ToPort: aws.Int64(1), } resp, err := svc.AuthorizeSecurityGroupIngress(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_BundleInstance() { svc := ec2.New(nil) params := &ec2.BundleInstanceInput{ - InstanceID: aws.String("String"), // Required + InstanceId: aws.String("String"), // Required Storage: &ec2.Storage{ // Required S3: &ec2.S3Storage{ - AWSAccessKeyID: aws.String("String"), + AWSAccessKeyId: aws.String("String"), Bucket: aws.String("String"), Prefix: aws.String("String"), UploadPolicy: []byte("PAYLOAD"), UploadPolicySignature: aws.String("String"), }, }, - DryRun: aws.Boolean(true), + DryRun: aws.Bool(true), } resp, err := svc.BundleInstance(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_CancelBundleTask() { svc := ec2.New(nil) params := &ec2.CancelBundleTaskInput{ - BundleID: aws.String("String"), // Required - DryRun: aws.Boolean(true), + BundleId: aws.String("String"), // Required + DryRun: aws.Bool(true), } resp, err := svc.CancelBundleTask(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_CancelConversionTask() { svc := ec2.New(nil) params := &ec2.CancelConversionTaskInput{ - ConversionTaskID: aws.String("String"), // Required - DryRun: aws.Boolean(true), + ConversionTaskId: aws.String("String"), // Required + DryRun: aws.Bool(true), ReasonMessage: aws.String("String"), } resp, err := svc.CancelConversionTask(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_CancelExportTask() { svc := ec2.New(nil) params := &ec2.CancelExportTaskInput{ - ExportTaskID: aws.String("String"), // Required + ExportTaskId: aws.String("String"), // Required } resp, err := svc.CancelExportTask(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_CancelImportTask() { @@ -598,147 +460,107 @@ func ExampleEC2_CancelImportTask() { params := &ec2.CancelImportTaskInput{ CancelReason: aws.String("String"), - DryRun: aws.Boolean(true), - ImportTaskID: aws.String("String"), + DryRun: aws.Bool(true), + ImportTaskId: aws.String("String"), } resp, err := svc.CancelImportTask(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_CancelReservedInstancesListing() { svc := ec2.New(nil) params := &ec2.CancelReservedInstancesListingInput{ - ReservedInstancesListingID: aws.String("String"), // Required + ReservedInstancesListingId: aws.String("String"), // Required } resp, err := svc.CancelReservedInstancesListing(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_CancelSpotFleetRequests() { svc := ec2.New(nil) params := &ec2.CancelSpotFleetRequestsInput{ - SpotFleetRequestIDs: []*string{ // Required + SpotFleetRequestIds: []*string{ // Required aws.String("String"), // Required // More values... }, - TerminateInstances: aws.Boolean(true), // Required - DryRun: aws.Boolean(true), + TerminateInstances: aws.Bool(true), // Required + DryRun: aws.Bool(true), } resp, err := svc.CancelSpotFleetRequests(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_CancelSpotInstanceRequests() { svc := ec2.New(nil) params := &ec2.CancelSpotInstanceRequestsInput{ - SpotInstanceRequestIDs: []*string{ // Required + SpotInstanceRequestIds: []*string{ // Required aws.String("String"), // Required // More values... }, - DryRun: aws.Boolean(true), + DryRun: aws.Bool(true), } resp, err := svc.CancelSpotInstanceRequests(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_ConfirmProductInstance() { svc := ec2.New(nil) params := &ec2.ConfirmProductInstanceInput{ - InstanceID: aws.String("String"), // Required + InstanceId: aws.String("String"), // Required ProductCode: aws.String("String"), // Required - DryRun: aws.Boolean(true), + DryRun: aws.Bool(true), } resp, err := svc.ConfirmProductInstance(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_CopyImage() { @@ -746,31 +568,23 @@ func ExampleEC2_CopyImage() { params := &ec2.CopyImageInput{ Name: aws.String("String"), // Required - SourceImageID: aws.String("String"), // Required + SourceImageId: aws.String("String"), // Required SourceRegion: aws.String("String"), // Required ClientToken: aws.String("String"), Description: aws.String("String"), - DryRun: aws.Boolean(true), + DryRun: aws.Bool(true), } resp, err := svc.CopyImage(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_CopySnapshot() { @@ -778,69 +592,55 @@ func ExampleEC2_CopySnapshot() { params := &ec2.CopySnapshotInput{ SourceRegion: aws.String("String"), // Required - SourceSnapshotID: aws.String("String"), // Required + SourceSnapshotId: aws.String("String"), // Required Description: aws.String("String"), DestinationRegion: aws.String("String"), - DryRun: aws.Boolean(true), - PresignedURL: aws.String("String"), + DryRun: aws.Bool(true), + Encrypted: aws.Bool(true), + KmsKeyId: aws.String("String"), + PresignedUrl: aws.String("String"), } resp, err := svc.CopySnapshot(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_CreateCustomerGateway() { svc := ec2.New(nil) params := &ec2.CreateCustomerGatewayInput{ - BGPASN: aws.Long(1), // Required - PublicIP: aws.String("String"), // Required + BgpAsn: aws.Int64(1), // Required + PublicIp: aws.String("String"), // Required Type: aws.String("GatewayType"), // Required - DryRun: aws.Boolean(true), + DryRun: aws.Bool(true), } resp, err := svc.CreateCustomerGateway(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } -func ExampleEC2_CreateDHCPOptions() { +func ExampleEC2_CreateDhcpOptions() { svc := ec2.New(nil) - params := &ec2.CreateDHCPOptionsInput{ - DHCPConfigurations: []*ec2.NewDHCPConfiguration{ // Required - &ec2.NewDHCPConfiguration{ // Required + params := &ec2.CreateDhcpOptionsInput{ + DhcpConfigurations: []*ec2.NewDhcpConfiguration{ // Required + { // Required Key: aws.String("String"), Values: []*string{ aws.String("String"), // Required @@ -849,44 +649,63 @@ func ExampleEC2_CreateDHCPOptions() { }, // More values... }, - DryRun: aws.Boolean(true), + DryRun: aws.Bool(true), + } + resp, err := svc.CreateDhcpOptions(params) + + if err != nil { + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return + } + + // Pretty-print the response data. + fmt.Println(resp) +} + +func ExampleEC2_CreateFlowLogs() { + svc := ec2.New(nil) + + params := &ec2.CreateFlowLogsInput{ + DeliverLogsPermissionArn: aws.String("String"), // Required + LogGroupName: aws.String("String"), // Required + ResourceIds: []*string{ // Required + aws.String("String"), // Required + // More values... + }, + ResourceType: aws.String("FlowLogsResourceType"), // Required + TrafficType: aws.String("TrafficType"), // Required + ClientToken: aws.String("String"), } - resp, err := svc.CreateDHCPOptions(params) + resp, err := svc.CreateFlowLogs(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_CreateImage() { svc := ec2.New(nil) params := &ec2.CreateImageInput{ - InstanceID: aws.String("String"), // Required + InstanceId: aws.String("String"), // Required Name: aws.String("String"), // Required BlockDeviceMappings: []*ec2.BlockDeviceMapping{ - &ec2.BlockDeviceMapping{ // Required + { // Required DeviceName: aws.String("String"), - EBS: &ec2.EBSBlockDevice{ - DeleteOnTermination: aws.Boolean(true), - Encrypted: aws.Boolean(true), - IOPS: aws.Long(1), - SnapshotID: aws.String("String"), - VolumeSize: aws.Long(1), + Ebs: &ec2.EbsBlockDevice{ + DeleteOnTermination: aws.Bool(true), + Encrypted: aws.Bool(true), + Iops: aws.Int64(1), + SnapshotId: aws.String("String"), + VolumeSize: aws.Int64(1), VolumeType: aws.String("VolumeType"), }, NoDevice: aws.String("String"), @@ -895,35 +714,27 @@ func ExampleEC2_CreateImage() { // More values... }, Description: aws.String("String"), - DryRun: aws.Boolean(true), - NoReboot: aws.Boolean(true), + DryRun: aws.Bool(true), + NoReboot: aws.Bool(true), } resp, err := svc.CreateImage(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_CreateInstanceExportTask() { svc := ec2.New(nil) params := &ec2.CreateInstanceExportTaskInput{ - InstanceID: aws.String("String"), // Required + InstanceId: aws.String("String"), // Required Description: aws.String("String"), ExportToS3Task: &ec2.ExportToS3TaskSpecification{ ContainerFormat: aws.String("ContainerFormat"), @@ -936,49 +747,33 @@ func ExampleEC2_CreateInstanceExportTask() { resp, err := svc.CreateInstanceExportTask(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_CreateInternetGateway() { svc := ec2.New(nil) params := &ec2.CreateInternetGatewayInput{ - DryRun: aws.Boolean(true), + DryRun: aws.Bool(true), } resp, err := svc.CreateInternetGateway(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_CreateKeyPair() { @@ -986,138 +781,106 @@ func ExampleEC2_CreateKeyPair() { params := &ec2.CreateKeyPairInput{ KeyName: aws.String("String"), // Required - DryRun: aws.Boolean(true), + DryRun: aws.Bool(true), } resp, err := svc.CreateKeyPair(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } -func ExampleEC2_CreateNetworkACL() { +func ExampleEC2_CreateNetworkAcl() { svc := ec2.New(nil) - params := &ec2.CreateNetworkACLInput{ - VPCID: aws.String("String"), // Required - DryRun: aws.Boolean(true), + params := &ec2.CreateNetworkAclInput{ + VpcId: aws.String("String"), // Required + DryRun: aws.Bool(true), } - resp, err := svc.CreateNetworkACL(params) + resp, err := svc.CreateNetworkAcl(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } -func ExampleEC2_CreateNetworkACLEntry() { +func ExampleEC2_CreateNetworkAclEntry() { svc := ec2.New(nil) - params := &ec2.CreateNetworkACLEntryInput{ - CIDRBlock: aws.String("String"), // Required - Egress: aws.Boolean(true), // Required - NetworkACLID: aws.String("String"), // Required + params := &ec2.CreateNetworkAclEntryInput{ + CidrBlock: aws.String("String"), // Required + Egress: aws.Bool(true), // Required + NetworkAclId: aws.String("String"), // Required Protocol: aws.String("String"), // Required RuleAction: aws.String("RuleAction"), // Required - RuleNumber: aws.Long(1), // Required - DryRun: aws.Boolean(true), - ICMPTypeCode: &ec2.ICMPTypeCode{ - Code: aws.Long(1), - Type: aws.Long(1), + RuleNumber: aws.Int64(1), // Required + DryRun: aws.Bool(true), + IcmpTypeCode: &ec2.IcmpTypeCode{ + Code: aws.Int64(1), + Type: aws.Int64(1), }, PortRange: &ec2.PortRange{ - From: aws.Long(1), - To: aws.Long(1), + From: aws.Int64(1), + To: aws.Int64(1), }, } - resp, err := svc.CreateNetworkACLEntry(params) + resp, err := svc.CreateNetworkAclEntry(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_CreateNetworkInterface() { svc := ec2.New(nil) params := &ec2.CreateNetworkInterfaceInput{ - SubnetID: aws.String("String"), // Required + SubnetId: aws.String("String"), // Required Description: aws.String("String"), - DryRun: aws.Boolean(true), + DryRun: aws.Bool(true), Groups: []*string{ aws.String("String"), // Required // More values... }, - PrivateIPAddress: aws.String("String"), - PrivateIPAddresses: []*ec2.PrivateIPAddressSpecification{ - &ec2.PrivateIPAddressSpecification{ // Required - PrivateIPAddress: aws.String("String"), // Required - Primary: aws.Boolean(true), + PrivateIpAddress: aws.String("String"), + PrivateIpAddresses: []*ec2.PrivateIpAddressSpecification{ + { // Required + PrivateIpAddress: aws.String("String"), // Required + Primary: aws.Bool(true), }, // More values... }, - SecondaryPrivateIPAddressCount: aws.Long(1), + SecondaryPrivateIpAddressCount: aws.Int64(1), } resp, err := svc.CreateNetworkInterface(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_CreatePlacementGroup() { @@ -1126,27 +889,19 @@ func ExampleEC2_CreatePlacementGroup() { params := &ec2.CreatePlacementGroupInput{ GroupName: aws.String("String"), // Required Strategy: aws.String("PlacementStrategy"), // Required - DryRun: aws.Boolean(true), + DryRun: aws.Bool(true), } resp, err := svc.CreatePlacementGroup(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_CreateReservedInstancesListing() { @@ -1154,98 +909,73 @@ func ExampleEC2_CreateReservedInstancesListing() { params := &ec2.CreateReservedInstancesListingInput{ ClientToken: aws.String("String"), // Required - InstanceCount: aws.Long(1), // Required + InstanceCount: aws.Int64(1), // Required PriceSchedules: []*ec2.PriceScheduleSpecification{ // Required - &ec2.PriceScheduleSpecification{ // Required + { // Required CurrencyCode: aws.String("CurrencyCodeValues"), - Price: aws.Double(1.0), - Term: aws.Long(1), + Price: aws.Float64(1.0), + Term: aws.Int64(1), }, // More values... }, - ReservedInstancesID: aws.String("String"), // Required + ReservedInstancesId: aws.String("String"), // Required } resp, err := svc.CreateReservedInstancesListing(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_CreateRoute() { svc := ec2.New(nil) params := &ec2.CreateRouteInput{ - DestinationCIDRBlock: aws.String("String"), // Required - RouteTableID: aws.String("String"), // Required - ClientToken: aws.String("String"), - DryRun: aws.Boolean(true), - GatewayID: aws.String("String"), - InstanceID: aws.String("String"), - NetworkInterfaceID: aws.String("String"), - VPCPeeringConnectionID: aws.String("String"), + DestinationCidrBlock: aws.String("String"), // Required + RouteTableId: aws.String("String"), // Required + DryRun: aws.Bool(true), + GatewayId: aws.String("String"), + InstanceId: aws.String("String"), + NetworkInterfaceId: aws.String("String"), + VpcPeeringConnectionId: aws.String("String"), } resp, err := svc.CreateRoute(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_CreateRouteTable() { svc := ec2.New(nil) params := &ec2.CreateRouteTableInput{ - VPCID: aws.String("String"), // Required - DryRun: aws.Boolean(true), + VpcId: aws.String("String"), // Required + DryRun: aws.Bool(true), } resp, err := svc.CreateRouteTable(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_CreateSecurityGroup() { @@ -1254,57 +984,41 @@ func ExampleEC2_CreateSecurityGroup() { params := &ec2.CreateSecurityGroupInput{ Description: aws.String("String"), // Required GroupName: aws.String("String"), // Required - DryRun: aws.Boolean(true), - VPCID: aws.String("String"), + DryRun: aws.Bool(true), + VpcId: aws.String("String"), } resp, err := svc.CreateSecurityGroup(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_CreateSnapshot() { svc := ec2.New(nil) params := &ec2.CreateSnapshotInput{ - VolumeID: aws.String("String"), // Required + VolumeId: aws.String("String"), // Required Description: aws.String("String"), - DryRun: aws.Boolean(true), + DryRun: aws.Bool(true), } resp, err := svc.CreateSnapshot(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_CreateSpotDatafeedSubscription() { @@ -1312,58 +1026,42 @@ func ExampleEC2_CreateSpotDatafeedSubscription() { params := &ec2.CreateSpotDatafeedSubscriptionInput{ Bucket: aws.String("String"), // Required - DryRun: aws.Boolean(true), + DryRun: aws.Bool(true), Prefix: aws.String("String"), } resp, err := svc.CreateSpotDatafeedSubscription(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_CreateSubnet() { svc := ec2.New(nil) params := &ec2.CreateSubnetInput{ - CIDRBlock: aws.String("String"), // Required - VPCID: aws.String("String"), // Required + CidrBlock: aws.String("String"), // Required + VpcId: aws.String("String"), // Required AvailabilityZone: aws.String("String"), - DryRun: aws.Boolean(true), + DryRun: aws.Bool(true), } resp, err := svc.CreateSubnet(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_CreateTags() { @@ -1375,335 +1073,269 @@ func ExampleEC2_CreateTags() { // More values... }, Tags: []*ec2.Tag{ // Required - &ec2.Tag{ // Required + { // Required Key: aws.String("String"), Value: aws.String("String"), }, // More values... }, - DryRun: aws.Boolean(true), + DryRun: aws.Bool(true), } resp, err := svc.CreateTags(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return + } + + // Pretty-print the response data. + fmt.Println(resp) +} + +func ExampleEC2_CreateVolume() { + svc := ec2.New(nil) + + params := &ec2.CreateVolumeInput{ + AvailabilityZone: aws.String("String"), // Required + DryRun: aws.Bool(true), + Encrypted: aws.Bool(true), + Iops: aws.Int64(1), + KmsKeyId: aws.String("String"), + Size: aws.Int64(1), + SnapshotId: aws.String("String"), + VolumeType: aws.String("VolumeType"), + } + resp, err := svc.CreateVolume(params) + + if err != nil { + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } -func ExampleEC2_CreateVPC() { +func ExampleEC2_CreateVpc() { svc := ec2.New(nil) - params := &ec2.CreateVPCInput{ - CIDRBlock: aws.String("String"), // Required - DryRun: aws.Boolean(true), + params := &ec2.CreateVpcInput{ + CidrBlock: aws.String("String"), // Required + DryRun: aws.Bool(true), InstanceTenancy: aws.String("Tenancy"), } - resp, err := svc.CreateVPC(params) + resp, err := svc.CreateVpc(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } -func ExampleEC2_CreateVPCEndpoint() { +func ExampleEC2_CreateVpcEndpoint() { svc := ec2.New(nil) - params := &ec2.CreateVPCEndpointInput{ + params := &ec2.CreateVpcEndpointInput{ ServiceName: aws.String("String"), // Required - VPCID: aws.String("String"), // Required + VpcId: aws.String("String"), // Required ClientToken: aws.String("String"), - DryRun: aws.Boolean(true), + DryRun: aws.Bool(true), PolicyDocument: aws.String("String"), - RouteTableIDs: []*string{ + RouteTableIds: []*string{ aws.String("String"), // Required // More values... }, } - resp, err := svc.CreateVPCEndpoint(params) + resp, err := svc.CreateVpcEndpoint(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } -func ExampleEC2_CreateVPCPeeringConnection() { +func ExampleEC2_CreateVpcPeeringConnection() { svc := ec2.New(nil) - params := &ec2.CreateVPCPeeringConnectionInput{ - DryRun: aws.Boolean(true), - PeerOwnerID: aws.String("String"), - PeerVPCID: aws.String("String"), - VPCID: aws.String("String"), + params := &ec2.CreateVpcPeeringConnectionInput{ + DryRun: aws.Bool(true), + PeerOwnerId: aws.String("String"), + PeerVpcId: aws.String("String"), + VpcId: aws.String("String"), } - resp, err := svc.CreateVPCPeeringConnection(params) + resp, err := svc.CreateVpcPeeringConnection(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } -func ExampleEC2_CreateVPNConnection() { +func ExampleEC2_CreateVpnConnection() { svc := ec2.New(nil) - params := &ec2.CreateVPNConnectionInput{ - CustomerGatewayID: aws.String("String"), // Required + params := &ec2.CreateVpnConnectionInput{ + CustomerGatewayId: aws.String("String"), // Required Type: aws.String("String"), // Required - VPNGatewayID: aws.String("String"), // Required - DryRun: aws.Boolean(true), - Options: &ec2.VPNConnectionOptionsSpecification{ - StaticRoutesOnly: aws.Boolean(true), + VpnGatewayId: aws.String("String"), // Required + DryRun: aws.Bool(true), + Options: &ec2.VpnConnectionOptionsSpecification{ + StaticRoutesOnly: aws.Bool(true), }, } - resp, err := svc.CreateVPNConnection(params) + resp, err := svc.CreateVpnConnection(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } -func ExampleEC2_CreateVPNConnectionRoute() { +func ExampleEC2_CreateVpnConnectionRoute() { svc := ec2.New(nil) - params := &ec2.CreateVPNConnectionRouteInput{ - DestinationCIDRBlock: aws.String("String"), // Required - VPNConnectionID: aws.String("String"), // Required + params := &ec2.CreateVpnConnectionRouteInput{ + DestinationCidrBlock: aws.String("String"), // Required + VpnConnectionId: aws.String("String"), // Required } - resp, err := svc.CreateVPNConnectionRoute(params) + resp, err := svc.CreateVpnConnectionRoute(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } -func ExampleEC2_CreateVPNGateway() { +func ExampleEC2_CreateVpnGateway() { svc := ec2.New(nil) - params := &ec2.CreateVPNGatewayInput{ + params := &ec2.CreateVpnGatewayInput{ Type: aws.String("GatewayType"), // Required AvailabilityZone: aws.String("String"), - DryRun: aws.Boolean(true), + DryRun: aws.Bool(true), } - resp, err := svc.CreateVPNGateway(params) + resp, err := svc.CreateVpnGateway(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } -func ExampleEC2_CreateVolume() { +func ExampleEC2_DeleteCustomerGateway() { svc := ec2.New(nil) - params := &ec2.CreateVolumeInput{ - AvailabilityZone: aws.String("String"), // Required - DryRun: aws.Boolean(true), - Encrypted: aws.Boolean(true), - IOPS: aws.Long(1), - KMSKeyID: aws.String("String"), - Size: aws.Long(1), - SnapshotID: aws.String("String"), - VolumeType: aws.String("VolumeType"), + params := &ec2.DeleteCustomerGatewayInput{ + CustomerGatewayId: aws.String("String"), // Required + DryRun: aws.Bool(true), } - resp, err := svc.CreateVolume(params) + resp, err := svc.DeleteCustomerGateway(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } -func ExampleEC2_DeleteCustomerGateway() { +func ExampleEC2_DeleteDhcpOptions() { svc := ec2.New(nil) - params := &ec2.DeleteCustomerGatewayInput{ - CustomerGatewayID: aws.String("String"), // Required - DryRun: aws.Boolean(true), + params := &ec2.DeleteDhcpOptionsInput{ + DhcpOptionsId: aws.String("String"), // Required + DryRun: aws.Bool(true), } - resp, err := svc.DeleteCustomerGateway(params) + resp, err := svc.DeleteDhcpOptions(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } -func ExampleEC2_DeleteDHCPOptions() { +func ExampleEC2_DeleteFlowLogs() { svc := ec2.New(nil) - params := &ec2.DeleteDHCPOptionsInput{ - DHCPOptionsID: aws.String("String"), // Required - DryRun: aws.Boolean(true), + params := &ec2.DeleteFlowLogsInput{ + FlowLogIds: []*string{ // Required + aws.String("String"), // Required + // More values... + }, } - resp, err := svc.DeleteDHCPOptions(params) + resp, err := svc.DeleteFlowLogs(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_DeleteInternetGateway() { svc := ec2.New(nil) params := &ec2.DeleteInternetGatewayInput{ - InternetGatewayID: aws.String("String"), // Required - DryRun: aws.Boolean(true), + InternetGatewayId: aws.String("String"), // Required + DryRun: aws.Bool(true), } resp, err := svc.DeleteInternetGateway(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_DeleteKeyPair() { @@ -1711,113 +1343,81 @@ func ExampleEC2_DeleteKeyPair() { params := &ec2.DeleteKeyPairInput{ KeyName: aws.String("String"), // Required - DryRun: aws.Boolean(true), + DryRun: aws.Bool(true), } resp, err := svc.DeleteKeyPair(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } -func ExampleEC2_DeleteNetworkACL() { +func ExampleEC2_DeleteNetworkAcl() { svc := ec2.New(nil) - params := &ec2.DeleteNetworkACLInput{ - NetworkACLID: aws.String("String"), // Required - DryRun: aws.Boolean(true), + params := &ec2.DeleteNetworkAclInput{ + NetworkAclId: aws.String("String"), // Required + DryRun: aws.Bool(true), } - resp, err := svc.DeleteNetworkACL(params) + resp, err := svc.DeleteNetworkAcl(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } -func ExampleEC2_DeleteNetworkACLEntry() { +func ExampleEC2_DeleteNetworkAclEntry() { svc := ec2.New(nil) - params := &ec2.DeleteNetworkACLEntryInput{ - Egress: aws.Boolean(true), // Required - NetworkACLID: aws.String("String"), // Required - RuleNumber: aws.Long(1), // Required - DryRun: aws.Boolean(true), + params := &ec2.DeleteNetworkAclEntryInput{ + Egress: aws.Bool(true), // Required + NetworkAclId: aws.String("String"), // Required + RuleNumber: aws.Int64(1), // Required + DryRun: aws.Bool(true), } - resp, err := svc.DeleteNetworkACLEntry(params) + resp, err := svc.DeleteNetworkAclEntry(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_DeleteNetworkInterface() { svc := ec2.New(nil) params := &ec2.DeleteNetworkInterfaceInput{ - NetworkInterfaceID: aws.String("String"), // Required - DryRun: aws.Boolean(true), + NetworkInterfaceId: aws.String("String"), // Required + DryRun: aws.Bool(true), } resp, err := svc.DeleteNetworkInterface(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_DeletePlacementGroup() { @@ -1825,196 +1425,140 @@ func ExampleEC2_DeletePlacementGroup() { params := &ec2.DeletePlacementGroupInput{ GroupName: aws.String("String"), // Required - DryRun: aws.Boolean(true), + DryRun: aws.Bool(true), } resp, err := svc.DeletePlacementGroup(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_DeleteRoute() { svc := ec2.New(nil) params := &ec2.DeleteRouteInput{ - DestinationCIDRBlock: aws.String("String"), // Required - RouteTableID: aws.String("String"), // Required - DryRun: aws.Boolean(true), + DestinationCidrBlock: aws.String("String"), // Required + RouteTableId: aws.String("String"), // Required + DryRun: aws.Bool(true), } resp, err := svc.DeleteRoute(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_DeleteRouteTable() { svc := ec2.New(nil) params := &ec2.DeleteRouteTableInput{ - RouteTableID: aws.String("String"), // Required - DryRun: aws.Boolean(true), + RouteTableId: aws.String("String"), // Required + DryRun: aws.Bool(true), } resp, err := svc.DeleteRouteTable(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_DeleteSecurityGroup() { svc := ec2.New(nil) params := &ec2.DeleteSecurityGroupInput{ - DryRun: aws.Boolean(true), - GroupID: aws.String("String"), + DryRun: aws.Bool(true), + GroupId: aws.String("String"), GroupName: aws.String("String"), } resp, err := svc.DeleteSecurityGroup(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_DeleteSnapshot() { svc := ec2.New(nil) params := &ec2.DeleteSnapshotInput{ - SnapshotID: aws.String("String"), // Required - DryRun: aws.Boolean(true), + SnapshotId: aws.String("String"), // Required + DryRun: aws.Bool(true), } resp, err := svc.DeleteSnapshot(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_DeleteSpotDatafeedSubscription() { svc := ec2.New(nil) params := &ec2.DeleteSpotDatafeedSubscriptionInput{ - DryRun: aws.Boolean(true), + DryRun: aws.Bool(true), } resp, err := svc.DeleteSpotDatafeedSubscription(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_DeleteSubnet() { svc := ec2.New(nil) params := &ec2.DeleteSubnetInput{ - SubnetID: aws.String("String"), // Required - DryRun: aws.Boolean(true), + SubnetId: aws.String("String"), // Required + DryRun: aws.Bool(true), } resp, err := svc.DeleteSubnet(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_DeleteTags() { @@ -2025,9 +1569,9 @@ func ExampleEC2_DeleteTags() { aws.String("String"), // Required // More values... }, - DryRun: aws.Boolean(true), + DryRun: aws.Bool(true), Tags: []*ec2.Tag{ - &ec2.Tag{ // Required + { // Required Key: aws.String("String"), Value: aws.String("String"), }, @@ -2037,249 +1581,177 @@ func ExampleEC2_DeleteTags() { resp, err := svc.DeleteTags(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } -func ExampleEC2_DeleteVPC() { +func ExampleEC2_DeleteVolume() { svc := ec2.New(nil) - params := &ec2.DeleteVPCInput{ - VPCID: aws.String("String"), // Required - DryRun: aws.Boolean(true), + params := &ec2.DeleteVolumeInput{ + VolumeId: aws.String("String"), // Required + DryRun: aws.Bool(true), } - resp, err := svc.DeleteVPC(params) + resp, err := svc.DeleteVolume(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } -func ExampleEC2_DeleteVPCEndpoints() { +func ExampleEC2_DeleteVpc() { svc := ec2.New(nil) - params := &ec2.DeleteVPCEndpointsInput{ - VPCEndpointIDs: []*string{ // Required - aws.String("String"), // Required - // More values... - }, - DryRun: aws.Boolean(true), + params := &ec2.DeleteVpcInput{ + VpcId: aws.String("String"), // Required + DryRun: aws.Bool(true), } - resp, err := svc.DeleteVPCEndpoints(params) + resp, err := svc.DeleteVpc(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } -func ExampleEC2_DeleteVPCPeeringConnection() { +func ExampleEC2_DeleteVpcEndpoints() { svc := ec2.New(nil) - params := &ec2.DeleteVPCPeeringConnectionInput{ - VPCPeeringConnectionID: aws.String("String"), // Required - DryRun: aws.Boolean(true), + params := &ec2.DeleteVpcEndpointsInput{ + VpcEndpointIds: []*string{ // Required + aws.String("String"), // Required + // More values... + }, + DryRun: aws.Bool(true), } - resp, err := svc.DeleteVPCPeeringConnection(params) + resp, err := svc.DeleteVpcEndpoints(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } -func ExampleEC2_DeleteVPNConnection() { +func ExampleEC2_DeleteVpcPeeringConnection() { svc := ec2.New(nil) - params := &ec2.DeleteVPNConnectionInput{ - VPNConnectionID: aws.String("String"), // Required - DryRun: aws.Boolean(true), + params := &ec2.DeleteVpcPeeringConnectionInput{ + VpcPeeringConnectionId: aws.String("String"), // Required + DryRun: aws.Bool(true), } - resp, err := svc.DeleteVPNConnection(params) + resp, err := svc.DeleteVpcPeeringConnection(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } -func ExampleEC2_DeleteVPNConnectionRoute() { +func ExampleEC2_DeleteVpnConnection() { svc := ec2.New(nil) - params := &ec2.DeleteVPNConnectionRouteInput{ - DestinationCIDRBlock: aws.String("String"), // Required - VPNConnectionID: aws.String("String"), // Required + params := &ec2.DeleteVpnConnectionInput{ + VpnConnectionId: aws.String("String"), // Required + DryRun: aws.Bool(true), } - resp, err := svc.DeleteVPNConnectionRoute(params) + resp, err := svc.DeleteVpnConnection(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } -func ExampleEC2_DeleteVPNGateway() { +func ExampleEC2_DeleteVpnConnectionRoute() { svc := ec2.New(nil) - params := &ec2.DeleteVPNGatewayInput{ - VPNGatewayID: aws.String("String"), // Required - DryRun: aws.Boolean(true), + params := &ec2.DeleteVpnConnectionRouteInput{ + DestinationCidrBlock: aws.String("String"), // Required + VpnConnectionId: aws.String("String"), // Required } - resp, err := svc.DeleteVPNGateway(params) + resp, err := svc.DeleteVpnConnectionRoute(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } -func ExampleEC2_DeleteVolume() { +func ExampleEC2_DeleteVpnGateway() { svc := ec2.New(nil) - params := &ec2.DeleteVolumeInput{ - VolumeID: aws.String("String"), // Required - DryRun: aws.Boolean(true), + params := &ec2.DeleteVpnGatewayInput{ + VpnGatewayId: aws.String("String"), // Required + DryRun: aws.Bool(true), } - resp, err := svc.DeleteVolume(params) + resp, err := svc.DeleteVpnGateway(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_DeregisterImage() { svc := ec2.New(nil) params := &ec2.DeregisterImageInput{ - ImageID: aws.String("String"), // Required - DryRun: aws.Boolean(true), + ImageId: aws.String("String"), // Required + DryRun: aws.Bool(true), } resp, err := svc.DeregisterImage(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_DescribeAccountAttributes() { @@ -2290,40 +1762,32 @@ func ExampleEC2_DescribeAccountAttributes() { aws.String("AccountAttributeName"), // Required // More values... }, - DryRun: aws.Boolean(true), + DryRun: aws.Bool(true), } resp, err := svc.DescribeAccountAttributes(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_DescribeAddresses() { svc := ec2.New(nil) params := &ec2.DescribeAddressesInput{ - AllocationIDs: []*string{ + AllocationIds: []*string{ aws.String("String"), // Required // More values... }, - DryRun: aws.Boolean(true), + DryRun: aws.Bool(true), Filters: []*ec2.Filter{ - &ec2.Filter{ // Required + { // Required Name: aws.String("String"), Values: []*string{ aws.String("String"), // Required @@ -2332,7 +1796,7 @@ func ExampleEC2_DescribeAddresses() { }, // More values... }, - PublicIPs: []*string{ + PublicIps: []*string{ aws.String("String"), // Required // More values... }, @@ -2340,31 +1804,23 @@ func ExampleEC2_DescribeAddresses() { resp, err := svc.DescribeAddresses(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_DescribeAvailabilityZones() { svc := ec2.New(nil) params := &ec2.DescribeAvailabilityZonesInput{ - DryRun: aws.Boolean(true), + DryRun: aws.Bool(true), Filters: []*ec2.Filter{ - &ec2.Filter{ // Required + { // Required Name: aws.String("String"), Values: []*string{ aws.String("String"), // Required @@ -2381,35 +1837,27 @@ func ExampleEC2_DescribeAvailabilityZones() { resp, err := svc.DescribeAvailabilityZones(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_DescribeBundleTasks() { svc := ec2.New(nil) params := &ec2.DescribeBundleTasksInput{ - BundleIDs: []*string{ + BundleIds: []*string{ aws.String("String"), // Required // More values... }, - DryRun: aws.Boolean(true), + DryRun: aws.Bool(true), Filters: []*ec2.Filter{ - &ec2.Filter{ // Required + { // Required Name: aws.String("String"), Values: []*string{ aws.String("String"), // Required @@ -2422,31 +1870,23 @@ func ExampleEC2_DescribeBundleTasks() { resp, err := svc.DescribeBundleTasks(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_DescribeClassicLinkInstances() { svc := ec2.New(nil) params := &ec2.DescribeClassicLinkInstancesInput{ - DryRun: aws.Boolean(true), + DryRun: aws.Bool(true), Filters: []*ec2.Filter{ - &ec2.Filter{ // Required + { // Required Name: aws.String("String"), Values: []*string{ aws.String("String"), // Required @@ -2455,45 +1895,37 @@ func ExampleEC2_DescribeClassicLinkInstances() { }, // More values... }, - InstanceIDs: []*string{ + InstanceIds: []*string{ aws.String("String"), // Required // More values... }, - MaxResults: aws.Long(1), + MaxResults: aws.Int64(1), NextToken: aws.String("String"), } resp, err := svc.DescribeClassicLinkInstances(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_DescribeConversionTasks() { svc := ec2.New(nil) params := &ec2.DescribeConversionTasksInput{ - ConversionTaskIDs: []*string{ + ConversionTaskIds: []*string{ aws.String("String"), // Required // More values... }, - DryRun: aws.Boolean(true), + DryRun: aws.Bool(true), Filters: []*ec2.Filter{ - &ec2.Filter{ // Required + { // Required Name: aws.String("String"), Values: []*string{ aws.String("String"), // Required @@ -2506,35 +1938,27 @@ func ExampleEC2_DescribeConversionTasks() { resp, err := svc.DescribeConversionTasks(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_DescribeCustomerGateways() { svc := ec2.New(nil) params := &ec2.DescribeCustomerGatewaysInput{ - CustomerGatewayIDs: []*string{ + CustomerGatewayIds: []*string{ aws.String("String"), // Required // More values... }, - DryRun: aws.Boolean(true), + DryRun: aws.Bool(true), Filters: []*ec2.Filter{ - &ec2.Filter{ // Required + { // Required Name: aws.String("String"), Values: []*string{ aws.String("String"), // Required @@ -2547,35 +1971,27 @@ func ExampleEC2_DescribeCustomerGateways() { resp, err := svc.DescribeCustomerGateways(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } -func ExampleEC2_DescribeDHCPOptions() { +func ExampleEC2_DescribeDhcpOptions() { svc := ec2.New(nil) - params := &ec2.DescribeDHCPOptionsInput{ - DHCPOptionsIDs: []*string{ + params := &ec2.DescribeDhcpOptionsInput{ + DhcpOptionsIds: []*string{ aws.String("String"), // Required // More values... }, - DryRun: aws.Boolean(true), + DryRun: aws.Bool(true), Filters: []*ec2.Filter{ - &ec2.Filter{ // Required + { // Required Name: aws.String("String"), Values: []*string{ aws.String("String"), // Required @@ -2585,32 +2001,24 @@ func ExampleEC2_DescribeDHCPOptions() { // More values... }, } - resp, err := svc.DescribeDHCPOptions(params) + resp, err := svc.DescribeDhcpOptions(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_DescribeExportTasks() { svc := ec2.New(nil) params := &ec2.DescribeExportTasksInput{ - ExportTaskIDs: []*string{ + ExportTaskIds: []*string{ aws.String("String"), // Required // More values... }, @@ -2618,22 +2026,48 @@ func ExampleEC2_DescribeExportTasks() { resp, err := svc.DescribeExportTasks(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) +} + +func ExampleEC2_DescribeFlowLogs() { + svc := ec2.New(nil) + + params := &ec2.DescribeFlowLogsInput{ + Filter: []*ec2.Filter{ + { // Required + Name: aws.String("String"), + Values: []*string{ + aws.String("String"), // Required + // More values... + }, + }, + // More values... + }, + FlowLogIds: []*string{ + aws.String("String"), // Required + // More values... + }, + MaxResults: aws.Int64(1), + NextToken: aws.String("String"), + } + resp, err := svc.DescribeFlowLogs(params) + + if err != nil { + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return + } + + // Pretty-print the response data. + fmt.Println(resp) } func ExampleEC2_DescribeImageAttribute() { @@ -2641,41 +2075,33 @@ func ExampleEC2_DescribeImageAttribute() { params := &ec2.DescribeImageAttributeInput{ Attribute: aws.String("ImageAttributeName"), // Required - ImageID: aws.String("String"), // Required - DryRun: aws.Boolean(true), + ImageId: aws.String("String"), // Required + DryRun: aws.Bool(true), } resp, err := svc.DescribeImageAttribute(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_DescribeImages() { svc := ec2.New(nil) params := &ec2.DescribeImagesInput{ - DryRun: aws.Boolean(true), + DryRun: aws.Bool(true), ExecutableUsers: []*string{ aws.String("String"), // Required // More values... }, Filters: []*ec2.Filter{ - &ec2.Filter{ // Required + { // Required Name: aws.String("String"), Values: []*string{ aws.String("String"), // Required @@ -2684,7 +2110,7 @@ func ExampleEC2_DescribeImages() { }, // More values... }, - ImageIDs: []*string{ + ImageIds: []*string{ aws.String("String"), // Required // More values... }, @@ -2696,31 +2122,23 @@ func ExampleEC2_DescribeImages() { resp, err := svc.DescribeImages(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_DescribeImportImageTasks() { svc := ec2.New(nil) params := &ec2.DescribeImportImageTasksInput{ - DryRun: aws.Boolean(true), + DryRun: aws.Bool(true), Filters: []*ec2.Filter{ - &ec2.Filter{ // Required + { // Required Name: aws.String("String"), Values: []*string{ aws.String("String"), // Required @@ -2729,41 +2147,33 @@ func ExampleEC2_DescribeImportImageTasks() { }, // More values... }, - ImportTaskIDs: []*string{ + ImportTaskIds: []*string{ aws.String("String"), // Required // More values... }, - MaxResults: aws.Long(1), + MaxResults: aws.Int64(1), NextToken: aws.String("String"), } resp, err := svc.DescribeImportImageTasks(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_DescribeImportSnapshotTasks() { svc := ec2.New(nil) params := &ec2.DescribeImportSnapshotTasksInput{ - DryRun: aws.Boolean(true), + DryRun: aws.Bool(true), Filters: []*ec2.Filter{ - &ec2.Filter{ // Required + { // Required Name: aws.String("String"), Values: []*string{ aws.String("String"), // Required @@ -2772,32 +2182,24 @@ func ExampleEC2_DescribeImportSnapshotTasks() { }, // More values... }, - ImportTaskIDs: []*string{ + ImportTaskIds: []*string{ aws.String("String"), // Required // More values... }, - MaxResults: aws.Long(1), + MaxResults: aws.Int64(1), NextToken: aws.String("String"), } resp, err := svc.DescribeImportSnapshotTasks(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_DescribeInstanceAttribute() { @@ -2805,37 +2207,29 @@ func ExampleEC2_DescribeInstanceAttribute() { params := &ec2.DescribeInstanceAttributeInput{ Attribute: aws.String("InstanceAttributeName"), // Required - InstanceID: aws.String("String"), // Required - DryRun: aws.Boolean(true), + InstanceId: aws.String("String"), // Required + DryRun: aws.Bool(true), } resp, err := svc.DescribeInstanceAttribute(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_DescribeInstanceStatus() { svc := ec2.New(nil) params := &ec2.DescribeInstanceStatusInput{ - DryRun: aws.Boolean(true), + DryRun: aws.Bool(true), Filters: []*ec2.Filter{ - &ec2.Filter{ // Required + { // Required Name: aws.String("String"), Values: []*string{ aws.String("String"), // Required @@ -2844,42 +2238,34 @@ func ExampleEC2_DescribeInstanceStatus() { }, // More values... }, - IncludeAllInstances: aws.Boolean(true), - InstanceIDs: []*string{ + IncludeAllInstances: aws.Bool(true), + InstanceIds: []*string{ aws.String("String"), // Required // More values... }, - MaxResults: aws.Long(1), + MaxResults: aws.Int64(1), NextToken: aws.String("String"), } resp, err := svc.DescribeInstanceStatus(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_DescribeInstances() { svc := ec2.New(nil) params := &ec2.DescribeInstancesInput{ - DryRun: aws.Boolean(true), + DryRun: aws.Bool(true), Filters: []*ec2.Filter{ - &ec2.Filter{ // Required + { // Required Name: aws.String("String"), Values: []*string{ aws.String("String"), // Required @@ -2888,41 +2274,33 @@ func ExampleEC2_DescribeInstances() { }, // More values... }, - InstanceIDs: []*string{ + InstanceIds: []*string{ aws.String("String"), // Required // More values... }, - MaxResults: aws.Long(1), + MaxResults: aws.Int64(1), NextToken: aws.String("String"), } resp, err := svc.DescribeInstances(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_DescribeInternetGateways() { svc := ec2.New(nil) params := &ec2.DescribeInternetGatewaysInput{ - DryRun: aws.Boolean(true), + DryRun: aws.Bool(true), Filters: []*ec2.Filter{ - &ec2.Filter{ // Required + { // Required Name: aws.String("String"), Values: []*string{ aws.String("String"), // Required @@ -2931,7 +2309,7 @@ func ExampleEC2_DescribeInternetGateways() { }, // More values... }, - InternetGatewayIDs: []*string{ + InternetGatewayIds: []*string{ aws.String("String"), // Required // More values... }, @@ -2939,31 +2317,23 @@ func ExampleEC2_DescribeInternetGateways() { resp, err := svc.DescribeInternetGateways(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_DescribeKeyPairs() { svc := ec2.New(nil) params := &ec2.DescribeKeyPairsInput{ - DryRun: aws.Boolean(true), + DryRun: aws.Bool(true), Filters: []*ec2.Filter{ - &ec2.Filter{ // Required + { // Required Name: aws.String("String"), Values: []*string{ aws.String("String"), // Required @@ -2980,31 +2350,23 @@ func ExampleEC2_DescribeKeyPairs() { resp, err := svc.DescribeKeyPairs(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_DescribeMovingAddresses() { svc := ec2.New(nil) params := &ec2.DescribeMovingAddressesInput{ - DryRun: aws.Boolean(true), + DryRun: aws.Bool(true), Filters: []*ec2.Filter{ - &ec2.Filter{ // Required + { // Required Name: aws.String("String"), Values: []*string{ aws.String("String"), // Required @@ -3013,9 +2375,9 @@ func ExampleEC2_DescribeMovingAddresses() { }, // More values... }, - MaxResults: aws.Long(1), + MaxResults: aws.Int64(1), NextToken: aws.String("String"), - PublicIPs: []*string{ + PublicIps: []*string{ aws.String("String"), // Required // More values... }, @@ -3023,31 +2385,23 @@ func ExampleEC2_DescribeMovingAddresses() { resp, err := svc.DescribeMovingAddresses(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } -func ExampleEC2_DescribeNetworkACLs() { +func ExampleEC2_DescribeNetworkAcls() { svc := ec2.New(nil) - params := &ec2.DescribeNetworkACLsInput{ - DryRun: aws.Boolean(true), + params := &ec2.DescribeNetworkAclsInput{ + DryRun: aws.Bool(true), Filters: []*ec2.Filter{ - &ec2.Filter{ // Required + { // Required Name: aws.String("String"), Values: []*string{ aws.String("String"), // Required @@ -3056,68 +2410,52 @@ func ExampleEC2_DescribeNetworkACLs() { }, // More values... }, - NetworkACLIDs: []*string{ + NetworkAclIds: []*string{ aws.String("String"), // Required // More values... }, } - resp, err := svc.DescribeNetworkACLs(params) + resp, err := svc.DescribeNetworkAcls(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_DescribeNetworkInterfaceAttribute() { svc := ec2.New(nil) params := &ec2.DescribeNetworkInterfaceAttributeInput{ - NetworkInterfaceID: aws.String("String"), // Required + NetworkInterfaceId: aws.String("String"), // Required Attribute: aws.String("NetworkInterfaceAttribute"), - DryRun: aws.Boolean(true), + DryRun: aws.Bool(true), } resp, err := svc.DescribeNetworkInterfaceAttribute(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_DescribeNetworkInterfaces() { svc := ec2.New(nil) params := &ec2.DescribeNetworkInterfacesInput{ - DryRun: aws.Boolean(true), + DryRun: aws.Bool(true), Filters: []*ec2.Filter{ - &ec2.Filter{ // Required + { // Required Name: aws.String("String"), Values: []*string{ aws.String("String"), // Required @@ -3126,7 +2464,7 @@ func ExampleEC2_DescribeNetworkInterfaces() { }, // More values... }, - NetworkInterfaceIDs: []*string{ + NetworkInterfaceIds: []*string{ aws.String("String"), // Required // More values... }, @@ -3134,31 +2472,23 @@ func ExampleEC2_DescribeNetworkInterfaces() { resp, err := svc.DescribeNetworkInterfaces(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_DescribePlacementGroups() { svc := ec2.New(nil) params := &ec2.DescribePlacementGroupsInput{ - DryRun: aws.Boolean(true), + DryRun: aws.Bool(true), Filters: []*ec2.Filter{ - &ec2.Filter{ // Required + { // Required Name: aws.String("String"), Values: []*string{ aws.String("String"), // Required @@ -3175,31 +2505,23 @@ func ExampleEC2_DescribePlacementGroups() { resp, err := svc.DescribePlacementGroups(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_DescribePrefixLists() { svc := ec2.New(nil) params := &ec2.DescribePrefixListsInput{ - DryRun: aws.Boolean(true), + DryRun: aws.Bool(true), Filters: []*ec2.Filter{ - &ec2.Filter{ // Required + { // Required Name: aws.String("String"), Values: []*string{ aws.String("String"), // Required @@ -3208,9 +2530,9 @@ func ExampleEC2_DescribePrefixLists() { }, // More values... }, - MaxResults: aws.Long(1), + MaxResults: aws.Int64(1), NextToken: aws.String("String"), - PrefixListIDs: []*string{ + PrefixListIds: []*string{ aws.String("String"), // Required // More values... }, @@ -3218,31 +2540,23 @@ func ExampleEC2_DescribePrefixLists() { resp, err := svc.DescribePrefixLists(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_DescribeRegions() { svc := ec2.New(nil) params := &ec2.DescribeRegionsInput{ - DryRun: aws.Boolean(true), + DryRun: aws.Bool(true), Filters: []*ec2.Filter{ - &ec2.Filter{ // Required + { // Required Name: aws.String("String"), Values: []*string{ aws.String("String"), // Required @@ -3259,31 +2573,23 @@ func ExampleEC2_DescribeRegions() { resp, err := svc.DescribeRegions(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_DescribeReservedInstances() { svc := ec2.New(nil) params := &ec2.DescribeReservedInstancesInput{ - DryRun: aws.Boolean(true), + DryRun: aws.Bool(true), Filters: []*ec2.Filter{ - &ec2.Filter{ // Required + { // Required Name: aws.String("String"), Values: []*string{ aws.String("String"), // Required @@ -3293,7 +2599,7 @@ func ExampleEC2_DescribeReservedInstances() { // More values... }, OfferingType: aws.String("OfferingTypeValues"), - ReservedInstancesIDs: []*string{ + ReservedInstancesIds: []*string{ aws.String("String"), // Required // More values... }, @@ -3301,22 +2607,14 @@ func ExampleEC2_DescribeReservedInstances() { resp, err := svc.DescribeReservedInstances(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_DescribeReservedInstancesListings() { @@ -3324,7 +2622,7 @@ func ExampleEC2_DescribeReservedInstancesListings() { params := &ec2.DescribeReservedInstancesListingsInput{ Filters: []*ec2.Filter{ - &ec2.Filter{ // Required + { // Required Name: aws.String("String"), Values: []*string{ aws.String("String"), // Required @@ -3333,28 +2631,20 @@ func ExampleEC2_DescribeReservedInstancesListings() { }, // More values... }, - ReservedInstancesID: aws.String("String"), - ReservedInstancesListingID: aws.String("String"), + ReservedInstancesId: aws.String("String"), + ReservedInstancesListingId: aws.String("String"), } resp, err := svc.DescribeReservedInstancesListings(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_DescribeReservedInstancesModifications() { @@ -3362,7 +2652,7 @@ func ExampleEC2_DescribeReservedInstancesModifications() { params := &ec2.DescribeReservedInstancesModificationsInput{ Filters: []*ec2.Filter{ - &ec2.Filter{ // Required + { // Required Name: aws.String("String"), Values: []*string{ aws.String("String"), // Required @@ -3372,7 +2662,7 @@ func ExampleEC2_DescribeReservedInstancesModifications() { // More values... }, NextToken: aws.String("String"), - ReservedInstancesModificationIDs: []*string{ + ReservedInstancesModificationIds: []*string{ aws.String("String"), // Required // More values... }, @@ -3380,22 +2670,14 @@ func ExampleEC2_DescribeReservedInstancesModifications() { resp, err := svc.DescribeReservedInstancesModifications(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_DescribeReservedInstancesOfferings() { @@ -3403,9 +2685,9 @@ func ExampleEC2_DescribeReservedInstancesOfferings() { params := &ec2.DescribeReservedInstancesOfferingsInput{ AvailabilityZone: aws.String("String"), - DryRun: aws.Boolean(true), + DryRun: aws.Bool(true), Filters: []*ec2.Filter{ - &ec2.Filter{ // Required + { // Required Name: aws.String("String"), Values: []*string{ aws.String("String"), // Required @@ -3414,17 +2696,17 @@ func ExampleEC2_DescribeReservedInstancesOfferings() { }, // More values... }, - IncludeMarketplace: aws.Boolean(true), + IncludeMarketplace: aws.Bool(true), InstanceTenancy: aws.String("Tenancy"), InstanceType: aws.String("InstanceType"), - MaxDuration: aws.Long(1), - MaxInstanceCount: aws.Long(1), - MaxResults: aws.Long(1), - MinDuration: aws.Long(1), + MaxDuration: aws.Int64(1), + MaxInstanceCount: aws.Int64(1), + MaxResults: aws.Int64(1), + MinDuration: aws.Int64(1), NextToken: aws.String("String"), OfferingType: aws.String("OfferingTypeValues"), ProductDescription: aws.String("RIProductDescription"), - ReservedInstancesOfferingIDs: []*string{ + ReservedInstancesOfferingIds: []*string{ aws.String("String"), // Required // More values... }, @@ -3432,31 +2714,23 @@ func ExampleEC2_DescribeReservedInstancesOfferings() { resp, err := svc.DescribeReservedInstancesOfferings(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_DescribeRouteTables() { svc := ec2.New(nil) params := &ec2.DescribeRouteTablesInput{ - DryRun: aws.Boolean(true), + DryRun: aws.Bool(true), Filters: []*ec2.Filter{ - &ec2.Filter{ // Required + { // Required Name: aws.String("String"), Values: []*string{ aws.String("String"), // Required @@ -3465,7 +2739,7 @@ func ExampleEC2_DescribeRouteTables() { }, // More values... }, - RouteTableIDs: []*string{ + RouteTableIds: []*string{ aws.String("String"), // Required // More values... }, @@ -3473,31 +2747,23 @@ func ExampleEC2_DescribeRouteTables() { resp, err := svc.DescribeRouteTables(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_DescribeSecurityGroups() { svc := ec2.New(nil) params := &ec2.DescribeSecurityGroupsInput{ - DryRun: aws.Boolean(true), + DryRun: aws.Bool(true), Filters: []*ec2.Filter{ - &ec2.Filter{ // Required + { // Required Name: aws.String("String"), Values: []*string{ aws.String("String"), // Required @@ -3506,7 +2772,7 @@ func ExampleEC2_DescribeSecurityGroups() { }, // More values... }, - GroupIDs: []*string{ + GroupIds: []*string{ aws.String("String"), // Required // More values... }, @@ -3518,22 +2784,14 @@ func ExampleEC2_DescribeSecurityGroups() { resp, err := svc.DescribeSecurityGroups(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_DescribeSnapshotAttribute() { @@ -3541,37 +2799,29 @@ func ExampleEC2_DescribeSnapshotAttribute() { params := &ec2.DescribeSnapshotAttributeInput{ Attribute: aws.String("SnapshotAttributeName"), // Required - SnapshotID: aws.String("String"), // Required - DryRun: aws.Boolean(true), + SnapshotId: aws.String("String"), // Required + DryRun: aws.Bool(true), } resp, err := svc.DescribeSnapshotAttribute(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_DescribeSnapshots() { svc := ec2.New(nil) params := &ec2.DescribeSnapshotsInput{ - DryRun: aws.Boolean(true), + DryRun: aws.Bool(true), Filters: []*ec2.Filter{ - &ec2.Filter{ // Required + { // Required Name: aws.String("String"), Values: []*string{ aws.String("String"), // Required @@ -3580,17 +2830,17 @@ func ExampleEC2_DescribeSnapshots() { }, // More values... }, - MaxResults: aws.Long(1), + MaxResults: aws.Int64(1), NextToken: aws.String("String"), - OwnerIDs: []*string{ + OwnerIds: []*string{ aws.String("String"), // Required // More values... }, - RestorableByUserIDs: []*string{ + RestorableByUserIds: []*string{ aws.String("String"), // Required // More values... }, - SnapshotIDs: []*string{ + SnapshotIds: []*string{ aws.String("String"), // Required // More values... }, @@ -3598,121 +2848,89 @@ func ExampleEC2_DescribeSnapshots() { resp, err := svc.DescribeSnapshots(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_DescribeSpotDatafeedSubscription() { svc := ec2.New(nil) params := &ec2.DescribeSpotDatafeedSubscriptionInput{ - DryRun: aws.Boolean(true), + DryRun: aws.Bool(true), } resp, err := svc.DescribeSpotDatafeedSubscription(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_DescribeSpotFleetInstances() { svc := ec2.New(nil) params := &ec2.DescribeSpotFleetInstancesInput{ - SpotFleetRequestID: aws.String("String"), // Required - DryRun: aws.Boolean(true), - MaxResults: aws.Long(1), + SpotFleetRequestId: aws.String("String"), // Required + DryRun: aws.Bool(true), + MaxResults: aws.Int64(1), NextToken: aws.String("String"), } resp, err := svc.DescribeSpotFleetInstances(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_DescribeSpotFleetRequestHistory() { svc := ec2.New(nil) params := &ec2.DescribeSpotFleetRequestHistoryInput{ - SpotFleetRequestID: aws.String("String"), // Required + SpotFleetRequestId: aws.String("String"), // Required StartTime: aws.Time(time.Now()), // Required - DryRun: aws.Boolean(true), + DryRun: aws.Bool(true), EventType: aws.String("EventType"), - MaxResults: aws.Long(1), + MaxResults: aws.Int64(1), NextToken: aws.String("String"), } resp, err := svc.DescribeSpotFleetRequestHistory(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_DescribeSpotFleetRequests() { svc := ec2.New(nil) params := &ec2.DescribeSpotFleetRequestsInput{ - DryRun: aws.Boolean(true), - MaxResults: aws.Long(1), + DryRun: aws.Bool(true), + MaxResults: aws.Int64(1), NextToken: aws.String("String"), - SpotFleetRequestIDs: []*string{ + SpotFleetRequestIds: []*string{ aws.String("String"), // Required // More values... }, @@ -3720,31 +2938,23 @@ func ExampleEC2_DescribeSpotFleetRequests() { resp, err := svc.DescribeSpotFleetRequests(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_DescribeSpotInstanceRequests() { svc := ec2.New(nil) params := &ec2.DescribeSpotInstanceRequestsInput{ - DryRun: aws.Boolean(true), + DryRun: aws.Bool(true), Filters: []*ec2.Filter{ - &ec2.Filter{ // Required + { // Required Name: aws.String("String"), Values: []*string{ aws.String("String"), // Required @@ -3753,7 +2963,7 @@ func ExampleEC2_DescribeSpotInstanceRequests() { }, // More values... }, - SpotInstanceRequestIDs: []*string{ + SpotInstanceRequestIds: []*string{ aws.String("String"), // Required // More values... }, @@ -3761,22 +2971,14 @@ func ExampleEC2_DescribeSpotInstanceRequests() { resp, err := svc.DescribeSpotInstanceRequests(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_DescribeSpotPriceHistory() { @@ -3784,10 +2986,10 @@ func ExampleEC2_DescribeSpotPriceHistory() { params := &ec2.DescribeSpotPriceHistoryInput{ AvailabilityZone: aws.String("String"), - DryRun: aws.Boolean(true), + DryRun: aws.Bool(true), EndTime: aws.Time(time.Now()), Filters: []*ec2.Filter{ - &ec2.Filter{ // Required + { // Required Name: aws.String("String"), Values: []*string{ aws.String("String"), // Required @@ -3800,7 +3002,7 @@ func ExampleEC2_DescribeSpotPriceHistory() { aws.String("InstanceType"), // Required // More values... }, - MaxResults: aws.Long(1), + MaxResults: aws.Int64(1), NextToken: aws.String("String"), ProductDescriptions: []*string{ aws.String("String"), // Required @@ -3811,31 +3013,23 @@ func ExampleEC2_DescribeSpotPriceHistory() { resp, err := svc.DescribeSpotPriceHistory(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_DescribeSubnets() { svc := ec2.New(nil) params := &ec2.DescribeSubnetsInput{ - DryRun: aws.Boolean(true), + DryRun: aws.Bool(true), Filters: []*ec2.Filter{ - &ec2.Filter{ // Required + { // Required Name: aws.String("String"), Values: []*string{ aws.String("String"), // Required @@ -3844,7 +3038,7 @@ func ExampleEC2_DescribeSubnets() { }, // More values... }, - SubnetIDs: []*string{ + SubnetIds: []*string{ aws.String("String"), // Required // More values... }, @@ -3852,31 +3046,23 @@ func ExampleEC2_DescribeSubnets() { resp, err := svc.DescribeSubnets(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_DescribeTags() { svc := ec2.New(nil) params := &ec2.DescribeTagsInput{ - DryRun: aws.Boolean(true), + DryRun: aws.Bool(true), Filters: []*ec2.Filter{ - &ec2.Filter{ // Required + { // Required Name: aws.String("String"), Values: []*string{ aws.String("String"), // Required @@ -3885,66 +3071,50 @@ func ExampleEC2_DescribeTags() { }, // More values... }, - MaxResults: aws.Long(1), + MaxResults: aws.Int64(1), NextToken: aws.String("String"), } resp, err := svc.DescribeTags(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } -func ExampleEC2_DescribeVPCAttribute() { +func ExampleEC2_DescribeVolumeAttribute() { svc := ec2.New(nil) - params := &ec2.DescribeVPCAttributeInput{ - VPCID: aws.String("String"), // Required - Attribute: aws.String("VpcAttributeName"), - DryRun: aws.Boolean(true), + params := &ec2.DescribeVolumeAttributeInput{ + VolumeId: aws.String("String"), // Required + Attribute: aws.String("VolumeAttributeName"), + DryRun: aws.Bool(true), } - resp, err := svc.DescribeVPCAttribute(params) + resp, err := svc.DescribeVolumeAttribute(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } -func ExampleEC2_DescribeVPCClassicLink() { +func ExampleEC2_DescribeVolumeStatus() { svc := ec2.New(nil) - params := &ec2.DescribeVPCClassicLinkInput{ - DryRun: aws.Boolean(true), + params := &ec2.DescribeVolumeStatusInput{ + DryRun: aws.Bool(true), Filters: []*ec2.Filter{ - &ec2.Filter{ // Required + { // Required Name: aws.String("String"), Values: []*string{ aws.String("String"), // Required @@ -3953,68 +3123,33 @@ func ExampleEC2_DescribeVPCClassicLink() { }, // More values... }, - VPCIDs: []*string{ + MaxResults: aws.Int64(1), + NextToken: aws.String("String"), + VolumeIds: []*string{ aws.String("String"), // Required // More values... }, } - resp, err := svc.DescribeVPCClassicLink(params) - - if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_DescribeVPCEndpointServices() { - svc := ec2.New(nil) - - params := &ec2.DescribeVPCEndpointServicesInput{ - DryRun: aws.Boolean(true), - MaxResults: aws.Long(1), - NextToken: aws.String("String"), - } - resp, err := svc.DescribeVPCEndpointServices(params) + resp, err := svc.DescribeVolumeStatus(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } -func ExampleEC2_DescribeVPCEndpoints() { +func ExampleEC2_DescribeVolumes() { svc := ec2.New(nil) - params := &ec2.DescribeVPCEndpointsInput{ - DryRun: aws.Boolean(true), + params := &ec2.DescribeVolumesInput{ + DryRun: aws.Bool(true), Filters: []*ec2.Filter{ - &ec2.Filter{ // Required + { // Required Name: aws.String("String"), Values: []*string{ aws.String("String"), // Required @@ -4023,41 +3158,54 @@ func ExampleEC2_DescribeVPCEndpoints() { }, // More values... }, - MaxResults: aws.Long(1), + MaxResults: aws.Int64(1), NextToken: aws.String("String"), - VPCEndpointIDs: []*string{ + VolumeIds: []*string{ aws.String("String"), // Required // More values... }, } - resp, err := svc.DescribeVPCEndpoints(params) + resp, err := svc.DescribeVolumes(params) + + if err != nil { + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return + } + + // Pretty-print the response data. + fmt.Println(resp) +} + +func ExampleEC2_DescribeVpcAttribute() { + svc := ec2.New(nil) + + params := &ec2.DescribeVpcAttributeInput{ + VpcId: aws.String("String"), // Required + Attribute: aws.String("VpcAttributeName"), + DryRun: aws.Bool(true), + } + resp, err := svc.DescribeVpcAttribute(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } -func ExampleEC2_DescribeVPCPeeringConnections() { +func ExampleEC2_DescribeVpcClassicLink() { svc := ec2.New(nil) - params := &ec2.DescribeVPCPeeringConnectionsInput{ - DryRun: aws.Boolean(true), + params := &ec2.DescribeVpcClassicLinkInput{ + DryRun: aws.Bool(true), Filters: []*ec2.Filter{ - &ec2.Filter{ // Required + { // Required Name: aws.String("String"), Values: []*string{ aws.String("String"), // Required @@ -4066,39 +3214,52 @@ func ExampleEC2_DescribeVPCPeeringConnections() { }, // More values... }, - VPCPeeringConnectionIDs: []*string{ + VpcIds: []*string{ aws.String("String"), // Required // More values... }, } - resp, err := svc.DescribeVPCPeeringConnections(params) + resp, err := svc.DescribeVpcClassicLink(params) + + if err != nil { + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return + } + + // Pretty-print the response data. + fmt.Println(resp) +} + +func ExampleEC2_DescribeVpcEndpointServices() { + svc := ec2.New(nil) + + params := &ec2.DescribeVpcEndpointServicesInput{ + DryRun: aws.Bool(true), + MaxResults: aws.Int64(1), + NextToken: aws.String("String"), + } + resp, err := svc.DescribeVpcEndpointServices(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } -func ExampleEC2_DescribeVPCs() { +func ExampleEC2_DescribeVpcEndpoints() { svc := ec2.New(nil) - params := &ec2.DescribeVPCsInput{ - DryRun: aws.Boolean(true), + params := &ec2.DescribeVpcEndpointsInput{ + DryRun: aws.Bool(true), Filters: []*ec2.Filter{ - &ec2.Filter{ // Required + { // Required Name: aws.String("String"), Values: []*string{ aws.String("String"), // Required @@ -4107,39 +3268,33 @@ func ExampleEC2_DescribeVPCs() { }, // More values... }, - VPCIDs: []*string{ + MaxResults: aws.Int64(1), + NextToken: aws.String("String"), + VpcEndpointIds: []*string{ aws.String("String"), // Required // More values... }, } - resp, err := svc.DescribeVPCs(params) + resp, err := svc.DescribeVpcEndpoints(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } -func ExampleEC2_DescribeVPNConnections() { +func ExampleEC2_DescribeVpcPeeringConnections() { svc := ec2.New(nil) - params := &ec2.DescribeVPNConnectionsInput{ - DryRun: aws.Boolean(true), + params := &ec2.DescribeVpcPeeringConnectionsInput{ + DryRun: aws.Bool(true), Filters: []*ec2.Filter{ - &ec2.Filter{ // Required + { // Required Name: aws.String("String"), Values: []*string{ aws.String("String"), // Required @@ -4148,39 +3303,31 @@ func ExampleEC2_DescribeVPNConnections() { }, // More values... }, - VPNConnectionIDs: []*string{ + VpcPeeringConnectionIds: []*string{ aws.String("String"), // Required // More values... }, } - resp, err := svc.DescribeVPNConnections(params) + resp, err := svc.DescribeVpcPeeringConnections(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } -func ExampleEC2_DescribeVPNGateways() { +func ExampleEC2_DescribeVpcs() { svc := ec2.New(nil) - params := &ec2.DescribeVPNGatewaysInput{ - DryRun: aws.Boolean(true), + params := &ec2.DescribeVpcsInput{ + DryRun: aws.Bool(true), Filters: []*ec2.Filter{ - &ec2.Filter{ // Required + { // Required Name: aws.String("String"), Values: []*string{ aws.String("String"), // Required @@ -4189,68 +3336,31 @@ func ExampleEC2_DescribeVPNGateways() { }, // More values... }, - VPNGatewayIDs: []*string{ + VpcIds: []*string{ aws.String("String"), // Required // More values... }, } - resp, err := svc.DescribeVPNGateways(params) + resp, err := svc.DescribeVpcs(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } -func ExampleEC2_DescribeVolumeAttribute() { +func ExampleEC2_DescribeVpnConnections() { svc := ec2.New(nil) - params := &ec2.DescribeVolumeAttributeInput{ - VolumeID: aws.String("String"), // Required - Attribute: aws.String("VolumeAttributeName"), - DryRun: aws.Boolean(true), - } - resp, err := svc.DescribeVolumeAttribute(params) - - if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_DescribeVolumeStatus() { - svc := ec2.New(nil) - - params := &ec2.DescribeVolumeStatusInput{ - DryRun: aws.Boolean(true), + params := &ec2.DescribeVpnConnectionsInput{ + DryRun: aws.Bool(true), Filters: []*ec2.Filter{ - &ec2.Filter{ // Required + { // Required Name: aws.String("String"), Values: []*string{ aws.String("String"), // Required @@ -4259,41 +3369,31 @@ func ExampleEC2_DescribeVolumeStatus() { }, // More values... }, - MaxResults: aws.Long(1), - NextToken: aws.String("String"), - VolumeIDs: []*string{ + VpnConnectionIds: []*string{ aws.String("String"), // Required // More values... }, } - resp, err := svc.DescribeVolumeStatus(params) + resp, err := svc.DescribeVpnConnections(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } -func ExampleEC2_DescribeVolumes() { +func ExampleEC2_DescribeVpnGateways() { svc := ec2.New(nil) - params := &ec2.DescribeVolumesInput{ - DryRun: aws.Boolean(true), + params := &ec2.DescribeVpnGatewaysInput{ + DryRun: aws.Bool(true), Filters: []*ec2.Filter{ - &ec2.Filter{ // Required + { // Required Name: aws.String("String"), Values: []*string{ aws.String("String"), // Required @@ -4302,432 +3402,310 @@ func ExampleEC2_DescribeVolumes() { }, // More values... }, - MaxResults: aws.Long(1), - NextToken: aws.String("String"), - VolumeIDs: []*string{ + VpnGatewayIds: []*string{ aws.String("String"), // Required // More values... }, } - resp, err := svc.DescribeVolumes(params) + resp, err := svc.DescribeVpnGateways(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } -func ExampleEC2_DetachClassicLinkVPC() { +func ExampleEC2_DetachClassicLinkVpc() { svc := ec2.New(nil) - params := &ec2.DetachClassicLinkVPCInput{ - InstanceID: aws.String("String"), // Required - VPCID: aws.String("String"), // Required - DryRun: aws.Boolean(true), + params := &ec2.DetachClassicLinkVpcInput{ + InstanceId: aws.String("String"), // Required + VpcId: aws.String("String"), // Required + DryRun: aws.Bool(true), } - resp, err := svc.DetachClassicLinkVPC(params) + resp, err := svc.DetachClassicLinkVpc(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_DetachInternetGateway() { svc := ec2.New(nil) params := &ec2.DetachInternetGatewayInput{ - InternetGatewayID: aws.String("String"), // Required - VPCID: aws.String("String"), // Required - DryRun: aws.Boolean(true), + InternetGatewayId: aws.String("String"), // Required + VpcId: aws.String("String"), // Required + DryRun: aws.Bool(true), } resp, err := svc.DetachInternetGateway(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_DetachNetworkInterface() { svc := ec2.New(nil) params := &ec2.DetachNetworkInterfaceInput{ - AttachmentID: aws.String("String"), // Required - DryRun: aws.Boolean(true), - Force: aws.Boolean(true), + AttachmentId: aws.String("String"), // Required + DryRun: aws.Bool(true), + Force: aws.Bool(true), } resp, err := svc.DetachNetworkInterface(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } -func ExampleEC2_DetachVPNGateway() { +func ExampleEC2_DetachVolume() { svc := ec2.New(nil) - params := &ec2.DetachVPNGatewayInput{ - VPCID: aws.String("String"), // Required - VPNGatewayID: aws.String("String"), // Required - DryRun: aws.Boolean(true), + params := &ec2.DetachVolumeInput{ + VolumeId: aws.String("String"), // Required + Device: aws.String("String"), + DryRun: aws.Bool(true), + Force: aws.Bool(true), + InstanceId: aws.String("String"), } - resp, err := svc.DetachVPNGateway(params) + resp, err := svc.DetachVolume(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } -func ExampleEC2_DetachVolume() { +func ExampleEC2_DetachVpnGateway() { svc := ec2.New(nil) - params := &ec2.DetachVolumeInput{ - VolumeID: aws.String("String"), // Required - Device: aws.String("String"), - DryRun: aws.Boolean(true), - Force: aws.Boolean(true), - InstanceID: aws.String("String"), + params := &ec2.DetachVpnGatewayInput{ + VpcId: aws.String("String"), // Required + VpnGatewayId: aws.String("String"), // Required + DryRun: aws.Bool(true), } - resp, err := svc.DetachVolume(params) + resp, err := svc.DetachVpnGateway(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } -func ExampleEC2_DisableVGWRoutePropagation() { +func ExampleEC2_DisableVgwRoutePropagation() { svc := ec2.New(nil) - params := &ec2.DisableVGWRoutePropagationInput{ - GatewayID: aws.String("String"), // Required - RouteTableID: aws.String("String"), // Required + params := &ec2.DisableVgwRoutePropagationInput{ + GatewayId: aws.String("String"), // Required + RouteTableId: aws.String("String"), // Required } - resp, err := svc.DisableVGWRoutePropagation(params) + resp, err := svc.DisableVgwRoutePropagation(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } -func ExampleEC2_DisableVPCClassicLink() { +func ExampleEC2_DisableVpcClassicLink() { svc := ec2.New(nil) - params := &ec2.DisableVPCClassicLinkInput{ - VPCID: aws.String("String"), // Required - DryRun: aws.Boolean(true), + params := &ec2.DisableVpcClassicLinkInput{ + VpcId: aws.String("String"), // Required + DryRun: aws.Bool(true), } - resp, err := svc.DisableVPCClassicLink(params) + resp, err := svc.DisableVpcClassicLink(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_DisassociateAddress() { svc := ec2.New(nil) params := &ec2.DisassociateAddressInput{ - AssociationID: aws.String("String"), - DryRun: aws.Boolean(true), - PublicIP: aws.String("String"), + AssociationId: aws.String("String"), + DryRun: aws.Bool(true), + PublicIp: aws.String("String"), } resp, err := svc.DisassociateAddress(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_DisassociateRouteTable() { svc := ec2.New(nil) params := &ec2.DisassociateRouteTableInput{ - AssociationID: aws.String("String"), // Required - DryRun: aws.Boolean(true), + AssociationId: aws.String("String"), // Required + DryRun: aws.Bool(true), } resp, err := svc.DisassociateRouteTable(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } -func ExampleEC2_EnableVGWRoutePropagation() { +func ExampleEC2_EnableVgwRoutePropagation() { svc := ec2.New(nil) - params := &ec2.EnableVGWRoutePropagationInput{ - GatewayID: aws.String("String"), // Required - RouteTableID: aws.String("String"), // Required + params := &ec2.EnableVgwRoutePropagationInput{ + GatewayId: aws.String("String"), // Required + RouteTableId: aws.String("String"), // Required } - resp, err := svc.EnableVGWRoutePropagation(params) + resp, err := svc.EnableVgwRoutePropagation(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } -func ExampleEC2_EnableVPCClassicLink() { +func ExampleEC2_EnableVolumeIO() { svc := ec2.New(nil) - params := &ec2.EnableVPCClassicLinkInput{ - VPCID: aws.String("String"), // Required - DryRun: aws.Boolean(true), + params := &ec2.EnableVolumeIOInput{ + VolumeId: aws.String("String"), // Required + DryRun: aws.Bool(true), } - resp, err := svc.EnableVPCClassicLink(params) + resp, err := svc.EnableVolumeIO(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } -func ExampleEC2_EnableVolumeIO() { +func ExampleEC2_EnableVpcClassicLink() { svc := ec2.New(nil) - params := &ec2.EnableVolumeIOInput{ - VolumeID: aws.String("String"), // Required - DryRun: aws.Boolean(true), + params := &ec2.EnableVpcClassicLinkInput{ + VpcId: aws.String("String"), // Required + DryRun: aws.Bool(true), } - resp, err := svc.EnableVolumeIO(params) + resp, err := svc.EnableVpcClassicLink(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_GetConsoleOutput() { svc := ec2.New(nil) params := &ec2.GetConsoleOutputInput{ - InstanceID: aws.String("String"), // Required - DryRun: aws.Boolean(true), + InstanceId: aws.String("String"), // Required + DryRun: aws.Bool(true), } resp, err := svc.GetConsoleOutput(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_GetPasswordData() { svc := ec2.New(nil) params := &ec2.GetPasswordDataInput{ - InstanceID: aws.String("String"), // Required - DryRun: aws.Boolean(true), + InstanceId: aws.String("String"), // Required + DryRun: aws.Bool(true), } resp, err := svc.GetPasswordData(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_ImportImage() { @@ -4738,18 +3716,18 @@ func ExampleEC2_ImportImage() { ClientData: &ec2.ClientData{ Comment: aws.String("String"), UploadEnd: aws.Time(time.Now()), - UploadSize: aws.Double(1.0), + UploadSize: aws.Float64(1.0), UploadStart: aws.Time(time.Now()), }, ClientToken: aws.String("String"), Description: aws.String("String"), DiskContainers: []*ec2.ImageDiskContainer{ - &ec2.ImageDiskContainer{ // Required + { // Required Description: aws.String("String"), DeviceName: aws.String("String"), Format: aws.String("String"), - SnapshotID: aws.String("String"), - URL: aws.String("String"), + SnapshotId: aws.String("String"), + Url: aws.String("String"), UserBucket: &ec2.UserBucket{ S3Bucket: aws.String("String"), S3Key: aws.String("String"), @@ -4757,7 +3735,7 @@ func ExampleEC2_ImportImage() { }, // More values... }, - DryRun: aws.Boolean(true), + DryRun: aws.Bool(true), Hypervisor: aws.String("String"), LicenseType: aws.String("String"), Platform: aws.String("String"), @@ -4766,22 +3744,14 @@ func ExampleEC2_ImportImage() { resp, err := svc.ImportImage(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_ImportInstance() { @@ -4791,24 +3761,24 @@ func ExampleEC2_ImportInstance() { Platform: aws.String("PlatformValues"), // Required Description: aws.String("String"), DiskImages: []*ec2.DiskImage{ - &ec2.DiskImage{ // Required + { // Required Description: aws.String("String"), Image: &ec2.DiskImageDetail{ - Bytes: aws.Long(1), // Required + Bytes: aws.Int64(1), // Required Format: aws.String("DiskImageFormat"), // Required - ImportManifestURL: aws.String("String"), // Required + ImportManifestUrl: aws.String("String"), // Required }, Volume: &ec2.VolumeDetail{ - Size: aws.Long(1), // Required + Size: aws.Int64(1), // Required }, }, // More values... }, - DryRun: aws.Boolean(true), + DryRun: aws.Bool(true), LaunchSpecification: &ec2.ImportInstanceLaunchSpecification{ AdditionalInfo: aws.String("String"), Architecture: aws.String("ArchitectureValues"), - GroupIDs: []*string{ + GroupIds: []*string{ aws.String("String"), // Required // More values... }, @@ -4818,14 +3788,14 @@ func ExampleEC2_ImportInstance() { }, InstanceInitiatedShutdownBehavior: aws.String("ShutdownBehavior"), InstanceType: aws.String("InstanceType"), - Monitoring: aws.Boolean(true), + Monitoring: aws.Bool(true), Placement: &ec2.Placement{ AvailabilityZone: aws.String("String"), GroupName: aws.String("String"), Tenancy: aws.String("Tenancy"), }, - PrivateIPAddress: aws.String("String"), - SubnetID: aws.String("String"), + PrivateIpAddress: aws.String("String"), + SubnetId: aws.String("String"), UserData: &ec2.UserData{ Data: aws.String("String"), }, @@ -4834,22 +3804,14 @@ func ExampleEC2_ImportInstance() { resp, err := svc.ImportInstance(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_ImportKeyPair() { @@ -4858,27 +3820,19 @@ func ExampleEC2_ImportKeyPair() { params := &ec2.ImportKeyPairInput{ KeyName: aws.String("String"), // Required PublicKeyMaterial: []byte("PAYLOAD"), // Required - DryRun: aws.Boolean(true), + DryRun: aws.Bool(true), } resp, err := svc.ImportKeyPair(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_ImportSnapshot() { @@ -4888,7 +3842,7 @@ func ExampleEC2_ImportSnapshot() { ClientData: &ec2.ClientData{ Comment: aws.String("String"), UploadEnd: aws.Time(time.Now()), - UploadSize: aws.Double(1.0), + UploadSize: aws.Float64(1.0), UploadStart: aws.Time(time.Now()), }, ClientToken: aws.String("String"), @@ -4896,34 +3850,26 @@ func ExampleEC2_ImportSnapshot() { DiskContainer: &ec2.SnapshotDiskContainer{ Description: aws.String("String"), Format: aws.String("String"), - URL: aws.String("String"), + Url: aws.String("String"), UserBucket: &ec2.UserBucket{ S3Bucket: aws.String("String"), S3Key: aws.String("String"), }, }, - DryRun: aws.Boolean(true), + DryRun: aws.Bool(true), RoleName: aws.String("String"), } resp, err := svc.ImportSnapshot(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_ImportVolume() { @@ -4932,64 +3878,56 @@ func ExampleEC2_ImportVolume() { params := &ec2.ImportVolumeInput{ AvailabilityZone: aws.String("String"), // Required Image: &ec2.DiskImageDetail{ // Required - Bytes: aws.Long(1), // Required + Bytes: aws.Int64(1), // Required Format: aws.String("DiskImageFormat"), // Required - ImportManifestURL: aws.String("String"), // Required + ImportManifestUrl: aws.String("String"), // Required }, Volume: &ec2.VolumeDetail{ // Required - Size: aws.Long(1), // Required + Size: aws.Int64(1), // Required }, Description: aws.String("String"), - DryRun: aws.Boolean(true), + DryRun: aws.Bool(true), } resp, err := svc.ImportVolume(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_ModifyImageAttribute() { svc := ec2.New(nil) params := &ec2.ModifyImageAttributeInput{ - ImageID: aws.String("String"), // Required + ImageId: aws.String("String"), // Required Attribute: aws.String("String"), Description: &ec2.AttributeValue{ Value: aws.String("String"), }, - DryRun: aws.Boolean(true), + DryRun: aws.Bool(true), LaunchPermission: &ec2.LaunchPermissionModifications{ Add: []*ec2.LaunchPermission{ - &ec2.LaunchPermission{ // Required + { // Required Group: aws.String("PermissionGroup"), - UserID: aws.String("String"), + UserId: aws.String("String"), }, // More values... }, Remove: []*ec2.LaunchPermission{ - &ec2.LaunchPermission{ // Required + { // Required Group: aws.String("PermissionGroup"), - UserID: aws.String("String"), + UserId: aws.String("String"), }, // More values... }, }, - OperationType: aws.String("String"), + OperationType: aws.String("OperationType"), ProductCodes: []*string{ aws.String("String"), // Required // More values... @@ -4998,7 +3936,7 @@ func ExampleEC2_ModifyImageAttribute() { aws.String("String"), // Required // More values... }, - UserIDs: []*string{ + UserIds: []*string{ aws.String("String"), // Required // More values... }, @@ -5007,48 +3945,40 @@ func ExampleEC2_ModifyImageAttribute() { resp, err := svc.ModifyImageAttribute(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_ModifyInstanceAttribute() { svc := ec2.New(nil) params := &ec2.ModifyInstanceAttributeInput{ - InstanceID: aws.String("String"), // Required + InstanceId: aws.String("String"), // Required Attribute: aws.String("InstanceAttributeName"), BlockDeviceMappings: []*ec2.InstanceBlockDeviceMappingSpecification{ - &ec2.InstanceBlockDeviceMappingSpecification{ // Required + { // Required DeviceName: aws.String("String"), - EBS: &ec2.EBSInstanceBlockDeviceSpecification{ - DeleteOnTermination: aws.Boolean(true), - VolumeID: aws.String("String"), + Ebs: &ec2.EbsInstanceBlockDeviceSpecification{ + DeleteOnTermination: aws.Bool(true), + VolumeId: aws.String("String"), }, NoDevice: aws.String("String"), VirtualName: aws.String("String"), }, // More values... }, - DisableAPITermination: &ec2.AttributeBooleanValue{ - Value: aws.Boolean(true), + DisableApiTermination: &ec2.AttributeBooleanValue{ + Value: aws.Bool(true), }, - DryRun: aws.Boolean(true), - EBSOptimized: &ec2.AttributeBooleanValue{ - Value: aws.Boolean(true), + DryRun: aws.Bool(true), + EbsOptimized: &ec2.AttributeBooleanValue{ + Value: aws.Bool(true), }, Groups: []*string{ aws.String("String"), // Required @@ -5063,14 +3993,14 @@ func ExampleEC2_ModifyInstanceAttribute() { Kernel: &ec2.AttributeValue{ Value: aws.String("String"), }, - RAMDisk: &ec2.AttributeValue{ - Value: aws.String("String"), - }, - SRIOVNetSupport: &ec2.AttributeValue{ + Ramdisk: &ec2.AttributeValue{ Value: aws.String("String"), }, SourceDestCheck: &ec2.AttributeBooleanValue{ - Value: aws.Boolean(true), + Value: aws.Bool(true), + }, + SriovNetSupport: &ec2.AttributeValue{ + Value: aws.String("String"), }, UserData: &ec2.BlobAttributeValue{ Value: []byte("PAYLOAD"), @@ -5080,78 +4010,62 @@ func ExampleEC2_ModifyInstanceAttribute() { resp, err := svc.ModifyInstanceAttribute(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_ModifyNetworkInterfaceAttribute() { svc := ec2.New(nil) params := &ec2.ModifyNetworkInterfaceAttributeInput{ - NetworkInterfaceID: aws.String("String"), // Required + NetworkInterfaceId: aws.String("String"), // Required Attachment: &ec2.NetworkInterfaceAttachmentChanges{ - AttachmentID: aws.String("String"), - DeleteOnTermination: aws.Boolean(true), + AttachmentId: aws.String("String"), + DeleteOnTermination: aws.Bool(true), }, Description: &ec2.AttributeValue{ Value: aws.String("String"), }, - DryRun: aws.Boolean(true), + DryRun: aws.Bool(true), Groups: []*string{ aws.String("String"), // Required // More values... }, SourceDestCheck: &ec2.AttributeBooleanValue{ - Value: aws.Boolean(true), + Value: aws.Bool(true), }, } resp, err := svc.ModifyNetworkInterfaceAttribute(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_ModifyReservedInstances() { svc := ec2.New(nil) params := &ec2.ModifyReservedInstancesInput{ - ReservedInstancesIDs: []*string{ // Required + ReservedInstancesIds: []*string{ // Required aws.String("String"), // Required // More values... }, TargetConfigurations: []*ec2.ReservedInstancesConfiguration{ // Required - &ec2.ReservedInstancesConfiguration{ // Required + { // Required AvailabilityZone: aws.String("String"), - InstanceCount: aws.Long(1), + InstanceCount: aws.Int64(1), InstanceType: aws.String("InstanceType"), Platform: aws.String("String"), }, @@ -5162,53 +4076,45 @@ func ExampleEC2_ModifyReservedInstances() { resp, err := svc.ModifyReservedInstances(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_ModifySnapshotAttribute() { svc := ec2.New(nil) params := &ec2.ModifySnapshotAttributeInput{ - SnapshotID: aws.String("String"), // Required + SnapshotId: aws.String("String"), // Required Attribute: aws.String("SnapshotAttributeName"), CreateVolumePermission: &ec2.CreateVolumePermissionModifications{ Add: []*ec2.CreateVolumePermission{ - &ec2.CreateVolumePermission{ // Required + { // Required Group: aws.String("PermissionGroup"), - UserID: aws.String("String"), + UserId: aws.String("String"), }, // More values... }, Remove: []*ec2.CreateVolumePermission{ - &ec2.CreateVolumePermission{ // Required + { // Required Group: aws.String("PermissionGroup"), - UserID: aws.String("String"), + UserId: aws.String("String"), }, // More values... }, }, - DryRun: aws.Boolean(true), + DryRun: aws.Bool(true), GroupNames: []*string{ aws.String("String"), // Required // More values... }, - OperationType: aws.String("String"), - UserIDs: []*string{ + OperationType: aws.String("OperationType"), + UserIds: []*string{ aws.String("String"), // Required // More values... }, @@ -5216,277 +4122,205 @@ func ExampleEC2_ModifySnapshotAttribute() { resp, err := svc.ModifySnapshotAttribute(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_ModifySubnetAttribute() { svc := ec2.New(nil) params := &ec2.ModifySubnetAttributeInput{ - SubnetID: aws.String("String"), // Required - MapPublicIPOnLaunch: &ec2.AttributeBooleanValue{ - Value: aws.Boolean(true), + SubnetId: aws.String("String"), // Required + MapPublicIpOnLaunch: &ec2.AttributeBooleanValue{ + Value: aws.Bool(true), }, } resp, err := svc.ModifySubnetAttribute(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } -func ExampleEC2_ModifyVPCAttribute() { +func ExampleEC2_ModifyVolumeAttribute() { svc := ec2.New(nil) - params := &ec2.ModifyVPCAttributeInput{ - VPCID: aws.String("String"), // Required - EnableDNSHostnames: &ec2.AttributeBooleanValue{ - Value: aws.Boolean(true), - }, - EnableDNSSupport: &ec2.AttributeBooleanValue{ - Value: aws.Boolean(true), + params := &ec2.ModifyVolumeAttributeInput{ + VolumeId: aws.String("String"), // Required + AutoEnableIO: &ec2.AttributeBooleanValue{ + Value: aws.Bool(true), }, + DryRun: aws.Bool(true), } - resp, err := svc.ModifyVPCAttribute(params) + resp, err := svc.ModifyVolumeAttribute(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } -func ExampleEC2_ModifyVPCEndpoint() { +func ExampleEC2_ModifyVpcAttribute() { svc := ec2.New(nil) - params := &ec2.ModifyVPCEndpointInput{ - VPCEndpointID: aws.String("String"), // Required - AddRouteTableIDs: []*string{ - aws.String("String"), // Required - // More values... + params := &ec2.ModifyVpcAttributeInput{ + VpcId: aws.String("String"), // Required + EnableDnsHostnames: &ec2.AttributeBooleanValue{ + Value: aws.Bool(true), }, - DryRun: aws.Boolean(true), - PolicyDocument: aws.String("String"), - RemoveRouteTableIDs: []*string{ - aws.String("String"), // Required - // More values... + EnableDnsSupport: &ec2.AttributeBooleanValue{ + Value: aws.Bool(true), }, - ResetPolicy: aws.Boolean(true), } - resp, err := svc.ModifyVPCEndpoint(params) + resp, err := svc.ModifyVpcAttribute(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } -func ExampleEC2_ModifyVolumeAttribute() { +func ExampleEC2_ModifyVpcEndpoint() { svc := ec2.New(nil) - params := &ec2.ModifyVolumeAttributeInput{ - VolumeID: aws.String("String"), // Required - AutoEnableIO: &ec2.AttributeBooleanValue{ - Value: aws.Boolean(true), + params := &ec2.ModifyVpcEndpointInput{ + VpcEndpointId: aws.String("String"), // Required + AddRouteTableIds: []*string{ + aws.String("String"), // Required + // More values... }, - DryRun: aws.Boolean(true), + DryRun: aws.Bool(true), + PolicyDocument: aws.String("String"), + RemoveRouteTableIds: []*string{ + aws.String("String"), // Required + // More values... + }, + ResetPolicy: aws.Bool(true), } - resp, err := svc.ModifyVolumeAttribute(params) + resp, err := svc.ModifyVpcEndpoint(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_MonitorInstances() { svc := ec2.New(nil) params := &ec2.MonitorInstancesInput{ - InstanceIDs: []*string{ // Required + InstanceIds: []*string{ // Required aws.String("String"), // Required // More values... }, - DryRun: aws.Boolean(true), + DryRun: aws.Bool(true), } resp, err := svc.MonitorInstances(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } -func ExampleEC2_MoveAddressToVPC() { +func ExampleEC2_MoveAddressToVpc() { svc := ec2.New(nil) - params := &ec2.MoveAddressToVPCInput{ - PublicIP: aws.String("String"), // Required - DryRun: aws.Boolean(true), + params := &ec2.MoveAddressToVpcInput{ + PublicIp: aws.String("String"), // Required + DryRun: aws.Bool(true), } - resp, err := svc.MoveAddressToVPC(params) + resp, err := svc.MoveAddressToVpc(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_PurchaseReservedInstancesOffering() { svc := ec2.New(nil) params := &ec2.PurchaseReservedInstancesOfferingInput{ - InstanceCount: aws.Long(1), // Required - ReservedInstancesOfferingID: aws.String("String"), // Required - DryRun: aws.Boolean(true), + InstanceCount: aws.Int64(1), // Required + ReservedInstancesOfferingId: aws.String("String"), // Required + DryRun: aws.Bool(true), LimitPrice: &ec2.ReservedInstanceLimitPrice{ - Amount: aws.Double(1.0), + Amount: aws.Float64(1.0), CurrencyCode: aws.String("CurrencyCodeValues"), }, } resp, err := svc.PurchaseReservedInstancesOffering(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_RebootInstances() { svc := ec2.New(nil) params := &ec2.RebootInstancesInput{ - InstanceIDs: []*string{ // Required + InstanceIds: []*string{ // Required aws.String("String"), // Required // More values... }, - DryRun: aws.Boolean(true), + DryRun: aws.Bool(true), } resp, err := svc.RebootInstances(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_RegisterImage() { @@ -5496,14 +4330,14 @@ func ExampleEC2_RegisterImage() { Name: aws.String("String"), // Required Architecture: aws.String("ArchitectureValues"), BlockDeviceMappings: []*ec2.BlockDeviceMapping{ - &ec2.BlockDeviceMapping{ // Required + { // Required DeviceName: aws.String("String"), - EBS: &ec2.EBSBlockDevice{ - DeleteOnTermination: aws.Boolean(true), - Encrypted: aws.Boolean(true), - IOPS: aws.Long(1), - SnapshotID: aws.String("String"), - VolumeSize: aws.Long(1), + Ebs: &ec2.EbsBlockDevice{ + DeleteOnTermination: aws.Bool(true), + Encrypted: aws.Bool(true), + Iops: aws.Int64(1), + SnapshotId: aws.String("String"), + VolumeSize: aws.Int64(1), VolumeType: aws.String("VolumeType"), }, NoDevice: aws.String("String"), @@ -5512,222 +4346,166 @@ func ExampleEC2_RegisterImage() { // More values... }, Description: aws.String("String"), - DryRun: aws.Boolean(true), + DryRun: aws.Bool(true), ImageLocation: aws.String("String"), - KernelID: aws.String("String"), - RAMDiskID: aws.String("String"), + KernelId: aws.String("String"), + RamdiskId: aws.String("String"), RootDeviceName: aws.String("String"), - SRIOVNetSupport: aws.String("String"), + SriovNetSupport: aws.String("String"), VirtualizationType: aws.String("String"), } resp, err := svc.RegisterImage(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } -func ExampleEC2_RejectVPCPeeringConnection() { +func ExampleEC2_RejectVpcPeeringConnection() { svc := ec2.New(nil) - params := &ec2.RejectVPCPeeringConnectionInput{ - VPCPeeringConnectionID: aws.String("String"), // Required - DryRun: aws.Boolean(true), + params := &ec2.RejectVpcPeeringConnectionInput{ + VpcPeeringConnectionId: aws.String("String"), // Required + DryRun: aws.Bool(true), } - resp, err := svc.RejectVPCPeeringConnection(params) + resp, err := svc.RejectVpcPeeringConnection(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_ReleaseAddress() { svc := ec2.New(nil) params := &ec2.ReleaseAddressInput{ - AllocationID: aws.String("String"), - DryRun: aws.Boolean(true), - PublicIP: aws.String("String"), + AllocationId: aws.String("String"), + DryRun: aws.Bool(true), + PublicIp: aws.String("String"), } resp, err := svc.ReleaseAddress(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } -func ExampleEC2_ReplaceNetworkACLAssociation() { +func ExampleEC2_ReplaceNetworkAclAssociation() { svc := ec2.New(nil) - params := &ec2.ReplaceNetworkACLAssociationInput{ - AssociationID: aws.String("String"), // Required - NetworkACLID: aws.String("String"), // Required - DryRun: aws.Boolean(true), + params := &ec2.ReplaceNetworkAclAssociationInput{ + AssociationId: aws.String("String"), // Required + NetworkAclId: aws.String("String"), // Required + DryRun: aws.Bool(true), } - resp, err := svc.ReplaceNetworkACLAssociation(params) + resp, err := svc.ReplaceNetworkAclAssociation(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } -func ExampleEC2_ReplaceNetworkACLEntry() { +func ExampleEC2_ReplaceNetworkAclEntry() { svc := ec2.New(nil) - params := &ec2.ReplaceNetworkACLEntryInput{ - CIDRBlock: aws.String("String"), // Required - Egress: aws.Boolean(true), // Required - NetworkACLID: aws.String("String"), // Required + params := &ec2.ReplaceNetworkAclEntryInput{ + CidrBlock: aws.String("String"), // Required + Egress: aws.Bool(true), // Required + NetworkAclId: aws.String("String"), // Required Protocol: aws.String("String"), // Required RuleAction: aws.String("RuleAction"), // Required - RuleNumber: aws.Long(1), // Required - DryRun: aws.Boolean(true), - ICMPTypeCode: &ec2.ICMPTypeCode{ - Code: aws.Long(1), - Type: aws.Long(1), + RuleNumber: aws.Int64(1), // Required + DryRun: aws.Bool(true), + IcmpTypeCode: &ec2.IcmpTypeCode{ + Code: aws.Int64(1), + Type: aws.Int64(1), }, PortRange: &ec2.PortRange{ - From: aws.Long(1), - To: aws.Long(1), + From: aws.Int64(1), + To: aws.Int64(1), }, } - resp, err := svc.ReplaceNetworkACLEntry(params) + resp, err := svc.ReplaceNetworkAclEntry(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_ReplaceRoute() { svc := ec2.New(nil) params := &ec2.ReplaceRouteInput{ - DestinationCIDRBlock: aws.String("String"), // Required - RouteTableID: aws.String("String"), // Required - DryRun: aws.Boolean(true), - GatewayID: aws.String("String"), - InstanceID: aws.String("String"), - NetworkInterfaceID: aws.String("String"), - VPCPeeringConnectionID: aws.String("String"), + DestinationCidrBlock: aws.String("String"), // Required + RouteTableId: aws.String("String"), // Required + DryRun: aws.Bool(true), + GatewayId: aws.String("String"), + InstanceId: aws.String("String"), + NetworkInterfaceId: aws.String("String"), + VpcPeeringConnectionId: aws.String("String"), } resp, err := svc.ReplaceRoute(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_ReplaceRouteTableAssociation() { svc := ec2.New(nil) params := &ec2.ReplaceRouteTableAssociationInput{ - AssociationID: aws.String("String"), // Required - RouteTableID: aws.String("String"), // Required - DryRun: aws.Boolean(true), + AssociationId: aws.String("String"), // Required + RouteTableId: aws.String("String"), // Required + DryRun: aws.Bool(true), } resp, err := svc.ReplaceRouteTableAssociation(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_ReportInstanceStatus() { @@ -5744,29 +4522,21 @@ func ExampleEC2_ReportInstanceStatus() { }, Status: aws.String("ReportStatusType"), // Required Description: aws.String("String"), - DryRun: aws.Boolean(true), + DryRun: aws.Bool(true), EndTime: aws.Time(time.Now()), StartTime: aws.Time(time.Now()), } resp, err := svc.ReportInstanceStatus(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_RequestSpotFleet() { @@ -5774,19 +4544,19 @@ func ExampleEC2_RequestSpotFleet() { params := &ec2.RequestSpotFleetInput{ SpotFleetRequestConfig: &ec2.SpotFleetRequestConfigData{ // Required - IAMFleetRole: aws.String("String"), // Required - LaunchSpecifications: []*ec2.LaunchSpecification{ // Required - &ec2.LaunchSpecification{ // Required + IamFleetRole: aws.String("String"), // Required + LaunchSpecifications: []*ec2.SpotFleetLaunchSpecification{ // Required + { // Required AddressingType: aws.String("String"), BlockDeviceMappings: []*ec2.BlockDeviceMapping{ - &ec2.BlockDeviceMapping{ // Required + { // Required DeviceName: aws.String("String"), - EBS: &ec2.EBSBlockDevice{ - DeleteOnTermination: aws.Boolean(true), - Encrypted: aws.Boolean(true), - IOPS: aws.Long(1), - SnapshotID: aws.String("String"), - VolumeSize: aws.Long(1), + Ebs: &ec2.EbsBlockDevice{ + DeleteOnTermination: aws.Bool(true), + Encrypted: aws.Bool(true), + Iops: aws.Int64(1), + SnapshotId: aws.String("String"), + VolumeSize: aws.Int64(1), VolumeType: aws.String("VolumeType"), }, NoDevice: aws.String("String"), @@ -5794,39 +4564,39 @@ func ExampleEC2_RequestSpotFleet() { }, // More values... }, - EBSOptimized: aws.Boolean(true), - IAMInstanceProfile: &ec2.IAMInstanceProfileSpecification{ - ARN: aws.String("String"), + EbsOptimized: aws.Bool(true), + IamInstanceProfile: &ec2.IamInstanceProfileSpecification{ + Arn: aws.String("String"), Name: aws.String("String"), }, - ImageID: aws.String("String"), + ImageId: aws.String("String"), InstanceType: aws.String("InstanceType"), - KernelID: aws.String("String"), + KernelId: aws.String("String"), KeyName: aws.String("String"), - Monitoring: &ec2.RunInstancesMonitoringEnabled{ - Enabled: aws.Boolean(true), // Required + Monitoring: &ec2.SpotFleetMonitoring{ + Enabled: aws.Bool(true), }, NetworkInterfaces: []*ec2.InstanceNetworkInterfaceSpecification{ - &ec2.InstanceNetworkInterfaceSpecification{ // Required - AssociatePublicIPAddress: aws.Boolean(true), - DeleteOnTermination: aws.Boolean(true), + { // Required + AssociatePublicIpAddress: aws.Bool(true), + DeleteOnTermination: aws.Bool(true), Description: aws.String("String"), - DeviceIndex: aws.Long(1), + DeviceIndex: aws.Int64(1), Groups: []*string{ aws.String("String"), // Required // More values... }, - NetworkInterfaceID: aws.String("String"), - PrivateIPAddress: aws.String("String"), - PrivateIPAddresses: []*ec2.PrivateIPAddressSpecification{ - &ec2.PrivateIPAddressSpecification{ // Required - PrivateIPAddress: aws.String("String"), // Required - Primary: aws.Boolean(true), + NetworkInterfaceId: aws.String("String"), + PrivateIpAddress: aws.String("String"), + PrivateIpAddresses: []*ec2.PrivateIpAddressSpecification{ + { // Required + PrivateIpAddress: aws.String("String"), // Required + Primary: aws.Bool(true), }, // More values... }, - SecondaryPrivateIPAddressCount: aws.Long(1), - SubnetID: aws.String("String"), + SecondaryPrivateIpAddressCount: aws.Int64(1), + SubnetId: aws.String("String"), }, // More values... }, @@ -5834,47 +4604,42 @@ func ExampleEC2_RequestSpotFleet() { AvailabilityZone: aws.String("String"), GroupName: aws.String("String"), }, - RAMDiskID: aws.String("String"), + RamdiskId: aws.String("String"), SecurityGroups: []*ec2.GroupIdentifier{ - &ec2.GroupIdentifier{ // Required - GroupID: aws.String("String"), + { // Required + GroupId: aws.String("String"), GroupName: aws.String("String"), }, // More values... }, - SubnetID: aws.String("String"), - UserData: aws.String("String"), + SpotPrice: aws.String("String"), + SubnetId: aws.String("String"), + UserData: aws.String("String"), + WeightedCapacity: aws.Float64(1.0), }, // More values... }, SpotPrice: aws.String("String"), // Required - TargetCapacity: aws.Long(1), // Required + TargetCapacity: aws.Int64(1), // Required + AllocationStrategy: aws.String("AllocationStrategy"), ClientToken: aws.String("String"), - TerminateInstancesWithExpiration: aws.Boolean(true), + TerminateInstancesWithExpiration: aws.Bool(true), ValidFrom: aws.Time(time.Now()), ValidUntil: aws.Time(time.Now()), }, - DryRun: aws.Boolean(true), + DryRun: aws.Bool(true), } resp, err := svc.RequestSpotFleet(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_RequestSpotInstances() { @@ -5884,20 +4649,20 @@ func ExampleEC2_RequestSpotInstances() { SpotPrice: aws.String("String"), // Required AvailabilityZoneGroup: aws.String("String"), ClientToken: aws.String("String"), - DryRun: aws.Boolean(true), - InstanceCount: aws.Long(1), + DryRun: aws.Bool(true), + InstanceCount: aws.Int64(1), LaunchGroup: aws.String("String"), LaunchSpecification: &ec2.RequestSpotLaunchSpecification{ AddressingType: aws.String("String"), BlockDeviceMappings: []*ec2.BlockDeviceMapping{ - &ec2.BlockDeviceMapping{ // Required + { // Required DeviceName: aws.String("String"), - EBS: &ec2.EBSBlockDevice{ - DeleteOnTermination: aws.Boolean(true), - Encrypted: aws.Boolean(true), - IOPS: aws.Long(1), - SnapshotID: aws.String("String"), - VolumeSize: aws.Long(1), + Ebs: &ec2.EbsBlockDevice{ + DeleteOnTermination: aws.Bool(true), + Encrypted: aws.Bool(true), + Iops: aws.Int64(1), + SnapshotId: aws.String("String"), + VolumeSize: aws.Int64(1), VolumeType: aws.String("VolumeType"), }, NoDevice: aws.String("String"), @@ -5905,39 +4670,39 @@ func ExampleEC2_RequestSpotInstances() { }, // More values... }, - EBSOptimized: aws.Boolean(true), - IAMInstanceProfile: &ec2.IAMInstanceProfileSpecification{ - ARN: aws.String("String"), + EbsOptimized: aws.Bool(true), + IamInstanceProfile: &ec2.IamInstanceProfileSpecification{ + Arn: aws.String("String"), Name: aws.String("String"), }, - ImageID: aws.String("String"), + ImageId: aws.String("String"), InstanceType: aws.String("InstanceType"), - KernelID: aws.String("String"), + KernelId: aws.String("String"), KeyName: aws.String("String"), Monitoring: &ec2.RunInstancesMonitoringEnabled{ - Enabled: aws.Boolean(true), // Required + Enabled: aws.Bool(true), // Required }, NetworkInterfaces: []*ec2.InstanceNetworkInterfaceSpecification{ - &ec2.InstanceNetworkInterfaceSpecification{ // Required - AssociatePublicIPAddress: aws.Boolean(true), - DeleteOnTermination: aws.Boolean(true), + { // Required + AssociatePublicIpAddress: aws.Bool(true), + DeleteOnTermination: aws.Bool(true), Description: aws.String("String"), - DeviceIndex: aws.Long(1), + DeviceIndex: aws.Int64(1), Groups: []*string{ aws.String("String"), // Required // More values... }, - NetworkInterfaceID: aws.String("String"), - PrivateIPAddress: aws.String("String"), - PrivateIPAddresses: []*ec2.PrivateIPAddressSpecification{ - &ec2.PrivateIPAddressSpecification{ // Required - PrivateIPAddress: aws.String("String"), // Required - Primary: aws.Boolean(true), + NetworkInterfaceId: aws.String("String"), + PrivateIpAddress: aws.String("String"), + PrivateIpAddresses: []*ec2.PrivateIpAddressSpecification{ + { // Required + PrivateIpAddress: aws.String("String"), // Required + Primary: aws.Bool(true), }, // More values... }, - SecondaryPrivateIPAddressCount: aws.Long(1), - SubnetID: aws.String("String"), + SecondaryPrivateIpAddressCount: aws.Int64(1), + SubnetId: aws.String("String"), }, // More values... }, @@ -5945,8 +4710,8 @@ func ExampleEC2_RequestSpotInstances() { AvailabilityZone: aws.String("String"), GroupName: aws.String("String"), }, - RAMDiskID: aws.String("String"), - SecurityGroupIDs: []*string{ + RamdiskId: aws.String("String"), + SecurityGroupIds: []*string{ aws.String("String"), // Required // More values... }, @@ -5954,7 +4719,7 @@ func ExampleEC2_RequestSpotInstances() { aws.String("String"), // Required // More values... }, - SubnetID: aws.String("String"), + SubnetId: aws.String("String"), UserData: aws.String("String"), }, Type: aws.String("SpotInstanceType"), @@ -5964,22 +4729,14 @@ func ExampleEC2_RequestSpotInstances() { resp, err := svc.RequestSpotInstances(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_ResetImageAttribute() { @@ -5987,28 +4744,20 @@ func ExampleEC2_ResetImageAttribute() { params := &ec2.ResetImageAttributeInput{ Attribute: aws.String("ResetImageAttributeName"), // Required - ImageID: aws.String("String"), // Required - DryRun: aws.Boolean(true), + ImageId: aws.String("String"), // Required + DryRun: aws.Bool(true), } resp, err := svc.ResetImageAttribute(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_ResetInstanceAttribute() { @@ -6016,57 +4765,41 @@ func ExampleEC2_ResetInstanceAttribute() { params := &ec2.ResetInstanceAttributeInput{ Attribute: aws.String("InstanceAttributeName"), // Required - InstanceID: aws.String("String"), // Required - DryRun: aws.Boolean(true), + InstanceId: aws.String("String"), // Required + DryRun: aws.Bool(true), } resp, err := svc.ResetInstanceAttribute(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_ResetNetworkInterfaceAttribute() { svc := ec2.New(nil) params := &ec2.ResetNetworkInterfaceAttributeInput{ - NetworkInterfaceID: aws.String("String"), // Required - DryRun: aws.Boolean(true), + NetworkInterfaceId: aws.String("String"), // Required + DryRun: aws.Bool(true), SourceDestCheck: aws.String("String"), } resp, err := svc.ResetNetworkInterfaceAttribute(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_ResetSnapshotAttribute() { @@ -6074,200 +4807,168 @@ func ExampleEC2_ResetSnapshotAttribute() { params := &ec2.ResetSnapshotAttributeInput{ Attribute: aws.String("SnapshotAttributeName"), // Required - SnapshotID: aws.String("String"), // Required - DryRun: aws.Boolean(true), + SnapshotId: aws.String("String"), // Required + DryRun: aws.Bool(true), } resp, err := svc.ResetSnapshotAttribute(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_RestoreAddressToClassic() { svc := ec2.New(nil) params := &ec2.RestoreAddressToClassicInput{ - PublicIP: aws.String("String"), // Required - DryRun: aws.Boolean(true), + PublicIp: aws.String("String"), // Required + DryRun: aws.Bool(true), } resp, err := svc.RestoreAddressToClassic(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_RevokeSecurityGroupEgress() { svc := ec2.New(nil) params := &ec2.RevokeSecurityGroupEgressInput{ - GroupID: aws.String("String"), // Required - CIDRIP: aws.String("String"), - DryRun: aws.Boolean(true), - FromPort: aws.Long(1), - IPPermissions: []*ec2.IPPermission{ - &ec2.IPPermission{ // Required - FromPort: aws.Long(1), - IPProtocol: aws.String("String"), - IPRanges: []*ec2.IPRange{ - &ec2.IPRange{ // Required - CIDRIP: aws.String("String"), + GroupId: aws.String("String"), // Required + CidrIp: aws.String("String"), + DryRun: aws.Bool(true), + FromPort: aws.Int64(1), + IpPermissions: []*ec2.IpPermission{ + { // Required + FromPort: aws.Int64(1), + IpProtocol: aws.String("String"), + IpRanges: []*ec2.IpRange{ + { // Required + CidrIp: aws.String("String"), }, // More values... }, - PrefixListIDs: []*ec2.PrefixListID{ - &ec2.PrefixListID{ // Required - PrefixListID: aws.String("String"), + PrefixListIds: []*ec2.PrefixListId{ + { // Required + PrefixListId: aws.String("String"), }, // More values... }, - ToPort: aws.Long(1), - UserIDGroupPairs: []*ec2.UserIDGroupPair{ - &ec2.UserIDGroupPair{ // Required - GroupID: aws.String("String"), + ToPort: aws.Int64(1), + UserIdGroupPairs: []*ec2.UserIdGroupPair{ + { // Required + GroupId: aws.String("String"), GroupName: aws.String("String"), - UserID: aws.String("String"), + UserId: aws.String("String"), }, // More values... }, }, // More values... }, - IPProtocol: aws.String("String"), + IpProtocol: aws.String("String"), SourceSecurityGroupName: aws.String("String"), - SourceSecurityGroupOwnerID: aws.String("String"), - ToPort: aws.Long(1), + SourceSecurityGroupOwnerId: aws.String("String"), + ToPort: aws.Int64(1), } resp, err := svc.RevokeSecurityGroupEgress(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_RevokeSecurityGroupIngress() { svc := ec2.New(nil) params := &ec2.RevokeSecurityGroupIngressInput{ - CIDRIP: aws.String("String"), - DryRun: aws.Boolean(true), - FromPort: aws.Long(1), - GroupID: aws.String("String"), + CidrIp: aws.String("String"), + DryRun: aws.Bool(true), + FromPort: aws.Int64(1), + GroupId: aws.String("String"), GroupName: aws.String("String"), - IPPermissions: []*ec2.IPPermission{ - &ec2.IPPermission{ // Required - FromPort: aws.Long(1), - IPProtocol: aws.String("String"), - IPRanges: []*ec2.IPRange{ - &ec2.IPRange{ // Required - CIDRIP: aws.String("String"), + IpPermissions: []*ec2.IpPermission{ + { // Required + FromPort: aws.Int64(1), + IpProtocol: aws.String("String"), + IpRanges: []*ec2.IpRange{ + { // Required + CidrIp: aws.String("String"), }, // More values... }, - PrefixListIDs: []*ec2.PrefixListID{ - &ec2.PrefixListID{ // Required - PrefixListID: aws.String("String"), + PrefixListIds: []*ec2.PrefixListId{ + { // Required + PrefixListId: aws.String("String"), }, // More values... }, - ToPort: aws.Long(1), - UserIDGroupPairs: []*ec2.UserIDGroupPair{ - &ec2.UserIDGroupPair{ // Required - GroupID: aws.String("String"), + ToPort: aws.Int64(1), + UserIdGroupPairs: []*ec2.UserIdGroupPair{ + { // Required + GroupId: aws.String("String"), GroupName: aws.String("String"), - UserID: aws.String("String"), + UserId: aws.String("String"), }, // More values... }, }, // More values... }, - IPProtocol: aws.String("String"), + IpProtocol: aws.String("String"), SourceSecurityGroupName: aws.String("String"), - SourceSecurityGroupOwnerID: aws.String("String"), - ToPort: aws.Long(1), + SourceSecurityGroupOwnerId: aws.String("String"), + ToPort: aws.Int64(1), } resp, err := svc.RevokeSecurityGroupIngress(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_RunInstances() { svc := ec2.New(nil) params := &ec2.RunInstancesInput{ - ImageID: aws.String("String"), // Required - MaxCount: aws.Long(1), // Required - MinCount: aws.Long(1), // Required + ImageId: aws.String("String"), // Required + MaxCount: aws.Int64(1), // Required + MinCount: aws.Int64(1), // Required AdditionalInfo: aws.String("String"), BlockDeviceMappings: []*ec2.BlockDeviceMapping{ - &ec2.BlockDeviceMapping{ // Required + { // Required DeviceName: aws.String("String"), - EBS: &ec2.EBSBlockDevice{ - DeleteOnTermination: aws.Boolean(true), - Encrypted: aws.Boolean(true), - IOPS: aws.Long(1), - SnapshotID: aws.String("String"), - VolumeSize: aws.Long(1), + Ebs: &ec2.EbsBlockDevice{ + DeleteOnTermination: aws.Bool(true), + Encrypted: aws.Bool(true), + Iops: aws.Int64(1), + SnapshotId: aws.String("String"), + VolumeSize: aws.Int64(1), VolumeType: aws.String("VolumeType"), }, NoDevice: aws.String("String"), @@ -6276,41 +4977,41 @@ func ExampleEC2_RunInstances() { // More values... }, ClientToken: aws.String("String"), - DisableAPITermination: aws.Boolean(true), - DryRun: aws.Boolean(true), - EBSOptimized: aws.Boolean(true), - IAMInstanceProfile: &ec2.IAMInstanceProfileSpecification{ - ARN: aws.String("String"), + DisableApiTermination: aws.Bool(true), + DryRun: aws.Bool(true), + EbsOptimized: aws.Bool(true), + IamInstanceProfile: &ec2.IamInstanceProfileSpecification{ + Arn: aws.String("String"), Name: aws.String("String"), }, InstanceInitiatedShutdownBehavior: aws.String("ShutdownBehavior"), InstanceType: aws.String("InstanceType"), - KernelID: aws.String("String"), + KernelId: aws.String("String"), KeyName: aws.String("String"), Monitoring: &ec2.RunInstancesMonitoringEnabled{ - Enabled: aws.Boolean(true), // Required + Enabled: aws.Bool(true), // Required }, NetworkInterfaces: []*ec2.InstanceNetworkInterfaceSpecification{ - &ec2.InstanceNetworkInterfaceSpecification{ // Required - AssociatePublicIPAddress: aws.Boolean(true), - DeleteOnTermination: aws.Boolean(true), + { // Required + AssociatePublicIpAddress: aws.Bool(true), + DeleteOnTermination: aws.Bool(true), Description: aws.String("String"), - DeviceIndex: aws.Long(1), + DeviceIndex: aws.Int64(1), Groups: []*string{ aws.String("String"), // Required // More values... }, - NetworkInterfaceID: aws.String("String"), - PrivateIPAddress: aws.String("String"), - PrivateIPAddresses: []*ec2.PrivateIPAddressSpecification{ - &ec2.PrivateIPAddressSpecification{ // Required - PrivateIPAddress: aws.String("String"), // Required - Primary: aws.Boolean(true), + NetworkInterfaceId: aws.String("String"), + PrivateIpAddress: aws.String("String"), + PrivateIpAddresses: []*ec2.PrivateIpAddressSpecification{ + { // Required + PrivateIpAddress: aws.String("String"), // Required + Primary: aws.Bool(true), }, // More values... }, - SecondaryPrivateIPAddressCount: aws.Long(1), - SubnetID: aws.String("String"), + SecondaryPrivateIpAddressCount: aws.Int64(1), + SubnetId: aws.String("String"), }, // More values... }, @@ -6319,9 +5020,9 @@ func ExampleEC2_RunInstances() { GroupName: aws.String("String"), Tenancy: aws.String("Tenancy"), }, - PrivateIPAddress: aws.String("String"), - RAMDiskID: aws.String("String"), - SecurityGroupIDs: []*string{ + PrivateIpAddress: aws.String("String"), + RamdiskId: aws.String("String"), + SecurityGroupIds: []*string{ aws.String("String"), // Required // More values... }, @@ -6329,183 +5030,135 @@ func ExampleEC2_RunInstances() { aws.String("String"), // Required // More values... }, - SubnetID: aws.String("String"), + SubnetId: aws.String("String"), UserData: aws.String("String"), } resp, err := svc.RunInstances(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_StartInstances() { svc := ec2.New(nil) params := &ec2.StartInstancesInput{ - InstanceIDs: []*string{ // Required + InstanceIds: []*string{ // Required aws.String("String"), // Required // More values... }, AdditionalInfo: aws.String("String"), - DryRun: aws.Boolean(true), + DryRun: aws.Bool(true), } resp, err := svc.StartInstances(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_StopInstances() { svc := ec2.New(nil) params := &ec2.StopInstancesInput{ - InstanceIDs: []*string{ // Required + InstanceIds: []*string{ // Required aws.String("String"), // Required // More values... }, - DryRun: aws.Boolean(true), - Force: aws.Boolean(true), + DryRun: aws.Bool(true), + Force: aws.Bool(true), } resp, err := svc.StopInstances(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_TerminateInstances() { svc := ec2.New(nil) params := &ec2.TerminateInstancesInput{ - InstanceIDs: []*string{ // Required + InstanceIds: []*string{ // Required aws.String("String"), // Required // More values... }, - DryRun: aws.Boolean(true), + DryRun: aws.Bool(true), } resp, err := svc.TerminateInstances(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } -func ExampleEC2_UnassignPrivateIPAddresses() { +func ExampleEC2_UnassignPrivateIpAddresses() { svc := ec2.New(nil) - params := &ec2.UnassignPrivateIPAddressesInput{ - NetworkInterfaceID: aws.String("String"), // Required - PrivateIPAddresses: []*string{ // Required + params := &ec2.UnassignPrivateIpAddressesInput{ + NetworkInterfaceId: aws.String("String"), // Required + PrivateIpAddresses: []*string{ // Required aws.String("String"), // Required // More values... }, } - resp, err := svc.UnassignPrivateIPAddresses(params) + resp, err := svc.UnassignPrivateIpAddresses(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleEC2_UnmonitorInstances() { svc := ec2.New(nil) params := &ec2.UnmonitorInstancesInput{ - InstanceIDs: []*string{ // Required + InstanceIds: []*string{ // Required aws.String("String"), // Required // More values... }, - DryRun: aws.Boolean(true), + DryRun: aws.Bool(true), } resp, err := svc.UnmonitorInstances(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/ec2/service.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/ec2/service.go index 792be71fb322..102c8fe026d7 100644 --- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/ec2/service.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/ec2/service.go @@ -4,27 +4,36 @@ package ec2 import ( "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/defaults" + "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/aws/service" + "github.com/aws/aws-sdk-go/aws/service/serviceinfo" "github.com/aws/aws-sdk-go/internal/protocol/ec2query" "github.com/aws/aws-sdk-go/internal/signer/v4" ) -// EC2 is a client for Amazon EC2. +// Amazon Elastic Compute Cloud (Amazon EC2) provides resizable computing capacity +// in the Amazon Web Services (AWS) cloud. Using Amazon EC2 eliminates your +// need to invest in hardware up front, so you can develop and deploy applications +// faster. type EC2 struct { - *aws.Service + *service.Service } // Used for custom service initialization logic -var initService func(*aws.Service) +var initService func(*service.Service) // Used for custom request initialization logic -var initRequest func(*aws.Request) +var initRequest func(*request.Request) // New returns a new EC2 client. func New(config *aws.Config) *EC2 { - service := &aws.Service{ - Config: aws.DefaultConfig.Merge(config), - ServiceName: "ec2", - APIVersion: "2015-04-15", + service := &service.Service{ + ServiceInfo: serviceinfo.ServiceInfo{ + Config: defaults.DefaultConfig.Merge(config), + ServiceName: "ec2", + APIVersion: "2015-04-15", + }, } service.Initialize() @@ -45,8 +54,8 @@ func New(config *aws.Config) *EC2 { // newRequest creates a new request for a EC2 operation and runs any // custom request initialization. -func (c *EC2) newRequest(op *aws.Operation, params, data interface{}) *aws.Request { - req := aws.NewRequest(c.Service, op, params, data) +func (c *EC2) newRequest(op *request.Operation, params, data interface{}) *request.Request { + req := c.NewRequest(op, params, data) // Run custom request initialization if present if initRequest != nil { diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/elb/api.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/elb/api.go index 18fa15edf227..14126085b6af 100644 --- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/elb/api.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/elb/api.go @@ -4,32 +4,27 @@ package elb import ( - "sync" "time" - "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/awsutil" + "github.com/aws/aws-sdk-go/aws/request" ) -var oprw sync.Mutex +const opAddTags = "AddTags" // AddTagsRequest generates a request for the AddTags operation. -func (c *ELB) AddTagsRequest(input *AddTagsInput) (req *aws.Request, output *AddTagsOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opAddTags == nil { - opAddTags = &aws.Operation{ - Name: "AddTags", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *ELB) AddTagsRequest(input *AddTagsInput) (req *request.Request, output *AddTagsOutput) { + op := &request.Operation{ + Name: opAddTags, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &AddTagsInput{} } - req = c.newRequest(opAddTags, input, output) + req = c.newRequest(op, input, output) output = &AddTagsOutput{} req.Data = output return @@ -41,7 +36,7 @@ func (c *ELB) AddTagsRequest(input *AddTagsInput) (req *aws.Request, output *Add // Each tag consists of a key and an optional value. If a tag with the same // key is already associated with the load balancer, AddTags updates its value. // -// For more information, see Tagging (http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/TerminologyandKeyConcepts.html#tagging-elb) +// For more information, see Tag Your Load Balancer (http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/add-remove-tags.html) // in the Elastic Load Balancing Developer Guide. func (c *ELB) AddTags(input *AddTagsInput) (*AddTagsOutput, error) { req, out := c.AddTagsRequest(input) @@ -49,26 +44,21 @@ func (c *ELB) AddTags(input *AddTagsInput) (*AddTagsOutput, error) { return out, err } -var opAddTags *aws.Operation +const opApplySecurityGroupsToLoadBalancer = "ApplySecurityGroupsToLoadBalancer" // ApplySecurityGroupsToLoadBalancerRequest generates a request for the ApplySecurityGroupsToLoadBalancer operation. -func (c *ELB) ApplySecurityGroupsToLoadBalancerRequest(input *ApplySecurityGroupsToLoadBalancerInput) (req *aws.Request, output *ApplySecurityGroupsToLoadBalancerOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opApplySecurityGroupsToLoadBalancer == nil { - opApplySecurityGroupsToLoadBalancer = &aws.Operation{ - Name: "ApplySecurityGroupsToLoadBalancer", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *ELB) ApplySecurityGroupsToLoadBalancerRequest(input *ApplySecurityGroupsToLoadBalancerInput) (req *request.Request, output *ApplySecurityGroupsToLoadBalancerOutput) { + op := &request.Operation{ + Name: opApplySecurityGroupsToLoadBalancer, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &ApplySecurityGroupsToLoadBalancerInput{} } - req = c.newRequest(opApplySecurityGroupsToLoadBalancer, input, output) + req = c.newRequest(op, input, output) output = &ApplySecurityGroupsToLoadBalancerOutput{} req.Data = output return @@ -78,7 +68,7 @@ func (c *ELB) ApplySecurityGroupsToLoadBalancerRequest(input *ApplySecurityGroup // private cloud (VPC). The specified security groups override the previously // associated security groups. // -// For more information, see Manage Security Groups for Amazon VPC (http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/USVPC_ApplySG.html) +// For more information, see Security Groups for Load Balancers in a VPC (http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/elb-security-groups.html#elb-vpc-security-groups) // in the Elastic Load Balancing Developer Guide. func (c *ELB) ApplySecurityGroupsToLoadBalancer(input *ApplySecurityGroupsToLoadBalancerInput) (*ApplySecurityGroupsToLoadBalancerOutput, error) { req, out := c.ApplySecurityGroupsToLoadBalancerRequest(input) @@ -86,26 +76,21 @@ func (c *ELB) ApplySecurityGroupsToLoadBalancer(input *ApplySecurityGroupsToLoad return out, err } -var opApplySecurityGroupsToLoadBalancer *aws.Operation +const opAttachLoadBalancerToSubnets = "AttachLoadBalancerToSubnets" // AttachLoadBalancerToSubnetsRequest generates a request for the AttachLoadBalancerToSubnets operation. -func (c *ELB) AttachLoadBalancerToSubnetsRequest(input *AttachLoadBalancerToSubnetsInput) (req *aws.Request, output *AttachLoadBalancerToSubnetsOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opAttachLoadBalancerToSubnets == nil { - opAttachLoadBalancerToSubnets = &aws.Operation{ - Name: "AttachLoadBalancerToSubnets", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *ELB) AttachLoadBalancerToSubnetsRequest(input *AttachLoadBalancerToSubnetsInput) (req *request.Request, output *AttachLoadBalancerToSubnetsOutput) { + op := &request.Operation{ + Name: opAttachLoadBalancerToSubnets, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &AttachLoadBalancerToSubnetsInput{} } - req = c.newRequest(opAttachLoadBalancerToSubnets, input, output) + req = c.newRequest(op, input, output) output = &AttachLoadBalancerToSubnetsOutput{} req.Data = output return @@ -115,7 +100,8 @@ func (c *ELB) AttachLoadBalancerToSubnetsRequest(input *AttachLoadBalancerToSubn // load balancer. // // The load balancer evenly distributes requests across all registered subnets. -// For more information, see Elastic Load Balancing in Amazon VPC (http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/UserScenariosForVPC.html) +// For more information, see Add or Remove Subnets for Your Load Balancer in +// a VPC (http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/elb-manage-subnets.html) // in the Elastic Load Balancing Developer Guide. func (c *ELB) AttachLoadBalancerToSubnets(input *AttachLoadBalancerToSubnetsInput) (*AttachLoadBalancerToSubnetsOutput, error) { req, out := c.AttachLoadBalancerToSubnetsRequest(input) @@ -123,26 +109,21 @@ func (c *ELB) AttachLoadBalancerToSubnets(input *AttachLoadBalancerToSubnetsInpu return out, err } -var opAttachLoadBalancerToSubnets *aws.Operation +const opConfigureHealthCheck = "ConfigureHealthCheck" // ConfigureHealthCheckRequest generates a request for the ConfigureHealthCheck operation. -func (c *ELB) ConfigureHealthCheckRequest(input *ConfigureHealthCheckInput) (req *aws.Request, output *ConfigureHealthCheckOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opConfigureHealthCheck == nil { - opConfigureHealthCheck = &aws.Operation{ - Name: "ConfigureHealthCheck", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *ELB) ConfigureHealthCheckRequest(input *ConfigureHealthCheckInput) (req *request.Request, output *ConfigureHealthCheckOutput) { + op := &request.Operation{ + Name: opConfigureHealthCheck, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &ConfigureHealthCheckInput{} } - req = c.newRequest(opConfigureHealthCheck, input, output) + req = c.newRequest(op, input, output) output = &ConfigureHealthCheckOutput{} req.Data = output return @@ -151,7 +132,7 @@ func (c *ELB) ConfigureHealthCheckRequest(input *ConfigureHealthCheckInput) (req // Specifies the health check settings to use when evaluating the health state // of your back-end instances. // -// For more information, see Health Checks (http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/TerminologyandKeyConcepts.html#healthcheck) +// For more information, see Configure Health Checks (http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/elb-healthchecks.html) // in the Elastic Load Balancing Developer Guide. func (c *ELB) ConfigureHealthCheck(input *ConfigureHealthCheckInput) (*ConfigureHealthCheckOutput, error) { req, out := c.ConfigureHealthCheckRequest(input) @@ -159,26 +140,21 @@ func (c *ELB) ConfigureHealthCheck(input *ConfigureHealthCheckInput) (*Configure return out, err } -var opConfigureHealthCheck *aws.Operation +const opCreateAppCookieStickinessPolicy = "CreateAppCookieStickinessPolicy" // CreateAppCookieStickinessPolicyRequest generates a request for the CreateAppCookieStickinessPolicy operation. -func (c *ELB) CreateAppCookieStickinessPolicyRequest(input *CreateAppCookieStickinessPolicyInput) (req *aws.Request, output *CreateAppCookieStickinessPolicyOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opCreateAppCookieStickinessPolicy == nil { - opCreateAppCookieStickinessPolicy = &aws.Operation{ - Name: "CreateAppCookieStickinessPolicy", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *ELB) CreateAppCookieStickinessPolicyRequest(input *CreateAppCookieStickinessPolicyInput) (req *request.Request, output *CreateAppCookieStickinessPolicyOutput) { + op := &request.Operation{ + Name: opCreateAppCookieStickinessPolicy, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &CreateAppCookieStickinessPolicyInput{} } - req = c.newRequest(opCreateAppCookieStickinessPolicy, input, output) + req = c.newRequest(op, input, output) output = &CreateAppCookieStickinessPolicyOutput{} req.Data = output return @@ -197,7 +173,7 @@ func (c *ELB) CreateAppCookieStickinessPolicyRequest(input *CreateAppCookieStick // If the application cookie is explicitly removed or expires, the session // stops being sticky until a new application cookie is issued. // -// For more information, see Application-Controlled Session Stickiness (http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/US_StickySessions.html#US_EnableStickySessionsAppCookies) +// For more information, see Application-Controlled Session Stickiness (http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/elb-sticky-sessions.html#enable-sticky-sessions-application) // in the Elastic Load Balancing Developer Guide. func (c *ELB) CreateAppCookieStickinessPolicy(input *CreateAppCookieStickinessPolicyInput) (*CreateAppCookieStickinessPolicyOutput, error) { req, out := c.CreateAppCookieStickinessPolicyRequest(input) @@ -205,26 +181,21 @@ func (c *ELB) CreateAppCookieStickinessPolicy(input *CreateAppCookieStickinessPo return out, err } -var opCreateAppCookieStickinessPolicy *aws.Operation +const opCreateLBCookieStickinessPolicy = "CreateLBCookieStickinessPolicy" // CreateLBCookieStickinessPolicyRequest generates a request for the CreateLBCookieStickinessPolicy operation. -func (c *ELB) CreateLBCookieStickinessPolicyRequest(input *CreateLBCookieStickinessPolicyInput) (req *aws.Request, output *CreateLBCookieStickinessPolicyOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opCreateLBCookieStickinessPolicy == nil { - opCreateLBCookieStickinessPolicy = &aws.Operation{ - Name: "CreateLBCookieStickinessPolicy", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *ELB) CreateLBCookieStickinessPolicyRequest(input *CreateLBCookieStickinessPolicyInput) (req *request.Request, output *CreateLBCookieStickinessPolicyOutput) { + op := &request.Operation{ + Name: opCreateLBCookieStickinessPolicy, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &CreateLBCookieStickinessPolicyInput{} } - req = c.newRequest(opCreateLBCookieStickinessPolicy, input, output) + req = c.newRequest(op, input, output) output = &CreateLBCookieStickinessPolicyOutput{} req.Data = output return @@ -245,7 +216,7 @@ func (c *ELB) CreateLBCookieStickinessPolicyRequest(input *CreateLBCookieStickin // the same user to that server. The validity of the cookie is based on the // cookie expiration time, which is specified in the policy configuration. // -// For more information, see Duration-Based Session Stickiness (http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/US_StickySessions.html#US_EnableStickySessionsLBCookies) +// For more information, see Duration-Based Session Stickiness (http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/elb-sticky-sessions.html#enable-sticky-sessions-duration) // in the Elastic Load Balancing Developer Guide. func (c *ELB) CreateLBCookieStickinessPolicy(input *CreateLBCookieStickinessPolicyInput) (*CreateLBCookieStickinessPolicyOutput, error) { req, out := c.CreateLBCookieStickinessPolicyRequest(input) @@ -253,26 +224,21 @@ func (c *ELB) CreateLBCookieStickinessPolicy(input *CreateLBCookieStickinessPoli return out, err } -var opCreateLBCookieStickinessPolicy *aws.Operation +const opCreateLoadBalancer = "CreateLoadBalancer" // CreateLoadBalancerRequest generates a request for the CreateLoadBalancer operation. -func (c *ELB) CreateLoadBalancerRequest(input *CreateLoadBalancerInput) (req *aws.Request, output *CreateLoadBalancerOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opCreateLoadBalancer == nil { - opCreateLoadBalancer = &aws.Operation{ - Name: "CreateLoadBalancer", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *ELB) CreateLoadBalancerRequest(input *CreateLoadBalancerInput) (req *request.Request, output *CreateLoadBalancerOutput) { + op := &request.Operation{ + Name: opCreateLoadBalancer, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &CreateLoadBalancerInput{} } - req = c.newRequest(opCreateLoadBalancer, input, output) + req = c.newRequest(op, input, output) output = &CreateLoadBalancerOutput{} req.Data = output return @@ -281,51 +247,36 @@ func (c *ELB) CreateLoadBalancerRequest(input *CreateLoadBalancerInput) (req *aw // Creates a load balancer. // // If the call completes successfully, a new load balancer is created with -// a unique Domain Name Service (DNS) name. The DNS name includes the name of -// the AWS region in which the load balancer was created. For example, the DNS -// name might end with either of the following: -// -// us-east-1.elb.amazonaws.com us-west-2.elb.amazonaws.com For information -// about the AWS regions supported by Elastic Load Balancing, see Regions and -// Endpoints (http://docs.aws.amazon.com/general/latest/gr/rande.html#elb_region) -// in the Amazon Web Services General Reference. +// a unique Domain Name Service (DNS) name. The load balancer receives incoming +// traffic and routes it to the registered instances. For more information, +// see How Elastic Load Balancing Works (http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/how-elb-works.html) +// in the Elastic Load Balancing Developer Guide. // // You can create up to 20 load balancers per region per account. You can request // an increase for the number of load balancers for your account. For more information, // see Elastic Load Balancing Limits (http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/elb-limits.html) // in the Elastic Load Balancing Developer Guide. -// -// Elastic Load Balancing supports load balancing your EC2 instances launched -// in either the EC2-Classic or EC2-VPC platform. For more information, see -// Elastic Load Balancing in EC2-Classic (http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/UserScenariosForEC2.html) -// or Elastic Load Balancing in a VPC (http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/UserScenariosForVPC.html) -// in the Elastic Load Balancing Developer Guide. func (c *ELB) CreateLoadBalancer(input *CreateLoadBalancerInput) (*CreateLoadBalancerOutput, error) { req, out := c.CreateLoadBalancerRequest(input) err := req.Send() return out, err } -var opCreateLoadBalancer *aws.Operation +const opCreateLoadBalancerListeners = "CreateLoadBalancerListeners" // CreateLoadBalancerListenersRequest generates a request for the CreateLoadBalancerListeners operation. -func (c *ELB) CreateLoadBalancerListenersRequest(input *CreateLoadBalancerListenersInput) (req *aws.Request, output *CreateLoadBalancerListenersOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opCreateLoadBalancerListeners == nil { - opCreateLoadBalancerListeners = &aws.Operation{ - Name: "CreateLoadBalancerListeners", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *ELB) CreateLoadBalancerListenersRequest(input *CreateLoadBalancerListenersInput) (req *request.Request, output *CreateLoadBalancerListenersOutput) { + op := &request.Operation{ + Name: opCreateLoadBalancerListeners, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &CreateLoadBalancerListenersInput{} } - req = c.newRequest(opCreateLoadBalancerListeners, input, output) + req = c.newRequest(op, input, output) output = &CreateLoadBalancerListenersOutput{} req.Data = output return @@ -344,26 +295,21 @@ func (c *ELB) CreateLoadBalancerListeners(input *CreateLoadBalancerListenersInpu return out, err } -var opCreateLoadBalancerListeners *aws.Operation +const opCreateLoadBalancerPolicy = "CreateLoadBalancerPolicy" // CreateLoadBalancerPolicyRequest generates a request for the CreateLoadBalancerPolicy operation. -func (c *ELB) CreateLoadBalancerPolicyRequest(input *CreateLoadBalancerPolicyInput) (req *aws.Request, output *CreateLoadBalancerPolicyOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opCreateLoadBalancerPolicy == nil { - opCreateLoadBalancerPolicy = &aws.Operation{ - Name: "CreateLoadBalancerPolicy", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *ELB) CreateLoadBalancerPolicyRequest(input *CreateLoadBalancerPolicyInput) (req *request.Request, output *CreateLoadBalancerPolicyOutput) { + op := &request.Operation{ + Name: opCreateLoadBalancerPolicy, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &CreateLoadBalancerPolicyInput{} } - req = c.newRequest(opCreateLoadBalancerPolicy, input, output) + req = c.newRequest(op, input, output) output = &CreateLoadBalancerPolicyOutput{} req.Data = output return @@ -380,26 +326,21 @@ func (c *ELB) CreateLoadBalancerPolicy(input *CreateLoadBalancerPolicyInput) (*C return out, err } -var opCreateLoadBalancerPolicy *aws.Operation +const opDeleteLoadBalancer = "DeleteLoadBalancer" // DeleteLoadBalancerRequest generates a request for the DeleteLoadBalancer operation. -func (c *ELB) DeleteLoadBalancerRequest(input *DeleteLoadBalancerInput) (req *aws.Request, output *DeleteLoadBalancerOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opDeleteLoadBalancer == nil { - opDeleteLoadBalancer = &aws.Operation{ - Name: "DeleteLoadBalancer", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *ELB) DeleteLoadBalancerRequest(input *DeleteLoadBalancerInput) (req *request.Request, output *DeleteLoadBalancerOutput) { + op := &request.Operation{ + Name: opDeleteLoadBalancer, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &DeleteLoadBalancerInput{} } - req = c.newRequest(opDeleteLoadBalancer, input, output) + req = c.newRequest(op, input, output) output = &DeleteLoadBalancerOutput{} req.Data = output return @@ -421,26 +362,21 @@ func (c *ELB) DeleteLoadBalancer(input *DeleteLoadBalancerInput) (*DeleteLoadBal return out, err } -var opDeleteLoadBalancer *aws.Operation +const opDeleteLoadBalancerListeners = "DeleteLoadBalancerListeners" // DeleteLoadBalancerListenersRequest generates a request for the DeleteLoadBalancerListeners operation. -func (c *ELB) DeleteLoadBalancerListenersRequest(input *DeleteLoadBalancerListenersInput) (req *aws.Request, output *DeleteLoadBalancerListenersOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opDeleteLoadBalancerListeners == nil { - opDeleteLoadBalancerListeners = &aws.Operation{ - Name: "DeleteLoadBalancerListeners", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *ELB) DeleteLoadBalancerListenersRequest(input *DeleteLoadBalancerListenersInput) (req *request.Request, output *DeleteLoadBalancerListenersOutput) { + op := &request.Operation{ + Name: opDeleteLoadBalancerListeners, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &DeleteLoadBalancerListenersInput{} } - req = c.newRequest(opDeleteLoadBalancerListeners, input, output) + req = c.newRequest(op, input, output) output = &DeleteLoadBalancerListenersOutput{} req.Data = output return @@ -453,26 +389,21 @@ func (c *ELB) DeleteLoadBalancerListeners(input *DeleteLoadBalancerListenersInpu return out, err } -var opDeleteLoadBalancerListeners *aws.Operation +const opDeleteLoadBalancerPolicy = "DeleteLoadBalancerPolicy" // DeleteLoadBalancerPolicyRequest generates a request for the DeleteLoadBalancerPolicy operation. -func (c *ELB) DeleteLoadBalancerPolicyRequest(input *DeleteLoadBalancerPolicyInput) (req *aws.Request, output *DeleteLoadBalancerPolicyOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opDeleteLoadBalancerPolicy == nil { - opDeleteLoadBalancerPolicy = &aws.Operation{ - Name: "DeleteLoadBalancerPolicy", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *ELB) DeleteLoadBalancerPolicyRequest(input *DeleteLoadBalancerPolicyInput) (req *request.Request, output *DeleteLoadBalancerPolicyOutput) { + op := &request.Operation{ + Name: opDeleteLoadBalancerPolicy, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &DeleteLoadBalancerPolicyInput{} } - req = c.newRequest(opDeleteLoadBalancerPolicy, input, output) + req = c.newRequest(op, input, output) output = &DeleteLoadBalancerPolicyOutput{} req.Data = output return @@ -486,26 +417,21 @@ func (c *ELB) DeleteLoadBalancerPolicy(input *DeleteLoadBalancerPolicyInput) (*D return out, err } -var opDeleteLoadBalancerPolicy *aws.Operation +const opDeregisterInstancesFromLoadBalancer = "DeregisterInstancesFromLoadBalancer" // DeregisterInstancesFromLoadBalancerRequest generates a request for the DeregisterInstancesFromLoadBalancer operation. -func (c *ELB) DeregisterInstancesFromLoadBalancerRequest(input *DeregisterInstancesFromLoadBalancerInput) (req *aws.Request, output *DeregisterInstancesFromLoadBalancerOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opDeregisterInstancesFromLoadBalancer == nil { - opDeregisterInstancesFromLoadBalancer = &aws.Operation{ - Name: "DeregisterInstancesFromLoadBalancer", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *ELB) DeregisterInstancesFromLoadBalancerRequest(input *DeregisterInstancesFromLoadBalancerInput) (req *request.Request, output *DeregisterInstancesFromLoadBalancerOutput) { + op := &request.Operation{ + Name: opDeregisterInstancesFromLoadBalancer, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &DeregisterInstancesFromLoadBalancerInput{} } - req = c.newRequest(opDeregisterInstancesFromLoadBalancer, input, output) + req = c.newRequest(op, input, output) output = &DeregisterInstancesFromLoadBalancerOutput{} req.Data = output return @@ -526,26 +452,21 @@ func (c *ELB) DeregisterInstancesFromLoadBalancer(input *DeregisterInstancesFrom return out, err } -var opDeregisterInstancesFromLoadBalancer *aws.Operation +const opDescribeInstanceHealth = "DescribeInstanceHealth" // DescribeInstanceHealthRequest generates a request for the DescribeInstanceHealth operation. -func (c *ELB) DescribeInstanceHealthRequest(input *DescribeInstanceHealthInput) (req *aws.Request, output *DescribeInstanceHealthOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opDescribeInstanceHealth == nil { - opDescribeInstanceHealth = &aws.Operation{ - Name: "DescribeInstanceHealth", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *ELB) DescribeInstanceHealthRequest(input *DescribeInstanceHealthInput) (req *request.Request, output *DescribeInstanceHealthOutput) { + op := &request.Operation{ + Name: opDescribeInstanceHealth, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &DescribeInstanceHealthInput{} } - req = c.newRequest(opDescribeInstanceHealth, input, output) + req = c.newRequest(op, input, output) output = &DescribeInstanceHealthOutput{} req.Data = output return @@ -561,26 +482,21 @@ func (c *ELB) DescribeInstanceHealth(input *DescribeInstanceHealthInput) (*Descr return out, err } -var opDescribeInstanceHealth *aws.Operation +const opDescribeLoadBalancerAttributes = "DescribeLoadBalancerAttributes" // DescribeLoadBalancerAttributesRequest generates a request for the DescribeLoadBalancerAttributes operation. -func (c *ELB) DescribeLoadBalancerAttributesRequest(input *DescribeLoadBalancerAttributesInput) (req *aws.Request, output *DescribeLoadBalancerAttributesOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opDescribeLoadBalancerAttributes == nil { - opDescribeLoadBalancerAttributes = &aws.Operation{ - Name: "DescribeLoadBalancerAttributes", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *ELB) DescribeLoadBalancerAttributesRequest(input *DescribeLoadBalancerAttributesInput) (req *request.Request, output *DescribeLoadBalancerAttributesOutput) { + op := &request.Operation{ + Name: opDescribeLoadBalancerAttributes, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &DescribeLoadBalancerAttributesInput{} } - req = c.newRequest(opDescribeLoadBalancerAttributes, input, output) + req = c.newRequest(op, input, output) output = &DescribeLoadBalancerAttributesOutput{} req.Data = output return @@ -593,26 +509,21 @@ func (c *ELB) DescribeLoadBalancerAttributes(input *DescribeLoadBalancerAttribut return out, err } -var opDescribeLoadBalancerAttributes *aws.Operation +const opDescribeLoadBalancerPolicies = "DescribeLoadBalancerPolicies" // DescribeLoadBalancerPoliciesRequest generates a request for the DescribeLoadBalancerPolicies operation. -func (c *ELB) DescribeLoadBalancerPoliciesRequest(input *DescribeLoadBalancerPoliciesInput) (req *aws.Request, output *DescribeLoadBalancerPoliciesOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opDescribeLoadBalancerPolicies == nil { - opDescribeLoadBalancerPolicies = &aws.Operation{ - Name: "DescribeLoadBalancerPolicies", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *ELB) DescribeLoadBalancerPoliciesRequest(input *DescribeLoadBalancerPoliciesInput) (req *request.Request, output *DescribeLoadBalancerPoliciesOutput) { + op := &request.Operation{ + Name: opDescribeLoadBalancerPolicies, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &DescribeLoadBalancerPoliciesInput{} } - req = c.newRequest(opDescribeLoadBalancerPolicies, input, output) + req = c.newRequest(op, input, output) output = &DescribeLoadBalancerPoliciesOutput{} req.Data = output return @@ -632,26 +543,21 @@ func (c *ELB) DescribeLoadBalancerPolicies(input *DescribeLoadBalancerPoliciesIn return out, err } -var opDescribeLoadBalancerPolicies *aws.Operation +const opDescribeLoadBalancerPolicyTypes = "DescribeLoadBalancerPolicyTypes" // DescribeLoadBalancerPolicyTypesRequest generates a request for the DescribeLoadBalancerPolicyTypes operation. -func (c *ELB) DescribeLoadBalancerPolicyTypesRequest(input *DescribeLoadBalancerPolicyTypesInput) (req *aws.Request, output *DescribeLoadBalancerPolicyTypesOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opDescribeLoadBalancerPolicyTypes == nil { - opDescribeLoadBalancerPolicyTypes = &aws.Operation{ - Name: "DescribeLoadBalancerPolicyTypes", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *ELB) DescribeLoadBalancerPolicyTypesRequest(input *DescribeLoadBalancerPolicyTypesInput) (req *request.Request, output *DescribeLoadBalancerPolicyTypesOutput) { + op := &request.Operation{ + Name: opDescribeLoadBalancerPolicyTypes, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &DescribeLoadBalancerPolicyTypesInput{} } - req = c.newRequest(opDescribeLoadBalancerPolicyTypes, input, output) + req = c.newRequest(op, input, output) output = &DescribeLoadBalancerPolicyTypesOutput{} req.Data = output return @@ -667,32 +573,27 @@ func (c *ELB) DescribeLoadBalancerPolicyTypes(input *DescribeLoadBalancerPolicyT return out, err } -var opDescribeLoadBalancerPolicyTypes *aws.Operation +const opDescribeLoadBalancers = "DescribeLoadBalancers" // DescribeLoadBalancersRequest generates a request for the DescribeLoadBalancers operation. -func (c *ELB) DescribeLoadBalancersRequest(input *DescribeLoadBalancersInput) (req *aws.Request, output *DescribeLoadBalancersOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opDescribeLoadBalancers == nil { - opDescribeLoadBalancers = &aws.Operation{ - Name: "DescribeLoadBalancers", - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &aws.Paginator{ - InputTokens: []string{"Marker"}, - OutputTokens: []string{"NextMarker"}, - LimitToken: "", - TruncationToken: "", - }, - } +func (c *ELB) DescribeLoadBalancersRequest(input *DescribeLoadBalancersInput) (req *request.Request, output *DescribeLoadBalancersOutput) { + op := &request.Operation{ + Name: opDescribeLoadBalancers, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"Marker"}, + OutputTokens: []string{"NextMarker"}, + LimitToken: "", + TruncationToken: "", + }, } if input == nil { input = &DescribeLoadBalancersInput{} } - req = c.newRequest(opDescribeLoadBalancers, input, output) + req = c.newRequest(op, input, output) output = &DescribeLoadBalancersOutput{} req.Data = output return @@ -713,26 +614,21 @@ func (c *ELB) DescribeLoadBalancersPages(input *DescribeLoadBalancersInput, fn f }) } -var opDescribeLoadBalancers *aws.Operation +const opDescribeTags = "DescribeTags" // DescribeTagsRequest generates a request for the DescribeTags operation. -func (c *ELB) DescribeTagsRequest(input *DescribeTagsInput) (req *aws.Request, output *DescribeTagsOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opDescribeTags == nil { - opDescribeTags = &aws.Operation{ - Name: "DescribeTags", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *ELB) DescribeTagsRequest(input *DescribeTagsInput) (req *request.Request, output *DescribeTagsOutput) { + op := &request.Operation{ + Name: opDescribeTags, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &DescribeTagsInput{} } - req = c.newRequest(opDescribeTags, input, output) + req = c.newRequest(op, input, output) output = &DescribeTagsOutput{} req.Data = output return @@ -745,26 +641,21 @@ func (c *ELB) DescribeTags(input *DescribeTagsInput) (*DescribeTagsOutput, error return out, err } -var opDescribeTags *aws.Operation +const opDetachLoadBalancerFromSubnets = "DetachLoadBalancerFromSubnets" // DetachLoadBalancerFromSubnetsRequest generates a request for the DetachLoadBalancerFromSubnets operation. -func (c *ELB) DetachLoadBalancerFromSubnetsRequest(input *DetachLoadBalancerFromSubnetsInput) (req *aws.Request, output *DetachLoadBalancerFromSubnetsOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opDetachLoadBalancerFromSubnets == nil { - opDetachLoadBalancerFromSubnets = &aws.Operation{ - Name: "DetachLoadBalancerFromSubnets", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *ELB) DetachLoadBalancerFromSubnetsRequest(input *DetachLoadBalancerFromSubnetsInput) (req *request.Request, output *DetachLoadBalancerFromSubnetsOutput) { + op := &request.Operation{ + Name: opDetachLoadBalancerFromSubnets, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &DetachLoadBalancerFromSubnetsInput{} } - req = c.newRequest(opDetachLoadBalancerFromSubnets, input, output) + req = c.newRequest(op, input, output) output = &DetachLoadBalancerFromSubnetsOutput{} req.Data = output return @@ -782,26 +673,21 @@ func (c *ELB) DetachLoadBalancerFromSubnets(input *DetachLoadBalancerFromSubnets return out, err } -var opDetachLoadBalancerFromSubnets *aws.Operation +const opDisableAvailabilityZonesForLoadBalancer = "DisableAvailabilityZonesForLoadBalancer" // DisableAvailabilityZonesForLoadBalancerRequest generates a request for the DisableAvailabilityZonesForLoadBalancer operation. -func (c *ELB) DisableAvailabilityZonesForLoadBalancerRequest(input *DisableAvailabilityZonesForLoadBalancerInput) (req *aws.Request, output *DisableAvailabilityZonesForLoadBalancerOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opDisableAvailabilityZonesForLoadBalancer == nil { - opDisableAvailabilityZonesForLoadBalancer = &aws.Operation{ - Name: "DisableAvailabilityZonesForLoadBalancer", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *ELB) DisableAvailabilityZonesForLoadBalancerRequest(input *DisableAvailabilityZonesForLoadBalancerInput) (req *request.Request, output *DisableAvailabilityZonesForLoadBalancerOutput) { + op := &request.Operation{ + Name: opDisableAvailabilityZonesForLoadBalancer, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &DisableAvailabilityZonesForLoadBalancerInput{} } - req = c.newRequest(opDisableAvailabilityZonesForLoadBalancer, input, output) + req = c.newRequest(op, input, output) output = &DisableAvailabilityZonesForLoadBalancerOutput{} req.Data = output return @@ -825,26 +711,21 @@ func (c *ELB) DisableAvailabilityZonesForLoadBalancer(input *DisableAvailability return out, err } -var opDisableAvailabilityZonesForLoadBalancer *aws.Operation +const opEnableAvailabilityZonesForLoadBalancer = "EnableAvailabilityZonesForLoadBalancer" // EnableAvailabilityZonesForLoadBalancerRequest generates a request for the EnableAvailabilityZonesForLoadBalancer operation. -func (c *ELB) EnableAvailabilityZonesForLoadBalancerRequest(input *EnableAvailabilityZonesForLoadBalancerInput) (req *aws.Request, output *EnableAvailabilityZonesForLoadBalancerOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opEnableAvailabilityZonesForLoadBalancer == nil { - opEnableAvailabilityZonesForLoadBalancer = &aws.Operation{ - Name: "EnableAvailabilityZonesForLoadBalancer", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *ELB) EnableAvailabilityZonesForLoadBalancerRequest(input *EnableAvailabilityZonesForLoadBalancerInput) (req *request.Request, output *EnableAvailabilityZonesForLoadBalancerOutput) { + op := &request.Operation{ + Name: opEnableAvailabilityZonesForLoadBalancer, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &EnableAvailabilityZonesForLoadBalancerInput{} } - req = c.newRequest(opEnableAvailabilityZonesForLoadBalancer, input, output) + req = c.newRequest(op, input, output) output = &EnableAvailabilityZonesForLoadBalancerOutput{} req.Data = output return @@ -864,26 +745,21 @@ func (c *ELB) EnableAvailabilityZonesForLoadBalancer(input *EnableAvailabilityZo return out, err } -var opEnableAvailabilityZonesForLoadBalancer *aws.Operation +const opModifyLoadBalancerAttributes = "ModifyLoadBalancerAttributes" // ModifyLoadBalancerAttributesRequest generates a request for the ModifyLoadBalancerAttributes operation. -func (c *ELB) ModifyLoadBalancerAttributesRequest(input *ModifyLoadBalancerAttributesInput) (req *aws.Request, output *ModifyLoadBalancerAttributesOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opModifyLoadBalancerAttributes == nil { - opModifyLoadBalancerAttributes = &aws.Operation{ - Name: "ModifyLoadBalancerAttributes", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *ELB) ModifyLoadBalancerAttributesRequest(input *ModifyLoadBalancerAttributesInput) (req *request.Request, output *ModifyLoadBalancerAttributesOutput) { + op := &request.Operation{ + Name: opModifyLoadBalancerAttributes, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &ModifyLoadBalancerAttributesInput{} } - req = c.newRequest(opModifyLoadBalancerAttributes, input, output) + req = c.newRequest(op, input, output) output = &ModifyLoadBalancerAttributesOutput{} req.Data = output return @@ -909,26 +785,21 @@ func (c *ELB) ModifyLoadBalancerAttributes(input *ModifyLoadBalancerAttributesIn return out, err } -var opModifyLoadBalancerAttributes *aws.Operation +const opRegisterInstancesWithLoadBalancer = "RegisterInstancesWithLoadBalancer" // RegisterInstancesWithLoadBalancerRequest generates a request for the RegisterInstancesWithLoadBalancer operation. -func (c *ELB) RegisterInstancesWithLoadBalancerRequest(input *RegisterInstancesWithLoadBalancerInput) (req *aws.Request, output *RegisterInstancesWithLoadBalancerOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opRegisterInstancesWithLoadBalancer == nil { - opRegisterInstancesWithLoadBalancer = &aws.Operation{ - Name: "RegisterInstancesWithLoadBalancer", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *ELB) RegisterInstancesWithLoadBalancerRequest(input *RegisterInstancesWithLoadBalancerInput) (req *request.Request, output *RegisterInstancesWithLoadBalancerOutput) { + op := &request.Operation{ + Name: opRegisterInstancesWithLoadBalancer, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &RegisterInstancesWithLoadBalancerInput{} } - req = c.newRequest(opRegisterInstancesWithLoadBalancer, input, output) + req = c.newRequest(op, input, output) output = &RegisterInstancesWithLoadBalancerOutput{} req.Data = output return @@ -967,26 +838,21 @@ func (c *ELB) RegisterInstancesWithLoadBalancer(input *RegisterInstancesWithLoad return out, err } -var opRegisterInstancesWithLoadBalancer *aws.Operation +const opRemoveTags = "RemoveTags" // RemoveTagsRequest generates a request for the RemoveTags operation. -func (c *ELB) RemoveTagsRequest(input *RemoveTagsInput) (req *aws.Request, output *RemoveTagsOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opRemoveTags == nil { - opRemoveTags = &aws.Operation{ - Name: "RemoveTags", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *ELB) RemoveTagsRequest(input *RemoveTagsInput) (req *request.Request, output *RemoveTagsOutput) { + op := &request.Operation{ + Name: opRemoveTags, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &RemoveTagsInput{} } - req = c.newRequest(opRemoveTags, input, output) + req = c.newRequest(op, input, output) output = &RemoveTagsOutput{} req.Data = output return @@ -999,26 +865,21 @@ func (c *ELB) RemoveTags(input *RemoveTagsInput) (*RemoveTagsOutput, error) { return out, err } -var opRemoveTags *aws.Operation +const opSetLoadBalancerListenerSSLCertificate = "SetLoadBalancerListenerSSLCertificate" // SetLoadBalancerListenerSSLCertificateRequest generates a request for the SetLoadBalancerListenerSSLCertificate operation. -func (c *ELB) SetLoadBalancerListenerSSLCertificateRequest(input *SetLoadBalancerListenerSSLCertificateInput) (req *aws.Request, output *SetLoadBalancerListenerSSLCertificateOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opSetLoadBalancerListenerSSLCertificate == nil { - opSetLoadBalancerListenerSSLCertificate = &aws.Operation{ - Name: "SetLoadBalancerListenerSSLCertificate", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *ELB) SetLoadBalancerListenerSSLCertificateRequest(input *SetLoadBalancerListenerSSLCertificateInput) (req *request.Request, output *SetLoadBalancerListenerSSLCertificateOutput) { + op := &request.Operation{ + Name: opSetLoadBalancerListenerSSLCertificate, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &SetLoadBalancerListenerSSLCertificateInput{} } - req = c.newRequest(opSetLoadBalancerListenerSSLCertificate, input, output) + req = c.newRequest(op, input, output) output = &SetLoadBalancerListenerSSLCertificateOutput{} req.Data = output return @@ -1037,26 +898,21 @@ func (c *ELB) SetLoadBalancerListenerSSLCertificate(input *SetLoadBalancerListen return out, err } -var opSetLoadBalancerListenerSSLCertificate *aws.Operation +const opSetLoadBalancerPoliciesForBackendServer = "SetLoadBalancerPoliciesForBackendServer" // SetLoadBalancerPoliciesForBackendServerRequest generates a request for the SetLoadBalancerPoliciesForBackendServer operation. -func (c *ELB) SetLoadBalancerPoliciesForBackendServerRequest(input *SetLoadBalancerPoliciesForBackendServerInput) (req *aws.Request, output *SetLoadBalancerPoliciesForBackendServerOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opSetLoadBalancerPoliciesForBackendServer == nil { - opSetLoadBalancerPoliciesForBackendServer = &aws.Operation{ - Name: "SetLoadBalancerPoliciesForBackendServer", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *ELB) SetLoadBalancerPoliciesForBackendServerRequest(input *SetLoadBalancerPoliciesForBackendServerInput) (req *request.Request, output *SetLoadBalancerPoliciesForBackendServerOutput) { + op := &request.Operation{ + Name: opSetLoadBalancerPoliciesForBackendServer, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &SetLoadBalancerPoliciesForBackendServerInput{} } - req = c.newRequest(opSetLoadBalancerPoliciesForBackendServer, input, output) + req = c.newRequest(op, input, output) output = &SetLoadBalancerPoliciesForBackendServerOutput{} req.Data = output return @@ -1079,26 +935,21 @@ func (c *ELB) SetLoadBalancerPoliciesForBackendServer(input *SetLoadBalancerPoli return out, err } -var opSetLoadBalancerPoliciesForBackendServer *aws.Operation +const opSetLoadBalancerPoliciesOfListener = "SetLoadBalancerPoliciesOfListener" // SetLoadBalancerPoliciesOfListenerRequest generates a request for the SetLoadBalancerPoliciesOfListener operation. -func (c *ELB) SetLoadBalancerPoliciesOfListenerRequest(input *SetLoadBalancerPoliciesOfListenerInput) (req *aws.Request, output *SetLoadBalancerPoliciesOfListenerOutput) { - oprw.Lock() - defer oprw.Unlock() - - if opSetLoadBalancerPoliciesOfListener == nil { - opSetLoadBalancerPoliciesOfListener = &aws.Operation{ - Name: "SetLoadBalancerPoliciesOfListener", - HTTPMethod: "POST", - HTTPPath: "/", - } +func (c *ELB) SetLoadBalancerPoliciesOfListenerRequest(input *SetLoadBalancerPoliciesOfListenerInput) (req *request.Request, output *SetLoadBalancerPoliciesOfListenerOutput) { + op := &request.Operation{ + Name: opSetLoadBalancerPoliciesOfListener, + HTTPMethod: "POST", + HTTPPath: "/", } if input == nil { input = &SetLoadBalancerPoliciesOfListenerInput{} } - req = c.newRequest(opSetLoadBalancerPoliciesOfListener, input, output) + req = c.newRequest(op, input, output) output = &SetLoadBalancerPoliciesOfListenerOutput{} req.Data = output return @@ -1112,8 +963,6 @@ func (c *ELB) SetLoadBalancerPoliciesOfListener(input *SetLoadBalancerPoliciesOf return out, err } -var opSetLoadBalancerPoliciesOfListener *aws.Operation - // Information about the AccessLog attribute. type AccessLog struct { // The interval for publishing the access logs. You can specify an interval @@ -1140,12 +989,22 @@ type metadataAccessLog struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s AccessLog) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AccessLog) GoString() string { + return s.String() +} + type AddTagsInput struct { // The name of the load balancer. You can specify one load balancer only. LoadBalancerNames []*string `type:"list" required:"true"` // The tags. - Tags []*Tag `type:"list" required:"true"` + Tags []*Tag `min:"1" type:"list" required:"true"` metadataAddTagsInput `json:"-" xml:"-"` } @@ -1154,6 +1013,16 @@ type metadataAddTagsInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s AddTagsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AddTagsInput) GoString() string { + return s.String() +} + type AddTagsOutput struct { metadataAddTagsOutput `json:"-" xml:"-"` } @@ -1162,6 +1031,16 @@ type metadataAddTagsOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s AddTagsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AddTagsOutput) GoString() string { + return s.String() +} + // This data type is reserved. type AdditionalAttribute struct { // This parameter is reserved. @@ -1177,6 +1056,16 @@ type metadataAdditionalAttribute struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s AdditionalAttribute) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AdditionalAttribute) GoString() string { + return s.String() +} + // Information about a policy for application-controlled session stickiness. type AppCookieStickinessPolicy struct { // The name of the application cookie used for stickiness. @@ -1193,6 +1082,16 @@ type metadataAppCookieStickinessPolicy struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s AppCookieStickinessPolicy) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AppCookieStickinessPolicy) GoString() string { + return s.String() +} + type ApplySecurityGroupsToLoadBalancerInput struct { // The name of the load balancer. LoadBalancerName *string `type:"string" required:"true"` @@ -1208,6 +1107,16 @@ type metadataApplySecurityGroupsToLoadBalancerInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s ApplySecurityGroupsToLoadBalancerInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ApplySecurityGroupsToLoadBalancerInput) GoString() string { + return s.String() +} + type ApplySecurityGroupsToLoadBalancerOutput struct { // The IDs of the security groups associated with the load balancer. SecurityGroups []*string `type:"list"` @@ -1219,6 +1128,16 @@ type metadataApplySecurityGroupsToLoadBalancerOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s ApplySecurityGroupsToLoadBalancerOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ApplySecurityGroupsToLoadBalancerOutput) GoString() string { + return s.String() +} + type AttachLoadBalancerToSubnetsInput struct { // The name of the load balancer. LoadBalancerName *string `type:"string" required:"true"` @@ -1234,6 +1153,16 @@ type metadataAttachLoadBalancerToSubnetsInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s AttachLoadBalancerToSubnetsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AttachLoadBalancerToSubnetsInput) GoString() string { + return s.String() +} + type AttachLoadBalancerToSubnetsOutput struct { // The IDs of the subnets attached to the load balancer. Subnets []*string `type:"list"` @@ -1245,10 +1174,20 @@ type metadataAttachLoadBalancerToSubnetsOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s AttachLoadBalancerToSubnetsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AttachLoadBalancerToSubnetsOutput) GoString() string { + return s.String() +} + // Information about the configuration of a back-end server. type BackendServerDescription struct { // The port on which the back-end server is listening. - InstancePort *int64 `type:"integer"` + InstancePort *int64 `min:"1" type:"integer"` // The names of the policies enabled for the back-end server. PolicyNames []*string `type:"list"` @@ -1260,6 +1199,16 @@ type metadataBackendServerDescription struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s BackendServerDescription) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s BackendServerDescription) GoString() string { + return s.String() +} + type ConfigureHealthCheckInput struct { // The configuration information for the new health check. HealthCheck *HealthCheck `type:"structure" required:"true"` @@ -1274,6 +1223,16 @@ type metadataConfigureHealthCheckInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s ConfigureHealthCheckInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ConfigureHealthCheckInput) GoString() string { + return s.String() +} + type ConfigureHealthCheckOutput struct { // The updated health check. HealthCheck *HealthCheck `type:"structure"` @@ -1285,6 +1244,16 @@ type metadataConfigureHealthCheckOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s ConfigureHealthCheckOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ConfigureHealthCheckOutput) GoString() string { + return s.String() +} + // Information about the ConnectionDraining attribute. type ConnectionDraining struct { // Specifies whether connection draining is enabled for the load balancer. @@ -1301,11 +1270,21 @@ type metadataConnectionDraining struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s ConnectionDraining) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ConnectionDraining) GoString() string { + return s.String() +} + // Information about the ConnectionSettings attribute. type ConnectionSettings struct { // The time, in seconds, that the connection is allowed to be idle (no data // has been sent over the connection) before it is closed by the load balancer. - IdleTimeout *int64 `type:"integer" required:"true"` + IdleTimeout *int64 `min:"1" type:"integer" required:"true"` metadataConnectionSettings `json:"-" xml:"-"` } @@ -1314,6 +1293,16 @@ type metadataConnectionSettings struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s ConnectionSettings) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ConnectionSettings) GoString() string { + return s.String() +} + type CreateAppCookieStickinessPolicyInput struct { // The name of the application cookie used for stickiness. CookieName *string `type:"string" required:"true"` @@ -1332,6 +1321,16 @@ type metadataCreateAppCookieStickinessPolicyInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s CreateAppCookieStickinessPolicyInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateAppCookieStickinessPolicyInput) GoString() string { + return s.String() +} + type CreateAppCookieStickinessPolicyOutput struct { metadataCreateAppCookieStickinessPolicyOutput `json:"-" xml:"-"` } @@ -1340,6 +1339,16 @@ type metadataCreateAppCookieStickinessPolicyOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s CreateAppCookieStickinessPolicyOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateAppCookieStickinessPolicyOutput) GoString() string { + return s.String() +} + type CreateLBCookieStickinessPolicyInput struct { // The time period, in seconds, after which the cookie should be considered // stale. If you do not specify this parameter, the sticky session lasts for @@ -1360,6 +1369,16 @@ type metadataCreateLBCookieStickinessPolicyInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s CreateLBCookieStickinessPolicyInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateLBCookieStickinessPolicyInput) GoString() string { + return s.String() +} + type CreateLBCookieStickinessPolicyOutput struct { metadataCreateLBCookieStickinessPolicyOutput `json:"-" xml:"-"` } @@ -1368,6 +1387,16 @@ type metadataCreateLBCookieStickinessPolicyOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s CreateLBCookieStickinessPolicyOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateLBCookieStickinessPolicyOutput) GoString() string { + return s.String() +} + type CreateLoadBalancerInput struct { // One or more Availability Zones from the same region as the load balancer. // Traffic is equally distributed across all specified Availability Zones. @@ -1380,8 +1409,7 @@ type CreateLoadBalancerInput struct { // The listeners. // - // For more information, see Listener Configurations for Elastic Load Balancing - // (http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/elb-listener-config.html) + // For more information, see Listeners for Your Load Balancer (http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/elb-listener-config.html) // in the Elastic Load Balancing Developer Guide. Listeners []*Listener `type:"list" required:"true"` @@ -1415,7 +1443,7 @@ type CreateLoadBalancerInput struct { // // For more information about tagging your load balancer, see Tagging (http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/TerminologyandKeyConcepts.html#tagging-elb) // in the Elastic Load Balancing Developer Guide. - Tags []*Tag `type:"list"` + Tags []*Tag `min:"1" type:"list"` metadataCreateLoadBalancerInput `json:"-" xml:"-"` } @@ -1424,6 +1452,16 @@ type metadataCreateLoadBalancerInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s CreateLoadBalancerInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateLoadBalancerInput) GoString() string { + return s.String() +} + type CreateLoadBalancerListenersInput struct { // The listeners. Listeners []*Listener `type:"list" required:"true"` @@ -1438,6 +1476,16 @@ type metadataCreateLoadBalancerListenersInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s CreateLoadBalancerListenersInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateLoadBalancerListenersInput) GoString() string { + return s.String() +} + type CreateLoadBalancerListenersOutput struct { metadataCreateLoadBalancerListenersOutput `json:"-" xml:"-"` } @@ -1446,6 +1494,16 @@ type metadataCreateLoadBalancerListenersOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s CreateLoadBalancerListenersOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateLoadBalancerListenersOutput) GoString() string { + return s.String() +} + type CreateLoadBalancerOutput struct { // The DNS name of the load balancer. DNSName *string `type:"string"` @@ -1457,6 +1515,16 @@ type metadataCreateLoadBalancerOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s CreateLoadBalancerOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateLoadBalancerOutput) GoString() string { + return s.String() +} + type CreateLoadBalancerPolicyInput struct { // The name of the load balancer. LoadBalancerName *string `type:"string" required:"true"` @@ -1478,6 +1546,16 @@ type metadataCreateLoadBalancerPolicyInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s CreateLoadBalancerPolicyInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateLoadBalancerPolicyInput) GoString() string { + return s.String() +} + type CreateLoadBalancerPolicyOutput struct { metadataCreateLoadBalancerPolicyOutput `json:"-" xml:"-"` } @@ -1486,6 +1564,16 @@ type metadataCreateLoadBalancerPolicyOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s CreateLoadBalancerPolicyOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateLoadBalancerPolicyOutput) GoString() string { + return s.String() +} + // Information about the CrossZoneLoadBalancing attribute. type CrossZoneLoadBalancing struct { // Specifies whether cross-zone load balancing is enabled for the load balancer. @@ -1498,6 +1586,16 @@ type metadataCrossZoneLoadBalancing struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s CrossZoneLoadBalancing) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CrossZoneLoadBalancing) GoString() string { + return s.String() +} + type DeleteLoadBalancerInput struct { // The name of the load balancer. LoadBalancerName *string `type:"string" required:"true"` @@ -1509,6 +1607,16 @@ type metadataDeleteLoadBalancerInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DeleteLoadBalancerInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteLoadBalancerInput) GoString() string { + return s.String() +} + type DeleteLoadBalancerListenersInput struct { // The name of the load balancer. LoadBalancerName *string `type:"string" required:"true"` @@ -1523,6 +1631,16 @@ type metadataDeleteLoadBalancerListenersInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DeleteLoadBalancerListenersInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteLoadBalancerListenersInput) GoString() string { + return s.String() +} + type DeleteLoadBalancerListenersOutput struct { metadataDeleteLoadBalancerListenersOutput `json:"-" xml:"-"` } @@ -1531,6 +1649,16 @@ type metadataDeleteLoadBalancerListenersOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DeleteLoadBalancerListenersOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteLoadBalancerListenersOutput) GoString() string { + return s.String() +} + type DeleteLoadBalancerOutput struct { metadataDeleteLoadBalancerOutput `json:"-" xml:"-"` } @@ -1539,6 +1667,16 @@ type metadataDeleteLoadBalancerOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DeleteLoadBalancerOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteLoadBalancerOutput) GoString() string { + return s.String() +} + // = type DeleteLoadBalancerPolicyInput struct { // The name of the load balancer. @@ -1554,6 +1692,16 @@ type metadataDeleteLoadBalancerPolicyInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DeleteLoadBalancerPolicyInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteLoadBalancerPolicyInput) GoString() string { + return s.String() +} + type DeleteLoadBalancerPolicyOutput struct { metadataDeleteLoadBalancerPolicyOutput `json:"-" xml:"-"` } @@ -1562,6 +1710,16 @@ type metadataDeleteLoadBalancerPolicyOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DeleteLoadBalancerPolicyOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteLoadBalancerPolicyOutput) GoString() string { + return s.String() +} + type DeregisterInstancesFromLoadBalancerInput struct { // The IDs of the instances. Instances []*Instance `type:"list" required:"true"` @@ -1576,6 +1734,16 @@ type metadataDeregisterInstancesFromLoadBalancerInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DeregisterInstancesFromLoadBalancerInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeregisterInstancesFromLoadBalancerInput) GoString() string { + return s.String() +} + type DeregisterInstancesFromLoadBalancerOutput struct { // The remaining instances registered with the load balancer. Instances []*Instance `type:"list"` @@ -1587,6 +1755,16 @@ type metadataDeregisterInstancesFromLoadBalancerOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DeregisterInstancesFromLoadBalancerOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeregisterInstancesFromLoadBalancerOutput) GoString() string { + return s.String() +} + type DescribeInstanceHealthInput struct { // The IDs of the instances. Instances []*Instance `type:"list"` @@ -1601,6 +1779,16 @@ type metadataDescribeInstanceHealthInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeInstanceHealthInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeInstanceHealthInput) GoString() string { + return s.String() +} + type DescribeInstanceHealthOutput struct { // Information about the health of the instances. InstanceStates []*InstanceState `type:"list"` @@ -1612,6 +1800,16 @@ type metadataDescribeInstanceHealthOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeInstanceHealthOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeInstanceHealthOutput) GoString() string { + return s.String() +} + type DescribeLoadBalancerAttributesInput struct { // The name of the load balancer. LoadBalancerName *string `type:"string" required:"true"` @@ -1623,6 +1821,16 @@ type metadataDescribeLoadBalancerAttributesInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeLoadBalancerAttributesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeLoadBalancerAttributesInput) GoString() string { + return s.String() +} + type DescribeLoadBalancerAttributesOutput struct { // Information about the load balancer attributes. LoadBalancerAttributes *LoadBalancerAttributes `type:"structure"` @@ -1634,6 +1842,16 @@ type metadataDescribeLoadBalancerAttributesOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeLoadBalancerAttributesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeLoadBalancerAttributesOutput) GoString() string { + return s.String() +} + type DescribeLoadBalancerPoliciesInput struct { // The name of the load balancer. LoadBalancerName *string `type:"string"` @@ -1648,6 +1866,16 @@ type metadataDescribeLoadBalancerPoliciesInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeLoadBalancerPoliciesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeLoadBalancerPoliciesInput) GoString() string { + return s.String() +} + type DescribeLoadBalancerPoliciesOutput struct { // Information about the policies. PolicyDescriptions []*PolicyDescription `type:"list"` @@ -1659,6 +1887,16 @@ type metadataDescribeLoadBalancerPoliciesOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeLoadBalancerPoliciesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeLoadBalancerPoliciesOutput) GoString() string { + return s.String() +} + type DescribeLoadBalancerPolicyTypesInput struct { // The names of the policy types. If no names are specified, describes all policy // types defined by Elastic Load Balancing. @@ -1671,6 +1909,16 @@ type metadataDescribeLoadBalancerPolicyTypesInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeLoadBalancerPolicyTypesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeLoadBalancerPolicyTypesInput) GoString() string { + return s.String() +} + type DescribeLoadBalancerPolicyTypesOutput struct { // Information about the policy types. PolicyTypeDescriptions []*PolicyTypeDescription `type:"list"` @@ -1682,6 +1930,16 @@ type metadataDescribeLoadBalancerPolicyTypesOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeLoadBalancerPolicyTypesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeLoadBalancerPolicyTypesOutput) GoString() string { + return s.String() +} + type DescribeLoadBalancersInput struct { // The names of the load balancers. LoadBalancerNames []*string `type:"list"` @@ -1692,7 +1950,7 @@ type DescribeLoadBalancersInput struct { // The maximum number of results to return with this call (a number from 1 to // 400). The default is 400. - PageSize *int64 `type:"integer"` + PageSize *int64 `min:"1" type:"integer"` metadataDescribeLoadBalancersInput `json:"-" xml:"-"` } @@ -1701,6 +1959,16 @@ type metadataDescribeLoadBalancersInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeLoadBalancersInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeLoadBalancersInput) GoString() string { + return s.String() +} + type DescribeLoadBalancersOutput struct { // Information about the load balancers. LoadBalancerDescriptions []*LoadBalancerDescription `type:"list"` @@ -1716,9 +1984,19 @@ type metadataDescribeLoadBalancersOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeLoadBalancersOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeLoadBalancersOutput) GoString() string { + return s.String() +} + type DescribeTagsInput struct { // The names of the load balancers. - LoadBalancerNames []*string `type:"list" required:"true"` + LoadBalancerNames []*string `min:"1" type:"list" required:"true"` metadataDescribeTagsInput `json:"-" xml:"-"` } @@ -1727,6 +2005,16 @@ type metadataDescribeTagsInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeTagsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeTagsInput) GoString() string { + return s.String() +} + type DescribeTagsOutput struct { // Information about the tags. TagDescriptions []*TagDescription `type:"list"` @@ -1738,6 +2026,16 @@ type metadataDescribeTagsOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DescribeTagsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeTagsOutput) GoString() string { + return s.String() +} + type DetachLoadBalancerFromSubnetsInput struct { // The name of the load balancer. LoadBalancerName *string `type:"string" required:"true"` @@ -1752,6 +2050,16 @@ type metadataDetachLoadBalancerFromSubnetsInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DetachLoadBalancerFromSubnetsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DetachLoadBalancerFromSubnetsInput) GoString() string { + return s.String() +} + type DetachLoadBalancerFromSubnetsOutput struct { // The IDs of the remaining subnets for the load balancer. Subnets []*string `type:"list"` @@ -1763,6 +2071,16 @@ type metadataDetachLoadBalancerFromSubnetsOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DetachLoadBalancerFromSubnetsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DetachLoadBalancerFromSubnetsOutput) GoString() string { + return s.String() +} + type DisableAvailabilityZonesForLoadBalancerInput struct { // The Availability Zones. AvailabilityZones []*string `type:"list" required:"true"` @@ -1777,6 +2095,16 @@ type metadataDisableAvailabilityZonesForLoadBalancerInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DisableAvailabilityZonesForLoadBalancerInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DisableAvailabilityZonesForLoadBalancerInput) GoString() string { + return s.String() +} + type DisableAvailabilityZonesForLoadBalancerOutput struct { // The remaining Availability Zones for the load balancer. AvailabilityZones []*string `type:"list"` @@ -1788,6 +2116,16 @@ type metadataDisableAvailabilityZonesForLoadBalancerOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s DisableAvailabilityZonesForLoadBalancerOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DisableAvailabilityZonesForLoadBalancerOutput) GoString() string { + return s.String() +} + type EnableAvailabilityZonesForLoadBalancerInput struct { // The Availability Zones. These must be in the same region as the load balancer. AvailabilityZones []*string `type:"list" required:"true"` @@ -1802,6 +2140,16 @@ type metadataEnableAvailabilityZonesForLoadBalancerInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s EnableAvailabilityZonesForLoadBalancerInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s EnableAvailabilityZonesForLoadBalancerInput) GoString() string { + return s.String() +} + type EnableAvailabilityZonesForLoadBalancerOutput struct { // The updated list of Availability Zones for the load balancer. AvailabilityZones []*string `type:"list"` @@ -1813,15 +2161,25 @@ type metadataEnableAvailabilityZonesForLoadBalancerOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s EnableAvailabilityZonesForLoadBalancerOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s EnableAvailabilityZonesForLoadBalancerOutput) GoString() string { + return s.String() +} + // Information about a health check. type HealthCheck struct { // The number of consecutive health checks successes required before moving // the instance to the Healthy state. - HealthyThreshold *int64 `type:"integer" required:"true"` + HealthyThreshold *int64 `min:"2" type:"integer" required:"true"` // The approximate interval, in seconds, between health checks of an individual // instance. - Interval *int64 `type:"integer" required:"true"` + Interval *int64 `min:"1" type:"integer" required:"true"` // The instance being checked. The protocol is either TCP, HTTP, HTTPS, or SSL. // The range of valid ports is one (1) through 65535. @@ -1847,11 +2205,11 @@ type HealthCheck struct { // check. // // This value must be less than the Interval value. - Timeout *int64 `type:"integer" required:"true"` + Timeout *int64 `min:"1" type:"integer" required:"true"` // The number of consecutive health check failures required before moving the // instance to the Unhealthy state. - UnhealthyThreshold *int64 `type:"integer" required:"true"` + UnhealthyThreshold *int64 `min:"2" type:"integer" required:"true"` metadataHealthCheck `json:"-" xml:"-"` } @@ -1860,10 +2218,20 @@ type metadataHealthCheck struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s HealthCheck) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s HealthCheck) GoString() string { + return s.String() +} + // The ID of a back-end instance. type Instance struct { // The ID of the instance. - InstanceID *string `locationName:"InstanceId" type:"string"` + InstanceId *string `type:"string"` metadataInstance `json:"-" xml:"-"` } @@ -1872,6 +2240,16 @@ type metadataInstance struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s Instance) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Instance) GoString() string { + return s.String() +} + // Information about the state of a back-end instance. type InstanceState struct { // A description of the instance state. This string can contain one or more @@ -1906,7 +2284,7 @@ type InstanceState struct { Description *string `type:"string"` // The ID of the instance. - InstanceID *string `locationName:"InstanceId" type:"string"` + InstanceId *string `type:"string"` // Information about the cause of OutOfService instances. Specifically, whether // the cause is Elastic Load Balancing or the instance. @@ -1926,6 +2304,16 @@ type metadataInstanceState struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s InstanceState) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InstanceState) GoString() string { + return s.String() +} + // Information about a policy for duration-based session stickiness. type LBCookieStickinessPolicy struct { // The time period, in seconds, after which the cookie should be considered @@ -1944,15 +2332,24 @@ type metadataLBCookieStickinessPolicy struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s LBCookieStickinessPolicy) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LBCookieStickinessPolicy) GoString() string { + return s.String() +} + // Information about a listener. // // For information about the protocols and the ports supported by Elastic Load // Balancing, see Listener Configurations for Elastic Load Balancing (http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/elb-listener-config.html) // in the Elastic Load Balancing Developer Guide. type Listener struct { - // The port on which the instance server is listening - 25, 80, 443, 465, 587, - // or 1024-65535. - InstancePort *int64 `type:"integer" required:"true"` + // The port on which the instance is listening. + InstancePort *int64 `min:"1" type:"integer" required:"true"` // The protocol to use for routing traffic to back-end instances: HTTP, HTTPS, // TCP, or SSL. @@ -1967,8 +2364,8 @@ type Listener struct { // is HTTP or TCP, the listener's InstanceProtocol must be HTTP or TCP. InstanceProtocol *string `type:"string"` - // The port on which the load balancer is listening: 25, 80, 443, 465, 587, - // or 1024-65535. + // The port on which the load balancer is listening. The supported ports are: + // 25, 80, 443, 465, 587, and 1024-65535. LoadBalancerPort *int64 `type:"integer" required:"true"` // The load balancer transport protocol to use for routing: HTTP, HTTPS, TCP, @@ -1976,7 +2373,7 @@ type Listener struct { Protocol *string `type:"string" required:"true"` // The Amazon Resource Name (ARN) of the server certificate. - SSLCertificateID *string `locationName:"SSLCertificateId" type:"string"` + SSLCertificateId *string `type:"string"` metadataListener `json:"-" xml:"-"` } @@ -1985,6 +2382,16 @@ type metadataListener struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s Listener) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Listener) GoString() string { + return s.String() +} + // The policies enabled for a listener. type ListenerDescription struct { // Information about a listener. @@ -2004,6 +2411,16 @@ type metadataListenerDescription struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s ListenerDescription) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListenerDescription) GoString() string { + return s.String() +} + // The attributes for a load balancer. type LoadBalancerAttributes struct { // If enabled, the load balancer captures detailed information of all requests @@ -2047,6 +2464,16 @@ type metadataLoadBalancerAttributes struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s LoadBalancerAttributes) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LoadBalancerAttributes) GoString() string { + return s.String() +} + // Information about a load balancer. type LoadBalancerDescription struct { // The Availability Zones for the load balancer. @@ -2109,7 +2536,7 @@ type LoadBalancerDescription struct { Subnets []*string `type:"list"` // The ID of the VPC for the load balancer. - VPCID *string `locationName:"VPCId" type:"string"` + VPCId *string `type:"string"` metadataLoadBalancerDescription `json:"-" xml:"-"` } @@ -2118,6 +2545,16 @@ type metadataLoadBalancerDescription struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s LoadBalancerDescription) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LoadBalancerDescription) GoString() string { + return s.String() +} + type ModifyLoadBalancerAttributesInput struct { // The attributes of the load balancer. LoadBalancerAttributes *LoadBalancerAttributes `type:"structure" required:"true"` @@ -2132,6 +2569,16 @@ type metadataModifyLoadBalancerAttributesInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s ModifyLoadBalancerAttributesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ModifyLoadBalancerAttributesInput) GoString() string { + return s.String() +} + type ModifyLoadBalancerAttributesOutput struct { // The attributes for a load balancer. LoadBalancerAttributes *LoadBalancerAttributes `type:"structure"` @@ -2146,6 +2593,16 @@ type metadataModifyLoadBalancerAttributesOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s ModifyLoadBalancerAttributesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ModifyLoadBalancerAttributesOutput) GoString() string { + return s.String() +} + // The policies for a load balancer. type Policies struct { // The stickiness policies created using CreateAppCookieStickinessPolicy. @@ -2164,6 +2621,16 @@ type metadataPolicies struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s Policies) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Policies) GoString() string { + return s.String() +} + // Information about a policy attribute. type PolicyAttribute struct { // The name of the attribute. @@ -2179,6 +2646,16 @@ type metadataPolicyAttribute struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s PolicyAttribute) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PolicyAttribute) GoString() string { + return s.String() +} + // Information about a policy attribute. type PolicyAttributeDescription struct { // The name of the attribute. @@ -2194,6 +2671,16 @@ type metadataPolicyAttributeDescription struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s PolicyAttributeDescription) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PolicyAttributeDescription) GoString() string { + return s.String() +} + // Information about a policy attribute type. type PolicyAttributeTypeDescription struct { // The name of the attribute. @@ -2224,6 +2711,16 @@ type metadataPolicyAttributeTypeDescription struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s PolicyAttributeTypeDescription) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PolicyAttributeTypeDescription) GoString() string { + return s.String() +} + // Information about a policy. type PolicyDescription struct { // The policy attributes. @@ -2242,6 +2739,16 @@ type metadataPolicyDescription struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s PolicyDescription) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PolicyDescription) GoString() string { + return s.String() +} + // Information about a policy type. type PolicyTypeDescription struct { // A description of the policy type. @@ -2261,6 +2768,16 @@ type metadataPolicyTypeDescription struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s PolicyTypeDescription) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PolicyTypeDescription) GoString() string { + return s.String() +} + type RegisterInstancesWithLoadBalancerInput struct { // The IDs of the instances. Instances []*Instance `type:"list" required:"true"` @@ -2275,6 +2792,16 @@ type metadataRegisterInstancesWithLoadBalancerInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s RegisterInstancesWithLoadBalancerInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RegisterInstancesWithLoadBalancerInput) GoString() string { + return s.String() +} + type RegisterInstancesWithLoadBalancerOutput struct { // The updated list of instances for the load balancer. Instances []*Instance `type:"list"` @@ -2286,13 +2813,23 @@ type metadataRegisterInstancesWithLoadBalancerOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s RegisterInstancesWithLoadBalancerOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RegisterInstancesWithLoadBalancerOutput) GoString() string { + return s.String() +} + type RemoveTagsInput struct { // The name of the load balancer. You can specify a maximum of one load balancer // name. LoadBalancerNames []*string `type:"list" required:"true"` // The list of tag keys to remove. - Tags []*TagKeyOnly `type:"list" required:"true"` + Tags []*TagKeyOnly `min:"1" type:"list" required:"true"` metadataRemoveTagsInput `json:"-" xml:"-"` } @@ -2301,6 +2838,16 @@ type metadataRemoveTagsInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s RemoveTagsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RemoveTagsInput) GoString() string { + return s.String() +} + type RemoveTagsOutput struct { metadataRemoveTagsOutput `json:"-" xml:"-"` } @@ -2309,6 +2856,16 @@ type metadataRemoveTagsOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s RemoveTagsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RemoveTagsOutput) GoString() string { + return s.String() +} + type SetLoadBalancerListenerSSLCertificateInput struct { // The name of the load balancer. LoadBalancerName *string `type:"string" required:"true"` @@ -2317,7 +2874,7 @@ type SetLoadBalancerListenerSSLCertificateInput struct { LoadBalancerPort *int64 `type:"integer" required:"true"` // The Amazon Resource Name (ARN) of the SSL certificate. - SSLCertificateID *string `locationName:"SSLCertificateId" type:"string" required:"true"` + SSLCertificateId *string `type:"string" required:"true"` metadataSetLoadBalancerListenerSSLCertificateInput `json:"-" xml:"-"` } @@ -2326,6 +2883,16 @@ type metadataSetLoadBalancerListenerSSLCertificateInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s SetLoadBalancerListenerSSLCertificateInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SetLoadBalancerListenerSSLCertificateInput) GoString() string { + return s.String() +} + type SetLoadBalancerListenerSSLCertificateOutput struct { metadataSetLoadBalancerListenerSSLCertificateOutput `json:"-" xml:"-"` } @@ -2334,6 +2901,16 @@ type metadataSetLoadBalancerListenerSSLCertificateOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s SetLoadBalancerListenerSSLCertificateOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SetLoadBalancerListenerSSLCertificateOutput) GoString() string { + return s.String() +} + type SetLoadBalancerPoliciesForBackendServerInput struct { // The port number associated with the back-end server. InstancePort *int64 `type:"integer" required:"true"` @@ -2352,6 +2929,16 @@ type metadataSetLoadBalancerPoliciesForBackendServerInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s SetLoadBalancerPoliciesForBackendServerInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SetLoadBalancerPoliciesForBackendServerInput) GoString() string { + return s.String() +} + type SetLoadBalancerPoliciesForBackendServerOutput struct { metadataSetLoadBalancerPoliciesForBackendServerOutput `json:"-" xml:"-"` } @@ -2360,6 +2947,16 @@ type metadataSetLoadBalancerPoliciesForBackendServerOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s SetLoadBalancerPoliciesForBackendServerOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SetLoadBalancerPoliciesForBackendServerOutput) GoString() string { + return s.String() +} + type SetLoadBalancerPoliciesOfListenerInput struct { // The name of the load balancer. LoadBalancerName *string `type:"string" required:"true"` @@ -2378,6 +2975,16 @@ type metadataSetLoadBalancerPoliciesOfListenerInput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s SetLoadBalancerPoliciesOfListenerInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SetLoadBalancerPoliciesOfListenerInput) GoString() string { + return s.String() +} + type SetLoadBalancerPoliciesOfListenerOutput struct { metadataSetLoadBalancerPoliciesOfListenerOutput `json:"-" xml:"-"` } @@ -2386,6 +2993,16 @@ type metadataSetLoadBalancerPoliciesOfListenerOutput struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s SetLoadBalancerPoliciesOfListenerOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SetLoadBalancerPoliciesOfListenerOutput) GoString() string { + return s.String() +} + // Information about a source security group. type SourceSecurityGroup struct { // The name of the security group. @@ -2401,10 +3018,20 @@ type metadataSourceSecurityGroup struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s SourceSecurityGroup) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SourceSecurityGroup) GoString() string { + return s.String() +} + // Information about a tag. type Tag struct { // The key of the tag. - Key *string `type:"string" required:"true"` + Key *string `min:"1" type:"string" required:"true"` // The value of the tag. Value *string `type:"string"` @@ -2416,13 +3043,23 @@ type metadataTag struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s Tag) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Tag) GoString() string { + return s.String() +} + // The tags associated with a load balancer. type TagDescription struct { // The name of the load balancer. LoadBalancerName *string `type:"string"` // The tags. - Tags []*Tag `type:"list"` + Tags []*Tag `min:"1" type:"list"` metadataTagDescription `json:"-" xml:"-"` } @@ -2431,10 +3068,20 @@ type metadataTagDescription struct { SDKShapeTraits bool `type:"structure"` } +// String returns the string representation +func (s TagDescription) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TagDescription) GoString() string { + return s.String() +} + // The key of a tag. type TagKeyOnly struct { // The name of the key. - Key *string `type:"string"` + Key *string `min:"1" type:"string"` metadataTagKeyOnly `json:"-" xml:"-"` } @@ -2442,3 +3089,13 @@ type TagKeyOnly struct { type metadataTagKeyOnly struct { SDKShapeTraits bool `type:"structure"` } + +// String returns the string representation +func (s TagKeyOnly) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TagKeyOnly) GoString() string { + return s.String() +} diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/elb/elbiface/interface.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/elb/elbiface/interface.go index 5beab180cecf..a1b4214745e2 100644 --- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/elb/elbiface/interface.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/elb/elbiface/interface.go @@ -4,64 +4,123 @@ 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) } diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/elb/examples_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/elb/examples_test.go index 354af9bb8c32..765c050eaafd 100644 --- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/elb/examples_test.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/elb/examples_test.go @@ -8,8 +8,6 @@ import ( "time" "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/aws/awsutil" "github.com/aws/aws-sdk-go/service/elb" ) @@ -25,7 +23,7 @@ func ExampleELB_AddTags() { // More values... }, Tags: []*elb.Tag{ // Required - &elb.Tag{ // Required + { // Required Key: aws.String("TagKey"), // Required Value: aws.String("TagValue"), }, @@ -35,22 +33,14 @@ func ExampleELB_AddTags() { resp, err := svc.AddTags(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleELB_ApplySecurityGroupsToLoadBalancer() { @@ -66,22 +56,14 @@ func ExampleELB_ApplySecurityGroupsToLoadBalancer() { resp, err := svc.ApplySecurityGroupsToLoadBalancer(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleELB_AttachLoadBalancerToSubnets() { @@ -97,22 +79,14 @@ func ExampleELB_AttachLoadBalancerToSubnets() { resp, err := svc.AttachLoadBalancerToSubnets(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleELB_ConfigureHealthCheck() { @@ -120,33 +94,25 @@ func ExampleELB_ConfigureHealthCheck() { params := &elb.ConfigureHealthCheckInput{ HealthCheck: &elb.HealthCheck{ // Required - HealthyThreshold: aws.Long(1), // Required - Interval: aws.Long(1), // Required + HealthyThreshold: aws.Int64(1), // Required + Interval: aws.Int64(1), // Required Target: aws.String("HealthCheckTarget"), // Required - Timeout: aws.Long(1), // Required - UnhealthyThreshold: aws.Long(1), // Required + Timeout: aws.Int64(1), // Required + UnhealthyThreshold: aws.Int64(1), // Required }, LoadBalancerName: aws.String("AccessPointName"), // Required } resp, err := svc.ConfigureHealthCheck(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleELB_CreateAppCookieStickinessPolicy() { @@ -160,22 +126,14 @@ func ExampleELB_CreateAppCookieStickinessPolicy() { resp, err := svc.CreateAppCookieStickinessPolicy(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleELB_CreateLBCookieStickinessPolicy() { @@ -184,27 +142,19 @@ func ExampleELB_CreateLBCookieStickinessPolicy() { params := &elb.CreateLBCookieStickinessPolicyInput{ LoadBalancerName: aws.String("AccessPointName"), // Required PolicyName: aws.String("PolicyName"), // Required - CookieExpirationPeriod: aws.Long(1), + CookieExpirationPeriod: aws.Int64(1), } resp, err := svc.CreateLBCookieStickinessPolicy(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleELB_CreateLoadBalancer() { @@ -212,12 +162,12 @@ func ExampleELB_CreateLoadBalancer() { params := &elb.CreateLoadBalancerInput{ Listeners: []*elb.Listener{ // Required - &elb.Listener{ // Required - InstancePort: aws.Long(1), // Required - LoadBalancerPort: aws.Long(1), // Required + { // Required + InstancePort: aws.Int64(1), // Required + LoadBalancerPort: aws.Int64(1), // Required Protocol: aws.String("Protocol"), // Required InstanceProtocol: aws.String("Protocol"), - SSLCertificateID: aws.String("SSLCertificateId"), + SSLCertificateId: aws.String("SSLCertificateId"), }, // More values... }, @@ -236,7 +186,7 @@ func ExampleELB_CreateLoadBalancer() { // More values... }, Tags: []*elb.Tag{ - &elb.Tag{ // Required + { // Required Key: aws.String("TagKey"), // Required Value: aws.String("TagValue"), }, @@ -246,22 +196,14 @@ func ExampleELB_CreateLoadBalancer() { resp, err := svc.CreateLoadBalancer(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleELB_CreateLoadBalancerListeners() { @@ -269,12 +211,12 @@ func ExampleELB_CreateLoadBalancerListeners() { params := &elb.CreateLoadBalancerListenersInput{ Listeners: []*elb.Listener{ // Required - &elb.Listener{ // Required - InstancePort: aws.Long(1), // Required - LoadBalancerPort: aws.Long(1), // Required + { // Required + InstancePort: aws.Int64(1), // Required + LoadBalancerPort: aws.Int64(1), // Required Protocol: aws.String("Protocol"), // Required InstanceProtocol: aws.String("Protocol"), - SSLCertificateID: aws.String("SSLCertificateId"), + SSLCertificateId: aws.String("SSLCertificateId"), }, // More values... }, @@ -283,22 +225,14 @@ func ExampleELB_CreateLoadBalancerListeners() { resp, err := svc.CreateLoadBalancerListeners(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleELB_CreateLoadBalancerPolicy() { @@ -309,7 +243,7 @@ func ExampleELB_CreateLoadBalancerPolicy() { PolicyName: aws.String("PolicyName"), // Required PolicyTypeName: aws.String("PolicyTypeName"), // Required PolicyAttributes: []*elb.PolicyAttribute{ - &elb.PolicyAttribute{ // Required + { // Required AttributeName: aws.String("AttributeName"), AttributeValue: aws.String("AttributeValue"), }, @@ -319,22 +253,14 @@ func ExampleELB_CreateLoadBalancerPolicy() { resp, err := svc.CreateLoadBalancerPolicy(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleELB_DeleteLoadBalancer() { @@ -346,22 +272,14 @@ func ExampleELB_DeleteLoadBalancer() { resp, err := svc.DeleteLoadBalancer(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleELB_DeleteLoadBalancerListeners() { @@ -370,29 +288,21 @@ func ExampleELB_DeleteLoadBalancerListeners() { params := &elb.DeleteLoadBalancerListenersInput{ LoadBalancerName: aws.String("AccessPointName"), // Required LoadBalancerPorts: []*int64{ // Required - aws.Long(1), // Required + aws.Int64(1), // Required // More values... }, } resp, err := svc.DeleteLoadBalancerListeners(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleELB_DeleteLoadBalancerPolicy() { @@ -405,22 +315,14 @@ func ExampleELB_DeleteLoadBalancerPolicy() { resp, err := svc.DeleteLoadBalancerPolicy(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleELB_DeregisterInstancesFromLoadBalancer() { @@ -428,8 +330,8 @@ func ExampleELB_DeregisterInstancesFromLoadBalancer() { params := &elb.DeregisterInstancesFromLoadBalancerInput{ Instances: []*elb.Instance{ // Required - &elb.Instance{ // Required - InstanceID: aws.String("InstanceId"), + { // Required + InstanceId: aws.String("InstanceId"), }, // More values... }, @@ -438,22 +340,14 @@ func ExampleELB_DeregisterInstancesFromLoadBalancer() { resp, err := svc.DeregisterInstancesFromLoadBalancer(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleELB_DescribeInstanceHealth() { @@ -462,8 +356,8 @@ func ExampleELB_DescribeInstanceHealth() { params := &elb.DescribeInstanceHealthInput{ LoadBalancerName: aws.String("AccessPointName"), // Required Instances: []*elb.Instance{ - &elb.Instance{ // Required - InstanceID: aws.String("InstanceId"), + { // Required + InstanceId: aws.String("InstanceId"), }, // More values... }, @@ -471,22 +365,14 @@ func ExampleELB_DescribeInstanceHealth() { resp, err := svc.DescribeInstanceHealth(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleELB_DescribeLoadBalancerAttributes() { @@ -498,22 +384,14 @@ func ExampleELB_DescribeLoadBalancerAttributes() { resp, err := svc.DescribeLoadBalancerAttributes(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleELB_DescribeLoadBalancerPolicies() { @@ -529,22 +407,14 @@ func ExampleELB_DescribeLoadBalancerPolicies() { resp, err := svc.DescribeLoadBalancerPolicies(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleELB_DescribeLoadBalancerPolicyTypes() { @@ -559,22 +429,14 @@ func ExampleELB_DescribeLoadBalancerPolicyTypes() { resp, err := svc.DescribeLoadBalancerPolicyTypes(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleELB_DescribeLoadBalancers() { @@ -586,27 +448,19 @@ func ExampleELB_DescribeLoadBalancers() { // More values... }, Marker: aws.String("Marker"), - PageSize: aws.Long(1), + PageSize: aws.Int64(1), } resp, err := svc.DescribeLoadBalancers(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleELB_DescribeTags() { @@ -621,22 +475,14 @@ func ExampleELB_DescribeTags() { resp, err := svc.DescribeTags(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleELB_DetachLoadBalancerFromSubnets() { @@ -652,22 +498,14 @@ func ExampleELB_DetachLoadBalancerFromSubnets() { resp, err := svc.DetachLoadBalancerFromSubnets(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleELB_DisableAvailabilityZonesForLoadBalancer() { @@ -683,22 +521,14 @@ func ExampleELB_DisableAvailabilityZonesForLoadBalancer() { resp, err := svc.DisableAvailabilityZonesForLoadBalancer(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleELB_EnableAvailabilityZonesForLoadBalancer() { @@ -714,22 +544,14 @@ func ExampleELB_EnableAvailabilityZonesForLoadBalancer() { resp, err := svc.EnableAvailabilityZonesForLoadBalancer(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleELB_ModifyLoadBalancerAttributes() { @@ -738,27 +560,27 @@ func ExampleELB_ModifyLoadBalancerAttributes() { params := &elb.ModifyLoadBalancerAttributesInput{ LoadBalancerAttributes: &elb.LoadBalancerAttributes{ // Required AccessLog: &elb.AccessLog{ - Enabled: aws.Boolean(true), // Required - EmitInterval: aws.Long(1), + Enabled: aws.Bool(true), // Required + EmitInterval: aws.Int64(1), S3BucketName: aws.String("S3BucketName"), S3BucketPrefix: aws.String("AccessLogPrefix"), }, AdditionalAttributes: []*elb.AdditionalAttribute{ - &elb.AdditionalAttribute{ // Required + { // Required Key: aws.String("StringVal"), Value: aws.String("StringVal"), }, // More values... }, ConnectionDraining: &elb.ConnectionDraining{ - Enabled: aws.Boolean(true), // Required - Timeout: aws.Long(1), + Enabled: aws.Bool(true), // Required + Timeout: aws.Int64(1), }, ConnectionSettings: &elb.ConnectionSettings{ - IdleTimeout: aws.Long(1), // Required + IdleTimeout: aws.Int64(1), // Required }, CrossZoneLoadBalancing: &elb.CrossZoneLoadBalancing{ - Enabled: aws.Boolean(true), // Required + Enabled: aws.Bool(true), // Required }, }, LoadBalancerName: aws.String("AccessPointName"), // Required @@ -766,22 +588,14 @@ func ExampleELB_ModifyLoadBalancerAttributes() { resp, err := svc.ModifyLoadBalancerAttributes(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleELB_RegisterInstancesWithLoadBalancer() { @@ -789,8 +603,8 @@ func ExampleELB_RegisterInstancesWithLoadBalancer() { params := &elb.RegisterInstancesWithLoadBalancerInput{ Instances: []*elb.Instance{ // Required - &elb.Instance{ // Required - InstanceID: aws.String("InstanceId"), + { // Required + InstanceId: aws.String("InstanceId"), }, // More values... }, @@ -799,22 +613,14 @@ func ExampleELB_RegisterInstancesWithLoadBalancer() { resp, err := svc.RegisterInstancesWithLoadBalancer(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleELB_RemoveTags() { @@ -826,7 +632,7 @@ func ExampleELB_RemoveTags() { // More values... }, Tags: []*elb.TagKeyOnly{ // Required - &elb.TagKeyOnly{ // Required + { // Required Key: aws.String("TagKey"), }, // More values... @@ -835,22 +641,14 @@ func ExampleELB_RemoveTags() { resp, err := svc.RemoveTags(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleELB_SetLoadBalancerListenerSSLCertificate() { @@ -858,35 +656,27 @@ func ExampleELB_SetLoadBalancerListenerSSLCertificate() { params := &elb.SetLoadBalancerListenerSSLCertificateInput{ LoadBalancerName: aws.String("AccessPointName"), // Required - LoadBalancerPort: aws.Long(1), // Required - SSLCertificateID: aws.String("SSLCertificateId"), // Required + LoadBalancerPort: aws.Int64(1), // Required + SSLCertificateId: aws.String("SSLCertificateId"), // Required } resp, err := svc.SetLoadBalancerListenerSSLCertificate(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleELB_SetLoadBalancerPoliciesForBackendServer() { svc := elb.New(nil) params := &elb.SetLoadBalancerPoliciesForBackendServerInput{ - InstancePort: aws.Long(1), // Required + InstancePort: aws.Int64(1), // Required LoadBalancerName: aws.String("AccessPointName"), // Required PolicyNames: []*string{ // Required aws.String("PolicyName"), // Required @@ -896,22 +686,14 @@ func ExampleELB_SetLoadBalancerPoliciesForBackendServer() { resp, err := svc.SetLoadBalancerPoliciesForBackendServer(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } func ExampleELB_SetLoadBalancerPoliciesOfListener() { @@ -919,7 +701,7 @@ func ExampleELB_SetLoadBalancerPoliciesOfListener() { params := &elb.SetLoadBalancerPoliciesOfListenerInput{ LoadBalancerName: aws.String("AccessPointName"), // Required - LoadBalancerPort: aws.Long(1), // Required + LoadBalancerPort: aws.Int64(1), // Required PolicyNames: []*string{ // Required aws.String("PolicyName"), // Required // More values... @@ -928,20 +710,12 @@ func ExampleELB_SetLoadBalancerPoliciesOfListener() { resp, err := svc.SetLoadBalancerPoliciesOfListener(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - // Generic AWS Error with Code, Message, and original error (if any) - fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) - if reqErr, ok := err.(awserr.RequestFailure); ok { - // A service error occurred - fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) - } - } else { - // This case should never be hit, The SDK should alwsy return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) + fmt.Println(resp) } diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/elb/service.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/elb/service.go index b77651c5356b..20eda10fe43b 100644 --- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/elb/service.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/elb/service.go @@ -4,27 +4,45 @@ package elb import ( "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/defaults" + "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/aws/service" + "github.com/aws/aws-sdk-go/aws/service/serviceinfo" "github.com/aws/aws-sdk-go/internal/protocol/query" "github.com/aws/aws-sdk-go/internal/signer/v4" ) -// ELB is a client for Elastic Load Balancing. +// Elastic Load Balancing distributes incoming traffic across your EC2 instances. +// +// For information about the features of Elastic Load Balancing, see What Is +// Elastic Load Balancing? (http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/elastic-load-balancing.html) +// in the Elastic Load Balancing Developer Guide. +// +// For information about the AWS regions supported by Elastic Load Balancing, +// see Regions and Endpoints - Elastic Load Balancing (http://docs.aws.amazon.com/general/latest/gr/rande.html#elb_region) +// in the Amazon Web Services General Reference. +// +// All Elastic Load Balancing operations are idempotent, which means that they +// complete at most one time. If you repeat an operation, it succeeds with a +// 200 OK response code. type ELB struct { - *aws.Service + *service.Service } // Used for custom service initialization logic -var initService func(*aws.Service) +var initService func(*service.Service) // Used for custom request initialization logic -var initRequest func(*aws.Request) +var initRequest func(*request.Request) // New returns a new ELB client. func New(config *aws.Config) *ELB { - service := &aws.Service{ - Config: aws.DefaultConfig.Merge(config), - ServiceName: "elasticloadbalancing", - APIVersion: "2012-06-01", + service := &service.Service{ + ServiceInfo: serviceinfo.ServiceInfo{ + Config: defaults.DefaultConfig.Merge(config), + ServiceName: "elasticloadbalancing", + APIVersion: "2012-06-01", + }, } service.Initialize() @@ -45,8 +63,8 @@ func New(config *aws.Config) *ELB { // newRequest creates a new request for a ELB operation and runs any // custom request initialization. -func (c *ELB) newRequest(op *aws.Operation, params, data interface{}) *aws.Request { - req := aws.NewRequest(c.Service, op, params, data) +func (c *ELB) newRequest(op *request.Operation, params, data interface{}) *request.Request { + req := c.NewRequest(op, params, data) // Run custom request initialization if present if initRequest != nil { diff --git a/Godeps/_workspace/src/github.com/bradfitz/http2/testdata/draft-ietf-httpbis-http2.xml b/Godeps/_workspace/src/github.com/bradfitz/http2/testdata/draft-ietf-httpbis-http2.xml new file mode 100644 index 000000000000..31a84bed4f07 --- /dev/null +++ b/Godeps/_workspace/src/github.com/bradfitz/http2/testdata/draft-ietf-httpbis-http2.xml @@ -0,0 +1,5021 @@ + + + + + + + + + + + + + + + + + + + Hypertext Transfer Protocol version 2 + + + Twist +
+ mbelshe@chromium.org +
+
+ + + Google, Inc +
+ fenix@google.com +
+
+ + + Mozilla +
+ + 331 E Evelyn Street + Mountain View + CA + 94041 + US + + martin.thomson@gmail.com +
+
+ + + Applications + HTTPbis + HTTP + SPDY + Web + + + + This specification describes an optimized expression of the semantics of the Hypertext + Transfer Protocol (HTTP). HTTP/2 enables a more efficient use of network resources and a + reduced perception of latency by introducing header field compression and allowing multiple + concurrent messages on the same connection. It also introduces unsolicited push of + representations from servers to clients. + + + This specification is an alternative to, but does not obsolete, the HTTP/1.1 message syntax. + HTTP's existing semantics remain unchanged. + + + + + + Discussion of this draft takes place on the HTTPBIS working group mailing list + (ietf-http-wg@w3.org), which is archived at . + + + Working Group information can be found at ; that specific to HTTP/2 are at . + + + The changes in this draft are summarized in . + + + +
+ + +
+ + + The Hypertext Transfer Protocol (HTTP) is a wildly successful protocol. However, the + HTTP/1.1 message format () has + several characteristics that have a negative overall effect on application performance + today. + + + In particular, HTTP/1.0 allowed only one request to be outstanding at a time on a given + TCP connection. HTTP/1.1 added request pipelining, but this only partially addressed + request concurrency and still suffers from head-of-line blocking. Therefore, HTTP/1.1 + clients that need to make many requests typically use multiple connections to a server in + order to achieve concurrency and thereby reduce latency. + + + Furthermore, HTTP header fields are often repetitive and verbose, causing unnecessary + network traffic, as well as causing the initial TCP congestion + window to quickly fill. This can result in excessive latency when multiple requests are + made on a new TCP connection. + + + HTTP/2 addresses these issues by defining an optimized mapping of HTTP's semantics to an + underlying connection. Specifically, it allows interleaving of request and response + messages on the same connection and uses an efficient coding for HTTP header fields. It + also allows prioritization of requests, letting more important requests complete more + quickly, further improving performance. + + + The resulting protocol is more friendly to the network, because fewer TCP connections can + be used in comparison to HTTP/1.x. This means less competition with other flows, and + longer-lived connections, which in turn leads to better utilization of available network + capacity. + + + Finally, HTTP/2 also enables more efficient processing of messages through use of binary + message framing. + +
+ +
+ + HTTP/2 provides an optimized transport for HTTP semantics. HTTP/2 supports all of the core + features of HTTP/1.1, but aims to be more efficient in several ways. + + + The basic protocol unit in HTTP/2 is a frame. Each frame + type serves a different purpose. For example, HEADERS and + DATA frames form the basis of HTTP requests and + responses; other frame types like SETTINGS, + WINDOW_UPDATE, and PUSH_PROMISE are used in support of other + HTTP/2 features. + + + Multiplexing of requests is achieved by having each HTTP request-response exchange + associated with its own stream. Streams are largely + independent of each other, so a blocked or stalled request or response does not prevent + progress on other streams. + + + Flow control and prioritization ensure that it is possible to efficiently use multiplexed + streams. Flow control helps to ensure that only data that + can be used by a receiver is transmitted. Prioritization ensures that limited resources can be directed + to the most important streams first. + + + HTTP/2 adds a new interaction mode, whereby a server can push + responses to a client. Server push allows a server to speculatively send a client + data that the server anticipates the client will need, trading off some network usage + against a potential latency gain. The server does this by synthesizing a request, which it + sends as a PUSH_PROMISE frame. The server is then able to send a response to + the synthetic request on a separate stream. + + + Frames that contain HTTP header fields are compressed. + HTTP requests can be highly redundant, so compression can reduce the size of requests and + responses significantly. + + +
+ + The HTTP/2 specification is split into four parts: + + + Starting HTTP/2 covers how an HTTP/2 connection is + initiated. + + + The framing and streams layers describe the way HTTP/2 frames are + structured and formed into multiplexed streams. + + + Frame and error + definitions include details of the frame and error types used in HTTP/2. + + + HTTP mappings and additional + requirements describe how HTTP semantics are expressed using frames and + streams. + + + + + While some of the frame and stream layer concepts are isolated from HTTP, this + specification does not define a completely generic framing layer. The framing and streams + layers are tailored to the needs of the HTTP protocol and server push. + +
+ +
+ + The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD + NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as + described in RFC 2119. + + + All numeric values are in network byte order. Values are unsigned unless otherwise + indicated. Literal values are provided in decimal or hexadecimal as appropriate. + Hexadecimal literals are prefixed with 0x to distinguish them + from decimal literals. + + + The following terms are used: + + + The endpoint initiating the HTTP/2 connection. + + + A transport-layer connection between two endpoints. + + + An error that affects the entire HTTP/2 connection. + + + Either the client or server of the connection. + + + The smallest unit of communication within an HTTP/2 connection, consisting of a header + and a variable-length sequence of octets structured according to the frame type. + + + An endpoint. When discussing a particular endpoint, "peer" refers to the endpoint + that is remote to the primary subject of discussion. + + + An endpoint that is receiving frames. + + + An endpoint that is transmitting frames. + + + The endpoint which did not initiate the HTTP/2 connection. + + + A bi-directional flow of frames across a virtual channel within the HTTP/2 connection. + + + An error on the individual HTTP/2 stream. + + + + + Finally, the terms "gateway", "intermediary", "proxy", and "tunnel" are defined + in . + +
+
+ +
+ + An HTTP/2 connection is an application layer protocol running on top of a TCP connection + (). The client is the TCP connection initiator. + + + HTTP/2 uses the same "http" and "https" URI schemes used by HTTP/1.1. HTTP/2 shares the same + default port numbers: 80 for "http" URIs and 443 for "https" URIs. As a result, + implementations processing requests for target resource URIs like http://example.org/foo or https://example.com/bar are required to first discover whether the + upstream server (the immediate peer to which the client wishes to establish a connection) + supports HTTP/2. + + + + The means by which support for HTTP/2 is determined is different for "http" and "https" + URIs. Discovery for "http" URIs is described in . Discovery + for "https" URIs is described in . + + +
+ + The protocol defined in this document has two identifiers. + + + + The string "h2" identifies the protocol where HTTP/2 uses TLS. This identifier is used in the TLS application layer protocol negotiation extension (ALPN) + field and any place that HTTP/2 over TLS is identified. + + + The "h2" string is serialized into an ALPN protocol identifier as the two octet + sequence: 0x68, 0x32. + + + + + The string "h2c" identifies the protocol where HTTP/2 is run over cleartext TCP. + This identifier is used in the HTTP/1.1 Upgrade header field and any place that + HTTP/2 over TCP is identified. + + + + + + Negotiating "h2" or "h2c" implies the use of the transport, security, framing and message + semantics described in this document. + + + RFC Editor's Note: please remove the remainder of this section prior to the + publication of a final version of this document. + + + Only implementations of the final, published RFC can identify themselves as "h2" or "h2c". + Until such an RFC exists, implementations MUST NOT identify themselves using these + strings. + + + Examples and text throughout the rest of this document use "h2" as a matter of + editorial convenience only. Implementations of draft versions MUST NOT identify using + this string. + + + Implementations of draft versions of the protocol MUST add the string "-" and the + corresponding draft number to the identifier. For example, draft-ietf-httpbis-http2-11 + over TLS is identified using the string "h2-11". + + + Non-compatible experiments that are based on these draft versions MUST append the string + "-" and an experiment name to the identifier. For example, an experimental implementation + of packet mood-based encoding based on draft-ietf-httpbis-http2-09 might identify itself + as "h2-09-emo". Note that any label MUST conform to the "token" syntax defined in + . Experimenters are + encouraged to coordinate their experiments on the ietf-http-wg@w3.org mailing list. + +
+ +
+ + A client that makes a request for an "http" URI without prior knowledge about support for + HTTP/2 uses the HTTP Upgrade mechanism (). The client makes an HTTP/1.1 request that includes an Upgrade + header field identifying HTTP/2 with the "h2c" token. The HTTP/1.1 request MUST include + exactly one HTTP2-Settings header field. + +
+ For example: + + +]]> +
+ + Requests that contain an entity body MUST be sent in their entirety before the client can + send HTTP/2 frames. This means that a large request entity can block the use of the + connection until it is completely sent. + + + If concurrency of an initial request with subsequent requests is important, an OPTIONS + request can be used to perform the upgrade to HTTP/2, at the cost of an additional + round-trip. + + + A server that does not support HTTP/2 can respond to the request as though the Upgrade + header field were absent: + +
+ +HTTP/1.1 200 OK +Content-Length: 243 +Content-Type: text/html + +... + +
+ + A server MUST ignore a "h2" token in an Upgrade header field. Presence of a token with + "h2" implies HTTP/2 over TLS, which is instead negotiated as described in . + + + A server that supports HTTP/2 can accept the upgrade with a 101 (Switching Protocols) + response. After the empty line that terminates the 101 response, the server can begin + sending HTTP/2 frames. These frames MUST include a response to the request that initiated + the Upgrade. + + +
+ + For example: + + +HTTP/1.1 101 Switching Protocols +Connection: Upgrade +Upgrade: h2c + +[ HTTP/2 connection ... + +
+ + The first HTTP/2 frame sent by the server is a SETTINGS frame () as the server connection preface (). Upon receiving the 101 response, the client sends a connection preface, which includes a + SETTINGS frame. + + + The HTTP/1.1 request that is sent prior to upgrade is assigned stream identifier 1 and is + assigned default priority values. Stream 1 is + implicitly half closed from the client toward the server, since the request is completed + as an HTTP/1.1 request. After commencing the HTTP/2 connection, stream 1 is used for the + response. + + +
+ + A request that upgrades from HTTP/1.1 to HTTP/2 MUST include exactly one HTTP2-Settings header field. The HTTP2-Settings header field is a connection-specific header field + that includes parameters that govern the HTTP/2 connection, provided in anticipation of + the server accepting the request to upgrade. + +
+ +
+ + A server MUST NOT upgrade the connection to HTTP/2 if this header field is not present, + or if more than one is present. A server MUST NOT send this header field. + + + + The content of the HTTP2-Settings header field is the + payload of a SETTINGS frame (), encoded as a + base64url string (that is, the URL- and filename-safe Base64 encoding described in , with any trailing '=' characters omitted). The + ABNF production for token68 is + defined in . + + + Since the upgrade is only intended to apply to the immediate connection, a client + sending HTTP2-Settings MUST also send HTTP2-Settings as a connection option in the Connection header field to prevent it from being forwarded + downstream. + + + A server decodes and interprets these values as it would any other + SETTINGS frame. Acknowledgement of the + SETTINGS parameters is not necessary, since a 101 response serves as implicit + acknowledgment. Providing these values in the Upgrade request gives a client an + opportunity to provide parameters prior to receiving any frames from the server. + +
+
+ +
+ + A client that makes a request to an "https" URI uses TLS + with the application layer protocol negotiation extension. + + + HTTP/2 over TLS uses the "h2" application token. The "h2c" token MUST NOT be sent by a + client or selected by a server. + + + Once TLS negotiation is complete, both the client and the server send a connection preface. + +
+ +
+ + A client can learn that a particular server supports HTTP/2 by other means. For example, + describes a mechanism for advertising this capability. + + + A client MAY immediately send HTTP/2 frames to a server that is known to support HTTP/2, + after the connection preface; a server can + identify such a connection by the presence of the connection preface. This only affects + the establishment of HTTP/2 connections over cleartext TCP; implementations that support + HTTP/2 over TLS MUST use protocol negotiation in TLS. + + + Without additional information, prior support for HTTP/2 is not a strong signal that a + given server will support HTTP/2 for future connections. For example, it is possible for + server configurations to change, for configurations to differ between instances in + clustered servers, or for network conditions to change. + +
+ +
+ + Upon establishment of a TCP connection and determination that HTTP/2 will be used by both + peers, each endpoint MUST send a connection preface as a final confirmation and to + establish the initial SETTINGS parameters for the HTTP/2 connection. The client and + server each send a different connection preface. + + + The client connection preface starts with a sequence of 24 octets, which in hex notation + are: + +
+ +
+ + (the string PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n). This sequence + is followed by a SETTINGS frame (). The + SETTINGS frame MAY be empty. The client sends the client connection + preface immediately upon receipt of a 101 Switching Protocols response (indicating a + successful upgrade), or as the first application data octets of a TLS connection. If + starting an HTTP/2 connection with prior knowledge of server support for the protocol, the + client connection preface is sent upon connection establishment. + + + + + The client connection preface is selected so that a large proportion of HTTP/1.1 or + HTTP/1.0 servers and intermediaries do not attempt to process further frames. Note + that this does not address the concerns raised in . + + + + + The server connection preface consists of a potentially empty SETTINGS + frame () that MUST be the first frame the server sends in the + HTTP/2 connection. + + + The SETTINGS frames received from a peer as part of the connection preface + MUST be acknowledged (see ) after sending the connection + preface. + + + To avoid unnecessary latency, clients are permitted to send additional frames to the + server immediately after sending the client connection preface, without waiting to receive + the server connection preface. It is important to note, however, that the server + connection preface SETTINGS frame might include parameters that necessarily + alter how a client is expected to communicate with the server. Upon receiving the + SETTINGS frame, the client is expected to honor any parameters established. + In some configurations, it is possible for the server to transmit SETTINGS + before the client sends additional frames, providing an opportunity to avoid this issue. + + + Clients and servers MUST treat an invalid connection preface as a connection error of type + PROTOCOL_ERROR. A GOAWAY frame () + MAY be omitted in this case, since an invalid preface indicates that the peer is not using + HTTP/2. + +
+
+ +
+ + Once the HTTP/2 connection is established, endpoints can begin exchanging frames. + + +
+ + All frames begin with a fixed 9-octet header followed by a variable-length payload. + +
+ +
+ + The fields of the frame header are defined as: + + + + The length of the frame payload expressed as an unsigned 24-bit integer. Values + greater than 214 (16,384) MUST NOT be sent unless the receiver has + set a larger value for SETTINGS_MAX_FRAME_SIZE. + + + The 9 octets of the frame header are not included in this value. + + + + + The 8-bit type of the frame. The frame type determines the format and semantics of + the frame. Implementations MUST ignore and discard any frame that has a type that + is unknown. + + + + + An 8-bit field reserved for frame-type specific boolean flags. + + + Flags are assigned semantics specific to the indicated frame type. Flags that have + no defined semantics for a particular frame type MUST be ignored, and MUST be left + unset (0) when sending. + + + + + A reserved 1-bit field. The semantics of this bit are undefined and the bit MUST + remain unset (0) when sending and MUST be ignored when receiving. + + + + + A 31-bit stream identifier (see ). The value 0 is + reserved for frames that are associated with the connection as a whole as opposed to + an individual stream. + + + + + + The structure and content of the frame payload is dependent entirely on the frame type. + +
+ +
+ + The size of a frame payload is limited by the maximum size that a receiver advertises in + the SETTINGS_MAX_FRAME_SIZE setting. This setting can have any value + between 214 (16,384) and 224-1 (16,777,215) octets, + inclusive. + + + All implementations MUST be capable of receiving and minimally processing frames up to + 214 octets in length, plus the 9 octet frame + header. The size of the frame header is not included when describing frame sizes. + + + Certain frame types, such as PING, impose additional limits + on the amount of payload data allowed. + + + + + If a frame size exceeds any defined limit, or is too small to contain mandatory frame + data, the endpoint MUST send a FRAME_SIZE_ERROR error. A frame size error + in a frame that could alter the state of the entire connection MUST be treated as a connection error; this includes any frame carrying + a header block (that is, HEADERS, + PUSH_PROMISE, and CONTINUATION), SETTINGS, + and any WINDOW_UPDATE frame with a stream identifier of 0. + + + Endpoints are not obligated to use all available space in a frame. Responsiveness can be + improved by using frames that are smaller than the permitted maximum size. Sending large + frames can result in delays in sending time-sensitive frames (such + RST_STREAM, WINDOW_UPDATE, or PRIORITY) + which if blocked by the transmission of a large frame, could affect performance. + +
+ +
+ + Just as in HTTP/1, a header field in HTTP/2 is a name with one or more associated values. + They are used within HTTP request and response messages as well as server push operations + (see ). + + + Header lists are collections of zero or more header fields. When transmitted over a + connection, a header list is serialized into a header block using HTTP Header Compression. The serialized header block is then + divided into one or more octet sequences, called header block fragments, and transmitted + within the payload of HEADERS, PUSH_PROMISE or CONTINUATION frames. + + + The Cookie header field is treated specially by the HTTP + mapping (see ). + + + A receiving endpoint reassembles the header block by concatenating its fragments, then + decompresses the block to reconstruct the header list. + + + A complete header block consists of either: + + + a single HEADERS or PUSH_PROMISE frame, + with the END_HEADERS flag set, or + + + a HEADERS or PUSH_PROMISE frame with the END_HEADERS + flag cleared and one or more CONTINUATION frames, + where the last CONTINUATION frame has the END_HEADERS flag set. + + + + + Header compression is stateful. One compression context and one decompression context is + used for the entire connection. Each header block is processed as a discrete unit. + Header blocks MUST be transmitted as a contiguous sequence of frames, with no interleaved + frames of any other type or from any other stream. The last frame in a sequence of + HEADERS or CONTINUATION frames MUST have the END_HEADERS + flag set. The last frame in a sequence of PUSH_PROMISE or + CONTINUATION frames MUST have the END_HEADERS flag set. This allows a + header block to be logically equivalent to a single frame. + + + Header block fragments can only be sent as the payload of HEADERS, + PUSH_PROMISE or CONTINUATION frames, because these frames + carry data that can modify the compression context maintained by a receiver. An endpoint + receiving HEADERS, PUSH_PROMISE or + CONTINUATION frames MUST reassemble header blocks and perform decompression + even if the frames are to be discarded. A receiver MUST terminate the connection with a + connection error of type + COMPRESSION_ERROR if it does not decompress a header block. + +
+
+ +
+ + A "stream" is an independent, bi-directional sequence of frames exchanged between the client + and server within an HTTP/2 connection. Streams have several important characteristics: + + + A single HTTP/2 connection can contain multiple concurrently open streams, with either + endpoint interleaving frames from multiple streams. + + + Streams can be established and used unilaterally or shared by either the client or + server. + + + Streams can be closed by either endpoint. + + + The order in which frames are sent on a stream is significant. Recipients process frames + in the order they are received. In particular, the order of HEADERS, + and DATA frames is semantically significant. + + + Streams are identified by an integer. Stream identifiers are assigned to streams by the + endpoint initiating the stream. + + + + +
+ + The lifecycle of a stream is shown in . + + +
+ + | |<-----------' | + | R | closed | R | + `-------------------->| |<--------------------' + +--------+ + + H: HEADERS frame (with implied CONTINUATIONs) + PP: PUSH_PROMISE frame (with implied CONTINUATIONs) + ES: END_STREAM flag + R: RST_STREAM frame +]]> + +
+ + + Note that this diagram shows stream state transitions and the frames and flags that affect + those transitions only. In this regard, CONTINUATION frames do not result + in state transitions; they are effectively part of the HEADERS or + PUSH_PROMISE that they follow. For this purpose, the END_STREAM flag is + processed as a separate event to the frame that bears it; a HEADERS frame + with the END_STREAM flag set can cause two state transitions. + + + Both endpoints have a subjective view of the state of a stream that could be different + when frames are in transit. Endpoints do not coordinate the creation of streams; they are + created unilaterally by either endpoint. The negative consequences of a mismatch in + states are limited to the "closed" state after sending RST_STREAM, where + frames might be received for some time after closing. + + + Streams have the following states: + + + + + + All streams start in the "idle" state. In this state, no frames have been + exchanged. + + + The following transitions are valid from this state: + + + Sending or receiving a HEADERS frame causes the stream to become + "open". The stream identifier is selected as described in . The same HEADERS frame can also + cause a stream to immediately become "half closed". + + + Sending a PUSH_PROMISE frame marks the associated stream for + later use. The stream state for the reserved stream transitions to "reserved + (local)". + + + Receiving a PUSH_PROMISE frame marks the associated stream as + reserved by the remote peer. The state of the stream becomes "reserved + (remote)". + + + + + Receiving any frames other than HEADERS or + PUSH_PROMISE on a stream in this state MUST be treated as a connection error of type + PROTOCOL_ERROR. + + + + + + + A stream in the "reserved (local)" state is one that has been promised by sending a + PUSH_PROMISE frame. A PUSH_PROMISE frame reserves an + idle stream by associating the stream with an open stream that was initiated by the + remote peer (see ). + + + In this state, only the following transitions are possible: + + + The endpoint can send a HEADERS frame. This causes the stream to + open in a "half closed (remote)" state. + + + Either endpoint can send a RST_STREAM frame to cause the stream + to become "closed". This releases the stream reservation. + + + + + An endpoint MUST NOT send any type of frame other than HEADERS or + RST_STREAM in this state. + + + A PRIORITY frame MAY be received in this state. Receiving any type + of frame other than RST_STREAM or PRIORITY on a stream + in this state MUST be treated as a connection + error of type PROTOCOL_ERROR. + + + + + + + A stream in the "reserved (remote)" state has been reserved by a remote peer. + + + In this state, only the following transitions are possible: + + + Receiving a HEADERS frame causes the stream to transition to + "half closed (local)". + + + Either endpoint can send a RST_STREAM frame to cause the stream + to become "closed". This releases the stream reservation. + + + + + An endpoint MAY send a PRIORITY frame in this state to reprioritize + the reserved stream. An endpoint MUST NOT send any type of frame other than + RST_STREAM, WINDOW_UPDATE, or PRIORITY + in this state. + + + Receiving any type of frame other than HEADERS or + RST_STREAM on a stream in this state MUST be treated as a connection error of type + PROTOCOL_ERROR. + + + + + + + A stream in the "open" state may be used by both peers to send frames of any type. + In this state, sending peers observe advertised stream + level flow control limits. + + + From this state either endpoint can send a frame with an END_STREAM flag set, which + causes the stream to transition into one of the "half closed" states: an endpoint + sending an END_STREAM flag causes the stream state to become "half closed (local)"; + an endpoint receiving an END_STREAM flag causes the stream state to become "half + closed (remote)". + + + Either endpoint can send a RST_STREAM frame from this state, causing + it to transition immediately to "closed". + + + + + + + A stream that is in the "half closed (local)" state cannot be used for sending + frames. Only WINDOW_UPDATE, PRIORITY and + RST_STREAM frames can be sent in this state. + + + A stream transitions from this state to "closed" when a frame that contains an + END_STREAM flag is received, or when either peer sends a RST_STREAM + frame. + + + A receiver can ignore WINDOW_UPDATE frames in this state, which might + arrive for a short period after a frame bearing the END_STREAM flag is sent. + + + PRIORITY frames received in this state are used to reprioritize + streams that depend on the current stream. + + + + + + + A stream that is "half closed (remote)" is no longer being used by the peer to send + frames. In this state, an endpoint is no longer obligated to maintain a receiver + flow control window if it performs flow control. + + + If an endpoint receives additional frames for a stream that is in this state, other + than WINDOW_UPDATE, PRIORITY or + RST_STREAM, it MUST respond with a stream error of type + STREAM_CLOSED. + + + A stream that is "half closed (remote)" can be used by the endpoint to send frames + of any type. In this state, the endpoint continues to observe advertised stream level flow control limits. + + + A stream can transition from this state to "closed" by sending a frame that contains + an END_STREAM flag, or when either peer sends a RST_STREAM frame. + + + + + + + The "closed" state is the terminal state. + + + An endpoint MUST NOT send frames other than PRIORITY on a closed + stream. An endpoint that receives any frame other than PRIORITY + after receiving a RST_STREAM MUST treat that as a stream error of type + STREAM_CLOSED. Similarly, an endpoint that receives any frames after + receiving a frame with the END_STREAM flag set MUST treat that as a connection error of type + STREAM_CLOSED, unless the frame is permitted as described below. + + + WINDOW_UPDATE or RST_STREAM frames can be received in + this state for a short period after a DATA or HEADERS + frame containing an END_STREAM flag is sent. Until the remote peer receives and + processes RST_STREAM or the frame bearing the END_STREAM flag, it + might send frames of these types. Endpoints MUST ignore + WINDOW_UPDATE or RST_STREAM frames received in this + state, though endpoints MAY choose to treat frames that arrive a significant time + after sending END_STREAM as a connection + error of type PROTOCOL_ERROR. + + + PRIORITY frames can be sent on closed streams to prioritize streams + that are dependent on the closed stream. Endpoints SHOULD process + PRIORITY frame, though they can be ignored if the stream has been + removed from the dependency tree (see ). + + + If this state is reached as a result of sending a RST_STREAM frame, + the peer that receives the RST_STREAM might have already sent - or + enqueued for sending - frames on the stream that cannot be withdrawn. An endpoint + MUST ignore frames that it receives on closed streams after it has sent a + RST_STREAM frame. An endpoint MAY choose to limit the period over + which it ignores frames and treat frames that arrive after this time as being in + error. + + + Flow controlled frames (i.e., DATA) received after sending + RST_STREAM are counted toward the connection flow control window. + Even though these frames might be ignored, because they are sent before the sender + receives the RST_STREAM, the sender will consider the frames to count + against the flow control window. + + + An endpoint might receive a PUSH_PROMISE frame after it sends + RST_STREAM. PUSH_PROMISE causes a stream to become + "reserved" even if the associated stream has been reset. Therefore, a + RST_STREAM is needed to close an unwanted promised stream. + + + + + + In the absence of more specific guidance elsewhere in this document, implementations + SHOULD treat the receipt of a frame that is not expressly permitted in the description of + a state as a connection error of type + PROTOCOL_ERROR. Frame of unknown types are ignored. + + + An example of the state transitions for an HTTP request/response exchange can be found in + . An example of the state transitions for server push can be + found in and . + + +
+ + Streams are identified with an unsigned 31-bit integer. Streams initiated by a client + MUST use odd-numbered stream identifiers; those initiated by the server MUST use + even-numbered stream identifiers. A stream identifier of zero (0x0) is used for + connection control messages; the stream identifier zero cannot be used to establish a + new stream. + + + HTTP/1.1 requests that are upgraded to HTTP/2 (see ) are + responded to with a stream identifier of one (0x1). After the upgrade + completes, stream 0x1 is "half closed (local)" to the client. Therefore, stream 0x1 + cannot be selected as a new stream identifier by a client that upgrades from HTTP/1.1. + + + The identifier of a newly established stream MUST be numerically greater than all + streams that the initiating endpoint has opened or reserved. This governs streams that + are opened using a HEADERS frame and streams that are reserved using + PUSH_PROMISE. An endpoint that receives an unexpected stream identifier + MUST respond with a connection error of + type PROTOCOL_ERROR. + + + The first use of a new stream identifier implicitly closes all streams in the "idle" + state that might have been initiated by that peer with a lower-valued stream identifier. + For example, if a client sends a HEADERS frame on stream 7 without ever + sending a frame on stream 5, then stream 5 transitions to the "closed" state when the + first frame for stream 7 is sent or received. + + + Stream identifiers cannot be reused. Long-lived connections can result in an endpoint + exhausting the available range of stream identifiers. A client that is unable to + establish a new stream identifier can establish a new connection for new streams. A + server that is unable to establish a new stream identifier can send a + GOAWAY frame so that the client is forced to open a new connection for + new streams. + +
+ +
+ + A peer can limit the number of concurrently active streams using the + SETTINGS_MAX_CONCURRENT_STREAMS parameter (see ) within a SETTINGS frame. The maximum concurrent + streams setting is specific to each endpoint and applies only to the peer that receives + the setting. That is, clients specify the maximum number of concurrent streams the + server can initiate, and servers specify the maximum number of concurrent streams the + client can initiate. + + + Streams that are in the "open" state, or either of the "half closed" states count toward + the maximum number of streams that an endpoint is permitted to open. Streams in any of + these three states count toward the limit advertised in the + SETTINGS_MAX_CONCURRENT_STREAMS setting. Streams in either of the + "reserved" states do not count toward the stream limit. + + + Endpoints MUST NOT exceed the limit set by their peer. An endpoint that receives a + HEADERS frame that causes their advertised concurrent stream limit to be + exceeded MUST treat this as a stream error. An + endpoint that wishes to reduce the value of + SETTINGS_MAX_CONCURRENT_STREAMS to a value that is below the current + number of open streams can either close streams that exceed the new value or allow + streams to complete. + +
+
+ +
+ + Using streams for multiplexing introduces contention over use of the TCP connection, + resulting in blocked streams. A flow control scheme ensures that streams on the same + connection do not destructively interfere with each other. Flow control is used for both + individual streams and for the connection as a whole. + + + HTTP/2 provides for flow control through use of the WINDOW_UPDATE frame. + + +
+ + HTTP/2 stream flow control aims to allow a variety of flow control algorithms to be + used without requiring protocol changes. Flow control in HTTP/2 has the following + characteristics: + + + Flow control is specific to a connection; i.e., it is "hop-by-hop", not + "end-to-end". + + + Flow control is based on window update frames. Receivers advertise how many octets + they are prepared to receive on a stream and for the entire connection. This is a + credit-based scheme. + + + Flow control is directional with overall control provided by the receiver. A + receiver MAY choose to set any window size that it desires for each stream and for + the entire connection. A sender MUST respect flow control limits imposed by a + receiver. Clients, servers and intermediaries all independently advertise their + flow control window as a receiver and abide by the flow control limits set by + their peer when sending. + + + The initial value for the flow control window is 65,535 octets for both new streams + and the overall connection. + + + The frame type determines whether flow control applies to a frame. Of the frames + specified in this document, only DATA frames are subject to flow + control; all other frame types do not consume space in the advertised flow control + window. This ensures that important control frames are not blocked by flow control. + + + Flow control cannot be disabled. + + + HTTP/2 defines only the format and semantics of the WINDOW_UPDATE + frame (). This document does not stipulate how a + receiver decides when to send this frame or the value that it sends, nor does it + specify how a sender chooses to send packets. Implementations are able to select + any algorithm that suits their needs. + + + + + Implementations are also responsible for managing how requests and responses are sent + based on priority; choosing how to avoid head of line blocking for requests; and + managing the creation of new streams. Algorithm choices for these could interact with + any flow control algorithm. + +
+ +
+ + Flow control is defined to protect endpoints that are operating under resource + constraints. For example, a proxy needs to share memory between many connections, and + also might have a slow upstream connection and a fast downstream one. Flow control + addresses cases where the receiver is unable process data on one stream, yet wants to + continue to process other streams in the same connection. + + + Deployments that do not require this capability can advertise a flow control window of + the maximum size, incrementing the available space when new data is received. This + effectively disables flow control for that receiver. Conversely, a sender is always + subject to the flow control window advertised by the receiver. + + + Deployments with constrained resources (for example, memory) can employ flow control to + limit the amount of memory a peer can consume. Note, however, that this can lead to + suboptimal use of available network resources if flow control is enabled without + knowledge of the bandwidth-delay product (see ). + + + Even with full awareness of the current bandwidth-delay product, implementation of flow + control can be difficult. When using flow control, the receiver MUST read from the TCP + receive buffer in a timely fashion. Failure to do so could lead to a deadlock when + critical frames, such as WINDOW_UPDATE, are not read and acted upon. + +
+
+ +
+ + A client can assign a priority for a new stream by including prioritization information in + the HEADERS frame that opens the stream. For an existing + stream, the PRIORITY frame can be used to change the + priority. + + + The purpose of prioritization is to allow an endpoint to express how it would prefer its + peer allocate resources when managing concurrent streams. Most importantly, priority can + be used to select streams for transmitting frames when there is limited capacity for + sending. + + + Streams can be prioritized by marking them as dependent on the completion of other streams + (). Each dependency is assigned a relative weight, a number + that is used to determine the relative proportion of available resources that are assigned + to streams dependent on the same stream. + + + + Explicitly setting the priority for a stream is input to a prioritization process. It + does not guarantee any particular processing or transmission order for the stream relative + to any other stream. An endpoint cannot force a peer to process concurrent streams in a + particular order using priority. Expressing priority is therefore only ever a suggestion. + + + Providing prioritization information is optional, so default values are used if no + explicit indicator is provided (). + + +
+ + Each stream can be given an explicit dependency on another stream. Including a + dependency expresses a preference to allocate resources to the identified stream rather + than to the dependent stream. + + + A stream that is not dependent on any other stream is given a stream dependency of 0x0. + In other words, the non-existent stream 0 forms the root of the tree. + + + A stream that depends on another stream is a dependent stream. The stream upon which a + stream is dependent is a parent stream. A dependency on a stream that is not currently + in the tree - such as a stream in the "idle" state - results in that stream being given + a default priority. + + + When assigning a dependency on another stream, the stream is added as a new dependency + of the parent stream. Dependent streams that share the same parent are not ordered with + respect to each other. For example, if streams B and C are dependent on stream A, and + if stream D is created with a dependency on stream A, this results in a dependency order + of A followed by B, C, and D in any order. + +
+ /|\ + B C B D C +]]> +
+ + An exclusive flag allows for the insertion of a new level of dependencies. The + exclusive flag causes the stream to become the sole dependency of its parent stream, + causing other dependencies to become dependent on the exclusive stream. In the + previous example, if stream D is created with an exclusive dependency on stream A, this + results in D becoming the dependency parent of B and C. + +
+ D + B C / \ + B C +]]> +
+ + Inside the dependency tree, a dependent stream SHOULD only be allocated resources if all + of the streams that it depends on (the chain of parent streams up to 0x0) are either + closed, or it is not possible to make progress on them. + + + A stream cannot depend on itself. An endpoint MUST treat this as a stream error of type PROTOCOL_ERROR. + +
+ +
+ + All dependent streams are allocated an integer weight between 1 and 256 (inclusive). + + + Streams with the same parent SHOULD be allocated resources proportionally based on their + weight. Thus, if stream B depends on stream A with weight 4, and C depends on stream A + with weight 12, and if no progress can be made on A, stream B ideally receives one third + of the resources allocated to stream C. + +
+ +
+ + Stream priorities are changed using the PRIORITY frame. Setting a + dependency causes a stream to become dependent on the identified parent stream. + + + Dependent streams move with their parent stream if the parent is reprioritized. Setting + a dependency with the exclusive flag for a reprioritized stream moves all the + dependencies of the new parent stream to become dependent on the reprioritized stream. + + + If a stream is made dependent on one of its own dependencies, the formerly dependent + stream is first moved to be dependent on the reprioritized stream's previous parent. + The moved dependency retains its weight. + +
+ + For example, consider an original dependency tree where B and C depend on A, D and E + depend on C, and F depends on D. If A is made dependent on D, then D takes the place + of A. All other dependency relationships stay the same, except for F, which becomes + dependent on A if the reprioritization is exclusive. + + F B C ==> F A OR A + / \ | / \ /|\ + D E E B C B C F + | | | + F E E + (intermediate) (non-exclusive) (exclusive) +]]> +
+
+ +
+ + When a stream is removed from the dependency tree, its dependencies can be moved to + become dependent on the parent of the closed stream. The weights of new dependencies + are recalculated by distributing the weight of the dependency of the closed stream + proportionally based on the weights of its dependencies. + + + Streams that are removed from the dependency tree cause some prioritization information + to be lost. Resources are shared between streams with the same parent stream, which + means that if a stream in that set closes or becomes blocked, any spare capacity + allocated to a stream is distributed to the immediate neighbors of the stream. However, + if the common dependency is removed from the tree, those streams share resources with + streams at the next highest level. + + + For example, assume streams A and B share a parent, and streams C and D both depend on + stream A. Prior to the removal of stream A, if streams A and D are unable to proceed, + then stream C receives all the resources dedicated to stream A. If stream A is removed + from the tree, the weight of stream A is divided between streams C and D. If stream D + is still unable to proceed, this results in stream C receiving a reduced proportion of + resources. For equal starting weights, C receives one third, rather than one half, of + available resources. + + + It is possible for a stream to become closed while prioritization information that + creates a dependency on that stream is in transit. If a stream identified in a + dependency has no associated priority information, then the dependent stream is instead + assigned a default priority. This potentially creates + suboptimal prioritization, since the stream could be given a priority that is different + to what is intended. + + + To avoid these problems, an endpoint SHOULD retain stream prioritization state for a + period after streams become closed. The longer state is retained, the lower the chance + that streams are assigned incorrect or default priority values. + + + This could create a large state burden for an endpoint, so this state MAY be limited. + An endpoint MAY apply a fixed upper limit on the number of closed streams for which + prioritization state is tracked to limit state exposure. The amount of additional state + an endpoint maintains could be dependent on load; under high load, prioritization state + can be discarded to limit resource commitments. In extreme cases, an endpoint could + even discard prioritization state for active or reserved streams. If a fixed limit is + applied, endpoints SHOULD maintain state for at least as many streams as allowed by + their setting for SETTINGS_MAX_CONCURRENT_STREAMS. + + + An endpoint receiving a PRIORITY frame that changes the priority of a + closed stream SHOULD alter the dependencies of the streams that depend on it, if it has + retained enough state to do so. + +
+ +
+ + Providing priority information is optional. Streams are assigned a non-exclusive + dependency on stream 0x0 by default. Pushed streams + initially depend on their associated stream. In both cases, streams are assigned a + default weight of 16. + +
+
+ +
+ + HTTP/2 framing permits two classes of error: + + + An error condition that renders the entire connection unusable is a connection error. + + + An error in an individual stream is a stream error. + + + + + A list of error codes is included in . + + +
+ + A connection error is any error which prevents further processing of the framing layer, + or which corrupts any connection state. + + + An endpoint that encounters a connection error SHOULD first send a GOAWAY + frame () with the stream identifier of the last stream that it + successfully received from its peer. The GOAWAY frame includes an error + code that indicates why the connection is terminating. After sending the + GOAWAY frame, the endpoint MUST close the TCP connection. + + + It is possible that the GOAWAY will not be reliably received by the + receiving endpoint (see ). In the event of a connection error, + GOAWAY only provides a best effort attempt to communicate with the peer + about why the connection is being terminated. + + + An endpoint can end a connection at any time. In particular, an endpoint MAY choose to + treat a stream error as a connection error. Endpoints SHOULD send a + GOAWAY frame when ending a connection, providing that circumstances + permit it. + +
+ +
+ + A stream error is an error related to a specific stream that does not affect processing + of other streams. + + + An endpoint that detects a stream error sends a RST_STREAM frame () that contains the stream identifier of the stream where the error + occurred. The RST_STREAM frame includes an error code that indicates the + type of error. + + + A RST_STREAM is the last frame that an endpoint can send on a stream. + The peer that sends the RST_STREAM frame MUST be prepared to receive any + frames that were sent or enqueued for sending by the remote peer. These frames can be + ignored, except where they modify connection state (such as the state maintained for + header compression, or flow control). + + + Normally, an endpoint SHOULD NOT send more than one RST_STREAM frame for + any stream. However, an endpoint MAY send additional RST_STREAM frames if + it receives frames on a closed stream after more than a round-trip time. This behavior + is permitted to deal with misbehaving implementations. + + + An endpoint MUST NOT send a RST_STREAM in response to an + RST_STREAM frame, to avoid looping. + +
+ +
+ + If the TCP connection is closed or reset while streams remain in open or half closed + states, then the endpoint MUST assume that those streams were abnormally interrupted and + could be incomplete. + +
+
+ +
+ + HTTP/2 permits extension of the protocol. Protocol extensions can be used to provide + additional services or alter any aspect of the protocol, within the limitations described + in this section. Extensions are effective only within the scope of a single HTTP/2 + connection. + + + Extensions are permitted to use new frame types, new + settings, or new error + codes. Registries are established for managing these extension points: frame types, settings and + error codes. + + + Implementations MUST ignore unknown or unsupported values in all extensible protocol + elements. Implementations MUST discard frames that have unknown or unsupported types. + This means that any of these extension points can be safely used by extensions without + prior arrangement or negotiation. However, extension frames that appear in the middle of + a header block are not permitted; these MUST be treated + as a connection error of type + PROTOCOL_ERROR. + + + However, extensions that could change the semantics of existing protocol components MUST + be negotiated before being used. For example, an extension that changes the layout of the + HEADERS frame cannot be used until the peer has given a positive signal + that this is acceptable. In this case, it could also be necessary to coordinate when the + revised layout comes into effect. Note that treating any frame other than + DATA frames as flow controlled is such a change in semantics, and can only + be done through negotiation. + + + This document doesn't mandate a specific method for negotiating the use of an extension, + but notes that a setting could be used for that + purpose. If both peers set a value that indicates willingness to use the extension, then + the extension can be used. If a setting is used for extension negotiation, the initial + value MUST be defined so that the extension is initially disabled. + +
+
+ +
+ + This specification defines a number of frame types, each identified by a unique 8-bit type + code. Each frame type serves a distinct purpose either in the establishment and management + of the connection as a whole, or of individual streams. + + + The transmission of specific frame types can alter the state of a connection. If endpoints + fail to maintain a synchronized view of the connection state, successful communication + within the connection will no longer be possible. Therefore, it is important that endpoints + have a shared comprehension of how the state is affected by the use any given frame. + + +
+ + DATA frames (type=0x0) convey arbitrary, variable-length sequences of octets associated + with a stream. One or more DATA frames are used, for instance, to carry HTTP request or + response payloads. + + + DATA frames MAY also contain arbitrary padding. Padding can be added to DATA frames to + obscure the size of messages. + +
+ +
+ + The DATA frame contains the following fields: + + + An 8-bit field containing the length of the frame padding in units of octets. This + field is optional and is only present if the PADDED flag is set. + + + Application data. The amount of data is the remainder of the frame payload after + subtracting the length of the other fields that are present. + + + Padding octets that contain no application semantic value. Padding octets MUST be set + to zero when sending and ignored when receiving. + + + + + + The DATA frame defines the following flags: + + + Bit 1 being set indicates that this frame is the last that the endpoint will send for + the identified stream. Setting this flag causes the stream to enter one of the "half closed" states or the "closed" state. + + + Bit 4 being set indicates that the Pad Length field and any padding that it describes + is present. + + + + + DATA frames MUST be associated with a stream. If a DATA frame is received whose stream + identifier field is 0x0, the recipient MUST respond with a connection error of type + PROTOCOL_ERROR. + + + DATA frames are subject to flow control and can only be sent when a stream is in the + "open" or "half closed (remote)" states. The entire DATA frame payload is included in flow + control, including Pad Length and Padding fields if present. If a DATA frame is received + whose stream is not in "open" or "half closed (local)" state, the recipient MUST respond + with a stream error of type + STREAM_CLOSED. + + + The total number of padding octets is determined by the value of the Pad Length field. If + the length of the padding is greater than the length of the frame payload, the recipient + MUST treat this as a connection error of + type PROTOCOL_ERROR. + + + A frame can be increased in size by one octet by including a Pad Length field with a + value of zero. + + + + + Padding is a security feature; see . + +
+ +
+ + The HEADERS frame (type=0x1) is used to open a stream, + and additionally carries a header block fragment. HEADERS frames can be sent on a stream + in the "open" or "half closed (remote)" states. + +
+ +
+ + The HEADERS frame payload has the following fields: + + + An 8-bit field containing the length of the frame padding in units of octets. This + field is only present if the PADDED flag is set. + + + A single bit flag indicates that the stream dependency is exclusive, see . This field is only present if the PRIORITY flag is set. + + + A 31-bit stream identifier for the stream that this stream depends on, see . This field is only present if the PRIORITY flag is set. + + + An 8-bit weight for the stream, see . Add one to the + value to obtain a weight between 1 and 256. This field is only present if the + PRIORITY flag is set. + + + A header block fragment. + + + Padding octets that contain no application semantic value. Padding octets MUST be set + to zero when sending and ignored when receiving. + + + + + + The HEADERS frame defines the following flags: + + + + Bit 1 being set indicates that the header block is + the last that the endpoint will send for the identified stream. Setting this flag + causes the stream to enter one of "half closed" + states. + + + A HEADERS frame carries the END_STREAM flag that signals the end of a stream. + However, a HEADERS frame with the END_STREAM flag set can be followed by + CONTINUATION frames on the same stream. Logically, the + CONTINUATION frames are part of the HEADERS frame. + + + + + Bit 3 being set indicates that this frame contains an entire header block and is not followed by any + CONTINUATION frames. + + + A HEADERS frame without the END_HEADERS flag set MUST be followed by a + CONTINUATION frame for the same stream. A receiver MUST treat the + receipt of any other type of frame or a frame on a different stream as a connection error of type + PROTOCOL_ERROR. + + + + + Bit 4 being set indicates that the Pad Length field and any padding that it + describes is present. + + + + + Bit 6 being set indicates that the Exclusive Flag (E), Stream Dependency, and Weight + fields are present; see . + + + + + + + The payload of a HEADERS frame contains a header block + fragment. A header block that does not fit within a HEADERS frame is continued in + a CONTINUATION frame. + + + + HEADERS frames MUST be associated with a stream. If a HEADERS frame is received whose + stream identifier field is 0x0, the recipient MUST respond with a connection error of type + PROTOCOL_ERROR. + + + + The HEADERS frame changes the connection state as described in . + + + + The HEADERS frame includes optional padding. Padding fields and flags are identical to + those defined for DATA frames. + + + Prioritization information in a HEADERS frame is logically equivalent to a separate + PRIORITY frame, but inclusion in HEADERS avoids the potential for churn in + stream prioritization when new streams are created. Priorization fields in HEADERS frames + subsequent to the first on a stream reprioritize the + stream. + +
+ +
+ + The PRIORITY frame (type=0x2) specifies the sender-advised + priority of a stream. It can be sent at any time for an existing stream, including + closed streams. This enables reprioritization of existing streams. + +
+ +
+ + The payload of a PRIORITY frame contains the following fields: + + + A single bit flag indicates that the stream dependency is exclusive, see . + + + A 31-bit stream identifier for the stream that this stream depends on, see . + + + An 8-bit weight for the identified stream dependency, see . Add one to the value to obtain a weight between 1 and 256. + + + + + + The PRIORITY frame does not define any flags. + + + + The PRIORITY frame is associated with an existing stream. If a PRIORITY frame is received + with a stream identifier of 0x0, the recipient MUST respond with a connection error of type + PROTOCOL_ERROR. + + + The PRIORITY frame can be sent on a stream in any of the "reserved (remote)", "open", + "half closed (local)", "half closed (remote)", or "closed" states, though it cannot be + sent between consecutive frames that comprise a single header + block. Note that this frame could arrive after processing or frame sending has + completed, which would cause it to have no effect on the current stream. For a stream + that is in the "half closed (remote)" or "closed" - state, this frame can only affect + processing of the current stream and not frame transmission. + + + The PRIORITY frame is the only frame that can be sent for a stream in the "closed" state. + This allows for the reprioritization of a group of dependent streams by altering the + priority of a parent stream, which might be closed. However, a PRIORITY frame sent on a + closed stream risks being ignored due to the peer having discarded priority state + information for that stream. + +
+ +
+ + The RST_STREAM frame (type=0x3) allows for abnormal termination of a stream. When sent by + the initiator of a stream, it indicates that they wish to cancel the stream or that an + error condition has occurred. When sent by the receiver of a stream, it indicates that + either the receiver is rejecting the stream, requesting that the stream be cancelled, or + that an error condition has occurred. + +
+ +
+ + + The RST_STREAM frame contains a single unsigned, 32-bit integer identifying the error code. The error code indicates why the stream is being + terminated. + + + + The RST_STREAM frame does not define any flags. + + + + The RST_STREAM frame fully terminates the referenced stream and causes it to enter the + closed state. After receiving a RST_STREAM on a stream, the receiver MUST NOT send + additional frames for that stream, with the exception of PRIORITY. However, + after sending the RST_STREAM, the sending endpoint MUST be prepared to receive and process + additional frames sent on the stream that might have been sent by the peer prior to the + arrival of the RST_STREAM. + + + + RST_STREAM frames MUST be associated with a stream. If a RST_STREAM frame is received + with a stream identifier of 0x0, the recipient MUST treat this as a connection error of type + PROTOCOL_ERROR. + + + + RST_STREAM frames MUST NOT be sent for a stream in the "idle" state. If a RST_STREAM + frame identifying an idle stream is received, the recipient MUST treat this as a connection error of type + PROTOCOL_ERROR. + + +
+ +
+ + The SETTINGS frame (type=0x4) conveys configuration parameters that affect how endpoints + communicate, such as preferences and constraints on peer behavior. The SETTINGS frame is + also used to acknowledge the receipt of those parameters. Individually, a SETTINGS + parameter can also be referred to as a "setting". + + + SETTINGS parameters are not negotiated; they describe characteristics of the sending peer, + which are used by the receiving peer. Different values for the same parameter can be + advertised by each peer. For example, a client might set a high initial flow control + window, whereas a server might set a lower value to conserve resources. + + + + A SETTINGS frame MUST be sent by both endpoints at the start of a connection, and MAY be + sent at any other time by either endpoint over the lifetime of the connection. + Implementations MUST support all of the parameters defined by this specification. + + + + Each parameter in a SETTINGS frame replaces any existing value for that parameter. + Parameters are processed in the order in which they appear, and a receiver of a SETTINGS + frame does not need to maintain any state other than the current value of its + parameters. Therefore, the value of a SETTINGS parameter is the last value that is seen by + a receiver. + + + SETTINGS parameters are acknowledged by the receiving peer. To enable this, the SETTINGS + frame defines the following flag: + + + Bit 1 being set indicates that this frame acknowledges receipt and application of the + peer's SETTINGS frame. When this bit is set, the payload of the SETTINGS frame MUST + be empty. Receipt of a SETTINGS frame with the ACK flag set and a length field value + other than 0 MUST be treated as a connection + error of type FRAME_SIZE_ERROR. For more info, see Settings Synchronization. + + + + + SETTINGS frames always apply to a connection, never a single stream. The stream + identifier for a SETTINGS frame MUST be zero (0x0). If an endpoint receives a SETTINGS + frame whose stream identifier field is anything other than 0x0, the endpoint MUST respond + with a connection error of type + PROTOCOL_ERROR. + + + The SETTINGS frame affects connection state. A badly formed or incomplete SETTINGS frame + MUST be treated as a connection error of type + PROTOCOL_ERROR. + + +
+ + The payload of a SETTINGS frame consists of zero or more parameters, each consisting of + an unsigned 16-bit setting identifier and an unsigned 32-bit value. + + +
+ +
+
+ +
+ + The following parameters are defined: + + + + Allows the sender to inform the remote endpoint of the maximum size of the header + compression table used to decode header blocks, in octets. The encoder can select + any size equal to or less than this value by using signaling specific to the + header compression format inside a header block. The initial value is 4,096 + octets. + + + + + This setting can be use to disable server + push. An endpoint MUST NOT send a PUSH_PROMISE frame if it + receives this parameter set to a value of 0. An endpoint that has both set this + parameter to 0 and had it acknowledged MUST treat the receipt of a + PUSH_PROMISE frame as a connection error of type + PROTOCOL_ERROR. + + + The initial value is 1, which indicates that server push is permitted. Any value + other than 0 or 1 MUST be treated as a connection error of type + PROTOCOL_ERROR. + + + + + Indicates the maximum number of concurrent streams that the sender will allow. + This limit is directional: it applies to the number of streams that the sender + permits the receiver to create. Initially there is no limit to this value. It is + recommended that this value be no smaller than 100, so as to not unnecessarily + limit parallelism. + + + A value of 0 for SETTINGS_MAX_CONCURRENT_STREAMS SHOULD NOT be treated as special + by endpoints. A zero value does prevent the creation of new streams, however this + can also happen for any limit that is exhausted with active streams. Servers + SHOULD only set a zero value for short durations; if a server does not wish to + accept requests, closing the connection could be preferable. + + + + + Indicates the sender's initial window size (in octets) for stream level flow + control. The initial value is 216-1 (65,535) octets. + + + This setting affects the window size of all streams, including existing streams, + see . + + + Values above the maximum flow control window size of 231-1 MUST + be treated as a connection error of + type FLOW_CONTROL_ERROR. + + + + + Indicates the size of the largest frame payload that the sender is willing to + receive, in octets. + + + The initial value is 214 (16,384) octets. The value advertised by + an endpoint MUST be between this initial value and the maximum allowed frame size + (224-1 or 16,777,215 octets), inclusive. Values outside this range + MUST be treated as a connection error + of type PROTOCOL_ERROR. + + + + + This advisory setting informs a peer of the maximum size of header list that the + sender is prepared to accept, in octets. The value is based on the uncompressed + size of header fields, including the length of the name and value in octets plus + an overhead of 32 octets for each header field. + + + For any given request, a lower limit than what is advertised MAY be enforced. The + initial value of this setting is unlimited. + + + + + + An endpoint that receives a SETTINGS frame with any unknown or unsupported identifier + MUST ignore that setting. + +
+ +
+ + Most values in SETTINGS benefit from or require an understanding of when the peer has + received and applied the changed parameter values. In order to provide + such synchronization timepoints, the recipient of a SETTINGS frame in which the ACK flag + is not set MUST apply the updated parameters as soon as possible upon receipt. + + + The values in the SETTINGS frame MUST be processed in the order they appear, with no + other frame processing between values. Unsupported parameters MUST be ignored. Once + all values have been processed, the recipient MUST immediately emit a SETTINGS frame + with the ACK flag set. Upon receiving a SETTINGS frame with the ACK flag set, the sender + of the altered parameters can rely on the setting having been applied. + + + If the sender of a SETTINGS frame does not receive an acknowledgement within a + reasonable amount of time, it MAY issue a connection error of type + SETTINGS_TIMEOUT. + +
+
+ +
+ + The PUSH_PROMISE frame (type=0x5) is used to notify the peer endpoint in advance of + streams the sender intends to initiate. The PUSH_PROMISE frame includes the unsigned + 31-bit identifier of the stream the endpoint plans to create along with a set of headers + that provide additional context for the stream. contains a + thorough description of the use of PUSH_PROMISE frames. + + +
+ +
+ + The PUSH_PROMISE frame payload has the following fields: + + + An 8-bit field containing the length of the frame padding in units of octets. This + field is only present if the PADDED flag is set. + + + A single reserved bit. + + + An unsigned 31-bit integer that identifies the stream that is reserved by the + PUSH_PROMISE. The promised stream identifier MUST be a valid choice for the next + stream sent by the sender (see new stream + identifier). + + + A header block fragment containing request header + fields. + + + Padding octets. + + + + + + The PUSH_PROMISE frame defines the following flags: + + + + Bit 3 being set indicates that this frame contains an entire header block and is not followed by any + CONTINUATION frames. + + + A PUSH_PROMISE frame without the END_HEADERS flag set MUST be followed by a + CONTINUATION frame for the same stream. A receiver MUST treat the receipt of any + other type of frame or a frame on a different stream as a connection error of type + PROTOCOL_ERROR. + + + + + Bit 4 being set indicates that the Pad Length field and any padding that it + describes is present. + + + + + + + PUSH_PROMISE frames MUST be associated with an existing, peer-initiated stream. The stream + identifier of a PUSH_PROMISE frame indicates the stream it is associated with. If the + stream identifier field specifies the value 0x0, a recipient MUST respond with a connection error of type + PROTOCOL_ERROR. + + + + Promised streams are not required to be used in the order they are promised. The + PUSH_PROMISE only reserves stream identifiers for later use. + + + + PUSH_PROMISE MUST NOT be sent if the SETTINGS_ENABLE_PUSH setting of the + peer endpoint is set to 0. An endpoint that has set this setting and has received + acknowledgement MUST treat the receipt of a PUSH_PROMISE frame as a connection error of type + PROTOCOL_ERROR. + + + Recipients of PUSH_PROMISE frames can choose to reject promised streams by returning a + RST_STREAM referencing the promised stream identifier back to the sender of + the PUSH_PROMISE. + + + + A PUSH_PROMISE frame modifies the connection state in two ways. The inclusion of a header block potentially modifies the state maintained for + header compression. PUSH_PROMISE also reserves a stream for later use, causing the + promised stream to enter the "reserved" state. A sender MUST NOT send a PUSH_PROMISE on a + stream unless that stream is either "open" or "half closed (remote)"; the sender MUST + ensure that the promised stream is a valid choice for a new stream identifier (that is, the promised stream MUST + be in the "idle" state). + + + Since PUSH_PROMISE reserves a stream, ignoring a PUSH_PROMISE frame causes the stream + state to become indeterminate. A receiver MUST treat the receipt of a PUSH_PROMISE on a + stream that is neither "open" nor "half closed (local)" as a connection error of type + PROTOCOL_ERROR. However, an endpoint that has sent + RST_STREAM on the associated stream MUST handle PUSH_PROMISE frames that + might have been created before the RST_STREAM frame is received and + processed. + + + A receiver MUST treat the receipt of a PUSH_PROMISE that promises an illegal stream identifier (that is, an identifier for a + stream that is not currently in the "idle" state) as a connection error of type + PROTOCOL_ERROR. + + + + The PUSH_PROMISE frame includes optional padding. Padding fields and flags are identical + to those defined for DATA frames. + +
+ +
+ + The PING frame (type=0x6) is a mechanism for measuring a minimal round trip time from the + sender, as well as determining whether an idle connection is still functional. PING + frames can be sent from any endpoint. + +
+ +
+ + + In addition to the frame header, PING frames MUST contain 8 octets of data in the payload. + A sender can include any value it chooses and use those bytes in any fashion. + + + Receivers of a PING frame that does not include an ACK flag MUST send a PING frame with + the ACK flag set in response, with an identical payload. PING responses SHOULD be given + higher priority than any other frame. + + + + The PING frame defines the following flags: + + + Bit 1 being set indicates that this PING frame is a PING response. An endpoint MUST + set this flag in PING responses. An endpoint MUST NOT respond to PING frames + containing this flag. + + + + + PING frames are not associated with any individual stream. If a PING frame is received + with a stream identifier field value other than 0x0, the recipient MUST respond with a + connection error of type + PROTOCOL_ERROR. + + + Receipt of a PING frame with a length field value other than 8 MUST be treated as a connection error of type + FRAME_SIZE_ERROR. + + +
+ +
+ + The GOAWAY frame (type=0x7) informs the remote peer to stop creating streams on this + connection. GOAWAY can be sent by either the client or the server. Once sent, the sender + will ignore frames sent on any new streams with identifiers higher than the included last + stream identifier. Receivers of a GOAWAY frame MUST NOT open additional streams on the + connection, although a new connection can be established for new streams. + + + The purpose of this frame is to allow an endpoint to gracefully stop accepting new + streams, while still finishing processing of previously established streams. This enables + administrative actions, like server maintainance. + + + There is an inherent race condition between an endpoint starting new streams and the + remote sending a GOAWAY frame. To deal with this case, the GOAWAY contains the stream + identifier of the last peer-initiated stream which was or might be processed on the + sending endpoint in this connection. For instance, if the server sends a GOAWAY frame, + the identified stream is the highest numbered stream initiated by the client. + + + If the receiver of the GOAWAY has sent data on streams with a higher stream identifier + than what is indicated in the GOAWAY frame, those streams are not or will not be + processed. The receiver of the GOAWAY frame can treat the streams as though they had + never been created at all, thereby allowing those streams to be retried later on a new + connection. + + + Endpoints SHOULD always send a GOAWAY frame before closing a connection so that the remote + can know whether a stream has been partially processed or not. For example, if an HTTP + client sends a POST at the same time that a server closes a connection, the client cannot + know if the server started to process that POST request if the server does not send a + GOAWAY frame to indicate what streams it might have acted on. + + + An endpoint might choose to close a connection without sending GOAWAY for misbehaving + peers. + + +
+ +
+ + The GOAWAY frame does not define any flags. + + + The GOAWAY frame applies to the connection, not a specific stream. An endpoint MUST treat + a GOAWAY frame with a stream identifier other than 0x0 as a connection error of type + PROTOCOL_ERROR. + + + The last stream identifier in the GOAWAY frame contains the highest numbered stream + identifier for which the sender of the GOAWAY frame might have taken some action on, or + might yet take action on. All streams up to and including the identified stream might + have been processed in some way. The last stream identifier can be set to 0 if no streams + were processed. + + + In this context, "processed" means that some data from the stream was passed to some + higher layer of software that might have taken some action as a result. + + + If a connection terminates without a GOAWAY frame, the last stream identifier is + effectively the highest possible stream identifier. + + + On streams with lower or equal numbered identifiers that were not closed completely prior + to the connection being closed, re-attempting requests, transactions, or any protocol + activity is not possible, with the exception of idempotent actions like HTTP GET, PUT, or + DELETE. Any protocol activity that uses higher numbered streams can be safely retried + using a new connection. + + + Activity on streams numbered lower or equal to the last stream identifier might still + complete successfully. The sender of a GOAWAY frame might gracefully shut down a + connection by sending a GOAWAY frame, maintaining the connection in an open state until + all in-progress streams complete. + + + An endpoint MAY send multiple GOAWAY frames if circumstances change. For instance, an + endpoint that sends GOAWAY with NO_ERROR during graceful shutdown could + subsequently encounter an condition that requires immediate termination of the connection. + The last stream identifier from the last GOAWAY frame received indicates which streams + could have been acted upon. Endpoints MUST NOT increase the value they send in the last + stream identifier, since the peers might already have retried unprocessed requests on + another connection. + + + A client that is unable to retry requests loses all requests that are in flight when the + server closes the connection. This is especially true for intermediaries that might + not be serving clients using HTTP/2. A server that is attempting to gracefully shut down + a connection SHOULD send an initial GOAWAY frame with the last stream identifier set to + 231-1 and a NO_ERROR code. This signals to the client that + a shutdown is imminent and that no further requests can be initiated. After waiting at + least one round trip time, the server can send another GOAWAY frame with an updated last + stream identifier. This ensures that a connection can be cleanly shut down without losing + requests. + + + + After sending a GOAWAY frame, the sender can discard frames for streams with identifiers + higher than the identified last stream. However, any frames that alter connection state + cannot be completely ignored. For instance, HEADERS, + PUSH_PROMISE and CONTINUATION frames MUST be minimally + processed to ensure the state maintained for header compression is consistent (see ); similarly DATA frames MUST be counted toward the connection flow + control window. Failure to process these frames can cause flow control or header + compression state to become unsynchronized. + + + + The GOAWAY frame also contains a 32-bit error code that + contains the reason for closing the connection. + + + Endpoints MAY append opaque data to the payload of any GOAWAY frame. Additional debug + data is intended for diagnostic purposes only and carries no semantic value. Debug + information could contain security- or privacy-sensitive data. Logged or otherwise + persistently stored debug data MUST have adequate safeguards to prevent unauthorized + access. + +
+ +
+ + The WINDOW_UPDATE frame (type=0x8) is used to implement flow control; see for an overview. + + + Flow control operates at two levels: on each individual stream and on the entire + connection. + + + Both types of flow control are hop-by-hop; that is, only between the two endpoints. + Intermediaries do not forward WINDOW_UPDATE frames between dependent connections. + However, throttling of data transfer by any receiver can indirectly cause the propagation + of flow control information toward the original sender. + + + Flow control only applies to frames that are identified as being subject to flow control. + Of the frame types defined in this document, this includes only DATA frames. + Frames that are exempt from flow control MUST be accepted and processed, unless the + receiver is unable to assign resources to handling the frame. A receiver MAY respond with + a stream error or connection error of type + FLOW_CONTROL_ERROR if it is unable to accept a frame. + +
+ +
+ + The payload of a WINDOW_UPDATE frame is one reserved bit, plus an unsigned 31-bit integer + indicating the number of octets that the sender can transmit in addition to the existing + flow control window. The legal range for the increment to the flow control window is 1 to + 231-1 (0x7fffffff) octets. + + + The WINDOW_UPDATE frame does not define any flags. + + + The WINDOW_UPDATE frame can be specific to a stream or to the entire connection. In the + former case, the frame's stream identifier indicates the affected stream; in the latter, + the value "0" indicates that the entire connection is the subject of the frame. + + + A receiver MUST treat the receipt of a WINDOW_UPDATE frame with an flow control window + increment of 0 as a stream error of type + PROTOCOL_ERROR; errors on the connection flow control window MUST be + treated as a connection error. + + + WINDOW_UPDATE can be sent by a peer that has sent a frame bearing the END_STREAM flag. + This means that a receiver could receive a WINDOW_UPDATE frame on a "half closed (remote)" + or "closed" stream. A receiver MUST NOT treat this as an error, see . + + + A receiver that receives a flow controlled frame MUST always account for its contribution + against the connection flow control window, unless the receiver treats this as a connection error. This is necessary even if the + frame is in error. Since the sender counts the frame toward the flow control window, if + the receiver does not, the flow control window at sender and receiver can become + different. + + +
+ + Flow control in HTTP/2 is implemented using a window kept by each sender on every + stream. The flow control window is a simple integer value that indicates how many octets + of data the sender is permitted to transmit; as such, its size is a measure of the + buffering capacity of the receiver. + + + Two flow control windows are applicable: the stream flow control window and the + connection flow control window. The sender MUST NOT send a flow controlled frame with a + length that exceeds the space available in either of the flow control windows advertised + by the receiver. Frames with zero length with the END_STREAM flag set (that is, an + empty DATA frame) MAY be sent if there is no available space in either + flow control window. + + + For flow control calculations, the 9 octet frame header is not counted. + + + After sending a flow controlled frame, the sender reduces the space available in both + windows by the length of the transmitted frame. + + + The receiver of a frame sends a WINDOW_UPDATE frame as it consumes data and frees up + space in flow control windows. Separate WINDOW_UPDATE frames are sent for the stream + and connection level flow control windows. + + + A sender that receives a WINDOW_UPDATE frame updates the corresponding window by the + amount specified in the frame. + + + A sender MUST NOT allow a flow control window to exceed 231-1 octets. + If a sender receives a WINDOW_UPDATE that causes a flow control window to exceed this + maximum it MUST terminate either the stream or the connection, as appropriate. For + streams, the sender sends a RST_STREAM with the error code of + FLOW_CONTROL_ERROR code; for the connection, a GOAWAY + frame with a FLOW_CONTROL_ERROR code. + + + Flow controlled frames from the sender and WINDOW_UPDATE frames from the receiver are + completely asynchronous with respect to each other. This property allows a receiver to + aggressively update the window size kept by the sender to prevent streams from stalling. + +
+ +
+ + When an HTTP/2 connection is first established, new streams are created with an initial + flow control window size of 65,535 octets. The connection flow control window is 65,535 + octets. Both endpoints can adjust the initial window size for new streams by including + a value for SETTINGS_INITIAL_WINDOW_SIZE in the SETTINGS + frame that forms part of the connection preface. The connection flow control window can + only be changed using WINDOW_UPDATE frames. + + + Prior to receiving a SETTINGS frame that sets a value for + SETTINGS_INITIAL_WINDOW_SIZE, an endpoint can only use the default + initial window size when sending flow controlled frames. Similarly, the connection flow + control window is set to the default initial window size until a WINDOW_UPDATE frame is + received. + + + A SETTINGS frame can alter the initial flow control window size for all + current streams. When the value of SETTINGS_INITIAL_WINDOW_SIZE changes, + a receiver MUST adjust the size of all stream flow control windows that it maintains by + the difference between the new value and the old value. + + + A change to SETTINGS_INITIAL_WINDOW_SIZE can cause the available space in + a flow control window to become negative. A sender MUST track the negative flow control + window, and MUST NOT send new flow controlled frames until it receives WINDOW_UPDATE + frames that cause the flow control window to become positive. + + + For example, if the client sends 60KB immediately on connection establishment, and the + server sets the initial window size to be 16KB, the client will recalculate the + available flow control window to be -44KB on receipt of the SETTINGS + frame. The client retains a negative flow control window until WINDOW_UPDATE frames + restore the window to being positive, after which the client can resume sending. + + + A SETTINGS frame cannot alter the connection flow control window. + + + An endpoint MUST treat a change to SETTINGS_INITIAL_WINDOW_SIZE that + causes any flow control window to exceed the maximum size as a connection error of type + FLOW_CONTROL_ERROR. + +
+ +
+ + A receiver that wishes to use a smaller flow control window than the current size can + send a new SETTINGS frame. However, the receiver MUST be prepared to + receive data that exceeds this window size, since the sender might send data that + exceeds the lower limit prior to processing the SETTINGS frame. + + + After sending a SETTINGS frame that reduces the initial flow control window size, a + receiver has two options for handling streams that exceed flow control limits: + + + The receiver can immediately send RST_STREAM with + FLOW_CONTROL_ERROR error code for the affected streams. + + + The receiver can accept the streams and tolerate the resulting head of line + blocking, sending WINDOW_UPDATE frames as it consumes data. + + + +
+
+ +
+ + The CONTINUATION frame (type=0x9) is used to continue a sequence of header block fragments. Any number of CONTINUATION frames can + be sent on an existing stream, as long as the preceding frame is on the same stream and is + a HEADERS, PUSH_PROMISE or CONTINUATION frame without the + END_HEADERS flag set. + + +
+ +
+ + The CONTINUATION frame payload contains a header block + fragment. + + + + The CONTINUATION frame defines the following flag: + + + + Bit 3 being set indicates that this frame ends a header + block. + + + If the END_HEADERS bit is not set, this frame MUST be followed by another + CONTINUATION frame. A receiver MUST treat the receipt of any other type of frame or + a frame on a different stream as a connection + error of type PROTOCOL_ERROR. + + + + + + + The CONTINUATION frame changes the connection state as defined in . + + + + CONTINUATION frames MUST be associated with a stream. If a CONTINUATION frame is received + whose stream identifier field is 0x0, the recipient MUST respond with a connection error of type PROTOCOL_ERROR. + + + + A CONTINUATION frame MUST be preceded by a HEADERS, + PUSH_PROMISE or CONTINUATION frame without the END_HEADERS flag set. A + recipient that observes violation of this rule MUST respond with a connection error of type + PROTOCOL_ERROR. + +
+
+ +
+ + Error codes are 32-bit fields that are used in RST_STREAM and + GOAWAY frames to convey the reasons for the stream or connection error. + + + + Error codes share a common code space. Some error codes apply only to either streams or the + entire connection and have no defined semantics in the other context. + + + + The following error codes are defined: + + + The associated condition is not as a result of an error. For example, a + GOAWAY might include this code to indicate graceful shutdown of a + connection. + + + The endpoint detected an unspecific protocol error. This error is for use when a more + specific error code is not available. + + + The endpoint encountered an unexpected internal error. + + + The endpoint detected that its peer violated the flow control protocol. + + + The endpoint sent a SETTINGS frame, but did not receive a response in a + timely manner. See Settings Synchronization. + + + The endpoint received a frame after a stream was half closed. + + + The endpoint received a frame with an invalid size. + + + The endpoint refuses the stream prior to performing any application processing, see + for details. + + + Used by the endpoint to indicate that the stream is no longer needed. + + + The endpoint is unable to maintain the header compression context for the connection. + + + The connection established in response to a CONNECT + request was reset or abnormally closed. + + + The endpoint detected that its peer is exhibiting a behavior that might be generating + excessive load. + + + The underlying transport has properties that do not meet minimum security + requirements (see ). + + + + + Unknown or unsupported error codes MUST NOT trigger any special behavior. These MAY be + treated by an implementation as being equivalent to INTERNAL_ERROR. + +
+ +
+ + HTTP/2 is intended to be as compatible as possible with current uses of HTTP. This means + that, from the application perspective, the features of the protocol are largely + unchanged. To achieve this, all request and response semantics are preserved, although the + syntax of conveying those semantics has changed. + + + Thus, the specification and requirements of HTTP/1.1 Semantics and Content , Conditional Requests , Range Requests , Caching and Authentication are applicable to HTTP/2. Selected portions of HTTP/1.1 Message Syntax + and Routing , such as the HTTP and HTTPS URI schemes, are also + applicable in HTTP/2, but the expression of those semantics for this protocol are defined + in the sections below. + + +
+ + A client sends an HTTP request on a new stream, using a previously unused stream identifier. A server sends an HTTP response on + the same stream as the request. + + + An HTTP message (request or response) consists of: + + + for a response only, zero or more HEADERS frames (each followed by zero + or more CONTINUATION frames) containing the message headers of + informational (1xx) HTTP responses (see and ), + and + + + one HEADERS frame (followed by zero or more CONTINUATION + frames) containing the message headers (see ), and + + + zero or more DATA frames containing the message payload (see ), and + + + optionally, one HEADERS frame, followed by zero or more + CONTINUATION frames containing the trailer-part, if present (see ). + + + The last frame in the sequence bears an END_STREAM flag, noting that a + HEADERS frame bearing the END_STREAM flag can be followed by + CONTINUATION frames that carry any remaining portions of the header block. + + + Other frames (from any stream) MUST NOT occur between either HEADERS frame + and any CONTINUATION frames that might follow. + + + + Trailing header fields are carried in a header block that also terminates the stream. + That is, a sequence starting with a HEADERS frame, followed by zero or more + CONTINUATION frames, where the HEADERS frame bears an + END_STREAM flag. Header blocks after the first that do not terminate the stream are not + part of an HTTP request or response. + + + A HEADERS frame (and associated CONTINUATION frames) can + only appear at the start or end of a stream. An endpoint that receives a + HEADERS frame without the END_STREAM flag set after receiving a final + (non-informational) status code MUST treat the corresponding request or response as malformed. + + + + An HTTP request/response exchange fully consumes a single stream. A request starts with + the HEADERS frame that puts the stream into an "open" state. The request + ends with a frame bearing END_STREAM, which causes the stream to become "half closed + (local)" for the client and "half closed (remote)" for the server. A response starts with + a HEADERS frame and ends with a frame bearing END_STREAM, which places the + stream in the "closed" state. + + + +
+ + HTTP/2 removes support for the 101 (Switching Protocols) informational status code + (). + + + The semantics of 101 (Switching Protocols) aren't applicable to a multiplexed protocol. + Alternative protocols are able to use the same mechanisms that HTTP/2 uses to negotiate + their use (see ). + +
+ +
+ + HTTP header fields carry information as a series of key-value pairs. For a listing of + registered HTTP headers, see the Message Header Field Registry maintained at . + + +
+ + While HTTP/1.x used the message start-line (see ) to convey the target URI and method of the request, and the + status code for the response, HTTP/2 uses special pseudo-header fields beginning with + ':' character (ASCII 0x3a) for this purpose. + + + Pseudo-header fields are not HTTP header fields. Endpoints MUST NOT generate + pseudo-header fields other than those defined in this document. + + + Pseudo-header fields are only valid in the context in which they are defined. + Pseudo-header fields defined for requests MUST NOT appear in responses; pseudo-header + fields defined for responses MUST NOT appear in requests. Pseudo-header fields MUST + NOT appear in trailers. Endpoints MUST treat a request or response that contains + undefined or invalid pseudo-header fields as malformed. + + + Just as in HTTP/1.x, header field names are strings of ASCII characters that are + compared in a case-insensitive fashion. However, header field names MUST be converted + to lowercase prior to their encoding in HTTP/2. A request or response containing + uppercase header field names MUST be treated as malformed. + + + All pseudo-header fields MUST appear in the header block before regular header fields. + Any request or response that contains a pseudo-header field that appears in a header + block after a regular header field MUST be treated as malformed. + +
+ +
+ + HTTP/2 does not use the Connection header field to + indicate connection-specific header fields; in this protocol, connection-specific + metadata is conveyed by other means. An endpoint MUST NOT generate a HTTP/2 message + containing connection-specific header fields; any message containing + connection-specific header fields MUST be treated as malformed. + + + This means that an intermediary transforming an HTTP/1.x message to HTTP/2 will need + to remove any header fields nominated by the Connection header field, along with the + Connection header field itself. Such intermediaries SHOULD also remove other + connection-specific header fields, such as Keep-Alive, Proxy-Connection, + Transfer-Encoding and Upgrade, even if they are not nominated by Connection. + + + One exception to this is the TE header field, which MAY be present in an HTTP/2 + request, but when it is MUST NOT contain any value other than "trailers". + + + + + HTTP/2 purposefully does not support upgrade to another protocol. The handshake + methods described in are believed sufficient to + negotiate the use of alternative protocols. + + + +
+ +
+ + The following pseudo-header fields are defined for HTTP/2 requests: + + + + The :method pseudo-header field includes the HTTP + method (). + + + + + The :scheme pseudo-header field includes the scheme + portion of the target URI (). + + + :scheme is not restricted to http and https schemed URIs. A + proxy or gateway can translate requests for non-HTTP schemes, enabling the use + of HTTP to interact with non-HTTP services. + + + + + The :authority pseudo-header field includes the + authority portion of the target URI (). The authority MUST NOT include the deprecated userinfo subcomponent for http + or https schemed URIs. + + + To ensure that the HTTP/1.1 request line can be reproduced accurately, this + pseudo-header field MUST be omitted when translating from an HTTP/1.1 request + that has a request target in origin or asterisk form (see ). Clients that generate + HTTP/2 requests directly SHOULD use the :authority pseudo-header + field instead of the Host header field. An + intermediary that converts an HTTP/2 request to HTTP/1.1 MUST create a Host header field if one is not present in a request by + copying the value of the :authority pseudo-header + field. + + + + + The :path pseudo-header field includes the path and + query parts of the target URI (the path-absolute + production from and optionally a '?' character + followed by the query production, see and ). A request in asterisk form includes the value '*' for the + :path pseudo-header field. + + + This pseudo-header field MUST NOT be empty for http + or https URIs; http or + https URIs that do not contain a path component + MUST include a value of '/'. The exception to this rule is an OPTIONS request + for an http or https + URI that does not include a path component; these MUST include a :path pseudo-header field with a value of '*' (see ). + + + + + + All HTTP/2 requests MUST include exactly one valid value for the :method, :scheme, and :path pseudo-header fields, unless it is a CONNECT request. An HTTP request that omits mandatory + pseudo-header fields is malformed. + + + HTTP/2 does not define a way to carry the version identifier that is included in the + HTTP/1.1 request line. + +
+ +
+ + For HTTP/2 responses, a single :status pseudo-header + field is defined that carries the HTTP status code field (see ). This pseudo-header field MUST be included in all + responses, otherwise the response is malformed. + + + HTTP/2 does not define a way to carry the version or reason phrase that is included in + an HTTP/1.1 status line. + +
+ +
+ + The Cookie header field can carry a significant amount of + redundant data. + + + The Cookie header field uses a semi-colon (";") to delimit cookie-pairs (or "crumbs"). + This header field doesn't follow the list construction rules in HTTP (see ), which prevents cookie-pairs from + being separated into different name-value pairs. This can significantly reduce + compression efficiency as individual cookie-pairs are updated. + + + To allow for better compression efficiency, the Cookie header field MAY be split into + separate header fields, each with one or more cookie-pairs. If there are multiple + Cookie header fields after decompression, these MUST be concatenated into a single + octet string using the two octet delimiter of 0x3B, 0x20 (the ASCII string "; ") + before being passed into a non-HTTP/2 context, such as an HTTP/1.1 connection, or a + generic HTTP server application. + +
+ + Therefore, the following two lists of Cookie header fields are semantically + equivalent. + + +
+
+ +
+ + A malformed request or response is one that is an otherwise valid sequence of HTTP/2 + frames, but is otherwise invalid due to the presence of extraneous frames, prohibited + header fields, the absence of mandatory header fields, or the inclusion of uppercase + header field names. + + + A request or response that includes an entity body can include a content-length header field. A request or response is also + malformed if the value of a content-length header field + does not equal the sum of the DATA frame payload lengths that form the + body. A response that is defined to have no payload, as described in , can have a non-zero + content-length header field, even though no content is + included in DATA frames. + + + Intermediaries that process HTTP requests or responses (i.e., any intermediary not + acting as a tunnel) MUST NOT forward a malformed request or response. Malformed + requests or responses that are detected MUST be treated as a stream error of type PROTOCOL_ERROR. + + + For malformed requests, a server MAY send an HTTP response prior to closing or + resetting the stream. Clients MUST NOT accept a malformed response. Note that these + requirements are intended to protect against several types of common attacks against + HTTP; they are deliberately strict, because being permissive can expose + implementations to these vulnerabilities. + +
+
+ +
+ + This section shows HTTP/1.1 requests and responses, with illustrations of equivalent + HTTP/2 requests and responses. + + + An HTTP GET request includes request header fields and no body and is therefore + transmitted as a single HEADERS frame, followed by zero or more + CONTINUATION frames containing the serialized block of request header + fields. The HEADERS frame in the following has both the END_HEADERS and + END_STREAM flags set; no CONTINUATION frames are sent: + + +
+ + END_STREAM + Accept: image/jpeg + END_HEADERS + :method = GET + :scheme = https + :path = /resource + host = example.org + accept = image/jpeg +]]> +
+ + + Similarly, a response that includes only response header fields is transmitted as a + HEADERS frame (again, followed by zero or more + CONTINUATION frames) containing the serialized block of response header + fields. + + +
+ + END_STREAM + Expires: Thu, 23 Jan ... + END_HEADERS + :status = 304 + etag = "xyzzy" + expires = Thu, 23 Jan ... +]]> +
+ + + An HTTP POST request that includes request header fields and payload data is transmitted + as one HEADERS frame, followed by zero or more + CONTINUATION frames containing the request header fields, followed by one + or more DATA frames, with the last CONTINUATION (or + HEADERS) frame having the END_HEADERS flag set and the final + DATA frame having the END_STREAM flag set: + + +
+ - END_STREAM + Content-Type: image/jpeg - END_HEADERS + Content-Length: 123 :method = POST + :path = /resource + {binary data} :scheme = https + + CONTINUATION + + END_HEADERS + content-type = image/jpeg + host = example.org + content-length = 123 + + DATA + + END_STREAM + {binary data} +]]> + + Note that data contributing to any given header field could be spread between header + block fragments. The allocation of header fields to frames in this example is + illustrative only. + +
+ + + A response that includes header fields and payload data is transmitted as a + HEADERS frame, followed by zero or more CONTINUATION + frames, followed by one or more DATA frames, with the last + DATA frame in the sequence having the END_STREAM flag set: + + +
+ - END_STREAM + Content-Length: 123 + END_HEADERS + :status = 200 + {binary data} content-type = image/jpeg + content-length = 123 + + DATA + + END_STREAM + {binary data} +]]> +
+ + + Trailing header fields are sent as a header block after both the request or response + header block and all the DATA frames have been sent. The + HEADERS frame starting the trailers header block has the END_STREAM flag + set. + + +
+ - END_STREAM + Transfer-Encoding: chunked + END_HEADERS + Trailer: Foo :status = 200 + content-length = 123 + 123 content-type = image/jpeg + {binary data} trailer = Foo + 0 + Foo: bar DATA + - END_STREAM + {binary data} + + HEADERS + + END_STREAM + + END_HEADERS + foo = bar +]]> +
+ + +
+ + An informational response using a 1xx status code other than 101 is transmitted as a + HEADERS frame, followed by zero or more CONTINUATION + frames: + + - END_STREAM + + END_HEADERS + :status = 103 + extension-field = bar +]]> +
+
+ +
+ + In HTTP/1.1, an HTTP client is unable to retry a non-idempotent request when an error + occurs, because there is no means to determine the nature of the error. It is possible + that some server processing occurred prior to the error, which could result in + undesirable effects if the request were reattempted. + + + HTTP/2 provides two mechanisms for providing a guarantee to a client that a request has + not been processed: + + + The GOAWAY frame indicates the highest stream number that might have + been processed. Requests on streams with higher numbers are therefore guaranteed to + be safe to retry. + + + The REFUSED_STREAM error code can be included in a + RST_STREAM frame to indicate that the stream is being closed prior to + any processing having occurred. Any request that was sent on the reset stream can + be safely retried. + + + + + Requests that have not been processed have not failed; clients MAY automatically retry + them, even those with non-idempotent methods. + + + A server MUST NOT indicate that a stream has not been processed unless it can guarantee + that fact. If frames that are on a stream are passed to the application layer for any + stream, then REFUSED_STREAM MUST NOT be used for that stream, and a + GOAWAY frame MUST include a stream identifier that is greater than or + equal to the given stream identifier. + + + In addition to these mechanisms, the PING frame provides a way for a + client to easily test a connection. Connections that remain idle can become broken as + some middleboxes (for instance, network address translators, or load balancers) silently + discard connection bindings. The PING frame allows a client to safely + test whether a connection is still active without sending a request. + +
+
+ +
+ + HTTP/2 allows a server to pre-emptively send (or "push") responses (along with + corresponding "promised" requests) to a client in association with a previous + client-initiated request. This can be useful when the server knows the client will need + to have those responses available in order to fully process the response to the original + request. + + + + Pushing additional message exchanges in this fashion is optional, and is negotiated + between individual endpoints. The SETTINGS_ENABLE_PUSH setting can be set + to 0 to indicate that server push is disabled. + + + Promised requests MUST be cacheable (see ), MUST be safe (see ) and MUST NOT include a request body. Clients that receive a + promised request that is not cacheable, unsafe or that includes a request body MUST + reset the stream with a stream error of type + PROTOCOL_ERROR. + + + Pushed responses that are cacheable (see ) can be stored by the client, if it implements a HTTP + cache. Pushed responses are considered successfully validated on the origin server (e.g., + if the "no-cache" cache response directive is present) while the stream identified by the + promised stream ID is still open. + + + Pushed responses that are not cacheable MUST NOT be stored by any HTTP cache. They MAY + be made available to the application separately. + + + An intermediary can receive pushes from the server and choose not to forward them on to + the client. In other words, how to make use of the pushed information is up to that + intermediary. Equally, the intermediary might choose to make additional pushes to the + client, without any action taken by the server. + + + A client cannot push. Thus, servers MUST treat the receipt of a + PUSH_PROMISE frame as a connection + error of type PROTOCOL_ERROR. Clients MUST reject any attempt to + change the SETTINGS_ENABLE_PUSH setting to a value other than 0 by treating + the message as a connection error of type + PROTOCOL_ERROR. + + +
+ + Server push is semantically equivalent to a server responding to a request; however, in + this case that request is also sent by the server, as a PUSH_PROMISE + frame. + + + The PUSH_PROMISE frame includes a header block that contains a complete + set of request header fields that the server attributes to the request. It is not + possible to push a response to a request that includes a request body. + + + + Pushed responses are always associated with an explicit request from the client. The + PUSH_PROMISE frames sent by the server are sent on that explicit + request's stream. The PUSH_PROMISE frame also includes a promised stream + identifier, chosen from the stream identifiers available to the server (see ). + + + + The header fields in PUSH_PROMISE and any subsequent + CONTINUATION frames MUST be a valid and complete set of request header fields. The server MUST include a method in + the :method header field that is safe and cacheable. If a + client receives a PUSH_PROMISE that does not include a complete and valid + set of header fields, or the :method header field identifies + a method that is not safe, it MUST respond with a stream error of type PROTOCOL_ERROR. + + + + The server SHOULD send PUSH_PROMISE () + frames prior to sending any frames that reference the promised responses. This avoids a + race where clients issue requests prior to receiving any PUSH_PROMISE + frames. + + + For example, if the server receives a request for a document containing embedded links + to multiple image files, and the server chooses to push those additional images to the + client, sending push promises before the DATA frames that contain the + image links ensures that the client is able to see the promises before discovering + embedded links. Similarly, if the server pushes responses referenced by the header block + (for instance, in Link header fields), sending the push promises before sending the + header block ensures that clients do not request them. + + + + PUSH_PROMISE frames MUST NOT be sent by the client. + + + PUSH_PROMISE frames can be sent by the server in response to any + client-initiated stream, but the stream MUST be in either the "open" or "half closed + (remote)" state with respect to the server. PUSH_PROMISE frames are + interspersed with the frames that comprise a response, though they cannot be + interspersed with HEADERS and CONTINUATION frames that + comprise a single header block. + + + Sending a PUSH_PROMISE frame creates a new stream and puts the stream + into the “reserved (local)” state for the server and the “reserved (remote)” state for + the client. + +
+ +
+ + After sending the PUSH_PROMISE frame, the server can begin delivering the + pushed response as a response on a server-initiated + stream that uses the promised stream identifier. The server uses this stream to + transmit an HTTP response, using the same sequence of frames as defined in . This stream becomes "half closed" + to the client after the initial HEADERS frame is sent. + + + + Once a client receives a PUSH_PROMISE frame and chooses to accept the + pushed response, the client SHOULD NOT issue any requests for the promised response + until after the promised stream has closed. + + + + If the client determines, for any reason, that it does not wish to receive the pushed + response from the server, or if the server takes too long to begin sending the promised + response, the client can send an RST_STREAM frame, using either the + CANCEL or REFUSED_STREAM codes, and referencing the pushed + stream's identifier. + + + A client can use the SETTINGS_MAX_CONCURRENT_STREAMS setting to limit the + number of responses that can be concurrently pushed by a server. Advertising a + SETTINGS_MAX_CONCURRENT_STREAMS value of zero disables server push by + preventing the server from creating the necessary streams. This does not prohibit a + server from sending PUSH_PROMISE frames; clients need to reset any + promised streams that are not wanted. + + + + Clients receiving a pushed response MUST validate that either the server is + authoritative (see ), or the proxy that provided the pushed + response is configured for the corresponding request. For example, a server that offers + a certificate for only the example.com DNS-ID or Common Name + is not permitted to push a response for https://www.example.org/doc. + + + The response for a PUSH_PROMISE stream begins with a + HEADERS frame, which immediately puts the stream into the “half closed + (remote)” state for the server and “half closed (local)” state for the client, and ends + with a frame bearing END_STREAM, which places the stream in the "closed" state. + + + The client never sends a frame with the END_STREAM flag for a server push. + + + +
+ +
+ +
+ + In HTTP/1.x, the pseudo-method CONNECT () is used to convert an HTTP connection into a tunnel to a remote host. + CONNECT is primarily used with HTTP proxies to establish a TLS session with an origin + server for the purposes of interacting with https resources. + + + In HTTP/2, the CONNECT method is used to establish a tunnel over a single HTTP/2 stream to + a remote host, for similar purposes. The HTTP header field mapping works as defined in + Request Header Fields, with a few + differences. Specifically: + + + The :method header field is set to CONNECT. + + + The :scheme and :path header + fields MUST be omitted. + + + The :authority header field contains the host and port to + connect to (equivalent to the authority-form of the request-target of CONNECT + requests, see ). + + + + + A proxy that supports CONNECT establishes a TCP connection to + the server identified in the :authority header field. Once + this connection is successfully established, the proxy sends a HEADERS + frame containing a 2xx series status code to the client, as defined in . + + + After the initial HEADERS frame sent by each peer, all subsequent + DATA frames correspond to data sent on the TCP connection. The payload of + any DATA frames sent by the client is transmitted by the proxy to the TCP + server; data received from the TCP server is assembled into DATA frames by + the proxy. Frame types other than DATA or stream management frames + (RST_STREAM, WINDOW_UPDATE, and PRIORITY) + MUST NOT be sent on a connected stream, and MUST be treated as a stream error if received. + + + The TCP connection can be closed by either peer. The END_STREAM flag on a + DATA frame is treated as being equivalent to the TCP FIN bit. A client is + expected to send a DATA frame with the END_STREAM flag set after receiving + a frame bearing the END_STREAM flag. A proxy that receives a DATA frame + with the END_STREAM flag set sends the attached data with the FIN bit set on the last TCP + segment. A proxy that receives a TCP segment with the FIN bit set sends a + DATA frame with the END_STREAM flag set. Note that the final TCP segment + or DATA frame could be empty. + + + A TCP connection error is signaled with RST_STREAM. A proxy treats any + error in the TCP connection, which includes receiving a TCP segment with the RST bit set, + as a stream error of type + CONNECT_ERROR. Correspondingly, a proxy MUST send a TCP segment with the + RST bit set if it detects an error with the stream or the HTTP/2 connection. + +
+
+ +
+ + This section outlines attributes of the HTTP protocol that improve interoperability, reduce + exposure to known security vulnerabilities, or reduce the potential for implementation + variation. + + +
+ + HTTP/2 connections are persistent. For best performance, it is expected clients will not + close connections until it is determined that no further communication with a server is + necessary (for example, when a user navigates away from a particular web page), or until + the server closes the connection. + + + Clients SHOULD NOT open more than one HTTP/2 connection to a given host and port pair, + where host is derived from a URI, a selected alternative + service, or a configured proxy. + + + A client can create additional connections as replacements, either to replace connections + that are near to exhausting the available stream + identifier space, to refresh the keying material for a TLS connection, or to + replace connections that have encountered errors. + + + A client MAY open multiple connections to the same IP address and TCP port using different + Server Name Indication values or to provide different TLS + client certificates, but SHOULD avoid creating multiple connections with the same + configuration. + + + Servers are encouraged to maintain open connections for as long as possible, but are + permitted to terminate idle connections if necessary. When either endpoint chooses to + close the transport-layer TCP connection, the terminating endpoint SHOULD first send a + GOAWAY () frame so that both endpoints can reliably + determine whether previously sent frames have been processed and gracefully complete or + terminate any necessary remaining tasks. + + +
+ + Connections that are made to an origin servers, either directly or through a tunnel + created using the CONNECT method MAY be reused for + requests with multiple different URI authority components. A connection can be reused + as long as the origin server is authoritative. For + http resources, this depends on the host having resolved to + the same IP address. + + + For https resources, connection reuse additionally depends + on having a certificate that is valid for the host in the URI. An origin server might + offer a certificate with multiple subjectAltName attributes, + or names with wildcards, one of which is valid for the authority in the URI. For + example, a certificate with a subjectAltName of *.example.com might permit the use of the same connection for + requests to URIs starting with https://a.example.com/ and + https://b.example.com/. + + + In some deployments, reusing a connection for multiple origins can result in requests + being directed to the wrong origin server. For example, TLS termination might be + performed by a middlebox that uses the TLS Server Name Indication + (SNI) extension to select an origin server. This means that it is possible + for clients to send confidential information to servers that might not be the intended + target for the request, even though the server is otherwise authoritative. + + + A server that does not wish clients to reuse connections can indicate that it is not + authoritative for a request by sending a 421 (Misdirected Request) status code in response + to the request (see ). + + + A client that is configured to use a proxy over HTTP/2 directs requests to that proxy + through a single connection. That is, all requests sent via a proxy reuse the + connection to the proxy. + +
+ +
+ + The 421 (Misdirected Request) status code indicates that the request was directed at a + server that is not able to produce a response. This can be sent by a server that is not + configured to produce responses for the combination of scheme and authority that are + included in the request URI. + + + Clients receiving a 421 (Misdirected Request) response from a server MAY retry the + request - whether the request method is idempotent or not - over a different connection. + This is possible if a connection is reused () or if an alternative + service is selected (). + + + This status code MUST NOT be generated by proxies. + + + A 421 response is cacheable by default; i.e., unless otherwise indicated by the method + definition or explicit cache controls (see ). + +
+
+ +
+ + Implementations of HTTP/2 MUST support TLS 1.2 for HTTP/2 over + TLS. The general TLS usage guidance in SHOULD be followed, with + some additional restrictions that are specific to HTTP/2. + + + + An implementation of HTTP/2 over TLS MUST use TLS 1.2 or higher with the restrictions on + feature set and cipher suite described in this section. Due to implementation + limitations, it might not be possible to fail TLS negotiation. An endpoint MUST + immediately terminate an HTTP/2 connection that does not meet these minimum requirements + with a connection error of type + INADEQUATE_SECURITY. + + +
+ + The TLS implementation MUST support the Server Name Indication + (SNI) extension to TLS. HTTP/2 clients MUST indicate the target domain name when + negotiating TLS. + + + The TLS implementation MUST disable compression. TLS compression can lead to the + exposure of information that would not otherwise be revealed . + Generic compression is unnecessary since HTTP/2 provides compression features that are + more aware of context and therefore likely to be more appropriate for use for + performance, security or other reasons. + + + The TLS implementation MUST disable renegotiation. An endpoint MUST treat a TLS + renegotiation as a connection error of type + PROTOCOL_ERROR. Note that disabling renegotiation can result in + long-lived connections becoming unusable due to limits on the number of messages the + underlying cipher suite can encipher. + + + A client MAY use renegotiation to provide confidentiality protection for client + credentials offered in the handshake, but any renegotiation MUST occur prior to sending + the connection preface. A server SHOULD request a client certificate if it sees a + renegotiation request immediately after establishing a connection. + + + This effectively prevents the use of renegotiation in response to a request for a + specific protected resource. A future specification might provide a way to support this + use case. + +
+ +
+ + The set of TLS cipher suites that are permitted in HTTP/2 is restricted. HTTP/2 MUST + only be used with cipher suites that have ephemeral key exchange, such as the ephemeral Diffie-Hellman (DHE) or the elliptic curve variant (ECDHE). Ephemeral key exchange MUST + have a minimum size of 2048 bits for DHE or security level of 128 bits for ECDHE. + Clients MUST accept DHE sizes of up to 4096 bits. HTTP MUST NOT be used with cipher + suites that use stream or block ciphers. Authenticated Encryption with Additional Data + (AEAD) modes, such as the Galois Counter Model (GCM) mode for + AES are acceptable. + + + The effect of these restrictions is that TLS 1.2 implementations could have + non-intersecting sets of available cipher suites, since these prevent the use of the + cipher suite that TLS 1.2 makes mandatory. To avoid this problem, implementations of + HTTP/2 that use TLS 1.2 MUST support TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 with P256 . + + + Clients MAY advertise support of cipher suites that are prohibited by the above + restrictions in order to allow for connection to servers that do not support HTTP/2. + This enables a fallback to protocols without these constraints without the additional + latency imposed by using a separate connection for fallback. + +
+
+
+ +
+
+ + HTTP/2 relies on the HTTP/1.1 definition of authority for determining whether a server is + authoritative in providing a given response, see . This relies on local name resolution for the "http" + URI scheme, and the authenticated server identity for the "https" scheme (see ). + +
+ +
+ + In a cross-protocol attack, an attacker causes a client to initiate a transaction in one + protocol toward a server that understands a different protocol. An attacker might be able + to cause the transaction to appear as valid transaction in the second protocol. In + combination with the capabilities of the web context, this can be used to interact with + poorly protected servers in private networks. + + + Completing a TLS handshake with an ALPN identifier for HTTP/2 can be considered sufficient + protection against cross protocol attacks. ALPN provides a positive indication that a + server is willing to proceed with HTTP/2, which prevents attacks on other TLS-based + protocols. + + + The encryption in TLS makes it difficult for attackers to control the data which could be + used in a cross-protocol attack on a cleartext protocol. + + + The cleartext version of HTTP/2 has minimal protection against cross-protocol attacks. + The connection preface contains a string that is + designed to confuse HTTP/1.1 servers, but no special protection is offered for other + protocols. A server that is willing to ignore parts of an HTTP/1.1 request containing an + Upgrade header field in addition to the client connection preface could be exposed to a + cross-protocol attack. + +
+ +
+ + HTTP/2 header field names and values are encoded as sequences of octets with a length + prefix. This enables HTTP/2 to carry any string of octets as the name or value of a + header field. An intermediary that translates HTTP/2 requests or responses into HTTP/1.1 + directly could permit the creation of corrupted HTTP/1.1 messages. An attacker might + exploit this behavior to cause the intermediary to create HTTP/1.1 messages with illegal + header fields, extra header fields, or even new messages that are entirely falsified. + + + Header field names or values that contain characters not permitted by HTTP/1.1, including + carriage return (ASCII 0xd) or line feed (ASCII 0xa) MUST NOT be translated verbatim by an + intermediary, as stipulated in . + + + Translation from HTTP/1.x to HTTP/2 does not produce the same opportunity to an attacker. + Intermediaries that perform translation to HTTP/2 MUST remove any instances of the obs-fold production from header field values. + +
+ +
+ + Pushed responses do not have an explicit request from the client; the request + is provided by the server in the PUSH_PROMISE frame. + + + Caching responses that are pushed is possible based on the guidance provided by the origin + server in the Cache-Control header field. However, this can cause issues if a single + server hosts more than one tenant. For example, a server might offer multiple users each + a small portion of its URI space. + + + Where multiple tenants share space on the same server, that server MUST ensure that + tenants are not able to push representations of resources that they do not have authority + over. Failure to enforce this would allow a tenant to provide a representation that would + be served out of cache, overriding the actual representation that the authoritative tenant + provides. + + + Pushed responses for which an origin server is not authoritative (see + ) are never cached or used. + +
+ +
+ + An HTTP/2 connection can demand a greater commitment of resources to operate than a + HTTP/1.1 connection. The use of header compression and flow control depend on a + commitment of resources for storing a greater amount of state. Settings for these + features ensure that memory commitments for these features are strictly bounded. + + + The number of PUSH_PROMISE frames is not constrained in the same fashion. + A client that accepts server push SHOULD limit the number of streams it allows to be in + the "reserved (remote)" state. Excessive number of server push streams can be treated as + a stream error of type + ENHANCE_YOUR_CALM. + + + Processing capacity cannot be guarded as effectively as state capacity. + + + The SETTINGS frame can be abused to cause a peer to expend additional + processing time. This might be done by pointlessly changing SETTINGS parameters, setting + multiple undefined parameters, or changing the same setting multiple times in the same + frame. WINDOW_UPDATE or PRIORITY frames can be abused to + cause an unnecessary waste of resources. + + + Large numbers of small or empty frames can be abused to cause a peer to expend time + processing frame headers. Note however that some uses are entirely legitimate, such as + the sending of an empty DATA frame to end a stream. + + + Header compression also offers some opportunities to waste processing resources; see for more details on potential abuses. + + + Limits in SETTINGS parameters cannot be reduced instantaneously, which + leaves an endpoint exposed to behavior from a peer that could exceed the new limits. In + particular, immediately after establishing a connection, limits set by a server are not + known to clients and could be exceeded without being an obvious protocol violation. + + + All these features - i.e., SETTINGS changes, small frames, header + compression - have legitimate uses. These features become a burden only when they are + used unnecessarily or to excess. + + + An endpoint that doesn't monitor this behavior exposes itself to a risk of denial of + service attack. Implementations SHOULD track the use of these features and set limits on + their use. An endpoint MAY treat activity that is suspicious as a connection error of type + ENHANCE_YOUR_CALM. + + +
+ + A large header block can cause an implementation to + commit a large amount of state. Header fields that are critical for routing can appear + toward the end of a header block, which prevents streaming of header fields to their + ultimate destination. For this an other reasons, such as ensuring cache correctness, + means that an endpoint might need to buffer the entire header block. Since there is no + hard limit to the size of a header block, some endpoints could be forced commit a large + amount of available memory for header fields. + + + An endpoint can use the SETTINGS_MAX_HEADER_LIST_SIZE to advise peers of + limits that might apply on the size of header blocks. This setting is only advisory, so + endpoints MAY choose to send header blocks that exceed this limit and risk having the + request or response being treated as malformed. This setting specific to a connection, + so any request or response could encounter a hop with a lower, unknown limit. An + intermediary can attempt to avoid this problem by passing on values presented by + different peers, but they are not obligated to do so. + + + A server that receives a larger header block than it is willing to handle can send an + HTTP 431 (Request Header Fields Too Large) status code . A + client can discard responses that it cannot process. The header block MUST be processed + to ensure a consistent connection state, unless the connection is closed. + +
+
+ +
+ + HTTP/2 enables greater use of compression for both header fields () and entity bodies. Compression can allow an attacker to recover + secret data when it is compressed in the same context as data under attacker control. + + + There are demonstrable attacks on compression that exploit the characteristics of the web + (e.g., ). The attacker induces multiple requests containing + varying plaintext, observing the length of the resulting ciphertext in each, which + reveals a shorter length when a guess about the secret is correct. + + + Implementations communicating on a secure channel MUST NOT compress content that includes + both confidential and attacker-controlled data unless separate compression dictionaries + are used for each source of data. Compression MUST NOT be used if the source of data + cannot be reliably determined. Generic stream compression, such as that provided by TLS + MUST NOT be used with HTTP/2 (). + + + Further considerations regarding the compression of header fields are described in . + +
+ +
+ + Padding within HTTP/2 is not intended as a replacement for general purpose padding, such + as might be provided by TLS. Redundant padding could even be + counterproductive. Correct application can depend on having specific knowledge of the + data that is being padded. + + + To mitigate attacks that rely on compression, disabling or limiting compression might be + preferable to padding as a countermeasure. + + + Padding can be used to obscure the exact size of frame content, and is provided to + mitigate specific attacks within HTTP. For example, attacks where compressed content + includes both attacker-controlled plaintext and secret data (see for example, ). + + + Use of padding can result in less protection than might seem immediately obvious. At + best, padding only makes it more difficult for an attacker to infer length information by + increasing the number of frames an attacker has to observe. Incorrectly implemented + padding schemes can be easily defeated. In particular, randomized padding with a + predictable distribution provides very little protection; similarly, padding payloads to a + fixed size exposes information as payload sizes cross the fixed size boundary, which could + be possible if an attacker can control plaintext. + + + Intermediaries SHOULD retain padding for DATA frames, but MAY drop padding + for HEADERS and PUSH_PROMISE frames. A valid reason for an + intermediary to change the amount of padding of frames is to improve the protections that + padding provides. + +
+ +
+ + Several characteristics of HTTP/2 provide an observer an opportunity to correlate actions + of a single client or server over time. This includes the value of settings, the manner + in which flow control windows are managed, the way priorities are allocated to streams, + timing of reactions to stimulus, and handling of any optional features. + + + As far as this creates observable differences in behavior, they could be used as a basis + for fingerprinting a specific client, as defined in . + +
+
+ +
+ + A string for identifying HTTP/2 is entered into the "Application Layer Protocol Negotiation + (ALPN) Protocol IDs" registry established in . + + + This document establishes a registry for frame types, settings, and error codes. These new + registries are entered into a new "Hypertext Transfer Protocol (HTTP) 2 Parameters" section. + + + This document registers the HTTP2-Settings header field for + use in HTTP; and the 421 (Misdirected Request) status code. + + + This document registers the PRI method for use in HTTP, to avoid + collisions with the connection preface. + + +
+ + This document creates two registrations for the identification of HTTP/2 in the + "Application Layer Protocol Negotiation (ALPN) Protocol IDs" registry established in . + + + The "h2" string identifies HTTP/2 when used over TLS: + + HTTP/2 over TLS + 0x68 0x32 ("h2") + This document + + + + The "h2c" string identifies HTTP/2 when used over cleartext TCP: + + HTTP/2 over TCP + 0x68 0x32 0x63 ("h2c") + This document + + +
+ +
+ + This document establishes a registry for HTTP/2 frame type codes. The "HTTP/2 Frame + Type" registry manages an 8-bit space. The "HTTP/2 Frame Type" registry operates under + either of the "IETF Review" or "IESG Approval" policies for + values between 0x00 and 0xef, with values between 0xf0 and 0xff being reserved for + experimental use. + + + New entries in this registry require the following information: + + + A name or label for the frame type. + + + The 8-bit code assigned to the frame type. + + + A reference to a specification that includes a description of the frame layout, + it's semantics and flags that the frame type uses, including any parts of the frame + that are conditionally present based on the value of flags. + + + + + The entries in the following table are registered by this document. + + + Frame Type + Code + Section + DATA0x0 + HEADERS0x1 + PRIORITY0x2 + RST_STREAM0x3 + SETTINGS0x4 + PUSH_PROMISE0x5 + PING0x6 + GOAWAY0x7 + WINDOW_UPDATE0x8 + CONTINUATION0x9 + +
+ +
+ + This document establishes a registry for HTTP/2 settings. The "HTTP/2 Settings" registry + manages a 16-bit space. The "HTTP/2 Settings" registry operates under the "Expert Review" policy for values in the range from 0x0000 to + 0xefff, with values between and 0xf000 and 0xffff being reserved for experimental use. + + + New registrations are advised to provide the following information: + + + A symbolic name for the setting. Specifying a setting name is optional. + + + The 16-bit code assigned to the setting. + + + An initial value for the setting. + + + An optional reference to a specification that describes the use of the setting. + + + + + An initial set of setting registrations can be found in . + + + Name + Code + Initial Value + Specification + HEADER_TABLE_SIZE + 0x14096 + ENABLE_PUSH + 0x21 + MAX_CONCURRENT_STREAMS + 0x3(infinite) + INITIAL_WINDOW_SIZE + 0x465535 + MAX_FRAME_SIZE + 0x516384 + MAX_HEADER_LIST_SIZE + 0x6(infinite) + + +
+ +
+ + This document establishes a registry for HTTP/2 error codes. The "HTTP/2 Error Code" + registry manages a 32-bit space. The "HTTP/2 Error Code" registry operates under the + "Expert Review" policy. + + + Registrations for error codes are required to include a description of the error code. An + expert reviewer is advised to examine new registrations for possible duplication with + existing error codes. Use of existing registrations is to be encouraged, but not + mandated. + + + New registrations are advised to provide the following information: + + + A name for the error code. Specifying an error code name is optional. + + + The 32-bit error code value. + + + A brief description of the error code semantics, longer if no detailed specification + is provided. + + + An optional reference for a specification that defines the error code. + + + + + The entries in the following table are registered by this document. + + + Name + Code + Description + Specification + NO_ERROR0x0 + Graceful shutdown + + PROTOCOL_ERROR0x1 + Protocol error detected + + INTERNAL_ERROR0x2 + Implementation fault + + FLOW_CONTROL_ERROR0x3 + Flow control limits exceeded + + SETTINGS_TIMEOUT0x4 + Settings not acknowledged + + STREAM_CLOSED0x5 + Frame received for closed stream + + FRAME_SIZE_ERROR0x6 + Frame size incorrect + + REFUSED_STREAM0x7 + Stream not processed + + CANCEL0x8 + Stream cancelled + + COMPRESSION_ERROR0x9 + Compression state not updated + + CONNECT_ERROR0xa + TCP connection error for CONNECT method + + ENHANCE_YOUR_CALM0xb + Processing capacity exceeded + + INADEQUATE_SECURITY0xc + Negotiated TLS parameters not acceptable + + + +
+ +
+ + This section registers the HTTP2-Settings header field in the + Permanent Message Header Field Registry. + + + HTTP2-Settings + + + http + + + standard + + + IETF + + + of this document + + + This header field is only used by an HTTP/2 client for Upgrade-based negotiation. + + + +
+ +
+ + This section registers the PRI method in the HTTP Method + Registry (). + + + PRI + + + No + + + No + + + of this document + + + This method is never used by an actual client. This method will appear to be used + when an HTTP/1.1 server or intermediary attempts to parse an HTTP/2 connection + preface. + + + +
+ +
+ + This document registers the 421 (Misdirected Request) HTTP Status code in the Hypertext + Transfer Protocol (HTTP) Status Code Registry (). + + + + + 421 + + + Misdirected Request + + + of this document + + + +
+ +
+ +
+ + This document includes substantial input from the following individuals: + + + Adam Langley, Wan-Teh Chang, Jim Morrison, Mark Nottingham, Alyssa Wilk, Costin + Manolache, William Chan, Vitaliy Lvin, Joe Chan, Adam Barth, Ryan Hamilton, Gavin + Peters, Kent Alstad, Kevin Lindsay, Paul Amer, Fan Yang, Jonathan Leighton (SPDY + contributors). + + + Gabriel Montenegro and Willy Tarreau (Upgrade mechanism). + + + William Chan, Salvatore Loreto, Osama Mazahir, Gabriel Montenegro, Jitu Padhye, Roberto + Peon, Rob Trace (Flow control). + + + Mike Bishop (Extensibility). + + + Mark Nottingham, Julian Reschke, James Snell, Jeff Pinner, Mike Bishop, Herve Ruellan + (Substantial editorial contributions). + + + Kari Hurtta, Tatsuhiro Tsujikawa, Greg Wilkins, Poul-Henning Kamp. + + + Alexey Melnikov was an editor of this document during 2013. + + + A substantial proportion of Martin's contribution was supported by Microsoft during his + employment there. + + + +
+
+ + + + + + HPACK - Header Compression for HTTP/2 + + + + + + + + + + + + Transmission Control Protocol + + + University of Southern California (USC)/Information Sciences + Institute + + + + + + + + + + + Key words for use in RFCs to Indicate Requirement Levels + + + Harvard University +
sob@harvard.edu
+
+ +
+ + +
+ + + + + HTTP Over TLS + + + + + + + + + + Uniform Resource Identifier (URI): Generic + Syntax + + + + + + + + + + + + The Base16, Base32, and Base64 Data Encodings + + + + + + + + + Guidelines for Writing an IANA Considerations Section in RFCs + + + + + + + + + + + Augmented BNF for Syntax Specifications: ABNF + + + + + + + + + + + The Transport Layer Security (TLS) Protocol Version 1.2 + + + + + + + + + + + Transport Layer Security (TLS) Extensions: Extension Definitions + + + + + + + + + + Transport Layer Security (TLS) Application-Layer Protocol Negotiation Extension + + + + + + + + + + + + + TLS Elliptic Curve Cipher Suites with SHA-256/384 and AES Galois + Counter Mode (GCM) + + + + + + + + + + + Digital Signature Standard (DSS) + + NIST + + + + + + + + + Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing + + Adobe Systems Incorporated +
fielding@gbiv.com
+
+ + greenbytes GmbH +
julian.reschke@greenbytes.de
+
+ +
+ + +
+ + + + Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content + + Adobe Systems Incorporated +
fielding@gbiv.com
+
+ + greenbytes GmbH +
julian.reschke@greenbytes.de
+
+ +
+ + +
+ + + Hypertext Transfer Protocol (HTTP/1.1): Conditional Requests + + Adobe Systems Incorporated +
fielding@gbiv.com
+
+ + greenbytes GmbH +
julian.reschke@greenbytes.de
+
+ +
+ +
+ + + Hypertext Transfer Protocol (HTTP/1.1): Range Requests + + Adobe Systems Incorporated +
fielding@gbiv.com
+
+ + World Wide Web Consortium +
ylafon@w3.org
+
+ + greenbytes GmbH +
julian.reschke@greenbytes.de
+
+ +
+ +
+ + + Hypertext Transfer Protocol (HTTP/1.1): Caching + + Adobe Systems Incorporated +
fielding@gbiv.com
+
+ + Akamai +
mnot@mnot.net
+
+ + greenbytes GmbH +
julian.reschke@greenbytes.de
+
+ +
+ + +
+ + + Hypertext Transfer Protocol (HTTP/1.1): Authentication + + Adobe Systems Incorporated +
fielding@gbiv.com
+
+ + greenbytes GmbH +
julian.reschke@greenbytes.de
+
+ +
+ + +
+ + + + HTTP State Management Mechanism + + + + + +
+ + + + + + TCP Extensions for High Performance + + + + + + + + + + + + Transport Layer Security Protocol Compression Methods + + + + + + + + + Additional HTTP Status Codes + + + + + + + + + + + Elliptic Curve Cryptography (ECC) Cipher Suites for Transport Layer Security (TLS) + + + + + + + + + + + + + + + AES Galois Counter Mode (GCM) Cipher Suites for TLS + + + + + + + + + + + + HTML5 + + + + + + + + + + + Latest version available at + . + + + + + + + Talking to Yourself for Fun and Profit + + + + + + + + + + + + + + BREACH: Reviving the CRIME Attack + + + + + + + + + + + Registration Procedures for Message Header Fields + + Nine by Nine +
GK-IETF@ninebynine.org
+
+ + BEA Systems +
mnot@pobox.com
+
+ + HP Labs +
JeffMogul@acm.org
+
+ +
+ + +
+ + + + Recommendations for Secure Use of TLS and DTLS + + + + + + + + + + + + + + + + + + HTTP Alternative Services + + + Akamai + + + Mozilla + + + greenbytes + + + + + + +
+ +
+ + This section is to be removed by RFC Editor before publication. + + +
+ + Renamed Not Authoritative status code to Misdirected Request. + +
+ +
+ + Pseudo-header fields are now required to appear strictly before regular ones. + + + Restored 1xx series status codes, except 101. + + + Changed frame length field 24-bits. Expanded frame header to 9 octets. Added a setting + to limit the damage. + + + Added a setting to advise peers of header set size limits. + + + Removed segments. + + + Made non-semantic-bearing HEADERS frames illegal in the HTTP mapping. + +
+ +
+ + Restored extensibility options. + + + Restricting TLS cipher suites to AEAD only. + + + Removing Content-Encoding requirements. + + + Permitting the use of PRIORITY after stream close. + + + Removed ALTSVC frame. + + + Removed BLOCKED frame. + + + Reducing the maximum padding size to 256 octets; removing padding from + CONTINUATION frames. + + + Removed per-frame GZIP compression. + +
+ +
+ + Added BLOCKED frame (at risk). + + + Simplified priority scheme. + + + Added DATA per-frame GZIP compression. + +
+ +
+ + Changed "connection header" to "connection preface" to avoid confusion. + + + Added dependency-based stream prioritization. + + + Added "h2c" identifier to distinguish between cleartext and secured HTTP/2. + + + Adding missing padding to PUSH_PROMISE. + + + Integrate ALTSVC frame and supporting text. + + + Dropping requirement on "deflate" Content-Encoding. + + + Improving security considerations around use of compression. + +
+ +
+ + Adding padding for data frames. + + + Renumbering frame types, error codes, and settings. + + + Adding INADEQUATE_SECURITY error code. + + + Updating TLS usage requirements to 1.2; forbidding TLS compression. + + + Removing extensibility for frames and settings. + + + Changing setting identifier size. + + + Removing the ability to disable flow control. + + + Changing the protocol identification token to "h2". + + + Changing the use of :authority to make it optional and to allow userinfo in non-HTTP + cases. + + + Allowing split on 0x0 for Cookie. + + + Reserved PRI method in HTTP/1.1 to avoid possible future collisions. + +
+ +
+ + Added cookie crumbling for more efficient header compression. + + + Added header field ordering with the value-concatenation mechanism. + +
+ +
+ + Marked draft for implementation. + +
+ +
+ + Adding definition for CONNECT method. + + + Constraining the use of push to safe, cacheable methods with no request body. + + + Changing from :host to :authority to remove any potential confusion. + + + Adding setting for header compression table size. + + + Adding settings acknowledgement. + + + Removing unnecessary and potentially problematic flags from CONTINUATION. + + + Added denial of service considerations. + +
+
+ + Marking the draft ready for implementation. + + + Renumbering END_PUSH_PROMISE flag. + + + Editorial clarifications and changes. + +
+ +
+ + Added CONTINUATION frame for HEADERS and PUSH_PROMISE. + + + PUSH_PROMISE is no longer implicitly prohibited if SETTINGS_MAX_CONCURRENT_STREAMS is + zero. + + + Push expanded to allow all safe methods without a request body. + + + Clarified the use of HTTP header fields in requests and responses. Prohibited HTTP/1.1 + hop-by-hop header fields. + + + Requiring that intermediaries not forward requests with missing or illegal routing + :-headers. + + + Clarified requirements around handling different frames after stream close, stream reset + and GOAWAY. + + + Added more specific prohibitions for sending of different frame types in various stream + states. + + + Making the last received setting value the effective value. + + + Clarified requirements on TLS version, extension and ciphers. + +
+ +
+ + Committed major restructuring atrocities. + + + Added reference to first header compression draft. + + + Added more formal description of frame lifecycle. + + + Moved END_STREAM (renamed from FINAL) back to HEADERS/DATA. + + + Removed HEADERS+PRIORITY, added optional priority to HEADERS frame. + + + Added PRIORITY frame. + +
+ +
+ + Added continuations to frames carrying header blocks. + + + Replaced use of "session" with "connection" to avoid confusion with other HTTP stateful + concepts, like cookies. + + + Removed "message". + + + Switched to TLS ALPN from NPN. + + + Editorial changes. + +
+ +
+ + Added IANA considerations section for frame types, error codes and settings. + + + Removed data frame compression. + + + Added PUSH_PROMISE. + + + Added globally applicable flags to framing. + + + Removed zlib-based header compression mechanism. + + + Updated references. + + + Clarified stream identifier reuse. + + + Removed CREDENTIALS frame and associated mechanisms. + + + Added advice against naive implementation of flow control. + + + Added session header section. + + + Restructured frame header. Removed distinction between data and control frames. + + + Altered flow control properties to include session-level limits. + + + Added note on cacheability of pushed resources and multiple tenant servers. + + + Changed protocol label form based on discussions. + +
+ +
+ + Changed title throughout. + + + Removed section on Incompatibilities with SPDY draft#2. + + + Changed INTERNAL_ERROR on GOAWAY to have a value of 2 . + + + Replaced abstract and introduction. + + + Added section on starting HTTP/2.0, including upgrade mechanism. + + + Removed unused references. + + + Added flow control principles based on . + +
+ +
+ + Adopted as base for draft-ietf-httpbis-http2. + + + Updated authors/editors list. + + + Added status note. + +
+
+ +
+
+ diff --git a/Godeps/_workspace/src/github.com/coreos/go-etcd/etcd/client.go b/Godeps/_workspace/src/github.com/coreos/go-etcd/etcd/client.go index 727e5dfca46d..60ed762b99dd 100644 --- a/Godeps/_workspace/src/github.com/coreos/go-etcd/etcd/client.go +++ b/Godeps/_workspace/src/github.com/coreos/go-etcd/etcd/client.go @@ -192,7 +192,7 @@ func (c *Client) Close() { // initHTTPClient initializes a HTTP client for etcd client func (c *Client) initHTTPClient() { c.transport = &http.Transport{ - Dial: c.dial, + Dial: c.DefaultDial, TLSClientConfig: &tls.Config{ InsecureSkipVerify: true, }, @@ -216,12 +216,12 @@ func (c *Client) initHTTPSClient(cert, key string) error { InsecureSkipVerify: true, } - tr := &http.Transport{ + c.transport = &http.Transport{ TLSClientConfig: tlsConfig, - Dial: c.dial, + Dial: c.DefaultDial, } - c.httpClient = &http.Client{Transport: tr} + c.httpClient = &http.Client{Transport: c.transport} return nil } @@ -391,29 +391,15 @@ func (c *Client) createHttpPath(serverName string, _path string) string { return u.String() } -// dial attempts to open a TCP connection to the provided address, explicitly +// DefaultDial attempts to open a TCP connection to the provided address, explicitly // enabling keep-alives with a one-second interval. -func (c *Client) dial(network, addr string) (net.Conn, error) { - conn, err := net.DialTimeout(network, addr, c.config.DialTimeout) - if err != nil { - return nil, err - } - - tcpConn, ok := conn.(*net.TCPConn) - if !ok { - return nil, errors.New("Failed type-assertion of net.Conn as *net.TCPConn") - } - - // Keep TCP alive to check whether or not the remote machine is down - if err = tcpConn.SetKeepAlive(true); err != nil { - return nil, err - } - - if err = tcpConn.SetKeepAlivePeriod(time.Second); err != nil { - return nil, err +func (c *Client) DefaultDial(network, addr string) (net.Conn, error) { + dialer := net.Dialer{ + Timeout: c.config.DialTimeout, + KeepAlive: time.Second, } - return tcpConn, nil + return dialer.Dial(network, addr) } func (c *Client) OpenCURL() { diff --git a/Godeps/_workspace/src/github.com/coreos/go-etcd/etcd/cluster.go b/Godeps/_workspace/src/github.com/coreos/go-etcd/etcd/cluster.go index 1ad3e155be52..d0461e17a252 100644 --- a/Godeps/_workspace/src/github.com/coreos/go-etcd/etcd/cluster.go +++ b/Godeps/_workspace/src/github.com/coreos/go-etcd/etcd/cluster.go @@ -3,12 +3,14 @@ package etcd import ( "math/rand" "strings" + "sync" ) type Cluster struct { Leader string `json:"leader"` Machines []string `json:"machines"` picked int + mu sync.RWMutex } func NewCluster(machines []string) *Cluster { @@ -17,6 +19,8 @@ func NewCluster(machines []string) *Cluster { machines = []string{"http://127.0.0.1:4001"} } + machines = shuffleStringSlice(machines) + logger.Debug("Shuffle cluster machines", machines) // default leader and machines return &Cluster{ Leader: "", @@ -25,13 +29,26 @@ func NewCluster(machines []string) *Cluster { } } -func (cl *Cluster) failure() { cl.picked = rand.Intn(len(cl.Machines)) } -func (cl *Cluster) pick() string { return cl.Machines[cl.picked] } +func (cl *Cluster) failure() { + cl.mu.Lock() + defer cl.mu.Unlock() + cl.picked = (cl.picked + 1) % len(cl.Machines) +} + +func (cl *Cluster) pick() string { + cl.mu.Lock() + defer cl.mu.Unlock() + return cl.Machines[cl.picked] +} func (cl *Cluster) updateFromStr(machines string) { + cl.mu.Lock() + defer cl.mu.Unlock() + cl.Machines = strings.Split(machines, ",") for i := range cl.Machines { cl.Machines[i] = strings.TrimSpace(cl.Machines[i]) } + cl.Machines = shuffleStringSlice(cl.Machines) cl.picked = rand.Intn(len(cl.Machines)) } diff --git a/Godeps/_workspace/src/github.com/coreos/go-etcd/etcd/requests.go b/Godeps/_workspace/src/github.com/coreos/go-etcd/etcd/requests.go index 3c3f436beac4..8f720f6f4426 100644 --- a/Godeps/_workspace/src/github.com/coreos/go-etcd/etcd/requests.go +++ b/Godeps/_workspace/src/github.com/coreos/go-etcd/etcd/requests.go @@ -348,7 +348,7 @@ func DefaultCheckRetry(cluster *Cluster, numReqs int, lastResp http.Response, } // sleep some time and expect leader election finish time.Sleep(time.Millisecond * 200) - logger.Warning("bad response status code", lastResp.StatusCode) + logger.Warning("bad response status code ", lastResp.StatusCode) return nil } diff --git a/Godeps/_workspace/src/github.com/coreos/go-etcd/etcd/response.generated.go b/Godeps/_workspace/src/github.com/coreos/go-etcd/etcd/response.generated.go index eb05e4c893f8..397488b14c09 100644 --- a/Godeps/_workspace/src/github.com/coreos/go-etcd/etcd/response.generated.go +++ b/Godeps/_workspace/src/github.com/coreos/go-etcd/etcd/response.generated.go @@ -9,501 +9,519 @@ import ( "errors" "fmt" codec1978 "github.com/ugorji/go/codec" - "net/http" + pkg1_http "net/http" "reflect" "runtime" - "time" + time "time" ) const ( - codecSelferC_UTF84402 = 1 - codecSelferC_RAW4402 = 0 - codecSelverValueTypeArray4402 = 10 - codecSelverValueTypeMap4402 = 9 + codecSelferC_UTF86669 = 1 + codecSelferC_RAW6669 = 0 + codecSelverValueTypeArray6669 = 10 + codecSelverValueTypeMap6669 = 9 ) var ( - codecSelferBitsize4402 = uint8(reflect.TypeOf(uint(0)).Bits()) - codecSelferOnlyMapOrArrayEncodeToStructErr4402 = errors.New(`only encoded map or array can be decoded into a struct`) + codecSelferBitsize6669 = uint8(reflect.TypeOf(uint(0)).Bits()) + codecSelferOnlyMapOrArrayEncodeToStructErr6669 = errors.New(`only encoded map or array can be decoded into a struct`) ) -type codecSelfer4402 struct{} +type codecSelfer6669 struct{} func init() { - if codec1978.GenVersion != 2 { + if codec1978.GenVersion != 4 { _, file, _, _ := runtime.Caller(0) err := fmt.Errorf("codecgen version mismatch: current: %v, need %v. Re-generate file: %v", - 2, codec1978.GenVersion, file) + 4, codec1978.GenVersion, file) panic(err) } if false { // reference the types, but skip this branch at build/run time - var v0 http.Header + var v0 pkg1_http.Header var v1 time.Time _, _ = v0, v1 } } func (x responseType) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer4402 + var h codecSelfer6669 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r - r.EncodeInt(int64(x)) + yym1 := z.EncBinary() + _ = yym1 + if false { + } else if z.HasExtensions() && z.EncExt(x) { + } else { + r.EncodeInt(int64(x)) + } } func (x *responseType) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer4402 + var h codecSelfer6669 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - *((*int)(x)) = int(r.DecodeInt(codecSelferBitsize4402)) + yym2 := z.DecBinary() + _ = yym2 + if false { + } else if z.HasExtensions() && z.DecExt(x) { + } else { + *((*int)(x)) = int(r.DecodeInt(codecSelferBitsize6669)) + } } func (x *RawResponse) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer4402 + var h codecSelfer6669 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r if x == nil { r.EncodeNil() } else { - yysep1 := !z.EncBinary() - yy2arr1 := z.EncBasicHandle().StructToArray - var yyfirst1 bool - var yyq1 [3]bool - _, _, _, _ = yysep1, yyfirst1, yyq1, yy2arr1 - const yyr1 bool = false - if yyr1 || yy2arr1 { - r.EncodeArrayStart(3) - } else { - var yynn1 int = 3 - for _, b := range yyq1 { - if b { - yynn1++ - } - } - r.EncodeMapStart(yynn1) - } - if yyr1 || yy2arr1 { - r.EncodeInt(int64(x.StatusCode)) - } else { - yyfirst1 = true - r.EncodeString(codecSelferC_UTF84402, string("StatusCode")) - if yysep1 { - r.EncodeMapKVSeparator() - } - r.EncodeInt(int64(x.StatusCode)) - } - if yyr1 || yy2arr1 { - if yysep1 { - r.EncodeArrayEntrySeparator() - } - if x.Body == nil { - r.EncodeNil() - } else { - r.EncodeStringBytes(codecSelferC_RAW4402, []byte(x.Body)) - } + yym3 := z.EncBinary() + _ = yym3 + if false { + } else if z.HasExtensions() && z.EncExt(x) { } else { - if yyfirst1 { - r.EncodeMapEntrySeparator() + yysep4 := !z.EncBinary() + yy2arr4 := z.EncBasicHandle().StructToArray + var yyq4 [3]bool + _, _, _ = yysep4, yyq4, yy2arr4 + const yyr4 bool = false + if yyr4 || yy2arr4 { + r.EncodeArrayStart(3) } else { - yyfirst1 = true - } - r.EncodeString(codecSelferC_UTF84402, string("Body")) - if yysep1 { - r.EncodeMapKVSeparator() - } - if x.Body == nil { - r.EncodeNil() - } else { - r.EncodeStringBytes(codecSelferC_RAW4402, []byte(x.Body)) - } - } - if yyr1 || yy2arr1 { - if yysep1 { - r.EncodeArrayEntrySeparator() + var yynn4 int = 3 + for _, b := range yyq4 { + if b { + yynn4++ + } + } + r.EncodeMapStart(yynn4) } - if x.Header == nil { - r.EncodeNil() + if yyr4 || yy2arr4 { + yym6 := z.EncBinary() + _ = yym6 + if false { + } else { + r.EncodeInt(int64(x.StatusCode)) + } } else { - h.enchttp_Header(http.Header(x.Header), e) + r.EncodeString(codecSelferC_UTF86669, string("StatusCode")) + yym7 := z.EncBinary() + _ = yym7 + if false { + } else { + r.EncodeInt(int64(x.StatusCode)) + } } - } else { - if yyfirst1 { - r.EncodeMapEntrySeparator() + if yyr4 || yy2arr4 { + if x.Body == nil { + r.EncodeNil() + } else { + yym9 := z.EncBinary() + _ = yym9 + if false { + } else { + r.EncodeStringBytes(codecSelferC_RAW6669, []byte(x.Body)) + } + } } else { - yyfirst1 = true - } - r.EncodeString(codecSelferC_UTF84402, string("Header")) - if yysep1 { - r.EncodeMapKVSeparator() + r.EncodeString(codecSelferC_UTF86669, string("Body")) + if x.Body == nil { + r.EncodeNil() + } else { + yym10 := z.EncBinary() + _ = yym10 + if false { + } else { + r.EncodeStringBytes(codecSelferC_RAW6669, []byte(x.Body)) + } + } } - if x.Header == nil { - r.EncodeNil() + if yyr4 || yy2arr4 { + if x.Header == nil { + r.EncodeNil() + } else { + yym12 := z.EncBinary() + _ = yym12 + if false { + } else if z.HasExtensions() && z.EncExt(x.Header) { + } else { + h.enchttp_Header((pkg1_http.Header)(x.Header), e) + } + } } else { - h.enchttp_Header(http.Header(x.Header), e) + r.EncodeString(codecSelferC_UTF86669, string("Header")) + if x.Header == nil { + r.EncodeNil() + } else { + yym13 := z.EncBinary() + _ = yym13 + if false { + } else if z.HasExtensions() && z.EncExt(x.Header) { + } else { + h.enchttp_Header((pkg1_http.Header)(x.Header), e) + } + } } - } - if yysep1 { - if yyr1 || yy2arr1 { - r.EncodeArrayEnd() - } else { - r.EncodeMapEnd() + if yysep4 { + r.EncodeEnd() } } } } func (x *RawResponse) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer4402 + var h codecSelfer6669 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - if r.IsContainerType(codecSelverValueTypeMap4402) { - yyl5 := r.ReadMapStart() - if yyl5 == 0 { - r.ReadMapEnd() - } else { - x.codecDecodeSelfFromMap(yyl5, d) - } - } else if r.IsContainerType(codecSelverValueTypeArray4402) { - yyl5 := r.ReadArrayStart() - if yyl5 == 0 { - r.ReadArrayEnd() + yym14 := z.DecBinary() + _ = yym14 + if false { + } else if z.HasExtensions() && z.DecExt(x) { + } else { + if r.IsContainerType(codecSelverValueTypeMap6669) { + yyl15 := r.ReadMapStart() + if yyl15 == 0 { + r.ReadEnd() + } else { + x.codecDecodeSelfFromMap(yyl15, d) + } + } else if r.IsContainerType(codecSelverValueTypeArray6669) { + yyl15 := r.ReadArrayStart() + if yyl15 == 0 { + r.ReadEnd() + } else { + x.codecDecodeSelfFromArray(yyl15, d) + } } else { - x.codecDecodeSelfFromArray(yyl5, d) + panic(codecSelferOnlyMapOrArrayEncodeToStructErr6669) } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr4402) } } func (x *RawResponse) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer4402 + var h codecSelfer6669 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys6Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys6Slc - var yyhl6 bool = l >= 0 - for yyj6 := 0; ; yyj6++ { - if yyhl6 { - if yyj6 >= l { + var yys16Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys16Slc + var yyhl16 bool = l >= 0 + for yyj16 := 0; ; yyj16++ { + if yyhl16 { + if yyj16 >= l { break } } else { if r.CheckBreak() { break } - if yyj6 > 0 { - r.ReadMapEntrySeparator() - } - } - yys6Slc = r.DecodeBytes(yys6Slc, true, true) - yys6 := string(yys6Slc) - if !yyhl6 { - r.ReadMapKVSeparator() } - switch yys6 { + yys16Slc = r.DecodeBytes(yys16Slc, true, true) + yys16 := string(yys16Slc) + switch yys16 { case "StatusCode": if r.TryDecodeAsNil() { x.StatusCode = 0 } else { - x.StatusCode = int(r.DecodeInt(codecSelferBitsize4402)) + x.StatusCode = int(r.DecodeInt(codecSelferBitsize6669)) } case "Body": if r.TryDecodeAsNil() { x.Body = nil } else { - yyv8 := &x.Body - *yyv8 = r.DecodeBytes(*(*[]byte)(yyv8), false, false) + yyv18 := &x.Body + yym19 := z.DecBinary() + _ = yym19 + if false { + } else { + *yyv18 = r.DecodeBytes(*(*[]byte)(yyv18), false, false) + } } case "Header": if r.TryDecodeAsNil() { x.Header = nil } else { - yyv9 := &x.Header - h.dechttp_Header((*http.Header)(yyv9), d) + yyv20 := &x.Header + yym21 := z.DecBinary() + _ = yym21 + if false { + } else if z.HasExtensions() && z.DecExt(yyv20) { + } else { + h.dechttp_Header((*pkg1_http.Header)(yyv20), d) + } } default: - z.DecStructFieldNotFound(-1, yys6) - } // end switch yys6 - } // end for yyj6 - if !yyhl6 { - r.ReadMapEnd() + z.DecStructFieldNotFound(-1, yys16) + } // end switch yys16 + } // end for yyj16 + if !yyhl16 { + r.ReadEnd() } } func (x *RawResponse) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer4402 + var h codecSelfer6669 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj10 int - var yyb10 bool - var yyhl10 bool = l >= 0 - yyj10++ - if yyhl10 { - yyb10 = yyj10 > l + var yyj22 int + var yyb22 bool + var yyhl22 bool = l >= 0 + yyj22++ + if yyhl22 { + yyb22 = yyj22 > l } else { - yyb10 = r.CheckBreak() + yyb22 = r.CheckBreak() } - if yyb10 { - r.ReadArrayEnd() + if yyb22 { + r.ReadEnd() return } if r.TryDecodeAsNil() { x.StatusCode = 0 } else { - x.StatusCode = int(r.DecodeInt(codecSelferBitsize4402)) + x.StatusCode = int(r.DecodeInt(codecSelferBitsize6669)) } - yyj10++ - if yyhl10 { - yyb10 = yyj10 > l + yyj22++ + if yyhl22 { + yyb22 = yyj22 > l } else { - yyb10 = r.CheckBreak() + yyb22 = r.CheckBreak() } - if yyb10 { - r.ReadArrayEnd() + if yyb22 { + r.ReadEnd() return } - r.ReadArrayEntrySeparator() if r.TryDecodeAsNil() { x.Body = nil } else { - yyv12 := &x.Body - *yyv12 = r.DecodeBytes(*(*[]byte)(yyv12), false, false) + yyv24 := &x.Body + yym25 := z.DecBinary() + _ = yym25 + if false { + } else { + *yyv24 = r.DecodeBytes(*(*[]byte)(yyv24), false, false) + } } - yyj10++ - if yyhl10 { - yyb10 = yyj10 > l + yyj22++ + if yyhl22 { + yyb22 = yyj22 > l } else { - yyb10 = r.CheckBreak() + yyb22 = r.CheckBreak() } - if yyb10 { - r.ReadArrayEnd() + if yyb22 { + r.ReadEnd() return } - r.ReadArrayEntrySeparator() if r.TryDecodeAsNil() { x.Header = nil } else { - yyv13 := &x.Header - h.dechttp_Header((*http.Header)(yyv13), d) + yyv26 := &x.Header + yym27 := z.DecBinary() + _ = yym27 + if false { + } else if z.HasExtensions() && z.DecExt(yyv26) { + } else { + h.dechttp_Header((*pkg1_http.Header)(yyv26), d) + } } for { - yyj10++ - if yyhl10 { - yyb10 = yyj10 > l + yyj22++ + if yyhl22 { + yyb22 = yyj22 > l } else { - yyb10 = r.CheckBreak() + yyb22 = r.CheckBreak() } - if yyb10 { + if yyb22 { break } - if yyj10 > 1 { - r.ReadArrayEntrySeparator() - } - z.DecStructFieldNotFound(yyj10-1, "") + z.DecStructFieldNotFound(yyj22-1, "") } - r.ReadArrayEnd() + r.ReadEnd() } func (x *Response) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer4402 + var h codecSelfer6669 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r if x == nil { r.EncodeNil() } else { - yysep14 := !z.EncBinary() - yy2arr14 := z.EncBasicHandle().StructToArray - var yyfirst14 bool - var yyq14 [6]bool - _, _, _, _ = yysep14, yyfirst14, yyq14, yy2arr14 - const yyr14 bool = false - yyq14[2] = x.PrevNode != nil - if yyr14 || yy2arr14 { - r.EncodeArrayStart(6) - } else { - var yynn14 int = 5 - for _, b := range yyq14 { - if b { - yynn14++ - } - } - r.EncodeMapStart(yynn14) - } - if yyr14 || yy2arr14 { - r.EncodeString(codecSelferC_UTF84402, string(x.Action)) + yym28 := z.EncBinary() + _ = yym28 + if false { + } else if z.HasExtensions() && z.EncExt(x) { } else { - yyfirst14 = true - r.EncodeString(codecSelferC_UTF84402, string("action")) - if yysep14 { - r.EncodeMapKVSeparator() - } - r.EncodeString(codecSelferC_UTF84402, string(x.Action)) - } - if yyr14 || yy2arr14 { - if yysep14 { - r.EncodeArrayEntrySeparator() - } - if x.Node == nil { - r.EncodeNil() + yysep29 := !z.EncBinary() + yy2arr29 := z.EncBasicHandle().StructToArray + var yyq29 [6]bool + _, _, _ = yysep29, yyq29, yy2arr29 + const yyr29 bool = false + yyq29[2] = x.PrevNode != nil + if yyr29 || yy2arr29 { + r.EncodeArrayStart(6) } else { - x.Node.CodecEncodeSelf(e) - } - } else { - if yyfirst14 { - r.EncodeMapEntrySeparator() - } else { - yyfirst14 = true - } - r.EncodeString(codecSelferC_UTF84402, string("node")) - if yysep14 { - r.EncodeMapKVSeparator() + var yynn29 int = 5 + for _, b := range yyq29 { + if b { + yynn29++ + } + } + r.EncodeMapStart(yynn29) } - if x.Node == nil { - r.EncodeNil() + if yyr29 || yy2arr29 { + yym31 := z.EncBinary() + _ = yym31 + if false { + } else { + r.EncodeString(codecSelferC_UTF86669, string(x.Action)) + } } else { - x.Node.CodecEncodeSelf(e) - } - } - if yyr14 || yy2arr14 { - if yysep14 { - r.EncodeArrayEntrySeparator() + r.EncodeString(codecSelferC_UTF86669, string("action")) + yym32 := z.EncBinary() + _ = yym32 + if false { + } else { + r.EncodeString(codecSelferC_UTF86669, string(x.Action)) + } } - if yyq14[2] { - if x.PrevNode == nil { + if yyr29 || yy2arr29 { + if x.Node == nil { r.EncodeNil() } else { - x.PrevNode.CodecEncodeSelf(e) + x.Node.CodecEncodeSelf(e) } } else { - r.EncodeNil() + r.EncodeString(codecSelferC_UTF86669, string("node")) + if x.Node == nil { + r.EncodeNil() + } else { + x.Node.CodecEncodeSelf(e) + } } - } else { - if yyq14[2] { - if yyfirst14 { - r.EncodeMapEntrySeparator() + if yyr29 || yy2arr29 { + if yyq29[2] { + if x.PrevNode == nil { + r.EncodeNil() + } else { + x.PrevNode.CodecEncodeSelf(e) + } } else { - yyfirst14 = true + r.EncodeNil() } - r.EncodeString(codecSelferC_UTF84402, string("prevNode")) - if yysep14 { - r.EncodeMapKVSeparator() + } else { + if yyq29[2] { + r.EncodeString(codecSelferC_UTF86669, string("prevNode")) + if x.PrevNode == nil { + r.EncodeNil() + } else { + x.PrevNode.CodecEncodeSelf(e) + } } - if x.PrevNode == nil { - r.EncodeNil() + } + if yyr29 || yy2arr29 { + yym36 := z.EncBinary() + _ = yym36 + if false { } else { - x.PrevNode.CodecEncodeSelf(e) + r.EncodeUint(uint64(x.EtcdIndex)) } - } - } - if yyr14 || yy2arr14 { - if yysep14 { - r.EncodeArrayEntrySeparator() - } - r.EncodeUint(uint64(x.EtcdIndex)) - } else { - if yyfirst14 { - r.EncodeMapEntrySeparator() } else { - yyfirst14 = true - } - r.EncodeString(codecSelferC_UTF84402, string("etcdIndex")) - if yysep14 { - r.EncodeMapKVSeparator() - } - r.EncodeUint(uint64(x.EtcdIndex)) - } - if yyr14 || yy2arr14 { - if yysep14 { - r.EncodeArrayEntrySeparator() + r.EncodeString(codecSelferC_UTF86669, string("etcdIndex")) + yym37 := z.EncBinary() + _ = yym37 + if false { + } else { + r.EncodeUint(uint64(x.EtcdIndex)) + } } - r.EncodeUint(uint64(x.RaftIndex)) - } else { - if yyfirst14 { - r.EncodeMapEntrySeparator() + if yyr29 || yy2arr29 { + yym39 := z.EncBinary() + _ = yym39 + if false { + } else { + r.EncodeUint(uint64(x.RaftIndex)) + } } else { - yyfirst14 = true - } - r.EncodeString(codecSelferC_UTF84402, string("raftIndex")) - if yysep14 { - r.EncodeMapKVSeparator() - } - r.EncodeUint(uint64(x.RaftIndex)) - } - if yyr14 || yy2arr14 { - if yysep14 { - r.EncodeArrayEntrySeparator() + r.EncodeString(codecSelferC_UTF86669, string("raftIndex")) + yym40 := z.EncBinary() + _ = yym40 + if false { + } else { + r.EncodeUint(uint64(x.RaftIndex)) + } } - r.EncodeUint(uint64(x.RaftTerm)) - } else { - if yyfirst14 { - r.EncodeMapEntrySeparator() + if yyr29 || yy2arr29 { + yym42 := z.EncBinary() + _ = yym42 + if false { + } else { + r.EncodeUint(uint64(x.RaftTerm)) + } } else { - yyfirst14 = true - } - r.EncodeString(codecSelferC_UTF84402, string("raftTerm")) - if yysep14 { - r.EncodeMapKVSeparator() + r.EncodeString(codecSelferC_UTF86669, string("raftTerm")) + yym43 := z.EncBinary() + _ = yym43 + if false { + } else { + r.EncodeUint(uint64(x.RaftTerm)) + } } - r.EncodeUint(uint64(x.RaftTerm)) - } - if yysep14 { - if yyr14 || yy2arr14 { - r.EncodeArrayEnd() - } else { - r.EncodeMapEnd() + if yysep29 { + r.EncodeEnd() } } } } func (x *Response) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer4402 + var h codecSelfer6669 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - if r.IsContainerType(codecSelverValueTypeMap4402) { - yyl21 := r.ReadMapStart() - if yyl21 == 0 { - r.ReadMapEnd() - } else { - x.codecDecodeSelfFromMap(yyl21, d) - } - } else if r.IsContainerType(codecSelverValueTypeArray4402) { - yyl21 := r.ReadArrayStart() - if yyl21 == 0 { - r.ReadArrayEnd() + yym44 := z.DecBinary() + _ = yym44 + if false { + } else if z.HasExtensions() && z.DecExt(x) { + } else { + if r.IsContainerType(codecSelverValueTypeMap6669) { + yyl45 := r.ReadMapStart() + if yyl45 == 0 { + r.ReadEnd() + } else { + x.codecDecodeSelfFromMap(yyl45, d) + } + } else if r.IsContainerType(codecSelverValueTypeArray6669) { + yyl45 := r.ReadArrayStart() + if yyl45 == 0 { + r.ReadEnd() + } else { + x.codecDecodeSelfFromArray(yyl45, d) + } } else { - x.codecDecodeSelfFromArray(yyl21, d) + panic(codecSelferOnlyMapOrArrayEncodeToStructErr6669) } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr4402) } } func (x *Response) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer4402 + var h codecSelfer6669 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys22Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys22Slc - var yyhl22 bool = l >= 0 - for yyj22 := 0; ; yyj22++ { - if yyhl22 { - if yyj22 >= l { + var yys46Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys46Slc + var yyhl46 bool = l >= 0 + for yyj46 := 0; ; yyj46++ { + if yyhl46 { + if yyj46 >= l { break } } else { if r.CheckBreak() { break } - if yyj22 > 0 { - r.ReadMapEntrySeparator() - } } - yys22Slc = r.DecodeBytes(yys22Slc, true, true) - yys22 := string(yys22Slc) - if !yyhl22 { - r.ReadMapKVSeparator() - } - switch yys22 { + yys46Slc = r.DecodeBytes(yys46Slc, true, true) + yys46 := string(yys46Slc) + switch yys46 { case "action": if r.TryDecodeAsNil() { x.Action = "" @@ -551,29 +569,29 @@ func (x *Response) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { x.RaftTerm = uint64(r.DecodeUint(64)) } default: - z.DecStructFieldNotFound(-1, yys22) - } // end switch yys22 - } // end for yyj22 - if !yyhl22 { - r.ReadMapEnd() + z.DecStructFieldNotFound(-1, yys46) + } // end switch yys46 + } // end for yyj46 + if !yyhl46 { + r.ReadEnd() } } func (x *Response) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer4402 + var h codecSelfer6669 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj29 int - var yyb29 bool - var yyhl29 bool = l >= 0 - yyj29++ - if yyhl29 { - yyb29 = yyj29 > l + var yyj53 int + var yyb53 bool + var yyhl53 bool = l >= 0 + yyj53++ + if yyhl53 { + yyb53 = yyj53 > l } else { - yyb29 = r.CheckBreak() + yyb53 = r.CheckBreak() } - if yyb29 { - r.ReadArrayEnd() + if yyb53 { + r.ReadEnd() return } if r.TryDecodeAsNil() { @@ -581,17 +599,16 @@ func (x *Response) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Action = string(r.DecodeString()) } - yyj29++ - if yyhl29 { - yyb29 = yyj29 > l + yyj53++ + if yyhl53 { + yyb53 = yyj53 > l } else { - yyb29 = r.CheckBreak() + yyb53 = r.CheckBreak() } - if yyb29 { - r.ReadArrayEnd() + if yyb53 { + r.ReadEnd() return } - r.ReadArrayEntrySeparator() if r.TryDecodeAsNil() { if x.Node != nil { x.Node = nil @@ -602,17 +619,16 @@ func (x *Response) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } x.Node.CodecDecodeSelf(d) } - yyj29++ - if yyhl29 { - yyb29 = yyj29 > l + yyj53++ + if yyhl53 { + yyb53 = yyj53 > l } else { - yyb29 = r.CheckBreak() + yyb53 = r.CheckBreak() } - if yyb29 { - r.ReadArrayEnd() + if yyb53 { + r.ReadEnd() return } - r.ReadArrayEntrySeparator() if r.TryDecodeAsNil() { if x.PrevNode != nil { x.PrevNode = nil @@ -623,349 +639,347 @@ func (x *Response) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } x.PrevNode.CodecDecodeSelf(d) } - yyj29++ - if yyhl29 { - yyb29 = yyj29 > l + yyj53++ + if yyhl53 { + yyb53 = yyj53 > l } else { - yyb29 = r.CheckBreak() + yyb53 = r.CheckBreak() } - if yyb29 { - r.ReadArrayEnd() + if yyb53 { + r.ReadEnd() return } - r.ReadArrayEntrySeparator() if r.TryDecodeAsNil() { x.EtcdIndex = 0 } else { x.EtcdIndex = uint64(r.DecodeUint(64)) } - yyj29++ - if yyhl29 { - yyb29 = yyj29 > l + yyj53++ + if yyhl53 { + yyb53 = yyj53 > l } else { - yyb29 = r.CheckBreak() + yyb53 = r.CheckBreak() } - if yyb29 { - r.ReadArrayEnd() + if yyb53 { + r.ReadEnd() return } - r.ReadArrayEntrySeparator() if r.TryDecodeAsNil() { x.RaftIndex = 0 } else { x.RaftIndex = uint64(r.DecodeUint(64)) } - yyj29++ - if yyhl29 { - yyb29 = yyj29 > l + yyj53++ + if yyhl53 { + yyb53 = yyj53 > l } else { - yyb29 = r.CheckBreak() + yyb53 = r.CheckBreak() } - if yyb29 { - r.ReadArrayEnd() + if yyb53 { + r.ReadEnd() return } - r.ReadArrayEntrySeparator() if r.TryDecodeAsNil() { x.RaftTerm = 0 } else { x.RaftTerm = uint64(r.DecodeUint(64)) } for { - yyj29++ - if yyhl29 { - yyb29 = yyj29 > l + yyj53++ + if yyhl53 { + yyb53 = yyj53 > l } else { - yyb29 = r.CheckBreak() + yyb53 = r.CheckBreak() } - if yyb29 { + if yyb53 { break } - if yyj29 > 1 { - r.ReadArrayEntrySeparator() - } - z.DecStructFieldNotFound(yyj29-1, "") + z.DecStructFieldNotFound(yyj53-1, "") } - r.ReadArrayEnd() + r.ReadEnd() } func (x *Node) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer4402 + var h codecSelfer6669 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r if x == nil { r.EncodeNil() } else { - yysep36 := !z.EncBinary() - yy2arr36 := z.EncBasicHandle().StructToArray - var yyfirst36 bool - var yyq36 [8]bool - _, _, _, _ = yysep36, yyfirst36, yyq36, yy2arr36 - const yyr36 bool = false - yyq36[1] = x.Value != "" - yyq36[2] = x.Dir != false - yyq36[3] = x.Expiration != nil - yyq36[4] = x.TTL != 0 - yyq36[5] = len(x.Nodes) != 0 - yyq36[6] = x.ModifiedIndex != 0 - yyq36[7] = x.CreatedIndex != 0 - if yyr36 || yy2arr36 { - r.EncodeArrayStart(8) + yym60 := z.EncBinary() + _ = yym60 + if false { + } else if z.HasExtensions() && z.EncExt(x) { } else { - var yynn36 int = 1 - for _, b := range yyq36 { - if b { - yynn36++ - } - } - r.EncodeMapStart(yynn36) - } - if yyr36 || yy2arr36 { - r.EncodeString(codecSelferC_UTF84402, string(x.Key)) - } else { - yyfirst36 = true - r.EncodeString(codecSelferC_UTF84402, string("key")) - if yysep36 { - r.EncodeMapKVSeparator() - } - r.EncodeString(codecSelferC_UTF84402, string(x.Key)) - } - if yyr36 || yy2arr36 { - if yysep36 { - r.EncodeArrayEntrySeparator() - } - if yyq36[1] { - r.EncodeString(codecSelferC_UTF84402, string(x.Value)) + yysep61 := !z.EncBinary() + yy2arr61 := z.EncBasicHandle().StructToArray + var yyq61 [8]bool + _, _, _ = yysep61, yyq61, yy2arr61 + const yyr61 bool = false + yyq61[1] = x.Value != "" + yyq61[2] = x.Dir != false + yyq61[3] = x.Expiration != nil + yyq61[4] = x.TTL != 0 + yyq61[5] = len(x.Nodes) != 0 + yyq61[6] = x.ModifiedIndex != 0 + yyq61[7] = x.CreatedIndex != 0 + if yyr61 || yy2arr61 { + r.EncodeArrayStart(8) } else { - r.EncodeString(codecSelferC_UTF84402, "") + var yynn61 int = 1 + for _, b := range yyq61 { + if b { + yynn61++ + } + } + r.EncodeMapStart(yynn61) } - } else { - if yyq36[1] { - if yyfirst36 { - r.EncodeMapEntrySeparator() + if yyr61 || yy2arr61 { + yym63 := z.EncBinary() + _ = yym63 + if false { } else { - yyfirst36 = true - } - r.EncodeString(codecSelferC_UTF84402, string("value")) - if yysep36 { - r.EncodeMapKVSeparator() + r.EncodeString(codecSelferC_UTF86669, string(x.Key)) } - r.EncodeString(codecSelferC_UTF84402, string(x.Value)) - } - } - if yyr36 || yy2arr36 { - if yysep36 { - r.EncodeArrayEntrySeparator() - } - if yyq36[2] { - r.EncodeBool(bool(x.Dir)) } else { - r.EncodeBool(false) - } - } else { - if yyq36[2] { - if yyfirst36 { - r.EncodeMapEntrySeparator() + r.EncodeString(codecSelferC_UTF86669, string("key")) + yym64 := z.EncBinary() + _ = yym64 + if false { } else { - yyfirst36 = true - } - r.EncodeString(codecSelferC_UTF84402, string("dir")) - if yysep36 { - r.EncodeMapKVSeparator() + r.EncodeString(codecSelferC_UTF86669, string(x.Key)) } - r.EncodeBool(bool(x.Dir)) - } - } - if yyr36 || yy2arr36 { - if yysep36 { - r.EncodeArrayEntrySeparator() } - if yyq36[3] { - if x.Expiration == nil { - r.EncodeNil() + if yyr61 || yy2arr61 { + if yyq61[1] { + yym66 := z.EncBinary() + _ = yym66 + if false { + } else { + r.EncodeString(codecSelferC_UTF86669, string(x.Value)) + } } else { - z.EncFallback(x.Expiration) + r.EncodeString(codecSelferC_UTF86669, "") } } else { - r.EncodeNil() - } - } else { - if yyq36[3] { - if yyfirst36 { - r.EncodeMapEntrySeparator() - } else { - yyfirst36 = true - } - r.EncodeString(codecSelferC_UTF84402, string("expiration")) - if yysep36 { - r.EncodeMapKVSeparator() + if yyq61[1] { + r.EncodeString(codecSelferC_UTF86669, string("value")) + yym67 := z.EncBinary() + _ = yym67 + if false { + } else { + r.EncodeString(codecSelferC_UTF86669, string(x.Value)) + } } - if x.Expiration == nil { - r.EncodeNil() + } + if yyr61 || yy2arr61 { + if yyq61[2] { + yym69 := z.EncBinary() + _ = yym69 + if false { + } else { + r.EncodeBool(bool(x.Dir)) + } } else { - z.EncFallback(x.Expiration) + r.EncodeBool(false) } - } - } - if yyr36 || yy2arr36 { - if yysep36 { - r.EncodeArrayEntrySeparator() - } - if yyq36[4] { - r.EncodeInt(int64(x.TTL)) } else { - r.EncodeInt(0) + if yyq61[2] { + r.EncodeString(codecSelferC_UTF86669, string("dir")) + yym70 := z.EncBinary() + _ = yym70 + if false { + } else { + r.EncodeBool(bool(x.Dir)) + } + } } - } else { - if yyq36[4] { - if yyfirst36 { - r.EncodeMapEntrySeparator() + if yyr61 || yy2arr61 { + if yyq61[3] { + if x.Expiration == nil { + r.EncodeNil() + } else { + yym72 := z.EncBinary() + _ = yym72 + if false { + } else if yym73 := z.TimeRtidIfBinc(); yym73 != 0 { + r.EncodeBuiltin(yym73, x.Expiration) + } else if z.HasExtensions() && z.EncExt(x.Expiration) { + } else if yym72 { + z.EncBinaryMarshal(x.Expiration) + } else if !yym72 && z.IsJSONHandle() { + z.EncJSONMarshal(x.Expiration) + } else { + z.EncFallback(x.Expiration) + } + } } else { - yyfirst36 = true + r.EncodeNil() } - r.EncodeString(codecSelferC_UTF84402, string("ttl")) - if yysep36 { - r.EncodeMapKVSeparator() + } else { + if yyq61[3] { + r.EncodeString(codecSelferC_UTF86669, string("expiration")) + if x.Expiration == nil { + r.EncodeNil() + } else { + yym74 := z.EncBinary() + _ = yym74 + if false { + } else if yym75 := z.TimeRtidIfBinc(); yym75 != 0 { + r.EncodeBuiltin(yym75, x.Expiration) + } else if z.HasExtensions() && z.EncExt(x.Expiration) { + } else if yym74 { + z.EncBinaryMarshal(x.Expiration) + } else if !yym74 && z.IsJSONHandle() { + z.EncJSONMarshal(x.Expiration) + } else { + z.EncFallback(x.Expiration) + } + } } - r.EncodeInt(int64(x.TTL)) - } - } - if yyr36 || yy2arr36 { - if yysep36 { - r.EncodeArrayEntrySeparator() } - if yyq36[5] { - if x.Nodes == nil { - r.EncodeNil() + if yyr61 || yy2arr61 { + if yyq61[4] { + yym77 := z.EncBinary() + _ = yym77 + if false { + } else { + r.EncodeInt(int64(x.TTL)) + } } else { - x.Nodes.CodecEncodeSelf(e) + r.EncodeInt(0) } } else { - r.EncodeNil() + if yyq61[4] { + r.EncodeString(codecSelferC_UTF86669, string("ttl")) + yym78 := z.EncBinary() + _ = yym78 + if false { + } else { + r.EncodeInt(int64(x.TTL)) + } + } } - } else { - if yyq36[5] { - if yyfirst36 { - r.EncodeMapEntrySeparator() + if yyr61 || yy2arr61 { + if yyq61[5] { + if x.Nodes == nil { + r.EncodeNil() + } else { + x.Nodes.CodecEncodeSelf(e) + } } else { - yyfirst36 = true - } - r.EncodeString(codecSelferC_UTF84402, string("nodes")) - if yysep36 { - r.EncodeMapKVSeparator() - } - if x.Nodes == nil { r.EncodeNil() - } else { - x.Nodes.CodecEncodeSelf(e) } - } - } - if yyr36 || yy2arr36 { - if yysep36 { - r.EncodeArrayEntrySeparator() - } - if yyq36[6] { - r.EncodeUint(uint64(x.ModifiedIndex)) } else { - r.EncodeUint(0) + if yyq61[5] { + r.EncodeString(codecSelferC_UTF86669, string("nodes")) + if x.Nodes == nil { + r.EncodeNil() + } else { + x.Nodes.CodecEncodeSelf(e) + } + } } - } else { - if yyq36[6] { - if yyfirst36 { - r.EncodeMapEntrySeparator() + if yyr61 || yy2arr61 { + if yyq61[6] { + yym81 := z.EncBinary() + _ = yym81 + if false { + } else { + r.EncodeUint(uint64(x.ModifiedIndex)) + } } else { - yyfirst36 = true - } - r.EncodeString(codecSelferC_UTF84402, string("modifiedIndex")) - if yysep36 { - r.EncodeMapKVSeparator() + r.EncodeUint(0) } - r.EncodeUint(uint64(x.ModifiedIndex)) - } - } - if yyr36 || yy2arr36 { - if yysep36 { - r.EncodeArrayEntrySeparator() - } - if yyq36[7] { - r.EncodeUint(uint64(x.CreatedIndex)) } else { - r.EncodeUint(0) + if yyq61[6] { + r.EncodeString(codecSelferC_UTF86669, string("modifiedIndex")) + yym82 := z.EncBinary() + _ = yym82 + if false { + } else { + r.EncodeUint(uint64(x.ModifiedIndex)) + } + } } - } else { - if yyq36[7] { - if yyfirst36 { - r.EncodeMapEntrySeparator() + if yyr61 || yy2arr61 { + if yyq61[7] { + yym84 := z.EncBinary() + _ = yym84 + if false { + } else { + r.EncodeUint(uint64(x.CreatedIndex)) + } } else { - yyfirst36 = true + r.EncodeUint(0) } - r.EncodeString(codecSelferC_UTF84402, string("createdIndex")) - if yysep36 { - r.EncodeMapKVSeparator() + } else { + if yyq61[7] { + r.EncodeString(codecSelferC_UTF86669, string("createdIndex")) + yym85 := z.EncBinary() + _ = yym85 + if false { + } else { + r.EncodeUint(uint64(x.CreatedIndex)) + } } - r.EncodeUint(uint64(x.CreatedIndex)) } - } - if yysep36 { - if yyr36 || yy2arr36 { - r.EncodeArrayEnd() - } else { - r.EncodeMapEnd() + if yysep61 { + r.EncodeEnd() } } } } func (x *Node) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer4402 + var h codecSelfer6669 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - if r.IsContainerType(codecSelverValueTypeMap4402) { - yyl45 := r.ReadMapStart() - if yyl45 == 0 { - r.ReadMapEnd() - } else { - x.codecDecodeSelfFromMap(yyl45, d) - } - } else if r.IsContainerType(codecSelverValueTypeArray4402) { - yyl45 := r.ReadArrayStart() - if yyl45 == 0 { - r.ReadArrayEnd() + yym86 := z.DecBinary() + _ = yym86 + if false { + } else if z.HasExtensions() && z.DecExt(x) { + } else { + if r.IsContainerType(codecSelverValueTypeMap6669) { + yyl87 := r.ReadMapStart() + if yyl87 == 0 { + r.ReadEnd() + } else { + x.codecDecodeSelfFromMap(yyl87, d) + } + } else if r.IsContainerType(codecSelverValueTypeArray6669) { + yyl87 := r.ReadArrayStart() + if yyl87 == 0 { + r.ReadEnd() + } else { + x.codecDecodeSelfFromArray(yyl87, d) + } } else { - x.codecDecodeSelfFromArray(yyl45, d) + panic(codecSelferOnlyMapOrArrayEncodeToStructErr6669) } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr4402) } } func (x *Node) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer4402 + var h codecSelfer6669 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yys46Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys46Slc - var yyhl46 bool = l >= 0 - for yyj46 := 0; ; yyj46++ { - if yyhl46 { - if yyj46 >= l { + var yys88Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys88Slc + var yyhl88 bool = l >= 0 + for yyj88 := 0; ; yyj88++ { + if yyhl88 { + if yyj88 >= l { break } } else { if r.CheckBreak() { break } - if yyj46 > 0 { - r.ReadMapEntrySeparator() - } - } - yys46Slc = r.DecodeBytes(yys46Slc, true, true) - yys46 := string(yys46Slc) - if !yyhl46 { - r.ReadMapKVSeparator() } - switch yys46 { + yys88Slc = r.DecodeBytes(yys88Slc, true, true) + yys88 := string(yys88Slc) + switch yys88 { case "key": if r.TryDecodeAsNil() { x.Key = "" @@ -993,7 +1007,19 @@ func (x *Node) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { if x.Expiration == nil { x.Expiration = new(time.Time) } - z.DecFallback(x.Expiration, false) + yym93 := z.DecBinary() + _ = yym93 + if false { + } else if yym94 := z.TimeRtidIfBinc(); yym94 != 0 { + r.DecodeBuiltin(yym94, x.Expiration) + } else if z.HasExtensions() && z.DecExt(x.Expiration) { + } else if yym93 { + z.DecBinaryUnmarshal(x.Expiration) + } else if !yym93 && z.IsJSONHandle() { + z.DecJSONUnmarshal(x.Expiration) + } else { + z.DecFallback(x.Expiration, false) + } } case "ttl": if r.TryDecodeAsNil() { @@ -1005,8 +1031,8 @@ func (x *Node) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.Nodes = nil } else { - yyv52 := &x.Nodes - yyv52.CodecDecodeSelf(d) + yyv96 := &x.Nodes + yyv96.CodecDecodeSelf(d) } case "modifiedIndex": if r.TryDecodeAsNil() { @@ -1021,29 +1047,29 @@ func (x *Node) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { x.CreatedIndex = uint64(r.DecodeUint(64)) } default: - z.DecStructFieldNotFound(-1, yys46) - } // end switch yys46 - } // end for yyj46 - if !yyhl46 { - r.ReadMapEnd() + z.DecStructFieldNotFound(-1, yys88) + } // end switch yys88 + } // end for yyj88 + if !yyhl88 { + r.ReadEnd() } } func (x *Node) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer4402 + var h codecSelfer6669 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - var yyj55 int - var yyb55 bool - var yyhl55 bool = l >= 0 - yyj55++ - if yyhl55 { - yyb55 = yyj55 > l + var yyj99 int + var yyb99 bool + var yyhl99 bool = l >= 0 + yyj99++ + if yyhl99 { + yyb99 = yyj99 > l } else { - yyb55 = r.CheckBreak() + yyb99 = r.CheckBreak() } - if yyb55 { - r.ReadArrayEnd() + if yyb99 { + r.ReadEnd() return } if r.TryDecodeAsNil() { @@ -1051,49 +1077,46 @@ func (x *Node) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } else { x.Key = string(r.DecodeString()) } - yyj55++ - if yyhl55 { - yyb55 = yyj55 > l + yyj99++ + if yyhl99 { + yyb99 = yyj99 > l } else { - yyb55 = r.CheckBreak() + yyb99 = r.CheckBreak() } - if yyb55 { - r.ReadArrayEnd() + if yyb99 { + r.ReadEnd() return } - r.ReadArrayEntrySeparator() if r.TryDecodeAsNil() { x.Value = "" } else { x.Value = string(r.DecodeString()) } - yyj55++ - if yyhl55 { - yyb55 = yyj55 > l + yyj99++ + if yyhl99 { + yyb99 = yyj99 > l } else { - yyb55 = r.CheckBreak() + yyb99 = r.CheckBreak() } - if yyb55 { - r.ReadArrayEnd() + if yyb99 { + r.ReadEnd() return } - r.ReadArrayEntrySeparator() if r.TryDecodeAsNil() { x.Dir = false } else { x.Dir = bool(r.DecodeBool()) } - yyj55++ - if yyhl55 { - yyb55 = yyj55 > l + yyj99++ + if yyhl99 { + yyb99 = yyj99 > l } else { - yyb55 = r.CheckBreak() + yyb99 = r.CheckBreak() } - if yyb55 { - r.ReadArrayEnd() + if yyb99 { + r.ReadEnd() return } - r.ReadArrayEntrySeparator() if r.TryDecodeAsNil() { if x.Expiration != nil { x.Expiration = nil @@ -1102,308 +1125,308 @@ func (x *Node) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if x.Expiration == nil { x.Expiration = new(time.Time) } - z.DecFallback(x.Expiration, false) + yym104 := z.DecBinary() + _ = yym104 + if false { + } else if yym105 := z.TimeRtidIfBinc(); yym105 != 0 { + r.DecodeBuiltin(yym105, x.Expiration) + } else if z.HasExtensions() && z.DecExt(x.Expiration) { + } else if yym104 { + z.DecBinaryUnmarshal(x.Expiration) + } else if !yym104 && z.IsJSONHandle() { + z.DecJSONUnmarshal(x.Expiration) + } else { + z.DecFallback(x.Expiration, false) + } } - yyj55++ - if yyhl55 { - yyb55 = yyj55 > l + yyj99++ + if yyhl99 { + yyb99 = yyj99 > l } else { - yyb55 = r.CheckBreak() + yyb99 = r.CheckBreak() } - if yyb55 { - r.ReadArrayEnd() + if yyb99 { + r.ReadEnd() return } - r.ReadArrayEntrySeparator() if r.TryDecodeAsNil() { x.TTL = 0 } else { x.TTL = int64(r.DecodeInt(64)) } - yyj55++ - if yyhl55 { - yyb55 = yyj55 > l + yyj99++ + if yyhl99 { + yyb99 = yyj99 > l } else { - yyb55 = r.CheckBreak() + yyb99 = r.CheckBreak() } - if yyb55 { - r.ReadArrayEnd() + if yyb99 { + r.ReadEnd() return } - r.ReadArrayEntrySeparator() if r.TryDecodeAsNil() { x.Nodes = nil } else { - yyv61 := &x.Nodes - yyv61.CodecDecodeSelf(d) + yyv107 := &x.Nodes + yyv107.CodecDecodeSelf(d) } - yyj55++ - if yyhl55 { - yyb55 = yyj55 > l + yyj99++ + if yyhl99 { + yyb99 = yyj99 > l } else { - yyb55 = r.CheckBreak() + yyb99 = r.CheckBreak() } - if yyb55 { - r.ReadArrayEnd() + if yyb99 { + r.ReadEnd() return } - r.ReadArrayEntrySeparator() if r.TryDecodeAsNil() { x.ModifiedIndex = 0 } else { x.ModifiedIndex = uint64(r.DecodeUint(64)) } - yyj55++ - if yyhl55 { - yyb55 = yyj55 > l + yyj99++ + if yyhl99 { + yyb99 = yyj99 > l } else { - yyb55 = r.CheckBreak() + yyb99 = r.CheckBreak() } - if yyb55 { - r.ReadArrayEnd() + if yyb99 { + r.ReadEnd() return } - r.ReadArrayEntrySeparator() if r.TryDecodeAsNil() { x.CreatedIndex = 0 } else { x.CreatedIndex = uint64(r.DecodeUint(64)) } for { - yyj55++ - if yyhl55 { - yyb55 = yyj55 > l + yyj99++ + if yyhl99 { + yyb99 = yyj99 > l } else { - yyb55 = r.CheckBreak() + yyb99 = r.CheckBreak() } - if yyb55 { + if yyb99 { break } - if yyj55 > 1 { - r.ReadArrayEntrySeparator() - } - z.DecStructFieldNotFound(yyj55-1, "") + z.DecStructFieldNotFound(yyj99-1, "") } - r.ReadArrayEnd() + r.ReadEnd() } func (x Nodes) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer4402 + var h codecSelfer6669 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r if x == nil { r.EncodeNil() } else { - h.encNodes(Nodes(x), e) + yym110 := z.EncBinary() + _ = yym110 + if false { + } else if z.HasExtensions() && z.EncExt(x) { + } else { + h.encNodes((Nodes)(x), e) + } } } func (x *Nodes) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer4402 + var h codecSelfer6669 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - h.decNodes((*Nodes)(x), d) + yym111 := z.DecBinary() + _ = yym111 + if false { + } else if z.HasExtensions() && z.DecExt(x) { + } else { + h.decNodes((*Nodes)(x), d) + } } -func (x codecSelfer4402) enchttp_Header(v http.Header, e *codec1978.Encoder) { - var h codecSelfer4402 +func (x codecSelfer6669) enchttp_Header(v pkg1_http.Header, e *codec1978.Encoder) { + var h codecSelfer6669 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r r.EncodeMapStart(len(v)) - yys64 := !z.EncBinary() - yyj64 := 0 - if yys64 { - for yyk64, yyv64 := range v { - if yyj64 > 0 { - r.EncodeMapEntrySeparator() - } - r.EncodeString(codecSelferC_UTF84402, string(yyk64)) - r.EncodeMapKVSeparator() - if yyv64 == nil { - r.EncodeNil() - } else { - z.F.EncSliceStringV(yyv64, false, e) - } - yyj64++ + for yyk112, yyv112 := range v { + yym113 := z.EncBinary() + _ = yym113 + if false { + } else { + r.EncodeString(codecSelferC_UTF86669, string(yyk112)) } - r.EncodeMapEnd() - } else { - for yyk64, yyv64 := range v { - r.EncodeString(codecSelferC_UTF84402, string(yyk64)) - if yyv64 == nil { - r.EncodeNil() + if yyv112 == nil { + r.EncodeNil() + } else { + yym114 := z.EncBinary() + _ = yym114 + if false { } else { - z.F.EncSliceStringV(yyv64, false, e) + z.F.EncSliceStringV(yyv112, false, e) } } } + r.EncodeEnd() } -func (x codecSelfer4402) dechttp_Header(v *http.Header, d *codec1978.Decoder) { - var h codecSelfer4402 +func (x codecSelfer6669) dechttp_Header(v *pkg1_http.Header, d *codec1978.Decoder) { + var h codecSelfer6669 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yyv65 := *v - yyl65 := r.ReadMapStart() - if yyv65 == nil { - if yyl65 > 0 { - yyv65 = make(map[string][]string, yyl65) + yyv115 := *v + yyl115 := r.ReadMapStart() + if yyv115 == nil { + if yyl115 > 0 { + yyv115 = make(map[string][]string, yyl115) } else { - yyv65 = make(map[string][]string) // supports indefinite-length, etc + yyv115 = make(map[string][]string) // supports indefinite-length, etc } - *v = yyv65 + *v = yyv115 } - if yyl65 > 0 { - for yyj65 := 0; yyj65 < yyl65; yyj65++ { - var yymk65 string + if yyl115 > 0 { + for yyj115 := 0; yyj115 < yyl115; yyj115++ { + var yymk115 string if r.TryDecodeAsNil() { - yymk65 = "" + yymk115 = "" } else { - yymk65 = string(r.DecodeString()) + yymk115 = string(r.DecodeString()) } - yymv65 := yyv65[yymk65] + yymv115 := yyv115[yymk115] if r.TryDecodeAsNil() { - yymv65 = nil + yymv115 = nil } else { - yyv67 := &yymv65 - z.F.DecSliceStringX(yyv67, false, d) + yyv117 := &yymv115 + yym118 := z.DecBinary() + _ = yym118 + if false { + } else { + z.F.DecSliceStringX(yyv117, false, d) + } } - if yyv65 != nil { - yyv65[yymk65] = yymv65 + if yyv115 != nil { + yyv115[yymk115] = yymv115 } } - } else if yyl65 < 0 { - for yyj65 := 0; !r.CheckBreak(); yyj65++ { - if yyj65 > 0 { - r.ReadMapEntrySeparator() - } - var yymk65 string + } else if yyl115 < 0 { + for yyj115 := 0; !r.CheckBreak(); yyj115++ { + var yymk115 string if r.TryDecodeAsNil() { - yymk65 = "" + yymk115 = "" } else { - yymk65 = string(r.DecodeString()) + yymk115 = string(r.DecodeString()) } - r.ReadMapKVSeparator() - yymv65 := yyv65[yymk65] + yymv115 := yyv115[yymk115] if r.TryDecodeAsNil() { - yymv65 = nil + yymv115 = nil } else { - yyv69 := &yymv65 - z.F.DecSliceStringX(yyv69, false, d) + yyv120 := &yymv115 + yym121 := z.DecBinary() + _ = yym121 + if false { + } else { + z.F.DecSliceStringX(yyv120, false, d) + } } - if yyv65 != nil { - yyv65[yymk65] = yymv65 + if yyv115 != nil { + yyv115[yymk115] = yymv115 } } - r.ReadMapEnd() + r.ReadEnd() } // else len==0: TODO: Should we clear map entries? } -func (x codecSelfer4402) encNodes(v Nodes, e *codec1978.Encoder) { - var h codecSelfer4402 +func (x codecSelfer6669) encNodes(v Nodes, e *codec1978.Encoder) { + var h codecSelfer6669 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r r.EncodeArrayStart(len(v)) - yys70 := !z.EncBinary() - if yys70 { - for yyi70, yyv70 := range v { - if yyi70 > 0 { - r.EncodeArrayEntrySeparator() - } - if yyv70 == nil { - r.EncodeNil() - } else { - yyv70.CodecEncodeSelf(e) - } - } - r.EncodeArrayEnd() - } else { - for _, yyv70 := range v { - if yyv70 == nil { - r.EncodeNil() - } else { - yyv70.CodecEncodeSelf(e) - } + for _, yyv122 := range v { + if yyv122 == nil { + r.EncodeNil() + } else { + yyv122.CodecEncodeSelf(e) } } + r.EncodeEnd() } -func (x codecSelfer4402) decNodes(v *Nodes, d *codec1978.Decoder) { - var h codecSelfer4402 +func (x codecSelfer6669) decNodes(v *Nodes, d *codec1978.Decoder) { + var h codecSelfer6669 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r - yyv71 := *v - yyh71, yyl71 := z.DecSliceHelperStart() + yyv123 := *v + yyh123, yyl123 := z.DecSliceHelperStart() + + var yyc123 bool + _ = yyc123 - var yyc71 bool - if yyv71 == nil { - if yyl71 <= 0 { - yyv71 = make(Nodes, 0) + if yyv123 == nil { + if yyl123 <= 0 { + yyv123 = make(Nodes, 0) } else { - yyv71 = make(Nodes, yyl71) + yyv123 = make(Nodes, yyl123) } - yyc71 = true + yyc123 = true } - if yyl71 == 0 { - if len(yyv71) != 0 { - yyv71 = yyv71[:0] - yyc71 = true + if yyl123 == 0 { + if len(yyv123) != 0 { + yyv123 = yyv123[:0] + yyc123 = true } - } else if yyl71 > 0 { + } else if yyl123 > 0 { - yyn71 := yyl71 - if yyl71 > cap(yyv71) { - yyv71 = make([]*Node, yyl71, yyl71) - yyc71 = true + yyn123 := yyl123 + if yyl123 > cap(yyv123) { + yyv123 = make([]*Node, yyl123, yyl123) + yyc123 = true - } else if yyl71 != len(yyv71) { - yyv71 = yyv71[:yyl71] - yyc71 = true + } else if yyl123 != len(yyv123) { + yyv123 = yyv123[:yyl123] + yyc123 = true } - yyj71 := 0 - for ; yyj71 < yyn71; yyj71++ { + yyj123 := 0 + for ; yyj123 < yyn123; yyj123++ { if r.TryDecodeAsNil() { - if yyv71[yyj71] != nil { - *yyv71[yyj71] = Node{} + if yyv123[yyj123] != nil { + *yyv123[yyj123] = Node{} } } else { - if yyv71[yyj71] == nil { - yyv71[yyj71] = new(Node) + if yyv123[yyj123] == nil { + yyv123[yyj123] = new(Node) } - yyw72 := yyv71[yyj71] - yyw72.CodecDecodeSelf(d) + yyw124 := yyv123[yyj123] + yyw124.CodecDecodeSelf(d) } } } else { - for yyj71 := 0; !r.CheckBreak(); yyj71++ { - if yyj71 >= len(yyv71) { - yyv71 = append(yyv71, nil) // var yyz71 *Node - yyc71 = true - } - if yyj71 > 0 { - yyh71.Sep(yyj71) + for yyj123 := 0; !r.CheckBreak(); yyj123++ { + if yyj123 >= len(yyv123) { + yyv123 = append(yyv123, nil) // var yyz123 *Node + yyc123 = true } - if yyj71 < len(yyv71) { + if yyj123 < len(yyv123) { if r.TryDecodeAsNil() { - if yyv71[yyj71] != nil { - *yyv71[yyj71] = Node{} + if yyv123[yyj123] != nil { + *yyv123[yyj123] = Node{} } } else { - if yyv71[yyj71] == nil { - yyv71[yyj71] = new(Node) + if yyv123[yyj123] == nil { + yyv123[yyj123] = new(Node) } - yyw73 := yyv71[yyj71] - yyw73.CodecDecodeSelf(d) + yyw125 := yyv123[yyj123] + yyw125.CodecDecodeSelf(d) } } else { @@ -1411,9 +1434,10 @@ func (x codecSelfer4402) decNodes(v *Nodes, d *codec1978.Decoder) { } } - yyh71.End() + yyh123.End() } - if yyc71 { - *v = yyv71 + if yyc123 { + *v = yyv123 } + } diff --git a/Godeps/_workspace/src/github.com/coreos/go-etcd/etcd/shuffle.go b/Godeps/_workspace/src/github.com/coreos/go-etcd/etcd/shuffle.go new file mode 100644 index 000000000000..c26ddac30cf6 --- /dev/null +++ b/Godeps/_workspace/src/github.com/coreos/go-etcd/etcd/shuffle.go @@ -0,0 +1,19 @@ +package etcd + +import ( + "math/rand" +) + +func shuffleStringSlice(cards []string) []string { + size := len(cards) + //Do not need to copy if nothing changed + if size <= 1 { + return cards + } + shuffled := make([]string, size) + index := rand.Perm(size) + for i := range cards { + shuffled[index[i]] = cards[i] + } + return shuffled +} diff --git a/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/.gitignore b/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/.gitignore new file mode 100644 index 000000000000..5f6b48eae0d6 --- /dev/null +++ b/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/.gitignore @@ -0,0 +1,2 @@ +# temporary symlink for testing +testing/data/symlink diff --git a/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/.travis.yml b/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/.travis.yml index e03407b3e79b..927a999f0841 100644 --- a/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/.travis.yml +++ b/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/.travis.yml @@ -1,9 +1,9 @@ language: go sudo: false go: - - 1.3.1 - - 1.4 - - 1.5 + - 1.3.3 + - 1.4.2 + - 1.5.1 - tip env: - GOARCH=amd64 diff --git a/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/AUTHORS b/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/AUTHORS index a149a7723c82..7abd05b14c21 100644 --- a/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/AUTHORS +++ b/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/AUTHORS @@ -1,6 +1,7 @@ # This is the official list of go-dockerclient authors for copyright purposes. Adam Bell-Hanssen +Adrien Kohlbecker Aldrin Leal Andreas Jaekle Andrews Medina @@ -11,6 +12,7 @@ Ben McCann Brendan Fosberry Brian Lalor Brian Palmer +Bryan Boreham Burke Libbey Carlos Diaz-Padron Cesar Wong @@ -28,6 +30,7 @@ David Huie Dawn Chen Dinesh Subhraveti Ed +Erez Horev Eric Anderson Ewout Prangsma Fabio Rehm @@ -45,6 +48,7 @@ Jawher Moussa Jean-Baptiste Dalido Jeff Mitchell Jeffrey Hulten +Jen Andre Johan Euphrosine Kamil Domanski Karan Misra @@ -52,6 +56,7 @@ Kim, Hirokuni Kyle Allan Liron Levin Liu Peng +Lorenz Leutgeb Lucas Clemente Lucas Weiblen Mantas Matelis @@ -75,7 +80,9 @@ Rob Miller Robert Williamson Salvador Gironès Sam Rijs +Sami Wagiaalla Samuel Karp +Silas Sewell Simon Eskildsen Simon Menke Skolos diff --git a/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/README.markdown b/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/README.markdown index a124d0b45e0f..9f3c0ca1bacd 100644 --- a/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/README.markdown +++ b/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/README.markdown @@ -5,7 +5,7 @@ [![GoDoc](https://img.shields.io/badge/api-Godoc-blue.svg?style=flat-square)](https://godoc.org/github.com/fsouza/go-dockerclient) This package presents a client for the Docker remote API. It also provides -support for the extensions in the [Swarm API](https://docs.docker.com/swarm/API/). +support for the extensions in the [Swarm API](https://docs.docker.com/swarm/api/swarm-api/). This package also provides support for docker's network API, which is a simple passthrough to the libnetwork remote API. Note that docker's network API is diff --git a/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/auth.go b/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/auth.go index d2af8780c2a7..30e3af3eb7a1 100644 --- a/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/auth.go +++ b/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/auth.go @@ -127,12 +127,10 @@ func (c *Client) AuthCheck(conf *AuthConfiguration) error { if conf == nil { return fmt.Errorf("conf is nil") } - body, statusCode, err := c.do("POST", "/auth", doOptions{data: conf}) + resp, err := c.do("POST", "/auth", doOptions{data: conf}) if err != nil { return err } - if statusCode > 400 { - return fmt.Errorf("auth error (%d): %s", statusCode, body) - } + resp.Body.Close() return nil } diff --git a/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/build_test.go b/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/build_test.go index a4864db83703..c9640f20571e 100644 --- a/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/build_test.go +++ b/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/build_test.go @@ -35,6 +35,16 @@ func TestBuildImageMultipleContextsError(t *testing.T) { func TestBuildImageContextDirDockerignoreParsing(t *testing.T) { fakeRT := &FakeRoundTripper{message: "", status: http.StatusOK} client := newTestClient(fakeRT) + + if err := os.Symlink("doesnotexist", "testing/data/symlink"); err != nil { + t.Errorf("error creating symlink on demand: %s", err) + } + defer func() { + if err := os.Remove("testing/data/symlink"); err != nil { + t.Errorf("error removing symlink on demand: %s", err) + } + }() + var buf bytes.Buffer opts := BuildImageOptions{ Name: "testImage", diff --git a/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/client.go b/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/client.go index c3d86f40b8af..0129eb334f4b 100644 --- a/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/client.go +++ b/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/client.go @@ -130,6 +130,7 @@ type Client struct { SkipServerVersionCheck bool HTTPClient *http.Client TLSConfig *tls.Config + Dialer *net.Dialer endpoint string endpointURL *url.URL @@ -137,6 +138,7 @@ type Client struct { requestedAPIVersion APIVersion serverAPIVersion APIVersion expectedAPIVersion APIVersion + unixHTTPClient *http.Client } // NewClient returns a Client instance ready for communication with the given @@ -191,6 +193,7 @@ func NewVersionedClient(endpoint string, apiVersionString string) (*Client, erro } return &Client{ HTTPClient: http.DefaultClient, + Dialer: &net.Dialer{}, endpoint: endpoint, endpointURL: u, eventMonitor: new(eventMonitoringState), @@ -302,6 +305,7 @@ func NewVersionedTLSClientFromBytes(endpoint string, certPEMBlock, keyPEMBlock, return &Client{ HTTPClient: &http.Client{Transport: tr}, TLSConfig: tlsConfig, + Dialer: &net.Dialer{}, endpoint: endpoint, endpointURL: u, eventMonitor: new(eventMonitoringState), @@ -326,32 +330,40 @@ func (c *Client) checkAPIVersion() error { return nil } +// Endpoint returns the current endpoint. It's useful for getting the endpoint +// when using functions that get this data from the environment (like +// NewClientFromEnv. +func (c *Client) Endpoint() string { + return c.endpoint +} + // Ping pings the docker server // // See https://goo.gl/kQCfJj for more details. func (c *Client) Ping() error { path := "/_ping" - body, status, err := c.do("GET", path, doOptions{}) + resp, err := c.do("GET", path, doOptions{}) if err != nil { return err } - if status != http.StatusOK { - return newError(status, body) + if resp.StatusCode != http.StatusOK { + return newError(resp) } + resp.Body.Close() return nil } func (c *Client) getServerAPIVersionString() (version string, err error) { - body, status, err := c.do("GET", "/version", doOptions{}) + resp, err := c.do("GET", "/version", doOptions{}) if err != nil { return "", err } - if status != http.StatusOK { - return "", fmt.Errorf("Received unexpected status %d while trying to retrieve the server version", status) + defer resp.Body.Close() + if resp.StatusCode != http.StatusOK { + return "", fmt.Errorf("Received unexpected status %d while trying to retrieve the server version", resp.StatusCode) } var versionResponse map[string]interface{} - err = json.Unmarshal(body, &versionResponse) - if err != nil { + if err := json.NewDecoder(resp.Body).Decode(&versionResponse); err != nil { return "", err } if version, ok := (versionResponse["ApiVersion"]).(string); ok { @@ -365,24 +377,35 @@ type doOptions struct { forceJSON bool } -func (c *Client) do(method, path string, doOptions doOptions) ([]byte, int, error) { +func (c *Client) do(method, path string, doOptions doOptions) (*http.Response, error) { var params io.Reader if doOptions.data != nil || doOptions.forceJSON { buf, err := json.Marshal(doOptions.data) if err != nil { - return nil, -1, err + return nil, err } params = bytes.NewBuffer(buf) } if path != "/version" && !c.SkipServerVersionCheck && c.expectedAPIVersion == nil { err := c.checkAPIVersion() if err != nil { - return nil, -1, err + return nil, err } } - req, err := http.NewRequest(method, c.getURL(path), params) + + httpClient := c.HTTPClient + protocol := c.endpointURL.Scheme + var u string + if protocol == "unix" { + httpClient = c.unixClient() + u = c.getFakeUnixURL(path) + } else { + u = c.getURL(path) + } + + req, err := http.NewRequest(method, u, params) if err != nil { - return nil, -1, err + return nil, err } req.Header.Set("User-Agent", userAgent) if doOptions.data != nil { @@ -390,40 +413,19 @@ func (c *Client) do(method, path string, doOptions doOptions) ([]byte, int, erro } else if method == "POST" { req.Header.Set("Content-Type", "plain/text") } - var resp *http.Response - protocol := c.endpointURL.Scheme - address := c.endpointURL.Path - if protocol == "unix" { - var dial net.Conn - dial, err = net.Dial(protocol, address) - if err != nil { - return nil, -1, err - } - defer dial.Close() - breader := bufio.NewReader(dial) - err = req.Write(dial) - if err != nil { - return nil, -1, err - } - resp, err = http.ReadResponse(breader, req) - } else { - resp, err = c.HTTPClient.Do(req) - } + + resp, err := httpClient.Do(req) if err != nil { if strings.Contains(err.Error(), "connection refused") { - return nil, -1, ErrConnectionRefused + return nil, ErrConnectionRefused } - return nil, -1, err - } - defer resp.Body.Close() - body, err := ioutil.ReadAll(resp.Body) - if err != nil { - return nil, -1, err + return nil, err } + if resp.StatusCode < 200 || resp.StatusCode >= 400 { - return nil, resp.StatusCode, newError(resp.StatusCode, body) + return nil, newError(resp) } - return body, resp.StatusCode, nil + return resp, nil } type streamOptions struct { @@ -464,16 +466,12 @@ func (c *Client) stream(method, path string, streamOptions streamOptions) error address := c.endpointURL.Path if streamOptions.stdout == nil { streamOptions.stdout = ioutil.Discard - } else if t, ok := streamOptions.stdout.(io.Closer); ok { - defer t.Close() } if streamOptions.stderr == nil { streamOptions.stderr = ioutil.Discard - } else if t, ok := streamOptions.stderr.(io.Closer); ok { - defer t.Close() } if protocol == "unix" { - dial, err := net.Dial(protocol, address) + dial, err := c.Dialer.Dial(protocol, address) if err != nil { return err } @@ -509,11 +507,7 @@ func (c *Client) stream(method, path string, streamOptions streamOptions) error } defer resp.Body.Close() if resp.StatusCode < 200 || resp.StatusCode >= 400 { - body, err := ioutil.ReadAll(resp.Body) - if err != nil { - return err - } - return newError(resp.StatusCode, body) + return newError(resp) } if streamOptions.useJSONDecoder || resp.Header.Get("Content-Type") == "application/json" { // if we want to get raw json stream, just copy it back to output @@ -599,12 +593,12 @@ func (c *Client) hijack(method, path string, hijackOptions hijackOptions) error } var dial net.Conn if c.TLSConfig != nil && protocol != "unix" { - dial, err = tlsDial(protocol, address, c.TLSConfig) + dial, err = tlsDialWithDialer(c.Dialer, protocol, address, c.TLSConfig) if err != nil { return err } } else { - dial, err = net.Dial(protocol, address) + dial, err = c.Dialer.Dial(protocol, address) if err != nil { return err } @@ -666,6 +660,41 @@ func (c *Client) getURL(path string) string { return fmt.Sprintf("%s%s", urlStr, path) } +// getFakeUnixURL returns the URL needed to make an HTTP request over a UNIX +// domain socket to the given path. +func (c *Client) getFakeUnixURL(path string) string { + u := *c.endpointURL // Copy. + + // Override URL so that net/http will not complain. + u.Scheme = "http" + u.Host = "unix.sock" // Doesn't matter what this is - it's not used. + u.Path = "" + + urlStr := strings.TrimRight(u.String(), "/") + + if c.requestedAPIVersion != nil { + return fmt.Sprintf("%s/v%s%s", urlStr, c.requestedAPIVersion, path) + } + return fmt.Sprintf("%s%s", urlStr, path) +} + +func (c *Client) unixClient() *http.Client { + if c.unixHTTPClient != nil { + return c.unixHTTPClient + } + + socketPath := c.endpointURL.Path + c.unixHTTPClient = &http.Client{ + Transport: &http.Transport{ + Dial: func(network, addr string) (net.Conn, error) { + return c.Dialer.Dial("unix", socketPath) + }, + }, + } + + return c.unixHTTPClient +} + type jsonMessage struct { Status string `json:"status,omitempty"` Progress string `json:"progress,omitempty"` @@ -747,8 +776,13 @@ type Error struct { Message string } -func newError(status int, body []byte) *Error { - return &Error{Status: status, Message: string(body)} +func newError(resp *http.Response) *Error { + defer resp.Body.Close() + data, err := ioutil.ReadAll(resp.Body) + if err != nil { + return &Error{Status: resp.StatusCode, Message: fmt.Sprintf("cannot read body, err: %v", err)} + } + return &Error{Status: resp.StatusCode, Message: string(data)} } func (e *Error) Error() string { diff --git a/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/client_test.go b/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/client_test.go index c00c3d30c8e2..67230a4e15c2 100644 --- a/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/client_test.go +++ b/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/client_test.go @@ -5,6 +5,7 @@ package docker import ( + "bytes" "fmt" "io/ioutil" "net" @@ -161,6 +162,16 @@ func TestNewTLSClient(t *testing.T) { } } +func TestEndpoint(t *testing.T) { + client, err := NewVersionedClient("http://localhost:4243", "1.12") + if err != nil { + t.Fatal(err) + } + if endpoint := client.Endpoint(); endpoint != client.endpoint { + t.Errorf("Client.Endpoint(): want %q. Got %q", client.endpoint, endpoint) + } +} + func TestGetURL(t *testing.T) { var tests = []struct { endpoint string @@ -185,8 +196,34 @@ func TestGetURL(t *testing.T) { } } +func TestGetFakeUnixURL(t *testing.T) { + var tests = []struct { + endpoint string + path string + expected string + }{ + {"unix://var/run/docker.sock", "/", "http://unix.sock/"}, + {"unix://var/run/docker.socket", "/", "http://unix.sock/"}, + {"unix://var/run/docker.sock", "/containers/ps", "http://unix.sock/containers/ps"}, + } + for _, tt := range tests { + client, _ := NewClient(tt.endpoint) + client.endpoint = tt.endpoint + client.SkipServerVersionCheck = true + got := client.getFakeUnixURL(tt.path) + if got != tt.expected { + t.Errorf("getURL(%q): Got %s. Want %s.", tt.path, got, tt.expected) + } + } +} + func TestError(t *testing.T) { - err := newError(400, []byte("bad parameter")) + fakeBody := ioutil.NopCloser(bytes.NewBufferString("bad parameter")) + resp := &http.Response{ + StatusCode: 400, + Body: fakeBody, + } + err := newError(resp) expected := Error{Status: 400, Message: "bad parameter"} if !reflect.DeepEqual(expected, *err) { t.Errorf("Wrong error type. Want %#v. Got %#v.", expected, *err) @@ -334,7 +371,7 @@ func TestPingErrorWithUnixSocket(t *testing.T) { } defer li.Close() if err != nil { - t.Fatalf("Expected to get listner, but failed: %#v", err) + t.Fatalf("Expected to get listener, but failed: %#v", err) } fd, err := li.Accept() @@ -345,7 +382,7 @@ func TestPingErrorWithUnixSocket(t *testing.T) { buf := make([]byte, 512) nr, err := fd.Read(buf) - // Create invalid response message to occur error + // Create invalid response message to trigger error. data := buf[0:nr] for i := 0; i < 10; i++ { data[i] = 63 @@ -366,6 +403,7 @@ func TestPingErrorWithUnixSocket(t *testing.T) { u, _ := parseEndpoint(endpoint, false) client := Client{ HTTPClient: http.DefaultClient, + Dialer: &net.Dialer{}, endpoint: endpoint, endpointURL: u, SkipServerVersionCheck: true, diff --git a/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/container.go b/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/container.go index b74a992c0afe..faf12632f0be 100644 --- a/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/container.go +++ b/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/container.go @@ -5,7 +5,6 @@ package docker import ( - "bytes" "encoding/json" "errors" "fmt" @@ -61,13 +60,13 @@ type APIContainers struct { // See https://goo.gl/47a6tO for more details. func (c *Client) ListContainers(opts ListContainersOptions) ([]APIContainers, error) { path := "/containers/json?" + queryString(opts) - body, _, err := c.do("GET", path, doOptions{}) + resp, err := c.do("GET", path, doOptions{}) if err != nil { return nil, err } + defer resp.Body.Close() var containers []APIContainers - err = json.Unmarshal(body, &containers) - if err != nil { + if err := json.NewDecoder(resp.Body).Decode(&containers); err != nil { return nil, err } return containers, nil @@ -206,6 +205,7 @@ type Config struct { DNS []string `json:"Dns,omitempty" yaml:"Dns,omitempty"` // For Docker API v1.9 and below only Image string `json:"Image,omitempty" yaml:"Image,omitempty"` Volumes map[string]struct{} `json:"Volumes,omitempty" yaml:"Volumes,omitempty"` + VolumeDriver string `json:"VolumeDriver,omitempty" yaml:"VolumeDriver,omitempty"` VolumesFrom string `json:"VolumesFrom,omitempty" yaml:"VolumesFrom,omitempty"` WorkingDir string `json:"WorkingDir,omitempty" yaml:"WorkingDir,omitempty"` MacAddress string `json:"MacAddress,omitempty" yaml:"MacAddress,omitempty"` @@ -271,13 +271,14 @@ type Container struct { NetworkSettings *NetworkSettings `json:"NetworkSettings,omitempty" yaml:"NetworkSettings,omitempty"` - SysInitPath string `json:"SysInitPath,omitempty" yaml:"SysInitPath,omitempty"` - ResolvConfPath string `json:"ResolvConfPath,omitempty" yaml:"ResolvConfPath,omitempty"` - HostnamePath string `json:"HostnamePath,omitempty" yaml:"HostnamePath,omitempty"` - HostsPath string `json:"HostsPath,omitempty" yaml:"HostsPath,omitempty"` - LogPath string `json:"LogPath,omitempty" yaml:"LogPath,omitempty"` - Name string `json:"Name,omitempty" yaml:"Name,omitempty"` - Driver string `json:"Driver,omitempty" yaml:"Driver,omitempty"` + SysInitPath string `json:"SysInitPath,omitempty" yaml:"SysInitPath,omitempty"` + ResolvConfPath string `json:"ResolvConfPath,omitempty" yaml:"ResolvConfPath,omitempty"` + HostnamePath string `json:"HostnamePath,omitempty" yaml:"HostnamePath,omitempty"` + HostsPath string `json:"HostsPath,omitempty" yaml:"HostsPath,omitempty"` + LogPath string `json:"LogPath,omitempty" yaml:"LogPath,omitempty"` + Name string `json:"Name,omitempty" yaml:"Name,omitempty"` + Driver string `json:"Driver,omitempty" yaml:"Driver,omitempty"` + Mounts []Mount `json:"Mounts,omitempty" yaml:"Mounts,omitempty"` Volumes map[string]string `json:"Volumes,omitempty" yaml:"Volumes,omitempty"` VolumesRW map[string]bool `json:"VolumesRW,omitempty" yaml:"VolumesRW,omitempty"` @@ -304,8 +305,12 @@ type RenameContainerOptions struct { // // See https://goo.gl/laSOIy for more details. func (c *Client) RenameContainer(opts RenameContainerOptions) error { - _, _, err := c.do("POST", fmt.Sprintf("/containers/"+opts.ID+"/rename?%s", queryString(opts)), doOptions{}) - return err + resp, err := c.do("POST", fmt.Sprintf("/containers/"+opts.ID+"/rename?%s", queryString(opts)), doOptions{}) + if err != nil { + return err + } + resp.Body.Close() + return nil } // InspectContainer returns information about a container by its ID. @@ -313,16 +318,16 @@ func (c *Client) RenameContainer(opts RenameContainerOptions) error { // See https://goo.gl/RdIq0b for more details. func (c *Client) InspectContainer(id string) (*Container, error) { path := "/containers/" + id + "/json" - body, status, err := c.do("GET", path, doOptions{}) - if status == http.StatusNotFound { - return nil, &NoSuchContainer{ID: id} - } + resp, err := c.do("GET", path, doOptions{}) if err != nil { + if e, ok := err.(*Error); ok && e.Status == http.StatusNotFound { + return nil, &NoSuchContainer{ID: id} + } return nil, err } + defer resp.Body.Close() var container Container - err = json.Unmarshal(body, &container) - if err != nil { + if err := json.NewDecoder(resp.Body).Decode(&container); err != nil { return nil, err } return &container, nil @@ -333,16 +338,16 @@ func (c *Client) InspectContainer(id string) (*Container, error) { // See https://goo.gl/9GsTIF for more details. func (c *Client) ContainerChanges(id string) ([]Change, error) { path := "/containers/" + id + "/changes" - body, status, err := c.do("GET", path, doOptions{}) - if status == http.StatusNotFound { - return nil, &NoSuchContainer{ID: id} - } + resp, err := c.do("GET", path, doOptions{}) if err != nil { + if e, ok := err.(*Error); ok && e.Status == http.StatusNotFound { + return nil, &NoSuchContainer{ID: id} + } return nil, err } + defer resp.Body.Close() var changes []Change - err = json.Unmarshal(body, &changes) - if err != nil { + if err := json.NewDecoder(resp.Body).Decode(&changes); err != nil { return nil, err } return changes, nil @@ -363,7 +368,7 @@ type CreateContainerOptions struct { // See https://goo.gl/WxQzrr for more details. func (c *Client) CreateContainer(opts CreateContainerOptions) (*Container, error) { path := "/containers/create?" + queryString(opts) - body, status, err := c.do( + resp, err := c.do( "POST", path, doOptions{ @@ -377,18 +382,21 @@ func (c *Client) CreateContainer(opts CreateContainerOptions) (*Container, error }, ) - if status == http.StatusNotFound { - return nil, ErrNoSuchImage - } - if status == http.StatusConflict { - return nil, ErrContainerAlreadyExists + if e, ok := err.(*Error); ok { + if e.Status == http.StatusNotFound { + return nil, ErrNoSuchImage + } + if e.Status == http.StatusConflict { + return nil, ErrContainerAlreadyExists + } } + if err != nil { return nil, err } + defer resp.Body.Close() var container Container - err = json.Unmarshal(body, &container) - if err != nil { + if err := json.NewDecoder(resp.Body).Decode(&container); err != nil { return nil, err } @@ -449,6 +457,7 @@ type HostConfig struct { Binds []string `json:"Binds,omitempty" yaml:"Binds,omitempty"` CapAdd []string `json:"CapAdd,omitempty" yaml:"CapAdd,omitempty"` CapDrop []string `json:"CapDrop,omitempty" yaml:"CapDrop,omitempty"` + GroupAdd []string `json:"GroupAdd,omitempty" yaml:"GroupAdd,omitempty"` ContainerIDFile string `json:"ContainerIDFile,omitempty" yaml:"ContainerIDFile,omitempty"` LxcConf []KeyValuePair `json:"LxcConf,omitempty" yaml:"LxcConf,omitempty"` Privileged bool `json:"Privileged,omitempty" yaml:"Privileged,omitempty"` @@ -488,16 +497,17 @@ type HostConfig struct { // See https://goo.gl/MrBAJv for more details. func (c *Client) StartContainer(id string, hostConfig *HostConfig) error { path := "/containers/" + id + "/start" - _, status, err := c.do("POST", path, doOptions{data: hostConfig, forceJSON: true}) - if status == http.StatusNotFound { - return &NoSuchContainer{ID: id, Err: err} - } - if status == http.StatusNotModified { - return &ContainerAlreadyRunning{ID: id} - } + resp, err := c.do("POST", path, doOptions{data: hostConfig, forceJSON: true}) if err != nil { + if e, ok := err.(*Error); ok && e.Status == http.StatusNotFound { + return &NoSuchContainer{ID: id, Err: err} + } return err } + if resp.StatusCode == http.StatusNotModified { + return &ContainerAlreadyRunning{ID: id} + } + resp.Body.Close() return nil } @@ -507,16 +517,17 @@ func (c *Client) StartContainer(id string, hostConfig *HostConfig) error { // See https://goo.gl/USqsFt for more details. func (c *Client) StopContainer(id string, timeout uint) error { path := fmt.Sprintf("/containers/%s/stop?t=%d", id, timeout) - _, status, err := c.do("POST", path, doOptions{}) - if status == http.StatusNotFound { - return &NoSuchContainer{ID: id} - } - if status == http.StatusNotModified { - return &ContainerNotRunning{ID: id} - } + resp, err := c.do("POST", path, doOptions{}) if err != nil { + if e, ok := err.(*Error); ok && e.Status == http.StatusNotFound { + return &NoSuchContainer{ID: id} + } return err } + if resp.StatusCode == http.StatusNotModified { + return &ContainerNotRunning{ID: id} + } + resp.Body.Close() return nil } @@ -526,13 +537,14 @@ func (c *Client) StopContainer(id string, timeout uint) error { // See https://goo.gl/QzsDnz for more details. func (c *Client) RestartContainer(id string, timeout uint) error { path := fmt.Sprintf("/containers/%s/restart?t=%d", id, timeout) - _, status, err := c.do("POST", path, doOptions{}) - if status == http.StatusNotFound { - return &NoSuchContainer{ID: id} - } + resp, err := c.do("POST", path, doOptions{}) if err != nil { + if e, ok := err.(*Error); ok && e.Status == http.StatusNotFound { + return &NoSuchContainer{ID: id} + } return err } + resp.Body.Close() return nil } @@ -541,13 +553,14 @@ func (c *Client) RestartContainer(id string, timeout uint) error { // See https://goo.gl/OF7W9X for more details. func (c *Client) PauseContainer(id string) error { path := fmt.Sprintf("/containers/%s/pause", id) - _, status, err := c.do("POST", path, doOptions{}) - if status == http.StatusNotFound { - return &NoSuchContainer{ID: id} - } + resp, err := c.do("POST", path, doOptions{}) if err != nil { + if e, ok := err.(*Error); ok && e.Status == http.StatusNotFound { + return &NoSuchContainer{ID: id} + } return err } + resp.Body.Close() return nil } @@ -556,13 +569,14 @@ func (c *Client) PauseContainer(id string) error { // See https://goo.gl/7dwyPA for more details. func (c *Client) UnpauseContainer(id string) error { path := fmt.Sprintf("/containers/%s/unpause", id) - _, status, err := c.do("POST", path, doOptions{}) - if status == http.StatusNotFound { - return &NoSuchContainer{ID: id} - } + resp, err := c.do("POST", path, doOptions{}) if err != nil { + if e, ok := err.(*Error); ok && e.Status == http.StatusNotFound { + return &NoSuchContainer{ID: id} + } return err } + resp.Body.Close() return nil } @@ -585,15 +599,15 @@ func (c *Client) TopContainer(id string, psArgs string) (TopResult, error) { args = fmt.Sprintf("?ps_args=%s", psArgs) } path := fmt.Sprintf("/containers/%s/top%s", id, args) - body, status, err := c.do("GET", path, doOptions{}) - if status == http.StatusNotFound { - return result, &NoSuchContainer{ID: id} - } + resp, err := c.do("GET", path, doOptions{}) if err != nil { + if e, ok := err.(*Error); ok && e.Status == http.StatusNotFound { + return result, &NoSuchContainer{ID: id} + } return result, err } - err = json.Unmarshal(body, &result) - if err != nil { + defer resp.Body.Close() + if err := json.NewDecoder(resp.Body).Decode(&result); err != nil { return result, err } return result, nil @@ -768,7 +782,7 @@ func (c *Client) Stats(opts StatsOptions) (retErr error) { decoder := json.NewDecoder(readCloser) stats := new(Stats) - for err := decoder.Decode(&stats); err != io.EOF; err = decoder.Decode(stats) { + for err := decoder.Decode(stats); err != io.EOF; err = decoder.Decode(stats) { if err != nil { return err } @@ -797,13 +811,14 @@ type KillContainerOptions struct { // See https://goo.gl/hkS9i8 for more details. func (c *Client) KillContainer(opts KillContainerOptions) error { path := "/containers/" + opts.ID + "/kill" + "?" + queryString(opts) - _, status, err := c.do("POST", path, doOptions{}) - if status == http.StatusNotFound { - return &NoSuchContainer{ID: opts.ID} - } + resp, err := c.do("POST", path, doOptions{}) if err != nil { + if e, ok := err.(*Error); ok && e.Status == http.StatusNotFound { + return &NoSuchContainer{ID: opts.ID} + } return err } + resp.Body.Close() return nil } @@ -828,43 +843,86 @@ type RemoveContainerOptions struct { // See https://goo.gl/RQyX62 for more details. func (c *Client) RemoveContainer(opts RemoveContainerOptions) error { path := "/containers/" + opts.ID + "?" + queryString(opts) - _, status, err := c.do("DELETE", path, doOptions{}) - if status == http.StatusNotFound { - return &NoSuchContainer{ID: opts.ID} - } + resp, err := c.do("DELETE", path, doOptions{}) if err != nil { + if e, ok := err.(*Error); ok && e.Status == http.StatusNotFound { + return &NoSuchContainer{ID: opts.ID} + } return err } + resp.Body.Close() return nil } -// CopyFromContainerOptions is the set of options that can be used when copying -// files or folders from a container. +// UploadToContainerOptions is the set of options that can be used when +// uploading an archive into a container. +// +// See https://goo.gl/Ss97HW for more details. +type UploadToContainerOptions struct { + InputStream io.Reader `json:"-" qs:"-"` + Path string `qs:"path"` + NoOverwriteDirNonDir bool `qs:"noOverwriteDirNonDir"` +} + +// UploadToContainer uploads a tar archive to be extracted to a path in the +// filesystem of the container. +// +// See https://goo.gl/Ss97HW for more details. +func (c *Client) UploadToContainer(id string, opts UploadToContainerOptions) error { + url := fmt.Sprintf("/containers/%s/archive?", id) + queryString(opts) + + return c.stream("PUT", url, streamOptions{ + in: opts.InputStream, + }) +} + +// DownloadFromContainerOptions is the set of options that can be used when +// downloading resources from a container. +// +// See https://goo.gl/KnZJDX for more details. +type DownloadFromContainerOptions struct { + OutputStream io.Writer `json:"-" qs:"-"` + Path string `qs:"path"` +} + +// DownloadFromContainer downloads a tar archive of files or folders in a container. +// +// See https://goo.gl/KnZJDX for more details. +func (c *Client) DownloadFromContainer(id string, opts DownloadFromContainerOptions) error { + url := fmt.Sprintf("/containers/%s/archive?", id) + queryString(opts) + + return c.stream("GET", url, streamOptions{ + setRawTerminal: true, + stdout: opts.OutputStream, + }) +} + +// CopyFromContainerOptions has been DEPRECATED, please use DownloadFromContainerOptions along with DownloadFromContainer. // -// See https://goo.gl/4L7b07 for more details. +// See https://goo.gl/R2jevW for more details. type CopyFromContainerOptions struct { OutputStream io.Writer `json:"-"` Container string `json:"-"` Resource string } -// CopyFromContainer copy files or folders from a container, using a given -// resource. +// CopyFromContainer has been DEPRECATED, please use DownloadFromContainerOptions along with DownloadFromContainer. // -// See https://goo.gl/4L7b07 for more details. +// See https://goo.gl/R2jevW for more details. func (c *Client) CopyFromContainer(opts CopyFromContainerOptions) error { if opts.Container == "" { return &NoSuchContainer{ID: opts.Container} } url := fmt.Sprintf("/containers/%s/copy", opts.Container) - body, status, err := c.do("POST", url, doOptions{data: opts}) - if status == http.StatusNotFound { - return &NoSuchContainer{ID: opts.Container} - } + resp, err := c.do("POST", url, doOptions{data: opts}) if err != nil { + if e, ok := err.(*Error); ok && e.Status == http.StatusNotFound { + return &NoSuchContainer{ID: opts.Container} + } return err } - _, err = io.Copy(opts.OutputStream, bytes.NewBuffer(body)) + defer resp.Body.Close() + _, err = io.Copy(opts.OutputStream, resp.Body) return err } @@ -873,16 +931,16 @@ func (c *Client) CopyFromContainer(opts CopyFromContainerOptions) error { // // See https://goo.gl/Gc1rge for more details. func (c *Client) WaitContainer(id string) (int, error) { - body, status, err := c.do("POST", "/containers/"+id+"/wait", doOptions{}) - if status == http.StatusNotFound { - return 0, &NoSuchContainer{ID: id} - } + resp, err := c.do("POST", "/containers/"+id+"/wait", doOptions{}) if err != nil { + if e, ok := err.(*Error); ok && e.Status == http.StatusNotFound { + return 0, &NoSuchContainer{ID: id} + } return 0, err } + defer resp.Body.Close() var r struct{ StatusCode int } - err = json.Unmarshal(body, &r) - if err != nil { + if err := json.NewDecoder(resp.Body).Decode(&r); err != nil { return 0, err } return r.StatusCode, nil @@ -905,16 +963,16 @@ type CommitContainerOptions struct { // See https://goo.gl/mqfoCw for more details. func (c *Client) CommitContainer(opts CommitContainerOptions) (*Image, error) { path := "/commit?" + queryString(opts) - body, status, err := c.do("POST", path, doOptions{data: opts.Run}) - if status == http.StatusNotFound { - return nil, &NoSuchContainer{ID: opts.Container} - } + resp, err := c.do("POST", path, doOptions{data: opts.Run}) if err != nil { + if e, ok := err.(*Error); ok && e.Status == http.StatusNotFound { + return nil, &NoSuchContainer{ID: opts.Container} + } return nil, err } + defer resp.Body.Close() var image Image - err = json.Unmarshal(body, &image) - if err != nil { + if err := json.NewDecoder(resp.Body).Decode(&image); err != nil { return nil, err } return &image, nil @@ -1017,8 +1075,12 @@ func (c *Client) ResizeContainerTTY(id string, height, width int) error { params := make(url.Values) params.Set("h", strconv.Itoa(height)) params.Set("w", strconv.Itoa(width)) - _, _, err := c.do("POST", "/containers/"+id+"/resize?"+params.Encode(), doOptions{}) - return err + resp, err := c.do("POST", "/containers/"+id+"/resize?"+params.Encode(), doOptions{}) + if err != nil { + return err + } + resp.Body.Close() + return nil } // ExportContainerOptions is the set of parameters to the ExportContainer diff --git a/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/container_test.go b/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/container_test.go index d9dbea86fdbf..ea7fad2f6f7d 100644 --- a/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/container_test.go +++ b/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/container_test.go @@ -238,7 +238,8 @@ func TestInspectContainer(t *testing.T) { "PublishAllPorts": false, "CgroupParent": "/mesos", "Memory": 17179869184, - "MemorySwap": 34359738368 + "MemorySwap": 34359738368, + "GroupAdd": ["fake", "12345"] } }` var expected Container @@ -1371,6 +1372,7 @@ func TestExportContainerViaUnixSocket(t *testing.T) { u, _ := parseEndpoint(endpoint, false) client := Client{ HTTPClient: http.DefaultClient, + Dialer: &net.Dialer{}, endpoint: endpoint, endpointURL: u, SkipServerVersionCheck: true, @@ -1426,17 +1428,60 @@ func TestExportContainerNoId(t *testing.T) { } } +func TestUploadToContainer(t *testing.T) { + content := "File content" + in := stdinMock{bytes.NewBufferString(content)} + fakeRT := &FakeRoundTripper{status: http.StatusOK} + client := newTestClient(fakeRT) + opts := UploadToContainerOptions{ + Path: "abc", + InputStream: in, + } + err := client.UploadToContainer("a123456", opts) + if err != nil { + t.Errorf("UploadToContainer: caught error %#v while uploading archive to container, expected nil", err) + } + + req := fakeRT.requests[0] + + if req.Method != "PUT" { + t.Errorf("UploadToContainer{Path:abc}: Wrong HTTP method. Want PUT. Got %s", req.Method) + } + + if pathParam := req.URL.Query().Get("path"); pathParam != "abc" { + t.Errorf("ListImages({Path:abc}): Wrong parameter. Want path=abc. Got path=%s", pathParam) + } + +} + +func TestDownloadFromContainer(t *testing.T) { + filecontent := "File content" + client := newTestClient(&FakeRoundTripper{message: filecontent, status: http.StatusOK}) + + var out bytes.Buffer + opts := DownloadFromContainerOptions{ + OutputStream: &out, + } + err := client.DownloadFromContainer("a123456", opts) + if err != nil { + t.Errorf("DownloadFromContainer: caught error %#v while downloading from container, expected nil", err.Error()) + } + if out.String() != filecontent { + t.Errorf("DownloadFromContainer: wrong stdout. Want %#v. Got %#v.", filecontent, out.String()) + } +} + func TestCopyFromContainer(t *testing.T) { content := "File content" out := stdoutMock{bytes.NewBufferString(content)} client := newTestClient(&FakeRoundTripper{status: http.StatusOK}) opts := CopyFromContainerOptions{ Container: "a123456", - OutputStream: out, + OutputStream: &out, } err := client.CopyFromContainer(opts) if err != nil { - t.Errorf("CopyFromContainer: caugh error %#v while copying from container, expected nil", err.Error()) + t.Errorf("CopyFromContainer: caught error %#v while copying from container, expected nil", err.Error()) } if out.String() != content { t.Errorf("CopyFromContainer: wrong stdout. Want %#v. Got %#v.", content, out.String()) @@ -1584,7 +1629,6 @@ func TestTopContainerWithPsArgs(t *testing.T) { } func TestStatsTimeout(t *testing.T) { - l, err := net.Listen("unix", "/tmp/docker_test.sock") if err != nil { t.Fatal(err) @@ -1594,7 +1638,7 @@ func TestStatsTimeout(t *testing.T) { go func() { l.Accept() received = true - time.Sleep(time.Millisecond * 250) + time.Sleep(time.Second) }() client, _ := NewClient("unix:///tmp/docker_test.sock") client.SkipServerVersionCheck = true diff --git a/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/event.go b/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/event.go index 5a85983cc896..eaffddb825fc 100644 --- a/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/event.go +++ b/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/event.go @@ -5,7 +5,6 @@ package docker import ( - "crypto/tls" "encoding/json" "errors" "fmt" @@ -260,9 +259,9 @@ func (c *Client) eventHijack(startTime int64, eventChan chan *APIEvents, errChan var dial net.Conn var err error if c.TLSConfig == nil { - dial, err = net.Dial(protocol, address) + dial, err = c.Dialer.Dial(protocol, address) } else { - dial, err = tls.Dial(protocol, address, c.TLSConfig) + dial, err = tlsDialWithDialer(c.Dialer, protocol, address, c.TLSConfig) } if err != nil { return err diff --git a/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/exec.go b/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/exec.go index 84047f04efb2..f3b705fa0a73 100644 --- a/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/exec.go +++ b/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/exec.go @@ -38,16 +38,16 @@ type CreateExecOptions struct { // See https://goo.gl/1KSIb7 for more details func (c *Client) CreateExec(opts CreateExecOptions) (*Exec, error) { path := fmt.Sprintf("/containers/%s/exec", opts.Container) - body, status, err := c.do("POST", path, doOptions{data: opts}) - if status == http.StatusNotFound { - return nil, &NoSuchContainer{ID: opts.Container} - } + resp, err := c.do("POST", path, doOptions{data: opts}) if err != nil { + if e, ok := err.(*Error); ok && e.Status == http.StatusNotFound { + return nil, &NoSuchContainer{ID: opts.Container} + } return nil, err } + defer resp.Body.Close() var exec Exec - err = json.Unmarshal(body, &exec) - if err != nil { + if err := json.NewDecoder(resp.Body).Decode(&exec); err != nil { return nil, err } @@ -90,13 +90,14 @@ func (c *Client) StartExec(id string, opts StartExecOptions) error { path := fmt.Sprintf("/exec/%s/start", id) if opts.Detach { - _, status, err := c.do("POST", path, doOptions{data: opts}) - if status == http.StatusNotFound { - return &NoSuchExec{ID: id} - } + resp, err := c.do("POST", path, doOptions{data: opts}) if err != nil { + if e, ok := err.(*Error); ok && e.Status == http.StatusNotFound { + return &NoSuchExec{ID: id} + } return err } + defer resp.Body.Close() return nil } @@ -121,8 +122,12 @@ func (c *Client) ResizeExecTTY(id string, height, width int) error { params.Set("w", strconv.Itoa(width)) path := fmt.Sprintf("/exec/%s/resize?%s", id, params.Encode()) - _, _, err := c.do("POST", path, doOptions{}) - return err + resp, err := c.do("POST", path, doOptions{}) + if err != nil { + return err + } + resp.Body.Close() + return nil } // ExecProcessConfig is a type describing the command associated to a Exec @@ -156,16 +161,16 @@ type ExecInspect struct { // See https://goo.gl/gPtX9R for more details func (c *Client) InspectExec(id string) (*ExecInspect, error) { path := fmt.Sprintf("/exec/%s/json", id) - body, status, err := c.do("GET", path, doOptions{}) - if status == http.StatusNotFound { - return nil, &NoSuchExec{ID: id} - } + resp, err := c.do("GET", path, doOptions{}) if err != nil { + if e, ok := err.(*Error); ok && e.Status == http.StatusNotFound { + return nil, &NoSuchExec{ID: id} + } return nil, err } + defer resp.Body.Close() var exec ExecInspect - err = json.Unmarshal(body, &exec) - if err != nil { + if err := json.NewDecoder(resp.Body).Decode(&exec); err != nil { return nil, err } return &exec, nil diff --git a/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/image.go b/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/image.go index f8be846901f9..87c1e19b1e1a 100644 --- a/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/image.go +++ b/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/image.go @@ -96,13 +96,13 @@ type ListImagesOptions struct { // See https://goo.gl/xBe1u3 for more details. func (c *Client) ListImages(opts ListImagesOptions) ([]APIImages, error) { path := "/images/json?" + queryString(opts) - body, _, err := c.do("GET", path, doOptions{}) + resp, err := c.do("GET", path, doOptions{}) if err != nil { return nil, err } + defer resp.Body.Close() var images []APIImages - err = json.Unmarshal(body, &images) - if err != nil { + if err := json.NewDecoder(resp.Body).Decode(&images); err != nil { return nil, err } return images, nil @@ -122,16 +122,16 @@ type ImageHistory struct { // // See https://goo.gl/8bnTId for more details. func (c *Client) ImageHistory(name string) ([]ImageHistory, error) { - body, status, err := c.do("GET", "/images/"+name+"/history", doOptions{}) - if status == http.StatusNotFound { - return nil, ErrNoSuchImage - } + resp, err := c.do("GET", "/images/"+name+"/history", doOptions{}) if err != nil { + if e, ok := err.(*Error); ok && e.Status == http.StatusNotFound { + return nil, ErrNoSuchImage + } return nil, err } + defer resp.Body.Close() var history []ImageHistory - err = json.Unmarshal(body, &history) - if err != nil { + if err := json.NewDecoder(resp.Body).Decode(&history); err != nil { return nil, err } return history, nil @@ -141,11 +141,15 @@ func (c *Client) ImageHistory(name string) ([]ImageHistory, error) { // // See https://goo.gl/V3ZWnK for more details. func (c *Client) RemoveImage(name string) error { - _, status, err := c.do("DELETE", "/images/"+name, doOptions{}) - if status == http.StatusNotFound { - return ErrNoSuchImage + resp, err := c.do("DELETE", "/images/"+name, doOptions{}) + if err != nil { + if e, ok := err.(*Error); ok && e.Status == http.StatusNotFound { + return ErrNoSuchImage + } + return err } - return err + resp.Body.Close() + return nil } // RemoveImageOptions present the set of options available for removing an image @@ -163,37 +167,40 @@ type RemoveImageOptions struct { // See https://goo.gl/V3ZWnK for more details. func (c *Client) RemoveImageExtended(name string, opts RemoveImageOptions) error { uri := fmt.Sprintf("/images/%s?%s", name, queryString(&opts)) - _, status, err := c.do("DELETE", uri, doOptions{}) - if status == http.StatusNotFound { - return ErrNoSuchImage + resp, err := c.do("DELETE", uri, doOptions{}) + if err != nil { + if e, ok := err.(*Error); ok && e.Status == http.StatusNotFound { + return ErrNoSuchImage + } + return err } - return err + resp.Body.Close() + return nil } // InspectImage returns an image by its name or ID. // // See https://goo.gl/jHPcg6 for more details. func (c *Client) InspectImage(name string) (*Image, error) { - body, status, err := c.do("GET", "/images/"+name+"/json", doOptions{}) - if status == http.StatusNotFound { - return nil, ErrNoSuchImage - } + resp, err := c.do("GET", "/images/"+name+"/json", doOptions{}) if err != nil { + if e, ok := err.(*Error); ok && e.Status == http.StatusNotFound { + return nil, ErrNoSuchImage + } return nil, err } + defer resp.Body.Close() var image Image // if the caller elected to skip checking the server's version, assume it's the latest if c.SkipServerVersionCheck || c.expectedAPIVersion.GreaterThanOrEqualTo(apiVersion112) { - err = json.Unmarshal(body, &image) - if err != nil { + if err := json.NewDecoder(resp.Body).Decode(&image); err != nil { return nil, err } } else { var imagePre012 ImagePre012 - err = json.Unmarshal(body, &imagePre012) - if err != nil { + if err := json.NewDecoder(resp.Body).Decode(&imagePre012); err != nil { return nil, err } @@ -409,6 +416,7 @@ type BuildImageOptions struct { Auth AuthConfiguration `qs:"-"` // for older docker X-Registry-Auth header AuthConfigs AuthConfigurations `qs:"-"` // for newer docker X-Registry-Config header ContextDir string `qs:"-"` + Ulimits []ULimit `qs:"-"` } // BuildImage builds an image from a tarball's url or a Dockerfile in the input @@ -442,7 +450,16 @@ func (c *Client) BuildImage(opts BuildImageOptions) error { } } - return c.stream("POST", fmt.Sprintf("/build?%s", queryString(&opts)), streamOptions{ + qs := queryString(&opts) + if len(opts.Ulimits) > 0 { + if b, err := json.Marshal(opts.Ulimits); err == nil { + item := url.Values(map[string][]string{}) + item.Add("ulimits", string(b)) + qs = fmt.Sprintf("%s&%s", qs, item.Encode()) + } + } + + return c.stream("POST", fmt.Sprintf("/build?%s", qs), streamOptions{ setRawTerminal: true, rawJSONStream: opts.RawJSONStream, headers: headers, @@ -477,10 +494,11 @@ func (c *Client) TagImage(name string, opts TagImageOptions) error { if name == "" { return ErrNoSuchImage } - _, status, err := c.do("POST", fmt.Sprintf("/images/"+name+"/tag?%s", + resp, err := c.do("POST", fmt.Sprintf("/images/"+name+"/tag?%s", queryString(&opts)), doOptions{}) + defer resp.Body.Close() - if status == http.StatusNotFound { + if resp.StatusCode == http.StatusNotFound { return ErrNoSuchImage } @@ -533,13 +551,13 @@ type APIImageSearch struct { // // See https://goo.gl/AYjyrF for more details. func (c *Client) SearchImages(term string) ([]APIImageSearch, error) { - body, _, err := c.do("GET", "/images/search?term="+term, doOptions{}) + resp, err := c.do("GET", "/images/search?term="+term, doOptions{}) + defer resp.Body.Close() if err != nil { return nil, err } var searchResult []APIImageSearch - err = json.Unmarshal(body, &searchResult) - if err != nil { + if err := json.NewDecoder(resp.Body).Decode(&searchResult); err != nil { return nil, err } return searchResult, nil diff --git a/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/image_test.go b/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/image_test.go index bf010a2f994d..8d9ee7ae2ff3 100644 --- a/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/image_test.go +++ b/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/image_test.go @@ -9,6 +9,7 @@ import ( "encoding/base64" "encoding/json" "io/ioutil" + "net" "net/http" "net/url" "os" @@ -24,6 +25,7 @@ func newTestClient(rt *FakeRoundTripper) Client { testAPIVersion, _ := NewAPIVersion("1.17") client := Client{ HTTPClient: &http.Client{Transport: rt}, + Dialer: &net.Dialer{}, endpoint: endpoint, endpointURL: u, SkipServerVersionCheck: true, @@ -680,6 +682,7 @@ func TestBuildImageParameters(t *testing.T) { Memswap: 2048, CPUShares: 10, CPUSetCPUs: "0-3", + Ulimits: []ULimit{ULimit{Name: "nofile", Soft: 100, Hard: 200}}, InputStream: &buf, OutputStream: &buf, } @@ -699,6 +702,7 @@ func TestBuildImageParameters(t *testing.T) { "memswap": {"2048"}, "cpushares": {"10"}, "cpusetcpus": {"0-3"}, + "ulimits": {"[{\"Name\":\"nofile\",\"Soft\":100,\"Hard\":200}]"}, } got := map[string][]string(req.URL.Query()) if !reflect.DeepEqual(got, expected) { diff --git a/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/misc.go b/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/misc.go index df22cf4945bd..34c96531ad90 100644 --- a/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/misc.go +++ b/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/misc.go @@ -4,21 +4,19 @@ package docker -import ( - "bytes" - "strings" -) +import "strings" // Version returns version information about the docker server. // // See https://goo.gl/ND9R8L for more details. func (c *Client) Version() (*Env, error) { - body, _, err := c.do("GET", "/version", doOptions{}) + resp, err := c.do("GET", "/version", doOptions{}) if err != nil { return nil, err } + defer resp.Body.Close() var env Env - if err := env.Decode(bytes.NewReader(body)); err != nil { + if err := env.Decode(resp.Body); err != nil { return nil, err } return &env, nil @@ -28,13 +26,13 @@ func (c *Client) Version() (*Env, error) { // // See https://goo.gl/ElTHi2 for more details. func (c *Client) Info() (*Env, error) { - body, _, err := c.do("GET", "/info", doOptions{}) + resp, err := c.do("GET", "/info", doOptions{}) if err != nil { return nil, err } + defer resp.Body.Close() var info Env - err = info.Decode(bytes.NewReader(body)) - if err != nil { + if err := info.Decode(resp.Body); err != nil { return nil, err } return &info, nil diff --git a/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/network.go b/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/network.go index 0d3e2d43f243..e21e7dfeac9b 100644 --- a/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/network.go +++ b/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/network.go @@ -38,12 +38,13 @@ type Endpoint struct { // // See https://goo.gl/4hCNtZ for more details. func (c *Client) ListNetworks() ([]Network, error) { - body, _, err := c.do("GET", "/networks", doOptions{}) + resp, err := c.do("GET", "/networks", doOptions{}) if err != nil { return nil, err } + defer resp.Body.Close() var networks []Network - if err := json.Unmarshal(body, &networks); err != nil { + if err := json.NewDecoder(resp.Body).Decode(&networks); err != nil { return nil, err } return networks, nil @@ -54,15 +55,16 @@ func (c *Client) ListNetworks() ([]Network, error) { // See https://goo.gl/4hCNtZ for more details. func (c *Client) NetworkInfo(id string) (*Network, error) { path := "/networks/" + id - body, status, err := c.do("GET", path, doOptions{}) - if status == http.StatusNotFound { - return nil, &NoSuchNetwork{ID: id} - } + resp, err := c.do("GET", path, doOptions{}) if err != nil { + if e, ok := err.(*Error); ok && e.Status == http.StatusNotFound { + return nil, &NoSuchNetwork{ID: id} + } return nil, err } + defer resp.Body.Close() var network Network - if err := json.Unmarshal(body, &network); err != nil { + if err := json.NewDecoder(resp.Body).Decode(&network); err != nil { return nil, err } return &network, nil @@ -83,35 +85,34 @@ type CreateNetworkOptions struct { // // See http://goo.gl/mErxNp for more details. func (c *Client) CreateNetwork(opts CreateNetworkOptions) (*Network, error) { - body, status, err := c.do( + resp, err := c.do( "POST", "/networks", doOptions{ data: opts, }, ) - - if status == http.StatusConflict { - return nil, ErrNetworkAlreadyExists - } if err != nil { + if e, ok := err.(*Error); ok && e.Status == http.StatusConflict { + return nil, ErrNetworkAlreadyExists + } return nil, err } + defer resp.Body.Close() type createNetworkResponse struct { ID string } var ( network Network - resp createNetworkResponse + cnr createNetworkResponse ) - err = json.Unmarshal(body, &resp) - if err != nil { + if err := json.NewDecoder(resp.Body).Decode(&cnr); err != nil { return nil, err } network.Name = opts.Name - network.ID = resp.ID + network.ID = cnr.ID network.Type = opts.NetworkType return &network, nil diff --git a/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/testing/data/symlink b/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/testing/data/symlink deleted file mode 120000 index 3ddf86a35947..000000000000 --- a/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/testing/data/symlink +++ /dev/null @@ -1 +0,0 @@ -doesnotexist \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/testing/server.go b/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/testing/server.go index 05cd2e25bf0e..46f6b672165b 100644 --- a/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/testing/server.go +++ b/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/testing/server.go @@ -957,7 +957,7 @@ func (s *DockerServer) createExecContainer(w http.ResponseWriter, r *http.Reques func (s *DockerServer) startExecContainer(w http.ResponseWriter, r *http.Request) { id := mux.Vars(r)["id"] - if exec, err := s.getExec(id); err == nil { + if exec, err := s.getExec(id, false); err == nil { s.execMut.Lock() exec.Running = true s.execMut.Unlock() @@ -979,7 +979,7 @@ func (s *DockerServer) startExecContainer(w http.ResponseWriter, r *http.Request func (s *DockerServer) resizeExecContainer(w http.ResponseWriter, r *http.Request) { id := mux.Vars(r)["id"] - if _, err := s.getExec(id); err == nil { + if _, err := s.getExec(id, false); err == nil { w.WriteHeader(http.StatusOK) return } @@ -988,7 +988,7 @@ func (s *DockerServer) resizeExecContainer(w http.ResponseWriter, r *http.Reques func (s *DockerServer) inspectExecContainer(w http.ResponseWriter, r *http.Request) { id := mux.Vars(r)["id"] - if exec, err := s.getExec(id); err == nil { + 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) @@ -997,11 +997,15 @@ func (s *DockerServer) inspectExecContainer(w http.ResponseWriter, r *http.Reque w.WriteHeader(http.StatusNotFound) } -func (s *DockerServer) getExec(id string) (*docker.ExecInspect, error) { +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 } } diff --git a/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/tls.go b/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/tls.go index 11d571761a8c..55f43174bf05 100644 --- a/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/tls.go +++ b/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/tls.go @@ -94,7 +94,3 @@ func tlsDialWithDialer(dialer *net.Dialer, network, addr string, config *tls.Con // wrapper which holds both the TLS and raw connections. return &tlsClientCon{conn, rawConn}, nil } - -func tlsDial(network, addr string, config *tls.Config) (net.Conn, error) { - return tlsDialWithDialer(new(net.Dialer), network, addr, config) -} diff --git a/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/volume.go b/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/volume.go index 4e63272542bd..a989a6eee3d2 100644 --- a/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/volume.go +++ b/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/volume.go @@ -38,12 +38,13 @@ type ListVolumesOptions struct { // // See https://goo.gl/FZA4BK for more details. func (c *Client) ListVolumes(opts ListVolumesOptions) ([]Volume, error) { - body, _, err := c.do("GET", "/volumes?"+queryString(opts), doOptions{}) + resp, err := c.do("GET", "/volumes?"+queryString(opts), doOptions{}) if err != nil { return nil, err } + defer resp.Body.Close() m := make(map[string]interface{}) - if err := json.Unmarshal(body, &m); err != nil { + if err := json.NewDecoder(resp.Body).Decode(&m); err != nil { return nil, err } var volumes []Volume @@ -74,12 +75,13 @@ type CreateVolumeOptions struct { // // See https://goo.gl/pBUbZ9 for more details. func (c *Client) CreateVolume(opts CreateVolumeOptions) (*Volume, error) { - body, _, err := c.do("POST", "/volumes", doOptions{data: opts}) + resp, err := c.do("POST", "/volumes", doOptions{data: opts}) if err != nil { return nil, err } + defer resp.Body.Close() var volume Volume - if err := json.Unmarshal(body, &volume); err != nil { + if err := json.NewDecoder(resp.Body).Decode(&volume); err != nil { return nil, err } return &volume, nil @@ -89,15 +91,16 @@ func (c *Client) CreateVolume(opts CreateVolumeOptions) (*Volume, error) { // // See https://goo.gl/0g9A6i for more details. func (c *Client) InspectVolume(name string) (*Volume, error) { - body, status, err := c.do("GET", "/volumes/"+name, doOptions{}) - if status == http.StatusNotFound { - return nil, ErrNoSuchVolume - } + resp, err := c.do("GET", "/volumes/"+name, doOptions{}) if err != nil { + if e, ok := err.(*Error); ok && e.Status == http.StatusNotFound { + return nil, ErrNoSuchVolume + } return nil, err } + defer resp.Body.Close() var volume Volume - if err := json.Unmarshal(body, &volume); err != nil { + if err := json.NewDecoder(resp.Body).Decode(&volume); err != nil { return nil, err } return &volume, nil @@ -107,12 +110,18 @@ func (c *Client) InspectVolume(name string) (*Volume, error) { // // See https://goo.gl/79GNQz for more details. func (c *Client) RemoveVolume(name string) error { - _, status, err := c.do("DELETE", "/volumes/"+name, doOptions{}) - if status == http.StatusNotFound { - return ErrNoSuchVolume - } - if status == http.StatusConflict { - return ErrVolumeInUse + resp, err := c.do("DELETE", "/volumes/"+name, doOptions{}) + if err != nil { + if e, ok := err.(*Error); ok { + if e.Status == http.StatusNotFound { + return ErrNoSuchVolume + } + if e.Status == http.StatusConflict { + return ErrVolumeInUse + } + } + return nil } - return err + defer resp.Body.Close() + return nil } diff --git a/Godeps/_workspace/src/github.com/ghodss/yaml/.travis.yml b/Godeps/_workspace/src/github.com/ghodss/yaml/.travis.yml new file mode 100644 index 000000000000..0e9d6edc010a --- /dev/null +++ b/Godeps/_workspace/src/github.com/ghodss/yaml/.travis.yml @@ -0,0 +1,7 @@ +language: go +go: + - 1.3 + - 1.4 +script: + - go test + - go build diff --git a/Godeps/_workspace/src/github.com/ghodss/yaml/README.md b/Godeps/_workspace/src/github.com/ghodss/yaml/README.md index 2d603097fc05..f8f7e369549c 100644 --- a/Godeps/_workspace/src/github.com/ghodss/yaml/README.md +++ b/Godeps/_workspace/src/github.com/ghodss/yaml/README.md @@ -1,5 +1,7 @@ # YAML marshaling and unmarshaling support for Go +[![Build Status](https://travis-ci.org/ghodss/yaml.svg)](https://travis-ci.org/ghodss/yaml) + ## Introduction A wrapper around [go-yaml](https://github.com/go-yaml/yaml) designed to enable a better way of handling YAML when marshaling to and from structs. diff --git a/Godeps/_workspace/src/github.com/ghodss/yaml/yaml.go b/Godeps/_workspace/src/github.com/ghodss/yaml/yaml.go index 2f42d4dc6f02..c02beacb9a41 100644 --- a/Godeps/_workspace/src/github.com/ghodss/yaml/yaml.go +++ b/Godeps/_workspace/src/github.com/ghodss/yaml/yaml.go @@ -113,12 +113,11 @@ func convertToJSONableObject(yamlObj interface{}, jsonTarget *reflect.Value) (in } } - // If yamlObj is a number, check if jsonTarget is a string - if so, coerce. - // Else return normal. + // If yamlObj is a number or a boolean, check if jsonTarget is a string - + // if so, coerce. Else return normal. // If yamlObj is a map or array, find the field that each key is // unmarshaling to, and when you recurse pass the reflect.Value for that // field back into this function. - switch typedYAMLObj := yamlObj.(type) { case map[interface{}]interface{}: // JSON does not support arbitrary keys in a map, so we must convert @@ -155,14 +154,22 @@ func convertToJSONableObject(yamlObj interface{}, jsonTarget *reflect.Value) (in s = ".nan" } keyString = s + case bool: + if typedKey { + keyString = "true" + } else { + keyString = "false" + } default: return nil, fmt.Errorf("Unsupported map key of type: %s, key: %+#v, value: %+#v", reflect.TypeOf(k), k, v) } - // If jsonTarget is a struct (which it really should be), find the - // field it's going to map to. If it's not a struct, just pass nil - // - JSON conversion will error for us if it's a real issue. + // jsonTarget should be a struct or a map. If it's a struct, find + // the field it's going to map to and pass its reflect.Value. If + // it's a map, find the element type of the map and pass the + // reflect.Value created from that type. If it's neither, just pass + // nil - JSON conversion will error for us if it's a real issue. if jsonTarget != nil { t := *jsonTarget if t.Kind() == reflect.Struct { @@ -191,6 +198,15 @@ func convertToJSONableObject(yamlObj interface{}, jsonTarget *reflect.Value) (in } continue } + } else if t.Kind() == reflect.Map { + // Create a zero value of the map's element type to use as + // the JSON target. + jtv := reflect.Zero(t.Type().Elem()) + strMap[keyString], err = convertToJSONableObject(v, &jtv) + if err != nil { + return nil, err + } + continue } } strMap[keyString], err = convertToJSONableObject(v, nil) @@ -234,15 +250,21 @@ func convertToJSONableObject(yamlObj interface{}, jsonTarget *reflect.Value) (in // Based on my reading of go-yaml, it may return int, int64, // float64, or uint64. var s string - switch num := typedYAMLObj.(type) { + switch typedVal := typedYAMLObj.(type) { case int: - s = strconv.FormatInt(int64(num), 10) + s = strconv.FormatInt(int64(typedVal), 10) case int64: - s = strconv.FormatInt(num, 10) + s = strconv.FormatInt(typedVal, 10) case float64: - s = strconv.FormatFloat(num, 'g', -1, 32) + s = strconv.FormatFloat(typedVal, 'g', -1, 32) case uint64: - s = strconv.FormatUint(num, 10) + s = strconv.FormatUint(typedVal, 10) + case bool: + if typedVal { + s = "true" + } else { + s = "false" + } } if len(s) > 0 { yamlObj = interface{}(s) diff --git a/Godeps/_workspace/src/github.com/ghodss/yaml/yaml_test.go b/Godeps/_workspace/src/github.com/ghodss/yaml/yaml_test.go index cfbe0b54881e..0ae0954e9013 100644 --- a/Godeps/_workspace/src/github.com/ghodss/yaml/yaml_test.go +++ b/Godeps/_workspace/src/github.com/ghodss/yaml/yaml_test.go @@ -33,7 +33,12 @@ func TestMarshal(t *testing.T) { } type UnmarshalString struct { - A string + A string + True string +} + +type UnmarshalStringMap struct { + A map[string]string } type UnmarshalNestedString struct { @@ -56,7 +61,17 @@ type NestedSlice struct { func TestUnmarshal(t *testing.T) { y := []byte("a: 1") s1 := UnmarshalString{} - e1 := UnmarshalString{"1"} + e1 := UnmarshalString{A: "1"} + unmarshal(t, y, &s1, &e1) + + y = []byte("a: true") + s1 = UnmarshalString{} + e1 = UnmarshalString{A: "true"} + unmarshal(t, y, &s1, &e1) + + y = []byte("true: 1") + s1 = UnmarshalString{} + e1 = UnmarshalString{True: "1"} unmarshal(t, y, &s1, &e1) y = []byte("a:\n a: 1") @@ -68,6 +83,11 @@ func TestUnmarshal(t *testing.T) { s3 := UnmarshalSlice{} e3 := UnmarshalSlice{[]NestedSlice{NestedSlice{"abc", strPtr("def")}, NestedSlice{"123", strPtr("456")}}} unmarshal(t, y, &s3, &e3) + + y = []byte("a:\n b: 1") + s4 := UnmarshalStringMap{} + e4 := UnmarshalStringMap{map[string]string{"b": "1"}} + unmarshal(t, y, &s4, &e4) } func unmarshal(t *testing.T, y []byte, s, e interface{}) { diff --git a/Godeps/_workspace/src/github.com/gogo/protobuf/proto/all_test.go b/Godeps/_workspace/src/github.com/gogo/protobuf/proto/all_test.go index 88c506cf0afc..5f27645ec072 100644 --- a/Godeps/_workspace/src/github.com/gogo/protobuf/proto/all_test.go +++ b/Godeps/_workspace/src/github.com/gogo/protobuf/proto/all_test.go @@ -1958,6 +1958,58 @@ func TestMapFieldWithNil(t *testing.T) { } } +func TestOneof(t *testing.T) { + m := &Communique{} + b, err := Marshal(m) + if err != nil { + t.Fatalf("Marshal of empty message with oneof: %v", err) + } + if len(b) != 0 { + t.Errorf("Marshal of empty message yielded too many bytes: %v", b) + } + + m = &Communique{ + Union: &Communique_Name{"Barry"}, + } + + // Round-trip. + b, err = Marshal(m) + if err != nil { + t.Fatalf("Marshal of message with oneof: %v", err) + } + if len(b) != 7 { // name tag/wire (1) + name len (1) + name (5) + t.Errorf("Incorrect marshal of message with oneof: %v", b) + } + m.Reset() + if err := Unmarshal(b, m); err != nil { + t.Fatalf("Unmarshal of message with oneof: %v", err) + } + if x, ok := m.Union.(*Communique_Name); !ok || x.Name != "Barry" { + t.Errorf("After round trip, Union = %+v", m.Union) + } + if name := m.GetName(); name != "Barry" { + t.Errorf("After round trip, GetName = %q, want %q", name, "Barry") + } + + // Let's try with a message in the oneof. + m.Union = &Communique_Msg{&Strings{StringField: String("deep deep string")}} + b, err = Marshal(m) + if err != nil { + t.Fatalf("Marshal of message with oneof set to message: %v", err) + } + if len(b) != 20 { // msg tag/wire (1) + msg len (1) + msg (1 + 1 + 16) + t.Errorf("Incorrect marshal of message with oneof set to message: %v", b) + } + m.Reset() + if err := Unmarshal(b, m); err != nil { + t.Fatalf("Unmarshal of message with oneof set to message: %v", err) + } + ss, ok := m.Union.(*Communique_Msg) + if !ok || ss.Msg.GetStringField() != "deep deep string" { + t.Errorf("After round trip with oneof set to message, Union = %+v", m.Union) + } +} + // Benchmarks func testMsg() *GoTest { diff --git a/Godeps/_workspace/src/github.com/gogo/protobuf/proto/clone.go b/Godeps/_workspace/src/github.com/gogo/protobuf/proto/clone.go index 57297947beb2..4ff1ff59e714 100644 --- a/Godeps/_workspace/src/github.com/gogo/protobuf/proto/clone.go +++ b/Godeps/_workspace/src/github.com/gogo/protobuf/proto/clone.go @@ -125,6 +125,17 @@ func mergeAny(out, in reflect.Value, viaPtr bool, prop *Properties) { return } out.Set(in) + case reflect.Interface: + // Probably a oneof field; copy non-nil values. + if in.IsNil() { + return + } + // Allocate destination if it is not set, or set to a different type. + // Otherwise we will merge as normal. + if out.IsNil() || out.Elem().Type() != in.Elem().Type() { + out.Set(reflect.New(in.Elem().Elem().Type())) // interface -> *T -> T -> new(T) + } + mergeAny(out.Elem(), in.Elem(), false, nil) case reflect.Map: if in.Len() == 0 { return diff --git a/Godeps/_workspace/src/github.com/gogo/protobuf/proto/clone_test.go b/Godeps/_workspace/src/github.com/gogo/protobuf/proto/clone_test.go index 7eef89ee09e1..f065210b8941 100644 --- a/Godeps/_workspace/src/github.com/gogo/protobuf/proto/clone_test.go +++ b/Godeps/_workspace/src/github.com/gogo/protobuf/proto/clone_test.go @@ -232,6 +232,28 @@ var mergeTests = []struct { Data: []byte("texas!"), }, }, + // Oneof fields should merge by assignment. + { + src: &pb.Communique{ + Union: &pb.Communique_Number{Number: 41}, + }, + dst: &pb.Communique{ + Union: &pb.Communique_Name{Name: "Bobby Tables"}, + }, + want: &pb.Communique{ + Union: &pb.Communique_Number{Number: 41}, + }, + }, + // Oneof nil is the same as not set. + { + src: &pb.Communique{}, + dst: &pb.Communique{ + Union: &pb.Communique_Name{Name: "Bobby Tables"}, + }, + want: &pb.Communique{ + Union: &pb.Communique_Name{Name: "Bobby Tables"}, + }, + }, } func TestMerge(t *testing.T) { diff --git a/Godeps/_workspace/src/github.com/gogo/protobuf/proto/decode.go b/Godeps/_workspace/src/github.com/gogo/protobuf/proto/decode.go index f7b1884b3cb3..34258942aeee 100644 --- a/Godeps/_workspace/src/github.com/gogo/protobuf/proto/decode.go +++ b/Godeps/_workspace/src/github.com/gogo/protobuf/proto/decode.go @@ -46,6 +46,10 @@ import ( // errOverflow is returned when an integer is too large to be represented. var errOverflow = errors.New("proto: integer overflow") +// ErrInternalBadWireType is returned by generated code when an incorrect +// wire type is encountered. It does not get returned to user code. +var ErrInternalBadWireType = errors.New("proto: internal error: bad wiretype for oneof") + // The fundamental decoders that interpret bytes on the wire. // Those that take integer types all return uint64 and are // therefore of type valueDecoder. @@ -314,6 +318,24 @@ func UnmarshalMerge(buf []byte, pb Message) error { return NewBuffer(buf).Unmarshal(pb) } +// DecodeMessage reads a count-delimited message from the Buffer. +func (p *Buffer) DecodeMessage(pb Message) error { + enc, err := p.DecodeRawBytes(false) + if err != nil { + return err + } + return NewBuffer(enc).Unmarshal(pb) +} + +// DecodeGroup reads a tag-delimited group from the Buffer. +func (p *Buffer) DecodeGroup(pb Message) error { + typ, base, err := getbase(pb) + if err != nil { + return err + } + return p.unmarshalType(typ.Elem(), GetProperties(typ.Elem()), true, base) +} + // Unmarshal parses the protocol buffer representation in the // Buffer and places the decoded result in pb. If the struct // underlying pb does not match the data in the buffer, the results can be @@ -370,11 +392,11 @@ func (o *Buffer) unmarshalType(st reflect.Type, prop *StructProperties, is_group if prop.extendable { if e := structPointer_Interface(base, st).(extendableProto); isExtensionField(e, int32(tag)) { if err = o.skip(st, tag, wire); err == nil { - if ee, ok := e.(extensionsMap); ok { + if ee, eok := e.(extensionsMap); eok { ext := ee.ExtensionMap()[int32(tag)] // may be missing ext.enc = append(ext.enc, o.buf[oi:o.index]...) ee.ExtensionMap()[int32(tag)] = ext - } else if ee, ok := e.(extensionsBytes); ok { + } else if ee, eok := e.(extensionsBytes); eok { ext := ee.GetExtensions() *ext = append(*ext, o.buf[oi:o.index]...) } @@ -382,6 +404,20 @@ func (o *Buffer) unmarshalType(st reflect.Type, prop *StructProperties, is_group continue } } + // Maybe it's a oneof? + if prop.oneofUnmarshaler != nil { + m := structPointer_Interface(base, st).(Message) + // First return value indicates whether tag is a oneof field. + ok, err = prop.oneofUnmarshaler(m, tag, wire, o) + if err == ErrInternalBadWireType { + // Map the error to something more descriptive. + // Do the formatting here to save generated code space. + err = fmt.Errorf("bad wiretype for oneof field in %T", m) + } + if ok { + continue + } + } err = o.skipAndSave(st, tag, wire, base, prop.unrecField) continue } diff --git a/Godeps/_workspace/src/github.com/gogo/protobuf/proto/encode.go b/Godeps/_workspace/src/github.com/gogo/protobuf/proto/encode.go index 91f3f0784d2c..89d0caa8268f 100644 --- a/Godeps/_workspace/src/github.com/gogo/protobuf/proto/encode.go +++ b/Godeps/_workspace/src/github.com/gogo/protobuf/proto/encode.go @@ -228,6 +228,20 @@ func Marshal(pb Message) ([]byte, error) { return p.buf, err } +// EncodeMessage writes the protocol buffer to the Buffer, +// prefixed by a varint-encoded length. +func (p *Buffer) EncodeMessage(pb Message) error { + t, base, err := getbase(pb) + if structPointer_IsNil(base) { + return ErrNil + } + if err == nil { + var state errorState + err = p.enc_len_struct(GetProperties(t.Elem()), base, &state) + } + return err +} + // Marshal takes the protocol buffer // and encodes it into the wire format, writing the result to the // Buffer. @@ -318,7 +332,7 @@ func size_bool(p *Properties, base structPointer) int { func size_proto3_bool(p *Properties, base structPointer) int { v := *structPointer_BoolVal(base, p.field) - if !v { + if !v && !p.oneof { return 0 } return len(p.tagcode) + 1 // each bool takes exactly one byte @@ -361,7 +375,7 @@ func size_int32(p *Properties, base structPointer) (n int) { func size_proto3_int32(p *Properties, base structPointer) (n int) { v := structPointer_Word32Val(base, p.field) x := int32(word32Val_Get(v)) // permit sign extension to use full 64-bit range - if x == 0 { + if x == 0 && !p.oneof { return 0 } n += len(p.tagcode) @@ -407,7 +421,7 @@ func size_uint32(p *Properties, base structPointer) (n int) { func size_proto3_uint32(p *Properties, base structPointer) (n int) { v := structPointer_Word32Val(base, p.field) x := word32Val_Get(v) - if x == 0 { + if x == 0 && !p.oneof { return 0 } n += len(p.tagcode) @@ -452,7 +466,7 @@ func size_int64(p *Properties, base structPointer) (n int) { func size_proto3_int64(p *Properties, base structPointer) (n int) { v := structPointer_Word64Val(base, p.field) x := word64Val_Get(v) - if x == 0 { + if x == 0 && !p.oneof { return 0 } n += len(p.tagcode) @@ -495,7 +509,7 @@ func size_string(p *Properties, base structPointer) (n int) { func size_proto3_string(p *Properties, base structPointer) (n int) { v := *structPointer_StringVal(base, p.field) - if v == "" { + if v == "" && !p.oneof { return 0 } n += len(p.tagcode) @@ -667,7 +681,7 @@ func (o *Buffer) enc_proto3_slice_byte(p *Properties, base structPointer) error func size_slice_byte(p *Properties, base structPointer) (n int) { s := *structPointer_Bytes(base, p.field) - if s == nil { + if s == nil && !p.oneof { return 0 } n += len(p.tagcode) @@ -677,7 +691,7 @@ func size_slice_byte(p *Properties, base structPointer) (n int) { func size_proto3_slice_byte(p *Properties, base structPointer) (n int) { s := *structPointer_Bytes(base, p.field) - if len(s) == 0 { + if len(s) == 0 && !p.oneof { return 0 } n += len(p.tagcode) @@ -1201,6 +1215,14 @@ func (o *Buffer) enc_struct(prop *StructProperties, base structPointer) error { } } + // Do oneof fields. + if prop.oneofMarshaler != nil { + m := structPointer_Interface(base, prop.stype).(Message) + if err := prop.oneofMarshaler(m, o); err != nil { + return err + } + } + // Add unrecognized fields at the end. if prop.unrecField.IsValid() { v := *structPointer_Bytes(base, prop.unrecField) @@ -1226,6 +1248,27 @@ func size_struct(prop *StructProperties, base structPointer) (n int) { n += len(v) } + // Factor in any oneof fields. + // TODO: This could be faster and use less reflection. + if prop.oneofMarshaler != nil { + sv := reflect.ValueOf(structPointer_Interface(base, prop.stype)).Elem() + for i := 0; i < prop.stype.NumField(); i++ { + fv := sv.Field(i) + if fv.Kind() != reflect.Interface || fv.IsNil() { + continue + } + if prop.stype.Field(i).Tag.Get("protobuf_oneof") == "" { + continue + } + spv := fv.Elem() // interface -> *T + sv := spv.Elem() // *T -> T + sf := sv.Type().Field(0) // StructField inside T + var prop Properties + prop.Init(sf.Type, "whatever", sf.Tag.Get("protobuf"), &sf) + n += prop.size(&prop, toStructPointer(spv)) + } + } + return } diff --git a/Godeps/_workspace/src/github.com/gogo/protobuf/proto/equal.go b/Godeps/_workspace/src/github.com/gogo/protobuf/proto/equal.go index d8673a3e97ae..5475c3d9596f 100644 --- a/Godeps/_workspace/src/github.com/gogo/protobuf/proto/equal.go +++ b/Godeps/_workspace/src/github.com/gogo/protobuf/proto/equal.go @@ -154,6 +154,17 @@ func equalAny(v1, v2 reflect.Value) bool { return v1.Float() == v2.Float() case reflect.Int32, reflect.Int64: return v1.Int() == v2.Int() + case reflect.Interface: + // Probably a oneof field; compare the inner values. + n1, n2 := v1.IsNil(), v2.IsNil() + if n1 || n2 { + return n1 == n2 + } + e1, e2 := v1.Elem(), v2.Elem() + if e1.Type() != e2.Type() { + return false + } + return equalAny(e1, e2) case reflect.Map: if v1.Len() != v2.Len() { return false diff --git a/Godeps/_workspace/src/github.com/gogo/protobuf/proto/equal_test.go b/Godeps/_workspace/src/github.com/gogo/protobuf/proto/equal_test.go index ef6048008d3e..7cb36d3785d8 100644 --- a/Godeps/_workspace/src/github.com/gogo/protobuf/proto/equal_test.go +++ b/Godeps/_workspace/src/github.com/gogo/protobuf/proto/equal_test.go @@ -180,6 +180,24 @@ var EqualTests = []struct { &pb.MessageWithMap{NameMapping: map[int32]string{1: "Rob"}}, false, }, + { + "oneof same", + &pb.Communique{Union: &pb.Communique_Number{Number: 41}}, + &pb.Communique{Union: &pb.Communique_Number{Number: 41}}, + true, + }, + { + "oneof one nil", + &pb.Communique{Union: &pb.Communique_Number{Number: 41}}, + &pb.Communique{}, + false, + }, + { + "oneof different", + &pb.Communique{Union: &pb.Communique_Number{Number: 41}}, + &pb.Communique{Union: &pb.Communique_Name{Name: "Bobby Tables"}}, + false, + }, } func TestEqual(t *testing.T) { diff --git a/Godeps/_workspace/src/github.com/gogo/protobuf/proto/lib.go b/Godeps/_workspace/src/github.com/gogo/protobuf/proto/lib.go index d36f9ad1293b..b964734c7728 100644 --- a/Godeps/_workspace/src/github.com/gogo/protobuf/proto/lib.go +++ b/Godeps/_workspace/src/github.com/gogo/protobuf/proto/lib.go @@ -66,6 +66,8 @@ for a protocol buffer variable v: that contain it (if any) followed by the CamelCased name of the extension field itself. HasExtension, ClearExtension, GetExtension and SetExtension are functions for manipulating extensions. + - Oneof field sets are given a single field in their message, + with distinguished wrapper types for each possible field value. - Marshal and Unmarshal are functions to encode and decode the wire format. The simplest way to describe this is to see an example. @@ -82,6 +84,10 @@ Given file test.proto, containing optional group OptionalGroup = 4 { required string RequiredField = 5; } + oneof union { + int32 number = 6; + string name = 7; + } } The resulting file, test.pb.go, is: @@ -120,15 +126,40 @@ The resulting file, test.pb.go, is: } type Test struct { - Label *string `protobuf:"bytes,1,req,name=label" json:"label,omitempty"` - Type *int32 `protobuf:"varint,2,opt,name=type,def=77" json:"type,omitempty"` - Reps []int64 `protobuf:"varint,3,rep,name=reps" json:"reps,omitempty"` - Optionalgroup *Test_OptionalGroup `protobuf:"group,4,opt,name=OptionalGroup" json:"optionalgroup,omitempty"` - XXX_unrecognized []byte `json:"-"` + Label *string `protobuf:"bytes,1,req,name=label" json:"label,omitempty"` + Type *int32 `protobuf:"varint,2,opt,name=type,def=77" json:"type,omitempty"` + Reps []int64 `protobuf:"varint,3,rep,name=reps" json:"reps,omitempty"` + Optionalgroup *Test_OptionalGroup `protobuf:"group,4,opt,name=OptionalGroup" json:"optionalgroup,omitempty"` + // Types that are valid to be assigned to Union: + // *Test_Number + // *Test_Name + Union isTest_Union `protobuf_oneof:"union"` + XXX_unrecognized []byte `json:"-"` } func (m *Test) Reset() { *m = Test{} } func (m *Test) String() string { return proto.CompactTextString(m) } - func (*Test) ProtoMessage() {} + func (*Test) ProtoMessage() {} + + type isTest_Union interface { + isTest_Union() + } + + type Test_Number struct { + Number int32 `protobuf:"varint,6,opt,name=number"` + } + type Test_Name struct { + Name string `protobuf:"bytes,7,opt,name=name"` + } + + func (*Test_Number) isTest_Union() {} + func (*Test_Name) isTest_Union() {} + + func (m *Test) GetUnion() isTest_Union { + if m != nil { + return m.Union + } + return nil + } const Default_Test_Type int32 = 77 func (m *Test) GetLabel() string { @@ -165,6 +196,20 @@ The resulting file, test.pb.go, is: return "" } + func (m *Test) GetNumber() int32 { + if x, ok := m.GetUnion().(*Test_Number); ok { + return x.Number + } + return 0 + } + + func (m *Test) GetName() string { + if x, ok := m.GetUnion().(*Test_Name); ok { + return x.Name + } + return "" + } + func init() { proto.RegisterEnum("example.FOO", FOO_name, FOO_value) } @@ -187,6 +232,7 @@ package main Optionalgroup: &pb.Test_OptionalGroup{ RequiredField: proto.String("good bye"), }, + Union: &pb.Test_Name{"fred"}, } data, err := proto.Marshal(test) if err != nil { @@ -201,6 +247,11 @@ package main if test.GetLabel() != newTest.GetLabel() { log.Fatalf("data mismatch %q != %q", test.GetLabel(), newTest.GetLabel()) } + // Use a type switch to determine which oneof was set. + switch u := test.Union.(type) { + case *pb.Test_Number: // u.Number contains the number. + case *pb.Test_Name: // u.Name contains the string. + } // etc. } */ @@ -460,7 +511,6 @@ out: break out } fmt.Printf("%3d: t=%3d fix64 %d\n", index, tag, u) - break case WireVarint: u, err = p.DecodeVarint() @@ -471,19 +521,11 @@ out: fmt.Printf("%3d: t=%3d varint %d\n", index, tag, u) case WireStartGroup: - if err != nil { - fmt.Printf("%3d: t=%3d start err %v\n", index, tag, err) - break out - } fmt.Printf("%3d: t=%3d start\n", index, tag) depth++ case WireEndGroup: depth-- - if err != nil { - fmt.Printf("%3d: t=%3d end err %v\n", index, tag, err) - break out - } fmt.Printf("%3d: t=%3d end\n", index, tag) } } diff --git a/Godeps/_workspace/src/github.com/gogo/protobuf/proto/properties.go b/Godeps/_workspace/src/github.com/gogo/protobuf/proto/properties.go index 13245c00df24..1bb17a26abb1 100644 --- a/Godeps/_workspace/src/github.com/gogo/protobuf/proto/properties.go +++ b/Godeps/_workspace/src/github.com/gogo/protobuf/proto/properties.go @@ -89,6 +89,12 @@ type decoder func(p *Buffer, prop *Properties, base structPointer) error // A valueDecoder decodes a single integer in a particular encoding. type valueDecoder func(o *Buffer) (x uint64, err error) +// A oneofMarshaler does the marshaling for all oneof fields in a message. +type oneofMarshaler func(Message, *Buffer) error + +// A oneofUnmarshaler does the unmarshaling for a oneof field in a message. +type oneofUnmarshaler func(Message, int, int, *Buffer) (bool, error) + // tagMap is an optimization over map[int]int for typical protocol buffer // use-cases. Encoded protocol buffers are often in tag order with small tag // numbers. @@ -137,6 +143,21 @@ type StructProperties struct { order []int // list of struct field numbers in tag order unrecField field // field id of the XXX_unrecognized []byte field extendable bool // is this an extendable proto + + oneofMarshaler oneofMarshaler + oneofUnmarshaler oneofUnmarshaler + stype reflect.Type + + // OneofTypes contains information about the oneof fields in this message. + // It is keyed by the original name of a field. + OneofTypes map[string]*OneofProperties +} + +// OneofProperties represents information about a specific field in a oneof. +type OneofProperties struct { + Type reflect.Type // pointer to generated struct type for this oneof field + Field int // struct field number of the containing oneof in the message + Prop *Properties } // Implement the sorting interface so we can sort the fields in tag order, as recommended by the spec. @@ -161,6 +182,7 @@ type Properties struct { Packed bool // relevant for repeated primitives only Enum string // set for enum types only proto3 bool // whether this is known to be a proto3 field; set for []byte only + oneof bool // whether this is a oneof field Default string // default value HasDefault bool // whether an explicit default was provided @@ -216,6 +238,9 @@ func (p *Properties) String() string { if p.proto3 { s += ",proto3" } + if p.oneof { + s += ",oneof" + } if len(p.Enum) > 0 { s += ",enum=" + p.Enum } @@ -292,6 +317,8 @@ func (p *Properties) Parse(s string) { p.Enum = f[5:] case f == "proto3": p.proto3 = true + case f == "oneof": + p.oneof = true case strings.HasPrefix(f, "def="): p.HasDefault = true p.Default = f[4:] // rest of string @@ -733,6 +760,7 @@ func getPropertiesLocked(t reflect.Type) *StructProperties { if f.Name == "XXX_unrecognized" { // special case prop.unrecField = toField(&f) } + oneof := f.Tag.Get("protobuf_oneof") != "" // special case prop.Prop[i] = p prop.order[i] = i if debug { @@ -742,7 +770,7 @@ func getPropertiesLocked(t reflect.Type) *StructProperties { } print("\n") } - if p.enc == nil && !strings.HasPrefix(f.Name, "XXX_") { + if p.enc == nil && !strings.HasPrefix(f.Name, "XXX_") && !oneof { fmt.Fprintln(os.Stderr, "proto: no encoder for", f.Name, f.Type.String(), "[GetProperties]") } } @@ -750,6 +778,41 @@ func getPropertiesLocked(t reflect.Type) *StructProperties { // Re-order prop.order. sort.Sort(prop) + type oneofMessage interface { + XXX_OneofFuncs() (func(Message, *Buffer) error, func(Message, int, int, *Buffer) (bool, error), []interface{}) + } + if om, ok := reflect.Zero(reflect.PtrTo(t)).Interface().(oneofMessage); ok { + var oots []interface{} + prop.oneofMarshaler, prop.oneofUnmarshaler, oots = om.XXX_OneofFuncs() + prop.stype = t + + // Interpret oneof metadata. + prop.OneofTypes = make(map[string]*OneofProperties) + for _, oot := range oots { + oop := &OneofProperties{ + Type: reflect.ValueOf(oot).Type(), // *T + Prop: new(Properties), + } + sft := oop.Type.Elem().Field(0) + oop.Prop.Name = sft.Name + oop.Prop.Parse(sft.Tag.Get("protobuf")) + // There will be exactly one interface field that + // this new value is assignable to. + for i := 0; i < t.NumField(); i++ { + f := t.Field(i) + if f.Type.Kind() != reflect.Interface { + continue + } + if !oop.Type.AssignableTo(f.Type) { + continue + } + oop.Field = i + break + } + prop.OneofTypes[oop.Prop.OrigName] = oop + } + } + // build required counts // build tags reqCount := 0 diff --git a/Godeps/_workspace/src/github.com/gogo/protobuf/proto/proto3_proto/proto3.pb.go b/Godeps/_workspace/src/github.com/gogo/protobuf/proto/proto3_proto/proto3.pb.go index 2f2da4604485..b48227622f6f 100644 --- a/Godeps/_workspace/src/github.com/gogo/protobuf/proto/proto3_proto/proto3.pb.go +++ b/Godeps/_workspace/src/github.com/gogo/protobuf/proto/proto3_proto/proto3.pb.go @@ -16,10 +16,14 @@ It has these top-level messages: 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 diff --git a/Godeps/_workspace/src/github.com/gogo/protobuf/proto/size_test.go b/Godeps/_workspace/src/github.com/gogo/protobuf/proto/size_test.go index 457a479ebb41..f4b8b8e3a0a5 100644 --- a/Godeps/_workspace/src/github.com/gogo/protobuf/proto/size_test.go +++ b/Godeps/_workspace/src/github.com/gogo/protobuf/proto/size_test.go @@ -124,6 +124,11 @@ var SizeTests = []struct { {"map field with big entry", &pb.MessageWithMap{NameMapping: map[int32]string{8: strings.Repeat("x", 125)}}}, {"map field with big key and val", &pb.MessageWithMap{StrToStr: map[string]string{strings.Repeat("x", 70): strings.Repeat("y", 70)}}}, {"map field with big numeric key", &pb.MessageWithMap{NameMapping: map[int32]string{0xf00d: "om nom nom"}}}, + + {"oneof not set", &pb.Communique{}}, + {"oneof zero int32", &pb.Communique{Union: &pb.Communique_Number{Number: 0}}}, + {"oneof int32", &pb.Communique{Union: &pb.Communique_Number{Number: 3}}}, + {"oneof string", &pb.Communique{Union: &pb.Communique_Name{Name: "Rhythmic Fman"}}}, } func TestSize(t *testing.T) { diff --git a/Godeps/_workspace/src/github.com/gogo/protobuf/proto/testdata/Makefile b/Godeps/_workspace/src/github.com/gogo/protobuf/proto/testdata/Makefile new file mode 100644 index 000000000000..31d83277ccf1 --- /dev/null +++ b/Godeps/_workspace/src/github.com/gogo/protobuf/proto/testdata/Makefile @@ -0,0 +1,37 @@ +# 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. + +all: regenerate + +regenerate: + go install github.com/gogo/protobuf/protoc-min-version + protoc-min-version --version="3.0.0" --gogo_out=. test.proto + diff --git a/Godeps/_workspace/src/github.com/gogo/protobuf/proto/testdata/golden_test.go b/Godeps/_workspace/src/github.com/gogo/protobuf/proto/testdata/golden_test.go new file mode 100644 index 000000000000..8e84515377a9 --- /dev/null +++ b/Godeps/_workspace/src/github.com/gogo/protobuf/proto/testdata/golden_test.go @@ -0,0 +1,86 @@ +// Go support for Protocol Buffers - Google's data interchange format +// +// Copyright 2012 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. + +// Verify that the compiler output for test.proto is unchanged. + +package testdata + +import ( + "crypto/sha1" + "fmt" + "io/ioutil" + "os" + "os/exec" + "path/filepath" + "testing" +) + +// sum returns in string form (for easy comparison) the SHA-1 hash of the named file. +func sum(t *testing.T, name string) string { + data, err := ioutil.ReadFile(name) + if err != nil { + t.Fatal(err) + } + t.Logf("sum(%q): length is %d", name, len(data)) + hash := sha1.New() + _, err = hash.Write(data) + if err != nil { + t.Fatal(err) + } + return fmt.Sprintf("% x", hash.Sum(nil)) +} + +func run(t *testing.T, name string, args ...string) { + cmd := exec.Command(name, args...) + cmd.Stdin = os.Stdin + cmd.Stdout = os.Stdout + cmd.Stderr = os.Stderr + err := cmd.Run() + if err != nil { + t.Fatal(err) + } +} + +func TestGolden(t *testing.T) { + // Compute the original checksum. + goldenSum := sum(t, "test.pb.go") + // Run the proto compiler. + run(t, "protoc", "--gogo_out="+os.TempDir(), "test.proto") + newFile := filepath.Join(os.TempDir(), "test.pb.go") + defer os.Remove(newFile) + // Compute the new checksum. + newSum := sum(t, newFile) + // Verify + if newSum != goldenSum { + run(t, "diff", "-u", "test.pb.go", newFile) + t.Fatal("Code generated by protoc-gen-go has changed; update test.pb.go") + } +} diff --git a/Godeps/_workspace/src/github.com/gogo/protobuf/proto/testdata/test.pb.go b/Godeps/_workspace/src/github.com/gogo/protobuf/proto/testdata/test.pb.go new file mode 100644 index 000000000000..0c200f6a41c0 --- /dev/null +++ b/Godeps/_workspace/src/github.com/gogo/protobuf/proto/testdata/test.pb.go @@ -0,0 +1,2948 @@ +// Code generated by protoc-gen-gogo. +// source: test.proto +// DO NOT EDIT! + +/* +Package testdata is a generated protocol buffer package. + +It is generated from these files: + test.proto + +It has these top-level messages: + GoEnum + GoTestField + GoTest + GoSkipTest + NonPackedTest + PackedTest + MaxTag + OldMessage + NewMessage + InnerMessage + OtherMessage + MyMessage + Ext + DefaultsMessage + MyMessageSet + Empty + MessageList + Strings + Defaults + SubDefaults + RepeatedEnum + MoreRepeated + GroupOld + GroupNew + FloatingPoint + MessageWithMap + Communique +*/ +package testdata + +import proto "github.com/gogo/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 FOO int32 + +const ( + FOO_FOO1 FOO = 1 +) + +var FOO_name = map[int32]string{ + 1: "FOO1", +} +var FOO_value = map[string]int32{ + "FOO1": 1, +} + +func (x FOO) Enum() *FOO { + p := new(FOO) + *p = x + return p +} +func (x FOO) String() string { + return proto.EnumName(FOO_name, int32(x)) +} +func (x *FOO) UnmarshalJSON(data []byte) error { + value, err := proto.UnmarshalJSONEnum(FOO_value, data, "FOO") + if err != nil { + return err + } + *x = FOO(value) + return nil +} + +// An enum, for completeness. +type GoTest_KIND int32 + +const ( + GoTest_VOID GoTest_KIND = 0 + // Basic types + GoTest_BOOL GoTest_KIND = 1 + GoTest_BYTES GoTest_KIND = 2 + GoTest_FINGERPRINT GoTest_KIND = 3 + GoTest_FLOAT GoTest_KIND = 4 + GoTest_INT GoTest_KIND = 5 + GoTest_STRING GoTest_KIND = 6 + GoTest_TIME GoTest_KIND = 7 + // Groupings + GoTest_TUPLE GoTest_KIND = 8 + GoTest_ARRAY GoTest_KIND = 9 + GoTest_MAP GoTest_KIND = 10 + // Table types + GoTest_TABLE GoTest_KIND = 11 + // Functions + GoTest_FUNCTION GoTest_KIND = 12 +) + +var GoTest_KIND_name = map[int32]string{ + 0: "VOID", + 1: "BOOL", + 2: "BYTES", + 3: "FINGERPRINT", + 4: "FLOAT", + 5: "INT", + 6: "STRING", + 7: "TIME", + 8: "TUPLE", + 9: "ARRAY", + 10: "MAP", + 11: "TABLE", + 12: "FUNCTION", +} +var GoTest_KIND_value = map[string]int32{ + "VOID": 0, + "BOOL": 1, + "BYTES": 2, + "FINGERPRINT": 3, + "FLOAT": 4, + "INT": 5, + "STRING": 6, + "TIME": 7, + "TUPLE": 8, + "ARRAY": 9, + "MAP": 10, + "TABLE": 11, + "FUNCTION": 12, +} + +func (x GoTest_KIND) Enum() *GoTest_KIND { + p := new(GoTest_KIND) + *p = x + return p +} +func (x GoTest_KIND) String() string { + return proto.EnumName(GoTest_KIND_name, int32(x)) +} +func (x *GoTest_KIND) UnmarshalJSON(data []byte) error { + value, err := proto.UnmarshalJSONEnum(GoTest_KIND_value, data, "GoTest_KIND") + if err != nil { + return err + } + *x = GoTest_KIND(value) + return nil +} + +type MyMessage_Color int32 + +const ( + MyMessage_RED MyMessage_Color = 0 + MyMessage_GREEN MyMessage_Color = 1 + MyMessage_BLUE MyMessage_Color = 2 +) + +var MyMessage_Color_name = map[int32]string{ + 0: "RED", + 1: "GREEN", + 2: "BLUE", +} +var MyMessage_Color_value = map[string]int32{ + "RED": 0, + "GREEN": 1, + "BLUE": 2, +} + +func (x MyMessage_Color) Enum() *MyMessage_Color { + p := new(MyMessage_Color) + *p = x + return p +} +func (x MyMessage_Color) String() string { + return proto.EnumName(MyMessage_Color_name, int32(x)) +} +func (x *MyMessage_Color) UnmarshalJSON(data []byte) error { + value, err := proto.UnmarshalJSONEnum(MyMessage_Color_value, data, "MyMessage_Color") + if err != nil { + return err + } + *x = MyMessage_Color(value) + return nil +} + +type DefaultsMessage_DefaultsEnum int32 + +const ( + DefaultsMessage_ZERO DefaultsMessage_DefaultsEnum = 0 + DefaultsMessage_ONE DefaultsMessage_DefaultsEnum = 1 + DefaultsMessage_TWO DefaultsMessage_DefaultsEnum = 2 +) + +var DefaultsMessage_DefaultsEnum_name = map[int32]string{ + 0: "ZERO", + 1: "ONE", + 2: "TWO", +} +var DefaultsMessage_DefaultsEnum_value = map[string]int32{ + "ZERO": 0, + "ONE": 1, + "TWO": 2, +} + +func (x DefaultsMessage_DefaultsEnum) Enum() *DefaultsMessage_DefaultsEnum { + p := new(DefaultsMessage_DefaultsEnum) + *p = x + return p +} +func (x DefaultsMessage_DefaultsEnum) String() string { + return proto.EnumName(DefaultsMessage_DefaultsEnum_name, int32(x)) +} +func (x *DefaultsMessage_DefaultsEnum) UnmarshalJSON(data []byte) error { + value, err := proto.UnmarshalJSONEnum(DefaultsMessage_DefaultsEnum_value, data, "DefaultsMessage_DefaultsEnum") + if err != nil { + return err + } + *x = DefaultsMessage_DefaultsEnum(value) + return nil +} + +type Defaults_Color int32 + +const ( + Defaults_RED Defaults_Color = 0 + Defaults_GREEN Defaults_Color = 1 + Defaults_BLUE Defaults_Color = 2 +) + +var Defaults_Color_name = map[int32]string{ + 0: "RED", + 1: "GREEN", + 2: "BLUE", +} +var Defaults_Color_value = map[string]int32{ + "RED": 0, + "GREEN": 1, + "BLUE": 2, +} + +func (x Defaults_Color) Enum() *Defaults_Color { + p := new(Defaults_Color) + *p = x + return p +} +func (x Defaults_Color) String() string { + return proto.EnumName(Defaults_Color_name, int32(x)) +} +func (x *Defaults_Color) UnmarshalJSON(data []byte) error { + value, err := proto.UnmarshalJSONEnum(Defaults_Color_value, data, "Defaults_Color") + if err != nil { + return err + } + *x = Defaults_Color(value) + return nil +} + +type RepeatedEnum_Color int32 + +const ( + RepeatedEnum_RED RepeatedEnum_Color = 1 +) + +var RepeatedEnum_Color_name = map[int32]string{ + 1: "RED", +} +var RepeatedEnum_Color_value = map[string]int32{ + "RED": 1, +} + +func (x RepeatedEnum_Color) Enum() *RepeatedEnum_Color { + p := new(RepeatedEnum_Color) + *p = x + return p +} +func (x RepeatedEnum_Color) String() string { + return proto.EnumName(RepeatedEnum_Color_name, int32(x)) +} +func (x *RepeatedEnum_Color) UnmarshalJSON(data []byte) error { + value, err := proto.UnmarshalJSONEnum(RepeatedEnum_Color_value, data, "RepeatedEnum_Color") + if err != nil { + return err + } + *x = RepeatedEnum_Color(value) + return nil +} + +type GoEnum struct { + Foo *FOO `protobuf:"varint,1,req,name=foo,enum=testdata.FOO" json:"foo,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *GoEnum) Reset() { *m = GoEnum{} } +func (m *GoEnum) String() string { return proto.CompactTextString(m) } +func (*GoEnum) ProtoMessage() {} + +func (m *GoEnum) GetFoo() FOO { + if m != nil && m.Foo != nil { + return *m.Foo + } + return FOO_FOO1 +} + +type GoTestField struct { + Label *string `protobuf:"bytes,1,req,name=Label" json:"Label,omitempty"` + Type *string `protobuf:"bytes,2,req,name=Type" json:"Type,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *GoTestField) Reset() { *m = GoTestField{} } +func (m *GoTestField) String() string { return proto.CompactTextString(m) } +func (*GoTestField) ProtoMessage() {} + +func (m *GoTestField) GetLabel() string { + if m != nil && m.Label != nil { + return *m.Label + } + return "" +} + +func (m *GoTestField) GetType() string { + if m != nil && m.Type != nil { + return *m.Type + } + return "" +} + +type GoTest struct { + // Some typical parameters + Kind *GoTest_KIND `protobuf:"varint,1,req,name=Kind,enum=testdata.GoTest_KIND" json:"Kind,omitempty"` + Table *string `protobuf:"bytes,2,opt,name=Table" json:"Table,omitempty"` + Param *int32 `protobuf:"varint,3,opt,name=Param" json:"Param,omitempty"` + // Required, repeated and optional foreign fields. + RequiredField *GoTestField `protobuf:"bytes,4,req,name=RequiredField" json:"RequiredField,omitempty"` + RepeatedField []*GoTestField `protobuf:"bytes,5,rep,name=RepeatedField" json:"RepeatedField,omitempty"` + OptionalField *GoTestField `protobuf:"bytes,6,opt,name=OptionalField" json:"OptionalField,omitempty"` + // Required fields of all basic types + F_BoolRequired *bool `protobuf:"varint,10,req,name=F_Bool_required" json:"F_Bool_required,omitempty"` + F_Int32Required *int32 `protobuf:"varint,11,req,name=F_Int32_required" json:"F_Int32_required,omitempty"` + F_Int64Required *int64 `protobuf:"varint,12,req,name=F_Int64_required" json:"F_Int64_required,omitempty"` + F_Fixed32Required *uint32 `protobuf:"fixed32,13,req,name=F_Fixed32_required" json:"F_Fixed32_required,omitempty"` + F_Fixed64Required *uint64 `protobuf:"fixed64,14,req,name=F_Fixed64_required" json:"F_Fixed64_required,omitempty"` + F_Uint32Required *uint32 `protobuf:"varint,15,req,name=F_Uint32_required" json:"F_Uint32_required,omitempty"` + F_Uint64Required *uint64 `protobuf:"varint,16,req,name=F_Uint64_required" json:"F_Uint64_required,omitempty"` + F_FloatRequired *float32 `protobuf:"fixed32,17,req,name=F_Float_required" json:"F_Float_required,omitempty"` + F_DoubleRequired *float64 `protobuf:"fixed64,18,req,name=F_Double_required" json:"F_Double_required,omitempty"` + F_StringRequired *string `protobuf:"bytes,19,req,name=F_String_required" json:"F_String_required,omitempty"` + F_BytesRequired []byte `protobuf:"bytes,101,req,name=F_Bytes_required" json:"F_Bytes_required,omitempty"` + F_Sint32Required *int32 `protobuf:"zigzag32,102,req,name=F_Sint32_required" json:"F_Sint32_required,omitempty"` + F_Sint64Required *int64 `protobuf:"zigzag64,103,req,name=F_Sint64_required" json:"F_Sint64_required,omitempty"` + // Repeated fields of all basic types + F_BoolRepeated []bool `protobuf:"varint,20,rep,name=F_Bool_repeated" json:"F_Bool_repeated,omitempty"` + F_Int32Repeated []int32 `protobuf:"varint,21,rep,name=F_Int32_repeated" json:"F_Int32_repeated,omitempty"` + F_Int64Repeated []int64 `protobuf:"varint,22,rep,name=F_Int64_repeated" json:"F_Int64_repeated,omitempty"` + F_Fixed32Repeated []uint32 `protobuf:"fixed32,23,rep,name=F_Fixed32_repeated" json:"F_Fixed32_repeated,omitempty"` + F_Fixed64Repeated []uint64 `protobuf:"fixed64,24,rep,name=F_Fixed64_repeated" json:"F_Fixed64_repeated,omitempty"` + F_Uint32Repeated []uint32 `protobuf:"varint,25,rep,name=F_Uint32_repeated" json:"F_Uint32_repeated,omitempty"` + F_Uint64Repeated []uint64 `protobuf:"varint,26,rep,name=F_Uint64_repeated" json:"F_Uint64_repeated,omitempty"` + F_FloatRepeated []float32 `protobuf:"fixed32,27,rep,name=F_Float_repeated" json:"F_Float_repeated,omitempty"` + F_DoubleRepeated []float64 `protobuf:"fixed64,28,rep,name=F_Double_repeated" json:"F_Double_repeated,omitempty"` + F_StringRepeated []string `protobuf:"bytes,29,rep,name=F_String_repeated" json:"F_String_repeated,omitempty"` + F_BytesRepeated [][]byte `protobuf:"bytes,201,rep,name=F_Bytes_repeated" json:"F_Bytes_repeated,omitempty"` + F_Sint32Repeated []int32 `protobuf:"zigzag32,202,rep,name=F_Sint32_repeated" json:"F_Sint32_repeated,omitempty"` + F_Sint64Repeated []int64 `protobuf:"zigzag64,203,rep,name=F_Sint64_repeated" json:"F_Sint64_repeated,omitempty"` + // Optional fields of all basic types + F_BoolOptional *bool `protobuf:"varint,30,opt,name=F_Bool_optional" json:"F_Bool_optional,omitempty"` + F_Int32Optional *int32 `protobuf:"varint,31,opt,name=F_Int32_optional" json:"F_Int32_optional,omitempty"` + F_Int64Optional *int64 `protobuf:"varint,32,opt,name=F_Int64_optional" json:"F_Int64_optional,omitempty"` + F_Fixed32Optional *uint32 `protobuf:"fixed32,33,opt,name=F_Fixed32_optional" json:"F_Fixed32_optional,omitempty"` + F_Fixed64Optional *uint64 `protobuf:"fixed64,34,opt,name=F_Fixed64_optional" json:"F_Fixed64_optional,omitempty"` + F_Uint32Optional *uint32 `protobuf:"varint,35,opt,name=F_Uint32_optional" json:"F_Uint32_optional,omitempty"` + F_Uint64Optional *uint64 `protobuf:"varint,36,opt,name=F_Uint64_optional" json:"F_Uint64_optional,omitempty"` + F_FloatOptional *float32 `protobuf:"fixed32,37,opt,name=F_Float_optional" json:"F_Float_optional,omitempty"` + F_DoubleOptional *float64 `protobuf:"fixed64,38,opt,name=F_Double_optional" json:"F_Double_optional,omitempty"` + F_StringOptional *string `protobuf:"bytes,39,opt,name=F_String_optional" json:"F_String_optional,omitempty"` + F_BytesOptional []byte `protobuf:"bytes,301,opt,name=F_Bytes_optional" json:"F_Bytes_optional,omitempty"` + F_Sint32Optional *int32 `protobuf:"zigzag32,302,opt,name=F_Sint32_optional" json:"F_Sint32_optional,omitempty"` + F_Sint64Optional *int64 `protobuf:"zigzag64,303,opt,name=F_Sint64_optional" json:"F_Sint64_optional,omitempty"` + // Default-valued fields of all basic types + F_BoolDefaulted *bool `protobuf:"varint,40,opt,name=F_Bool_defaulted,def=1" json:"F_Bool_defaulted,omitempty"` + F_Int32Defaulted *int32 `protobuf:"varint,41,opt,name=F_Int32_defaulted,def=32" json:"F_Int32_defaulted,omitempty"` + F_Int64Defaulted *int64 `protobuf:"varint,42,opt,name=F_Int64_defaulted,def=64" json:"F_Int64_defaulted,omitempty"` + F_Fixed32Defaulted *uint32 `protobuf:"fixed32,43,opt,name=F_Fixed32_defaulted,def=320" json:"F_Fixed32_defaulted,omitempty"` + F_Fixed64Defaulted *uint64 `protobuf:"fixed64,44,opt,name=F_Fixed64_defaulted,def=640" json:"F_Fixed64_defaulted,omitempty"` + F_Uint32Defaulted *uint32 `protobuf:"varint,45,opt,name=F_Uint32_defaulted,def=3200" json:"F_Uint32_defaulted,omitempty"` + F_Uint64Defaulted *uint64 `protobuf:"varint,46,opt,name=F_Uint64_defaulted,def=6400" json:"F_Uint64_defaulted,omitempty"` + F_FloatDefaulted *float32 `protobuf:"fixed32,47,opt,name=F_Float_defaulted,def=314159" json:"F_Float_defaulted,omitempty"` + F_DoubleDefaulted *float64 `protobuf:"fixed64,48,opt,name=F_Double_defaulted,def=271828" json:"F_Double_defaulted,omitempty"` + F_StringDefaulted *string `protobuf:"bytes,49,opt,name=F_String_defaulted,def=hello, \"world!\"\n" json:"F_String_defaulted,omitempty"` + F_BytesDefaulted []byte `protobuf:"bytes,401,opt,name=F_Bytes_defaulted,def=Bignose" json:"F_Bytes_defaulted,omitempty"` + F_Sint32Defaulted *int32 `protobuf:"zigzag32,402,opt,name=F_Sint32_defaulted,def=-32" json:"F_Sint32_defaulted,omitempty"` + F_Sint64Defaulted *int64 `protobuf:"zigzag64,403,opt,name=F_Sint64_defaulted,def=-64" json:"F_Sint64_defaulted,omitempty"` + // Packed repeated fields (no string or bytes). + F_BoolRepeatedPacked []bool `protobuf:"varint,50,rep,packed,name=F_Bool_repeated_packed" json:"F_Bool_repeated_packed,omitempty"` + F_Int32RepeatedPacked []int32 `protobuf:"varint,51,rep,packed,name=F_Int32_repeated_packed" json:"F_Int32_repeated_packed,omitempty"` + F_Int64RepeatedPacked []int64 `protobuf:"varint,52,rep,packed,name=F_Int64_repeated_packed" json:"F_Int64_repeated_packed,omitempty"` + F_Fixed32RepeatedPacked []uint32 `protobuf:"fixed32,53,rep,packed,name=F_Fixed32_repeated_packed" json:"F_Fixed32_repeated_packed,omitempty"` + F_Fixed64RepeatedPacked []uint64 `protobuf:"fixed64,54,rep,packed,name=F_Fixed64_repeated_packed" json:"F_Fixed64_repeated_packed,omitempty"` + F_Uint32RepeatedPacked []uint32 `protobuf:"varint,55,rep,packed,name=F_Uint32_repeated_packed" json:"F_Uint32_repeated_packed,omitempty"` + F_Uint64RepeatedPacked []uint64 `protobuf:"varint,56,rep,packed,name=F_Uint64_repeated_packed" json:"F_Uint64_repeated_packed,omitempty"` + F_FloatRepeatedPacked []float32 `protobuf:"fixed32,57,rep,packed,name=F_Float_repeated_packed" json:"F_Float_repeated_packed,omitempty"` + F_DoubleRepeatedPacked []float64 `protobuf:"fixed64,58,rep,packed,name=F_Double_repeated_packed" json:"F_Double_repeated_packed,omitempty"` + F_Sint32RepeatedPacked []int32 `protobuf:"zigzag32,502,rep,packed,name=F_Sint32_repeated_packed" json:"F_Sint32_repeated_packed,omitempty"` + F_Sint64RepeatedPacked []int64 `protobuf:"zigzag64,503,rep,packed,name=F_Sint64_repeated_packed" json:"F_Sint64_repeated_packed,omitempty"` + Requiredgroup *GoTest_RequiredGroup `protobuf:"group,70,req,name=RequiredGroup" json:"requiredgroup,omitempty"` + Repeatedgroup []*GoTest_RepeatedGroup `protobuf:"group,80,rep,name=RepeatedGroup" json:"repeatedgroup,omitempty"` + Optionalgroup *GoTest_OptionalGroup `protobuf:"group,90,opt,name=OptionalGroup" json:"optionalgroup,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *GoTest) Reset() { *m = GoTest{} } +func (m *GoTest) String() string { return proto.CompactTextString(m) } +func (*GoTest) ProtoMessage() {} + +const Default_GoTest_F_BoolDefaulted bool = true +const Default_GoTest_F_Int32Defaulted int32 = 32 +const Default_GoTest_F_Int64Defaulted int64 = 64 +const Default_GoTest_F_Fixed32Defaulted uint32 = 320 +const Default_GoTest_F_Fixed64Defaulted uint64 = 640 +const Default_GoTest_F_Uint32Defaulted uint32 = 3200 +const Default_GoTest_F_Uint64Defaulted uint64 = 6400 +const Default_GoTest_F_FloatDefaulted float32 = 314159 +const Default_GoTest_F_DoubleDefaulted float64 = 271828 +const Default_GoTest_F_StringDefaulted string = "hello, \"world!\"\n" + +var Default_GoTest_F_BytesDefaulted []byte = []byte("Bignose") + +const Default_GoTest_F_Sint32Defaulted int32 = -32 +const Default_GoTest_F_Sint64Defaulted int64 = -64 + +func (m *GoTest) GetKind() GoTest_KIND { + if m != nil && m.Kind != nil { + return *m.Kind + } + return GoTest_VOID +} + +func (m *GoTest) GetTable() string { + if m != nil && m.Table != nil { + return *m.Table + } + return "" +} + +func (m *GoTest) GetParam() int32 { + if m != nil && m.Param != nil { + return *m.Param + } + return 0 +} + +func (m *GoTest) GetRequiredField() *GoTestField { + if m != nil { + return m.RequiredField + } + return nil +} + +func (m *GoTest) GetRepeatedField() []*GoTestField { + if m != nil { + return m.RepeatedField + } + return nil +} + +func (m *GoTest) GetOptionalField() *GoTestField { + if m != nil { + return m.OptionalField + } + return nil +} + +func (m *GoTest) GetF_BoolRequired() bool { + if m != nil && m.F_BoolRequired != nil { + return *m.F_BoolRequired + } + return false +} + +func (m *GoTest) GetF_Int32Required() int32 { + if m != nil && m.F_Int32Required != nil { + return *m.F_Int32Required + } + return 0 +} + +func (m *GoTest) GetF_Int64Required() int64 { + if m != nil && m.F_Int64Required != nil { + return *m.F_Int64Required + } + return 0 +} + +func (m *GoTest) GetF_Fixed32Required() uint32 { + if m != nil && m.F_Fixed32Required != nil { + return *m.F_Fixed32Required + } + return 0 +} + +func (m *GoTest) GetF_Fixed64Required() uint64 { + if m != nil && m.F_Fixed64Required != nil { + return *m.F_Fixed64Required + } + return 0 +} + +func (m *GoTest) GetF_Uint32Required() uint32 { + if m != nil && m.F_Uint32Required != nil { + return *m.F_Uint32Required + } + return 0 +} + +func (m *GoTest) GetF_Uint64Required() uint64 { + if m != nil && m.F_Uint64Required != nil { + return *m.F_Uint64Required + } + return 0 +} + +func (m *GoTest) GetF_FloatRequired() float32 { + if m != nil && m.F_FloatRequired != nil { + return *m.F_FloatRequired + } + return 0 +} + +func (m *GoTest) GetF_DoubleRequired() float64 { + if m != nil && m.F_DoubleRequired != nil { + return *m.F_DoubleRequired + } + return 0 +} + +func (m *GoTest) GetF_StringRequired() string { + if m != nil && m.F_StringRequired != nil { + return *m.F_StringRequired + } + return "" +} + +func (m *GoTest) GetF_BytesRequired() []byte { + if m != nil { + return m.F_BytesRequired + } + return nil +} + +func (m *GoTest) GetF_Sint32Required() int32 { + if m != nil && m.F_Sint32Required != nil { + return *m.F_Sint32Required + } + return 0 +} + +func (m *GoTest) GetF_Sint64Required() int64 { + if m != nil && m.F_Sint64Required != nil { + return *m.F_Sint64Required + } + return 0 +} + +func (m *GoTest) GetF_BoolRepeated() []bool { + if m != nil { + return m.F_BoolRepeated + } + return nil +} + +func (m *GoTest) GetF_Int32Repeated() []int32 { + if m != nil { + return m.F_Int32Repeated + } + return nil +} + +func (m *GoTest) GetF_Int64Repeated() []int64 { + if m != nil { + return m.F_Int64Repeated + } + return nil +} + +func (m *GoTest) GetF_Fixed32Repeated() []uint32 { + if m != nil { + return m.F_Fixed32Repeated + } + return nil +} + +func (m *GoTest) GetF_Fixed64Repeated() []uint64 { + if m != nil { + return m.F_Fixed64Repeated + } + return nil +} + +func (m *GoTest) GetF_Uint32Repeated() []uint32 { + if m != nil { + return m.F_Uint32Repeated + } + return nil +} + +func (m *GoTest) GetF_Uint64Repeated() []uint64 { + if m != nil { + return m.F_Uint64Repeated + } + return nil +} + +func (m *GoTest) GetF_FloatRepeated() []float32 { + if m != nil { + return m.F_FloatRepeated + } + return nil +} + +func (m *GoTest) GetF_DoubleRepeated() []float64 { + if m != nil { + return m.F_DoubleRepeated + } + return nil +} + +func (m *GoTest) GetF_StringRepeated() []string { + if m != nil { + return m.F_StringRepeated + } + return nil +} + +func (m *GoTest) GetF_BytesRepeated() [][]byte { + if m != nil { + return m.F_BytesRepeated + } + return nil +} + +func (m *GoTest) GetF_Sint32Repeated() []int32 { + if m != nil { + return m.F_Sint32Repeated + } + return nil +} + +func (m *GoTest) GetF_Sint64Repeated() []int64 { + if m != nil { + return m.F_Sint64Repeated + } + return nil +} + +func (m *GoTest) GetF_BoolOptional() bool { + if m != nil && m.F_BoolOptional != nil { + return *m.F_BoolOptional + } + return false +} + +func (m *GoTest) GetF_Int32Optional() int32 { + if m != nil && m.F_Int32Optional != nil { + return *m.F_Int32Optional + } + return 0 +} + +func (m *GoTest) GetF_Int64Optional() int64 { + if m != nil && m.F_Int64Optional != nil { + return *m.F_Int64Optional + } + return 0 +} + +func (m *GoTest) GetF_Fixed32Optional() uint32 { + if m != nil && m.F_Fixed32Optional != nil { + return *m.F_Fixed32Optional + } + return 0 +} + +func (m *GoTest) GetF_Fixed64Optional() uint64 { + if m != nil && m.F_Fixed64Optional != nil { + return *m.F_Fixed64Optional + } + return 0 +} + +func (m *GoTest) GetF_Uint32Optional() uint32 { + if m != nil && m.F_Uint32Optional != nil { + return *m.F_Uint32Optional + } + return 0 +} + +func (m *GoTest) GetF_Uint64Optional() uint64 { + if m != nil && m.F_Uint64Optional != nil { + return *m.F_Uint64Optional + } + return 0 +} + +func (m *GoTest) GetF_FloatOptional() float32 { + if m != nil && m.F_FloatOptional != nil { + return *m.F_FloatOptional + } + return 0 +} + +func (m *GoTest) GetF_DoubleOptional() float64 { + if m != nil && m.F_DoubleOptional != nil { + return *m.F_DoubleOptional + } + return 0 +} + +func (m *GoTest) GetF_StringOptional() string { + if m != nil && m.F_StringOptional != nil { + return *m.F_StringOptional + } + return "" +} + +func (m *GoTest) GetF_BytesOptional() []byte { + if m != nil { + return m.F_BytesOptional + } + return nil +} + +func (m *GoTest) GetF_Sint32Optional() int32 { + if m != nil && m.F_Sint32Optional != nil { + return *m.F_Sint32Optional + } + return 0 +} + +func (m *GoTest) GetF_Sint64Optional() int64 { + if m != nil && m.F_Sint64Optional != nil { + return *m.F_Sint64Optional + } + return 0 +} + +func (m *GoTest) GetF_BoolDefaulted() bool { + if m != nil && m.F_BoolDefaulted != nil { + return *m.F_BoolDefaulted + } + return Default_GoTest_F_BoolDefaulted +} + +func (m *GoTest) GetF_Int32Defaulted() int32 { + if m != nil && m.F_Int32Defaulted != nil { + return *m.F_Int32Defaulted + } + return Default_GoTest_F_Int32Defaulted +} + +func (m *GoTest) GetF_Int64Defaulted() int64 { + if m != nil && m.F_Int64Defaulted != nil { + return *m.F_Int64Defaulted + } + return Default_GoTest_F_Int64Defaulted +} + +func (m *GoTest) GetF_Fixed32Defaulted() uint32 { + if m != nil && m.F_Fixed32Defaulted != nil { + return *m.F_Fixed32Defaulted + } + return Default_GoTest_F_Fixed32Defaulted +} + +func (m *GoTest) GetF_Fixed64Defaulted() uint64 { + if m != nil && m.F_Fixed64Defaulted != nil { + return *m.F_Fixed64Defaulted + } + return Default_GoTest_F_Fixed64Defaulted +} + +func (m *GoTest) GetF_Uint32Defaulted() uint32 { + if m != nil && m.F_Uint32Defaulted != nil { + return *m.F_Uint32Defaulted + } + return Default_GoTest_F_Uint32Defaulted +} + +func (m *GoTest) GetF_Uint64Defaulted() uint64 { + if m != nil && m.F_Uint64Defaulted != nil { + return *m.F_Uint64Defaulted + } + return Default_GoTest_F_Uint64Defaulted +} + +func (m *GoTest) GetF_FloatDefaulted() float32 { + if m != nil && m.F_FloatDefaulted != nil { + return *m.F_FloatDefaulted + } + return Default_GoTest_F_FloatDefaulted +} + +func (m *GoTest) GetF_DoubleDefaulted() float64 { + if m != nil && m.F_DoubleDefaulted != nil { + return *m.F_DoubleDefaulted + } + return Default_GoTest_F_DoubleDefaulted +} + +func (m *GoTest) GetF_StringDefaulted() string { + if m != nil && m.F_StringDefaulted != nil { + return *m.F_StringDefaulted + } + return Default_GoTest_F_StringDefaulted +} + +func (m *GoTest) GetF_BytesDefaulted() []byte { + if m != nil && m.F_BytesDefaulted != nil { + return m.F_BytesDefaulted + } + return append([]byte(nil), Default_GoTest_F_BytesDefaulted...) +} + +func (m *GoTest) GetF_Sint32Defaulted() int32 { + if m != nil && m.F_Sint32Defaulted != nil { + return *m.F_Sint32Defaulted + } + return Default_GoTest_F_Sint32Defaulted +} + +func (m *GoTest) GetF_Sint64Defaulted() int64 { + if m != nil && m.F_Sint64Defaulted != nil { + return *m.F_Sint64Defaulted + } + return Default_GoTest_F_Sint64Defaulted +} + +func (m *GoTest) GetF_BoolRepeatedPacked() []bool { + if m != nil { + return m.F_BoolRepeatedPacked + } + return nil +} + +func (m *GoTest) GetF_Int32RepeatedPacked() []int32 { + if m != nil { + return m.F_Int32RepeatedPacked + } + return nil +} + +func (m *GoTest) GetF_Int64RepeatedPacked() []int64 { + if m != nil { + return m.F_Int64RepeatedPacked + } + return nil +} + +func (m *GoTest) GetF_Fixed32RepeatedPacked() []uint32 { + if m != nil { + return m.F_Fixed32RepeatedPacked + } + return nil +} + +func (m *GoTest) GetF_Fixed64RepeatedPacked() []uint64 { + if m != nil { + return m.F_Fixed64RepeatedPacked + } + return nil +} + +func (m *GoTest) GetF_Uint32RepeatedPacked() []uint32 { + if m != nil { + return m.F_Uint32RepeatedPacked + } + return nil +} + +func (m *GoTest) GetF_Uint64RepeatedPacked() []uint64 { + if m != nil { + return m.F_Uint64RepeatedPacked + } + return nil +} + +func (m *GoTest) GetF_FloatRepeatedPacked() []float32 { + if m != nil { + return m.F_FloatRepeatedPacked + } + return nil +} + +func (m *GoTest) GetF_DoubleRepeatedPacked() []float64 { + if m != nil { + return m.F_DoubleRepeatedPacked + } + return nil +} + +func (m *GoTest) GetF_Sint32RepeatedPacked() []int32 { + if m != nil { + return m.F_Sint32RepeatedPacked + } + return nil +} + +func (m *GoTest) GetF_Sint64RepeatedPacked() []int64 { + if m != nil { + return m.F_Sint64RepeatedPacked + } + return nil +} + +func (m *GoTest) GetRequiredgroup() *GoTest_RequiredGroup { + if m != nil { + return m.Requiredgroup + } + return nil +} + +func (m *GoTest) GetRepeatedgroup() []*GoTest_RepeatedGroup { + if m != nil { + return m.Repeatedgroup + } + return nil +} + +func (m *GoTest) GetOptionalgroup() *GoTest_OptionalGroup { + if m != nil { + return m.Optionalgroup + } + return nil +} + +// Required, repeated, and optional groups. +type GoTest_RequiredGroup struct { + RequiredField *string `protobuf:"bytes,71,req,name=RequiredField" json:"RequiredField,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *GoTest_RequiredGroup) Reset() { *m = GoTest_RequiredGroup{} } +func (m *GoTest_RequiredGroup) String() string { return proto.CompactTextString(m) } +func (*GoTest_RequiredGroup) ProtoMessage() {} + +func (m *GoTest_RequiredGroup) GetRequiredField() string { + if m != nil && m.RequiredField != nil { + return *m.RequiredField + } + return "" +} + +type GoTest_RepeatedGroup struct { + RequiredField *string `protobuf:"bytes,81,req,name=RequiredField" json:"RequiredField,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *GoTest_RepeatedGroup) Reset() { *m = GoTest_RepeatedGroup{} } +func (m *GoTest_RepeatedGroup) String() string { return proto.CompactTextString(m) } +func (*GoTest_RepeatedGroup) ProtoMessage() {} + +func (m *GoTest_RepeatedGroup) GetRequiredField() string { + if m != nil && m.RequiredField != nil { + return *m.RequiredField + } + return "" +} + +type GoTest_OptionalGroup struct { + RequiredField *string `protobuf:"bytes,91,req,name=RequiredField" json:"RequiredField,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *GoTest_OptionalGroup) Reset() { *m = GoTest_OptionalGroup{} } +func (m *GoTest_OptionalGroup) String() string { return proto.CompactTextString(m) } +func (*GoTest_OptionalGroup) ProtoMessage() {} + +func (m *GoTest_OptionalGroup) GetRequiredField() string { + if m != nil && m.RequiredField != nil { + return *m.RequiredField + } + return "" +} + +// For testing skipping of unrecognized fields. +// Numbers are all big, larger than tag numbers in GoTestField, +// the message used in the corresponding test. +type GoSkipTest struct { + SkipInt32 *int32 `protobuf:"varint,11,req,name=skip_int32" json:"skip_int32,omitempty"` + SkipFixed32 *uint32 `protobuf:"fixed32,12,req,name=skip_fixed32" json:"skip_fixed32,omitempty"` + SkipFixed64 *uint64 `protobuf:"fixed64,13,req,name=skip_fixed64" json:"skip_fixed64,omitempty"` + SkipString *string `protobuf:"bytes,14,req,name=skip_string" json:"skip_string,omitempty"` + Skipgroup *GoSkipTest_SkipGroup `protobuf:"group,15,req,name=SkipGroup" json:"skipgroup,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *GoSkipTest) Reset() { *m = GoSkipTest{} } +func (m *GoSkipTest) String() string { return proto.CompactTextString(m) } +func (*GoSkipTest) ProtoMessage() {} + +func (m *GoSkipTest) GetSkipInt32() int32 { + if m != nil && m.SkipInt32 != nil { + return *m.SkipInt32 + } + return 0 +} + +func (m *GoSkipTest) GetSkipFixed32() uint32 { + if m != nil && m.SkipFixed32 != nil { + return *m.SkipFixed32 + } + return 0 +} + +func (m *GoSkipTest) GetSkipFixed64() uint64 { + if m != nil && m.SkipFixed64 != nil { + return *m.SkipFixed64 + } + return 0 +} + +func (m *GoSkipTest) GetSkipString() string { + if m != nil && m.SkipString != nil { + return *m.SkipString + } + return "" +} + +func (m *GoSkipTest) GetSkipgroup() *GoSkipTest_SkipGroup { + if m != nil { + return m.Skipgroup + } + return nil +} + +type GoSkipTest_SkipGroup struct { + GroupInt32 *int32 `protobuf:"varint,16,req,name=group_int32" json:"group_int32,omitempty"` + GroupString *string `protobuf:"bytes,17,req,name=group_string" json:"group_string,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *GoSkipTest_SkipGroup) Reset() { *m = GoSkipTest_SkipGroup{} } +func (m *GoSkipTest_SkipGroup) String() string { return proto.CompactTextString(m) } +func (*GoSkipTest_SkipGroup) ProtoMessage() {} + +func (m *GoSkipTest_SkipGroup) GetGroupInt32() int32 { + if m != nil && m.GroupInt32 != nil { + return *m.GroupInt32 + } + return 0 +} + +func (m *GoSkipTest_SkipGroup) GetGroupString() string { + if m != nil && m.GroupString != nil { + return *m.GroupString + } + return "" +} + +// For testing packed/non-packed decoder switching. +// A serialized instance of one should be deserializable as the other. +type NonPackedTest struct { + A []int32 `protobuf:"varint,1,rep,name=a" json:"a,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *NonPackedTest) Reset() { *m = NonPackedTest{} } +func (m *NonPackedTest) String() string { return proto.CompactTextString(m) } +func (*NonPackedTest) ProtoMessage() {} + +func (m *NonPackedTest) GetA() []int32 { + if m != nil { + return m.A + } + return nil +} + +type PackedTest struct { + B []int32 `protobuf:"varint,1,rep,packed,name=b" json:"b,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *PackedTest) Reset() { *m = PackedTest{} } +func (m *PackedTest) String() string { return proto.CompactTextString(m) } +func (*PackedTest) ProtoMessage() {} + +func (m *PackedTest) GetB() []int32 { + if m != nil { + return m.B + } + return nil +} + +type MaxTag struct { + // Maximum possible tag number. + LastField *string `protobuf:"bytes,536870911,opt,name=last_field" json:"last_field,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *MaxTag) Reset() { *m = MaxTag{} } +func (m *MaxTag) String() string { return proto.CompactTextString(m) } +func (*MaxTag) ProtoMessage() {} + +func (m *MaxTag) GetLastField() string { + if m != nil && m.LastField != nil { + return *m.LastField + } + return "" +} + +type OldMessage struct { + Nested *OldMessage_Nested `protobuf:"bytes,1,opt,name=nested" json:"nested,omitempty"` + Num *int32 `protobuf:"varint,2,opt,name=num" json:"num,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *OldMessage) Reset() { *m = OldMessage{} } +func (m *OldMessage) String() string { return proto.CompactTextString(m) } +func (*OldMessage) ProtoMessage() {} + +func (m *OldMessage) GetNested() *OldMessage_Nested { + if m != nil { + return m.Nested + } + return nil +} + +func (m *OldMessage) GetNum() int32 { + if m != nil && m.Num != nil { + return *m.Num + } + return 0 +} + +type OldMessage_Nested struct { + Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *OldMessage_Nested) Reset() { *m = OldMessage_Nested{} } +func (m *OldMessage_Nested) String() string { return proto.CompactTextString(m) } +func (*OldMessage_Nested) ProtoMessage() {} + +func (m *OldMessage_Nested) GetName() string { + if m != nil && m.Name != nil { + return *m.Name + } + return "" +} + +// NewMessage is wire compatible with OldMessage; +// imagine it as a future version. +type NewMessage struct { + Nested *NewMessage_Nested `protobuf:"bytes,1,opt,name=nested" json:"nested,omitempty"` + // This is an int32 in OldMessage. + Num *int64 `protobuf:"varint,2,opt,name=num" json:"num,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *NewMessage) Reset() { *m = NewMessage{} } +func (m *NewMessage) String() string { return proto.CompactTextString(m) } +func (*NewMessage) ProtoMessage() {} + +func (m *NewMessage) GetNested() *NewMessage_Nested { + if m != nil { + return m.Nested + } + return nil +} + +func (m *NewMessage) GetNum() int64 { + if m != nil && m.Num != nil { + return *m.Num + } + return 0 +} + +type NewMessage_Nested struct { + Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + FoodGroup *string `protobuf:"bytes,2,opt,name=food_group" json:"food_group,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *NewMessage_Nested) Reset() { *m = NewMessage_Nested{} } +func (m *NewMessage_Nested) String() string { return proto.CompactTextString(m) } +func (*NewMessage_Nested) ProtoMessage() {} + +func (m *NewMessage_Nested) GetName() string { + if m != nil && m.Name != nil { + return *m.Name + } + return "" +} + +func (m *NewMessage_Nested) GetFoodGroup() string { + if m != nil && m.FoodGroup != nil { + return *m.FoodGroup + } + return "" +} + +type InnerMessage struct { + Host *string `protobuf:"bytes,1,req,name=host" json:"host,omitempty"` + Port *int32 `protobuf:"varint,2,opt,name=port,def=4000" json:"port,omitempty"` + Connected *bool `protobuf:"varint,3,opt,name=connected" json:"connected,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *InnerMessage) Reset() { *m = InnerMessage{} } +func (m *InnerMessage) String() string { return proto.CompactTextString(m) } +func (*InnerMessage) ProtoMessage() {} + +const Default_InnerMessage_Port int32 = 4000 + +func (m *InnerMessage) GetHost() string { + if m != nil && m.Host != nil { + return *m.Host + } + return "" +} + +func (m *InnerMessage) GetPort() int32 { + if m != nil && m.Port != nil { + return *m.Port + } + return Default_InnerMessage_Port +} + +func (m *InnerMessage) GetConnected() bool { + if m != nil && m.Connected != nil { + return *m.Connected + } + return false +} + +type OtherMessage struct { + Key *int64 `protobuf:"varint,1,opt,name=key" json:"key,omitempty"` + Value []byte `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"` + Weight *float32 `protobuf:"fixed32,3,opt,name=weight" json:"weight,omitempty"` + Inner *InnerMessage `protobuf:"bytes,4,opt,name=inner" json:"inner,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *OtherMessage) Reset() { *m = OtherMessage{} } +func (m *OtherMessage) String() string { return proto.CompactTextString(m) } +func (*OtherMessage) ProtoMessage() {} + +func (m *OtherMessage) GetKey() int64 { + if m != nil && m.Key != nil { + return *m.Key + } + return 0 +} + +func (m *OtherMessage) GetValue() []byte { + if m != nil { + return m.Value + } + return nil +} + +func (m *OtherMessage) GetWeight() float32 { + if m != nil && m.Weight != nil { + return *m.Weight + } + return 0 +} + +func (m *OtherMessage) GetInner() *InnerMessage { + if m != nil { + return m.Inner + } + return nil +} + +type MyMessage struct { + Count *int32 `protobuf:"varint,1,req,name=count" json:"count,omitempty"` + Name *string `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"` + Quote *string `protobuf:"bytes,3,opt,name=quote" json:"quote,omitempty"` + Pet []string `protobuf:"bytes,4,rep,name=pet" json:"pet,omitempty"` + Inner *InnerMessage `protobuf:"bytes,5,opt,name=inner" json:"inner,omitempty"` + Others []*OtherMessage `protobuf:"bytes,6,rep,name=others" json:"others,omitempty"` + RepInner []*InnerMessage `protobuf:"bytes,12,rep,name=rep_inner" json:"rep_inner,omitempty"` + Bikeshed *MyMessage_Color `protobuf:"varint,7,opt,name=bikeshed,enum=testdata.MyMessage_Color" json:"bikeshed,omitempty"` + Somegroup *MyMessage_SomeGroup `protobuf:"group,8,opt,name=SomeGroup" json:"somegroup,omitempty"` + // This field becomes [][]byte in the generated code. + RepBytes [][]byte `protobuf:"bytes,10,rep,name=rep_bytes" json:"rep_bytes,omitempty"` + Bigfloat *float64 `protobuf:"fixed64,11,opt,name=bigfloat" json:"bigfloat,omitempty"` + XXX_extensions map[int32]proto.Extension `json:"-"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *MyMessage) Reset() { *m = MyMessage{} } +func (m *MyMessage) String() string { return proto.CompactTextString(m) } +func (*MyMessage) ProtoMessage() {} + +var extRange_MyMessage = []proto.ExtensionRange{ + {100, 536870911}, +} + +func (*MyMessage) ExtensionRangeArray() []proto.ExtensionRange { + return extRange_MyMessage +} +func (m *MyMessage) ExtensionMap() map[int32]proto.Extension { + if m.XXX_extensions == nil { + m.XXX_extensions = make(map[int32]proto.Extension) + } + return m.XXX_extensions +} + +func (m *MyMessage) GetCount() int32 { + if m != nil && m.Count != nil { + return *m.Count + } + return 0 +} + +func (m *MyMessage) GetName() string { + if m != nil && m.Name != nil { + return *m.Name + } + return "" +} + +func (m *MyMessage) GetQuote() string { + if m != nil && m.Quote != nil { + return *m.Quote + } + return "" +} + +func (m *MyMessage) GetPet() []string { + if m != nil { + return m.Pet + } + return nil +} + +func (m *MyMessage) GetInner() *InnerMessage { + if m != nil { + return m.Inner + } + return nil +} + +func (m *MyMessage) GetOthers() []*OtherMessage { + if m != nil { + return m.Others + } + return nil +} + +func (m *MyMessage) GetRepInner() []*InnerMessage { + if m != nil { + return m.RepInner + } + return nil +} + +func (m *MyMessage) GetBikeshed() MyMessage_Color { + if m != nil && m.Bikeshed != nil { + return *m.Bikeshed + } + return MyMessage_RED +} + +func (m *MyMessage) GetSomegroup() *MyMessage_SomeGroup { + if m != nil { + return m.Somegroup + } + return nil +} + +func (m *MyMessage) GetRepBytes() [][]byte { + if m != nil { + return m.RepBytes + } + return nil +} + +func (m *MyMessage) GetBigfloat() float64 { + if m != nil && m.Bigfloat != nil { + return *m.Bigfloat + } + return 0 +} + +type MyMessage_SomeGroup struct { + GroupField *int32 `protobuf:"varint,9,opt,name=group_field" json:"group_field,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *MyMessage_SomeGroup) Reset() { *m = MyMessage_SomeGroup{} } +func (m *MyMessage_SomeGroup) String() string { return proto.CompactTextString(m) } +func (*MyMessage_SomeGroup) ProtoMessage() {} + +func (m *MyMessage_SomeGroup) GetGroupField() int32 { + if m != nil && m.GroupField != nil { + return *m.GroupField + } + return 0 +} + +type Ext struct { + Data *string `protobuf:"bytes,1,opt,name=data" json:"data,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *Ext) Reset() { *m = Ext{} } +func (m *Ext) String() string { return proto.CompactTextString(m) } +func (*Ext) ProtoMessage() {} + +func (m *Ext) GetData() string { + if m != nil && m.Data != nil { + return *m.Data + } + return "" +} + +var E_Ext_More = &proto.ExtensionDesc{ + ExtendedType: (*MyMessage)(nil), + ExtensionType: (*Ext)(nil), + Field: 103, + Name: "testdata.Ext.more", + Tag: "bytes,103,opt,name=more", +} + +var E_Ext_Text = &proto.ExtensionDesc{ + ExtendedType: (*MyMessage)(nil), + ExtensionType: (*string)(nil), + Field: 104, + Name: "testdata.Ext.text", + Tag: "bytes,104,opt,name=text", +} + +var E_Ext_Number = &proto.ExtensionDesc{ + ExtendedType: (*MyMessage)(nil), + ExtensionType: (*int32)(nil), + Field: 105, + Name: "testdata.Ext.number", + Tag: "varint,105,opt,name=number", +} + +type DefaultsMessage struct { + XXX_extensions map[int32]proto.Extension `json:"-"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *DefaultsMessage) Reset() { *m = DefaultsMessage{} } +func (m *DefaultsMessage) String() string { return proto.CompactTextString(m) } +func (*DefaultsMessage) ProtoMessage() {} + +var extRange_DefaultsMessage = []proto.ExtensionRange{ + {100, 536870911}, +} + +func (*DefaultsMessage) ExtensionRangeArray() []proto.ExtensionRange { + return extRange_DefaultsMessage +} +func (m *DefaultsMessage) ExtensionMap() map[int32]proto.Extension { + if m.XXX_extensions == nil { + m.XXX_extensions = make(map[int32]proto.Extension) + } + return m.XXX_extensions +} + +type MyMessageSet struct { + XXX_extensions map[int32]proto.Extension `json:"-"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *MyMessageSet) Reset() { *m = MyMessageSet{} } +func (m *MyMessageSet) String() string { return proto.CompactTextString(m) } +func (*MyMessageSet) ProtoMessage() {} + +func (m *MyMessageSet) Marshal() ([]byte, error) { + return proto.MarshalMessageSet(m.ExtensionMap()) +} +func (m *MyMessageSet) Unmarshal(buf []byte) error { + return proto.UnmarshalMessageSet(buf, m.ExtensionMap()) +} +func (m *MyMessageSet) MarshalJSON() ([]byte, error) { + return proto.MarshalMessageSetJSON(m.XXX_extensions) +} +func (m *MyMessageSet) UnmarshalJSON(buf []byte) error { + return proto.UnmarshalMessageSetJSON(buf, m.XXX_extensions) +} + +// ensure MyMessageSet satisfies proto.Marshaler and proto.Unmarshaler +var _ proto.Marshaler = (*MyMessageSet)(nil) +var _ proto.Unmarshaler = (*MyMessageSet)(nil) + +var extRange_MyMessageSet = []proto.ExtensionRange{ + {100, 2147483646}, +} + +func (*MyMessageSet) ExtensionRangeArray() []proto.ExtensionRange { + return extRange_MyMessageSet +} +func (m *MyMessageSet) ExtensionMap() map[int32]proto.Extension { + if m.XXX_extensions == nil { + m.XXX_extensions = make(map[int32]proto.Extension) + } + return m.XXX_extensions +} + +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() {} + +type MessageList struct { + Message []*MessageList_Message `protobuf:"group,1,rep,name=Message" json:"message,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *MessageList) Reset() { *m = MessageList{} } +func (m *MessageList) String() string { return proto.CompactTextString(m) } +func (*MessageList) ProtoMessage() {} + +func (m *MessageList) GetMessage() []*MessageList_Message { + if m != nil { + return m.Message + } + return nil +} + +type MessageList_Message struct { + Name *string `protobuf:"bytes,2,req,name=name" json:"name,omitempty"` + Count *int32 `protobuf:"varint,3,req,name=count" json:"count,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *MessageList_Message) Reset() { *m = MessageList_Message{} } +func (m *MessageList_Message) String() string { return proto.CompactTextString(m) } +func (*MessageList_Message) ProtoMessage() {} + +func (m *MessageList_Message) GetName() string { + if m != nil && m.Name != nil { + return *m.Name + } + return "" +} + +func (m *MessageList_Message) GetCount() int32 { + if m != nil && m.Count != nil { + return *m.Count + } + return 0 +} + +type Strings struct { + StringField *string `protobuf:"bytes,1,opt,name=string_field" json:"string_field,omitempty"` + BytesField []byte `protobuf:"bytes,2,opt,name=bytes_field" json:"bytes_field,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *Strings) Reset() { *m = Strings{} } +func (m *Strings) String() string { return proto.CompactTextString(m) } +func (*Strings) ProtoMessage() {} + +func (m *Strings) GetStringField() string { + if m != nil && m.StringField != nil { + return *m.StringField + } + return "" +} + +func (m *Strings) GetBytesField() []byte { + if m != nil { + return m.BytesField + } + return nil +} + +type Defaults struct { + // Default-valued fields of all basic types. + // Same as GoTest, but copied here to make testing easier. + F_Bool *bool `protobuf:"varint,1,opt,name=F_Bool,def=1" json:"F_Bool,omitempty"` + F_Int32 *int32 `protobuf:"varint,2,opt,name=F_Int32,def=32" json:"F_Int32,omitempty"` + F_Int64 *int64 `protobuf:"varint,3,opt,name=F_Int64,def=64" json:"F_Int64,omitempty"` + F_Fixed32 *uint32 `protobuf:"fixed32,4,opt,name=F_Fixed32,def=320" json:"F_Fixed32,omitempty"` + F_Fixed64 *uint64 `protobuf:"fixed64,5,opt,name=F_Fixed64,def=640" json:"F_Fixed64,omitempty"` + F_Uint32 *uint32 `protobuf:"varint,6,opt,name=F_Uint32,def=3200" json:"F_Uint32,omitempty"` + F_Uint64 *uint64 `protobuf:"varint,7,opt,name=F_Uint64,def=6400" json:"F_Uint64,omitempty"` + F_Float *float32 `protobuf:"fixed32,8,opt,name=F_Float,def=314159" json:"F_Float,omitempty"` + F_Double *float64 `protobuf:"fixed64,9,opt,name=F_Double,def=271828" json:"F_Double,omitempty"` + F_String *string `protobuf:"bytes,10,opt,name=F_String,def=hello, \"world!\"\n" json:"F_String,omitempty"` + F_Bytes []byte `protobuf:"bytes,11,opt,name=F_Bytes,def=Bignose" json:"F_Bytes,omitempty"` + F_Sint32 *int32 `protobuf:"zigzag32,12,opt,name=F_Sint32,def=-32" json:"F_Sint32,omitempty"` + F_Sint64 *int64 `protobuf:"zigzag64,13,opt,name=F_Sint64,def=-64" json:"F_Sint64,omitempty"` + F_Enum *Defaults_Color `protobuf:"varint,14,opt,name=F_Enum,enum=testdata.Defaults_Color,def=1" json:"F_Enum,omitempty"` + // More fields with crazy defaults. + F_Pinf *float32 `protobuf:"fixed32,15,opt,name=F_Pinf,def=inf" json:"F_Pinf,omitempty"` + F_Ninf *float32 `protobuf:"fixed32,16,opt,name=F_Ninf,def=-inf" json:"F_Ninf,omitempty"` + F_Nan *float32 `protobuf:"fixed32,17,opt,name=F_Nan,def=nan" json:"F_Nan,omitempty"` + // Sub-message. + Sub *SubDefaults `protobuf:"bytes,18,opt,name=sub" json:"sub,omitempty"` + // Redundant but explicit defaults. + StrZero *string `protobuf:"bytes,19,opt,name=str_zero,def=" json:"str_zero,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *Defaults) Reset() { *m = Defaults{} } +func (m *Defaults) String() string { return proto.CompactTextString(m) } +func (*Defaults) ProtoMessage() {} + +const Default_Defaults_F_Bool bool = true +const Default_Defaults_F_Int32 int32 = 32 +const Default_Defaults_F_Int64 int64 = 64 +const Default_Defaults_F_Fixed32 uint32 = 320 +const Default_Defaults_F_Fixed64 uint64 = 640 +const Default_Defaults_F_Uint32 uint32 = 3200 +const Default_Defaults_F_Uint64 uint64 = 6400 +const Default_Defaults_F_Float float32 = 314159 +const Default_Defaults_F_Double float64 = 271828 +const Default_Defaults_F_String string = "hello, \"world!\"\n" + +var Default_Defaults_F_Bytes []byte = []byte("Bignose") + +const Default_Defaults_F_Sint32 int32 = -32 +const Default_Defaults_F_Sint64 int64 = -64 +const Default_Defaults_F_Enum Defaults_Color = Defaults_GREEN + +var Default_Defaults_F_Pinf float32 = float32(math.Inf(1)) +var Default_Defaults_F_Ninf float32 = float32(math.Inf(-1)) +var Default_Defaults_F_Nan float32 = float32(math.NaN()) + +func (m *Defaults) GetF_Bool() bool { + if m != nil && m.F_Bool != nil { + return *m.F_Bool + } + return Default_Defaults_F_Bool +} + +func (m *Defaults) GetF_Int32() int32 { + if m != nil && m.F_Int32 != nil { + return *m.F_Int32 + } + return Default_Defaults_F_Int32 +} + +func (m *Defaults) GetF_Int64() int64 { + if m != nil && m.F_Int64 != nil { + return *m.F_Int64 + } + return Default_Defaults_F_Int64 +} + +func (m *Defaults) GetF_Fixed32() uint32 { + if m != nil && m.F_Fixed32 != nil { + return *m.F_Fixed32 + } + return Default_Defaults_F_Fixed32 +} + +func (m *Defaults) GetF_Fixed64() uint64 { + if m != nil && m.F_Fixed64 != nil { + return *m.F_Fixed64 + } + return Default_Defaults_F_Fixed64 +} + +func (m *Defaults) GetF_Uint32() uint32 { + if m != nil && m.F_Uint32 != nil { + return *m.F_Uint32 + } + return Default_Defaults_F_Uint32 +} + +func (m *Defaults) GetF_Uint64() uint64 { + if m != nil && m.F_Uint64 != nil { + return *m.F_Uint64 + } + return Default_Defaults_F_Uint64 +} + +func (m *Defaults) GetF_Float() float32 { + if m != nil && m.F_Float != nil { + return *m.F_Float + } + return Default_Defaults_F_Float +} + +func (m *Defaults) GetF_Double() float64 { + if m != nil && m.F_Double != nil { + return *m.F_Double + } + return Default_Defaults_F_Double +} + +func (m *Defaults) GetF_String() string { + if m != nil && m.F_String != nil { + return *m.F_String + } + return Default_Defaults_F_String +} + +func (m *Defaults) GetF_Bytes() []byte { + if m != nil && m.F_Bytes != nil { + return m.F_Bytes + } + return append([]byte(nil), Default_Defaults_F_Bytes...) +} + +func (m *Defaults) GetF_Sint32() int32 { + if m != nil && m.F_Sint32 != nil { + return *m.F_Sint32 + } + return Default_Defaults_F_Sint32 +} + +func (m *Defaults) GetF_Sint64() int64 { + if m != nil && m.F_Sint64 != nil { + return *m.F_Sint64 + } + return Default_Defaults_F_Sint64 +} + +func (m *Defaults) GetF_Enum() Defaults_Color { + if m != nil && m.F_Enum != nil { + return *m.F_Enum + } + return Default_Defaults_F_Enum +} + +func (m *Defaults) GetF_Pinf() float32 { + if m != nil && m.F_Pinf != nil { + return *m.F_Pinf + } + return Default_Defaults_F_Pinf +} + +func (m *Defaults) GetF_Ninf() float32 { + if m != nil && m.F_Ninf != nil { + return *m.F_Ninf + } + return Default_Defaults_F_Ninf +} + +func (m *Defaults) GetF_Nan() float32 { + if m != nil && m.F_Nan != nil { + return *m.F_Nan + } + return Default_Defaults_F_Nan +} + +func (m *Defaults) GetSub() *SubDefaults { + if m != nil { + return m.Sub + } + return nil +} + +func (m *Defaults) GetStrZero() string { + if m != nil && m.StrZero != nil { + return *m.StrZero + } + return "" +} + +type SubDefaults struct { + N *int64 `protobuf:"varint,1,opt,name=n,def=7" json:"n,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *SubDefaults) Reset() { *m = SubDefaults{} } +func (m *SubDefaults) String() string { return proto.CompactTextString(m) } +func (*SubDefaults) ProtoMessage() {} + +const Default_SubDefaults_N int64 = 7 + +func (m *SubDefaults) GetN() int64 { + if m != nil && m.N != nil { + return *m.N + } + return Default_SubDefaults_N +} + +type RepeatedEnum struct { + Color []RepeatedEnum_Color `protobuf:"varint,1,rep,name=color,enum=testdata.RepeatedEnum_Color" json:"color,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *RepeatedEnum) Reset() { *m = RepeatedEnum{} } +func (m *RepeatedEnum) String() string { return proto.CompactTextString(m) } +func (*RepeatedEnum) ProtoMessage() {} + +func (m *RepeatedEnum) GetColor() []RepeatedEnum_Color { + if m != nil { + return m.Color + } + return nil +} + +type MoreRepeated struct { + Bools []bool `protobuf:"varint,1,rep,name=bools" json:"bools,omitempty"` + BoolsPacked []bool `protobuf:"varint,2,rep,packed,name=bools_packed" json:"bools_packed,omitempty"` + Ints []int32 `protobuf:"varint,3,rep,name=ints" json:"ints,omitempty"` + IntsPacked []int32 `protobuf:"varint,4,rep,packed,name=ints_packed" json:"ints_packed,omitempty"` + Int64SPacked []int64 `protobuf:"varint,7,rep,packed,name=int64s_packed" json:"int64s_packed,omitempty"` + Strings []string `protobuf:"bytes,5,rep,name=strings" json:"strings,omitempty"` + Fixeds []uint32 `protobuf:"fixed32,6,rep,name=fixeds" json:"fixeds,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *MoreRepeated) Reset() { *m = MoreRepeated{} } +func (m *MoreRepeated) String() string { return proto.CompactTextString(m) } +func (*MoreRepeated) ProtoMessage() {} + +func (m *MoreRepeated) GetBools() []bool { + if m != nil { + return m.Bools + } + return nil +} + +func (m *MoreRepeated) GetBoolsPacked() []bool { + if m != nil { + return m.BoolsPacked + } + return nil +} + +func (m *MoreRepeated) GetInts() []int32 { + if m != nil { + return m.Ints + } + return nil +} + +func (m *MoreRepeated) GetIntsPacked() []int32 { + if m != nil { + return m.IntsPacked + } + return nil +} + +func (m *MoreRepeated) GetInt64SPacked() []int64 { + if m != nil { + return m.Int64SPacked + } + return nil +} + +func (m *MoreRepeated) GetStrings() []string { + if m != nil { + return m.Strings + } + return nil +} + +func (m *MoreRepeated) GetFixeds() []uint32 { + if m != nil { + return m.Fixeds + } + return nil +} + +type GroupOld struct { + G *GroupOld_G `protobuf:"group,101,opt,name=G" json:"g,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *GroupOld) Reset() { *m = GroupOld{} } +func (m *GroupOld) String() string { return proto.CompactTextString(m) } +func (*GroupOld) ProtoMessage() {} + +func (m *GroupOld) GetG() *GroupOld_G { + if m != nil { + return m.G + } + return nil +} + +type GroupOld_G struct { + X *int32 `protobuf:"varint,2,opt,name=x" json:"x,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *GroupOld_G) Reset() { *m = GroupOld_G{} } +func (m *GroupOld_G) String() string { return proto.CompactTextString(m) } +func (*GroupOld_G) ProtoMessage() {} + +func (m *GroupOld_G) GetX() int32 { + if m != nil && m.X != nil { + return *m.X + } + return 0 +} + +type GroupNew struct { + G *GroupNew_G `protobuf:"group,101,opt,name=G" json:"g,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *GroupNew) Reset() { *m = GroupNew{} } +func (m *GroupNew) String() string { return proto.CompactTextString(m) } +func (*GroupNew) ProtoMessage() {} + +func (m *GroupNew) GetG() *GroupNew_G { + if m != nil { + return m.G + } + return nil +} + +type GroupNew_G struct { + X *int32 `protobuf:"varint,2,opt,name=x" json:"x,omitempty"` + Y *int32 `protobuf:"varint,3,opt,name=y" json:"y,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *GroupNew_G) Reset() { *m = GroupNew_G{} } +func (m *GroupNew_G) String() string { return proto.CompactTextString(m) } +func (*GroupNew_G) ProtoMessage() {} + +func (m *GroupNew_G) GetX() int32 { + if m != nil && m.X != nil { + return *m.X + } + return 0 +} + +func (m *GroupNew_G) GetY() int32 { + if m != nil && m.Y != nil { + return *m.Y + } + return 0 +} + +type FloatingPoint struct { + F *float64 `protobuf:"fixed64,1,req,name=f" json:"f,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *FloatingPoint) Reset() { *m = FloatingPoint{} } +func (m *FloatingPoint) String() string { return proto.CompactTextString(m) } +func (*FloatingPoint) ProtoMessage() {} + +func (m *FloatingPoint) GetF() float64 { + if m != nil && m.F != nil { + return *m.F + } + return 0 +} + +type MessageWithMap struct { + NameMapping map[int32]string `protobuf:"bytes,1,rep,name=name_mapping" json:"name_mapping,omitempty" protobuf_key:"varint,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + MsgMapping map[int64]*FloatingPoint `protobuf:"bytes,2,rep,name=msg_mapping" json:"msg_mapping,omitempty" protobuf_key:"zigzag64,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + ByteMapping map[bool][]byte `protobuf:"bytes,3,rep,name=byte_mapping" json:"byte_mapping,omitempty" protobuf_key:"varint,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + StrToStr map[string]string `protobuf:"bytes,4,rep,name=str_to_str" json:"str_to_str,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *MessageWithMap) Reset() { *m = MessageWithMap{} } +func (m *MessageWithMap) String() string { return proto.CompactTextString(m) } +func (*MessageWithMap) ProtoMessage() {} + +func (m *MessageWithMap) GetNameMapping() map[int32]string { + if m != nil { + return m.NameMapping + } + return nil +} + +func (m *MessageWithMap) GetMsgMapping() map[int64]*FloatingPoint { + if m != nil { + return m.MsgMapping + } + return nil +} + +func (m *MessageWithMap) GetByteMapping() map[bool][]byte { + if m != nil { + return m.ByteMapping + } + return nil +} + +func (m *MessageWithMap) GetStrToStr() map[string]string { + if m != nil { + return m.StrToStr + } + return nil +} + +type Communique struct { + MakeMeCry *bool `protobuf:"varint,1,opt,name=make_me_cry" json:"make_me_cry,omitempty"` + // This is a oneof, called "union". + // + // Types that are valid to be assigned to Union: + // *Communique_Number + // *Communique_Name + // *Communique_Data + // *Communique_TempC + // *Communique_Col + // *Communique_Msg + Union isCommunique_Union `protobuf_oneof:"union"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *Communique) Reset() { *m = Communique{} } +func (m *Communique) String() string { return proto.CompactTextString(m) } +func (*Communique) ProtoMessage() {} + +type isCommunique_Union interface { + isCommunique_Union() +} + +type Communique_Number struct { + Number int32 `protobuf:"varint,5,opt,name=number,oneof"` +} +type Communique_Name struct { + Name string `protobuf:"bytes,6,opt,name=name,oneof"` +} +type Communique_Data struct { + Data []byte `protobuf:"bytes,7,opt,name=data,oneof"` +} +type Communique_TempC struct { + TempC float64 `protobuf:"fixed64,8,opt,name=temp_c,oneof"` +} +type Communique_Col struct { + Col MyMessage_Color `protobuf:"varint,9,opt,name=col,enum=testdata.MyMessage_Color,oneof"` +} +type Communique_Msg struct { + Msg *Strings `protobuf:"bytes,10,opt,name=msg,oneof"` +} + +func (*Communique_Number) isCommunique_Union() {} +func (*Communique_Name) isCommunique_Union() {} +func (*Communique_Data) isCommunique_Union() {} +func (*Communique_TempC) isCommunique_Union() {} +func (*Communique_Col) isCommunique_Union() {} +func (*Communique_Msg) isCommunique_Union() {} + +func (m *Communique) GetUnion() isCommunique_Union { + if m != nil { + return m.Union + } + return nil +} + +func (m *Communique) GetMakeMeCry() bool { + if m != nil && m.MakeMeCry != nil { + return *m.MakeMeCry + } + return false +} + +func (m *Communique) GetNumber() int32 { + if x, ok := m.GetUnion().(*Communique_Number); ok { + return x.Number + } + return 0 +} + +func (m *Communique) GetName() string { + if x, ok := m.GetUnion().(*Communique_Name); ok { + return x.Name + } + return "" +} + +func (m *Communique) GetData() []byte { + if x, ok := m.GetUnion().(*Communique_Data); ok { + return x.Data + } + return nil +} + +func (m *Communique) GetTempC() float64 { + if x, ok := m.GetUnion().(*Communique_TempC); ok { + return x.TempC + } + return 0 +} + +func (m *Communique) GetCol() MyMessage_Color { + if x, ok := m.GetUnion().(*Communique_Col); ok { + return x.Col + } + return MyMessage_RED +} + +func (m *Communique) GetMsg() *Strings { + if x, ok := m.GetUnion().(*Communique_Msg); ok { + return x.Msg + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*Communique) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), []interface{}) { + return _Communique_OneofMarshaler, _Communique_OneofUnmarshaler, []interface{}{ + (*Communique_Number)(nil), + (*Communique_Name)(nil), + (*Communique_Data)(nil), + (*Communique_TempC)(nil), + (*Communique_Col)(nil), + (*Communique_Msg)(nil), + } +} + +func _Communique_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*Communique) + // union + switch x := m.Union.(type) { + case *Communique_Number: + _ = b.EncodeVarint(5<<3 | proto.WireVarint) + _ = b.EncodeVarint(uint64(x.Number)) + case *Communique_Name: + _ = b.EncodeVarint(6<<3 | proto.WireBytes) + _ = b.EncodeStringBytes(x.Name) + case *Communique_Data: + _ = b.EncodeVarint(7<<3 | proto.WireBytes) + _ = b.EncodeRawBytes(x.Data) + case *Communique_TempC: + _ = b.EncodeVarint(8<<3 | proto.WireFixed64) + _ = b.EncodeFixed64(math.Float64bits(x.TempC)) + case *Communique_Col: + _ = b.EncodeVarint(9<<3 | proto.WireVarint) + _ = b.EncodeVarint(uint64(x.Col)) + case *Communique_Msg: + _ = b.EncodeVarint(10<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Msg); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("Communique.Union has unexpected type %T", x) + } + return nil +} + +func _Communique_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*Communique) + switch tag { + case 5: // union.number + if wire != proto.WireVarint { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeVarint() + m.Union = &Communique_Number{int32(x)} + return true, err + case 6: // union.name + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeStringBytes() + m.Union = &Communique_Name{x} + return true, err + case 7: // union.data + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeRawBytes(true) + m.Union = &Communique_Data{x} + return true, err + case 8: // union.temp_c + if wire != proto.WireFixed64 { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeFixed64() + m.Union = &Communique_TempC{math.Float64frombits(x)} + return true, err + case 9: // union.col + if wire != proto.WireVarint { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeVarint() + m.Union = &Communique_Col{MyMessage_Color(x)} + return true, err + case 10: // union.msg + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(Strings) + err := b.DecodeMessage(msg) + m.Union = &Communique_Msg{msg} + return true, err + default: + return false, nil + } +} + +var E_Greeting = &proto.ExtensionDesc{ + ExtendedType: (*MyMessage)(nil), + ExtensionType: ([]string)(nil), + Field: 106, + Name: "testdata.greeting", + Tag: "bytes,106,rep,name=greeting", +} + +var E_NoDefaultDouble = &proto.ExtensionDesc{ + ExtendedType: (*DefaultsMessage)(nil), + ExtensionType: (*float64)(nil), + Field: 101, + Name: "testdata.no_default_double", + Tag: "fixed64,101,opt,name=no_default_double", +} + +var E_NoDefaultFloat = &proto.ExtensionDesc{ + ExtendedType: (*DefaultsMessage)(nil), + ExtensionType: (*float32)(nil), + Field: 102, + Name: "testdata.no_default_float", + Tag: "fixed32,102,opt,name=no_default_float", +} + +var E_NoDefaultInt32 = &proto.ExtensionDesc{ + ExtendedType: (*DefaultsMessage)(nil), + ExtensionType: (*int32)(nil), + Field: 103, + Name: "testdata.no_default_int32", + Tag: "varint,103,opt,name=no_default_int32", +} + +var E_NoDefaultInt64 = &proto.ExtensionDesc{ + ExtendedType: (*DefaultsMessage)(nil), + ExtensionType: (*int64)(nil), + Field: 104, + Name: "testdata.no_default_int64", + Tag: "varint,104,opt,name=no_default_int64", +} + +var E_NoDefaultUint32 = &proto.ExtensionDesc{ + ExtendedType: (*DefaultsMessage)(nil), + ExtensionType: (*uint32)(nil), + Field: 105, + Name: "testdata.no_default_uint32", + Tag: "varint,105,opt,name=no_default_uint32", +} + +var E_NoDefaultUint64 = &proto.ExtensionDesc{ + ExtendedType: (*DefaultsMessage)(nil), + ExtensionType: (*uint64)(nil), + Field: 106, + Name: "testdata.no_default_uint64", + Tag: "varint,106,opt,name=no_default_uint64", +} + +var E_NoDefaultSint32 = &proto.ExtensionDesc{ + ExtendedType: (*DefaultsMessage)(nil), + ExtensionType: (*int32)(nil), + Field: 107, + Name: "testdata.no_default_sint32", + Tag: "zigzag32,107,opt,name=no_default_sint32", +} + +var E_NoDefaultSint64 = &proto.ExtensionDesc{ + ExtendedType: (*DefaultsMessage)(nil), + ExtensionType: (*int64)(nil), + Field: 108, + Name: "testdata.no_default_sint64", + Tag: "zigzag64,108,opt,name=no_default_sint64", +} + +var E_NoDefaultFixed32 = &proto.ExtensionDesc{ + ExtendedType: (*DefaultsMessage)(nil), + ExtensionType: (*uint32)(nil), + Field: 109, + Name: "testdata.no_default_fixed32", + Tag: "fixed32,109,opt,name=no_default_fixed32", +} + +var E_NoDefaultFixed64 = &proto.ExtensionDesc{ + ExtendedType: (*DefaultsMessage)(nil), + ExtensionType: (*uint64)(nil), + Field: 110, + Name: "testdata.no_default_fixed64", + Tag: "fixed64,110,opt,name=no_default_fixed64", +} + +var E_NoDefaultSfixed32 = &proto.ExtensionDesc{ + ExtendedType: (*DefaultsMessage)(nil), + ExtensionType: (*int32)(nil), + Field: 111, + Name: "testdata.no_default_sfixed32", + Tag: "fixed32,111,opt,name=no_default_sfixed32", +} + +var E_NoDefaultSfixed64 = &proto.ExtensionDesc{ + ExtendedType: (*DefaultsMessage)(nil), + ExtensionType: (*int64)(nil), + Field: 112, + Name: "testdata.no_default_sfixed64", + Tag: "fixed64,112,opt,name=no_default_sfixed64", +} + +var E_NoDefaultBool = &proto.ExtensionDesc{ + ExtendedType: (*DefaultsMessage)(nil), + ExtensionType: (*bool)(nil), + Field: 113, + Name: "testdata.no_default_bool", + Tag: "varint,113,opt,name=no_default_bool", +} + +var E_NoDefaultString = &proto.ExtensionDesc{ + ExtendedType: (*DefaultsMessage)(nil), + ExtensionType: (*string)(nil), + Field: 114, + Name: "testdata.no_default_string", + Tag: "bytes,114,opt,name=no_default_string", +} + +var E_NoDefaultBytes = &proto.ExtensionDesc{ + ExtendedType: (*DefaultsMessage)(nil), + ExtensionType: ([]byte)(nil), + Field: 115, + Name: "testdata.no_default_bytes", + Tag: "bytes,115,opt,name=no_default_bytes", +} + +var E_NoDefaultEnum = &proto.ExtensionDesc{ + ExtendedType: (*DefaultsMessage)(nil), + ExtensionType: (*DefaultsMessage_DefaultsEnum)(nil), + Field: 116, + Name: "testdata.no_default_enum", + Tag: "varint,116,opt,name=no_default_enum,enum=testdata.DefaultsMessage_DefaultsEnum", +} + +var E_DefaultDouble = &proto.ExtensionDesc{ + ExtendedType: (*DefaultsMessage)(nil), + ExtensionType: (*float64)(nil), + Field: 201, + Name: "testdata.default_double", + Tag: "fixed64,201,opt,name=default_double,def=3.1415", +} + +var E_DefaultFloat = &proto.ExtensionDesc{ + ExtendedType: (*DefaultsMessage)(nil), + ExtensionType: (*float32)(nil), + Field: 202, + Name: "testdata.default_float", + Tag: "fixed32,202,opt,name=default_float,def=3.14", +} + +var E_DefaultInt32 = &proto.ExtensionDesc{ + ExtendedType: (*DefaultsMessage)(nil), + ExtensionType: (*int32)(nil), + Field: 203, + Name: "testdata.default_int32", + Tag: "varint,203,opt,name=default_int32,def=42", +} + +var E_DefaultInt64 = &proto.ExtensionDesc{ + ExtendedType: (*DefaultsMessage)(nil), + ExtensionType: (*int64)(nil), + Field: 204, + Name: "testdata.default_int64", + Tag: "varint,204,opt,name=default_int64,def=43", +} + +var E_DefaultUint32 = &proto.ExtensionDesc{ + ExtendedType: (*DefaultsMessage)(nil), + ExtensionType: (*uint32)(nil), + Field: 205, + Name: "testdata.default_uint32", + Tag: "varint,205,opt,name=default_uint32,def=44", +} + +var E_DefaultUint64 = &proto.ExtensionDesc{ + ExtendedType: (*DefaultsMessage)(nil), + ExtensionType: (*uint64)(nil), + Field: 206, + Name: "testdata.default_uint64", + Tag: "varint,206,opt,name=default_uint64,def=45", +} + +var E_DefaultSint32 = &proto.ExtensionDesc{ + ExtendedType: (*DefaultsMessage)(nil), + ExtensionType: (*int32)(nil), + Field: 207, + Name: "testdata.default_sint32", + Tag: "zigzag32,207,opt,name=default_sint32,def=46", +} + +var E_DefaultSint64 = &proto.ExtensionDesc{ + ExtendedType: (*DefaultsMessage)(nil), + ExtensionType: (*int64)(nil), + Field: 208, + Name: "testdata.default_sint64", + Tag: "zigzag64,208,opt,name=default_sint64,def=47", +} + +var E_DefaultFixed32 = &proto.ExtensionDesc{ + ExtendedType: (*DefaultsMessage)(nil), + ExtensionType: (*uint32)(nil), + Field: 209, + Name: "testdata.default_fixed32", + Tag: "fixed32,209,opt,name=default_fixed32,def=48", +} + +var E_DefaultFixed64 = &proto.ExtensionDesc{ + ExtendedType: (*DefaultsMessage)(nil), + ExtensionType: (*uint64)(nil), + Field: 210, + Name: "testdata.default_fixed64", + Tag: "fixed64,210,opt,name=default_fixed64,def=49", +} + +var E_DefaultSfixed32 = &proto.ExtensionDesc{ + ExtendedType: (*DefaultsMessage)(nil), + ExtensionType: (*int32)(nil), + Field: 211, + Name: "testdata.default_sfixed32", + Tag: "fixed32,211,opt,name=default_sfixed32,def=50", +} + +var E_DefaultSfixed64 = &proto.ExtensionDesc{ + ExtendedType: (*DefaultsMessage)(nil), + ExtensionType: (*int64)(nil), + Field: 212, + Name: "testdata.default_sfixed64", + Tag: "fixed64,212,opt,name=default_sfixed64,def=51", +} + +var E_DefaultBool = &proto.ExtensionDesc{ + ExtendedType: (*DefaultsMessage)(nil), + ExtensionType: (*bool)(nil), + Field: 213, + Name: "testdata.default_bool", + Tag: "varint,213,opt,name=default_bool,def=1", +} + +var E_DefaultString = &proto.ExtensionDesc{ + ExtendedType: (*DefaultsMessage)(nil), + ExtensionType: (*string)(nil), + Field: 214, + Name: "testdata.default_string", + Tag: "bytes,214,opt,name=default_string,def=Hello, string", +} + +var E_DefaultBytes = &proto.ExtensionDesc{ + ExtendedType: (*DefaultsMessage)(nil), + ExtensionType: ([]byte)(nil), + Field: 215, + Name: "testdata.default_bytes", + Tag: "bytes,215,opt,name=default_bytes,def=Hello, bytes", +} + +var E_DefaultEnum = &proto.ExtensionDesc{ + ExtendedType: (*DefaultsMessage)(nil), + ExtensionType: (*DefaultsMessage_DefaultsEnum)(nil), + Field: 216, + Name: "testdata.default_enum", + Tag: "varint,216,opt,name=default_enum,enum=testdata.DefaultsMessage_DefaultsEnum,def=1", +} + +var E_X201 = &proto.ExtensionDesc{ + ExtendedType: (*MyMessageSet)(nil), + ExtensionType: (*Empty)(nil), + Field: 201, + Name: "testdata.x201", + Tag: "bytes,201,opt,name=x201", +} + +var E_X202 = &proto.ExtensionDesc{ + ExtendedType: (*MyMessageSet)(nil), + ExtensionType: (*Empty)(nil), + Field: 202, + Name: "testdata.x202", + Tag: "bytes,202,opt,name=x202", +} + +var E_X203 = &proto.ExtensionDesc{ + ExtendedType: (*MyMessageSet)(nil), + ExtensionType: (*Empty)(nil), + Field: 203, + Name: "testdata.x203", + Tag: "bytes,203,opt,name=x203", +} + +var E_X204 = &proto.ExtensionDesc{ + ExtendedType: (*MyMessageSet)(nil), + ExtensionType: (*Empty)(nil), + Field: 204, + Name: "testdata.x204", + Tag: "bytes,204,opt,name=x204", +} + +var E_X205 = &proto.ExtensionDesc{ + ExtendedType: (*MyMessageSet)(nil), + ExtensionType: (*Empty)(nil), + Field: 205, + Name: "testdata.x205", + Tag: "bytes,205,opt,name=x205", +} + +var E_X206 = &proto.ExtensionDesc{ + ExtendedType: (*MyMessageSet)(nil), + ExtensionType: (*Empty)(nil), + Field: 206, + Name: "testdata.x206", + Tag: "bytes,206,opt,name=x206", +} + +var E_X207 = &proto.ExtensionDesc{ + ExtendedType: (*MyMessageSet)(nil), + ExtensionType: (*Empty)(nil), + Field: 207, + Name: "testdata.x207", + Tag: "bytes,207,opt,name=x207", +} + +var E_X208 = &proto.ExtensionDesc{ + ExtendedType: (*MyMessageSet)(nil), + ExtensionType: (*Empty)(nil), + Field: 208, + Name: "testdata.x208", + Tag: "bytes,208,opt,name=x208", +} + +var E_X209 = &proto.ExtensionDesc{ + ExtendedType: (*MyMessageSet)(nil), + ExtensionType: (*Empty)(nil), + Field: 209, + Name: "testdata.x209", + Tag: "bytes,209,opt,name=x209", +} + +var E_X210 = &proto.ExtensionDesc{ + ExtendedType: (*MyMessageSet)(nil), + ExtensionType: (*Empty)(nil), + Field: 210, + Name: "testdata.x210", + Tag: "bytes,210,opt,name=x210", +} + +var E_X211 = &proto.ExtensionDesc{ + ExtendedType: (*MyMessageSet)(nil), + ExtensionType: (*Empty)(nil), + Field: 211, + Name: "testdata.x211", + Tag: "bytes,211,opt,name=x211", +} + +var E_X212 = &proto.ExtensionDesc{ + ExtendedType: (*MyMessageSet)(nil), + ExtensionType: (*Empty)(nil), + Field: 212, + Name: "testdata.x212", + Tag: "bytes,212,opt,name=x212", +} + +var E_X213 = &proto.ExtensionDesc{ + ExtendedType: (*MyMessageSet)(nil), + ExtensionType: (*Empty)(nil), + Field: 213, + Name: "testdata.x213", + Tag: "bytes,213,opt,name=x213", +} + +var E_X214 = &proto.ExtensionDesc{ + ExtendedType: (*MyMessageSet)(nil), + ExtensionType: (*Empty)(nil), + Field: 214, + Name: "testdata.x214", + Tag: "bytes,214,opt,name=x214", +} + +var E_X215 = &proto.ExtensionDesc{ + ExtendedType: (*MyMessageSet)(nil), + ExtensionType: (*Empty)(nil), + Field: 215, + Name: "testdata.x215", + Tag: "bytes,215,opt,name=x215", +} + +var E_X216 = &proto.ExtensionDesc{ + ExtendedType: (*MyMessageSet)(nil), + ExtensionType: (*Empty)(nil), + Field: 216, + Name: "testdata.x216", + Tag: "bytes,216,opt,name=x216", +} + +var E_X217 = &proto.ExtensionDesc{ + ExtendedType: (*MyMessageSet)(nil), + ExtensionType: (*Empty)(nil), + Field: 217, + Name: "testdata.x217", + Tag: "bytes,217,opt,name=x217", +} + +var E_X218 = &proto.ExtensionDesc{ + ExtendedType: (*MyMessageSet)(nil), + ExtensionType: (*Empty)(nil), + Field: 218, + Name: "testdata.x218", + Tag: "bytes,218,opt,name=x218", +} + +var E_X219 = &proto.ExtensionDesc{ + ExtendedType: (*MyMessageSet)(nil), + ExtensionType: (*Empty)(nil), + Field: 219, + Name: "testdata.x219", + Tag: "bytes,219,opt,name=x219", +} + +var E_X220 = &proto.ExtensionDesc{ + ExtendedType: (*MyMessageSet)(nil), + ExtensionType: (*Empty)(nil), + Field: 220, + Name: "testdata.x220", + Tag: "bytes,220,opt,name=x220", +} + +var E_X221 = &proto.ExtensionDesc{ + ExtendedType: (*MyMessageSet)(nil), + ExtensionType: (*Empty)(nil), + Field: 221, + Name: "testdata.x221", + Tag: "bytes,221,opt,name=x221", +} + +var E_X222 = &proto.ExtensionDesc{ + ExtendedType: (*MyMessageSet)(nil), + ExtensionType: (*Empty)(nil), + Field: 222, + Name: "testdata.x222", + Tag: "bytes,222,opt,name=x222", +} + +var E_X223 = &proto.ExtensionDesc{ + ExtendedType: (*MyMessageSet)(nil), + ExtensionType: (*Empty)(nil), + Field: 223, + Name: "testdata.x223", + Tag: "bytes,223,opt,name=x223", +} + +var E_X224 = &proto.ExtensionDesc{ + ExtendedType: (*MyMessageSet)(nil), + ExtensionType: (*Empty)(nil), + Field: 224, + Name: "testdata.x224", + Tag: "bytes,224,opt,name=x224", +} + +var E_X225 = &proto.ExtensionDesc{ + ExtendedType: (*MyMessageSet)(nil), + ExtensionType: (*Empty)(nil), + Field: 225, + Name: "testdata.x225", + Tag: "bytes,225,opt,name=x225", +} + +var E_X226 = &proto.ExtensionDesc{ + ExtendedType: (*MyMessageSet)(nil), + ExtensionType: (*Empty)(nil), + Field: 226, + Name: "testdata.x226", + Tag: "bytes,226,opt,name=x226", +} + +var E_X227 = &proto.ExtensionDesc{ + ExtendedType: (*MyMessageSet)(nil), + ExtensionType: (*Empty)(nil), + Field: 227, + Name: "testdata.x227", + Tag: "bytes,227,opt,name=x227", +} + +var E_X228 = &proto.ExtensionDesc{ + ExtendedType: (*MyMessageSet)(nil), + ExtensionType: (*Empty)(nil), + Field: 228, + Name: "testdata.x228", + Tag: "bytes,228,opt,name=x228", +} + +var E_X229 = &proto.ExtensionDesc{ + ExtendedType: (*MyMessageSet)(nil), + ExtensionType: (*Empty)(nil), + Field: 229, + Name: "testdata.x229", + Tag: "bytes,229,opt,name=x229", +} + +var E_X230 = &proto.ExtensionDesc{ + ExtendedType: (*MyMessageSet)(nil), + ExtensionType: (*Empty)(nil), + Field: 230, + Name: "testdata.x230", + Tag: "bytes,230,opt,name=x230", +} + +var E_X231 = &proto.ExtensionDesc{ + ExtendedType: (*MyMessageSet)(nil), + ExtensionType: (*Empty)(nil), + Field: 231, + Name: "testdata.x231", + Tag: "bytes,231,opt,name=x231", +} + +var E_X232 = &proto.ExtensionDesc{ + ExtendedType: (*MyMessageSet)(nil), + ExtensionType: (*Empty)(nil), + Field: 232, + Name: "testdata.x232", + Tag: "bytes,232,opt,name=x232", +} + +var E_X233 = &proto.ExtensionDesc{ + ExtendedType: (*MyMessageSet)(nil), + ExtensionType: (*Empty)(nil), + Field: 233, + Name: "testdata.x233", + Tag: "bytes,233,opt,name=x233", +} + +var E_X234 = &proto.ExtensionDesc{ + ExtendedType: (*MyMessageSet)(nil), + ExtensionType: (*Empty)(nil), + Field: 234, + Name: "testdata.x234", + Tag: "bytes,234,opt,name=x234", +} + +var E_X235 = &proto.ExtensionDesc{ + ExtendedType: (*MyMessageSet)(nil), + ExtensionType: (*Empty)(nil), + Field: 235, + Name: "testdata.x235", + Tag: "bytes,235,opt,name=x235", +} + +var E_X236 = &proto.ExtensionDesc{ + ExtendedType: (*MyMessageSet)(nil), + ExtensionType: (*Empty)(nil), + Field: 236, + Name: "testdata.x236", + Tag: "bytes,236,opt,name=x236", +} + +var E_X237 = &proto.ExtensionDesc{ + ExtendedType: (*MyMessageSet)(nil), + ExtensionType: (*Empty)(nil), + Field: 237, + Name: "testdata.x237", + Tag: "bytes,237,opt,name=x237", +} + +var E_X238 = &proto.ExtensionDesc{ + ExtendedType: (*MyMessageSet)(nil), + ExtensionType: (*Empty)(nil), + Field: 238, + Name: "testdata.x238", + Tag: "bytes,238,opt,name=x238", +} + +var E_X239 = &proto.ExtensionDesc{ + ExtendedType: (*MyMessageSet)(nil), + ExtensionType: (*Empty)(nil), + Field: 239, + Name: "testdata.x239", + Tag: "bytes,239,opt,name=x239", +} + +var E_X240 = &proto.ExtensionDesc{ + ExtendedType: (*MyMessageSet)(nil), + ExtensionType: (*Empty)(nil), + Field: 240, + Name: "testdata.x240", + Tag: "bytes,240,opt,name=x240", +} + +var E_X241 = &proto.ExtensionDesc{ + ExtendedType: (*MyMessageSet)(nil), + ExtensionType: (*Empty)(nil), + Field: 241, + Name: "testdata.x241", + Tag: "bytes,241,opt,name=x241", +} + +var E_X242 = &proto.ExtensionDesc{ + ExtendedType: (*MyMessageSet)(nil), + ExtensionType: (*Empty)(nil), + Field: 242, + Name: "testdata.x242", + Tag: "bytes,242,opt,name=x242", +} + +var E_X243 = &proto.ExtensionDesc{ + ExtendedType: (*MyMessageSet)(nil), + ExtensionType: (*Empty)(nil), + Field: 243, + Name: "testdata.x243", + Tag: "bytes,243,opt,name=x243", +} + +var E_X244 = &proto.ExtensionDesc{ + ExtendedType: (*MyMessageSet)(nil), + ExtensionType: (*Empty)(nil), + Field: 244, + Name: "testdata.x244", + Tag: "bytes,244,opt,name=x244", +} + +var E_X245 = &proto.ExtensionDesc{ + ExtendedType: (*MyMessageSet)(nil), + ExtensionType: (*Empty)(nil), + Field: 245, + Name: "testdata.x245", + Tag: "bytes,245,opt,name=x245", +} + +var E_X246 = &proto.ExtensionDesc{ + ExtendedType: (*MyMessageSet)(nil), + ExtensionType: (*Empty)(nil), + Field: 246, + Name: "testdata.x246", + Tag: "bytes,246,opt,name=x246", +} + +var E_X247 = &proto.ExtensionDesc{ + ExtendedType: (*MyMessageSet)(nil), + ExtensionType: (*Empty)(nil), + Field: 247, + Name: "testdata.x247", + Tag: "bytes,247,opt,name=x247", +} + +var E_X248 = &proto.ExtensionDesc{ + ExtendedType: (*MyMessageSet)(nil), + ExtensionType: (*Empty)(nil), + Field: 248, + Name: "testdata.x248", + Tag: "bytes,248,opt,name=x248", +} + +var E_X249 = &proto.ExtensionDesc{ + ExtendedType: (*MyMessageSet)(nil), + ExtensionType: (*Empty)(nil), + Field: 249, + Name: "testdata.x249", + Tag: "bytes,249,opt,name=x249", +} + +var E_X250 = &proto.ExtensionDesc{ + ExtendedType: (*MyMessageSet)(nil), + ExtensionType: (*Empty)(nil), + Field: 250, + Name: "testdata.x250", + Tag: "bytes,250,opt,name=x250", +} + +func init() { + proto.RegisterEnum("testdata.FOO", FOO_name, FOO_value) + proto.RegisterEnum("testdata.GoTest_KIND", GoTest_KIND_name, GoTest_KIND_value) + proto.RegisterEnum("testdata.MyMessage_Color", MyMessage_Color_name, MyMessage_Color_value) + proto.RegisterEnum("testdata.DefaultsMessage_DefaultsEnum", DefaultsMessage_DefaultsEnum_name, DefaultsMessage_DefaultsEnum_value) + proto.RegisterEnum("testdata.Defaults_Color", Defaults_Color_name, Defaults_Color_value) + proto.RegisterEnum("testdata.RepeatedEnum_Color", RepeatedEnum_Color_name, RepeatedEnum_Color_value) + proto.RegisterExtension(E_Ext_More) + proto.RegisterExtension(E_Ext_Text) + proto.RegisterExtension(E_Ext_Number) + proto.RegisterExtension(E_Greeting) + proto.RegisterExtension(E_NoDefaultDouble) + proto.RegisterExtension(E_NoDefaultFloat) + proto.RegisterExtension(E_NoDefaultInt32) + proto.RegisterExtension(E_NoDefaultInt64) + proto.RegisterExtension(E_NoDefaultUint32) + proto.RegisterExtension(E_NoDefaultUint64) + proto.RegisterExtension(E_NoDefaultSint32) + proto.RegisterExtension(E_NoDefaultSint64) + proto.RegisterExtension(E_NoDefaultFixed32) + proto.RegisterExtension(E_NoDefaultFixed64) + proto.RegisterExtension(E_NoDefaultSfixed32) + proto.RegisterExtension(E_NoDefaultSfixed64) + proto.RegisterExtension(E_NoDefaultBool) + proto.RegisterExtension(E_NoDefaultString) + proto.RegisterExtension(E_NoDefaultBytes) + proto.RegisterExtension(E_NoDefaultEnum) + proto.RegisterExtension(E_DefaultDouble) + proto.RegisterExtension(E_DefaultFloat) + proto.RegisterExtension(E_DefaultInt32) + proto.RegisterExtension(E_DefaultInt64) + proto.RegisterExtension(E_DefaultUint32) + proto.RegisterExtension(E_DefaultUint64) + proto.RegisterExtension(E_DefaultSint32) + proto.RegisterExtension(E_DefaultSint64) + proto.RegisterExtension(E_DefaultFixed32) + proto.RegisterExtension(E_DefaultFixed64) + proto.RegisterExtension(E_DefaultSfixed32) + proto.RegisterExtension(E_DefaultSfixed64) + proto.RegisterExtension(E_DefaultBool) + proto.RegisterExtension(E_DefaultString) + proto.RegisterExtension(E_DefaultBytes) + proto.RegisterExtension(E_DefaultEnum) + proto.RegisterExtension(E_X201) + proto.RegisterExtension(E_X202) + proto.RegisterExtension(E_X203) + proto.RegisterExtension(E_X204) + proto.RegisterExtension(E_X205) + proto.RegisterExtension(E_X206) + proto.RegisterExtension(E_X207) + proto.RegisterExtension(E_X208) + proto.RegisterExtension(E_X209) + proto.RegisterExtension(E_X210) + proto.RegisterExtension(E_X211) + proto.RegisterExtension(E_X212) + proto.RegisterExtension(E_X213) + proto.RegisterExtension(E_X214) + proto.RegisterExtension(E_X215) + proto.RegisterExtension(E_X216) + proto.RegisterExtension(E_X217) + proto.RegisterExtension(E_X218) + proto.RegisterExtension(E_X219) + proto.RegisterExtension(E_X220) + proto.RegisterExtension(E_X221) + proto.RegisterExtension(E_X222) + proto.RegisterExtension(E_X223) + proto.RegisterExtension(E_X224) + proto.RegisterExtension(E_X225) + proto.RegisterExtension(E_X226) + proto.RegisterExtension(E_X227) + proto.RegisterExtension(E_X228) + proto.RegisterExtension(E_X229) + proto.RegisterExtension(E_X230) + proto.RegisterExtension(E_X231) + proto.RegisterExtension(E_X232) + proto.RegisterExtension(E_X233) + proto.RegisterExtension(E_X234) + proto.RegisterExtension(E_X235) + proto.RegisterExtension(E_X236) + proto.RegisterExtension(E_X237) + proto.RegisterExtension(E_X238) + proto.RegisterExtension(E_X239) + proto.RegisterExtension(E_X240) + proto.RegisterExtension(E_X241) + proto.RegisterExtension(E_X242) + proto.RegisterExtension(E_X243) + proto.RegisterExtension(E_X244) + proto.RegisterExtension(E_X245) + proto.RegisterExtension(E_X246) + proto.RegisterExtension(E_X247) + proto.RegisterExtension(E_X248) + proto.RegisterExtension(E_X249) + proto.RegisterExtension(E_X250) +} diff --git a/Godeps/_workspace/src/github.com/gogo/protobuf/proto/testdata/test.pb.go.golden b/Godeps/_workspace/src/github.com/gogo/protobuf/proto/testdata/test.pb.go.golden new file mode 100644 index 000000000000..0387853d56c6 --- /dev/null +++ b/Godeps/_workspace/src/github.com/gogo/protobuf/proto/testdata/test.pb.go.golden @@ -0,0 +1,1737 @@ +// Code generated by protoc-gen-gogo. +// source: test.proto +// DO NOT EDIT! + +package testdata + +import proto "github.com/gogo/protobuf/proto" +import json "encoding/json" +import math "math" + +import () + +// Reference proto, json, and math imports to suppress error if they are not otherwise used. +var _ = proto.Marshal +var _ = &json.SyntaxError{} +var _ = math.Inf + +type FOO int32 + +const ( + FOO_FOO1 FOO = 1 +) + +var FOO_name = map[int32]string{ + 1: "FOO1", +} +var FOO_value = map[string]int32{ + "FOO1": 1, +} + +func (x FOO) Enum() *FOO { + p := new(FOO) + *p = x + return p +} +func (x FOO) String() string { + return proto.EnumName(FOO_name, int32(x)) +} +func (x FOO) MarshalJSON() ([]byte, error) { + return json.Marshal(x.String()) +} +func (x *FOO) UnmarshalJSON(data []byte) error { + value, err := proto.UnmarshalJSONEnum(FOO_value, data, "FOO") + if err != nil { + return err + } + *x = FOO(value) + return nil +} + +type GoTest_KIND int32 + +const ( + GoTest_VOID GoTest_KIND = 0 + GoTest_BOOL GoTest_KIND = 1 + GoTest_BYTES GoTest_KIND = 2 + GoTest_FINGERPRINT GoTest_KIND = 3 + GoTest_FLOAT GoTest_KIND = 4 + GoTest_INT GoTest_KIND = 5 + GoTest_STRING GoTest_KIND = 6 + GoTest_TIME GoTest_KIND = 7 + GoTest_TUPLE GoTest_KIND = 8 + GoTest_ARRAY GoTest_KIND = 9 + GoTest_MAP GoTest_KIND = 10 + GoTest_TABLE GoTest_KIND = 11 + GoTest_FUNCTION GoTest_KIND = 12 +) + +var GoTest_KIND_name = map[int32]string{ + 0: "VOID", + 1: "BOOL", + 2: "BYTES", + 3: "FINGERPRINT", + 4: "FLOAT", + 5: "INT", + 6: "STRING", + 7: "TIME", + 8: "TUPLE", + 9: "ARRAY", + 10: "MAP", + 11: "TABLE", + 12: "FUNCTION", +} +var GoTest_KIND_value = map[string]int32{ + "VOID": 0, + "BOOL": 1, + "BYTES": 2, + "FINGERPRINT": 3, + "FLOAT": 4, + "INT": 5, + "STRING": 6, + "TIME": 7, + "TUPLE": 8, + "ARRAY": 9, + "MAP": 10, + "TABLE": 11, + "FUNCTION": 12, +} + +func (x GoTest_KIND) Enum() *GoTest_KIND { + p := new(GoTest_KIND) + *p = x + return p +} +func (x GoTest_KIND) String() string { + return proto.EnumName(GoTest_KIND_name, int32(x)) +} +func (x GoTest_KIND) MarshalJSON() ([]byte, error) { + return json.Marshal(x.String()) +} +func (x *GoTest_KIND) UnmarshalJSON(data []byte) error { + value, err := proto.UnmarshalJSONEnum(GoTest_KIND_value, data, "GoTest_KIND") + if err != nil { + return err + } + *x = GoTest_KIND(value) + return nil +} + +type MyMessage_Color int32 + +const ( + MyMessage_RED MyMessage_Color = 0 + MyMessage_GREEN MyMessage_Color = 1 + MyMessage_BLUE MyMessage_Color = 2 +) + +var MyMessage_Color_name = map[int32]string{ + 0: "RED", + 1: "GREEN", + 2: "BLUE", +} +var MyMessage_Color_value = map[string]int32{ + "RED": 0, + "GREEN": 1, + "BLUE": 2, +} + +func (x MyMessage_Color) Enum() *MyMessage_Color { + p := new(MyMessage_Color) + *p = x + return p +} +func (x MyMessage_Color) String() string { + return proto.EnumName(MyMessage_Color_name, int32(x)) +} +func (x MyMessage_Color) MarshalJSON() ([]byte, error) { + return json.Marshal(x.String()) +} +func (x *MyMessage_Color) UnmarshalJSON(data []byte) error { + value, err := proto.UnmarshalJSONEnum(MyMessage_Color_value, data, "MyMessage_Color") + if err != nil { + return err + } + *x = MyMessage_Color(value) + return nil +} + +type Defaults_Color int32 + +const ( + Defaults_RED Defaults_Color = 0 + Defaults_GREEN Defaults_Color = 1 + Defaults_BLUE Defaults_Color = 2 +) + +var Defaults_Color_name = map[int32]string{ + 0: "RED", + 1: "GREEN", + 2: "BLUE", +} +var Defaults_Color_value = map[string]int32{ + "RED": 0, + "GREEN": 1, + "BLUE": 2, +} + +func (x Defaults_Color) Enum() *Defaults_Color { + p := new(Defaults_Color) + *p = x + return p +} +func (x Defaults_Color) String() string { + return proto.EnumName(Defaults_Color_name, int32(x)) +} +func (x Defaults_Color) MarshalJSON() ([]byte, error) { + return json.Marshal(x.String()) +} +func (x *Defaults_Color) UnmarshalJSON(data []byte) error { + value, err := proto.UnmarshalJSONEnum(Defaults_Color_value, data, "Defaults_Color") + if err != nil { + return err + } + *x = Defaults_Color(value) + return nil +} + +type RepeatedEnum_Color int32 + +const ( + RepeatedEnum_RED RepeatedEnum_Color = 1 +) + +var RepeatedEnum_Color_name = map[int32]string{ + 1: "RED", +} +var RepeatedEnum_Color_value = map[string]int32{ + "RED": 1, +} + +func (x RepeatedEnum_Color) Enum() *RepeatedEnum_Color { + p := new(RepeatedEnum_Color) + *p = x + return p +} +func (x RepeatedEnum_Color) String() string { + return proto.EnumName(RepeatedEnum_Color_name, int32(x)) +} +func (x RepeatedEnum_Color) MarshalJSON() ([]byte, error) { + return json.Marshal(x.String()) +} +func (x *RepeatedEnum_Color) UnmarshalJSON(data []byte) error { + value, err := proto.UnmarshalJSONEnum(RepeatedEnum_Color_value, data, "RepeatedEnum_Color") + if err != nil { + return err + } + *x = RepeatedEnum_Color(value) + return nil +} + +type GoEnum struct { + Foo *FOO `protobuf:"varint,1,req,name=foo,enum=testdata.FOO" json:"foo,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *GoEnum) Reset() { *m = GoEnum{} } +func (m *GoEnum) String() string { return proto.CompactTextString(m) } +func (*GoEnum) ProtoMessage() {} + +func (m *GoEnum) GetFoo() FOO { + if m != nil && m.Foo != nil { + return *m.Foo + } + return 0 +} + +type GoTestField struct { + Label *string `protobuf:"bytes,1,req" json:"Label,omitempty"` + Type *string `protobuf:"bytes,2,req" json:"Type,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *GoTestField) Reset() { *m = GoTestField{} } +func (m *GoTestField) String() string { return proto.CompactTextString(m) } +func (*GoTestField) ProtoMessage() {} + +func (m *GoTestField) GetLabel() string { + if m != nil && m.Label != nil { + return *m.Label + } + return "" +} + +func (m *GoTestField) GetType() string { + if m != nil && m.Type != nil { + return *m.Type + } + return "" +} + +type GoTest struct { + Kind *GoTest_KIND `protobuf:"varint,1,req,enum=testdata.GoTest_KIND" json:"Kind,omitempty"` + Table *string `protobuf:"bytes,2,opt" json:"Table,omitempty"` + Param *int32 `protobuf:"varint,3,opt" json:"Param,omitempty"` + RequiredField *GoTestField `protobuf:"bytes,4,req" json:"RequiredField,omitempty"` + RepeatedField []*GoTestField `protobuf:"bytes,5,rep" json:"RepeatedField,omitempty"` + OptionalField *GoTestField `protobuf:"bytes,6,opt" json:"OptionalField,omitempty"` + F_BoolRequired *bool `protobuf:"varint,10,req,name=F_Bool_required" json:"F_Bool_required,omitempty"` + F_Int32Required *int32 `protobuf:"varint,11,req,name=F_Int32_required" json:"F_Int32_required,omitempty"` + F_Int64Required *int64 `protobuf:"varint,12,req,name=F_Int64_required" json:"F_Int64_required,omitempty"` + F_Fixed32Required *uint32 `protobuf:"fixed32,13,req,name=F_Fixed32_required" json:"F_Fixed32_required,omitempty"` + F_Fixed64Required *uint64 `protobuf:"fixed64,14,req,name=F_Fixed64_required" json:"F_Fixed64_required,omitempty"` + F_Uint32Required *uint32 `protobuf:"varint,15,req,name=F_Uint32_required" json:"F_Uint32_required,omitempty"` + F_Uint64Required *uint64 `protobuf:"varint,16,req,name=F_Uint64_required" json:"F_Uint64_required,omitempty"` + F_FloatRequired *float32 `protobuf:"fixed32,17,req,name=F_Float_required" json:"F_Float_required,omitempty"` + F_DoubleRequired *float64 `protobuf:"fixed64,18,req,name=F_Double_required" json:"F_Double_required,omitempty"` + F_StringRequired *string `protobuf:"bytes,19,req,name=F_String_required" json:"F_String_required,omitempty"` + F_BytesRequired []byte `protobuf:"bytes,101,req,name=F_Bytes_required" json:"F_Bytes_required,omitempty"` + F_Sint32Required *int32 `protobuf:"zigzag32,102,req,name=F_Sint32_required" json:"F_Sint32_required,omitempty"` + F_Sint64Required *int64 `protobuf:"zigzag64,103,req,name=F_Sint64_required" json:"F_Sint64_required,omitempty"` + F_BoolRepeated []bool `protobuf:"varint,20,rep,name=F_Bool_repeated" json:"F_Bool_repeated,omitempty"` + F_Int32Repeated []int32 `protobuf:"varint,21,rep,name=F_Int32_repeated" json:"F_Int32_repeated,omitempty"` + F_Int64Repeated []int64 `protobuf:"varint,22,rep,name=F_Int64_repeated" json:"F_Int64_repeated,omitempty"` + F_Fixed32Repeated []uint32 `protobuf:"fixed32,23,rep,name=F_Fixed32_repeated" json:"F_Fixed32_repeated,omitempty"` + F_Fixed64Repeated []uint64 `protobuf:"fixed64,24,rep,name=F_Fixed64_repeated" json:"F_Fixed64_repeated,omitempty"` + F_Uint32Repeated []uint32 `protobuf:"varint,25,rep,name=F_Uint32_repeated" json:"F_Uint32_repeated,omitempty"` + F_Uint64Repeated []uint64 `protobuf:"varint,26,rep,name=F_Uint64_repeated" json:"F_Uint64_repeated,omitempty"` + F_FloatRepeated []float32 `protobuf:"fixed32,27,rep,name=F_Float_repeated" json:"F_Float_repeated,omitempty"` + F_DoubleRepeated []float64 `protobuf:"fixed64,28,rep,name=F_Double_repeated" json:"F_Double_repeated,omitempty"` + F_StringRepeated []string `protobuf:"bytes,29,rep,name=F_String_repeated" json:"F_String_repeated,omitempty"` + F_BytesRepeated [][]byte `protobuf:"bytes,201,rep,name=F_Bytes_repeated" json:"F_Bytes_repeated,omitempty"` + F_Sint32Repeated []int32 `protobuf:"zigzag32,202,rep,name=F_Sint32_repeated" json:"F_Sint32_repeated,omitempty"` + F_Sint64Repeated []int64 `protobuf:"zigzag64,203,rep,name=F_Sint64_repeated" json:"F_Sint64_repeated,omitempty"` + F_BoolOptional *bool `protobuf:"varint,30,opt,name=F_Bool_optional" json:"F_Bool_optional,omitempty"` + F_Int32Optional *int32 `protobuf:"varint,31,opt,name=F_Int32_optional" json:"F_Int32_optional,omitempty"` + F_Int64Optional *int64 `protobuf:"varint,32,opt,name=F_Int64_optional" json:"F_Int64_optional,omitempty"` + F_Fixed32Optional *uint32 `protobuf:"fixed32,33,opt,name=F_Fixed32_optional" json:"F_Fixed32_optional,omitempty"` + F_Fixed64Optional *uint64 `protobuf:"fixed64,34,opt,name=F_Fixed64_optional" json:"F_Fixed64_optional,omitempty"` + F_Uint32Optional *uint32 `protobuf:"varint,35,opt,name=F_Uint32_optional" json:"F_Uint32_optional,omitempty"` + F_Uint64Optional *uint64 `protobuf:"varint,36,opt,name=F_Uint64_optional" json:"F_Uint64_optional,omitempty"` + F_FloatOptional *float32 `protobuf:"fixed32,37,opt,name=F_Float_optional" json:"F_Float_optional,omitempty"` + F_DoubleOptional *float64 `protobuf:"fixed64,38,opt,name=F_Double_optional" json:"F_Double_optional,omitempty"` + F_StringOptional *string `protobuf:"bytes,39,opt,name=F_String_optional" json:"F_String_optional,omitempty"` + F_BytesOptional []byte `protobuf:"bytes,301,opt,name=F_Bytes_optional" json:"F_Bytes_optional,omitempty"` + F_Sint32Optional *int32 `protobuf:"zigzag32,302,opt,name=F_Sint32_optional" json:"F_Sint32_optional,omitempty"` + F_Sint64Optional *int64 `protobuf:"zigzag64,303,opt,name=F_Sint64_optional" json:"F_Sint64_optional,omitempty"` + F_BoolDefaulted *bool `protobuf:"varint,40,opt,name=F_Bool_defaulted,def=1" json:"F_Bool_defaulted,omitempty"` + F_Int32Defaulted *int32 `protobuf:"varint,41,opt,name=F_Int32_defaulted,def=32" json:"F_Int32_defaulted,omitempty"` + F_Int64Defaulted *int64 `protobuf:"varint,42,opt,name=F_Int64_defaulted,def=64" json:"F_Int64_defaulted,omitempty"` + F_Fixed32Defaulted *uint32 `protobuf:"fixed32,43,opt,name=F_Fixed32_defaulted,def=320" json:"F_Fixed32_defaulted,omitempty"` + F_Fixed64Defaulted *uint64 `protobuf:"fixed64,44,opt,name=F_Fixed64_defaulted,def=640" json:"F_Fixed64_defaulted,omitempty"` + F_Uint32Defaulted *uint32 `protobuf:"varint,45,opt,name=F_Uint32_defaulted,def=3200" json:"F_Uint32_defaulted,omitempty"` + F_Uint64Defaulted *uint64 `protobuf:"varint,46,opt,name=F_Uint64_defaulted,def=6400" json:"F_Uint64_defaulted,omitempty"` + F_FloatDefaulted *float32 `protobuf:"fixed32,47,opt,name=F_Float_defaulted,def=314159" json:"F_Float_defaulted,omitempty"` + F_DoubleDefaulted *float64 `protobuf:"fixed64,48,opt,name=F_Double_defaulted,def=271828" json:"F_Double_defaulted,omitempty"` + F_StringDefaulted *string `protobuf:"bytes,49,opt,name=F_String_defaulted,def=hello, \"world!\"\n" json:"F_String_defaulted,omitempty"` + F_BytesDefaulted []byte `protobuf:"bytes,401,opt,name=F_Bytes_defaulted,def=Bignose" json:"F_Bytes_defaulted,omitempty"` + F_Sint32Defaulted *int32 `protobuf:"zigzag32,402,opt,name=F_Sint32_defaulted,def=-32" json:"F_Sint32_defaulted,omitempty"` + F_Sint64Defaulted *int64 `protobuf:"zigzag64,403,opt,name=F_Sint64_defaulted,def=-64" json:"F_Sint64_defaulted,omitempty"` + F_BoolRepeatedPacked []bool `protobuf:"varint,50,rep,packed,name=F_Bool_repeated_packed" json:"F_Bool_repeated_packed,omitempty"` + F_Int32RepeatedPacked []int32 `protobuf:"varint,51,rep,packed,name=F_Int32_repeated_packed" json:"F_Int32_repeated_packed,omitempty"` + F_Int64RepeatedPacked []int64 `protobuf:"varint,52,rep,packed,name=F_Int64_repeated_packed" json:"F_Int64_repeated_packed,omitempty"` + F_Fixed32RepeatedPacked []uint32 `protobuf:"fixed32,53,rep,packed,name=F_Fixed32_repeated_packed" json:"F_Fixed32_repeated_packed,omitempty"` + F_Fixed64RepeatedPacked []uint64 `protobuf:"fixed64,54,rep,packed,name=F_Fixed64_repeated_packed" json:"F_Fixed64_repeated_packed,omitempty"` + F_Uint32RepeatedPacked []uint32 `protobuf:"varint,55,rep,packed,name=F_Uint32_repeated_packed" json:"F_Uint32_repeated_packed,omitempty"` + F_Uint64RepeatedPacked []uint64 `protobuf:"varint,56,rep,packed,name=F_Uint64_repeated_packed" json:"F_Uint64_repeated_packed,omitempty"` + F_FloatRepeatedPacked []float32 `protobuf:"fixed32,57,rep,packed,name=F_Float_repeated_packed" json:"F_Float_repeated_packed,omitempty"` + F_DoubleRepeatedPacked []float64 `protobuf:"fixed64,58,rep,packed,name=F_Double_repeated_packed" json:"F_Double_repeated_packed,omitempty"` + F_Sint32RepeatedPacked []int32 `protobuf:"zigzag32,502,rep,packed,name=F_Sint32_repeated_packed" json:"F_Sint32_repeated_packed,omitempty"` + F_Sint64RepeatedPacked []int64 `protobuf:"zigzag64,503,rep,packed,name=F_Sint64_repeated_packed" json:"F_Sint64_repeated_packed,omitempty"` + Requiredgroup *GoTest_RequiredGroup `protobuf:"group,70,req,name=RequiredGroup" json:"requiredgroup,omitempty"` + Repeatedgroup []*GoTest_RepeatedGroup `protobuf:"group,80,rep,name=RepeatedGroup" json:"repeatedgroup,omitempty"` + Optionalgroup *GoTest_OptionalGroup `protobuf:"group,90,opt,name=OptionalGroup" json:"optionalgroup,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *GoTest) Reset() { *m = GoTest{} } +func (m *GoTest) String() string { return proto.CompactTextString(m) } +func (*GoTest) ProtoMessage() {} + +const Default_GoTest_F_BoolDefaulted bool = true +const Default_GoTest_F_Int32Defaulted int32 = 32 +const Default_GoTest_F_Int64Defaulted int64 = 64 +const Default_GoTest_F_Fixed32Defaulted uint32 = 320 +const Default_GoTest_F_Fixed64Defaulted uint64 = 640 +const Default_GoTest_F_Uint32Defaulted uint32 = 3200 +const Default_GoTest_F_Uint64Defaulted uint64 = 6400 +const Default_GoTest_F_FloatDefaulted float32 = 314159 +const Default_GoTest_F_DoubleDefaulted float64 = 271828 +const Default_GoTest_F_StringDefaulted string = "hello, \"world!\"\n" + +var Default_GoTest_F_BytesDefaulted []byte = []byte("Bignose") + +const Default_GoTest_F_Sint32Defaulted int32 = -32 +const Default_GoTest_F_Sint64Defaulted int64 = -64 + +func (m *GoTest) GetKind() GoTest_KIND { + if m != nil && m.Kind != nil { + return *m.Kind + } + return 0 +} + +func (m *GoTest) GetTable() string { + if m != nil && m.Table != nil { + return *m.Table + } + return "" +} + +func (m *GoTest) GetParam() int32 { + if m != nil && m.Param != nil { + return *m.Param + } + return 0 +} + +func (m *GoTest) GetRequiredField() *GoTestField { + if m != nil { + return m.RequiredField + } + return nil +} + +func (m *GoTest) GetRepeatedField() []*GoTestField { + if m != nil { + return m.RepeatedField + } + return nil +} + +func (m *GoTest) GetOptionalField() *GoTestField { + if m != nil { + return m.OptionalField + } + return nil +} + +func (m *GoTest) GetF_BoolRequired() bool { + if m != nil && m.F_BoolRequired != nil { + return *m.F_BoolRequired + } + return false +} + +func (m *GoTest) GetF_Int32Required() int32 { + if m != nil && m.F_Int32Required != nil { + return *m.F_Int32Required + } + return 0 +} + +func (m *GoTest) GetF_Int64Required() int64 { + if m != nil && m.F_Int64Required != nil { + return *m.F_Int64Required + } + return 0 +} + +func (m *GoTest) GetF_Fixed32Required() uint32 { + if m != nil && m.F_Fixed32Required != nil { + return *m.F_Fixed32Required + } + return 0 +} + +func (m *GoTest) GetF_Fixed64Required() uint64 { + if m != nil && m.F_Fixed64Required != nil { + return *m.F_Fixed64Required + } + return 0 +} + +func (m *GoTest) GetF_Uint32Required() uint32 { + if m != nil && m.F_Uint32Required != nil { + return *m.F_Uint32Required + } + return 0 +} + +func (m *GoTest) GetF_Uint64Required() uint64 { + if m != nil && m.F_Uint64Required != nil { + return *m.F_Uint64Required + } + return 0 +} + +func (m *GoTest) GetF_FloatRequired() float32 { + if m != nil && m.F_FloatRequired != nil { + return *m.F_FloatRequired + } + return 0 +} + +func (m *GoTest) GetF_DoubleRequired() float64 { + if m != nil && m.F_DoubleRequired != nil { + return *m.F_DoubleRequired + } + return 0 +} + +func (m *GoTest) GetF_StringRequired() string { + if m != nil && m.F_StringRequired != nil { + return *m.F_StringRequired + } + return "" +} + +func (m *GoTest) GetF_BytesRequired() []byte { + if m != nil { + return m.F_BytesRequired + } + return nil +} + +func (m *GoTest) GetF_Sint32Required() int32 { + if m != nil && m.F_Sint32Required != nil { + return *m.F_Sint32Required + } + return 0 +} + +func (m *GoTest) GetF_Sint64Required() int64 { + if m != nil && m.F_Sint64Required != nil { + return *m.F_Sint64Required + } + return 0 +} + +func (m *GoTest) GetF_BoolRepeated() []bool { + if m != nil { + return m.F_BoolRepeated + } + return nil +} + +func (m *GoTest) GetF_Int32Repeated() []int32 { + if m != nil { + return m.F_Int32Repeated + } + return nil +} + +func (m *GoTest) GetF_Int64Repeated() []int64 { + if m != nil { + return m.F_Int64Repeated + } + return nil +} + +func (m *GoTest) GetF_Fixed32Repeated() []uint32 { + if m != nil { + return m.F_Fixed32Repeated + } + return nil +} + +func (m *GoTest) GetF_Fixed64Repeated() []uint64 { + if m != nil { + return m.F_Fixed64Repeated + } + return nil +} + +func (m *GoTest) GetF_Uint32Repeated() []uint32 { + if m != nil { + return m.F_Uint32Repeated + } + return nil +} + +func (m *GoTest) GetF_Uint64Repeated() []uint64 { + if m != nil { + return m.F_Uint64Repeated + } + return nil +} + +func (m *GoTest) GetF_FloatRepeated() []float32 { + if m != nil { + return m.F_FloatRepeated + } + return nil +} + +func (m *GoTest) GetF_DoubleRepeated() []float64 { + if m != nil { + return m.F_DoubleRepeated + } + return nil +} + +func (m *GoTest) GetF_StringRepeated() []string { + if m != nil { + return m.F_StringRepeated + } + return nil +} + +func (m *GoTest) GetF_BytesRepeated() [][]byte { + if m != nil { + return m.F_BytesRepeated + } + return nil +} + +func (m *GoTest) GetF_Sint32Repeated() []int32 { + if m != nil { + return m.F_Sint32Repeated + } + return nil +} + +func (m *GoTest) GetF_Sint64Repeated() []int64 { + if m != nil { + return m.F_Sint64Repeated + } + return nil +} + +func (m *GoTest) GetF_BoolOptional() bool { + if m != nil && m.F_BoolOptional != nil { + return *m.F_BoolOptional + } + return false +} + +func (m *GoTest) GetF_Int32Optional() int32 { + if m != nil && m.F_Int32Optional != nil { + return *m.F_Int32Optional + } + return 0 +} + +func (m *GoTest) GetF_Int64Optional() int64 { + if m != nil && m.F_Int64Optional != nil { + return *m.F_Int64Optional + } + return 0 +} + +func (m *GoTest) GetF_Fixed32Optional() uint32 { + if m != nil && m.F_Fixed32Optional != nil { + return *m.F_Fixed32Optional + } + return 0 +} + +func (m *GoTest) GetF_Fixed64Optional() uint64 { + if m != nil && m.F_Fixed64Optional != nil { + return *m.F_Fixed64Optional + } + return 0 +} + +func (m *GoTest) GetF_Uint32Optional() uint32 { + if m != nil && m.F_Uint32Optional != nil { + return *m.F_Uint32Optional + } + return 0 +} + +func (m *GoTest) GetF_Uint64Optional() uint64 { + if m != nil && m.F_Uint64Optional != nil { + return *m.F_Uint64Optional + } + return 0 +} + +func (m *GoTest) GetF_FloatOptional() float32 { + if m != nil && m.F_FloatOptional != nil { + return *m.F_FloatOptional + } + return 0 +} + +func (m *GoTest) GetF_DoubleOptional() float64 { + if m != nil && m.F_DoubleOptional != nil { + return *m.F_DoubleOptional + } + return 0 +} + +func (m *GoTest) GetF_StringOptional() string { + if m != nil && m.F_StringOptional != nil { + return *m.F_StringOptional + } + return "" +} + +func (m *GoTest) GetF_BytesOptional() []byte { + if m != nil { + return m.F_BytesOptional + } + return nil +} + +func (m *GoTest) GetF_Sint32Optional() int32 { + if m != nil && m.F_Sint32Optional != nil { + return *m.F_Sint32Optional + } + return 0 +} + +func (m *GoTest) GetF_Sint64Optional() int64 { + if m != nil && m.F_Sint64Optional != nil { + return *m.F_Sint64Optional + } + return 0 +} + +func (m *GoTest) GetF_BoolDefaulted() bool { + if m != nil && m.F_BoolDefaulted != nil { + return *m.F_BoolDefaulted + } + return Default_GoTest_F_BoolDefaulted +} + +func (m *GoTest) GetF_Int32Defaulted() int32 { + if m != nil && m.F_Int32Defaulted != nil { + return *m.F_Int32Defaulted + } + return Default_GoTest_F_Int32Defaulted +} + +func (m *GoTest) GetF_Int64Defaulted() int64 { + if m != nil && m.F_Int64Defaulted != nil { + return *m.F_Int64Defaulted + } + return Default_GoTest_F_Int64Defaulted +} + +func (m *GoTest) GetF_Fixed32Defaulted() uint32 { + if m != nil && m.F_Fixed32Defaulted != nil { + return *m.F_Fixed32Defaulted + } + return Default_GoTest_F_Fixed32Defaulted +} + +func (m *GoTest) GetF_Fixed64Defaulted() uint64 { + if m != nil && m.F_Fixed64Defaulted != nil { + return *m.F_Fixed64Defaulted + } + return Default_GoTest_F_Fixed64Defaulted +} + +func (m *GoTest) GetF_Uint32Defaulted() uint32 { + if m != nil && m.F_Uint32Defaulted != nil { + return *m.F_Uint32Defaulted + } + return Default_GoTest_F_Uint32Defaulted +} + +func (m *GoTest) GetF_Uint64Defaulted() uint64 { + if m != nil && m.F_Uint64Defaulted != nil { + return *m.F_Uint64Defaulted + } + return Default_GoTest_F_Uint64Defaulted +} + +func (m *GoTest) GetF_FloatDefaulted() float32 { + if m != nil && m.F_FloatDefaulted != nil { + return *m.F_FloatDefaulted + } + return Default_GoTest_F_FloatDefaulted +} + +func (m *GoTest) GetF_DoubleDefaulted() float64 { + if m != nil && m.F_DoubleDefaulted != nil { + return *m.F_DoubleDefaulted + } + return Default_GoTest_F_DoubleDefaulted +} + +func (m *GoTest) GetF_StringDefaulted() string { + if m != nil && m.F_StringDefaulted != nil { + return *m.F_StringDefaulted + } + return Default_GoTest_F_StringDefaulted +} + +func (m *GoTest) GetF_BytesDefaulted() []byte { + if m != nil && m.F_BytesDefaulted != nil { + return m.F_BytesDefaulted + } + return append([]byte(nil), Default_GoTest_F_BytesDefaulted...) +} + +func (m *GoTest) GetF_Sint32Defaulted() int32 { + if m != nil && m.F_Sint32Defaulted != nil { + return *m.F_Sint32Defaulted + } + return Default_GoTest_F_Sint32Defaulted +} + +func (m *GoTest) GetF_Sint64Defaulted() int64 { + if m != nil && m.F_Sint64Defaulted != nil { + return *m.F_Sint64Defaulted + } + return Default_GoTest_F_Sint64Defaulted +} + +func (m *GoTest) GetF_BoolRepeatedPacked() []bool { + if m != nil { + return m.F_BoolRepeatedPacked + } + return nil +} + +func (m *GoTest) GetF_Int32RepeatedPacked() []int32 { + if m != nil { + return m.F_Int32RepeatedPacked + } + return nil +} + +func (m *GoTest) GetF_Int64RepeatedPacked() []int64 { + if m != nil { + return m.F_Int64RepeatedPacked + } + return nil +} + +func (m *GoTest) GetF_Fixed32RepeatedPacked() []uint32 { + if m != nil { + return m.F_Fixed32RepeatedPacked + } + return nil +} + +func (m *GoTest) GetF_Fixed64RepeatedPacked() []uint64 { + if m != nil { + return m.F_Fixed64RepeatedPacked + } + return nil +} + +func (m *GoTest) GetF_Uint32RepeatedPacked() []uint32 { + if m != nil { + return m.F_Uint32RepeatedPacked + } + return nil +} + +func (m *GoTest) GetF_Uint64RepeatedPacked() []uint64 { + if m != nil { + return m.F_Uint64RepeatedPacked + } + return nil +} + +func (m *GoTest) GetF_FloatRepeatedPacked() []float32 { + if m != nil { + return m.F_FloatRepeatedPacked + } + return nil +} + +func (m *GoTest) GetF_DoubleRepeatedPacked() []float64 { + if m != nil { + return m.F_DoubleRepeatedPacked + } + return nil +} + +func (m *GoTest) GetF_Sint32RepeatedPacked() []int32 { + if m != nil { + return m.F_Sint32RepeatedPacked + } + return nil +} + +func (m *GoTest) GetF_Sint64RepeatedPacked() []int64 { + if m != nil { + return m.F_Sint64RepeatedPacked + } + return nil +} + +func (m *GoTest) GetRequiredgroup() *GoTest_RequiredGroup { + if m != nil { + return m.Requiredgroup + } + return nil +} + +func (m *GoTest) GetRepeatedgroup() []*GoTest_RepeatedGroup { + if m != nil { + return m.Repeatedgroup + } + return nil +} + +func (m *GoTest) GetOptionalgroup() *GoTest_OptionalGroup { + if m != nil { + return m.Optionalgroup + } + return nil +} + +type GoTest_RequiredGroup struct { + RequiredField *string `protobuf:"bytes,71,req" json:"RequiredField,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *GoTest_RequiredGroup) Reset() { *m = GoTest_RequiredGroup{} } + +func (m *GoTest_RequiredGroup) GetRequiredField() string { + if m != nil && m.RequiredField != nil { + return *m.RequiredField + } + return "" +} + +type GoTest_RepeatedGroup struct { + RequiredField *string `protobuf:"bytes,81,req" json:"RequiredField,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *GoTest_RepeatedGroup) Reset() { *m = GoTest_RepeatedGroup{} } + +func (m *GoTest_RepeatedGroup) GetRequiredField() string { + if m != nil && m.RequiredField != nil { + return *m.RequiredField + } + return "" +} + +type GoTest_OptionalGroup struct { + RequiredField *string `protobuf:"bytes,91,req" json:"RequiredField,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *GoTest_OptionalGroup) Reset() { *m = GoTest_OptionalGroup{} } + +func (m *GoTest_OptionalGroup) GetRequiredField() string { + if m != nil && m.RequiredField != nil { + return *m.RequiredField + } + return "" +} + +type GoSkipTest struct { + SkipInt32 *int32 `protobuf:"varint,11,req,name=skip_int32" json:"skip_int32,omitempty"` + SkipFixed32 *uint32 `protobuf:"fixed32,12,req,name=skip_fixed32" json:"skip_fixed32,omitempty"` + SkipFixed64 *uint64 `protobuf:"fixed64,13,req,name=skip_fixed64" json:"skip_fixed64,omitempty"` + SkipString *string `protobuf:"bytes,14,req,name=skip_string" json:"skip_string,omitempty"` + Skipgroup *GoSkipTest_SkipGroup `protobuf:"group,15,req,name=SkipGroup" json:"skipgroup,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *GoSkipTest) Reset() { *m = GoSkipTest{} } +func (m *GoSkipTest) String() string { return proto.CompactTextString(m) } +func (*GoSkipTest) ProtoMessage() {} + +func (m *GoSkipTest) GetSkipInt32() int32 { + if m != nil && m.SkipInt32 != nil { + return *m.SkipInt32 + } + return 0 +} + +func (m *GoSkipTest) GetSkipFixed32() uint32 { + if m != nil && m.SkipFixed32 != nil { + return *m.SkipFixed32 + } + return 0 +} + +func (m *GoSkipTest) GetSkipFixed64() uint64 { + if m != nil && m.SkipFixed64 != nil { + return *m.SkipFixed64 + } + return 0 +} + +func (m *GoSkipTest) GetSkipString() string { + if m != nil && m.SkipString != nil { + return *m.SkipString + } + return "" +} + +func (m *GoSkipTest) GetSkipgroup() *GoSkipTest_SkipGroup { + if m != nil { + return m.Skipgroup + } + return nil +} + +type GoSkipTest_SkipGroup struct { + GroupInt32 *int32 `protobuf:"varint,16,req,name=group_int32" json:"group_int32,omitempty"` + GroupString *string `protobuf:"bytes,17,req,name=group_string" json:"group_string,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *GoSkipTest_SkipGroup) Reset() { *m = GoSkipTest_SkipGroup{} } + +func (m *GoSkipTest_SkipGroup) GetGroupInt32() int32 { + if m != nil && m.GroupInt32 != nil { + return *m.GroupInt32 + } + return 0 +} + +func (m *GoSkipTest_SkipGroup) GetGroupString() string { + if m != nil && m.GroupString != nil { + return *m.GroupString + } + return "" +} + +type NonPackedTest struct { + A []int32 `protobuf:"varint,1,rep,name=a" json:"a,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *NonPackedTest) Reset() { *m = NonPackedTest{} } +func (m *NonPackedTest) String() string { return proto.CompactTextString(m) } +func (*NonPackedTest) ProtoMessage() {} + +func (m *NonPackedTest) GetA() []int32 { + if m != nil { + return m.A + } + return nil +} + +type PackedTest struct { + B []int32 `protobuf:"varint,1,rep,packed,name=b" json:"b,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *PackedTest) Reset() { *m = PackedTest{} } +func (m *PackedTest) String() string { return proto.CompactTextString(m) } +func (*PackedTest) ProtoMessage() {} + +func (m *PackedTest) GetB() []int32 { + if m != nil { + return m.B + } + return nil +} + +type MaxTag struct { + LastField *string `protobuf:"bytes,536870911,opt,name=last_field" json:"last_field,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *MaxTag) Reset() { *m = MaxTag{} } +func (m *MaxTag) String() string { return proto.CompactTextString(m) } +func (*MaxTag) ProtoMessage() {} + +func (m *MaxTag) GetLastField() string { + if m != nil && m.LastField != nil { + return *m.LastField + } + return "" +} + +type OldMessage struct { + Nested *OldMessage_Nested `protobuf:"bytes,1,opt,name=nested" json:"nested,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *OldMessage) Reset() { *m = OldMessage{} } +func (m *OldMessage) String() string { return proto.CompactTextString(m) } +func (*OldMessage) ProtoMessage() {} + +func (m *OldMessage) GetNested() *OldMessage_Nested { + if m != nil { + return m.Nested + } + return nil +} + +type OldMessage_Nested struct { + Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *OldMessage_Nested) Reset() { *m = OldMessage_Nested{} } +func (m *OldMessage_Nested) String() string { return proto.CompactTextString(m) } +func (*OldMessage_Nested) ProtoMessage() {} + +func (m *OldMessage_Nested) GetName() string { + if m != nil && m.Name != nil { + return *m.Name + } + return "" +} + +type NewMessage struct { + Nested *NewMessage_Nested `protobuf:"bytes,1,opt,name=nested" json:"nested,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *NewMessage) Reset() { *m = NewMessage{} } +func (m *NewMessage) String() string { return proto.CompactTextString(m) } +func (*NewMessage) ProtoMessage() {} + +func (m *NewMessage) GetNested() *NewMessage_Nested { + if m != nil { + return m.Nested + } + return nil +} + +type NewMessage_Nested struct { + Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + FoodGroup *string `protobuf:"bytes,2,opt,name=food_group" json:"food_group,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *NewMessage_Nested) Reset() { *m = NewMessage_Nested{} } +func (m *NewMessage_Nested) String() string { return proto.CompactTextString(m) } +func (*NewMessage_Nested) ProtoMessage() {} + +func (m *NewMessage_Nested) GetName() string { + if m != nil && m.Name != nil { + return *m.Name + } + return "" +} + +func (m *NewMessage_Nested) GetFoodGroup() string { + if m != nil && m.FoodGroup != nil { + return *m.FoodGroup + } + return "" +} + +type InnerMessage struct { + Host *string `protobuf:"bytes,1,req,name=host" json:"host,omitempty"` + Port *int32 `protobuf:"varint,2,opt,name=port,def=4000" json:"port,omitempty"` + Connected *bool `protobuf:"varint,3,opt,name=connected" json:"connected,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *InnerMessage) Reset() { *m = InnerMessage{} } +func (m *InnerMessage) String() string { return proto.CompactTextString(m) } +func (*InnerMessage) ProtoMessage() {} + +const Default_InnerMessage_Port int32 = 4000 + +func (m *InnerMessage) GetHost() string { + if m != nil && m.Host != nil { + return *m.Host + } + return "" +} + +func (m *InnerMessage) GetPort() int32 { + if m != nil && m.Port != nil { + return *m.Port + } + return Default_InnerMessage_Port +} + +func (m *InnerMessage) GetConnected() bool { + if m != nil && m.Connected != nil { + return *m.Connected + } + return false +} + +type OtherMessage struct { + Key *int64 `protobuf:"varint,1,opt,name=key" json:"key,omitempty"` + Value []byte `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"` + Weight *float32 `protobuf:"fixed32,3,opt,name=weight" json:"weight,omitempty"` + Inner *InnerMessage `protobuf:"bytes,4,opt,name=inner" json:"inner,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *OtherMessage) Reset() { *m = OtherMessage{} } +func (m *OtherMessage) String() string { return proto.CompactTextString(m) } +func (*OtherMessage) ProtoMessage() {} + +func (m *OtherMessage) GetKey() int64 { + if m != nil && m.Key != nil { + return *m.Key + } + return 0 +} + +func (m *OtherMessage) GetValue() []byte { + if m != nil { + return m.Value + } + return nil +} + +func (m *OtherMessage) GetWeight() float32 { + if m != nil && m.Weight != nil { + return *m.Weight + } + return 0 +} + +func (m *OtherMessage) GetInner() *InnerMessage { + if m != nil { + return m.Inner + } + return nil +} + +type MyMessage struct { + Count *int32 `protobuf:"varint,1,req,name=count" json:"count,omitempty"` + Name *string `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"` + Quote *string `protobuf:"bytes,3,opt,name=quote" json:"quote,omitempty"` + Pet []string `protobuf:"bytes,4,rep,name=pet" json:"pet,omitempty"` + Inner *InnerMessage `protobuf:"bytes,5,opt,name=inner" json:"inner,omitempty"` + Others []*OtherMessage `protobuf:"bytes,6,rep,name=others" json:"others,omitempty"` + Bikeshed *MyMessage_Color `protobuf:"varint,7,opt,name=bikeshed,enum=testdata.MyMessage_Color" json:"bikeshed,omitempty"` + Somegroup *MyMessage_SomeGroup `protobuf:"group,8,opt,name=SomeGroup" json:"somegroup,omitempty"` + RepBytes [][]byte `protobuf:"bytes,10,rep,name=rep_bytes" json:"rep_bytes,omitempty"` + Bigfloat *float64 `protobuf:"fixed64,11,opt,name=bigfloat" json:"bigfloat,omitempty"` + XXX_extensions map[int32]proto.Extension `json:"-"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *MyMessage) Reset() { *m = MyMessage{} } +func (m *MyMessage) String() string { return proto.CompactTextString(m) } +func (*MyMessage) ProtoMessage() {} + +var extRange_MyMessage = []proto.ExtensionRange{ + {100, 536870911}, +} + +func (*MyMessage) ExtensionRangeArray() []proto.ExtensionRange { + return extRange_MyMessage +} +func (m *MyMessage) ExtensionMap() map[int32]proto.Extension { + if m.XXX_extensions == nil { + m.XXX_extensions = make(map[int32]proto.Extension) + } + return m.XXX_extensions +} + +func (m *MyMessage) GetCount() int32 { + if m != nil && m.Count != nil { + return *m.Count + } + return 0 +} + +func (m *MyMessage) GetName() string { + if m != nil && m.Name != nil { + return *m.Name + } + return "" +} + +func (m *MyMessage) GetQuote() string { + if m != nil && m.Quote != nil { + return *m.Quote + } + return "" +} + +func (m *MyMessage) GetPet() []string { + if m != nil { + return m.Pet + } + return nil +} + +func (m *MyMessage) GetInner() *InnerMessage { + if m != nil { + return m.Inner + } + return nil +} + +func (m *MyMessage) GetOthers() []*OtherMessage { + if m != nil { + return m.Others + } + return nil +} + +func (m *MyMessage) GetBikeshed() MyMessage_Color { + if m != nil && m.Bikeshed != nil { + return *m.Bikeshed + } + return 0 +} + +func (m *MyMessage) GetSomegroup() *MyMessage_SomeGroup { + if m != nil { + return m.Somegroup + } + return nil +} + +func (m *MyMessage) GetRepBytes() [][]byte { + if m != nil { + return m.RepBytes + } + return nil +} + +func (m *MyMessage) GetBigfloat() float64 { + if m != nil && m.Bigfloat != nil { + return *m.Bigfloat + } + return 0 +} + +type MyMessage_SomeGroup struct { + GroupField *int32 `protobuf:"varint,9,opt,name=group_field" json:"group_field,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *MyMessage_SomeGroup) Reset() { *m = MyMessage_SomeGroup{} } + +func (m *MyMessage_SomeGroup) GetGroupField() int32 { + if m != nil && m.GroupField != nil { + return *m.GroupField + } + return 0 +} + +type Ext struct { + Data *string `protobuf:"bytes,1,opt,name=data" json:"data,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *Ext) Reset() { *m = Ext{} } +func (m *Ext) String() string { return proto.CompactTextString(m) } +func (*Ext) ProtoMessage() {} + +func (m *Ext) GetData() string { + if m != nil && m.Data != nil { + return *m.Data + } + return "" +} + +var E_Ext_More = &proto.ExtensionDesc{ + ExtendedType: (*MyMessage)(nil), + ExtensionType: (*Ext)(nil), + Field: 103, + Name: "testdata.Ext.more", + Tag: "bytes,103,opt,name=more", +} + +var E_Ext_Text = &proto.ExtensionDesc{ + ExtendedType: (*MyMessage)(nil), + ExtensionType: (*string)(nil), + Field: 104, + Name: "testdata.Ext.text", + Tag: "bytes,104,opt,name=text", +} + +var E_Ext_Number = &proto.ExtensionDesc{ + ExtendedType: (*MyMessage)(nil), + ExtensionType: (*int32)(nil), + Field: 105, + Name: "testdata.Ext.number", + Tag: "varint,105,opt,name=number", +} + +type MessageList struct { + Message []*MessageList_Message `protobuf:"group,1,rep" json:"message,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *MessageList) Reset() { *m = MessageList{} } +func (m *MessageList) String() string { return proto.CompactTextString(m) } +func (*MessageList) ProtoMessage() {} + +func (m *MessageList) GetMessage() []*MessageList_Message { + if m != nil { + return m.Message + } + return nil +} + +type MessageList_Message struct { + Name *string `protobuf:"bytes,2,req,name=name" json:"name,omitempty"` + Count *int32 `protobuf:"varint,3,req,name=count" json:"count,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *MessageList_Message) Reset() { *m = MessageList_Message{} } + +func (m *MessageList_Message) GetName() string { + if m != nil && m.Name != nil { + return *m.Name + } + return "" +} + +func (m *MessageList_Message) GetCount() int32 { + if m != nil && m.Count != nil { + return *m.Count + } + return 0 +} + +type Strings struct { + StringField *string `protobuf:"bytes,1,opt,name=string_field" json:"string_field,omitempty"` + BytesField []byte `protobuf:"bytes,2,opt,name=bytes_field" json:"bytes_field,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *Strings) Reset() { *m = Strings{} } +func (m *Strings) String() string { return proto.CompactTextString(m) } +func (*Strings) ProtoMessage() {} + +func (m *Strings) GetStringField() string { + if m != nil && m.StringField != nil { + return *m.StringField + } + return "" +} + +func (m *Strings) GetBytesField() []byte { + if m != nil { + return m.BytesField + } + return nil +} + +type Defaults struct { + F_Bool *bool `protobuf:"varint,1,opt,def=1" json:"F_Bool,omitempty"` + F_Int32 *int32 `protobuf:"varint,2,opt,def=32" json:"F_Int32,omitempty"` + F_Int64 *int64 `protobuf:"varint,3,opt,def=64" json:"F_Int64,omitempty"` + F_Fixed32 *uint32 `protobuf:"fixed32,4,opt,def=320" json:"F_Fixed32,omitempty"` + F_Fixed64 *uint64 `protobuf:"fixed64,5,opt,def=640" json:"F_Fixed64,omitempty"` + F_Uint32 *uint32 `protobuf:"varint,6,opt,def=3200" json:"F_Uint32,omitempty"` + F_Uint64 *uint64 `protobuf:"varint,7,opt,def=6400" json:"F_Uint64,omitempty"` + F_Float *float32 `protobuf:"fixed32,8,opt,def=314159" json:"F_Float,omitempty"` + F_Double *float64 `protobuf:"fixed64,9,opt,def=271828" json:"F_Double,omitempty"` + F_String *string `protobuf:"bytes,10,opt,def=hello, \"world!\"\n" json:"F_String,omitempty"` + F_Bytes []byte `protobuf:"bytes,11,opt,def=Bignose" json:"F_Bytes,omitempty"` + F_Sint32 *int32 `protobuf:"zigzag32,12,opt,def=-32" json:"F_Sint32,omitempty"` + F_Sint64 *int64 `protobuf:"zigzag64,13,opt,def=-64" json:"F_Sint64,omitempty"` + F_Enum *Defaults_Color `protobuf:"varint,14,opt,enum=testdata.Defaults_Color,def=1" json:"F_Enum,omitempty"` + F_Pinf *float32 `protobuf:"fixed32,15,opt,def=inf" json:"F_Pinf,omitempty"` + F_Ninf *float32 `protobuf:"fixed32,16,opt,def=-inf" json:"F_Ninf,omitempty"` + F_Nan *float32 `protobuf:"fixed32,17,opt,def=nan" json:"F_Nan,omitempty"` + Sub *SubDefaults `protobuf:"bytes,18,opt,name=sub" json:"sub,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *Defaults) Reset() { *m = Defaults{} } +func (m *Defaults) String() string { return proto.CompactTextString(m) } +func (*Defaults) ProtoMessage() {} + +const Default_Defaults_F_Bool bool = true +const Default_Defaults_F_Int32 int32 = 32 +const Default_Defaults_F_Int64 int64 = 64 +const Default_Defaults_F_Fixed32 uint32 = 320 +const Default_Defaults_F_Fixed64 uint64 = 640 +const Default_Defaults_F_Uint32 uint32 = 3200 +const Default_Defaults_F_Uint64 uint64 = 6400 +const Default_Defaults_F_Float float32 = 314159 +const Default_Defaults_F_Double float64 = 271828 +const Default_Defaults_F_String string = "hello, \"world!\"\n" + +var Default_Defaults_F_Bytes []byte = []byte("Bignose") + +const Default_Defaults_F_Sint32 int32 = -32 +const Default_Defaults_F_Sint64 int64 = -64 +const Default_Defaults_F_Enum Defaults_Color = Defaults_GREEN + +var Default_Defaults_F_Pinf float32 = float32(math.Inf(1)) +var Default_Defaults_F_Ninf float32 = float32(math.Inf(-1)) +var Default_Defaults_F_Nan float32 = float32(math.NaN()) + +func (m *Defaults) GetF_Bool() bool { + if m != nil && m.F_Bool != nil { + return *m.F_Bool + } + return Default_Defaults_F_Bool +} + +func (m *Defaults) GetF_Int32() int32 { + if m != nil && m.F_Int32 != nil { + return *m.F_Int32 + } + return Default_Defaults_F_Int32 +} + +func (m *Defaults) GetF_Int64() int64 { + if m != nil && m.F_Int64 != nil { + return *m.F_Int64 + } + return Default_Defaults_F_Int64 +} + +func (m *Defaults) GetF_Fixed32() uint32 { + if m != nil && m.F_Fixed32 != nil { + return *m.F_Fixed32 + } + return Default_Defaults_F_Fixed32 +} + +func (m *Defaults) GetF_Fixed64() uint64 { + if m != nil && m.F_Fixed64 != nil { + return *m.F_Fixed64 + } + return Default_Defaults_F_Fixed64 +} + +func (m *Defaults) GetF_Uint32() uint32 { + if m != nil && m.F_Uint32 != nil { + return *m.F_Uint32 + } + return Default_Defaults_F_Uint32 +} + +func (m *Defaults) GetF_Uint64() uint64 { + if m != nil && m.F_Uint64 != nil { + return *m.F_Uint64 + } + return Default_Defaults_F_Uint64 +} + +func (m *Defaults) GetF_Float() float32 { + if m != nil && m.F_Float != nil { + return *m.F_Float + } + return Default_Defaults_F_Float +} + +func (m *Defaults) GetF_Double() float64 { + if m != nil && m.F_Double != nil { + return *m.F_Double + } + return Default_Defaults_F_Double +} + +func (m *Defaults) GetF_String() string { + if m != nil && m.F_String != nil { + return *m.F_String + } + return Default_Defaults_F_String +} + +func (m *Defaults) GetF_Bytes() []byte { + if m != nil && m.F_Bytes != nil { + return m.F_Bytes + } + return append([]byte(nil), Default_Defaults_F_Bytes...) +} + +func (m *Defaults) GetF_Sint32() int32 { + if m != nil && m.F_Sint32 != nil { + return *m.F_Sint32 + } + return Default_Defaults_F_Sint32 +} + +func (m *Defaults) GetF_Sint64() int64 { + if m != nil && m.F_Sint64 != nil { + return *m.F_Sint64 + } + return Default_Defaults_F_Sint64 +} + +func (m *Defaults) GetF_Enum() Defaults_Color { + if m != nil && m.F_Enum != nil { + return *m.F_Enum + } + return Default_Defaults_F_Enum +} + +func (m *Defaults) GetF_Pinf() float32 { + if m != nil && m.F_Pinf != nil { + return *m.F_Pinf + } + return Default_Defaults_F_Pinf +} + +func (m *Defaults) GetF_Ninf() float32 { + if m != nil && m.F_Ninf != nil { + return *m.F_Ninf + } + return Default_Defaults_F_Ninf +} + +func (m *Defaults) GetF_Nan() float32 { + if m != nil && m.F_Nan != nil { + return *m.F_Nan + } + return Default_Defaults_F_Nan +} + +func (m *Defaults) GetSub() *SubDefaults { + if m != nil { + return m.Sub + } + return nil +} + +type SubDefaults struct { + N *int64 `protobuf:"varint,1,opt,name=n,def=7" json:"n,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *SubDefaults) Reset() { *m = SubDefaults{} } +func (m *SubDefaults) String() string { return proto.CompactTextString(m) } +func (*SubDefaults) ProtoMessage() {} + +const Default_SubDefaults_N int64 = 7 + +func (m *SubDefaults) GetN() int64 { + if m != nil && m.N != nil { + return *m.N + } + return Default_SubDefaults_N +} + +type RepeatedEnum struct { + Color []RepeatedEnum_Color `protobuf:"varint,1,rep,name=color,enum=testdata.RepeatedEnum_Color" json:"color,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *RepeatedEnum) Reset() { *m = RepeatedEnum{} } +func (m *RepeatedEnum) String() string { return proto.CompactTextString(m) } +func (*RepeatedEnum) ProtoMessage() {} + +func (m *RepeatedEnum) GetColor() []RepeatedEnum_Color { + if m != nil { + return m.Color + } + return nil +} + +type MoreRepeated struct { + Bools []bool `protobuf:"varint,1,rep,name=bools" json:"bools,omitempty"` + BoolsPacked []bool `protobuf:"varint,2,rep,packed,name=bools_packed" json:"bools_packed,omitempty"` + Ints []int32 `protobuf:"varint,3,rep,name=ints" json:"ints,omitempty"` + IntsPacked []int32 `protobuf:"varint,4,rep,packed,name=ints_packed" json:"ints_packed,omitempty"` + Strings []string `protobuf:"bytes,5,rep,name=strings" json:"strings,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *MoreRepeated) Reset() { *m = MoreRepeated{} } +func (m *MoreRepeated) String() string { return proto.CompactTextString(m) } +func (*MoreRepeated) ProtoMessage() {} + +func (m *MoreRepeated) GetBools() []bool { + if m != nil { + return m.Bools + } + return nil +} + +func (m *MoreRepeated) GetBoolsPacked() []bool { + if m != nil { + return m.BoolsPacked + } + return nil +} + +func (m *MoreRepeated) GetInts() []int32 { + if m != nil { + return m.Ints + } + return nil +} + +func (m *MoreRepeated) GetIntsPacked() []int32 { + if m != nil { + return m.IntsPacked + } + return nil +} + +func (m *MoreRepeated) GetStrings() []string { + if m != nil { + return m.Strings + } + return nil +} + +type GroupOld struct { + G *GroupOld_G `protobuf:"group,1,opt" json:"g,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *GroupOld) Reset() { *m = GroupOld{} } +func (m *GroupOld) String() string { return proto.CompactTextString(m) } +func (*GroupOld) ProtoMessage() {} + +func (m *GroupOld) GetG() *GroupOld_G { + if m != nil { + return m.G + } + return nil +} + +type GroupOld_G struct { + X *int32 `protobuf:"varint,2,opt,name=x" json:"x,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *GroupOld_G) Reset() { *m = GroupOld_G{} } + +func (m *GroupOld_G) GetX() int32 { + if m != nil && m.X != nil { + return *m.X + } + return 0 +} + +type GroupNew struct { + G *GroupNew_G `protobuf:"group,1,opt" json:"g,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *GroupNew) Reset() { *m = GroupNew{} } +func (m *GroupNew) String() string { return proto.CompactTextString(m) } +func (*GroupNew) ProtoMessage() {} + +func (m *GroupNew) GetG() *GroupNew_G { + if m != nil { + return m.G + } + return nil +} + +type GroupNew_G struct { + X *int32 `protobuf:"varint,2,opt,name=x" json:"x,omitempty"` + Y *int32 `protobuf:"varint,3,opt,name=y" json:"y,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *GroupNew_G) Reset() { *m = GroupNew_G{} } + +func (m *GroupNew_G) GetX() int32 { + if m != nil && m.X != nil { + return *m.X + } + return 0 +} + +func (m *GroupNew_G) GetY() int32 { + if m != nil && m.Y != nil { + return *m.Y + } + return 0 +} + +var E_Greeting = &proto.ExtensionDesc{ + ExtendedType: (*MyMessage)(nil), + ExtensionType: ([]string)(nil), + Field: 106, + Name: "testdata.greeting", + Tag: "bytes,106,rep,name=greeting", +} + +func init() { + proto.RegisterEnum("testdata.FOO", FOO_name, FOO_value) + proto.RegisterEnum("testdata.GoTest_KIND", GoTest_KIND_name, GoTest_KIND_value) + proto.RegisterEnum("testdata.MyMessage_Color", MyMessage_Color_name, MyMessage_Color_value) + proto.RegisterEnum("testdata.Defaults_Color", Defaults_Color_name, Defaults_Color_value) + proto.RegisterEnum("testdata.RepeatedEnum_Color", RepeatedEnum_Color_name, RepeatedEnum_Color_value) + proto.RegisterExtension(E_Ext_More) + proto.RegisterExtension(E_Ext_Text) + proto.RegisterExtension(E_Ext_Number) + proto.RegisterExtension(E_Greeting) +} diff --git a/Godeps/_workspace/src/github.com/gogo/protobuf/proto/testdata/test.proto b/Godeps/_workspace/src/github.com/gogo/protobuf/proto/testdata/test.proto new file mode 100644 index 000000000000..3d1cbb675d50 --- /dev/null +++ b/Godeps/_workspace/src/github.com/gogo/protobuf/proto/testdata/test.proto @@ -0,0 +1,494 @@ +// 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. + +// A feature-rich test file for the protocol compiler and libraries. + +syntax = "proto2"; + +package testdata; + +enum FOO { FOO1 = 1; }; + +message GoEnum { + required FOO foo = 1; +} + +message GoTestField { + required string Label = 1; + required string Type = 2; +} + +message GoTest { + // An enum, for completeness. + enum KIND { + VOID = 0; + + // Basic types + BOOL = 1; + BYTES = 2; + FINGERPRINT = 3; + FLOAT = 4; + INT = 5; + STRING = 6; + TIME = 7; + + // Groupings + TUPLE = 8; + ARRAY = 9; + MAP = 10; + + // Table types + TABLE = 11; + + // Functions + FUNCTION = 12; // last tag + }; + + // Some typical parameters + required KIND Kind = 1; + optional string Table = 2; + optional int32 Param = 3; + + // Required, repeated and optional foreign fields. + required GoTestField RequiredField = 4; + repeated GoTestField RepeatedField = 5; + optional GoTestField OptionalField = 6; + + // Required fields of all basic types + required bool F_Bool_required = 10; + required int32 F_Int32_required = 11; + required int64 F_Int64_required = 12; + required fixed32 F_Fixed32_required = 13; + required fixed64 F_Fixed64_required = 14; + required uint32 F_Uint32_required = 15; + required uint64 F_Uint64_required = 16; + required float F_Float_required = 17; + required double F_Double_required = 18; + required string F_String_required = 19; + required bytes F_Bytes_required = 101; + required sint32 F_Sint32_required = 102; + required sint64 F_Sint64_required = 103; + + // Repeated fields of all basic types + repeated bool F_Bool_repeated = 20; + repeated int32 F_Int32_repeated = 21; + repeated int64 F_Int64_repeated = 22; + repeated fixed32 F_Fixed32_repeated = 23; + repeated fixed64 F_Fixed64_repeated = 24; + repeated uint32 F_Uint32_repeated = 25; + repeated uint64 F_Uint64_repeated = 26; + repeated float F_Float_repeated = 27; + repeated double F_Double_repeated = 28; + repeated string F_String_repeated = 29; + repeated bytes F_Bytes_repeated = 201; + repeated sint32 F_Sint32_repeated = 202; + repeated sint64 F_Sint64_repeated = 203; + + // Optional fields of all basic types + optional bool F_Bool_optional = 30; + optional int32 F_Int32_optional = 31; + optional int64 F_Int64_optional = 32; + optional fixed32 F_Fixed32_optional = 33; + optional fixed64 F_Fixed64_optional = 34; + optional uint32 F_Uint32_optional = 35; + optional uint64 F_Uint64_optional = 36; + optional float F_Float_optional = 37; + optional double F_Double_optional = 38; + optional string F_String_optional = 39; + optional bytes F_Bytes_optional = 301; + optional sint32 F_Sint32_optional = 302; + optional sint64 F_Sint64_optional = 303; + + // Default-valued fields of all basic types + optional bool F_Bool_defaulted = 40 [default=true]; + optional int32 F_Int32_defaulted = 41 [default=32]; + optional int64 F_Int64_defaulted = 42 [default=64]; + optional fixed32 F_Fixed32_defaulted = 43 [default=320]; + optional fixed64 F_Fixed64_defaulted = 44 [default=640]; + optional uint32 F_Uint32_defaulted = 45 [default=3200]; + optional uint64 F_Uint64_defaulted = 46 [default=6400]; + optional float F_Float_defaulted = 47 [default=314159.]; + optional double F_Double_defaulted = 48 [default=271828.]; + optional string F_String_defaulted = 49 [default="hello, \"world!\"\n"]; + optional bytes F_Bytes_defaulted = 401 [default="Bignose"]; + optional sint32 F_Sint32_defaulted = 402 [default = -32]; + optional sint64 F_Sint64_defaulted = 403 [default = -64]; + + // Packed repeated fields (no string or bytes). + repeated bool F_Bool_repeated_packed = 50 [packed=true]; + repeated int32 F_Int32_repeated_packed = 51 [packed=true]; + repeated int64 F_Int64_repeated_packed = 52 [packed=true]; + repeated fixed32 F_Fixed32_repeated_packed = 53 [packed=true]; + repeated fixed64 F_Fixed64_repeated_packed = 54 [packed=true]; + repeated uint32 F_Uint32_repeated_packed = 55 [packed=true]; + repeated uint64 F_Uint64_repeated_packed = 56 [packed=true]; + repeated float F_Float_repeated_packed = 57 [packed=true]; + repeated double F_Double_repeated_packed = 58 [packed=true]; + repeated sint32 F_Sint32_repeated_packed = 502 [packed=true]; + repeated sint64 F_Sint64_repeated_packed = 503 [packed=true]; + + // Required, repeated, and optional groups. + required group RequiredGroup = 70 { + required string RequiredField = 71; + }; + + repeated group RepeatedGroup = 80 { + required string RequiredField = 81; + }; + + optional group OptionalGroup = 90 { + required string RequiredField = 91; + }; +} + +// For testing skipping of unrecognized fields. +// Numbers are all big, larger than tag numbers in GoTestField, +// the message used in the corresponding test. +message GoSkipTest { + required int32 skip_int32 = 11; + required fixed32 skip_fixed32 = 12; + required fixed64 skip_fixed64 = 13; + required string skip_string = 14; + required group SkipGroup = 15 { + required int32 group_int32 = 16; + required string group_string = 17; + } +} + +// For testing packed/non-packed decoder switching. +// A serialized instance of one should be deserializable as the other. +message NonPackedTest { + repeated int32 a = 1; +} + +message PackedTest { + repeated int32 b = 1 [packed=true]; +} + +message MaxTag { + // Maximum possible tag number. + optional string last_field = 536870911; +} + +message OldMessage { + message Nested { + optional string name = 1; + } + optional Nested nested = 1; + + optional int32 num = 2; +} + +// NewMessage is wire compatible with OldMessage; +// imagine it as a future version. +message NewMessage { + message Nested { + optional string name = 1; + optional string food_group = 2; + } + optional Nested nested = 1; + + // This is an int32 in OldMessage. + optional int64 num = 2; +} + +// Smaller tests for ASCII formatting. + +message InnerMessage { + required string host = 1; + optional int32 port = 2 [default=4000]; + optional bool connected = 3; +} + +message OtherMessage { + optional int64 key = 1; + optional bytes value = 2; + optional float weight = 3; + optional InnerMessage inner = 4; +} + +message MyMessage { + required int32 count = 1; + optional string name = 2; + optional string quote = 3; + repeated string pet = 4; + optional InnerMessage inner = 5; + repeated OtherMessage others = 6; + repeated InnerMessage rep_inner = 12; + + enum Color { + RED = 0; + GREEN = 1; + BLUE = 2; + }; + optional Color bikeshed = 7; + + optional group SomeGroup = 8 { + optional int32 group_field = 9; + } + + // This field becomes [][]byte in the generated code. + repeated bytes rep_bytes = 10; + + optional double bigfloat = 11; + + extensions 100 to max; +} + +message Ext { + extend MyMessage { + optional Ext more = 103; + optional string text = 104; + optional int32 number = 105; + } + + optional string data = 1; +} + +extend MyMessage { + repeated string greeting = 106; +} + +message DefaultsMessage { + enum DefaultsEnum { + ZERO = 0; + ONE = 1; + TWO = 2; + }; + extensions 100 to max; +} + +extend DefaultsMessage { + optional double no_default_double = 101; + optional float no_default_float = 102; + optional int32 no_default_int32 = 103; + optional int64 no_default_int64 = 104; + optional uint32 no_default_uint32 = 105; + optional uint64 no_default_uint64 = 106; + optional sint32 no_default_sint32 = 107; + optional sint64 no_default_sint64 = 108; + optional fixed32 no_default_fixed32 = 109; + optional fixed64 no_default_fixed64 = 110; + optional sfixed32 no_default_sfixed32 = 111; + optional sfixed64 no_default_sfixed64 = 112; + optional bool no_default_bool = 113; + optional string no_default_string = 114; + optional bytes no_default_bytes = 115; + optional DefaultsMessage.DefaultsEnum no_default_enum = 116; + + optional double default_double = 201 [default = 3.1415]; + optional float default_float = 202 [default = 3.14]; + optional int32 default_int32 = 203 [default = 42]; + optional int64 default_int64 = 204 [default = 43]; + optional uint32 default_uint32 = 205 [default = 44]; + optional uint64 default_uint64 = 206 [default = 45]; + optional sint32 default_sint32 = 207 [default = 46]; + optional sint64 default_sint64 = 208 [default = 47]; + optional fixed32 default_fixed32 = 209 [default = 48]; + optional fixed64 default_fixed64 = 210 [default = 49]; + optional sfixed32 default_sfixed32 = 211 [default = 50]; + optional sfixed64 default_sfixed64 = 212 [default = 51]; + optional bool default_bool = 213 [default = true]; + optional string default_string = 214 [default = "Hello, string"]; + optional bytes default_bytes = 215 [default = "Hello, bytes"]; + optional DefaultsMessage.DefaultsEnum default_enum = 216 [default = ONE]; +} + +message MyMessageSet { + option message_set_wire_format = true; + extensions 100 to max; +} + +message Empty { +} + +extend MyMessageSet { + optional Empty x201 = 201; + optional Empty x202 = 202; + optional Empty x203 = 203; + optional Empty x204 = 204; + optional Empty x205 = 205; + optional Empty x206 = 206; + optional Empty x207 = 207; + optional Empty x208 = 208; + optional Empty x209 = 209; + optional Empty x210 = 210; + optional Empty x211 = 211; + optional Empty x212 = 212; + optional Empty x213 = 213; + optional Empty x214 = 214; + optional Empty x215 = 215; + optional Empty x216 = 216; + optional Empty x217 = 217; + optional Empty x218 = 218; + optional Empty x219 = 219; + optional Empty x220 = 220; + optional Empty x221 = 221; + optional Empty x222 = 222; + optional Empty x223 = 223; + optional Empty x224 = 224; + optional Empty x225 = 225; + optional Empty x226 = 226; + optional Empty x227 = 227; + optional Empty x228 = 228; + optional Empty x229 = 229; + optional Empty x230 = 230; + optional Empty x231 = 231; + optional Empty x232 = 232; + optional Empty x233 = 233; + optional Empty x234 = 234; + optional Empty x235 = 235; + optional Empty x236 = 236; + optional Empty x237 = 237; + optional Empty x238 = 238; + optional Empty x239 = 239; + optional Empty x240 = 240; + optional Empty x241 = 241; + optional Empty x242 = 242; + optional Empty x243 = 243; + optional Empty x244 = 244; + optional Empty x245 = 245; + optional Empty x246 = 246; + optional Empty x247 = 247; + optional Empty x248 = 248; + optional Empty x249 = 249; + optional Empty x250 = 250; +} + +message MessageList { + repeated group Message = 1 { + required string name = 2; + required int32 count = 3; + } +} + +message Strings { + optional string string_field = 1; + optional bytes bytes_field = 2; +} + +message Defaults { + enum Color { + RED = 0; + GREEN = 1; + BLUE = 2; + } + + // Default-valued fields of all basic types. + // Same as GoTest, but copied here to make testing easier. + optional bool F_Bool = 1 [default=true]; + optional int32 F_Int32 = 2 [default=32]; + optional int64 F_Int64 = 3 [default=64]; + optional fixed32 F_Fixed32 = 4 [default=320]; + optional fixed64 F_Fixed64 = 5 [default=640]; + optional uint32 F_Uint32 = 6 [default=3200]; + optional uint64 F_Uint64 = 7 [default=6400]; + optional float F_Float = 8 [default=314159.]; + optional double F_Double = 9 [default=271828.]; + optional string F_String = 10 [default="hello, \"world!\"\n"]; + optional bytes F_Bytes = 11 [default="Bignose"]; + optional sint32 F_Sint32 = 12 [default=-32]; + optional sint64 F_Sint64 = 13 [default=-64]; + optional Color F_Enum = 14 [default=GREEN]; + + // More fields with crazy defaults. + optional float F_Pinf = 15 [default=inf]; + optional float F_Ninf = 16 [default=-inf]; + optional float F_Nan = 17 [default=nan]; + + // Sub-message. + optional SubDefaults sub = 18; + + // Redundant but explicit defaults. + optional string str_zero = 19 [default=""]; +} + +message SubDefaults { + optional int64 n = 1 [default=7]; +} + +message RepeatedEnum { + enum Color { + RED = 1; + } + repeated Color color = 1; +} + +message MoreRepeated { + repeated bool bools = 1; + repeated bool bools_packed = 2 [packed=true]; + repeated int32 ints = 3; + repeated int32 ints_packed = 4 [packed=true]; + repeated int64 int64s_packed = 7 [packed=true]; + repeated string strings = 5; + repeated fixed32 fixeds = 6; +} + +// GroupOld and GroupNew have the same wire format. +// GroupNew has a new field inside a group. + +message GroupOld { + optional group G = 101 { + optional int32 x = 2; + } +} + +message GroupNew { + optional group G = 101 { + optional int32 x = 2; + optional int32 y = 3; + } +} + +message FloatingPoint { + required double f = 1; +} + +message MessageWithMap { + map name_mapping = 1; + map msg_mapping = 2; + map byte_mapping = 3; + map str_to_str = 4; +} + +message Communique { + optional bool make_me_cry = 1; + + // This is a oneof, called "union". + oneof union { + int32 number = 5; + string name = 6; + bytes data = 7; + double temp_c = 8; + MyMessage.Color col = 9; + Strings msg = 10; + } +} diff --git a/Godeps/_workspace/src/github.com/gogo/protobuf/proto/text.go b/Godeps/_workspace/src/github.com/gogo/protobuf/proto/text.go index 36524244188d..c12caecafb99 100644 --- a/Godeps/_workspace/src/github.com/gogo/protobuf/proto/text.go +++ b/Godeps/_workspace/src/github.com/gogo/protobuf/proto/text.go @@ -42,6 +42,7 @@ import ( "bufio" "bytes" "encoding" + "errors" "fmt" "io" "log" @@ -331,6 +332,32 @@ func writeStruct(w *textWriter, sv reflect.Value) error { } } + if fv.Kind() == reflect.Interface { + // Check if it is a oneof. + if st.Field(i).Tag.Get("protobuf_oneof") != "" { + // fv is nil, or holds a pointer to generated struct. + // That generated struct has exactly one field, + // which has a protobuf struct tag. + if fv.IsNil() { + continue + } + inner := fv.Elem().Elem() // interface -> *T -> T + tag := inner.Type().Field(0).Tag.Get("protobuf") + props.Parse(tag) // Overwrite the outer props. + // Write the value in the oneof, not the oneof itself. + fv = inner.Field(0) + + // Special case to cope with malformed messages gracefully: + // If the value in the oneof is a nil pointer, don't panic + // in writeAny. + if fv.Kind() == reflect.Ptr && fv.IsNil() { + // Use errors.New so writeAny won't render quotes. + msg := errors.New("/* nil */") + fv = reflect.ValueOf(&msg).Elem() + } + } + } + if err := writeName(w, props); err != nil { return err } @@ -396,15 +423,17 @@ func writeAny(w *textWriter, v reflect.Value, props *Properties) error { v = reflect.Indirect(v) if props != nil && len(props.CustomType) > 0 { - var custom Marshaler = v.Interface().(Marshaler) - data, err := custom.Marshal() - if err != nil { - return err - } - if err := writeString(w, string(data)); err != nil { - return err + custom, ok := v.Interface().(Marshaler) + if ok { + data, err := custom.Marshal() + if err != nil { + return err + } + if err := writeString(w, string(data)); err != nil { + return err + } + return nil } - return nil } // Floats have special cases. @@ -533,8 +562,8 @@ func writeMessageSet(w *textWriter, ms *MessageSet) error { pb := reflect.New(msd.t.Elem()) if err := Unmarshal(item.Message, pb.Interface().(Message)); err != nil { - if _, err := fmt.Fprintf(w, "/* bad message: %v */\n", err); err != nil { - return err + if _, ferr := fmt.Fprintf(w, "/* bad message: %v */\n", err); ferr != nil { + return ferr } } else { if err := writeStruct(w, pb.Elem()); err != nil { @@ -569,19 +598,19 @@ func writeUnknownStruct(w *textWriter, data []byte) error { for b.index < len(b.buf) { x, err := b.DecodeVarint() if err != nil { - _, err := fmt.Fprintf(w, "/* %v */\n", err) - return err + _, ferr := fmt.Fprintf(w, "/* %v */\n", err) + return ferr } wire, tag := x&7, x>>3 if wire == WireEndGroup { w.unindent() - if _, err := w.Write(endBraceNewline); err != nil { - return err + if _, werr := w.Write(endBraceNewline); werr != nil { + return werr } continue } - if _, err := fmt.Fprint(w, tag); err != nil { - return err + if _, ferr := fmt.Fprint(w, tag); ferr != nil { + return ferr } if wire != WireStartGroup { if err := w.WriteByte(':'); err != nil { diff --git a/Godeps/_workspace/src/github.com/gogo/protobuf/proto/text_parser.go b/Godeps/_workspace/src/github.com/gogo/protobuf/proto/text_parser.go index 9b2fab593572..acc001fd2780 100644 --- a/Godeps/_workspace/src/github.com/gogo/protobuf/proto/text_parser.go +++ b/Godeps/_workspace/src/github.com/gogo/protobuf/proto/text_parser.go @@ -390,8 +390,7 @@ func (p *textParser) missingRequiredFieldError(sv reflect.Value) *RequiredNotSet } // Returns the index in the struct for the named field, as well as the parsed tag properties. -func structFieldByName(st reflect.Type, name string) (int, *Properties, bool) { - sprops := GetProperties(st) +func structFieldByName(sprops *StructProperties, name string) (int, *Properties, bool) { i, ok := sprops.decoderOrigNames[name] if ok { return i, sprops.Prop[i], true @@ -443,7 +442,8 @@ func (p *textParser) checkForColon(props *Properties, typ reflect.Type) *ParseEr func (p *textParser) readStruct(sv reflect.Value, terminator string) error { st := sv.Type() - reqCount := GetProperties(st).reqCount + sprops := GetProperties(st) + reqCount := sprops.reqCount var reqFieldErr error fieldSet := make(map[string]bool) // A struct is a sequence of "name: value", terminated by one of @@ -525,95 +525,107 @@ func (p *textParser) readStruct(sv reflect.Value, terminator string) error { sl = reflect.Append(sl, ext) SetExtension(ep, desc, sl.Interface()) } - } else { - // This is a normal, non-extension field. - name := tok.value - fi, props, ok := structFieldByName(st, name) - if !ok { - return p.errorf("unknown field name %q in %v", name, st) + if err := p.consumeOptionalSeparator(); err != nil { + return err } + continue + } - dst := sv.Field(fi) - - if dst.Kind() == reflect.Map { - // Consume any colon. - if err := p.checkForColon(props, dst.Type()); err != nil { - return err - } - - // Construct the map if it doesn't already exist. - if dst.IsNil() { - dst.Set(reflect.MakeMap(dst.Type())) - } - key := reflect.New(dst.Type().Key()).Elem() - val := reflect.New(dst.Type().Elem()).Elem() - - // The map entry should be this sequence of tokens: - // < key : KEY value : VALUE > - // Technically the "key" and "value" could come in any order, - // but in practice they won't. - - tok := p.next() - var terminator string - switch tok.value { - case "<": - terminator = ">" - case "{": - terminator = "}" - default: - return p.errorf("expected '{' or '<', found %q", tok.value) - } - if err := p.consumeToken("key"); err != nil { - return err - } - if err := p.consumeToken(":"); err != nil { - return err - } - if err := p.readAny(key, props.mkeyprop); err != nil { - return err - } - if err := p.consumeOptionalSeparator(); err != nil { - return err - } - if err := p.consumeToken("value"); err != nil { - return err - } - if err := p.checkForColon(props.mvalprop, dst.Type().Elem()); err != nil { - return err - } - if err := p.readAny(val, props.mvalprop); err != nil { - return err - } - if err := p.consumeOptionalSeparator(); err != nil { - return err - } - if err := p.consumeToken(terminator); err != nil { - return err - } + // This is a normal, non-extension field. + name := tok.value + var dst reflect.Value + fi, props, ok := structFieldByName(sprops, name) + if ok { + dst = sv.Field(fi) + } else if oop, ok := sprops.OneofTypes[name]; ok { + // It is a oneof. + props = oop.Prop + nv := reflect.New(oop.Type.Elem()) + dst = nv.Elem().Field(0) + sv.Field(oop.Field).Set(nv) + } + if !dst.IsValid() { + return p.errorf("unknown field name %q in %v", name, st) + } - dst.SetMapIndex(key, val) - continue + if dst.Kind() == reflect.Map { + // Consume any colon. + if err := p.checkForColon(props, dst.Type()); err != nil { + return err } - // Check that it's not already set if it's not a repeated field. - if !props.Repeated && fieldSet[name] { - return p.errorf("non-repeated field %q was repeated", name) + // Construct the map if it doesn't already exist. + if dst.IsNil() { + dst.Set(reflect.MakeMap(dst.Type())) } - - if err := p.checkForColon(props, st.Field(fi).Type); err != nil { + key := reflect.New(dst.Type().Key()).Elem() + val := reflect.New(dst.Type().Elem()).Elem() + + // The map entry should be this sequence of tokens: + // < key : KEY value : VALUE > + // Technically the "key" and "value" could come in any order, + // but in practice they won't. + + tok := p.next() + var terminator string + switch tok.value { + case "<": + terminator = ">" + case "{": + terminator = "}" + default: + return p.errorf("expected '{' or '<', found %q", tok.value) + } + if err := p.consumeToken("key"); err != nil { + return err + } + if err := p.consumeToken(":"); err != nil { + return err + } + if err := p.readAny(key, props.mkeyprop); err != nil { + return err + } + if err := p.consumeOptionalSeparator(); err != nil { + return err + } + if err := p.consumeToken("value"); err != nil { + return err + } + if err := p.checkForColon(props.mvalprop, dst.Type().Elem()); err != nil { + return err + } + if err := p.readAny(val, props.mvalprop); err != nil { + return err + } + if err := p.consumeOptionalSeparator(); err != nil { + return err + } + if err := p.consumeToken(terminator); err != nil { return err } - // Parse into the field. - fieldSet[name] = true - if err := p.readAny(dst, props); err != nil { - if _, ok := err.(*RequiredNotSetError); !ok { - return err - } - reqFieldErr = err - } else if props.Required { - reqCount-- + dst.SetMapIndex(key, val) + continue + } + + // Check that it's not already set if it's not a repeated field. + if !props.Repeated && fieldSet[name] { + return p.errorf("non-repeated field %q was repeated", name) + } + + if err := p.checkForColon(props, dst.Type()); err != nil { + return err + } + + // Parse into the field. + fieldSet[name] = true + if err := p.readAny(dst, props); err != nil { + if _, ok := err.(*RequiredNotSetError); !ok { + return err } + reqFieldErr = err + } else if props.Required { + reqCount-- } if err := p.consumeOptionalSeparator(); err != nil { diff --git a/Godeps/_workspace/src/github.com/gogo/protobuf/proto/text_parser_test.go b/Godeps/_workspace/src/github.com/gogo/protobuf/proto/text_parser_test.go index f1c62319251b..0ac8a51c5e98 100644 --- a/Godeps/_workspace/src/github.com/gogo/protobuf/proto/text_parser_test.go +++ b/Godeps/_workspace/src/github.com/gogo/protobuf/proto/text_parser_test.go @@ -486,6 +486,18 @@ func TestMapParsing(t *testing.T) { } } +func TestOneofParsing(t *testing.T) { + const in = `name:"Shrek"` + m := new(Communique) + want := &Communique{Union: &Communique_Name{"Shrek"}} + if err := UnmarshalText(in, m); err != nil { + t.Fatal(err) + } + if !Equal(m, want) { + t.Errorf("\n got %v\nwant %v", m, want) + } +} + var benchInput string func init() { diff --git a/Godeps/_workspace/src/github.com/gogo/protobuf/proto/text_test.go b/Godeps/_workspace/src/github.com/gogo/protobuf/proto/text_test.go index a98504ef35d0..6524048428f0 100644 --- a/Godeps/_workspace/src/github.com/gogo/protobuf/proto/text_test.go +++ b/Godeps/_workspace/src/github.com/gogo/protobuf/proto/text_test.go @@ -208,6 +208,30 @@ func TestMarshalTextUnknownEnum(t *testing.T) { } } +func TestTextOneof(t *testing.T) { + tests := []struct { + m proto.Message + want string + }{ + // zero message + {&pb.Communique{}, ``}, + // scalar field + {&pb.Communique{Union: &pb.Communique_Number{Number: 4}}, `number:4`}, + // message field + {&pb.Communique{Union: &pb.Communique_Msg{ + Msg: &pb.Strings{StringField: proto.String("why hello!")}, + }}, `msg:`}, + // bad oneof (should not panic) + {&pb.Communique{Union: &pb.Communique_Msg{Msg: nil}}, `msg:/* nil */`}, + } + for _, test := range tests { + got := strings.TrimSpace(test.m.String()) + if got != test.want { + t.Errorf("\n got %s\nwant %s", got, test.want) + } + } +} + func BenchmarkMarshalTextBuffered(b *testing.B) { buf := new(bytes.Buffer) m := newTestMessage() diff --git a/Godeps/_workspace/src/github.com/jonboulle/clockwork/.travis.yml b/Godeps/_workspace/src/github.com/jonboulle/clockwork/.travis.yml new file mode 100644 index 000000000000..6a363c70f86b --- /dev/null +++ b/Godeps/_workspace/src/github.com/jonboulle/clockwork/.travis.yml @@ -0,0 +1,3 @@ +language: go +go: + - 1.3 diff --git a/Godeps/_workspace/src/github.com/mesos/mesos-go/detector/zoo/client.go b/Godeps/_workspace/src/github.com/mesos/mesos-go/detector/zoo/client.go deleted file mode 100644 index 3e42c2d7c448..000000000000 --- a/Godeps/_workspace/src/github.com/mesos/mesos-go/detector/zoo/client.go +++ /dev/null @@ -1,444 +0,0 @@ -package zoo - -import ( - "errors" - "fmt" - "sync" - "sync/atomic" - "time" - - log "github.com/golang/glog" - "github.com/samuel/go-zookeeper/zk" -) - -const ( - defaultSessionTimeout = 60 * time.Second - defaultReconnectTimeout = 5 * time.Second - currentPath = "." - defaultRewatchDelay = 200 * time.Millisecond -) - -type stateType int32 - -const ( - disconnectedState stateType = iota - connectionRequestedState - connectionAttemptState - connectedState -) - -func (s stateType) String() string { - switch s { - case disconnectedState: - return "DISCONNECTED" - case connectionRequestedState: - return "REQUESTED" - case connectionAttemptState: - return "ATTEMPT" - case connectedState: - return "CONNECTED" - default: - panic(fmt.Sprintf("unrecognized state: %d", int32(s))) - } -} - -type Client struct { - conn Connector - defaultFactory Factory - factory Factory // must never be nil, use setFactory to update - state stateType - reconnCount uint64 - reconnDelay time.Duration - rootPath string - errorHandler ErrorHandler // must never be nil - connectOnce sync.Once - stopOnce sync.Once - shouldStop chan struct{} // signal chan - shouldReconn chan struct{} // message chan - connLock sync.Mutex - hasConnected chan struct{} // message chan - rewatchDelay time.Duration -} - -func newClient(hosts []string, path string) (*Client, error) { - zkc := &Client{ - reconnDelay: defaultReconnectTimeout, - rewatchDelay: defaultRewatchDelay, - rootPath: path, - shouldStop: make(chan struct{}), - shouldReconn: make(chan struct{}, 1), - hasConnected: make(chan struct{}, 1), - errorHandler: ErrorHandler(func(*Client, error) {}), - defaultFactory: asFactory(func() (Connector, <-chan zk.Event, error) { - return zk.Connect(hosts, defaultSessionTimeout) - }), - } - zkc.setFactory(zkc.defaultFactory) - // TODO(vlad): validate URIs - return zkc, nil -} - -func (zkc *Client) setFactory(f Factory) { - if f == nil { - f = zkc.defaultFactory - } - zkc.factory = asFactory(func() (c Connector, ch <-chan zk.Event, err error) { - select { - case <-zkc.shouldStop: - err = errors.New("client stopping") - default: - zkc.connLock.Lock() - defer zkc.connLock.Unlock() - if zkc.conn != nil { - zkc.conn.Close() - } - c, ch, err = f.create() - zkc.conn = c - } - return - }) -} - -// return true only if the client's state was changed from `from` to `to` -func (zkc *Client) stateChange(from, to stateType) (result bool) { - defer func() { - log.V(3).Infof("stateChange: from=%v to=%v result=%v", from, to, result) - }() - result = atomic.CompareAndSwapInt32((*int32)(&zkc.state), int32(from), int32(to)) - return -} - -// connect to zookeeper, blocks on the initial call to doConnect() -func (zkc *Client) connect() { - select { - case <-zkc.shouldStop: - return - default: - zkc.connectOnce.Do(func() { - if zkc.stateChange(disconnectedState, connectionRequestedState) { - if err := zkc.doConnect(); err != nil { - log.Error(err) - zkc.errorHandler(zkc, err) - } - } - go func() { - for { - select { - case <-zkc.shouldStop: - zkc.connLock.Lock() - defer zkc.connLock.Unlock() - if zkc.conn != nil { - zkc.conn.Close() - } - return - case <-zkc.shouldReconn: - if err := zkc.reconnect(); err != nil { - log.Error(err) - zkc.errorHandler(zkc, err) - } - } - } - }() - }) - } - return -} - -// attempt to reconnect to zookeeper. will ignore attempts to reconnect -// if not disconnected. if reconnection is attempted then this func will block -// for at least reconnDelay before actually attempting to connect to zookeeper. -func (zkc *Client) reconnect() error { - if !zkc.stateChange(disconnectedState, connectionRequestedState) { - log.V(4).Infoln("Ignoring reconnect, currently connected/connecting.") - return nil - } - - defer func() { zkc.reconnCount++ }() - - log.V(4).Infoln("Delaying reconnection for ", zkc.reconnDelay) - <-time.After(zkc.reconnDelay) - - return zkc.doConnect() -} - -func (zkc *Client) doConnect() error { - if !zkc.stateChange(connectionRequestedState, connectionAttemptState) { - log.V(4).Infoln("aborting doConnect, connection attempt already in progress or else disconnected") - return nil - } - - // if we're not connected by the time we return then we failed. - defer func() { - zkc.stateChange(connectionAttemptState, disconnectedState) - }() - - // create Connector instance - conn, sessionEvents, err := zkc.factory.create() - if err != nil { - // once the factory stops producing connectors, it's time to stop - zkc.stop() - return err - } - - zkc.connLock.Lock() - zkc.conn = conn - zkc.connLock.Unlock() - - log.V(4).Infof("Created connection object of type %T\n", conn) - connected := make(chan struct{}) - sessionExpired := make(chan struct{}) - go func() { - defer close(sessionExpired) - zkc.monitorSession(sessionEvents, connected) - }() - - // wait for connected confirmation - select { - case <-connected: - if !zkc.stateChange(connectionAttemptState, connectedState) { - log.V(4).Infoln("failed to transition to connected state") - // we could be: - // - disconnected ... reconnect() will try to connect again, otherwise; - // - connected ... another goroutine already established a connection - // - connectionRequested ... another goroutine is already trying to connect - zkc.requestReconnect() - } - log.Infoln("zookeeper client connected") - case <-sessionExpired: - // connection was disconnected before it was ever really 'connected' - if !zkc.stateChange(connectionAttemptState, disconnectedState) { - //programming error - panic("failed to transition from connection-attempt to disconnected state") - } - zkc.requestReconnect() - case <-zkc.shouldStop: - // noop - } - return nil -} - -// signal for reconnect unless we're shutting down -func (zkc *Client) requestReconnect() { - select { - case <-zkc.shouldStop: - // abort reconnect request, client is shutting down - default: - select { - case zkc.shouldReconn <- struct{}{}: - // reconnect request successful - default: - // reconnect chan is full: reconnect has already - // been requested. move on. - } - } -} - -// monitor a zookeeper session event channel, closes the 'connected' channel once -// a zookeeper connection has been established. errors are forwarded to the client's -// errorHandler. the closing of the sessionEvents chan triggers a call to client.onDisconnected. -// this func blocks until either the client's shouldStop or sessionEvents chan are closed. -func (zkc *Client) monitorSession(sessionEvents <-chan zk.Event, connected chan struct{}) { - firstConnected := true - for { - select { - case <-zkc.shouldStop: - return - case e, ok := <-sessionEvents: - if !ok { - // once sessionEvents is closed, the embedded ZK client will - // no longer attempt to reconnect. - zkc.onDisconnected() - return - } else if e.Err != nil { - log.Errorf("received state error: %s", e.Err.Error()) - zkc.errorHandler(zkc, e.Err) - } - switch e.State { - case zk.StateConnecting: - log.Infoln("connecting to zookeeper..") - - case zk.StateConnected: - log.V(2).Infoln("received StateConnected") - if firstConnected { - close(connected) // signal session listener - firstConnected = false - } - // let any listeners know about the change - select { - case <-zkc.shouldStop: // noop - case zkc.hasConnected <- struct{}{}: // noop - default: // message buf full, this becomes a non-blocking noop - } - - case zk.StateDisconnected: - log.Infoln("zookeeper client disconnected") - - case zk.StateExpired: - log.Infoln("zookeeper client session expired") - } - } - } -} - -// watch the child nodes for changes, at the specified path. -// callers that specify a path of `currentPath` will watch the currently set rootPath, -// otherwise the watchedPath is calculated as rootPath+path. -// this func spawns a go routine to actually do the watching, and so returns immediately. -// in the absense of errors a signalling channel is returned that will close -// upon the termination of the watch (e.g. due to disconnection). -func (zkc *Client) watchChildren(path string, watcher ChildWatcher) (<-chan struct{}, error) { - watchPath := zkc.rootPath - if path != "" && path != currentPath { - watchPath = watchPath + path - } - - log.V(2).Infoln("Watching children for path", watchPath) - watchEnded := make(chan struct{}) - go func() { - defer close(watchEnded) - zkc._watchChildren(watchPath, watcher) - }() - return watchEnded, nil -} - -// continuation of watchChildren. blocks until either underlying zk connector terminates, or else this -// client is shut down. continuously renews child watches. -func (zkc *Client) _watchChildren(watchPath string, watcher ChildWatcher) { - watcher(zkc, watchPath) // prime the listener - var zkevents <-chan zk.Event - var err error - first := true - for { - // we really only expect this to happen when zk session has expired, - // give the connection a little time to re-establish itself - for { - //TODO(jdef) it would be better if we could listen for broadcast Connection/Disconnection events, - //emitted whenever the embedded client cycles (read: when the connection state of this client changes). - //As it currently stands, if the embedded client cycles fast enough, we may actually not notice it here - //and keep on watching like nothing bad happened. - if !zkc.isConnected() { - log.Warningf("no longer connected to server, exiting child watch") - return - } - if first { - first = false - } else { - select { - case <-zkc.shouldStop: - return - case <-time.After(zkc.rewatchDelay): - } - } - _, _, zkevents, err = zkc.conn.ChildrenW(watchPath) - if err == nil { - log.V(2).Infoln("rewatching children for path", watchPath) - break - } - log.V(1).Infof("unable to watch children for path %s: %s", watchPath, err.Error()) - zkc.errorHandler(zkc, err) - } - // zkevents is (at most) a one-trick channel - // (a) a child event happens (no error) - // (b) the embedded client is shutting down (zk.ErrClosing) - // (c) the zk session expires (zk.ErrSessionExpired) - select { - case <-zkc.shouldStop: - return - case e, ok := <-zkevents: - if !ok { - log.Warningf("expected a single zk event before channel close") - break // the select - } - switch e.Type { - //TODO(jdef) should we not also watch for EventNode{Created,Deleted,DataChanged}? - case zk.EventNodeChildrenChanged: - log.V(2).Infoln("Handling: zk.EventNodeChildrenChanged") - watcher(zkc, e.Path) - continue - default: - if e.Err != nil { - zkc.errorHandler(zkc, e.Err) - if e.Type == zk.EventNotWatching && e.State == zk.StateDisconnected { - if e.Err == zk.ErrClosing { - log.V(1).Infof("watch invalidated, embedded client terminating") - return - } - log.V(1).Infof("watch invalidated, attempting to watch again: %v", e.Err) - } else { - log.Warningf("received error while watching path %s: %s", watchPath, e.Err.Error()) - } - } - } - } - } -} - -func (zkc *Client) onDisconnected() { - if st := zkc.getState(); st == connectedState && zkc.stateChange(st, disconnectedState) { - log.Infoln("disconnected from the server, reconnecting...") - zkc.requestReconnect() - return - } -} - -// return a channel that gets an empty struct every time a connection happens -func (zkc *Client) connections() <-chan struct{} { - return zkc.hasConnected -} - -func (zkc *Client) getState() stateType { - return stateType(atomic.LoadInt32((*int32)(&zkc.state))) -} - -// convenience function -func (zkc *Client) isConnected() bool { - return zkc.getState() == connectedState -} - -// convenience function -func (zkc *Client) isConnecting() bool { - state := zkc.getState() - return state == connectionRequestedState || state == connectionAttemptState -} - -// convenience function -func (zkc *Client) isDisconnected() bool { - return zkc.getState() == disconnectedState -} - -func (zkc *Client) list(path string) ([]string, error) { - if !zkc.isConnected() { - return nil, errors.New("Unable to list children, client not connected.") - } - - children, _, err := zkc.conn.Children(path) - if err != nil { - return nil, err - } - - return children, nil -} - -func (zkc *Client) data(path string) ([]byte, error) { - if !zkc.isConnected() { - return nil, errors.New("Unable to retrieve node data, client not connected.") - } - - data, _, err := zkc.conn.Get(path) - if err != nil { - return nil, err - } - - return data, nil -} - -func (zkc *Client) stop() { - zkc.stopOnce.Do(func() { - close(zkc.shouldStop) - }) -} - -// when this channel is closed the client is either stopping, or has stopped -func (zkc *Client) stopped() <-chan struct{} { - return zkc.shouldStop -} diff --git a/Godeps/_workspace/src/github.com/mesos/mesos-go/detector/zoo/client2.go b/Godeps/_workspace/src/github.com/mesos/mesos-go/detector/zoo/client2.go new file mode 100644 index 000000000000..8d3799a08139 --- /dev/null +++ b/Godeps/_workspace/src/github.com/mesos/mesos-go/detector/zoo/client2.go @@ -0,0 +1,88 @@ +package zoo + +import ( + "sync" + "time" + + "github.com/samuel/go-zookeeper/zk" +) + +const ( + defaultSessionTimeout = 60 * time.Second + currentPath = "." +) + +var zkSessionTimeout = defaultSessionTimeout + +type client2 struct { + *zk.Conn + path string + done chan struct{} // signal chan, closes when the underlying connection terminates + stopOnce sync.Once +} + +func connect2(hosts []string, path string) (*client2, error) { + c, ev, err := zk.Connect(hosts, zkSessionTimeout) + if err != nil { + return nil, err + } + done := make(chan struct{}) + go func() { + // close the 'done' chan when the zk event chan closes (signals termination of zk connection) + defer close(done) + for { + if _, ok := <-ev; !ok { + return + } + } + }() + return &client2{ + Conn: c, + path: path, + done: done, + }, nil +} + +func (c *client2) stopped() <-chan struct{} { + return c.done +} + +func (c *client2) stop() { + c.stopOnce.Do(c.Close) +} + +func (c *client2) data(path string) (data []byte, err error) { + data, _, err = c.Get(path) + return +} + +func (c *client2) watchChildren(path string) (string, <-chan []string, <-chan error) { + errCh := make(chan error, 1) + snap := make(chan []string) + + watchPath := c.path + if path != "" && path != currentPath { + watchPath = watchPath + path + } + go func() { + defer close(errCh) + for { + children, _, ev, err := c.ChildrenW(watchPath) + if err != nil { + errCh <- err + return + } + select { + case snap <- children: + case <-c.done: + return + } + e := <-ev // wait for the next watch-related event + if e.Err != nil { + errCh <- e.Err + return + } + } + }() + return watchPath, snap, errCh +} diff --git a/Godeps/_workspace/src/github.com/mesos/mesos-go/detector/zoo/client_test.go b/Godeps/_workspace/src/github.com/mesos/mesos-go/detector/zoo/client_test.go deleted file mode 100644 index 1ebca734b36e..000000000000 --- a/Godeps/_workspace/src/github.com/mesos/mesos-go/detector/zoo/client_test.go +++ /dev/null @@ -1,342 +0,0 @@ -package zoo - -import ( - "errors" - "fmt" - "os" - "strings" - "sync/atomic" - "testing" - "time" - - "github.com/gogo/protobuf/proto" - log "github.com/golang/glog" - util "github.com/mesos/mesos-go/mesosutil" - "github.com/samuel/go-zookeeper/zk" - "github.com/stretchr/testify/assert" -) - -var test_zk_hosts = []string{"localhost:2181"} - -const ( - test_zk_path = "/test" -) - -func TestClientNew(t *testing.T) { - path := "/mesos" - chEvent := make(chan zk.Event) - connector := makeMockConnector(path, chEvent) - - c, err := newClient(test_zk_hosts, path) - assert.NoError(t, err) - assert.NotNil(t, c) - assert.False(t, c.isConnected()) - c.conn = connector - -} - -// This test requires zookeeper to be running. -// You must also set env variable ZK_HOSTS to point to zk hosts. -// The zk package does not offer a way to mock its connection function. -func TestClientConnectIntegration(t *testing.T) { - if os.Getenv("ZK_HOSTS") == "" { - t.Skip("Skipping zk-server connection test: missing env ZK_HOSTS.") - } - hosts := strings.Split(os.Getenv("ZK_HOSTS"), ",") - c, err := newClient(hosts, "/mesos") - assert.NoError(t, err) - c.errorHandler = ErrorHandler(func(c *Client, e error) { - err = e - }) - c.connect() - assert.NoError(t, err) - - c.connect() - assert.NoError(t, err) - assert.True(t, c.isConnected()) -} - -func TestClientConnect(t *testing.T) { - c, err := makeClient() - assert.NoError(t, err) - assert.False(t, c.isConnected()) - c.connect() - assert.True(t, c.isConnected()) - assert.False(t, c.isConnecting()) -} - -func TestClient_FlappingConnection(t *testing.T) { - c, err := newClient(test_zk_hosts, test_zk_path) - c.reconnDelay = 10 * time.Millisecond // we don't want this test to take forever - defer c.stop() - - assert.NoError(t, err) - - attempts := 0 - c.setFactory(asFactory(func() (Connector, <-chan zk.Event, error) { - log.V(2).Infof("**** Using zk.Conn adapter ****") - ch0 := make(chan zk.Event, 10) // session chan - ch1 := make(chan zk.Event) // watch chan - go func() { - if attempts > 1 { - t.Fatalf("only one connector instance is expected") - } - attempts++ - for i := 0; i < 4; i++ { - ch0 <- zk.Event{ - Type: zk.EventSession, - State: zk.StateConnecting, - Path: test_zk_path, - } - ch0 <- zk.Event{ - Type: zk.EventSession, - State: zk.StateConnected, - Path: test_zk_path, - } - time.Sleep(200 * time.Millisecond) - ch0 <- zk.Event{ - Type: zk.EventSession, - State: zk.StateDisconnected, - Path: test_zk_path, - } - } - }() - connector := makeMockConnector(test_zk_path, ch1) - return connector, ch0, nil - })) - - go c.connect() - time.Sleep(2 * time.Second) - assert.True(t, c.isConnected()) - assert.Equal(t, 1, attempts) -} - -func TestClientWatchChildren(t *testing.T) { - c, err := makeClient() - assert.NoError(t, err) - c.errorHandler = ErrorHandler(func(c *Client, e error) { - err = e - }) - c.connect() - assert.NoError(t, err) - wCh := make(chan struct{}, 1) - childrenWatcher := ChildWatcher(func(zkc *Client, path string) { - log.V(4).Infoln("Path", path, "changed!") - children, err := c.list(path) - assert.NoError(t, err) - assert.Equal(t, 3, len(children)) - assert.Equal(t, "info_0", children[0]) - assert.Equal(t, "info_5", children[1]) - assert.Equal(t, "info_10", children[2]) - wCh <- struct{}{} - }) - - _, err = c.watchChildren(currentPath, childrenWatcher) - assert.NoError(t, err) - - select { - case <-wCh: - case <-time.After(time.Millisecond * 700): - panic("Waited too long...") - } -} - -func TestClientWatchErrors(t *testing.T) { - path := "/test" - ch := make(chan zk.Event, 1) - ch <- zk.Event{ - Type: zk.EventNotWatching, - Err: errors.New("Event Error"), - } - - c, err := makeClient() - c.state = connectedState - - assert.NoError(t, err) - c.conn = makeMockConnector(path, (<-chan zk.Event)(ch)) - wCh := make(chan struct{}, 1) - c.errorHandler = ErrorHandler(func(zkc *Client, err error) { - assert.Error(t, err) - wCh <- struct{}{} - }) - - c.watchChildren(currentPath, ChildWatcher(func(*Client, string) {})) - - select { - case <-wCh: - case <-time.After(time.Millisecond * 700): - t.Fatalf("timed out waiting for error message") - } - -} - -func TestWatchChildren_flappy(t *testing.T) { - c, err := newClient(test_zk_hosts, test_zk_path) - c.reconnDelay = 10 * time.Millisecond // we don't want this test to take forever - - assert.NoError(t, err) - - attempts := 0 - conn := NewMockConnector() - defer func() { - if !t.Failed() { - conn.AssertExpectations(t) - } - }() - defer func() { - // stop client and give it time to shut down the connector - c.stop() - time.Sleep(100 * time.Millisecond) - }() - c.setFactory(asFactory(func() (Connector, <-chan zk.Event, error) { - log.V(2).Infof("**** Using zk.Conn adapter ****") - ch0 := make(chan zk.Event, 10) // session chan - ch1 := make(chan zk.Event) // watch chan - go func() { - if attempts > 1 { - t.Fatalf("only one connector instance is expected") - } - attempts++ - for i := 0; i < 4; i++ { - ch0 <- zk.Event{ - Type: zk.EventSession, - State: zk.StateConnecting, - Path: test_zk_path, - } - ch0 <- zk.Event{ - Type: zk.EventSession, - State: zk.StateConnected, - Path: test_zk_path, - } - time.Sleep(200 * time.Millisecond) - ch0 <- zk.Event{ - Type: zk.EventSession, - State: zk.StateDisconnected, - Path: test_zk_path, - } - } - ch0 <- zk.Event{ - Type: zk.EventSession, - State: zk.StateConnecting, - Path: test_zk_path, - } - ch0 <- zk.Event{ - Type: zk.EventSession, - State: zk.StateConnected, - Path: test_zk_path, - } - ch1 <- zk.Event{ - Type: zk.EventNodeChildrenChanged, - Path: test_zk_path, - } - }() - simulatedErr := errors.New("simulated watch error") - conn.On("ChildrenW", test_zk_path).Return(nil, nil, nil, simulatedErr).Times(4) - conn.On("ChildrenW", test_zk_path).Return([]string{test_zk_path}, &zk.Stat{}, (<-chan zk.Event)(ch1), nil) - conn.On("Close").Return(nil) - return conn, ch0, nil - })) - - go c.connect() - var watchChildrenCount uint64 - watcherFunc := ChildWatcher(func(zkc *Client, path string) { - log.V(1).Infof("ChildWatcher invoked %d", atomic.LoadUint64(&watchChildrenCount)) - }) - startTime := time.Now() - endTime := startTime.Add(2 * time.Second) -watcherLoop: - for time.Now().Before(endTime) { - log.V(1).Infof("entered watcherLoop") - select { - case <-c.connections(): - log.V(1).Infof("invoking watchChildren") - if _, err := c.watchChildren(currentPath, watcherFunc); err == nil { - // watching children succeeded!! - t.Logf("child watch success") - atomic.AddUint64(&watchChildrenCount, 1) - } else { - // setting the watch failed - t.Logf("setting child watch failed: %v", err) - continue watcherLoop - } - case <-c.stopped(): - t.Logf("detected client termination") - break watcherLoop - case <-time.After(endTime.Sub(time.Now())): - } - } - - wantChildrenCount := atomic.LoadUint64(&watchChildrenCount) - assert.Equal(t, uint64(5), wantChildrenCount, "expected watchChildrenCount = 5 instead of %d, should be reinvoked upon initial ChildrenW failures", wantChildrenCount) -} - -func makeClient() (*Client, error) { - ch0 := make(chan zk.Event, 2) - ch1 := make(chan zk.Event, 1) - - ch0 <- zk.Event{ - State: zk.StateConnected, - Path: test_zk_path, - } - ch1 <- zk.Event{ - Type: zk.EventNodeChildrenChanged, - Path: test_zk_path, - } - go func() { - time.Sleep(1 * time.Second) - ch0 <- zk.Event{ - State: zk.StateDisconnected, - } - close(ch0) - close(ch1) - }() - - c, err := newClient(test_zk_hosts, test_zk_path) - if err != nil { - return nil, err - } - - // only allow a single connection - first := true - c.setFactory(asFactory(func() (Connector, <-chan zk.Event, error) { - if !first { - return nil, nil, errors.New("only a single connection attempt allowed for mock connector") - } else { - first = false - } - log.V(2).Infof("**** Using zk.Conn adapter ****") - connector := makeMockConnector(test_zk_path, ch1) - return connector, ch0, nil - })) - - return c, nil -} - -func makeMockConnector(path string, chEvent <-chan zk.Event) *MockConnector { - log.V(2).Infoln("Making Connector mock.") - conn := NewMockConnector() - conn.On("Close").Return(nil) - conn.On("ChildrenW", path).Return([]string{path}, &zk.Stat{}, chEvent, nil) - conn.On("Children", path).Return([]string{"info_0", "info_5", "info_10"}, &zk.Stat{}, nil) - conn.On("Get", fmt.Sprintf("%s/info_0", path)).Return(makeTestMasterInfo(), &zk.Stat{}, nil) - - return conn -} - -func newTestMasterInfo(id int) []byte { - miPb := util.NewMasterInfo(fmt.Sprintf("master(%d)@localhost:5050", id), 123456789, 400) - data, err := proto.Marshal(miPb) - if err != nil { - panic(err) - } - return data -} - -func makeTestMasterInfo() []byte { - miPb := util.NewMasterInfo("master@localhost:5050", 123456789, 400) - data, err := proto.Marshal(miPb) - if err != nil { - panic(err) - } - return data -} diff --git a/Godeps/_workspace/src/github.com/mesos/mesos-go/detector/zoo/detect.go b/Godeps/_workspace/src/github.com/mesos/mesos-go/detector/zoo/detect.go index 48eee4b41401..aca08fe4b2aa 100644 --- a/Godeps/_workspace/src/github.com/mesos/mesos-go/detector/zoo/detect.go +++ b/Godeps/_workspace/src/github.com/mesos/mesos-go/detector/zoo/detect.go @@ -19,6 +19,7 @@ package zoo import ( + "encoding/json" "fmt" "math" "net/url" @@ -37,25 +38,37 @@ import ( const ( // prefix for nodes listed at the ZK URL path nodePrefix = "info_" + nodeJSONPrefix = "json.info_" defaultMinDetectorCyclePeriod = 1 * time.Second ) // reasonable default for a noop change listener var ignoreChanged = detector.OnMasterChanged(func(*mesos.MasterInfo) {}) +type zkInterface interface { + stopped() <-chan struct{} + stop() + data(string) ([]byte, error) + watchChildren(string) (string, <-chan []string, <-chan error) +} + +type infoCodec func(path, node string) (*mesos.MasterInfo, error) + // Detector uses ZooKeeper to detect new leading master. type MasterDetector struct { - client *Client + client zkInterface leaderNode string - // for one-time zk client initiation - bootstrap sync.Once + bootstrapLock sync.RWMutex // guard against concurrent invocations of bootstrapFunc + bootstrapFunc func() error // for one-time zk client initiation // latch: only install, at most, one ignoreChanged listener; see MasterDetector.Detect ignoreInstalled int32 // detection should not signal master change listeners more frequently than this minDetectorCyclePeriod time.Duration + done chan struct{} + cancel func() } // Internal constructor function @@ -66,17 +79,20 @@ func NewMasterDetector(zkurls string) (*MasterDetector, error) { return nil, err } - client, err := newClient(zkHosts, zkPath) - if err != nil { - return nil, err - } - detector := &MasterDetector{ - client: client, minDetectorCyclePeriod: defaultMinDetectorCyclePeriod, + done: make(chan struct{}), + cancel: func() {}, } - log.V(2).Infoln("Created new detector, watching ", zkHosts, zkPath) + detector.bootstrapFunc = func() (err error) { + if detector.client == nil { + detector.client, err = connect2(zkHosts, zkPath) + } + return + } + + log.V(2).Infoln("Created new detector to watch", zkHosts, zkPath) return detector, nil } @@ -94,42 +110,35 @@ func parseZk(zkurls string) ([]string, string, error) { // returns a chan that, when closed, indicates termination of the detector func (md *MasterDetector) Done() <-chan struct{} { - return md.client.stopped() + return md.done } func (md *MasterDetector) Cancel() { - md.client.stop() + md.bootstrapLock.RLock() + defer md.bootstrapLock.RUnlock() + md.cancel() } -//TODO(jdef) execute async because we don't want to stall our client's event loop? if so -//then we also probably want serial event delivery (aka. delivery via a chan) but then we -//have to deal with chan buffer sizes .. ugh. This is probably the least painful for now. -func (md *MasterDetector) childrenChanged(zkc *Client, path string, obs detector.MasterChanged) { - log.V(2).Infof("fetching children at path '%v'", path) - list, err := zkc.list(path) - if err != nil { - log.Warning(err) - return - } - +func (md *MasterDetector) childrenChanged(path string, list []string, obs detector.MasterChanged) { md.notifyMasterChanged(path, list, obs) md.notifyAllMasters(path, list, obs) } func (md *MasterDetector) notifyMasterChanged(path string, list []string, obs detector.MasterChanged) { - topNode := selectTopNode(list) + // mesos v0.24 writes JSON only, v0.23 writes json and protobuf, v0.22 and prior only write protobuf + topNode, codec := md.selectTopNode(list) if md.leaderNode == topNode { log.V(2).Infof("ignoring children-changed event, leader has not changed: %v", path) return } - log.V(2).Infof("changing leader node from %s -> %s", md.leaderNode, topNode) + log.V(2).Infof("changing leader node from %q -> %q", md.leaderNode, topNode) md.leaderNode = topNode var masterInfo *mesos.MasterInfo if md.leaderNode != "" { var err error - if masterInfo, err = md.pullMasterInfo(path, topNode); err != nil { + if masterInfo, err = codec(path, topNode); err != nil { log.Errorln(err.Error()) } } @@ -156,7 +165,21 @@ func (md *MasterDetector) pullMasterInfo(path, node string) (*mesos.MasterInfo, masterInfo := &mesos.MasterInfo{} err = proto.Unmarshal(data, masterInfo) if err != nil { - return nil, fmt.Errorf("failed to unmarshall MasterInfo data from zookeeper: %v", err) + return nil, fmt.Errorf("failed to unmarshal protobuf MasterInfo data from zookeeper: %v", err) + } + return masterInfo, nil +} + +func (md *MasterDetector) pullMasterJsonInfo(path, node string) (*mesos.MasterInfo, error) { + data, err := md.client.data(fmt.Sprintf("%s/%s", path, node)) + if err != nil { + return nil, fmt.Errorf("failed to retrieve leader data: %v", err) + } + + masterInfo := &mesos.MasterInfo{} + err = json.Unmarshal(data, masterInfo) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal json MasterInfo data from zookeeper: %v", err) } return masterInfo, nil } @@ -167,18 +190,52 @@ func (md *MasterDetector) notifyAllMasters(path string, list []string, obs detec // not interested in entire master list return } - masters := []*mesos.MasterInfo{} - for _, node := range list { - info, err := md.pullMasterInfo(path, node) + + // mesos v0.24 writes JSON only, v0.23 writes json and protobuf, v0.22 and prior only write protobuf + masters := map[string]*mesos.MasterInfo{} + tryStore := func(node string, codec infoCodec) { + info, err := codec(path, node) if err != nil { log.Errorln(err.Error()) } else { - masters = append(masters, info) + masters[info.GetId()] = info } } + for _, node := range list { + // compare https://github.com/apache/mesos/blob/0.23.0/src/master/detector.cpp#L437 + if strings.HasPrefix(node, nodePrefix) { + tryStore(node, md.pullMasterInfo) + } else if strings.HasPrefix(node, nodeJSONPrefix) { + tryStore(node, md.pullMasterJsonInfo) + } else { + continue + } + } + masterList := make([]*mesos.MasterInfo, 0, len(masters)) + for _, v := range masters { + masterList = append(masterList, v) + } - log.V(2).Infof("notifying of master membership change: %+v", masters) - logPanic(func() { all.UpdatedMasters(masters) }) + log.V(2).Infof("notifying of master membership change: %+v", masterList) + logPanic(func() { all.UpdatedMasters(masterList) }) +} + +func (md *MasterDetector) callBootstrap() (e error) { + log.V(2).Infoln("invoking detector boostrap") + md.bootstrapLock.Lock() + defer md.bootstrapLock.Unlock() + + clientConfigured := md.client != nil + if e = md.bootstrapFunc(); e == nil && !clientConfigured && md.client != nil { + // chain the lifetime of this detector to that of the newly created client impl + client := md.client + md.cancel = client.stop + go func() { + defer close(md.done) + <-client.stopped() + }() + } + return } // the first call to Detect will kickstart a connection to zookeeper. a nil change listener may @@ -187,70 +244,111 @@ func (md *MasterDetector) notifyAllMasters(path string, list []string, obs detec // once, and each time the spec'd listener will be added to the list of those receiving notifications. func (md *MasterDetector) Detect(f detector.MasterChanged) (err error) { // kickstart zk client connectivity - md.bootstrap.Do(func() { go md.client.connect() }) + if err := md.callBootstrap(); err != nil { + log.V(3).Infoln("failed to execute bootstrap function", err.Error()) + return err + } if f == nil { // only ever install, at most, one ignoreChanged listener. multiple instances of it // just consume resources and generate misleading log messages. if !atomic.CompareAndSwapInt32(&md.ignoreInstalled, 0, 1) { + log.V(3).Infoln("ignoreChanged listener already installed") return } f = ignoreChanged } + log.V(3).Infoln("spawning detect()") go md.detect(f) return nil } func (md *MasterDetector) detect(f detector.MasterChanged) { + log.V(3).Infoln("detecting children at", currentPath) detectLoop: for { - started := time.Now() select { case <-md.Done(): return - case <-md.client.connections(): - // we let the golang runtime manage our listener list for us, in form of goroutines that - // callback to the master change notification listen func's - if watchEnded, err := md.client.watchChildren(currentPath, ChildWatcher(func(zkc *Client, path string) { - md.childrenChanged(zkc, path, f) - })); err == nil { - log.V(2).Infoln("detector listener installed") + default: + } + log.V(3).Infoln("watching children at", currentPath) + path, childrenCh, errCh := md.client.watchChildren(currentPath) + rewatch := false + for { + started := time.Now() + select { + case children := <-childrenCh: + md.childrenChanged(path, children, f) + case err, ok := <-errCh: + // check for a tie first (required for predictability (tests)); the downside of + // doing this is that a listener might get two callbacks back-to-back ("new leader", + // followed by "no leader"). select { - case <-watchEnded: + case children := <-childrenCh: + md.childrenChanged(path, children, f) + default: + } + if ok { + log.V(1).Infoln("child watch ended with error, master lost; error was:", err.Error()) + } else { + // detector shutdown likely... + log.V(1).Infoln("child watch ended, master lost") + } + select { + case <-md.Done(): + return + default: if md.leaderNode != "" { - log.V(1).Infof("child watch ended, signaling master lost") + log.V(2).Infof("changing leader node from %q -> \"\"", md.leaderNode) md.leaderNode = "" f.OnMasterChanged(nil) } - case <-md.client.stopped(): + } + rewatch = true + } + // rate-limit master changes + if elapsed := time.Now().Sub(started); elapsed > 0 { + log.V(2).Infoln("resting before next detection cycle") + select { + case <-md.Done(): return + case <-time.After(md.minDetectorCyclePeriod - elapsed): // noop } - } else { - log.V(1).Infof("child watch ended with error: %v", err) + } + if rewatch { continue detectLoop } } - // rate-limit master changes - if elapsed := time.Now().Sub(started); elapsed > 0 { - log.V(2).Infoln("resting before next detection cycle") - select { - case <-md.Done(): - return - case <-time.After(md.minDetectorCyclePeriod - elapsed): // noop - } + } +} + +func (md *MasterDetector) selectTopNode(list []string) (topNode string, codec infoCodec) { + // mesos v0.24 writes JSON only, v0.23 writes json and protobuf, v0.22 and prior only write protobuf + topNode = selectTopNodePrefix(list, nodeJSONPrefix) + codec = md.pullMasterJsonInfo + if topNode == "" { + topNode = selectTopNodePrefix(list, nodePrefix) + codec = md.pullMasterInfo + + if topNode != "" { + log.Warningf("Leading master is using a Protobuf binary format when registering "+ + "with Zookeeper (%s): this will be deprecated as of Mesos 0.24 (see MESOS-2340).", + topNode) } } + return } -func selectTopNode(list []string) (node string) { +func selectTopNodePrefix(list []string, pre string) (node string) { var leaderSeq uint64 = math.MaxUint64 for _, v := range list { - if !strings.HasPrefix(v, nodePrefix) { + if !strings.HasPrefix(v, pre) { continue // only care about participants } - seqStr := strings.TrimPrefix(v, nodePrefix) + seqStr := strings.TrimPrefix(v, pre) seq, err := strconv.ParseUint(seqStr, 10, 64) if err != nil { log.Warningf("unexpected zk node format '%s': %v", seqStr, err) diff --git a/Godeps/_workspace/src/github.com/mesos/mesos-go/detector/zoo/detect_test.go b/Godeps/_workspace/src/github.com/mesos/mesos-go/detector/zoo/detect_test.go index de1ce9762a97..863e7caa3b35 100644 --- a/Godeps/_workspace/src/github.com/mesos/mesos-go/detector/zoo/detect_test.go +++ b/Godeps/_workspace/src/github.com/mesos/mesos-go/detector/zoo/detect_test.go @@ -1,9 +1,7 @@ package zoo import ( - "errors" "fmt" - "sort" "sync" "testing" "time" @@ -12,14 +10,16 @@ import ( log "github.com/golang/glog" "github.com/mesos/mesos-go/detector" mesos "github.com/mesos/mesos-go/mesosproto" + util "github.com/mesos/mesos-go/mesosutil" "github.com/samuel/go-zookeeper/zk" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" ) const ( - zkurl = "zk://127.0.0.1:2181/mesos" - zkurl_bad = "zk://127.0.0.1:2181" + zkurl = "zk://127.0.0.1:2181/mesos" + zkurl_bad = "zk://127.0.0.1:2181" + test_zk_path = "/test" ) func TestParseZk_single(t *testing.T) { @@ -43,361 +43,299 @@ func TestParseZk_multiIP(t *testing.T) { assert.Equal(t, "/mesos", path) } -func TestMasterDetectorStart(t *testing.T) { - c, err := makeClient() - assert.False(t, c.isConnected()) - md, err := NewMasterDetector(zkurl) - defer md.Cancel() - assert.NoError(t, err) - c.errorHandler = ErrorHandler(func(c *Client, e error) { - err = e - }) - md.client = c // override zk.Conn with our own. - md.client.connect() - assert.NoError(t, err) - assert.True(t, c.isConnected()) +type mockZkClient struct { + mock.Mock } -func TestMasterDetectorChildrenChanged(t *testing.T) { - wCh := make(chan struct{}, 1) +func (m *mockZkClient) stopped() (a <-chan struct{}) { + args := m.Called() + if x := args.Get(0); x != nil { + a = x.(<-chan struct{}) + } + return +} - c, err := makeClient() - assert.NoError(t, err) - assert.False(t, c.isConnected()) +func (m *mockZkClient) stop() { + m.Called() +} + +func (m *mockZkClient) 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 *mockZkClient) 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 newMockZkClient(initialChildren ...string) (mocked *mockZkClient, snaps chan []string, errs chan error) { + var doneOnce sync.Once + done := make(chan struct{}) + + mocked = &mockZkClient{} + 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", currentPath).Return( + test_zk_path, (<-chan []string)(snaps), (<-chan error)(errs)).Run( + func(_ mock.Arguments) { log.V(1).Infoln("watchChildren invoked") }) + } + return +} + +func newTestMasterInfo(id int) []byte { + miPb := util.NewMasterInfo(fmt.Sprintf("master(%d)@localhost:5050", id), 123456789, 400) + data, err := proto.Marshal(miPb) + if err != nil { + panic(err) + } + return data +} + +func TestMasterDetectorChildrenChanged(t *testing.T) { md, err := NewMasterDetector(zkurl) defer md.Cancel() assert.NoError(t, err) - // override zk.Conn with our own. - c.errorHandler = ErrorHandler(func(c *Client, e error) { - err = e - }) - md.client = c - md.client.connect() - assert.NoError(t, err) - assert.True(t, c.isConnected()) + + path := test_zk_path + snapDetected := make(chan struct{}) + md.bootstrapFunc = func() error { + if md.client != nil { + return nil + } + log.V(1).Infoln("bootstrapping detector") + defer log.V(1).Infoln("bootstrapping detector ..finished") + + mocked, _, errs := newMockZkClient("info_0", "info_5", "info_10") + md.client = mocked + md.minDetectorCyclePeriod = 10 * time.Millisecond // we don't have all day! + + mocked.On("data", fmt.Sprintf("%s/info_0", path)).Return(newTestMasterInfo(0), nil) + + // wait for the first child snapshot to be processed before signaling end-of-watch + // (which is signalled by closing errs). + go func() { + defer close(errs) + select { + case <-snapDetected: + case <-md.Done(): + t.Errorf("detector died before child snapshot") + } + }() + return nil + } called := 0 - md.Detect(detector.OnMasterChanged(func(master *mesos.MasterInfo) { + lostMaster := make(chan struct{}) + const expectedLeader = "master(0)@localhost:5050" + err = md.Detect(detector.OnMasterChanged(func(master *mesos.MasterInfo) { //expect 2 calls in sequence: the first setting a master //and the second clearing it switch called++; called { case 1: + defer close(snapDetected) assert.NotNil(t, master) - assert.Equal(t, master.GetId(), "master@localhost:5050") - wCh <- struct{}{} + assert.Equal(t, expectedLeader, master.GetId()) case 2: + md.Cancel() + defer close(lostMaster) assert.Nil(t, master) - wCh <- struct{}{} default: - t.Fatalf("unexpected notification call attempt %d", called) + t.Errorf("unexpected notification call attempt %d", called) } })) + assert.NoError(t, err) + + fatalOn(t, 10*time.Second, lostMaster, "Waited too long for lost master") - startWait := time.Now() select { - case <-wCh: - case <-time.After(time.Second * 3): - panic("Waited too long...") + case <-md.Done(): + assert.Equal(t, 2, called, "expected 2 detection callbacks instead of %d", called) + case <-time.After(time.Second * 10): + panic("Waited too long for detector shutdown...") } - - // wait for the disconnect event, should be triggered - // 1s after the connected event - waited := time.Now().Sub(startWait) - time.Sleep((2 * time.Second) - waited) - assert.False(t, c.isConnected()) } -// single connector instance, session does not expire, but it's internal connection to zk is flappy -func TestMasterDetectFlappingConnectionState(t *testing.T) { - c, err := newClient(test_zk_hosts, test_zk_path) +// single connector instance, it's internal connection to zk is flappy +func TestMasterDetectorFlappyConnectionState(t *testing.T) { + md, err := NewMasterDetector(zkurl) + defer md.Cancel() assert.NoError(t, err) - initialChildren := []string{"info_005", "info_010", "info_022"} - connector := NewMockConnector() - connector.On("Close").Return(nil) - connector.On("Children", test_zk_path).Return(initialChildren, &zk.Stat{}, nil) - + const ITERATIONS = 3 var wg sync.WaitGroup - wg.Add(2) // async flapping, master change detection + wg.Add(1 + ITERATIONS) // +1 for the initial snapshot that's sent for the first watch + path := test_zk_path - first := true - c.setFactory(asFactory(func() (Connector, <-chan zk.Event, error) { - if !first { - t.Fatalf("only one connector instance expected") - return nil, nil, errors.New("ran out of connectors") - } else { - first = false + md.bootstrapFunc = func() error { + if md.client != nil { + return nil } - sessionEvents := make(chan zk.Event, 10) - watchEvents := make(chan zk.Event, 10) + log.V(1).Infoln("bootstrapping detector") + defer log.V(1).Infoln("bootstrapping detector ..finished") - connector.On("Get", fmt.Sprintf("%s/info_005", test_zk_path)).Return(newTestMasterInfo(1), &zk.Stat{}, nil).Once() - connector.On("ChildrenW", test_zk_path).Return([]string{test_zk_path}, &zk.Stat{}, (<-chan zk.Event)(watchEvents), nil) + children := []string{"info_0", "info_5", "info_10"} + mocked, snaps, errs := newMockZkClient(children...) + md.client = mocked + md.minDetectorCyclePeriod = 10 * time.Millisecond // we don't have all day! + + mocked.On("data", fmt.Sprintf("%s/info_0", path)).Return(newTestMasterInfo(0), nil) + + // the first snapshot will be sent immediately and the detector will be awaiting en event. + // cycle through some connected/disconnected events but maintain the same snapshot go func() { - defer wg.Done() - time.Sleep(100 * time.Millisecond) - for attempt := 0; attempt < 5; attempt++ { - sessionEvents <- zk.Event{ - Type: zk.EventSession, - State: zk.StateConnected, - } - time.Sleep(500 * time.Millisecond) - sessionEvents <- zk.Event{ - Type: zk.EventSession, - State: zk.StateDisconnected, - } - } - sessionEvents <- zk.Event{ - Type: zk.EventSession, - State: zk.StateConnected, + defer close(errs) + for attempt := 0; attempt < ITERATIONS; attempt++ { + // send an error, should cause the detector to re-issue a watch + errs <- zk.ErrSessionExpired + // the detection loop issues another watch, so send it a snapshot.. + // send another snapshot + snaps <- children } }() - return connector, sessionEvents, nil - })) - c.reconnDelay = 0 // there should be no reconnect, but just in case don't drag the test out - - md, err := NewMasterDetector(zkurl) - defer md.Cancel() - assert.NoError(t, err) - - c.errorHandler = ErrorHandler(func(c *Client, e error) { - t.Logf("zk client error: %v", e) - }) - md.client = c - - startTime := time.Now() - detected := false - md.Detect(detector.OnMasterChanged(func(master *mesos.MasterInfo) { - if detected { - t.Fatalf("already detected master, was not expecting another change: %v", master) - } else { - detected = true - assert.NotNil(t, master, fmt.Sprintf("on-master-changed %v", detected)) - t.Logf("Leader change detected at %v: '%+v'", time.Now().Sub(startTime), master) - wg.Done() - } - })) - - completed := make(chan struct{}) - go func() { - defer close(completed) - wg.Wait() - }() - - select { - case <-completed: // expected - case <-time.After(3 * time.Second): - t.Fatalf("failed to detect master change") + return nil } -} - -func TestMasterDetectFlappingConnector(t *testing.T) { - c, err := newClient(test_zk_hosts, test_zk_path) - assert.NoError(t, err) - - initialChildren := []string{"info_005", "info_010", "info_022"} - connector := NewMockConnector() - connector.On("Close").Return(nil) - connector.On("Children", test_zk_path).Return(initialChildren, &zk.Stat{}, nil) - - // timing - // t=0 t=400ms t=800ms t=1200ms t=1600ms t=2000ms t=2400ms - // |--=--=--=--|--=--=--=--|--=--=--=--|--=--=--=--|--=--=--=--|--=--=--=--|--=--=--=--|--=--=--=-- - // c1 d1 c3 d3 c5 d5 d6 ... - // c2 d2 c4 d4 c6 c7 ... - // M M' M M' M M' - attempt := 0 - c.setFactory(asFactory(func() (Connector, <-chan zk.Event, error) { - attempt++ - sessionEvents := make(chan zk.Event, 5) - watchEvents := make(chan zk.Event, 5) - - sessionEvents <- zk.Event{ - Type: zk.EventSession, - State: zk.StateConnected, - } - connector.On("Get", fmt.Sprintf("%s/info_005", test_zk_path)).Return(newTestMasterInfo(attempt), &zk.Stat{}, nil).Once() - connector.On("ChildrenW", test_zk_path).Return([]string{test_zk_path}, &zk.Stat{}, (<-chan zk.Event)(watchEvents), nil) - go func(attempt int) { - defer close(sessionEvents) - defer close(watchEvents) - time.Sleep(400 * time.Millisecond) - // this is the order in which the embedded zk implementation does it - sessionEvents <- zk.Event{ - Type: zk.EventSession, - State: zk.StateDisconnected, - } - connector.On("ChildrenW", test_zk_path).Return(nil, nil, nil, zk.ErrSessionExpired).Once() - watchEvents <- zk.Event{ - Type: zk.EventNotWatching, - State: zk.StateDisconnected, - Path: test_zk_path, - Err: zk.ErrSessionExpired, + called := 0 + lostMaster := make(chan struct{}) + const EXPECTED_CALLS = (ITERATIONS * 2) + 2 // +1 for initial snapshot, +1 for final lost-leader (close(errs)) + err = md.Detect(detector.OnMasterChanged(func(master *mesos.MasterInfo) { + called++ + log.V(3).Infof("detector invoked: called %d", called) + switch { + case called < EXPECTED_CALLS: + if master != nil { + wg.Done() + assert.Equal(t, master.GetId(), "master(0)@localhost:5050") } - }(attempt) - return connector, sessionEvents, nil - })) - c.reconnDelay = 100 * time.Millisecond - c.rewatchDelay = c.reconnDelay / 2 - - md, err := NewMasterDetector(zkurl) - md.minDetectorCyclePeriod = 600 * time.Millisecond - - defer md.Cancel() - assert.NoError(t, err) - - c.errorHandler = ErrorHandler(func(c *Client, e error) { - t.Logf("zk client error: %v", e) - }) - md.client = c - - var wg sync.WaitGroup - wg.Add(6) // 3 x (connected, disconnected) - detected := 0 - startTime := time.Now() - md.Detect(detector.OnMasterChanged(func(master *mesos.MasterInfo) { - if detected > 5 { - // ignore - return - } - if (detected & 1) == 0 { - assert.NotNil(t, master, fmt.Sprintf("on-master-changed-%d", detected)) - } else { - assert.Nil(t, master, fmt.Sprintf("on-master-changed-%d", detected)) + case called == EXPECTED_CALLS: + md.Cancel() + defer close(lostMaster) + assert.Nil(t, master) + default: + t.Errorf("unexpected notification call attempt %d", called) } - t.Logf("Leader change detected at %v: '%+v'", time.Now().Sub(startTime), master) - detected++ - wg.Done() })) + assert.NoError(t, err) - completed := make(chan struct{}) - go func() { - defer close(completed) - wg.Wait() - }() + fatalAfter(t, 10*time.Second, wg.Wait, "Waited too long for new-master alerts") + fatalOn(t, 3*time.Second, lostMaster, "Waited too long for lost master") select { - case <-completed: // expected - case <-time.After(3 * time.Second): - t.Fatalf("failed to detect flapping master changes") + case <-md.Done(): + assert.Equal(t, EXPECTED_CALLS, called, "expected %d detection callbacks instead of %d", EXPECTED_CALLS, called) + case <-time.After(time.Second * 10): + panic("Waited too long for detector shutdown...") } } -func TestMasterDetectMultiple(t *testing.T) { - ch0 := make(chan zk.Event, 5) - ch1 := make(chan zk.Event, 5) - - ch0 <- zk.Event{ - Type: zk.EventSession, - State: zk.StateConnected, - } - - c, err := newClient(test_zk_hosts, test_zk_path) - assert.NoError(t, err) - - initialChildren := []string{"info_005", "info_010", "info_022"} - connector := NewMockConnector() - connector.On("Close").Return(nil) - connector.On("Children", test_zk_path).Return(initialChildren, &zk.Stat{}, nil).Once() - connector.On("ChildrenW", test_zk_path).Return([]string{test_zk_path}, &zk.Stat{}, (<-chan zk.Event)(ch1), nil) - - first := true - c.setFactory(asFactory(func() (Connector, <-chan zk.Event, error) { - log.V(2).Infof("**** Using zk.Conn adapter ****") - if !first { - return nil, nil, errors.New("only 1 connector allowed") - } else { - first = false - } - return connector, ch0, nil - })) - +func TestMasterDetector_multipleLeadershipChanges(t *testing.T) { md, err := NewMasterDetector(zkurl) defer md.Cancel() assert.NoError(t, err) - c.errorHandler = ErrorHandler(func(c *Client, e error) { - err = e - }) - md.client = c - - // **** Test 4 consecutive ChildrenChangedEvents ****** - // setup event changes - sequences := [][]string{ + leadershipChanges := [][]string{ {"info_014", "info_010", "info_005"}, {"info_005", "info_004", "info_022"}, {}, // indicates no master {"info_017", "info_099", "info_200"}, } + ITERATIONS := len(leadershipChanges) + + // +1 for initial snapshot, +1 for final lost-leader (close(errs)) + EXPECTED_CALLS := (ITERATIONS + 2) + var wg sync.WaitGroup - startTime := time.Now() - detected := 0 - md.Detect(detector.OnMasterChanged(func(master *mesos.MasterInfo) { - if detected == 2 { - assert.Nil(t, master, fmt.Sprintf("on-master-changed-%d", detected)) - } else { - assert.NotNil(t, master, fmt.Sprintf("on-master-changed-%d", detected)) + wg.Add(ITERATIONS) // +1 for the initial snapshot that's sent for the first watch, -1 because set 3 is empty + path := test_zk_path + + md.bootstrapFunc = func() error { + if md.client != nil { + return nil } - t.Logf("Leader change detected at %v: '%+v'", time.Now().Sub(startTime), master) - detected++ - wg.Done() - })) + log.V(1).Infoln("bootstrapping detector") + defer log.V(1).Infoln("bootstrapping detector ..finished") - // 3 leadership changes + disconnect (leader change to '') - wg.Add(4) + children := []string{"info_0", "info_5", "info_10"} + mocked, snaps, errs := newMockZkClient(children...) + md.client = mocked + md.minDetectorCyclePeriod = 10 * time.Millisecond // we don't have all day! - go func() { - for i := range sequences { - sorted := make([]string, len(sequences[i])) - copy(sorted, sequences[i]) - sort.Strings(sorted) - t.Logf("testing master change sequence %d, path '%v'", i, test_zk_path) - connector.On("Children", test_zk_path).Return(sequences[i], &zk.Stat{}, nil).Once() - if len(sequences[i]) > 0 { - connector.On("Get", fmt.Sprintf("%s/%s", test_zk_path, sorted[0])).Return(newTestMasterInfo(i), &zk.Stat{}, nil).Once() + mocked.On("data", fmt.Sprintf("%s/info_0", path)).Return(newTestMasterInfo(0), nil) + mocked.On("data", fmt.Sprintf("%s/info_005", path)).Return(newTestMasterInfo(5), nil) + mocked.On("data", fmt.Sprintf("%s/info_004", path)).Return(newTestMasterInfo(4), nil) + mocked.On("data", fmt.Sprintf("%s/info_017", path)).Return(newTestMasterInfo(17), nil) + + // the first snapshot will be sent immediately and the detector will be awaiting en event. + // cycle through some connected/disconnected events but maintain the same snapshot + go func() { + defer close(errs) + for attempt := 0; attempt < ITERATIONS; attempt++ { + snaps <- leadershipChanges[attempt] } - ch1 <- zk.Event{ - Type: zk.EventNodeChildrenChanged, - Path: test_zk_path, + }() + return nil + } + + called := 0 + lostMaster := make(chan struct{}) + expectedLeaders := []int{0, 5, 4, 17} + leaderIdx := 0 + err = md.Detect(detector.OnMasterChanged(func(master *mesos.MasterInfo) { + called++ + log.V(3).Infof("detector invoked: called %d", called) + switch { + case called < EXPECTED_CALLS: + if master != nil { + expectedLeader := fmt.Sprintf("master(%d)@localhost:5050", expectedLeaders[leaderIdx]) + assert.Equal(t, expectedLeader, master.GetId()) + leaderIdx++ + wg.Done() } - time.Sleep(100 * time.Millisecond) // give async routines time to catch up - } - time.Sleep(1 * time.Second) // give async routines time to catch up - t.Logf("disconnecting...") - ch0 <- zk.Event{ - State: zk.StateDisconnected, + case called == EXPECTED_CALLS: + md.Cancel() + defer close(lostMaster) + assert.Nil(t, master) + default: + t.Errorf("unexpected notification call attempt %d", called) } - //TODO(jdef) does order of close matter here? probably, meaking client code is weak - close(ch0) - time.Sleep(500 * time.Millisecond) // give async routines time to catch up - close(ch1) - }() - completed := make(chan struct{}) - go func() { - defer close(completed) - wg.Wait() - }() + })) + assert.NoError(t, err) - defer func() { - if r := recover(); r != nil { - t.Fatal(r) - } - }() + fatalAfter(t, 10*time.Second, wg.Wait, "Waited too long for new-master alerts") + fatalOn(t, 3*time.Second, lostMaster, "Waited too long for lost master") select { - case <-time.After(2 * time.Second): - panic("timed out waiting for master changes to propagate") - case <-completed: + case <-md.Done(): + assert.Equal(t, EXPECTED_CALLS, called, "expected %d detection callbacks instead of %d", EXPECTED_CALLS, called) + case <-time.After(time.Second * 10): + panic("Waited too long for detector shutdown...") } } func TestMasterDetect_selectTopNode_none(t *testing.T) { assert := assert.New(t) nodeList := []string{} - node := selectTopNode(nodeList) + node := selectTopNodePrefix(nodeList, "foo") assert.Equal("", node) } @@ -410,10 +348,25 @@ func TestMasterDetect_selectTopNode_0000x(t *testing.T) { "info_0000000061", "info_0000000008", } - node := selectTopNode(nodeList) + node := selectTopNodePrefix(nodeList, nodePrefix) assert.Equal("info_0000000008", node) } +func TestMasterDetect_selectTopNode_mixJson(t *testing.T) { + assert := assert.New(t) + nodeList := []string{ + nodePrefix + "0000000046", + nodePrefix + "0000000032", + nodeJSONPrefix + "0000000046", + nodeJSONPrefix + "0000000032", + } + node := selectTopNodePrefix(nodeList, nodeJSONPrefix) + assert.Equal(nodeJSONPrefix+"0000000032", node) + + node = selectTopNodePrefix(nodeList, nodePrefix) + assert.Equal(nodePrefix+"0000000032", node) +} + func TestMasterDetect_selectTopNode_mixedEntries(t *testing.T) { assert := assert.New(t) nodeList := []string{ @@ -424,7 +377,7 @@ func TestMasterDetect_selectTopNode_mixedEntries(t *testing.T) { "log_replicas_fdgwsdfgsdf", "bar", } - node := selectTopNode(nodeList) + node := selectTopNodePrefix(nodeList, nodePrefix) assert.Equal("info_0000000032", node) } @@ -451,15 +404,25 @@ func afterFunc(f func()) <-chan struct{} { } func fatalAfter(t *testing.T, d time.Duration, f func(), msg string, args ...interface{}) { - ch := afterFunc(f) + fatalOn(t, d, afterFunc(f), msg, args...) +} + +func fatalOn(t *testing.T, d time.Duration, ch <-chan struct{}, msg string, args ...interface{}) { select { case <-ch: return case <-time.After(d): - t.Fatalf(msg, args...) + // check for a tie + select { + case <-ch: + return + default: + t.Fatalf(msg, args...) + } } } +/* TODO(jdef) refactor this to work with the new zkInterface func TestNotifyAllMasters(t *testing.T) { c, err := newClient(test_zk_hosts, test_zk_path) assert.NoError(t, err) @@ -482,7 +445,7 @@ func TestNotifyAllMasters(t *testing.T) { assert.NoError(t, err) c.errorHandler = ErrorHandler(func(c *Client, e error) { - t.Fatalf("unexpected error: %v", e) + t.Errorf("unexpected error: %v", e) }) md.client = c @@ -562,3 +525,4 @@ func TestNotifyAllMasters(t *testing.T) { connector.On("Close").Return(nil) } +*/ diff --git a/Godeps/_workspace/src/github.com/mesos/mesos-go/detector/zoo/mocked_detect.go b/Godeps/_workspace/src/github.com/mesos/mesos-go/detector/zoo/mocked_detect.go deleted file mode 100644 index d887b6dc869f..000000000000 --- a/Godeps/_workspace/src/github.com/mesos/mesos-go/detector/zoo/mocked_detect.go +++ /dev/null @@ -1,88 +0,0 @@ -package zoo - -import ( - "errors" - "fmt" - "net/url" - - "github.com/gogo/protobuf/proto" - log "github.com/golang/glog" - util "github.com/mesos/mesos-go/mesosutil" - "github.com/samuel/go-zookeeper/zk" -) - -type MockMasterDetector struct { - *MasterDetector - zkPath string - conCh chan zk.Event - sesCh chan zk.Event -} - -func NewMockMasterDetector(zkurls string) (*MockMasterDetector, error) { - log.V(4).Infoln("Creating mock zk master detector") - md, err := NewMasterDetector(zkurls) - if err != nil { - return nil, err - } - - u, _ := url.Parse(zkurls) - m := &MockMasterDetector{ - MasterDetector: md, - zkPath: u.Path, - conCh: make(chan zk.Event, 5), - sesCh: make(chan zk.Event, 5), - } - - path := m.zkPath - connector := NewMockConnector() - connector.On("Children", path).Return([]string{"info_0", "info_5", "info_10"}, &zk.Stat{}, nil) - connector.On("Get", fmt.Sprintf("%s/info_0", path)).Return(m.makeMasterInfo(), &zk.Stat{}, nil) - connector.On("Close").Return(nil) - connector.On("ChildrenW", m.zkPath).Return([]string{m.zkPath}, &zk.Stat{}, (<-chan zk.Event)(m.sesCh), nil) - - first := true - m.client.setFactory(asFactory(func() (Connector, <-chan zk.Event, error) { - if !first { - return nil, nil, errors.New("only 1 connector allowed") - } else { - first = false - } - return connector, m.conCh, nil - })) - - return m, nil -} - -func (m *MockMasterDetector) Start() { - m.client.connect() -} - -func (m *MockMasterDetector) ScheduleConnEvent(s zk.State) { - log.V(4).Infof("Scheduling zk connection event with state: %v\n", s) - go func() { - m.conCh <- zk.Event{ - State: s, - Path: m.zkPath, - } - }() -} - -func (m *MockMasterDetector) ScheduleSessEvent(t zk.EventType) { - log.V(4).Infof("Scheduling zk session event with state: %v\n", t) - go func() { - m.sesCh <- zk.Event{ - Type: t, - Path: m.zkPath, - } - }() -} - -func (m *MockMasterDetector) makeMasterInfo() []byte { - miPb := util.NewMasterInfo("master", 123456789, 400) - miPb.Pid = proto.String("master@127.0.0.1:5050") - data, err := proto.Marshal(miPb) - if err != nil { - panic(err) - } - return data -} diff --git a/Godeps/_workspace/src/github.com/mesos/mesos-go/detector/zoo/types.go b/Godeps/_workspace/src/github.com/mesos/mesos-go/detector/zoo/types.go index 811614042149..9b24b51b7cd7 100644 --- a/Godeps/_workspace/src/github.com/mesos/mesos-go/detector/zoo/types.go +++ b/Godeps/_workspace/src/github.com/mesos/mesos-go/detector/zoo/types.go @@ -14,12 +14,6 @@ type Connector interface { Get(string) ([]byte, *zk.Stat, error) } -// interface for handling watcher event when zk.EventNodeChildrenChanged. -type ChildWatcher func(*Client, string) - -// interface for handling errors (session and watch related). -type ErrorHandler func(*Client, error) - //Factory is an adapter to trap the creation of zk.Conn instances //since the official zk API does not expose an interface for zk.Conn. type Factory interface { diff --git a/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/authentication.pb.go b/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/authentication.pb.go new file mode 100644 index 000000000000..76bd7b3a9d14 --- /dev/null +++ b/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/authentication.pb.go @@ -0,0 +1,255 @@ +// Code generated by protoc-gen-gogo. +// source: authentication.proto +// DO NOT EDIT! + +/* + Package mesosproto is a generated protocol buffer package. + + It is generated from these files: + authentication.proto + containerizer.proto + internal.proto + log.proto + mesos.proto + messages.proto + registry.proto + scheduler.proto + state.proto + + It has these top-level messages: + AuthenticateMessage + AuthenticationMechanismsMessage + AuthenticationStartMessage + AuthenticationStepMessage + AuthenticationCompletedMessage + AuthenticationFailedMessage + AuthenticationErrorMessage + Launch + Update + Wait + Destroy + Usage + Termination + Containers + InternalMasterChangeDetected + InternalTryAuthentication + InternalAuthenticationResult + Promise + Action + Metadata + Record + PromiseRequest + PromiseResponse + WriteRequest + WriteResponse + LearnedMessage + RecoverRequest + RecoverResponse + FrameworkID + OfferID + SlaveID + TaskID + ExecutorID + ContainerID + FrameworkInfo + HealthCheck + CommandInfo + ExecutorInfo + MasterInfo + SlaveInfo + Value + Attribute + Resource + TrafficControlStatistics + ResourceStatistics + ResourceUsage + PerfStatistics + Request + Offer + TaskInfo + TaskStatus + Filters + Environment + Parameter + Parameters + Credential + Credentials + ACL + ACLs + RateLimit + RateLimits + Volume + ContainerInfo + Labels + Label + Port + Ports + DiscoveryInfo + Task + StatusUpdate + StatusUpdateRecord + SubmitSchedulerRequest + SubmitSchedulerResponse + ExecutorToFrameworkMessage + FrameworkToExecutorMessage + RegisterFrameworkMessage + ReregisterFrameworkMessage + FrameworkRegisteredMessage + FrameworkReregisteredMessage + UnregisterFrameworkMessage + DeactivateFrameworkMessage + ResourceRequestMessage + ResourceOffersMessage + LaunchTasksMessage + RescindResourceOfferMessage + ReviveOffersMessage + RunTaskMessage + KillTaskMessage + StatusUpdateMessage + StatusUpdateAcknowledgementMessage + LostSlaveMessage + ReconcileTasksMessage + FrameworkErrorMessage + RegisterSlaveMessage + ReregisterSlaveMessage + SlaveRegisteredMessage + SlaveReregisteredMessage + UnregisterSlaveMessage + MasterSlaveConnection + PingSlaveMessage + PongSlaveMessage + ShutdownFrameworkMessage + ShutdownExecutorMessage + UpdateFrameworkMessage + CheckpointResourcesMessage + UpdateSlaveMessage + RegisterExecutorMessage + ExecutorRegisteredMessage + ExecutorReregisteredMessage + ExitedExecutorMessage + ReconnectExecutorMessage + ReregisterExecutorMessage + ShutdownMessage + Archive + TaskHealthStatus + HookExecuted + Registry + Event + Call + Entry + Operation +*/ +package mesosproto + +import proto "github.com/gogo/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 AuthenticateMessage struct { + Pid *string `protobuf:"bytes,1,req,name=pid" json:"pid,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *AuthenticateMessage) Reset() { *m = AuthenticateMessage{} } +func (m *AuthenticateMessage) String() string { return proto.CompactTextString(m) } +func (*AuthenticateMessage) ProtoMessage() {} + +func (m *AuthenticateMessage) GetPid() string { + if m != nil && m.Pid != nil { + return *m.Pid + } + return "" +} + +type AuthenticationMechanismsMessage struct { + Mechanisms []string `protobuf:"bytes,1,rep,name=mechanisms" json:"mechanisms,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *AuthenticationMechanismsMessage) Reset() { *m = AuthenticationMechanismsMessage{} } +func (m *AuthenticationMechanismsMessage) String() string { return proto.CompactTextString(m) } +func (*AuthenticationMechanismsMessage) ProtoMessage() {} + +func (m *AuthenticationMechanismsMessage) GetMechanisms() []string { + if m != nil { + return m.Mechanisms + } + return nil +} + +type AuthenticationStartMessage struct { + Mechanism *string `protobuf:"bytes,1,req,name=mechanism" json:"mechanism,omitempty"` + Data []byte `protobuf:"bytes,2,opt,name=data" json:"data,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *AuthenticationStartMessage) Reset() { *m = AuthenticationStartMessage{} } +func (m *AuthenticationStartMessage) String() string { return proto.CompactTextString(m) } +func (*AuthenticationStartMessage) ProtoMessage() {} + +func (m *AuthenticationStartMessage) GetMechanism() string { + if m != nil && m.Mechanism != nil { + return *m.Mechanism + } + return "" +} + +func (m *AuthenticationStartMessage) GetData() []byte { + if m != nil { + return m.Data + } + return nil +} + +type AuthenticationStepMessage struct { + Data []byte `protobuf:"bytes,1,req,name=data" json:"data,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *AuthenticationStepMessage) Reset() { *m = AuthenticationStepMessage{} } +func (m *AuthenticationStepMessage) String() string { return proto.CompactTextString(m) } +func (*AuthenticationStepMessage) ProtoMessage() {} + +func (m *AuthenticationStepMessage) GetData() []byte { + if m != nil { + return m.Data + } + return nil +} + +type AuthenticationCompletedMessage struct { + XXX_unrecognized []byte `json:"-"` +} + +func (m *AuthenticationCompletedMessage) Reset() { *m = AuthenticationCompletedMessage{} } +func (m *AuthenticationCompletedMessage) String() string { return proto.CompactTextString(m) } +func (*AuthenticationCompletedMessage) ProtoMessage() {} + +type AuthenticationFailedMessage struct { + XXX_unrecognized []byte `json:"-"` +} + +func (m *AuthenticationFailedMessage) Reset() { *m = AuthenticationFailedMessage{} } +func (m *AuthenticationFailedMessage) String() string { return proto.CompactTextString(m) } +func (*AuthenticationFailedMessage) ProtoMessage() {} + +type AuthenticationErrorMessage struct { + Error *string `protobuf:"bytes,1,opt,name=error" json:"error,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *AuthenticationErrorMessage) Reset() { *m = AuthenticationErrorMessage{} } +func (m *AuthenticationErrorMessage) String() string { return proto.CompactTextString(m) } +func (*AuthenticationErrorMessage) ProtoMessage() {} + +func (m *AuthenticationErrorMessage) GetError() string { + if m != nil && m.Error != nil { + return *m.Error + } + return "" +} diff --git a/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/authentication.proto b/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/authentication.proto new file mode 100644 index 000000000000..d8e42569e398 --- /dev/null +++ b/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/authentication.proto @@ -0,0 +1,53 @@ +/** + * 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 mesosproto; + +import "mesos.proto"; + + +message AuthenticateMessage { + required string pid = 1; // PID that needs to be authenticated. +} + + +message AuthenticationMechanismsMessage { + repeated string mechanisms = 1; // List of available SASL mechanisms. +} + + +message AuthenticationStartMessage { + required string mechanism = 1; + optional bytes data = 2; +} + + +message AuthenticationStepMessage { + required bytes data = 1; +} + + +message AuthenticationCompletedMessage {} + + +message AuthenticationFailedMessage {} + + +message AuthenticationErrorMessage { + optional string error = 1; +} diff --git a/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/containerizer.pb.go b/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/containerizer.pb.go index 2e1e7921c53f..da62428f0801 100644 --- a/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/containerizer.pb.go +++ b/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/containerizer.pb.go @@ -2,37 +2,17 @@ // source: containerizer.proto // DO NOT EDIT! -/* - Package mesosproto is a generated protocol buffer package. - - It is generated from these files: - containerizer.proto - internal.proto - log.proto - mesos.proto - messages.proto - registry.proto - scheduler.proto - state.proto - - It has these top-level messages: - Launch - Update - Wait - Destroy - Usage - Termination - Containers -*/ package mesosproto import proto "github.com/gogo/protobuf/proto" +import fmt "fmt" import math "math" -// discarding unused import gogoproto "github.com/gogo/protobuf/gogoproto/gogo.pb" +// discarding unused import gogoproto "github.com/gogo/protobuf/gogoproto" // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal +var _ = fmt.Errorf var _ = math.Inf // * @@ -200,6 +180,8 @@ func (m *Usage) GetContainerId() *ContainerID { type Termination struct { // A container may be killed if it exceeds its resources; this will // be indicated by killed=true and described by the message string. + // TODO(jaybuff): As part of MESOS-2035 we should remove killed and + // replace it with a TaskStatus::Reason. Killed *bool `protobuf:"varint,1,req,name=killed" json:"killed,omitempty"` Message *string `protobuf:"bytes,2,req,name=message" json:"message,omitempty"` // Exit status of the process. @@ -250,6 +232,3 @@ func (m *Containers) GetContainers() []*ContainerID { } return nil } - -func init() { -} diff --git a/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/containerizer.proto b/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/containerizer.proto index 79eda5319765..878060cc4923 100644 --- a/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/containerizer.proto +++ b/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/containerizer.proto @@ -82,6 +82,8 @@ message Usage { message Termination { // A container may be killed if it exceeds its resources; this will // be indicated by killed=true and described by the message string. + // TODO(jaybuff): As part of MESOS-2035 we should remove killed and + // replace it with a TaskStatus::Reason. required bool killed = 1; required string message = 2; diff --git a/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/internal.pb.go b/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/internal.pb.go index c794dd359dab..8988e89978be 100644 --- a/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/internal.pb.go +++ b/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/internal.pb.go @@ -5,12 +5,14 @@ package mesosproto import proto "github.com/gogo/protobuf/proto" +import fmt "fmt" import math "math" -// discarding unused import gogoproto "github.com/gogo/protobuf/gogoproto/gogo.pb" +// discarding unused import gogoproto "github.com/gogo/protobuf/gogoproto" // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal +var _ = fmt.Errorf var _ = math.Inf // For use with detector callbacks @@ -73,6 +75,3 @@ func (m *InternalAuthenticationResult) GetPid() string { } return "" } - -func init() { -} diff --git a/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/log.pb.go b/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/log.pb.go index 06db2ecc1840..2b62f81d64af 100644 --- a/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/log.pb.go +++ b/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/log.pb.go @@ -5,30 +5,24 @@ package mesosproto import proto "github.com/gogo/protobuf/proto" +import fmt "fmt" import math "math" -// discarding unused import gogoproto "github.com/gogo/protobuf/gogoproto/gogo.pb" +// discarding unused import gogoproto "github.com/gogo/protobuf/gogoproto" -import io1 "io" -import fmt4 "fmt" -import github_com_gogo_protobuf_proto2 "github.com/gogo/protobuf/proto" +import bytes "bytes" -import fmt5 "fmt" -import strings2 "strings" -import reflect2 "reflect" +import strings "strings" +import github_com_gogo_protobuf_proto "github.com/gogo/protobuf/proto" +import sort "sort" +import strconv "strconv" +import reflect "reflect" -import fmt6 "fmt" -import strings3 "strings" -import github_com_gogo_protobuf_proto3 "github.com/gogo/protobuf/proto" -import sort1 "sort" -import strconv1 "strconv" -import reflect3 "reflect" - -import fmt7 "fmt" -import bytes1 "bytes" +import io "io" // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal +var _ = fmt.Errorf var _ = math.Inf type Action_Type int32 @@ -614,2104 +608,1540 @@ func init() { proto.RegisterEnum("mesosproto.Metadata_Status", Metadata_Status_name, Metadata_Status_value) proto.RegisterEnum("mesosproto.Record_Type", Record_Type_name, Record_Type_value) } -func (m *Promise) 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 io1.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 != 0 { - return fmt4.Errorf("proto: wrong wireType = %d for field Proposal", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io1.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Proposal = &v - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - index -= sizeOfWire - skippy, err := github_com_gogo_protobuf_proto2.Skip(data[index:]) - if err != nil { - return err - } - if (index + skippy) > l { - return io1.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[index:index+skippy]...) - index += skippy +func (this *Promise) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil } + return fmt.Errorf("that == nil && this != nil") } - return nil -} -func (m *Action) 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 io1.ErrUnexpectedEOF - } - b := data[index] - index++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } + + that1, ok := that.(*Promise) + if !ok { + return fmt.Errorf("that is not of type *Promise") + } + if that1 == nil { + if this == nil { + return nil } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 0 { - return fmt4.Errorf("proto: wrong wireType = %d for field Position", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io1.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Position = &v - case 2: - if wireType != 0 { - return fmt4.Errorf("proto: wrong wireType = %d for field Promised", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io1.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Promised = &v - case 3: - if wireType != 0 { - return fmt4.Errorf("proto: wrong wireType = %d for field Performed", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io1.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Performed = &v - case 4: - if wireType != 0 { - return fmt4.Errorf("proto: wrong wireType = %d for field Learned", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io1.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - b := bool(v != 0) - m.Learned = &b - case 5: - if wireType != 0 { - return fmt4.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - var v Action_Type - for shift := uint(0); ; shift += 7 { - if index >= l { - return io1.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (Action_Type(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Type = &v - case 6: - if wireType != 2 { - return fmt4.Errorf("proto: wrong wireType = %d for field Nop", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io1.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io1.ErrUnexpectedEOF - } - if m.Nop == nil { - m.Nop = &Action_Nop{} - } - if err := m.Nop.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - case 7: - if wireType != 2 { - return fmt4.Errorf("proto: wrong wireType = %d for field Append", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io1.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io1.ErrUnexpectedEOF - } - if m.Append == nil { - m.Append = &Action_Append{} - } - if err := m.Append.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - case 8: - if wireType != 2 { - return fmt4.Errorf("proto: wrong wireType = %d for field Truncate", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io1.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io1.ErrUnexpectedEOF - } - if m.Truncate == nil { - m.Truncate = &Action_Truncate{} - } - if err := m.Truncate.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - index -= sizeOfWire - skippy, err := github_com_gogo_protobuf_proto2.Skip(data[index:]) - if err != nil { - return err - } - if (index + skippy) > l { - return io1.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[index:index+skippy]...) - index += skippy + return fmt.Errorf("that is type *Promise but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *Promisebut is not nil && this == nil") + } + if this.Proposal != nil && that1.Proposal != nil { + if *this.Proposal != *that1.Proposal { + return fmt.Errorf("Proposal this(%v) Not Equal that(%v)", *this.Proposal, *that1.Proposal) } + } else if this.Proposal != nil { + return fmt.Errorf("this.Proposal == nil && that.Proposal != nil") + } else if that1.Proposal != nil { + return fmt.Errorf("Proposal this(%v) Not Equal that(%v)", this.Proposal, that1.Proposal) + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) } return nil } -func (m *Action_Nop) 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 io1.ErrUnexpectedEOF - } - b := data[index] - index++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } +func (this *Promise) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true } - fieldNum := int32(wire >> 3) - switch fieldNum { - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - index -= sizeOfWire - skippy, err := github_com_gogo_protobuf_proto2.Skip(data[index:]) - if err != nil { - return err - } - if (index + skippy) > l { - return io1.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[index:index+skippy]...) - index += skippy + return false + } + + that1, ok := that.(*Promise) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true } + return false + } else if this == nil { + return false } - return nil -} -func (m *Action_Append) 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 io1.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 fmt4.Errorf("proto: wrong wireType = %d for field Bytes", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io1.ErrUnexpectedEOF - } - b := data[index] - index++ - byteLen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + byteLen - if postIndex > l { - return io1.ErrUnexpectedEOF - } - m.Bytes = append([]byte{}, data[index:postIndex]...) - index = postIndex - case 2: - if wireType != 2 { - return fmt4.Errorf("proto: wrong wireType = %d for field Cksum", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io1.ErrUnexpectedEOF - } - b := data[index] - index++ - byteLen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + byteLen - if postIndex > l { - return io1.ErrUnexpectedEOF - } - m.Cksum = append([]byte{}, 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_proto2.Skip(data[index:]) - if err != nil { - return err - } - if (index + skippy) > l { - return io1.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[index:index+skippy]...) - index += skippy + if this.Proposal != nil && that1.Proposal != nil { + if *this.Proposal != *that1.Proposal { + return false } + } else if this.Proposal != nil { + return false + } else if that1.Proposal != nil { + return false } - return nil + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true } -func (m *Action_Truncate) 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 io1.ErrUnexpectedEOF - } - b := data[index] - index++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } +func (this *Action) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 0 { - return fmt4.Errorf("proto: wrong wireType = %d for field To", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io1.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.To = &v - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - index -= sizeOfWire - skippy, err := github_com_gogo_protobuf_proto2.Skip(data[index:]) - if err != nil { - return err - } - if (index + skippy) > l { - return io1.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[index:index+skippy]...) - index += skippy + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*Action) + if !ok { + return fmt.Errorf("that is not of type *Action") + } + if that1 == nil { + if this == nil { + return nil } + return fmt.Errorf("that is type *Action but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *Actionbut is not nil && this == nil") } - return nil -} -func (m *Metadata) 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 io1.ErrUnexpectedEOF - } - b := data[index] - index++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } + if this.Position != nil && that1.Position != nil { + if *this.Position != *that1.Position { + return fmt.Errorf("Position this(%v) Not Equal that(%v)", *this.Position, *that1.Position) } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 0 { - return fmt4.Errorf("proto: wrong wireType = %d for field Status", wireType) - } - var v Metadata_Status - for shift := uint(0); ; shift += 7 { - if index >= l { - return io1.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (Metadata_Status(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Status = &v - case 2: - if wireType != 0 { - return fmt4.Errorf("proto: wrong wireType = %d for field Promised", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io1.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Promised = &v - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - index -= sizeOfWire - skippy, err := github_com_gogo_protobuf_proto2.Skip(data[index:]) - if err != nil { - return err - } - if (index + skippy) > l { - return io1.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[index:index+skippy]...) - index += skippy + } else if this.Position != nil { + return fmt.Errorf("this.Position == nil && that.Position != nil") + } else if that1.Position != nil { + return fmt.Errorf("Position this(%v) Not Equal that(%v)", this.Position, that1.Position) + } + if this.Promised != nil && that1.Promised != nil { + if *this.Promised != *that1.Promised { + return fmt.Errorf("Promised this(%v) Not Equal that(%v)", *this.Promised, *that1.Promised) + } + } else if this.Promised != nil { + return fmt.Errorf("this.Promised == nil && that.Promised != nil") + } else if that1.Promised != nil { + return fmt.Errorf("Promised this(%v) Not Equal that(%v)", this.Promised, that1.Promised) + } + if this.Performed != nil && that1.Performed != nil { + if *this.Performed != *that1.Performed { + return fmt.Errorf("Performed this(%v) Not Equal that(%v)", *this.Performed, *that1.Performed) + } + } else if this.Performed != nil { + return fmt.Errorf("this.Performed == nil && that.Performed != nil") + } else if that1.Performed != nil { + return fmt.Errorf("Performed this(%v) Not Equal that(%v)", this.Performed, that1.Performed) + } + if this.Learned != nil && that1.Learned != nil { + if *this.Learned != *that1.Learned { + return fmt.Errorf("Learned this(%v) Not Equal that(%v)", *this.Learned, *that1.Learned) + } + } else if this.Learned != nil { + return fmt.Errorf("this.Learned == nil && that.Learned != nil") + } else if that1.Learned != nil { + return fmt.Errorf("Learned this(%v) Not Equal that(%v)", this.Learned, that1.Learned) + } + if this.Type != nil && that1.Type != nil { + if *this.Type != *that1.Type { + return fmt.Errorf("Type this(%v) Not Equal that(%v)", *this.Type, *that1.Type) } + } else if this.Type != nil { + return fmt.Errorf("this.Type == nil && that.Type != nil") + } else if that1.Type != nil { + return fmt.Errorf("Type this(%v) Not Equal that(%v)", this.Type, that1.Type) + } + if !this.Nop.Equal(that1.Nop) { + return fmt.Errorf("Nop this(%v) Not Equal that(%v)", this.Nop, that1.Nop) + } + if !this.Append.Equal(that1.Append) { + return fmt.Errorf("Append this(%v) Not Equal that(%v)", this.Append, that1.Append) + } + if !this.Truncate.Equal(that1.Truncate) { + return fmt.Errorf("Truncate this(%v) Not Equal that(%v)", this.Truncate, that1.Truncate) + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) } return nil } -func (m *Record) 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 io1.ErrUnexpectedEOF - } - b := data[index] - index++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } +func (this *Action) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 0 { - return fmt4.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - var v Record_Type - for shift := uint(0); ; shift += 7 { - if index >= l { - return io1.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (Record_Type(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Type = &v - case 2: - if wireType != 2 { - return fmt4.Errorf("proto: wrong wireType = %d for field Promise", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io1.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io1.ErrUnexpectedEOF - } - if m.Promise == nil { - m.Promise = &Promise{} - } - if err := m.Promise.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - case 3: - if wireType != 2 { - return fmt4.Errorf("proto: wrong wireType = %d for field Action", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io1.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io1.ErrUnexpectedEOF - } - if m.Action == nil { - m.Action = &Action{} - } - if err := m.Action.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - case 4: - if wireType != 2 { - return fmt4.Errorf("proto: wrong wireType = %d for field Metadata", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io1.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io1.ErrUnexpectedEOF - } - if m.Metadata == nil { - m.Metadata = &Metadata{} - } - if err := m.Metadata.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - index -= sizeOfWire - skippy, err := github_com_gogo_protobuf_proto2.Skip(data[index:]) - if err != nil { - return err - } - if (index + skippy) > l { - return io1.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[index:index+skippy]...) - index += skippy + return false + } + + that1, ok := that.(*Action) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true } + return false + } else if this == nil { + return false } - return nil -} -func (m *PromiseRequest) 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 io1.ErrUnexpectedEOF - } - b := data[index] - index++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } + if this.Position != nil && that1.Position != nil { + if *this.Position != *that1.Position { + return false } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 0 { - return fmt4.Errorf("proto: wrong wireType = %d for field Proposal", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io1.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Proposal = &v - case 2: - if wireType != 0 { - return fmt4.Errorf("proto: wrong wireType = %d for field Position", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io1.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Position = &v - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - index -= sizeOfWire - skippy, err := github_com_gogo_protobuf_proto2.Skip(data[index:]) - if err != nil { - return err - } - if (index + skippy) > l { - return io1.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[index:index+skippy]...) - index += skippy + } else if this.Position != nil { + return false + } else if that1.Position != nil { + return false + } + if this.Promised != nil && that1.Promised != nil { + if *this.Promised != *that1.Promised { + return false } + } else if this.Promised != nil { + return false + } else if that1.Promised != nil { + return false } - return nil + if this.Performed != nil && that1.Performed != nil { + if *this.Performed != *that1.Performed { + return false + } + } else if this.Performed != nil { + return false + } else if that1.Performed != nil { + return false + } + if this.Learned != nil && that1.Learned != nil { + if *this.Learned != *that1.Learned { + return false + } + } else if this.Learned != nil { + return false + } else if that1.Learned != nil { + return false + } + if this.Type != nil && that1.Type != nil { + if *this.Type != *that1.Type { + return false + } + } else if this.Type != nil { + return false + } else if that1.Type != nil { + return false + } + if !this.Nop.Equal(that1.Nop) { + return false + } + if !this.Append.Equal(that1.Append) { + return false + } + if !this.Truncate.Equal(that1.Truncate) { + return false + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true } -func (m *PromiseResponse) 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 io1.ErrUnexpectedEOF - } - b := data[index] - index++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } +func (this *Action_Nop) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 0 { - return fmt4.Errorf("proto: wrong wireType = %d for field Okay", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io1.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - b := bool(v != 0) - m.Okay = &b - case 2: - if wireType != 0 { - return fmt4.Errorf("proto: wrong wireType = %d for field Proposal", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io1.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Proposal = &v - case 4: - if wireType != 0 { - return fmt4.Errorf("proto: wrong wireType = %d for field Position", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io1.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Position = &v - case 3: - if wireType != 2 { - return fmt4.Errorf("proto: wrong wireType = %d for field Action", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io1.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io1.ErrUnexpectedEOF - } - if m.Action == nil { - m.Action = &Action{} - } - if err := m.Action.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - index -= sizeOfWire - skippy, err := github_com_gogo_protobuf_proto2.Skip(data[index:]) - if err != nil { - return err - } - if (index + skippy) > l { - return io1.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[index:index+skippy]...) - index += skippy + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*Action_Nop) + if !ok { + return fmt.Errorf("that is not of type *Action_Nop") + } + if that1 == nil { + if this == nil { + return nil } + return fmt.Errorf("that is type *Action_Nop but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *Action_Nopbut is not nil && this == nil") + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) } return nil } -func (m *WriteRequest) 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 io1.ErrUnexpectedEOF - } - b := data[index] - index++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } +func (this *Action_Nop) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 0 { - return fmt4.Errorf("proto: wrong wireType = %d for field Proposal", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io1.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Proposal = &v - case 2: - if wireType != 0 { - return fmt4.Errorf("proto: wrong wireType = %d for field Position", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io1.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Position = &v - case 3: - if wireType != 0 { - return fmt4.Errorf("proto: wrong wireType = %d for field Learned", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io1.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - b := bool(v != 0) - m.Learned = &b - case 4: - if wireType != 0 { - return fmt4.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - var v Action_Type - for shift := uint(0); ; shift += 7 { - if index >= l { - return io1.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (Action_Type(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Type = &v - case 5: - if wireType != 2 { - return fmt4.Errorf("proto: wrong wireType = %d for field Nop", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io1.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io1.ErrUnexpectedEOF - } - if m.Nop == nil { - m.Nop = &Action_Nop{} - } - if err := m.Nop.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - case 6: - if wireType != 2 { - return fmt4.Errorf("proto: wrong wireType = %d for field Append", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io1.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io1.ErrUnexpectedEOF - } - if m.Append == nil { - m.Append = &Action_Append{} - } - if err := m.Append.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - case 7: - if wireType != 2 { - return fmt4.Errorf("proto: wrong wireType = %d for field Truncate", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io1.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io1.ErrUnexpectedEOF - } - if m.Truncate == nil { - m.Truncate = &Action_Truncate{} - } - if err := m.Truncate.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - index -= sizeOfWire - skippy, err := github_com_gogo_protobuf_proto2.Skip(data[index:]) - if err != nil { - return err - } - if (index + skippy) > l { - return io1.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[index:index+skippy]...) - index += skippy + return false + } + + that1, ok := that.(*Action_Nop) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *Action_Append) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*Action_Append) + if !ok { + return fmt.Errorf("that is not of type *Action_Append") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *Action_Append but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *Action_Appendbut is not nil && this == nil") + } + if !bytes.Equal(this.Bytes, that1.Bytes) { + return fmt.Errorf("Bytes this(%v) Not Equal that(%v)", this.Bytes, that1.Bytes) + } + if !bytes.Equal(this.Cksum, that1.Cksum) { + return fmt.Errorf("Cksum this(%v) Not Equal that(%v)", this.Cksum, that1.Cksum) + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + } + return nil +} +func (this *Action_Append) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } + + that1, ok := that.(*Action_Append) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if !bytes.Equal(this.Bytes, that1.Bytes) { + return false + } + if !bytes.Equal(this.Cksum, that1.Cksum) { + return false + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *Action_Truncate) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*Action_Truncate) + if !ok { + return fmt.Errorf("that is not of type *Action_Truncate") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *Action_Truncate but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *Action_Truncatebut is not nil && this == nil") + } + if this.To != nil && that1.To != nil { + if *this.To != *that1.To { + return fmt.Errorf("To this(%v) Not Equal that(%v)", *this.To, *that1.To) + } + } else if this.To != nil { + return fmt.Errorf("this.To == nil && that.To != nil") + } else if that1.To != nil { + return fmt.Errorf("To this(%v) Not Equal that(%v)", this.To, that1.To) + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + } + return nil +} +func (this *Action_Truncate) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } + + that1, ok := that.(*Action_Truncate) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if this.To != nil && that1.To != nil { + if *this.To != *that1.To { + return false + } + } else if this.To != nil { + return false + } else if that1.To != nil { + return false + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *Metadata) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*Metadata) + if !ok { + return fmt.Errorf("that is not of type *Metadata") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *Metadata but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *Metadatabut is not nil && this == nil") + } + if this.Status != nil && that1.Status != nil { + if *this.Status != *that1.Status { + return fmt.Errorf("Status this(%v) Not Equal that(%v)", *this.Status, *that1.Status) + } + } else if this.Status != nil { + return fmt.Errorf("this.Status == nil && that.Status != nil") + } else if that1.Status != nil { + return fmt.Errorf("Status this(%v) Not Equal that(%v)", this.Status, that1.Status) + } + if this.Promised != nil && that1.Promised != nil { + if *this.Promised != *that1.Promised { + return fmt.Errorf("Promised this(%v) Not Equal that(%v)", *this.Promised, *that1.Promised) + } + } else if this.Promised != nil { + return fmt.Errorf("this.Promised == nil && that.Promised != nil") + } else if that1.Promised != nil { + return fmt.Errorf("Promised this(%v) Not Equal that(%v)", this.Promised, that1.Promised) + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + } + return nil +} +func (this *Metadata) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } + + that1, ok := that.(*Metadata) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if this.Status != nil && that1.Status != nil { + if *this.Status != *that1.Status { + return false + } + } else if this.Status != nil { + return false + } else if that1.Status != nil { + return false + } + if this.Promised != nil && that1.Promised != nil { + if *this.Promised != *that1.Promised { + return false } + } else if this.Promised != nil { + return false + } else if that1.Promised != nil { + return false } - return nil + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true } -func (m *WriteResponse) 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 io1.ErrUnexpectedEOF - } - b := data[index] - index++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } +func (this *Record) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 0 { - return fmt4.Errorf("proto: wrong wireType = %d for field Okay", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io1.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - b := bool(v != 0) - m.Okay = &b - case 2: - if wireType != 0 { - return fmt4.Errorf("proto: wrong wireType = %d for field Proposal", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io1.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Proposal = &v - case 3: - if wireType != 0 { - return fmt4.Errorf("proto: wrong wireType = %d for field Position", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io1.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Position = &v - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - index -= sizeOfWire - skippy, err := github_com_gogo_protobuf_proto2.Skip(data[index:]) - if err != nil { - return err - } - if (index + skippy) > l { - return io1.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[index:index+skippy]...) - index += skippy + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*Record) + if !ok { + return fmt.Errorf("that is not of type *Record") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *Record but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *Recordbut is not nil && this == nil") + } + if this.Type != nil && that1.Type != nil { + if *this.Type != *that1.Type { + return fmt.Errorf("Type this(%v) Not Equal that(%v)", *this.Type, *that1.Type) } + } else if this.Type != nil { + return fmt.Errorf("this.Type == nil && that.Type != nil") + } else if that1.Type != nil { + return fmt.Errorf("Type this(%v) Not Equal that(%v)", this.Type, that1.Type) + } + if !this.Promise.Equal(that1.Promise) { + return fmt.Errorf("Promise this(%v) Not Equal that(%v)", this.Promise, that1.Promise) + } + if !this.Action.Equal(that1.Action) { + return fmt.Errorf("Action this(%v) Not Equal that(%v)", this.Action, that1.Action) + } + if !this.Metadata.Equal(that1.Metadata) { + return fmt.Errorf("Metadata this(%v) Not Equal that(%v)", this.Metadata, that1.Metadata) + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) } return nil } -func (m *LearnedMessage) 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 io1.ErrUnexpectedEOF - } - b := data[index] - index++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } +func (this *Record) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt4.Errorf("proto: wrong wireType = %d for field Action", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io1.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io1.ErrUnexpectedEOF - } - if m.Action == nil { - m.Action = &Action{} - } - if err := m.Action.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - index -= sizeOfWire - skippy, err := github_com_gogo_protobuf_proto2.Skip(data[index:]) - if err != nil { - return err - } - if (index + skippy) > l { - return io1.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[index:index+skippy]...) - index += skippy + return false + } + + that1, ok := that.(*Record) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if this.Type != nil && that1.Type != nil { + if *this.Type != *that1.Type { + return false + } + } else if this.Type != nil { + return false + } else if that1.Type != nil { + return false + } + if !this.Promise.Equal(that1.Promise) { + return false + } + if !this.Action.Equal(that1.Action) { + return false + } + if !this.Metadata.Equal(that1.Metadata) { + return false + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *PromiseRequest) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*PromiseRequest) + if !ok { + return fmt.Errorf("that is not of type *PromiseRequest") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *PromiseRequest but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *PromiseRequestbut is not nil && this == nil") + } + if this.Proposal != nil && that1.Proposal != nil { + if *this.Proposal != *that1.Proposal { + return fmt.Errorf("Proposal this(%v) Not Equal that(%v)", *this.Proposal, *that1.Proposal) + } + } else if this.Proposal != nil { + return fmt.Errorf("this.Proposal == nil && that.Proposal != nil") + } else if that1.Proposal != nil { + return fmt.Errorf("Proposal this(%v) Not Equal that(%v)", this.Proposal, that1.Proposal) + } + if this.Position != nil && that1.Position != nil { + if *this.Position != *that1.Position { + return fmt.Errorf("Position this(%v) Not Equal that(%v)", *this.Position, *that1.Position) + } + } else if this.Position != nil { + return fmt.Errorf("this.Position == nil && that.Position != nil") + } else if that1.Position != nil { + return fmt.Errorf("Position this(%v) Not Equal that(%v)", this.Position, that1.Position) + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) } return nil } -func (m *RecoverRequest) 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 io1.ErrUnexpectedEOF - } - b := data[index] - index++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } +func (this *PromiseRequest) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } + + that1, ok := that.(*PromiseRequest) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if this.Proposal != nil && that1.Proposal != nil { + if *this.Proposal != *that1.Proposal { + return false + } + } else if this.Proposal != nil { + return false + } else if that1.Proposal != nil { + return false + } + if this.Position != nil && that1.Position != nil { + if *this.Position != *that1.Position { + return false + } + } else if this.Position != nil { + return false + } else if that1.Position != nil { + return false + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *PromiseResponse) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil } - fieldNum := int32(wire >> 3) - switch fieldNum { - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - index -= sizeOfWire - skippy, err := github_com_gogo_protobuf_proto2.Skip(data[index:]) - if err != nil { - return err - } - if (index + skippy) > l { - return io1.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[index:index+skippy]...) - index += skippy + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*PromiseResponse) + if !ok { + return fmt.Errorf("that is not of type *PromiseResponse") + } + if that1 == nil { + if this == nil { + return nil } + return fmt.Errorf("that is type *PromiseResponse but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *PromiseResponsebut is not nil && this == nil") } - return nil -} -func (m *RecoverResponse) 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 io1.ErrUnexpectedEOF - } - b := data[index] - index++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } + if this.Okay != nil && that1.Okay != nil { + if *this.Okay != *that1.Okay { + return fmt.Errorf("Okay this(%v) Not Equal that(%v)", *this.Okay, *that1.Okay) } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 0 { - return fmt4.Errorf("proto: wrong wireType = %d for field Status", wireType) - } - var v Metadata_Status - for shift := uint(0); ; shift += 7 { - if index >= l { - return io1.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (Metadata_Status(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Status = &v - case 2: - if wireType != 0 { - return fmt4.Errorf("proto: wrong wireType = %d for field Begin", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io1.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Begin = &v - case 3: - if wireType != 0 { - return fmt4.Errorf("proto: wrong wireType = %d for field End", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io1.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.End = &v - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - index -= sizeOfWire - skippy, err := github_com_gogo_protobuf_proto2.Skip(data[index:]) - if err != nil { - return err - } - if (index + skippy) > l { - return io1.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[index:index+skippy]...) - index += skippy + } else if this.Okay != nil { + return fmt.Errorf("this.Okay == nil && that.Okay != nil") + } else if that1.Okay != nil { + return fmt.Errorf("Okay this(%v) Not Equal that(%v)", this.Okay, that1.Okay) + } + if this.Proposal != nil && that1.Proposal != nil { + if *this.Proposal != *that1.Proposal { + return fmt.Errorf("Proposal this(%v) Not Equal that(%v)", *this.Proposal, *that1.Proposal) } + } else if this.Proposal != nil { + return fmt.Errorf("this.Proposal == nil && that.Proposal != nil") + } else if that1.Proposal != nil { + return fmt.Errorf("Proposal this(%v) Not Equal that(%v)", this.Proposal, that1.Proposal) } - return nil -} -func (this *Promise) String() string { - if this == nil { - return "nil" + if this.Position != nil && that1.Position != nil { + if *this.Position != *that1.Position { + return fmt.Errorf("Position this(%v) Not Equal that(%v)", *this.Position, *that1.Position) + } + } else if this.Position != nil { + return fmt.Errorf("this.Position == nil && that.Position != nil") + } else if that1.Position != nil { + return fmt.Errorf("Position this(%v) Not Equal that(%v)", this.Position, that1.Position) } - s := strings2.Join([]string{`&Promise{`, - `Proposal:` + valueToStringLog(this.Proposal) + `,`, - `XXX_unrecognized:` + fmt5.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *Action) String() string { - if this == nil { - return "nil" + if !this.Action.Equal(that1.Action) { + return fmt.Errorf("Action this(%v) Not Equal that(%v)", this.Action, that1.Action) } - s := strings2.Join([]string{`&Action{`, - `Position:` + valueToStringLog(this.Position) + `,`, - `Promised:` + valueToStringLog(this.Promised) + `,`, - `Performed:` + valueToStringLog(this.Performed) + `,`, - `Learned:` + valueToStringLog(this.Learned) + `,`, - `Type:` + valueToStringLog(this.Type) + `,`, - `Nop:` + strings2.Replace(fmt5.Sprintf("%v", this.Nop), "Action_Nop", "Action_Nop", 1) + `,`, - `Append:` + strings2.Replace(fmt5.Sprintf("%v", this.Append), "Action_Append", "Action_Append", 1) + `,`, - `Truncate:` + strings2.Replace(fmt5.Sprintf("%v", this.Truncate), "Action_Truncate", "Action_Truncate", 1) + `,`, - `XXX_unrecognized:` + fmt5.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *Action_Nop) String() string { - if this == nil { - return "nil" + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) } - s := strings2.Join([]string{`&Action_Nop{`, - `XXX_unrecognized:` + fmt5.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s + return nil } -func (this *Action_Append) String() string { - if this == nil { - return "nil" +func (this *PromiseResponse) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false } - s := strings2.Join([]string{`&Action_Append{`, - `Bytes:` + valueToStringLog(this.Bytes) + `,`, - `Cksum:` + valueToStringLog(this.Cksum) + `,`, - `XXX_unrecognized:` + fmt5.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *Action_Truncate) String() string { - if this == nil { - return "nil" + + that1, ok := that.(*PromiseResponse) + if !ok { + return false } - s := strings2.Join([]string{`&Action_Truncate{`, - `To:` + valueToStringLog(this.To) + `,`, - `XXX_unrecognized:` + fmt5.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *Metadata) String() string { - if this == nil { - return "nil" + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false } - s := strings2.Join([]string{`&Metadata{`, - `Status:` + valueToStringLog(this.Status) + `,`, - `Promised:` + valueToStringLog(this.Promised) + `,`, - `XXX_unrecognized:` + fmt5.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *Record) String() string { - if this == nil { - return "nil" + if this.Okay != nil && that1.Okay != nil { + if *this.Okay != *that1.Okay { + return false + } + } else if this.Okay != nil { + return false + } else if that1.Okay != nil { + return false } - s := strings2.Join([]string{`&Record{`, - `Type:` + valueToStringLog(this.Type) + `,`, - `Promise:` + strings2.Replace(fmt5.Sprintf("%v", this.Promise), "Promise", "Promise", 1) + `,`, - `Action:` + strings2.Replace(fmt5.Sprintf("%v", this.Action), "Action", "Action", 1) + `,`, - `Metadata:` + strings2.Replace(fmt5.Sprintf("%v", this.Metadata), "Metadata", "Metadata", 1) + `,`, - `XXX_unrecognized:` + fmt5.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *PromiseRequest) String() string { - if this == nil { - return "nil" + if this.Proposal != nil && that1.Proposal != nil { + if *this.Proposal != *that1.Proposal { + return false + } + } else if this.Proposal != nil { + return false + } else if that1.Proposal != nil { + return false } - s := strings2.Join([]string{`&PromiseRequest{`, - `Proposal:` + valueToStringLog(this.Proposal) + `,`, - `Position:` + valueToStringLog(this.Position) + `,`, - `XXX_unrecognized:` + fmt5.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *PromiseResponse) String() string { - if this == nil { - return "nil" + if this.Position != nil && that1.Position != nil { + if *this.Position != *that1.Position { + return false + } + } else if this.Position != nil { + return false + } else if that1.Position != nil { + return false } - s := strings2.Join([]string{`&PromiseResponse{`, - `Okay:` + valueToStringLog(this.Okay) + `,`, - `Proposal:` + valueToStringLog(this.Proposal) + `,`, - `Position:` + valueToStringLog(this.Position) + `,`, - `Action:` + strings2.Replace(fmt5.Sprintf("%v", this.Action), "Action", "Action", 1) + `,`, - `XXX_unrecognized:` + fmt5.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *WriteRequest) String() string { - if this == nil { - return "nil" + if !this.Action.Equal(that1.Action) { + return false } - s := strings2.Join([]string{`&WriteRequest{`, - `Proposal:` + valueToStringLog(this.Proposal) + `,`, - `Position:` + valueToStringLog(this.Position) + `,`, - `Learned:` + valueToStringLog(this.Learned) + `,`, - `Type:` + valueToStringLog(this.Type) + `,`, - `Nop:` + strings2.Replace(fmt5.Sprintf("%v", this.Nop), "Action_Nop", "Action_Nop", 1) + `,`, - `Append:` + strings2.Replace(fmt5.Sprintf("%v", this.Append), "Action_Append", "Action_Append", 1) + `,`, - `Truncate:` + strings2.Replace(fmt5.Sprintf("%v", this.Truncate), "Action_Truncate", "Action_Truncate", 1) + `,`, - `XXX_unrecognized:` + fmt5.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *WriteResponse) String() string { - if this == nil { - return "nil" + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false } - s := strings2.Join([]string{`&WriteResponse{`, - `Okay:` + valueToStringLog(this.Okay) + `,`, - `Proposal:` + valueToStringLog(this.Proposal) + `,`, - `Position:` + valueToStringLog(this.Position) + `,`, - `XXX_unrecognized:` + fmt5.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s + return true } -func (this *LearnedMessage) String() string { - if this == nil { - return "nil" +func (this *WriteRequest) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") } - s := strings2.Join([]string{`&LearnedMessage{`, - `Action:` + strings2.Replace(fmt5.Sprintf("%v", this.Action), "Action", "Action", 1) + `,`, - `XXX_unrecognized:` + fmt5.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *RecoverRequest) String() string { - if this == nil { - return "nil" + + that1, ok := that.(*WriteRequest) + if !ok { + return fmt.Errorf("that is not of type *WriteRequest") } - s := strings2.Join([]string{`&RecoverRequest{`, - `XXX_unrecognized:` + fmt5.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *RecoverResponse) String() string { - if this == nil { - return "nil" + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *WriteRequest but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *WriteRequestbut is not nil && this == nil") } - s := strings2.Join([]string{`&RecoverResponse{`, - `Status:` + valueToStringLog(this.Status) + `,`, - `Begin:` + valueToStringLog(this.Begin) + `,`, - `End:` + valueToStringLog(this.End) + `,`, - `XXX_unrecognized:` + fmt5.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func valueToStringLog(v interface{}) string { - rv := reflect2.ValueOf(v) - if rv.IsNil() { - return "nil" + if this.Proposal != nil && that1.Proposal != nil { + if *this.Proposal != *that1.Proposal { + return fmt.Errorf("Proposal this(%v) Not Equal that(%v)", *this.Proposal, *that1.Proposal) + } + } else if this.Proposal != nil { + return fmt.Errorf("this.Proposal == nil && that.Proposal != nil") + } else if that1.Proposal != nil { + return fmt.Errorf("Proposal this(%v) Not Equal that(%v)", this.Proposal, that1.Proposal) } - pv := reflect2.Indirect(rv).Interface() - return fmt5.Sprintf("*%v", pv) -} -func (m *Promise) Size() (n int) { - var l int - _ = l - if m.Proposal != nil { - n += 1 + sovLog(uint64(*m.Proposal)) + if this.Position != nil && that1.Position != nil { + if *this.Position != *that1.Position { + return fmt.Errorf("Position this(%v) Not Equal that(%v)", *this.Position, *that1.Position) + } + } else if this.Position != nil { + return fmt.Errorf("this.Position == nil && that.Position != nil") + } else if that1.Position != nil { + return fmt.Errorf("Position this(%v) Not Equal that(%v)", this.Position, that1.Position) } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + if this.Learned != nil && that1.Learned != nil { + if *this.Learned != *that1.Learned { + return fmt.Errorf("Learned this(%v) Not Equal that(%v)", *this.Learned, *that1.Learned) + } + } else if this.Learned != nil { + return fmt.Errorf("this.Learned == nil && that.Learned != nil") + } else if that1.Learned != nil { + return fmt.Errorf("Learned this(%v) Not Equal that(%v)", this.Learned, that1.Learned) } - return n + if this.Type != nil && that1.Type != nil { + if *this.Type != *that1.Type { + return fmt.Errorf("Type this(%v) Not Equal that(%v)", *this.Type, *that1.Type) + } + } else if this.Type != nil { + return fmt.Errorf("this.Type == nil && that.Type != nil") + } else if that1.Type != nil { + return fmt.Errorf("Type this(%v) Not Equal that(%v)", this.Type, that1.Type) + } + if !this.Nop.Equal(that1.Nop) { + return fmt.Errorf("Nop this(%v) Not Equal that(%v)", this.Nop, that1.Nop) + } + if !this.Append.Equal(that1.Append) { + return fmt.Errorf("Append this(%v) Not Equal that(%v)", this.Append, that1.Append) + } + if !this.Truncate.Equal(that1.Truncate) { + return fmt.Errorf("Truncate this(%v) Not Equal that(%v)", this.Truncate, that1.Truncate) + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + } + return nil } +func (this *WriteRequest) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } -func (m *Action) Size() (n int) { - var l int - _ = l - if m.Position != nil { - n += 1 + sovLog(uint64(*m.Position)) + that1, ok := that.(*WriteRequest) + if !ok { + return false } - if m.Promised != nil { - n += 1 + sovLog(uint64(*m.Promised)) + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false } - if m.Performed != nil { - n += 1 + sovLog(uint64(*m.Performed)) + if this.Proposal != nil && that1.Proposal != nil { + if *this.Proposal != *that1.Proposal { + return false + } + } else if this.Proposal != nil { + return false + } else if that1.Proposal != nil { + return false } - if m.Learned != nil { - n += 2 + if this.Position != nil && that1.Position != nil { + if *this.Position != *that1.Position { + return false + } + } else if this.Position != nil { + return false + } else if that1.Position != nil { + return false } - if m.Type != nil { - n += 1 + sovLog(uint64(*m.Type)) + if this.Learned != nil && that1.Learned != nil { + if *this.Learned != *that1.Learned { + return false + } + } else if this.Learned != nil { + return false + } else if that1.Learned != nil { + return false } - if m.Nop != nil { - l = m.Nop.Size() - n += 1 + l + sovLog(uint64(l)) + if this.Type != nil && that1.Type != nil { + if *this.Type != *that1.Type { + return false + } + } else if this.Type != nil { + return false + } else if that1.Type != nil { + return false } - if m.Append != nil { - l = m.Append.Size() - n += 1 + l + sovLog(uint64(l)) + if !this.Nop.Equal(that1.Nop) { + return false } - if m.Truncate != nil { - l = m.Truncate.Size() - n += 1 + l + sovLog(uint64(l)) + if !this.Append.Equal(that1.Append) { + return false } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + if !this.Truncate.Equal(that1.Truncate) { + return false } - return n + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true } +func (this *WriteResponse) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } -func (m *Action_Nop) Size() (n int) { - var l int - _ = l - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + that1, ok := that.(*WriteResponse) + if !ok { + return fmt.Errorf("that is not of type *WriteResponse") } - return n + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *WriteResponse but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *WriteResponsebut is not nil && this == nil") + } + if this.Okay != nil && that1.Okay != nil { + if *this.Okay != *that1.Okay { + return fmt.Errorf("Okay this(%v) Not Equal that(%v)", *this.Okay, *that1.Okay) + } + } else if this.Okay != nil { + return fmt.Errorf("this.Okay == nil && that.Okay != nil") + } else if that1.Okay != nil { + return fmt.Errorf("Okay this(%v) Not Equal that(%v)", this.Okay, that1.Okay) + } + if this.Proposal != nil && that1.Proposal != nil { + if *this.Proposal != *that1.Proposal { + return fmt.Errorf("Proposal this(%v) Not Equal that(%v)", *this.Proposal, *that1.Proposal) + } + } else if this.Proposal != nil { + return fmt.Errorf("this.Proposal == nil && that.Proposal != nil") + } else if that1.Proposal != nil { + return fmt.Errorf("Proposal this(%v) Not Equal that(%v)", this.Proposal, that1.Proposal) + } + if this.Position != nil && that1.Position != nil { + if *this.Position != *that1.Position { + return fmt.Errorf("Position this(%v) Not Equal that(%v)", *this.Position, *that1.Position) + } + } else if this.Position != nil { + return fmt.Errorf("this.Position == nil && that.Position != nil") + } else if that1.Position != nil { + return fmt.Errorf("Position this(%v) Not Equal that(%v)", this.Position, that1.Position) + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + } + return nil } +func (this *WriteResponse) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } -func (m *Action_Append) Size() (n int) { - var l int - _ = l - if m.Bytes != nil { - l = len(m.Bytes) - n += 1 + l + sovLog(uint64(l)) + that1, ok := that.(*WriteResponse) + if !ok { + return false } - if m.Cksum != nil { - l = len(m.Cksum) - n += 1 + l + sovLog(uint64(l)) + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if this.Okay != nil && that1.Okay != nil { + if *this.Okay != *that1.Okay { + return false + } + } else if this.Okay != nil { + return false + } else if that1.Okay != nil { + return false + } + if this.Proposal != nil && that1.Proposal != nil { + if *this.Proposal != *that1.Proposal { + return false + } + } else if this.Proposal != nil { + return false + } else if that1.Proposal != nil { + return false + } + if this.Position != nil && that1.Position != nil { + if *this.Position != *that1.Position { + return false + } + } else if this.Position != nil { + return false + } else if that1.Position != nil { + return false } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false } - return n + return true } +func (this *LearnedMessage) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } -func (m *Action_Truncate) Size() (n int) { - var l int - _ = l - if m.To != nil { - n += 1 + sovLog(uint64(*m.To)) + that1, ok := that.(*LearnedMessage) + if !ok { + return fmt.Errorf("that is not of type *LearnedMessage") } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *LearnedMessage but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *LearnedMessagebut is not nil && this == nil") } - return n + if !this.Action.Equal(that1.Action) { + return fmt.Errorf("Action this(%v) Not Equal that(%v)", this.Action, that1.Action) + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + } + return nil } +func (this *LearnedMessage) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } -func (m *Metadata) Size() (n int) { - var l int - _ = l - if m.Status != nil { - n += 1 + sovLog(uint64(*m.Status)) + that1, ok := that.(*LearnedMessage) + if !ok { + return false } - if m.Promised != nil { - n += 1 + sovLog(uint64(*m.Promised)) + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + if !this.Action.Equal(that1.Action) { + return false } - return n -} - -func (m *Record) Size() (n int) { - var l int - _ = l - if m.Type != nil { - n += 1 + sovLog(uint64(*m.Type)) + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false } - if m.Promise != nil { - l = m.Promise.Size() - n += 1 + l + sovLog(uint64(l)) + return true +} +func (this *RecoverRequest) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") } - if m.Action != nil { - l = m.Action.Size() - n += 1 + l + sovLog(uint64(l)) + + that1, ok := that.(*RecoverRequest) + if !ok { + return fmt.Errorf("that is not of type *RecoverRequest") } - if m.Metadata != nil { - l = m.Metadata.Size() - n += 1 + l + sovLog(uint64(l)) + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *RecoverRequest but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *RecoverRequestbut is not nil && this == nil") } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) } - return n + return nil } +func (this *RecoverRequest) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } -func (m *PromiseRequest) Size() (n int) { - var l int - _ = l - if m.Proposal != nil { - n += 1 + sovLog(uint64(*m.Proposal)) + that1, ok := that.(*RecoverRequest) + if !ok { + return false } - if m.Position != nil { - n += 1 + sovLog(uint64(*m.Position)) + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false } - return n + return true } +func (this *RecoverResponse) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } -func (m *PromiseResponse) Size() (n int) { - var l int - _ = l - if m.Okay != nil { - n += 2 + that1, ok := that.(*RecoverResponse) + if !ok { + return fmt.Errorf("that is not of type *RecoverResponse") } - if m.Proposal != nil { - n += 1 + sovLog(uint64(*m.Proposal)) + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *RecoverResponse but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *RecoverResponsebut is not nil && this == nil") } - if m.Position != nil { - n += 1 + sovLog(uint64(*m.Position)) + if this.Status != nil && that1.Status != nil { + if *this.Status != *that1.Status { + return fmt.Errorf("Status this(%v) Not Equal that(%v)", *this.Status, *that1.Status) + } + } else if this.Status != nil { + return fmt.Errorf("this.Status == nil && that.Status != nil") + } else if that1.Status != nil { + return fmt.Errorf("Status this(%v) Not Equal that(%v)", this.Status, that1.Status) } - if m.Action != nil { - l = m.Action.Size() - n += 1 + l + sovLog(uint64(l)) + if this.Begin != nil && that1.Begin != nil { + if *this.Begin != *that1.Begin { + return fmt.Errorf("Begin this(%v) Not Equal that(%v)", *this.Begin, *that1.Begin) + } + } else if this.Begin != nil { + return fmt.Errorf("this.Begin == nil && that.Begin != nil") + } else if that1.Begin != nil { + return fmt.Errorf("Begin this(%v) Not Equal that(%v)", this.Begin, that1.Begin) } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + if this.End != nil && that1.End != nil { + if *this.End != *that1.End { + return fmt.Errorf("End this(%v) Not Equal that(%v)", *this.End, *that1.End) + } + } else if this.End != nil { + return fmt.Errorf("this.End == nil && that.End != nil") + } else if that1.End != nil { + return fmt.Errorf("End this(%v) Not Equal that(%v)", this.End, that1.End) } - return n -} - -func (m *WriteRequest) Size() (n int) { - var l int - _ = l - if m.Proposal != nil { - n += 1 + sovLog(uint64(*m.Proposal)) + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) } - if m.Position != nil { - n += 1 + sovLog(uint64(*m.Position)) + return nil +} +func (this *RecoverResponse) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false } - if m.Learned != nil { - n += 2 + + that1, ok := that.(*RecoverResponse) + if !ok { + return false } - if m.Type != nil { - n += 1 + sovLog(uint64(*m.Type)) + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false } - if m.Nop != nil { - l = m.Nop.Size() - n += 1 + l + sovLog(uint64(l)) + if this.Status != nil && that1.Status != nil { + if *this.Status != *that1.Status { + return false + } + } else if this.Status != nil { + return false + } else if that1.Status != nil { + return false } - if m.Append != nil { - l = m.Append.Size() - n += 1 + l + sovLog(uint64(l)) + if this.Begin != nil && that1.Begin != nil { + if *this.Begin != *that1.Begin { + return false + } + } else if this.Begin != nil { + return false + } else if that1.Begin != nil { + return false } - if m.Truncate != nil { - l = m.Truncate.Size() - n += 1 + l + sovLog(uint64(l)) + if this.End != nil && that1.End != nil { + if *this.End != *that1.End { + return false + } + } else if this.End != nil { + return false + } else if that1.End != nil { + return false } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false } - return n + return true } - -func (m *WriteResponse) Size() (n int) { - var l int - _ = l - if m.Okay != nil { - n += 2 - } - if m.Proposal != nil { - n += 1 + sovLog(uint64(*m.Proposal)) +func (this *Promise) GoString() string { + if this == nil { + return "nil" } - if m.Position != nil { - n += 1 + sovLog(uint64(*m.Position)) + s := make([]string, 0, 5) + s = append(s, "&mesosproto.Promise{") + if this.Proposal != nil { + s = append(s, "Proposal: "+valueToGoStringLog(this.Proposal, "uint64")+",\n") } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") } - return n + s = append(s, "}") + return strings.Join(s, "") } - -func (m *LearnedMessage) Size() (n int) { - var l int - _ = l - if m.Action != nil { - l = m.Action.Size() - n += 1 + l + sovLog(uint64(l)) +func (this *Action) GoString() string { + if this == nil { + return "nil" } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + s := make([]string, 0, 12) + s = append(s, "&mesosproto.Action{") + if this.Position != nil { + s = append(s, "Position: "+valueToGoStringLog(this.Position, "uint64")+",\n") } - return n -} - -func (m *RecoverRequest) Size() (n int) { - var l int - _ = l - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + if this.Promised != nil { + s = append(s, "Promised: "+valueToGoStringLog(this.Promised, "uint64")+",\n") } - return n -} - -func (m *RecoverResponse) Size() (n int) { - var l int - _ = l - if m.Status != nil { - n += 1 + sovLog(uint64(*m.Status)) + if this.Performed != nil { + s = append(s, "Performed: "+valueToGoStringLog(this.Performed, "uint64")+",\n") } - if m.Begin != nil { - n += 1 + sovLog(uint64(*m.Begin)) + if this.Learned != nil { + s = append(s, "Learned: "+valueToGoStringLog(this.Learned, "bool")+",\n") } - if m.End != nil { - n += 1 + sovLog(uint64(*m.End)) + if this.Type != nil { + s = append(s, "Type: "+valueToGoStringLog(this.Type, "mesosproto.Action_Type")+",\n") } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + if this.Nop != nil { + s = append(s, "Nop: "+fmt.Sprintf("%#v", this.Nop)+",\n") } - return n -} - -func sovLog(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } + if this.Append != nil { + s = append(s, "Append: "+fmt.Sprintf("%#v", this.Append)+",\n") } - return n -} -func sozLog(x uint64) (n int) { - return sovLog(uint64((x << 1) ^ uint64((int64(x) >> 63)))) + if this.Truncate != nil { + s = append(s, "Truncate: "+fmt.Sprintf("%#v", this.Truncate)+",\n") + } + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") } -func NewPopulatedPromise(r randyLog, easy bool) *Promise { - this := &Promise{} - v1 := uint64(r.Uint32()) - this.Proposal = &v1 - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedLog(r, 2) +func (this *Action_Nop) GoString() string { + if this == nil { + return "nil" } - return this + s := make([]string, 0, 4) + s = append(s, "&mesosproto.Action_Nop{") + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") } - -func NewPopulatedAction(r randyLog, easy bool) *Action { - this := &Action{} - v2 := uint64(r.Uint32()) - this.Position = &v2 - v3 := uint64(r.Uint32()) - this.Promised = &v3 - if r.Intn(10) != 0 { - v4 := uint64(r.Uint32()) - this.Performed = &v4 +func (this *Action_Append) GoString() string { + if this == nil { + return "nil" } - if r.Intn(10) != 0 { - v5 := bool(r.Intn(2) == 0) - this.Learned = &v5 + s := make([]string, 0, 6) + s = append(s, "&mesosproto.Action_Append{") + if this.Bytes != nil { + s = append(s, "Bytes: "+valueToGoStringLog(this.Bytes, "byte")+",\n") } - if r.Intn(10) != 0 { - v6 := Action_Type([]int32{1, 2, 3}[r.Intn(3)]) - this.Type = &v6 + if this.Cksum != nil { + s = append(s, "Cksum: "+valueToGoStringLog(this.Cksum, "byte")+",\n") } - if r.Intn(10) != 0 { - this.Nop = NewPopulatedAction_Nop(r, easy) + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") } - if r.Intn(10) != 0 { - this.Append = NewPopulatedAction_Append(r, easy) + s = append(s, "}") + return strings.Join(s, "") +} +func (this *Action_Truncate) GoString() string { + if this == nil { + return "nil" } - if r.Intn(10) != 0 { - this.Truncate = NewPopulatedAction_Truncate(r, easy) + s := make([]string, 0, 5) + s = append(s, "&mesosproto.Action_Truncate{") + if this.To != nil { + s = append(s, "To: "+valueToGoStringLog(this.To, "uint64")+",\n") } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedLog(r, 9) + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") } - return this + s = append(s, "}") + return strings.Join(s, "") } - -func NewPopulatedAction_Nop(r randyLog, easy bool) *Action_Nop { - this := &Action_Nop{} - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedLog(r, 1) +func (this *Metadata) GoString() string { + if this == nil { + return "nil" } - return this -} - -func NewPopulatedAction_Append(r randyLog, easy bool) *Action_Append { - this := &Action_Append{} - v7 := r.Intn(100) - this.Bytes = make([]byte, v7) - for i := 0; i < v7; i++ { - this.Bytes[i] = byte(r.Intn(256)) + s := make([]string, 0, 6) + s = append(s, "&mesosproto.Metadata{") + if this.Status != nil { + s = append(s, "Status: "+valueToGoStringLog(this.Status, "mesosproto.Metadata_Status")+",\n") } - if r.Intn(10) != 0 { - v8 := r.Intn(100) - this.Cksum = make([]byte, v8) - for i := 0; i < v8; i++ { - this.Cksum[i] = byte(r.Intn(256)) - } + if this.Promised != nil { + s = append(s, "Promised: "+valueToGoStringLog(this.Promised, "uint64")+",\n") } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedLog(r, 3) + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") } - return this + s = append(s, "}") + return strings.Join(s, "") } - -func NewPopulatedAction_Truncate(r randyLog, easy bool) *Action_Truncate { - this := &Action_Truncate{} - v9 := uint64(r.Uint32()) - this.To = &v9 - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedLog(r, 2) +func (this *Record) GoString() string { + if this == nil { + return "nil" } - return this -} - -func NewPopulatedMetadata(r randyLog, easy bool) *Metadata { - this := &Metadata{} - v10 := Metadata_Status([]int32{1, 2, 3, 4}[r.Intn(4)]) - this.Status = &v10 - v11 := uint64(r.Uint32()) - this.Promised = &v11 - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedLog(r, 3) + s := make([]string, 0, 8) + s = append(s, "&mesosproto.Record{") + if this.Type != nil { + s = append(s, "Type: "+valueToGoStringLog(this.Type, "mesosproto.Record_Type")+",\n") } - return this -} - -func NewPopulatedRecord(r randyLog, easy bool) *Record { - this := &Record{} - v12 := Record_Type([]int32{1, 2, 3}[r.Intn(3)]) - this.Type = &v12 - if r.Intn(10) != 0 { - this.Promise = NewPopulatedPromise(r, easy) + if this.Promise != nil { + s = append(s, "Promise: "+fmt.Sprintf("%#v", this.Promise)+",\n") } - if r.Intn(10) != 0 { - this.Action = NewPopulatedAction(r, easy) + if this.Action != nil { + s = append(s, "Action: "+fmt.Sprintf("%#v", this.Action)+",\n") } - if r.Intn(10) != 0 { - this.Metadata = NewPopulatedMetadata(r, easy) + if this.Metadata != nil { + s = append(s, "Metadata: "+fmt.Sprintf("%#v", this.Metadata)+",\n") } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedLog(r, 5) + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") } - return this + s = append(s, "}") + return strings.Join(s, "") } - -func NewPopulatedPromiseRequest(r randyLog, easy bool) *PromiseRequest { - this := &PromiseRequest{} - v13 := uint64(r.Uint32()) - this.Proposal = &v13 - if r.Intn(10) != 0 { - v14 := uint64(r.Uint32()) - this.Position = &v14 +func (this *PromiseRequest) GoString() string { + if this == nil { + return "nil" } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedLog(r, 3) + s := make([]string, 0, 6) + s = append(s, "&mesosproto.PromiseRequest{") + if this.Proposal != nil { + s = append(s, "Proposal: "+valueToGoStringLog(this.Proposal, "uint64")+",\n") } - return this + if this.Position != nil { + s = append(s, "Position: "+valueToGoStringLog(this.Position, "uint64")+",\n") + } + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") } - -func NewPopulatedPromiseResponse(r randyLog, easy bool) *PromiseResponse { - this := &PromiseResponse{} - v15 := bool(r.Intn(2) == 0) - this.Okay = &v15 - v16 := uint64(r.Uint32()) - this.Proposal = &v16 - if r.Intn(10) != 0 { - v17 := uint64(r.Uint32()) - this.Position = &v17 +func (this *PromiseResponse) GoString() string { + if this == nil { + return "nil" } - if r.Intn(10) != 0 { - this.Action = NewPopulatedAction(r, easy) + s := make([]string, 0, 8) + s = append(s, "&mesosproto.PromiseResponse{") + if this.Okay != nil { + s = append(s, "Okay: "+valueToGoStringLog(this.Okay, "bool")+",\n") } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedLog(r, 5) + if this.Proposal != nil { + s = append(s, "Proposal: "+valueToGoStringLog(this.Proposal, "uint64")+",\n") } - return this + if this.Position != nil { + s = append(s, "Position: "+valueToGoStringLog(this.Position, "uint64")+",\n") + } + if this.Action != nil { + s = append(s, "Action: "+fmt.Sprintf("%#v", this.Action)+",\n") + } + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") } - -func NewPopulatedWriteRequest(r randyLog, easy bool) *WriteRequest { - this := &WriteRequest{} - v18 := uint64(r.Uint32()) - this.Proposal = &v18 - v19 := uint64(r.Uint32()) - this.Position = &v19 - if r.Intn(10) != 0 { - v20 := bool(r.Intn(2) == 0) - this.Learned = &v20 +func (this *WriteRequest) GoString() string { + if this == nil { + return "nil" } - v21 := Action_Type([]int32{1, 2, 3}[r.Intn(3)]) - this.Type = &v21 - if r.Intn(10) != 0 { - this.Nop = NewPopulatedAction_Nop(r, easy) + s := make([]string, 0, 11) + s = append(s, "&mesosproto.WriteRequest{") + if this.Proposal != nil { + s = append(s, "Proposal: "+valueToGoStringLog(this.Proposal, "uint64")+",\n") } - if r.Intn(10) != 0 { - this.Append = NewPopulatedAction_Append(r, easy) + if this.Position != nil { + s = append(s, "Position: "+valueToGoStringLog(this.Position, "uint64")+",\n") } - if r.Intn(10) != 0 { - this.Truncate = NewPopulatedAction_Truncate(r, easy) + if this.Learned != nil { + s = append(s, "Learned: "+valueToGoStringLog(this.Learned, "bool")+",\n") } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedLog(r, 8) + if this.Type != nil { + s = append(s, "Type: "+valueToGoStringLog(this.Type, "mesosproto.Action_Type")+",\n") } - return this -} - -func NewPopulatedWriteResponse(r randyLog, easy bool) *WriteResponse { - this := &WriteResponse{} - v22 := bool(r.Intn(2) == 0) - this.Okay = &v22 - v23 := uint64(r.Uint32()) - this.Proposal = &v23 - v24 := uint64(r.Uint32()) - this.Position = &v24 - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedLog(r, 4) + if this.Nop != nil { + s = append(s, "Nop: "+fmt.Sprintf("%#v", this.Nop)+",\n") } - return this -} - -func NewPopulatedLearnedMessage(r randyLog, easy bool) *LearnedMessage { - this := &LearnedMessage{} - this.Action = NewPopulatedAction(r, easy) - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedLog(r, 2) + if this.Append != nil { + s = append(s, "Append: "+fmt.Sprintf("%#v", this.Append)+",\n") } - return this -} - -func NewPopulatedRecoverRequest(r randyLog, easy bool) *RecoverRequest { - this := &RecoverRequest{} - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedLog(r, 1) + if this.Truncate != nil { + s = append(s, "Truncate: "+fmt.Sprintf("%#v", this.Truncate)+",\n") } - return this + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") } - -func NewPopulatedRecoverResponse(r randyLog, easy bool) *RecoverResponse { - this := &RecoverResponse{} - v25 := Metadata_Status([]int32{1, 2, 3, 4}[r.Intn(4)]) - this.Status = &v25 - if r.Intn(10) != 0 { - v26 := uint64(r.Uint32()) - this.Begin = &v26 +func (this *WriteResponse) GoString() string { + if this == nil { + return "nil" } - if r.Intn(10) != 0 { - v27 := uint64(r.Uint32()) - this.End = &v27 + s := make([]string, 0, 7) + s = append(s, "&mesosproto.WriteResponse{") + if this.Okay != nil { + s = append(s, "Okay: "+valueToGoStringLog(this.Okay, "bool")+",\n") } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedLog(r, 4) + if this.Proposal != nil { + s = append(s, "Proposal: "+valueToGoStringLog(this.Proposal, "uint64")+",\n") } - return this -} - -type randyLog interface { - Float32() float32 - Float64() float64 - Int63() int64 - Int31() int32 - Uint32() uint32 - Intn(n int) int + if this.Position != nil { + s = append(s, "Position: "+valueToGoStringLog(this.Position, "uint64")+",\n") + } + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") } - -func randUTF8RuneLog(r randyLog) rune { - res := rune(r.Uint32() % 1112064) - if 55296 <= res { - res += 2047 +func (this *LearnedMessage) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 5) + s = append(s, "&mesosproto.LearnedMessage{") + if this.Action != nil { + s = append(s, "Action: "+fmt.Sprintf("%#v", this.Action)+",\n") + } + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") } - return res + s = append(s, "}") + return strings.Join(s, "") } -func randStringLog(r randyLog) string { - v28 := r.Intn(100) - tmps := make([]rune, v28) - for i := 0; i < v28; i++ { - tmps[i] = randUTF8RuneLog(r) +func (this *RecoverRequest) GoString() string { + if this == nil { + return "nil" } - return string(tmps) + s := make([]string, 0, 4) + s = append(s, "&mesosproto.RecoverRequest{") + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") } -func randUnrecognizedLog(r randyLog, 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 = randFieldLog(data, r, fieldNumber, wire) +func (this *RecoverResponse) GoString() string { + if this == nil { + return "nil" } - return data + s := make([]string, 0, 7) + s = append(s, "&mesosproto.RecoverResponse{") + if this.Status != nil { + s = append(s, "Status: "+valueToGoStringLog(this.Status, "mesosproto.Metadata_Status")+",\n") + } + if this.Begin != nil { + s = append(s, "Begin: "+valueToGoStringLog(this.Begin, "uint64")+",\n") + } + if this.End != nil { + s = append(s, "End: "+valueToGoStringLog(this.End, "uint64")+",\n") + } + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") } -func randFieldLog(data []byte, r randyLog, fieldNumber int, wire int) []byte { - key := uint32(fieldNumber)<<3 | uint32(wire) - switch wire { - case 0: - data = encodeVarintPopulateLog(data, uint64(key)) - v29 := r.Int63() - if r.Intn(2) == 0 { - v29 *= -1 - } - data = encodeVarintPopulateLog(data, uint64(v29)) - case 1: - data = encodeVarintPopulateLog(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 = encodeVarintPopulateLog(data, uint64(key)) - ll := r.Intn(100) - data = encodeVarintPopulateLog(data, uint64(ll)) - for j := 0; j < ll; j++ { - data = append(data, byte(r.Intn(256))) - } - default: - data = encodeVarintPopulateLog(data, uint64(key)) - data = append(data, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) +func valueToGoStringLog(v interface{}, typ string) string { + rv := reflect.ValueOf(v) + if rv.IsNil() { + return "nil" } - return data + pv := reflect.Indirect(rv).Interface() + return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) } -func encodeVarintPopulateLog(data []byte, v uint64) []byte { - for v >= 1<<7 { - data = append(data, uint8(uint64(v)&0x7f|0x80)) - v >>= 7 +func extensionToGoStringLog(e map[int32]github_com_gogo_protobuf_proto.Extension) string { + if e == nil { + return "nil" } - data = append(data, uint8(v)) - return data + 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 *Promise) Marshal() (data []byte, err error) { size := m.Size() @@ -2723,12 +2153,14 @@ func (m *Promise) Marshal() (data []byte, err error) { return data[:n], nil } -func (m *Promise) MarshalTo(data []byte) (n int, err error) { +func (m *Promise) MarshalTo(data []byte) (int, error) { var i int _ = i var l int _ = l - if m.Proposal != nil { + if m.Proposal == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("proposal") + } else { data[i] = 0x8 i++ i = encodeVarintLog(data, i, uint64(*m.Proposal)) @@ -2749,17 +2181,21 @@ func (m *Action) Marshal() (data []byte, err error) { return data[:n], nil } -func (m *Action) MarshalTo(data []byte) (n int, err error) { +func (m *Action) MarshalTo(data []byte) (int, error) { var i int _ = i var l int _ = l - if m.Position != nil { + if m.Position == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("position") + } else { data[i] = 0x8 i++ i = encodeVarintLog(data, i, uint64(*m.Position)) } - if m.Promised != nil { + if m.Promised == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("promised") + } else { data[i] = 0x10 i++ i = encodeVarintLog(data, i, uint64(*m.Promised)) @@ -2830,7 +2266,7 @@ func (m *Action_Nop) Marshal() (data []byte, err error) { return data[:n], nil } -func (m *Action_Nop) MarshalTo(data []byte) (n int, err error) { +func (m *Action_Nop) MarshalTo(data []byte) (int, error) { var i int _ = i var l int @@ -2851,12 +2287,14 @@ func (m *Action_Append) Marshal() (data []byte, err error) { return data[:n], nil } -func (m *Action_Append) MarshalTo(data []byte) (n int, err error) { +func (m *Action_Append) MarshalTo(data []byte) (int, error) { var i int _ = i var l int _ = l - if m.Bytes != nil { + if m.Bytes == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("bytes") + } else { data[i] = 0xa i++ i = encodeVarintLog(data, i, uint64(len(m.Bytes))) @@ -2884,12 +2322,14 @@ func (m *Action_Truncate) Marshal() (data []byte, err error) { return data[:n], nil } -func (m *Action_Truncate) MarshalTo(data []byte) (n int, err error) { +func (m *Action_Truncate) MarshalTo(data []byte) (int, error) { var i int _ = i var l int _ = l - if m.To != nil { + if m.To == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("to") + } else { data[i] = 0x8 i++ i = encodeVarintLog(data, i, uint64(*m.To)) @@ -2910,17 +2350,21 @@ func (m *Metadata) Marshal() (data []byte, err error) { return data[:n], nil } -func (m *Metadata) MarshalTo(data []byte) (n int, err error) { +func (m *Metadata) MarshalTo(data []byte) (int, error) { var i int _ = i var l int _ = l - if m.Status != nil { + if m.Status == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("status") + } else { data[i] = 0x8 i++ i = encodeVarintLog(data, i, uint64(*m.Status)) } - if m.Promised != nil { + if m.Promised == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("promised") + } else { data[i] = 0x10 i++ i = encodeVarintLog(data, i, uint64(*m.Promised)) @@ -2941,12 +2385,14 @@ func (m *Record) Marshal() (data []byte, err error) { return data[:n], nil } -func (m *Record) MarshalTo(data []byte) (n int, err error) { +func (m *Record) MarshalTo(data []byte) (int, error) { var i int _ = i var l int _ = l - if m.Type != nil { + if m.Type == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("type") + } else { data[i] = 0x8 i++ i = encodeVarintLog(data, i, uint64(*m.Type)) @@ -2997,12 +2443,14 @@ func (m *PromiseRequest) Marshal() (data []byte, err error) { return data[:n], nil } -func (m *PromiseRequest) MarshalTo(data []byte) (n int, err error) { +func (m *PromiseRequest) MarshalTo(data []byte) (int, error) { var i int _ = i var l int _ = l - if m.Proposal != nil { + if m.Proposal == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("proposal") + } else { data[i] = 0x8 i++ i = encodeVarintLog(data, i, uint64(*m.Proposal)) @@ -3028,12 +2476,14 @@ func (m *PromiseResponse) Marshal() (data []byte, err error) { return data[:n], nil } -func (m *PromiseResponse) MarshalTo(data []byte) (n int, err error) { +func (m *PromiseResponse) MarshalTo(data []byte) (int, error) { var i int _ = i var l int _ = l - if m.Okay != nil { + if m.Okay == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("okay") + } else { data[i] = 0x8 i++ if *m.Okay { @@ -3043,16 +2493,13 @@ func (m *PromiseResponse) MarshalTo(data []byte) (n int, err error) { } i++ } - if m.Proposal != nil { + if m.Proposal == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("proposal") + } else { data[i] = 0x10 i++ i = encodeVarintLog(data, i, uint64(*m.Proposal)) } - if m.Position != nil { - data[i] = 0x20 - i++ - i = encodeVarintLog(data, i, uint64(*m.Position)) - } if m.Action != nil { data[i] = 0x1a i++ @@ -3063,6 +2510,11 @@ func (m *PromiseResponse) MarshalTo(data []byte) (n int, err error) { } i += n7 } + if m.Position != nil { + data[i] = 0x20 + i++ + i = encodeVarintLog(data, i, uint64(*m.Position)) + } if m.XXX_unrecognized != nil { i += copy(data[i:], m.XXX_unrecognized) } @@ -3079,17 +2531,21 @@ func (m *WriteRequest) Marshal() (data []byte, err error) { return data[:n], nil } -func (m *WriteRequest) MarshalTo(data []byte) (n int, err error) { +func (m *WriteRequest) MarshalTo(data []byte) (int, error) { var i int _ = i var l int _ = l - if m.Proposal != nil { + if m.Proposal == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("proposal") + } else { data[i] = 0x8 i++ i = encodeVarintLog(data, i, uint64(*m.Proposal)) } - if m.Position != nil { + if m.Position == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("position") + } else { data[i] = 0x10 i++ i = encodeVarintLog(data, i, uint64(*m.Position)) @@ -3104,7 +2560,9 @@ func (m *WriteRequest) MarshalTo(data []byte) (n int, err error) { } i++ } - if m.Type != nil { + if m.Type == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("type") + } else { data[i] = 0x20 i++ i = encodeVarintLog(data, i, uint64(*m.Type)) @@ -3155,12 +2613,14 @@ func (m *WriteResponse) Marshal() (data []byte, err error) { return data[:n], nil } -func (m *WriteResponse) MarshalTo(data []byte) (n int, err error) { +func (m *WriteResponse) MarshalTo(data []byte) (int, error) { var i int _ = i var l int _ = l - if m.Okay != nil { + if m.Okay == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("okay") + } else { data[i] = 0x8 i++ if *m.Okay { @@ -3170,12 +2630,16 @@ func (m *WriteResponse) MarshalTo(data []byte) (n int, err error) { } i++ } - if m.Proposal != nil { + if m.Proposal == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("proposal") + } else { data[i] = 0x10 i++ i = encodeVarintLog(data, i, uint64(*m.Proposal)) } - if m.Position != nil { + if m.Position == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("position") + } else { data[i] = 0x18 i++ i = encodeVarintLog(data, i, uint64(*m.Position)) @@ -3196,12 +2660,14 @@ func (m *LearnedMessage) Marshal() (data []byte, err error) { return data[:n], nil } -func (m *LearnedMessage) MarshalTo(data []byte) (n int, err error) { +func (m *LearnedMessage) MarshalTo(data []byte) (int, error) { var i int _ = i var l int _ = l - if m.Action != nil { + if m.Action == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("action") + } else { data[i] = 0xa i++ i = encodeVarintLog(data, i, uint64(m.Action.Size())) @@ -3227,7 +2693,7 @@ func (m *RecoverRequest) Marshal() (data []byte, err error) { return data[:n], nil } -func (m *RecoverRequest) MarshalTo(data []byte) (n int, err error) { +func (m *RecoverRequest) MarshalTo(data []byte) (int, error) { var i int _ = i var l int @@ -3248,12 +2714,14 @@ func (m *RecoverResponse) Marshal() (data []byte, err error) { return data[:n], nil } -func (m *RecoverResponse) MarshalTo(data []byte) (n int, err error) { +func (m *RecoverResponse) MarshalTo(data []byte) (int, error) { var i int _ = i var l int _ = l - if m.Status != nil { + if m.Status == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("status") + } else { data[i] = 0x8 i++ i = encodeVarintLog(data, i, uint64(*m.Status)) @@ -3301,1406 +2769,2378 @@ func encodeVarintLog(data []byte, offset int, v uint64) int { data[offset] = uint8(v) return offset + 1 } -func (this *Promise) GoString() string { - if this == nil { - return "nil" +func NewPopulatedPromise(r randyLog, easy bool) *Promise { + this := &Promise{} + v1 := uint64(uint64(r.Uint32())) + this.Proposal = &v1 + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedLog(r, 2) } - s := strings3.Join([]string{`&mesosproto.Promise{` + - `Proposal:` + valueToGoStringLog(this.Proposal, "uint64"), - `XXX_unrecognized:` + fmt6.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s + return this } -func (this *Action) GoString() string { - if this == nil { - return "nil" + +func NewPopulatedAction(r randyLog, easy bool) *Action { + this := &Action{} + v2 := uint64(uint64(r.Uint32())) + this.Position = &v2 + v3 := uint64(uint64(r.Uint32())) + this.Promised = &v3 + if r.Intn(10) != 0 { + v4 := uint64(uint64(r.Uint32())) + this.Performed = &v4 } - s := strings3.Join([]string{`&mesosproto.Action{` + - `Position:` + valueToGoStringLog(this.Position, "uint64"), - `Promised:` + valueToGoStringLog(this.Promised, "uint64"), - `Performed:` + valueToGoStringLog(this.Performed, "uint64"), - `Learned:` + valueToGoStringLog(this.Learned, "bool"), - `Type:` + valueToGoStringLog(this.Type, "mesosproto.Action_Type"), - `Nop:` + fmt6.Sprintf("%#v", this.Nop), - `Append:` + fmt6.Sprintf("%#v", this.Append), - `Truncate:` + fmt6.Sprintf("%#v", this.Truncate), - `XXX_unrecognized:` + fmt6.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s + if r.Intn(10) != 0 { + v5 := bool(bool(r.Intn(2) == 0)) + this.Learned = &v5 + } + if r.Intn(10) != 0 { + v6 := Action_Type([]int32{1, 2, 3}[r.Intn(3)]) + this.Type = &v6 + } + if r.Intn(10) != 0 { + this.Nop = NewPopulatedAction_Nop(r, easy) + } + if r.Intn(10) != 0 { + this.Append = NewPopulatedAction_Append(r, easy) + } + if r.Intn(10) != 0 { + this.Truncate = NewPopulatedAction_Truncate(r, easy) + } + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedLog(r, 9) + } + return this } -func (this *Action_Nop) GoString() string { - if this == nil { - return "nil" + +func NewPopulatedAction_Nop(r randyLog, easy bool) *Action_Nop { + this := &Action_Nop{} + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedLog(r, 1) } - s := strings3.Join([]string{`&mesosproto.Action_Nop{` + - `XXX_unrecognized:` + fmt6.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s + return this } -func (this *Action_Append) GoString() string { - if this == nil { - return "nil" + +func NewPopulatedAction_Append(r randyLog, easy bool) *Action_Append { + this := &Action_Append{} + v7 := r.Intn(100) + this.Bytes = make([]byte, v7) + for i := 0; i < v7; i++ { + this.Bytes[i] = byte(r.Intn(256)) } - s := strings3.Join([]string{`&mesosproto.Action_Append{` + - `Bytes:` + valueToGoStringLog(this.Bytes, "byte"), - `Cksum:` + valueToGoStringLog(this.Cksum, "byte"), - `XXX_unrecognized:` + fmt6.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s + if r.Intn(10) != 0 { + v8 := r.Intn(100) + this.Cksum = make([]byte, v8) + for i := 0; i < v8; i++ { + this.Cksum[i] = byte(r.Intn(256)) + } + } + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedLog(r, 3) + } + return this } -func (this *Action_Truncate) GoString() string { - if this == nil { - return "nil" + +func NewPopulatedAction_Truncate(r randyLog, easy bool) *Action_Truncate { + this := &Action_Truncate{} + v9 := uint64(uint64(r.Uint32())) + this.To = &v9 + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedLog(r, 2) } - s := strings3.Join([]string{`&mesosproto.Action_Truncate{` + - `To:` + valueToGoStringLog(this.To, "uint64"), - `XXX_unrecognized:` + fmt6.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s + return this } -func (this *Metadata) GoString() string { - if this == nil { - return "nil" + +func NewPopulatedMetadata(r randyLog, easy bool) *Metadata { + this := &Metadata{} + v10 := Metadata_Status([]int32{1, 2, 3, 4}[r.Intn(4)]) + this.Status = &v10 + v11 := uint64(uint64(r.Uint32())) + this.Promised = &v11 + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedLog(r, 3) } - s := strings3.Join([]string{`&mesosproto.Metadata{` + - `Status:` + valueToGoStringLog(this.Status, "mesosproto.Metadata_Status"), - `Promised:` + valueToGoStringLog(this.Promised, "uint64"), - `XXX_unrecognized:` + fmt6.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s + return this } -func (this *Record) GoString() string { - if this == nil { - return "nil" + +func NewPopulatedRecord(r randyLog, easy bool) *Record { + this := &Record{} + v12 := Record_Type([]int32{1, 2, 3}[r.Intn(3)]) + this.Type = &v12 + if r.Intn(10) != 0 { + this.Promise = NewPopulatedPromise(r, easy) } - s := strings3.Join([]string{`&mesosproto.Record{` + - `Type:` + valueToGoStringLog(this.Type, "mesosproto.Record_Type"), - `Promise:` + fmt6.Sprintf("%#v", this.Promise), - `Action:` + fmt6.Sprintf("%#v", this.Action), - `Metadata:` + fmt6.Sprintf("%#v", this.Metadata), - `XXX_unrecognized:` + fmt6.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s + if r.Intn(10) != 0 { + this.Action = NewPopulatedAction(r, easy) + } + if r.Intn(10) != 0 { + this.Metadata = NewPopulatedMetadata(r, easy) + } + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedLog(r, 5) + } + return this } -func (this *PromiseRequest) GoString() string { - if this == nil { - return "nil" + +func NewPopulatedPromiseRequest(r randyLog, easy bool) *PromiseRequest { + this := &PromiseRequest{} + v13 := uint64(uint64(r.Uint32())) + this.Proposal = &v13 + if r.Intn(10) != 0 { + v14 := uint64(uint64(r.Uint32())) + this.Position = &v14 } - s := strings3.Join([]string{`&mesosproto.PromiseRequest{` + - `Proposal:` + valueToGoStringLog(this.Proposal, "uint64"), - `Position:` + valueToGoStringLog(this.Position, "uint64"), - `XXX_unrecognized:` + fmt6.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedLog(r, 3) + } + return this } -func (this *PromiseResponse) GoString() string { - if this == nil { - return "nil" + +func NewPopulatedPromiseResponse(r randyLog, easy bool) *PromiseResponse { + this := &PromiseResponse{} + v15 := bool(bool(r.Intn(2) == 0)) + this.Okay = &v15 + v16 := uint64(uint64(r.Uint32())) + this.Proposal = &v16 + if r.Intn(10) != 0 { + this.Action = NewPopulatedAction(r, easy) + } + if r.Intn(10) != 0 { + v17 := uint64(uint64(r.Uint32())) + this.Position = &v17 + } + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedLog(r, 5) } - s := strings3.Join([]string{`&mesosproto.PromiseResponse{` + - `Okay:` + valueToGoStringLog(this.Okay, "bool"), - `Proposal:` + valueToGoStringLog(this.Proposal, "uint64"), - `Position:` + valueToGoStringLog(this.Position, "uint64"), - `Action:` + fmt6.Sprintf("%#v", this.Action), - `XXX_unrecognized:` + fmt6.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s + return this } -func (this *WriteRequest) GoString() string { - if this == nil { - return "nil" + +func NewPopulatedWriteRequest(r randyLog, easy bool) *WriteRequest { + this := &WriteRequest{} + v18 := uint64(uint64(r.Uint32())) + this.Proposal = &v18 + v19 := uint64(uint64(r.Uint32())) + this.Position = &v19 + if r.Intn(10) != 0 { + v20 := bool(bool(r.Intn(2) == 0)) + this.Learned = &v20 } - s := strings3.Join([]string{`&mesosproto.WriteRequest{` + - `Proposal:` + valueToGoStringLog(this.Proposal, "uint64"), - `Position:` + valueToGoStringLog(this.Position, "uint64"), - `Learned:` + valueToGoStringLog(this.Learned, "bool"), - `Type:` + valueToGoStringLog(this.Type, "mesosproto.Action_Type"), - `Nop:` + fmt6.Sprintf("%#v", this.Nop), - `Append:` + fmt6.Sprintf("%#v", this.Append), - `Truncate:` + fmt6.Sprintf("%#v", this.Truncate), - `XXX_unrecognized:` + fmt6.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s -} -func (this *WriteResponse) GoString() string { - if this == nil { - return "nil" + v21 := Action_Type([]int32{1, 2, 3}[r.Intn(3)]) + this.Type = &v21 + if r.Intn(10) != 0 { + this.Nop = NewPopulatedAction_Nop(r, easy) } - s := strings3.Join([]string{`&mesosproto.WriteResponse{` + - `Okay:` + valueToGoStringLog(this.Okay, "bool"), - `Proposal:` + valueToGoStringLog(this.Proposal, "uint64"), - `Position:` + valueToGoStringLog(this.Position, "uint64"), - `XXX_unrecognized:` + fmt6.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s -} -func (this *LearnedMessage) GoString() string { - if this == nil { - return "nil" + if r.Intn(10) != 0 { + this.Append = NewPopulatedAction_Append(r, easy) } - s := strings3.Join([]string{`&mesosproto.LearnedMessage{` + - `Action:` + fmt6.Sprintf("%#v", this.Action), - `XXX_unrecognized:` + fmt6.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s + if r.Intn(10) != 0 { + this.Truncate = NewPopulatedAction_Truncate(r, easy) + } + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedLog(r, 8) + } + return this } -func (this *RecoverRequest) GoString() string { - if this == nil { - return "nil" + +func NewPopulatedWriteResponse(r randyLog, easy bool) *WriteResponse { + this := &WriteResponse{} + v22 := bool(bool(r.Intn(2) == 0)) + this.Okay = &v22 + v23 := uint64(uint64(r.Uint32())) + this.Proposal = &v23 + v24 := uint64(uint64(r.Uint32())) + this.Position = &v24 + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedLog(r, 4) } - s := strings3.Join([]string{`&mesosproto.RecoverRequest{` + - `XXX_unrecognized:` + fmt6.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s + return this } -func (this *RecoverResponse) GoString() string { - if this == nil { - return "nil" + +func NewPopulatedLearnedMessage(r randyLog, easy bool) *LearnedMessage { + this := &LearnedMessage{} + this.Action = NewPopulatedAction(r, easy) + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedLog(r, 2) } - s := strings3.Join([]string{`&mesosproto.RecoverResponse{` + - `Status:` + valueToGoStringLog(this.Status, "mesosproto.Metadata_Status"), - `Begin:` + valueToGoStringLog(this.Begin, "uint64"), - `End:` + valueToGoStringLog(this.End, "uint64"), - `XXX_unrecognized:` + fmt6.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s + return this } -func valueToGoStringLog(v interface{}, typ string) string { - rv := reflect3.ValueOf(v) - if rv.IsNil() { - return "nil" + +func NewPopulatedRecoverRequest(r randyLog, easy bool) *RecoverRequest { + this := &RecoverRequest{} + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedLog(r, 1) } - pv := reflect3.Indirect(rv).Interface() - return fmt6.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) + return this } -func extensionToGoStringLog(e map[int32]github_com_gogo_protobuf_proto3.Extension) string { - if e == nil { - return "nil" + +func NewPopulatedRecoverResponse(r randyLog, easy bool) *RecoverResponse { + this := &RecoverResponse{} + v25 := Metadata_Status([]int32{1, 2, 3, 4}[r.Intn(4)]) + this.Status = &v25 + if r.Intn(10) != 0 { + v26 := uint64(uint64(r.Uint32())) + this.Begin = &v26 } - s := "map[int32]proto.Extension{" - keys := make([]int, 0, len(e)) - for k := range e { - keys = append(keys, int(k)) + if r.Intn(10) != 0 { + v27 := uint64(uint64(r.Uint32())) + this.End = &v27 } - sort1.Ints(keys) - ss := []string{} - for _, k := range keys { - ss = append(ss, strconv1.Itoa(k)+": "+e[int32(k)].GoString()) + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedLog(r, 4) } - s += strings3.Join(ss, ",") + "}" - return s + return this } -func (this *Promise) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt7.Errorf("that == nil && this != nil") - } - that1, ok := that.(*Promise) - if !ok { - return fmt7.Errorf("that is not of type *Promise") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt7.Errorf("that is type *Promise but is nil && this != nil") - } else if this == nil { - return fmt7.Errorf("that is type *Promisebut is not nil && this == nil") - } - if this.Proposal != nil && that1.Proposal != nil { - if *this.Proposal != *that1.Proposal { - return fmt7.Errorf("Proposal this(%v) Not Equal that(%v)", *this.Proposal, *that1.Proposal) - } - } else if this.Proposal != nil { - return fmt7.Errorf("this.Proposal == nil && that.Proposal != nil") - } else if that1.Proposal != nil { - return fmt7.Errorf("Proposal this(%v) Not Equal that(%v)", this.Proposal, that1.Proposal) +type randyLog interface { + Float32() float32 + Float64() float64 + Int63() int64 + Int31() int32 + Uint32() uint32 + Intn(n int) int +} + +func randUTF8RuneLog(r randyLog) rune { + ru := r.Intn(62) + if ru < 10 { + return rune(ru + 48) + } else if ru < 36 { + return rune(ru + 55) } - if !bytes1.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt7.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + return rune(ru + 61) +} +func randStringLog(r randyLog) string { + v28 := r.Intn(100) + tmps := make([]rune, v28) + for i := 0; i < v28; i++ { + tmps[i] = randUTF8RuneLog(r) } - return nil + return string(tmps) } -func (this *Promise) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true +func randUnrecognizedLog(r randyLog, maxFieldNumber int) (data []byte) { + l := r.Intn(5) + for i := 0; i < l; i++ { + wire := r.Intn(4) + if wire == 3 { + wire = 5 } - return false - } - - that1, ok := that.(*Promise) - if !ok { - return false + fieldNumber := maxFieldNumber + r.Intn(100) + data = randFieldLog(data, r, fieldNumber, wire) } - if that1 == nil { - if this == nil { - return true + return data +} +func randFieldLog(data []byte, r randyLog, fieldNumber int, wire int) []byte { + key := uint32(fieldNumber)<<3 | uint32(wire) + switch wire { + case 0: + data = encodeVarintPopulateLog(data, uint64(key)) + v29 := r.Int63() + if r.Intn(2) == 0 { + v29 *= -1 } - return false - } else if this == nil { - return false - } - if this.Proposal != nil && that1.Proposal != nil { - if *this.Proposal != *that1.Proposal { - return false + data = encodeVarintPopulateLog(data, uint64(v29)) + case 1: + data = encodeVarintPopulateLog(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 = encodeVarintPopulateLog(data, uint64(key)) + ll := r.Intn(100) + data = encodeVarintPopulateLog(data, uint64(ll)) + for j := 0; j < ll; j++ { + data = append(data, byte(r.Intn(256))) } - } else if this.Proposal != nil { - return false - } else if that1.Proposal != nil { - return false - } - if !bytes1.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false + default: + data = encodeVarintPopulateLog(data, uint64(key)) + data = append(data, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) } - return true + return data } -func (this *Action) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt7.Errorf("that == nil && this != nil") +func encodeVarintPopulateLog(data []byte, v uint64) []byte { + for v >= 1<<7 { + data = append(data, uint8(uint64(v)&0x7f|0x80)) + v >>= 7 } - - that1, ok := that.(*Action) - if !ok { - return fmt7.Errorf("that is not of type *Action") + data = append(data, uint8(v)) + return data +} +func (m *Promise) Size() (n int) { + var l int + _ = l + if m.Proposal != nil { + n += 1 + sovLog(uint64(*m.Proposal)) } - if that1 == nil { - if this == nil { - return nil - } - return fmt7.Errorf("that is type *Action but is nil && this != nil") - } else if this == nil { - return fmt7.Errorf("that is type *Actionbut is not nil && this == nil") + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - if this.Position != nil && that1.Position != nil { - if *this.Position != *that1.Position { - return fmt7.Errorf("Position this(%v) Not Equal that(%v)", *this.Position, *that1.Position) - } - } else if this.Position != nil { - return fmt7.Errorf("this.Position == nil && that.Position != nil") - } else if that1.Position != nil { - return fmt7.Errorf("Position this(%v) Not Equal that(%v)", this.Position, that1.Position) + return n +} + +func (m *Action) Size() (n int) { + var l int + _ = l + if m.Position != nil { + n += 1 + sovLog(uint64(*m.Position)) } - if this.Promised != nil && that1.Promised != nil { - if *this.Promised != *that1.Promised { - return fmt7.Errorf("Promised this(%v) Not Equal that(%v)", *this.Promised, *that1.Promised) - } - } else if this.Promised != nil { - return fmt7.Errorf("this.Promised == nil && that.Promised != nil") - } else if that1.Promised != nil { - return fmt7.Errorf("Promised this(%v) Not Equal that(%v)", this.Promised, that1.Promised) + if m.Promised != nil { + n += 1 + sovLog(uint64(*m.Promised)) } - if this.Performed != nil && that1.Performed != nil { - if *this.Performed != *that1.Performed { - return fmt7.Errorf("Performed this(%v) Not Equal that(%v)", *this.Performed, *that1.Performed) - } - } else if this.Performed != nil { - return fmt7.Errorf("this.Performed == nil && that.Performed != nil") - } else if that1.Performed != nil { - return fmt7.Errorf("Performed this(%v) Not Equal that(%v)", this.Performed, that1.Performed) + if m.Performed != nil { + n += 1 + sovLog(uint64(*m.Performed)) } - if this.Learned != nil && that1.Learned != nil { - if *this.Learned != *that1.Learned { - return fmt7.Errorf("Learned this(%v) Not Equal that(%v)", *this.Learned, *that1.Learned) - } - } else if this.Learned != nil { - return fmt7.Errorf("this.Learned == nil && that.Learned != nil") - } else if that1.Learned != nil { - return fmt7.Errorf("Learned this(%v) Not Equal that(%v)", this.Learned, that1.Learned) + if m.Learned != nil { + n += 2 } - if this.Type != nil && that1.Type != nil { - if *this.Type != *that1.Type { - return fmt7.Errorf("Type this(%v) Not Equal that(%v)", *this.Type, *that1.Type) - } - } else if this.Type != nil { - return fmt7.Errorf("this.Type == nil && that.Type != nil") - } else if that1.Type != nil { - return fmt7.Errorf("Type this(%v) Not Equal that(%v)", this.Type, that1.Type) + if m.Type != nil { + n += 1 + sovLog(uint64(*m.Type)) } - if !this.Nop.Equal(that1.Nop) { - return fmt7.Errorf("Nop this(%v) Not Equal that(%v)", this.Nop, that1.Nop) + if m.Nop != nil { + l = m.Nop.Size() + n += 1 + l + sovLog(uint64(l)) } - if !this.Append.Equal(that1.Append) { - return fmt7.Errorf("Append this(%v) Not Equal that(%v)", this.Append, that1.Append) + if m.Append != nil { + l = m.Append.Size() + n += 1 + l + sovLog(uint64(l)) } - if !this.Truncate.Equal(that1.Truncate) { - return fmt7.Errorf("Truncate this(%v) Not Equal that(%v)", this.Truncate, that1.Truncate) + if m.Truncate != nil { + l = m.Truncate.Size() + n += 1 + l + sovLog(uint64(l)) } - if !bytes1.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt7.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - return nil + return n } -func (this *Action) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - that1, ok := that.(*Action) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if this.Position != nil && that1.Position != nil { - if *this.Position != *that1.Position { - return false - } - } else if this.Position != nil { - return false - } else if that1.Position != nil { - return false +func (m *Action_Nop) Size() (n int) { + var l int + _ = l + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - if this.Promised != nil && that1.Promised != nil { - if *this.Promised != *that1.Promised { - return false - } - } else if this.Promised != nil { - return false - } else if that1.Promised != nil { - return false + return n +} + +func (m *Action_Append) Size() (n int) { + var l int + _ = l + if m.Bytes != nil { + l = len(m.Bytes) + n += 1 + l + sovLog(uint64(l)) } - if this.Performed != nil && that1.Performed != nil { - if *this.Performed != *that1.Performed { - return false - } - } else if this.Performed != nil { - return false - } else if that1.Performed != nil { - return false + if m.Cksum != nil { + l = len(m.Cksum) + n += 1 + l + sovLog(uint64(l)) } - if this.Learned != nil && that1.Learned != nil { - if *this.Learned != *that1.Learned { - return false - } - } else if this.Learned != nil { - return false - } else if that1.Learned != nil { - return false + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - if this.Type != nil && that1.Type != nil { - if *this.Type != *that1.Type { - return false - } - } else if this.Type != nil { - return false - } else if that1.Type != nil { - return false + return n +} + +func (m *Action_Truncate) Size() (n int) { + var l int + _ = l + if m.To != nil { + n += 1 + sovLog(uint64(*m.To)) } - if !this.Nop.Equal(that1.Nop) { - return false + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - if !this.Append.Equal(that1.Append) { - return false + return n +} + +func (m *Metadata) Size() (n int) { + var l int + _ = l + if m.Status != nil { + n += 1 + sovLog(uint64(*m.Status)) } - if !this.Truncate.Equal(that1.Truncate) { - return false + if m.Promised != nil { + n += 1 + sovLog(uint64(*m.Promised)) } - if !bytes1.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - return true + return n } -func (this *Action_Nop) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt7.Errorf("that == nil && this != nil") - } - that1, ok := that.(*Action_Nop) - if !ok { - return fmt7.Errorf("that is not of type *Action_Nop") +func (m *Record) Size() (n int) { + var l int + _ = l + if m.Type != nil { + n += 1 + sovLog(uint64(*m.Type)) } - if that1 == nil { - if this == nil { - return nil - } - return fmt7.Errorf("that is type *Action_Nop but is nil && this != nil") - } else if this == nil { - return fmt7.Errorf("that is type *Action_Nopbut is not nil && this == nil") + if m.Promise != nil { + l = m.Promise.Size() + n += 1 + l + sovLog(uint64(l)) } - if !bytes1.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt7.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + if m.Action != nil { + l = m.Action.Size() + n += 1 + l + sovLog(uint64(l)) } - return nil -} -func (this *Action_Nop) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false + if m.Metadata != nil { + l = m.Metadata.Size() + n += 1 + l + sovLog(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } + return n +} - that1, ok := that.(*Action_Nop) - if !ok { - return false +func (m *PromiseRequest) Size() (n int) { + var l int + _ = l + if m.Proposal != nil { + n += 1 + sovLog(uint64(*m.Proposal)) } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false + if m.Position != nil { + n += 1 + sovLog(uint64(*m.Position)) } - if !bytes1.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - return true + return n } -func (this *Action_Append) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt7.Errorf("that == nil && this != nil") - } - that1, ok := that.(*Action_Append) - if !ok { - return fmt7.Errorf("that is not of type *Action_Append") +func (m *PromiseResponse) Size() (n int) { + var l int + _ = l + if m.Okay != nil { + n += 2 } - if that1 == nil { - if this == nil { - return nil - } - return fmt7.Errorf("that is type *Action_Append but is nil && this != nil") - } else if this == nil { - return fmt7.Errorf("that is type *Action_Appendbut is not nil && this == nil") + if m.Proposal != nil { + n += 1 + sovLog(uint64(*m.Proposal)) } - if !bytes1.Equal(this.Bytes, that1.Bytes) { - return fmt7.Errorf("Bytes this(%v) Not Equal that(%v)", this.Bytes, that1.Bytes) + if m.Action != nil { + l = m.Action.Size() + n += 1 + l + sovLog(uint64(l)) } - if !bytes1.Equal(this.Cksum, that1.Cksum) { - return fmt7.Errorf("Cksum this(%v) Not Equal that(%v)", this.Cksum, that1.Cksum) + if m.Position != nil { + n += 1 + sovLog(uint64(*m.Position)) } - if !bytes1.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt7.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - return nil + return n } -func (this *Action_Append) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - that1, ok := that.(*Action_Append) - if !ok { - return false +func (m *WriteRequest) Size() (n int) { + var l int + _ = l + if m.Proposal != nil { + n += 1 + sovLog(uint64(*m.Proposal)) } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false + if m.Position != nil { + n += 1 + sovLog(uint64(*m.Position)) } - if !bytes1.Equal(this.Bytes, that1.Bytes) { - return false + if m.Learned != nil { + n += 2 } - if !bytes1.Equal(this.Cksum, that1.Cksum) { - return false + if m.Type != nil { + n += 1 + sovLog(uint64(*m.Type)) + } + if m.Nop != nil { + l = m.Nop.Size() + n += 1 + l + sovLog(uint64(l)) + } + if m.Append != nil { + l = m.Append.Size() + n += 1 + l + sovLog(uint64(l)) + } + if m.Truncate != nil { + l = m.Truncate.Size() + n += 1 + l + sovLog(uint64(l)) } - if !bytes1.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - return true + return n } -func (this *Action_Truncate) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt7.Errorf("that == nil && this != nil") - } - that1, ok := that.(*Action_Truncate) - if !ok { - return fmt7.Errorf("that is not of type *Action_Truncate") +func (m *WriteResponse) Size() (n int) { + var l int + _ = l + if m.Okay != nil { + n += 2 } - if that1 == nil { - if this == nil { - return nil - } - return fmt7.Errorf("that is type *Action_Truncate but is nil && this != nil") - } else if this == nil { - return fmt7.Errorf("that is type *Action_Truncatebut is not nil && this == nil") + if m.Proposal != nil { + n += 1 + sovLog(uint64(*m.Proposal)) } - if this.To != nil && that1.To != nil { - if *this.To != *that1.To { - return fmt7.Errorf("To this(%v) Not Equal that(%v)", *this.To, *that1.To) - } - } else if this.To != nil { - return fmt7.Errorf("this.To == nil && that.To != nil") - } else if that1.To != nil { - return fmt7.Errorf("To this(%v) Not Equal that(%v)", this.To, that1.To) + if m.Position != nil { + n += 1 + sovLog(uint64(*m.Position)) } - if !bytes1.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt7.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - return nil + return n } -func (this *Action_Truncate) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false + +func (m *LearnedMessage) Size() (n int) { + var l int + _ = l + if m.Action != nil { + l = m.Action.Size() + n += 1 + l + sovLog(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } + return n +} - that1, ok := that.(*Action_Truncate) - if !ok { - return false +func (m *RecoverRequest) Size() (n int) { + var l int + _ = l + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false + return n +} + +func (m *RecoverResponse) Size() (n int) { + var l int + _ = l + if m.Status != nil { + n += 1 + sovLog(uint64(*m.Status)) } - if this.To != nil && that1.To != nil { - if *this.To != *that1.To { - return false - } - } else if this.To != nil { - return false - } else if that1.To != nil { - return false + if m.Begin != nil { + n += 1 + sovLog(uint64(*m.Begin)) } - if !bytes1.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false + if m.End != nil { + n += 1 + sovLog(uint64(*m.End)) } - return true + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n } -func (this *Metadata) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil + +func sovLog(x uint64) (n int) { + for { + n++ + x >>= 7 + if x == 0 { + break } - return fmt7.Errorf("that == nil && this != nil") } - - that1, ok := that.(*Metadata) - if !ok { - return fmt7.Errorf("that is not of type *Metadata") + return n +} +func sozLog(x uint64) (n int) { + return sovLog(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (this *Promise) String() string { + if this == nil { + return "nil" } - if that1 == nil { - if this == nil { - return nil - } - return fmt7.Errorf("that is type *Metadata but is nil && this != nil") - } else if this == nil { - return fmt7.Errorf("that is type *Metadatabut is not nil && this == nil") + s := strings.Join([]string{`&Promise{`, + `Proposal:` + valueToStringLog(this.Proposal) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *Action) String() string { + if this == nil { + return "nil" } - if this.Status != nil && that1.Status != nil { - if *this.Status != *that1.Status { - return fmt7.Errorf("Status this(%v) Not Equal that(%v)", *this.Status, *that1.Status) - } - } else if this.Status != nil { - return fmt7.Errorf("this.Status == nil && that.Status != nil") - } else if that1.Status != nil { - return fmt7.Errorf("Status this(%v) Not Equal that(%v)", this.Status, that1.Status) + s := strings.Join([]string{`&Action{`, + `Position:` + valueToStringLog(this.Position) + `,`, + `Promised:` + valueToStringLog(this.Promised) + `,`, + `Performed:` + valueToStringLog(this.Performed) + `,`, + `Learned:` + valueToStringLog(this.Learned) + `,`, + `Type:` + valueToStringLog(this.Type) + `,`, + `Nop:` + strings.Replace(fmt.Sprintf("%v", this.Nop), "Action_Nop", "Action_Nop", 1) + `,`, + `Append:` + strings.Replace(fmt.Sprintf("%v", this.Append), "Action_Append", "Action_Append", 1) + `,`, + `Truncate:` + strings.Replace(fmt.Sprintf("%v", this.Truncate), "Action_Truncate", "Action_Truncate", 1) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *Action_Nop) String() string { + if this == nil { + return "nil" } - if this.Promised != nil && that1.Promised != nil { - if *this.Promised != *that1.Promised { - return fmt7.Errorf("Promised this(%v) Not Equal that(%v)", *this.Promised, *that1.Promised) - } - } else if this.Promised != nil { - return fmt7.Errorf("this.Promised == nil && that.Promised != nil") - } else if that1.Promised != nil { - return fmt7.Errorf("Promised this(%v) Not Equal that(%v)", this.Promised, that1.Promised) + s := strings.Join([]string{`&Action_Nop{`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *Action_Append) String() string { + if this == nil { + return "nil" } - if !bytes1.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt7.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + s := strings.Join([]string{`&Action_Append{`, + `Bytes:` + valueToStringLog(this.Bytes) + `,`, + `Cksum:` + valueToStringLog(this.Cksum) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *Action_Truncate) String() string { + if this == nil { + return "nil" } - return nil + s := strings.Join([]string{`&Action_Truncate{`, + `To:` + valueToStringLog(this.To) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s } -func (this *Metadata) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false +func (this *Metadata) String() string { + if this == nil { + return "nil" } - - that1, ok := that.(*Metadata) - if !ok { - return false + s := strings.Join([]string{`&Metadata{`, + `Status:` + valueToStringLog(this.Status) + `,`, + `Promised:` + valueToStringLog(this.Promised) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *Record) String() string { + if this == nil { + return "nil" } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false + s := strings.Join([]string{`&Record{`, + `Type:` + valueToStringLog(this.Type) + `,`, + `Promise:` + strings.Replace(fmt.Sprintf("%v", this.Promise), "Promise", "Promise", 1) + `,`, + `Action:` + strings.Replace(fmt.Sprintf("%v", this.Action), "Action", "Action", 1) + `,`, + `Metadata:` + strings.Replace(fmt.Sprintf("%v", this.Metadata), "Metadata", "Metadata", 1) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *PromiseRequest) String() string { + if this == nil { + return "nil" } - if this.Status != nil && that1.Status != nil { - if *this.Status != *that1.Status { - return false - } - } else if this.Status != nil { - return false - } else if that1.Status != nil { - return false + s := strings.Join([]string{`&PromiseRequest{`, + `Proposal:` + valueToStringLog(this.Proposal) + `,`, + `Position:` + valueToStringLog(this.Position) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *PromiseResponse) String() string { + if this == nil { + return "nil" } - if this.Promised != nil && that1.Promised != nil { - if *this.Promised != *that1.Promised { - return false - } - } else if this.Promised != nil { - return false - } else if that1.Promised != nil { - return false + s := strings.Join([]string{`&PromiseResponse{`, + `Okay:` + valueToStringLog(this.Okay) + `,`, + `Proposal:` + valueToStringLog(this.Proposal) + `,`, + `Action:` + strings.Replace(fmt.Sprintf("%v", this.Action), "Action", "Action", 1) + `,`, + `Position:` + valueToStringLog(this.Position) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *WriteRequest) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&WriteRequest{`, + `Proposal:` + valueToStringLog(this.Proposal) + `,`, + `Position:` + valueToStringLog(this.Position) + `,`, + `Learned:` + valueToStringLog(this.Learned) + `,`, + `Type:` + valueToStringLog(this.Type) + `,`, + `Nop:` + strings.Replace(fmt.Sprintf("%v", this.Nop), "Action_Nop", "Action_Nop", 1) + `,`, + `Append:` + strings.Replace(fmt.Sprintf("%v", this.Append), "Action_Append", "Action_Append", 1) + `,`, + `Truncate:` + strings.Replace(fmt.Sprintf("%v", this.Truncate), "Action_Truncate", "Action_Truncate", 1) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *WriteResponse) String() string { + if this == nil { + return "nil" } - if !bytes1.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false + s := strings.Join([]string{`&WriteResponse{`, + `Okay:` + valueToStringLog(this.Okay) + `,`, + `Proposal:` + valueToStringLog(this.Proposal) + `,`, + `Position:` + valueToStringLog(this.Position) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *LearnedMessage) String() string { + if this == nil { + return "nil" } - return true + s := strings.Join([]string{`&LearnedMessage{`, + `Action:` + strings.Replace(fmt.Sprintf("%v", this.Action), "Action", "Action", 1) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s } -func (this *Record) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt7.Errorf("that == nil && this != nil") +func (this *RecoverRequest) String() string { + if this == nil { + return "nil" } - - that1, ok := that.(*Record) - if !ok { - return fmt7.Errorf("that is not of type *Record") + s := strings.Join([]string{`&RecoverRequest{`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *RecoverResponse) String() string { + if this == nil { + return "nil" } - if that1 == nil { - if this == nil { - return nil - } - return fmt7.Errorf("that is type *Record but is nil && this != nil") - } else if this == nil { - return fmt7.Errorf("that is type *Recordbut is not nil && this == nil") + s := strings.Join([]string{`&RecoverResponse{`, + `Status:` + valueToStringLog(this.Status) + `,`, + `Begin:` + valueToStringLog(this.Begin) + `,`, + `End:` + valueToStringLog(this.End) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func valueToStringLog(v interface{}) string { + rv := reflect.ValueOf(v) + if rv.IsNil() { + return "nil" } - if this.Type != nil && that1.Type != nil { - if *this.Type != *that1.Type { - return fmt7.Errorf("Type this(%v) Not Equal that(%v)", *this.Type, *that1.Type) + pv := reflect.Indirect(rv).Interface() + return fmt.Sprintf("*%v", pv) +} +func (m *Promise) Unmarshal(data []byte) error { + var hasFields [1]uint64 + 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 != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Proposal", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Proposal = &v + hasFields[0] |= uint64(0x00000001) + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipLog(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthLog + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - } else if this.Type != nil { - return fmt7.Errorf("this.Type == nil && that.Type != nil") - } else if that1.Type != nil { - return fmt7.Errorf("Type this(%v) Not Equal that(%v)", this.Type, that1.Type) - } - if !this.Promise.Equal(that1.Promise) { - return fmt7.Errorf("Promise this(%v) Not Equal that(%v)", this.Promise, that1.Promise) - } - if !this.Action.Equal(that1.Action) { - return fmt7.Errorf("Action this(%v) Not Equal that(%v)", this.Action, that1.Action) - } - if !this.Metadata.Equal(that1.Metadata) { - return fmt7.Errorf("Metadata this(%v) Not Equal that(%v)", this.Metadata, that1.Metadata) } - if !bytes1.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt7.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("proposal") } + return nil } -func (this *Record) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*Record) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true +func (m *Action) Unmarshal(data []byte) error { + var hasFields [1]uint64 + 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 + } } - return false - } else if this == nil { - return false - } - if this.Type != nil && that1.Type != nil { - if *this.Type != *that1.Type { - return false + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Position", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Position = &v + hasFields[0] |= uint64(0x00000001) + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Promised", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Promised = &v + hasFields[0] |= uint64(0x00000002) + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Performed", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Performed = &v + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Learned", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + b := bool(v != 0) + m.Learned = &b + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + var v Action_Type + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (Action_Type(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Type = &v + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Nop", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthLog + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Nop == nil { + m.Nop = &Action_Nop{} + } + if err := m.Nop.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Append", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthLog + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Append == nil { + m.Append = &Action_Append{} + } + if err := m.Append.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Truncate", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthLog + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Truncate == nil { + m.Truncate = &Action_Truncate{} + } + if err := m.Truncate.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipLog(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthLog + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - } else if this.Type != nil { - return false - } else if that1.Type != nil { - return false - } - if !this.Promise.Equal(that1.Promise) { - return false - } - if !this.Action.Equal(that1.Action) { - return false - } - if !this.Metadata.Equal(that1.Metadata) { - return false } - if !bytes1.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("position") } - return true -} -func (this *PromiseRequest) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt7.Errorf("that == nil && this != nil") + if hasFields[0]&uint64(0x00000002) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("promised") } - that1, ok := that.(*PromiseRequest) - if !ok { - return fmt7.Errorf("that is not of type *PromiseRequest") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt7.Errorf("that is type *PromiseRequest but is nil && this != nil") - } else if this == nil { - return fmt7.Errorf("that is type *PromiseRequestbut is not nil && this == nil") - } - if this.Proposal != nil && that1.Proposal != nil { - if *this.Proposal != *that1.Proposal { - return fmt7.Errorf("Proposal this(%v) Not Equal that(%v)", *this.Proposal, *that1.Proposal) - } - } else if this.Proposal != nil { - return fmt7.Errorf("this.Proposal == nil && that.Proposal != nil") - } else if that1.Proposal != nil { - return fmt7.Errorf("Proposal this(%v) Not Equal that(%v)", this.Proposal, that1.Proposal) - } - if this.Position != nil && that1.Position != nil { - if *this.Position != *that1.Position { - return fmt7.Errorf("Position this(%v) Not Equal that(%v)", *this.Position, *that1.Position) - } - } else if this.Position != nil { - return fmt7.Errorf("this.Position == nil && that.Position != nil") - } else if that1.Position != nil { - return fmt7.Errorf("Position this(%v) Not Equal that(%v)", this.Position, that1.Position) - } - if !bytes1.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt7.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } return nil } -func (this *PromiseRequest) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*PromiseRequest) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if this.Proposal != nil && that1.Proposal != nil { - if *this.Proposal != *that1.Proposal { - return false - } - } else if this.Proposal != nil { - return false - } else if that1.Proposal != nil { - return false - } - if this.Position != nil && that1.Position != nil { - if *this.Position != *that1.Position { - return false +func (m *Action_Nop) 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 + } } - } else if this.Position != nil { - return false - } else if that1.Position != nil { - return false - } - if !bytes1.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *PromiseResponse) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil + fieldNum := int32(wire >> 3) + switch fieldNum { + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipLog(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthLog + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - return fmt7.Errorf("that == nil && this != nil") } - that1, ok := that.(*PromiseResponse) - if !ok { - return fmt7.Errorf("that is not of type *PromiseResponse") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt7.Errorf("that is type *PromiseResponse but is nil && this != nil") - } else if this == nil { - return fmt7.Errorf("that is type *PromiseResponsebut is not nil && this == nil") - } - if this.Okay != nil && that1.Okay != nil { - if *this.Okay != *that1.Okay { - return fmt7.Errorf("Okay this(%v) Not Equal that(%v)", *this.Okay, *that1.Okay) - } - } else if this.Okay != nil { - return fmt7.Errorf("this.Okay == nil && that.Okay != nil") - } else if that1.Okay != nil { - return fmt7.Errorf("Okay this(%v) Not Equal that(%v)", this.Okay, that1.Okay) - } - if this.Proposal != nil && that1.Proposal != nil { - if *this.Proposal != *that1.Proposal { - return fmt7.Errorf("Proposal this(%v) Not Equal that(%v)", *this.Proposal, *that1.Proposal) - } - } else if this.Proposal != nil { - return fmt7.Errorf("this.Proposal == nil && that.Proposal != nil") - } else if that1.Proposal != nil { - return fmt7.Errorf("Proposal this(%v) Not Equal that(%v)", this.Proposal, that1.Proposal) - } - if this.Position != nil && that1.Position != nil { - if *this.Position != *that1.Position { - return fmt7.Errorf("Position this(%v) Not Equal that(%v)", *this.Position, *that1.Position) - } - } else if this.Position != nil { - return fmt7.Errorf("this.Position == nil && that.Position != nil") - } else if that1.Position != nil { - return fmt7.Errorf("Position this(%v) Not Equal that(%v)", this.Position, that1.Position) - } - if !this.Action.Equal(that1.Action) { - return fmt7.Errorf("Action this(%v) Not Equal that(%v)", this.Action, that1.Action) - } - if !bytes1.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt7.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } return nil } -func (this *PromiseResponse) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*PromiseResponse) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if this.Okay != nil && that1.Okay != nil { - if *this.Okay != *that1.Okay { - return false - } - } else if this.Okay != nil { - return false - } else if that1.Okay != nil { - return false - } - if this.Proposal != nil && that1.Proposal != nil { - if *this.Proposal != *that1.Proposal { - return false - } - } else if this.Proposal != nil { - return false - } else if that1.Proposal != nil { - return false - } - if this.Position != nil && that1.Position != nil { - if *this.Position != *that1.Position { - return false - } - } else if this.Position != nil { - return false - } else if that1.Position != nil { - return false - } - if !this.Action.Equal(that1.Action) { - return false - } - if !bytes1.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *WriteRequest) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt7.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*WriteRequest) - if !ok { - return fmt7.Errorf("that is not of type *WriteRequest") - } - if that1 == nil { - if this == nil { - return nil +func (m *Action_Append) Unmarshal(data []byte) error { + var hasFields [1]uint64 + 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 + } } - return fmt7.Errorf("that is type *WriteRequest but is nil && this != nil") - } else if this == nil { - return fmt7.Errorf("that is type *WriteRequestbut is not nil && this == nil") - } - if this.Proposal != nil && that1.Proposal != nil { - if *this.Proposal != *that1.Proposal { - return fmt7.Errorf("Proposal this(%v) Not Equal that(%v)", *this.Proposal, *that1.Proposal) + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Bytes", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + byteLen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthLog + } + postIndex := iNdEx + byteLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Bytes = append([]byte{}, data[iNdEx:postIndex]...) + iNdEx = postIndex + hasFields[0] |= uint64(0x00000001) + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Cksum", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + byteLen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthLog + } + postIndex := iNdEx + byteLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Cksum = append([]byte{}, data[iNdEx:postIndex]...) + iNdEx = postIndex + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipLog(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthLog + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - } else if this.Proposal != nil { - return fmt7.Errorf("this.Proposal == nil && that.Proposal != nil") - } else if that1.Proposal != nil { - return fmt7.Errorf("Proposal this(%v) Not Equal that(%v)", this.Proposal, that1.Proposal) } - if this.Position != nil && that1.Position != nil { - if *this.Position != *that1.Position { - return fmt7.Errorf("Position this(%v) Not Equal that(%v)", *this.Position, *that1.Position) - } - } else if this.Position != nil { - return fmt7.Errorf("this.Position == nil && that.Position != nil") - } else if that1.Position != nil { - return fmt7.Errorf("Position this(%v) Not Equal that(%v)", this.Position, that1.Position) + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("bytes") } - if this.Learned != nil && that1.Learned != nil { - if *this.Learned != *that1.Learned { - return fmt7.Errorf("Learned this(%v) Not Equal that(%v)", *this.Learned, *that1.Learned) + + return nil +} +func (m *Action_Truncate) Unmarshal(data []byte) error { + var hasFields [1]uint64 + 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 + } } - } else if this.Learned != nil { - return fmt7.Errorf("this.Learned == nil && that.Learned != nil") - } else if that1.Learned != nil { - return fmt7.Errorf("Learned this(%v) Not Equal that(%v)", this.Learned, that1.Learned) - } - if this.Type != nil && that1.Type != nil { - if *this.Type != *that1.Type { - return fmt7.Errorf("Type this(%v) Not Equal that(%v)", *this.Type, *that1.Type) + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field To", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.To = &v + hasFields[0] |= uint64(0x00000001) + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipLog(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthLog + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - } else if this.Type != nil { - return fmt7.Errorf("this.Type == nil && that.Type != nil") - } else if that1.Type != nil { - return fmt7.Errorf("Type this(%v) Not Equal that(%v)", this.Type, that1.Type) } - if !this.Nop.Equal(that1.Nop) { - return fmt7.Errorf("Nop this(%v) Not Equal that(%v)", this.Nop, that1.Nop) - } - if !this.Append.Equal(that1.Append) { - return fmt7.Errorf("Append this(%v) Not Equal that(%v)", this.Append, that1.Append) - } - if !this.Truncate.Equal(that1.Truncate) { - return fmt7.Errorf("Truncate this(%v) Not Equal that(%v)", this.Truncate, that1.Truncate) - } - if !bytes1.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt7.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("to") } + return nil } -func (this *WriteRequest) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true +func (m *Metadata) Unmarshal(data []byte) error { + var hasFields [1]uint64 + 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 + } } - return false - } - - that1, ok := that.(*WriteRequest) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + var v Metadata_Status + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (Metadata_Status(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Status = &v + hasFields[0] |= uint64(0x00000001) + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Promised", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Promised = &v + hasFields[0] |= uint64(0x00000002) + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipLog(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthLog + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - return false - } else if this == nil { - return false } - if this.Proposal != nil && that1.Proposal != nil { - if *this.Proposal != *that1.Proposal { - return false - } - } else if this.Proposal != nil { - return false - } else if that1.Proposal != nil { - return false + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("status") } - if this.Position != nil && that1.Position != nil { - if *this.Position != *that1.Position { - return false - } - } else if this.Position != nil { - return false - } else if that1.Position != nil { - return false + if hasFields[0]&uint64(0x00000002) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("promised") } - if this.Learned != nil && that1.Learned != nil { - if *this.Learned != *that1.Learned { - return false + + return nil +} +func (m *Record) Unmarshal(data []byte) error { + var hasFields [1]uint64 + 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 + } } - } else if this.Learned != nil { - return false - } else if that1.Learned != nil { - return false - } - if this.Type != nil && that1.Type != nil { - if *this.Type != *that1.Type { - return false + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + var v Record_Type + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (Record_Type(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Type = &v + hasFields[0] |= uint64(0x00000001) + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Promise", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthLog + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Promise == nil { + m.Promise = &Promise{} + } + if err := m.Promise.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Action", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthLog + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Action == nil { + m.Action = &Action{} + } + if err := m.Action.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthLog + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Metadata == nil { + m.Metadata = &Metadata{} + } + if err := m.Metadata.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipLog(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthLog + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - } else if this.Type != nil { - return false - } else if that1.Type != nil { - return false - } - if !this.Nop.Equal(that1.Nop) { - return false - } - if !this.Append.Equal(that1.Append) { - return false - } - if !this.Truncate.Equal(that1.Truncate) { - return false } - if !bytes1.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *WriteResponse) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt7.Errorf("that == nil && this != nil") + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("type") } - that1, ok := that.(*WriteResponse) - if !ok { - return fmt7.Errorf("that is not of type *WriteResponse") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt7.Errorf("that is type *WriteResponse but is nil && this != nil") - } else if this == nil { - return fmt7.Errorf("that is type *WriteResponsebut is not nil && this == nil") - } - if this.Okay != nil && that1.Okay != nil { - if *this.Okay != *that1.Okay { - return fmt7.Errorf("Okay this(%v) Not Equal that(%v)", *this.Okay, *that1.Okay) - } - } else if this.Okay != nil { - return fmt7.Errorf("this.Okay == nil && that.Okay != nil") - } else if that1.Okay != nil { - return fmt7.Errorf("Okay this(%v) Not Equal that(%v)", this.Okay, that1.Okay) - } - if this.Proposal != nil && that1.Proposal != nil { - if *this.Proposal != *that1.Proposal { - return fmt7.Errorf("Proposal this(%v) Not Equal that(%v)", *this.Proposal, *that1.Proposal) - } - } else if this.Proposal != nil { - return fmt7.Errorf("this.Proposal == nil && that.Proposal != nil") - } else if that1.Proposal != nil { - return fmt7.Errorf("Proposal this(%v) Not Equal that(%v)", this.Proposal, that1.Proposal) - } - if this.Position != nil && that1.Position != nil { - if *this.Position != *that1.Position { - return fmt7.Errorf("Position this(%v) Not Equal that(%v)", *this.Position, *that1.Position) - } - } else if this.Position != nil { - return fmt7.Errorf("this.Position == nil && that.Position != nil") - } else if that1.Position != nil { - return fmt7.Errorf("Position this(%v) Not Equal that(%v)", this.Position, that1.Position) - } - if !bytes1.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt7.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } return nil } -func (this *WriteResponse) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*WriteResponse) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if this.Okay != nil && that1.Okay != nil { - if *this.Okay != *that1.Okay { - return false - } - } else if this.Okay != nil { - return false - } else if that1.Okay != nil { - return false - } - if this.Proposal != nil && that1.Proposal != nil { - if *this.Proposal != *that1.Proposal { - return false +func (m *PromiseRequest) Unmarshal(data []byte) error { + var hasFields [1]uint64 + 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 + } } - } else if this.Proposal != nil { - return false - } else if that1.Proposal != nil { - return false - } - if this.Position != nil && that1.Position != nil { - if *this.Position != *that1.Position { - return false + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Proposal", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Proposal = &v + hasFields[0] |= uint64(0x00000001) + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Position", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Position = &v + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipLog(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthLog + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - } else if this.Position != nil { - return false - } else if that1.Position != nil { - return false } - if !bytes1.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("proposal") } - return true + + return nil } -func (this *LearnedMessage) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil +func (m *PromiseResponse) Unmarshal(data []byte) error { + var hasFields [1]uint64 + 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 + } } - return fmt7.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*LearnedMessage) - if !ok { - return fmt7.Errorf("that is not of type *LearnedMessage") - } - if that1 == nil { - if this == nil { - return nil + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Okay", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + b := bool(v != 0) + m.Okay = &b + hasFields[0] |= uint64(0x00000001) + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Proposal", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Proposal = &v + hasFields[0] |= uint64(0x00000002) + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Action", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthLog + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Action == nil { + m.Action = &Action{} + } + if err := m.Action.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Position", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Position = &v + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipLog(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthLog + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - return fmt7.Errorf("that is type *LearnedMessage but is nil && this != nil") - } else if this == nil { - return fmt7.Errorf("that is type *LearnedMessagebut is not nil && this == nil") } - if !this.Action.Equal(that1.Action) { - return fmt7.Errorf("Action this(%v) Not Equal that(%v)", this.Action, that1.Action) + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("okay") } - if !bytes1.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt7.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + if hasFields[0]&uint64(0x00000002) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("proposal") } + return nil } -func (this *LearnedMessage) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true +func (m *WriteRequest) Unmarshal(data []byte) error { + var hasFields [1]uint64 + 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 + } } - return false - } - - that1, ok := that.(*LearnedMessage) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Proposal", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Proposal = &v + hasFields[0] |= uint64(0x00000001) + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Position", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Position = &v + hasFields[0] |= uint64(0x00000002) + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Learned", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + b := bool(v != 0) + m.Learned = &b + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + var v Action_Type + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (Action_Type(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Type = &v + hasFields[0] |= uint64(0x00000004) + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Nop", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthLog + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Nop == nil { + m.Nop = &Action_Nop{} + } + if err := m.Nop.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Append", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthLog + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Append == nil { + m.Append = &Action_Append{} + } + if err := m.Append.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Truncate", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthLog + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Truncate == nil { + m.Truncate = &Action_Truncate{} + } + if err := m.Truncate.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipLog(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthLog + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - return false - } else if this == nil { - return false } - if !this.Action.Equal(that1.Action) { - return false + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("proposal") } - if !bytes1.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false + if hasFields[0]&uint64(0x00000002) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("position") } - return true -} -func (this *RecoverRequest) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt7.Errorf("that == nil && this != nil") + if hasFields[0]&uint64(0x00000004) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("type") } - that1, ok := that.(*RecoverRequest) - if !ok { - return fmt7.Errorf("that is not of type *RecoverRequest") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt7.Errorf("that is type *RecoverRequest but is nil && this != nil") - } else if this == nil { - return fmt7.Errorf("that is type *RecoverRequestbut is not nil && this == nil") - } - if !bytes1.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt7.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } return nil } -func (this *RecoverRequest) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*RecoverRequest) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true +func (m *WriteResponse) Unmarshal(data []byte) error { + var hasFields [1]uint64 + 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 + } } - return false - } else if this == nil { - return false - } - if !bytes1.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *RecoverResponse) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Okay", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + b := bool(v != 0) + m.Okay = &b + hasFields[0] |= uint64(0x00000001) + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Proposal", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Proposal = &v + hasFields[0] |= uint64(0x00000002) + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Position", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Position = &v + hasFields[0] |= uint64(0x00000004) + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipLog(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthLog + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - return fmt7.Errorf("that == nil && this != nil") } - - that1, ok := that.(*RecoverResponse) - if !ok { - return fmt7.Errorf("that is not of type *RecoverResponse") + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("okay") } - if that1 == nil { - if this == nil { - return nil - } - return fmt7.Errorf("that is type *RecoverResponse but is nil && this != nil") - } else if this == nil { - return fmt7.Errorf("that is type *RecoverResponsebut is not nil && this == nil") + if hasFields[0]&uint64(0x00000002) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("proposal") } - if this.Status != nil && that1.Status != nil { - if *this.Status != *that1.Status { - return fmt7.Errorf("Status this(%v) Not Equal that(%v)", *this.Status, *that1.Status) - } - } else if this.Status != nil { - return fmt7.Errorf("this.Status == nil && that.Status != nil") - } else if that1.Status != nil { - return fmt7.Errorf("Status this(%v) Not Equal that(%v)", this.Status, that1.Status) + if hasFields[0]&uint64(0x00000004) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("position") } - if this.Begin != nil && that1.Begin != nil { - if *this.Begin != *that1.Begin { - return fmt7.Errorf("Begin this(%v) Not Equal that(%v)", *this.Begin, *that1.Begin) + + return nil +} +func (m *LearnedMessage) Unmarshal(data []byte) error { + var hasFields [1]uint64 + 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 + } } - } else if this.Begin != nil { - return fmt7.Errorf("this.Begin == nil && that.Begin != nil") - } else if that1.Begin != nil { - return fmt7.Errorf("Begin this(%v) Not Equal that(%v)", this.Begin, that1.Begin) - } - if this.End != nil && that1.End != nil { - if *this.End != *that1.End { - return fmt7.Errorf("End this(%v) Not Equal that(%v)", *this.End, *that1.End) + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Action", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthLog + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Action == nil { + m.Action = &Action{} + } + if err := m.Action.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + hasFields[0] |= uint64(0x00000001) + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipLog(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthLog + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - } else if this.End != nil { - return fmt7.Errorf("this.End == nil && that.End != nil") - } else if that1.End != nil { - return fmt7.Errorf("End this(%v) Not Equal that(%v)", this.End, that1.End) } - if !bytes1.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt7.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("action") } + return nil } -func (this *RecoverResponse) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true +func (m *RecoverRequest) 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) + switch fieldNum { + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipLog(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthLog + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - return false } - that1, ok := that.(*RecoverResponse) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true + return nil +} +func (m *RecoverResponse) Unmarshal(data []byte) error { + var hasFields [1]uint64 + 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 + } } - return false - } else if this == nil { - return false - } - if this.Status != nil && that1.Status != nil { - if *this.Status != *that1.Status { - return false + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + var v Metadata_Status + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (Metadata_Status(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Status = &v + hasFields[0] |= uint64(0x00000001) + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Begin", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Begin = &v + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field End", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.End = &v + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipLog(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthLog + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - } else if this.Status != nil { - return false - } else if that1.Status != nil { - return false } - if this.Begin != nil && that1.Begin != nil { - if *this.Begin != *that1.Begin { - return false - } - } else if this.Begin != nil { - return false - } else if that1.Begin != nil { - return false + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("status") } - if this.End != nil && that1.End != nil { - if *this.End != *that1.End { - return false + + return nil +} +func skipLog(data []byte) (n int, err error) { + l := len(data) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + 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 { + 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 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, ErrInvalidLengthLog + } + return iNdEx, nil + case 3: + for { + var innerWire uint64 + var start int = iNdEx + for shift := uint(0); ; shift += 7 { + 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 := skipLog(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) } - } else if this.End != nil { - return false - } else if that1.End != nil { - return false - } - if !bytes1.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false } - return true + panic("unreachable") } + +var ( + ErrInvalidLengthLog = fmt.Errorf("proto: negative length found during unmarshaling") +) diff --git a/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/logpb_test.go b/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/logpb_test.go index 0511bd3d8e40..20e6005eaf72 100644 --- a/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/logpb_test.go +++ b/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/logpb_test.go @@ -4,60 +4,60 @@ package mesosproto -import testing7 "testing" -import math_rand7 "math/rand" -import time7 "time" -import github_com_gogo_protobuf_proto4 "github.com/gogo/protobuf/proto" -import testing8 "testing" -import math_rand8 "math/rand" -import time8 "time" -import encoding_json1 "encoding/json" -import testing9 "testing" -import math_rand9 "math/rand" -import time9 "time" -import github_com_gogo_protobuf_proto5 "github.com/gogo/protobuf/proto" -import math_rand10 "math/rand" -import time10 "time" -import testing10 "testing" -import fmt2 "fmt" -import math_rand11 "math/rand" -import time11 "time" -import testing11 "testing" -import github_com_gogo_protobuf_proto6 "github.com/gogo/protobuf/proto" -import math_rand12 "math/rand" -import time12 "time" -import testing12 "testing" -import fmt3 "fmt" -import go_parser1 "go/parser" -import math_rand13 "math/rand" -import time13 "time" -import testing13 "testing" -import github_com_gogo_protobuf_proto7 "github.com/gogo/protobuf/proto" - -func TestPromiseProto(t *testing7.T) { - popr := math_rand7.New(math_rand7.NewSource(time7.Now().UnixNano())) +import testing "testing" +import math_rand "math/rand" +import time "time" +import github_com_gogo_protobuf_proto "github.com/gogo/protobuf/proto" +import github_com_gogo_protobuf_jsonpb "github.com/gogo/protobuf/jsonpb" +import fmt "fmt" +import go_parser "go/parser" +import proto "github.com/gogo/protobuf/proto" +import math "math" + +// discarding unused import gogoproto "github.com/gogo/protobuf/gogoproto" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +func TestPromiseProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedPromise(popr, false) - data, err := github_com_gogo_protobuf_proto4.Marshal(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Promise{} - if err := github_com_gogo_protobuf_proto4.Unmarshal(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestPromiseMarshalTo(t *testing7.T) { - popr := math_rand7.New(math_rand7.NewSource(time7.Now().UnixNano())) +func TestPromiseMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedPromise(popr, false) size := p.Size() data := make([]byte, size) @@ -66,25 +66,25 @@ func TestPromiseMarshalTo(t *testing7.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Promise{} - if err := github_com_gogo_protobuf_proto4.Unmarshal(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkPromiseProtoMarshal(b *testing7.B) { - popr := math_rand7.New(math_rand7.NewSource(616)) +func BenchmarkPromiseProtoMarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 pops := make([]*Promise, 10000) for i := 0; i < 10000; i++ { @@ -92,7 +92,7 @@ func BenchmarkPromiseProtoMarshal(b *testing7.B) { } b.ResetTimer() for i := 0; i < b.N; i++ { - data, err := github_com_gogo_protobuf_proto4.Marshal(pops[i%10000]) + data, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) if err != nil { panic(err) } @@ -101,12 +101,12 @@ func BenchmarkPromiseProtoMarshal(b *testing7.B) { b.SetBytes(int64(total / b.N)) } -func BenchmarkPromiseProtoUnmarshal(b *testing7.B) { - popr := math_rand7.New(math_rand7.NewSource(616)) +func BenchmarkPromiseProtoUnmarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 datas := make([][]byte, 10000) for i := 0; i < 10000; i++ { - data, err := github_com_gogo_protobuf_proto4.Marshal(NewPopulatedPromise(popr, false)) + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedPromise(popr, false)) if err != nil { panic(err) } @@ -116,37 +116,50 @@ func BenchmarkPromiseProtoUnmarshal(b *testing7.B) { b.ResetTimer() for i := 0; i < b.N; i++ { total += len(datas[i%10000]) - if err := github_com_gogo_protobuf_proto4.Unmarshal(datas[i%10000], msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { panic(err) } } b.SetBytes(int64(total / b.N)) } -func TestActionProto(t *testing7.T) { - popr := math_rand7.New(math_rand7.NewSource(time7.Now().UnixNano())) +func TestActionProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedAction(popr, false) - data, err := github_com_gogo_protobuf_proto4.Marshal(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Action{} - if err := github_com_gogo_protobuf_proto4.Unmarshal(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestActionMarshalTo(t *testing7.T) { - popr := math_rand7.New(math_rand7.NewSource(time7.Now().UnixNano())) +func TestActionMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedAction(popr, false) size := p.Size() data := make([]byte, size) @@ -155,25 +168,25 @@ func TestActionMarshalTo(t *testing7.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Action{} - if err := github_com_gogo_protobuf_proto4.Unmarshal(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkActionProtoMarshal(b *testing7.B) { - popr := math_rand7.New(math_rand7.NewSource(616)) +func BenchmarkActionProtoMarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 pops := make([]*Action, 10000) for i := 0; i < 10000; i++ { @@ -181,7 +194,7 @@ func BenchmarkActionProtoMarshal(b *testing7.B) { } b.ResetTimer() for i := 0; i < b.N; i++ { - data, err := github_com_gogo_protobuf_proto4.Marshal(pops[i%10000]) + data, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) if err != nil { panic(err) } @@ -190,12 +203,12 @@ func BenchmarkActionProtoMarshal(b *testing7.B) { b.SetBytes(int64(total / b.N)) } -func BenchmarkActionProtoUnmarshal(b *testing7.B) { - popr := math_rand7.New(math_rand7.NewSource(616)) +func BenchmarkActionProtoUnmarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 datas := make([][]byte, 10000) for i := 0; i < 10000; i++ { - data, err := github_com_gogo_protobuf_proto4.Marshal(NewPopulatedAction(popr, false)) + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedAction(popr, false)) if err != nil { panic(err) } @@ -205,37 +218,50 @@ func BenchmarkActionProtoUnmarshal(b *testing7.B) { b.ResetTimer() for i := 0; i < b.N; i++ { total += len(datas[i%10000]) - if err := github_com_gogo_protobuf_proto4.Unmarshal(datas[i%10000], msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { panic(err) } } b.SetBytes(int64(total / b.N)) } -func TestAction_NopProto(t *testing7.T) { - popr := math_rand7.New(math_rand7.NewSource(time7.Now().UnixNano())) +func TestAction_NopProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedAction_Nop(popr, false) - data, err := github_com_gogo_protobuf_proto4.Marshal(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Action_Nop{} - if err := github_com_gogo_protobuf_proto4.Unmarshal(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestAction_NopMarshalTo(t *testing7.T) { - popr := math_rand7.New(math_rand7.NewSource(time7.Now().UnixNano())) +func TestAction_NopMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedAction_Nop(popr, false) size := p.Size() data := make([]byte, size) @@ -244,25 +270,25 @@ func TestAction_NopMarshalTo(t *testing7.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Action_Nop{} - if err := github_com_gogo_protobuf_proto4.Unmarshal(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkAction_NopProtoMarshal(b *testing7.B) { - popr := math_rand7.New(math_rand7.NewSource(616)) +func BenchmarkAction_NopProtoMarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 pops := make([]*Action_Nop, 10000) for i := 0; i < 10000; i++ { @@ -270,7 +296,7 @@ func BenchmarkAction_NopProtoMarshal(b *testing7.B) { } b.ResetTimer() for i := 0; i < b.N; i++ { - data, err := github_com_gogo_protobuf_proto4.Marshal(pops[i%10000]) + data, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) if err != nil { panic(err) } @@ -279,12 +305,12 @@ func BenchmarkAction_NopProtoMarshal(b *testing7.B) { b.SetBytes(int64(total / b.N)) } -func BenchmarkAction_NopProtoUnmarshal(b *testing7.B) { - popr := math_rand7.New(math_rand7.NewSource(616)) +func BenchmarkAction_NopProtoUnmarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 datas := make([][]byte, 10000) for i := 0; i < 10000; i++ { - data, err := github_com_gogo_protobuf_proto4.Marshal(NewPopulatedAction_Nop(popr, false)) + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedAction_Nop(popr, false)) if err != nil { panic(err) } @@ -294,37 +320,50 @@ func BenchmarkAction_NopProtoUnmarshal(b *testing7.B) { b.ResetTimer() for i := 0; i < b.N; i++ { total += len(datas[i%10000]) - if err := github_com_gogo_protobuf_proto4.Unmarshal(datas[i%10000], msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { panic(err) } } b.SetBytes(int64(total / b.N)) } -func TestAction_AppendProto(t *testing7.T) { - popr := math_rand7.New(math_rand7.NewSource(time7.Now().UnixNano())) +func TestAction_AppendProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedAction_Append(popr, false) - data, err := github_com_gogo_protobuf_proto4.Marshal(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Action_Append{} - if err := github_com_gogo_protobuf_proto4.Unmarshal(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestAction_AppendMarshalTo(t *testing7.T) { - popr := math_rand7.New(math_rand7.NewSource(time7.Now().UnixNano())) +func TestAction_AppendMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedAction_Append(popr, false) size := p.Size() data := make([]byte, size) @@ -333,25 +372,25 @@ func TestAction_AppendMarshalTo(t *testing7.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Action_Append{} - if err := github_com_gogo_protobuf_proto4.Unmarshal(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkAction_AppendProtoMarshal(b *testing7.B) { - popr := math_rand7.New(math_rand7.NewSource(616)) +func BenchmarkAction_AppendProtoMarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 pops := make([]*Action_Append, 10000) for i := 0; i < 10000; i++ { @@ -359,7 +398,7 @@ func BenchmarkAction_AppendProtoMarshal(b *testing7.B) { } b.ResetTimer() for i := 0; i < b.N; i++ { - data, err := github_com_gogo_protobuf_proto4.Marshal(pops[i%10000]) + data, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) if err != nil { panic(err) } @@ -368,12 +407,12 @@ func BenchmarkAction_AppendProtoMarshal(b *testing7.B) { b.SetBytes(int64(total / b.N)) } -func BenchmarkAction_AppendProtoUnmarshal(b *testing7.B) { - popr := math_rand7.New(math_rand7.NewSource(616)) +func BenchmarkAction_AppendProtoUnmarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 datas := make([][]byte, 10000) for i := 0; i < 10000; i++ { - data, err := github_com_gogo_protobuf_proto4.Marshal(NewPopulatedAction_Append(popr, false)) + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedAction_Append(popr, false)) if err != nil { panic(err) } @@ -383,37 +422,50 @@ func BenchmarkAction_AppendProtoUnmarshal(b *testing7.B) { b.ResetTimer() for i := 0; i < b.N; i++ { total += len(datas[i%10000]) - if err := github_com_gogo_protobuf_proto4.Unmarshal(datas[i%10000], msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { panic(err) } } b.SetBytes(int64(total / b.N)) } -func TestAction_TruncateProto(t *testing7.T) { - popr := math_rand7.New(math_rand7.NewSource(time7.Now().UnixNano())) +func TestAction_TruncateProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedAction_Truncate(popr, false) - data, err := github_com_gogo_protobuf_proto4.Marshal(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Action_Truncate{} - if err := github_com_gogo_protobuf_proto4.Unmarshal(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestAction_TruncateMarshalTo(t *testing7.T) { - popr := math_rand7.New(math_rand7.NewSource(time7.Now().UnixNano())) +func TestAction_TruncateMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedAction_Truncate(popr, false) size := p.Size() data := make([]byte, size) @@ -422,25 +474,25 @@ func TestAction_TruncateMarshalTo(t *testing7.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Action_Truncate{} - if err := github_com_gogo_protobuf_proto4.Unmarshal(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkAction_TruncateProtoMarshal(b *testing7.B) { - popr := math_rand7.New(math_rand7.NewSource(616)) +func BenchmarkAction_TruncateProtoMarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 pops := make([]*Action_Truncate, 10000) for i := 0; i < 10000; i++ { @@ -448,7 +500,7 @@ func BenchmarkAction_TruncateProtoMarshal(b *testing7.B) { } b.ResetTimer() for i := 0; i < b.N; i++ { - data, err := github_com_gogo_protobuf_proto4.Marshal(pops[i%10000]) + data, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) if err != nil { panic(err) } @@ -457,12 +509,12 @@ func BenchmarkAction_TruncateProtoMarshal(b *testing7.B) { b.SetBytes(int64(total / b.N)) } -func BenchmarkAction_TruncateProtoUnmarshal(b *testing7.B) { - popr := math_rand7.New(math_rand7.NewSource(616)) +func BenchmarkAction_TruncateProtoUnmarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 datas := make([][]byte, 10000) for i := 0; i < 10000; i++ { - data, err := github_com_gogo_protobuf_proto4.Marshal(NewPopulatedAction_Truncate(popr, false)) + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedAction_Truncate(popr, false)) if err != nil { panic(err) } @@ -472,37 +524,50 @@ func BenchmarkAction_TruncateProtoUnmarshal(b *testing7.B) { b.ResetTimer() for i := 0; i < b.N; i++ { total += len(datas[i%10000]) - if err := github_com_gogo_protobuf_proto4.Unmarshal(datas[i%10000], msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { panic(err) } } b.SetBytes(int64(total / b.N)) } -func TestMetadataProto(t *testing7.T) { - popr := math_rand7.New(math_rand7.NewSource(time7.Now().UnixNano())) +func TestMetadataProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedMetadata(popr, false) - data, err := github_com_gogo_protobuf_proto4.Marshal(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Metadata{} - if err := github_com_gogo_protobuf_proto4.Unmarshal(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestMetadataMarshalTo(t *testing7.T) { - popr := math_rand7.New(math_rand7.NewSource(time7.Now().UnixNano())) +func TestMetadataMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedMetadata(popr, false) size := p.Size() data := make([]byte, size) @@ -511,25 +576,25 @@ func TestMetadataMarshalTo(t *testing7.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Metadata{} - if err := github_com_gogo_protobuf_proto4.Unmarshal(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkMetadataProtoMarshal(b *testing7.B) { - popr := math_rand7.New(math_rand7.NewSource(616)) +func BenchmarkMetadataProtoMarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 pops := make([]*Metadata, 10000) for i := 0; i < 10000; i++ { @@ -537,7 +602,7 @@ func BenchmarkMetadataProtoMarshal(b *testing7.B) { } b.ResetTimer() for i := 0; i < b.N; i++ { - data, err := github_com_gogo_protobuf_proto4.Marshal(pops[i%10000]) + data, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) if err != nil { panic(err) } @@ -546,12 +611,12 @@ func BenchmarkMetadataProtoMarshal(b *testing7.B) { b.SetBytes(int64(total / b.N)) } -func BenchmarkMetadataProtoUnmarshal(b *testing7.B) { - popr := math_rand7.New(math_rand7.NewSource(616)) +func BenchmarkMetadataProtoUnmarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 datas := make([][]byte, 10000) for i := 0; i < 10000; i++ { - data, err := github_com_gogo_protobuf_proto4.Marshal(NewPopulatedMetadata(popr, false)) + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedMetadata(popr, false)) if err != nil { panic(err) } @@ -561,37 +626,50 @@ func BenchmarkMetadataProtoUnmarshal(b *testing7.B) { b.ResetTimer() for i := 0; i < b.N; i++ { total += len(datas[i%10000]) - if err := github_com_gogo_protobuf_proto4.Unmarshal(datas[i%10000], msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { panic(err) } } b.SetBytes(int64(total / b.N)) } -func TestRecordProto(t *testing7.T) { - popr := math_rand7.New(math_rand7.NewSource(time7.Now().UnixNano())) +func TestRecordProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRecord(popr, false) - data, err := github_com_gogo_protobuf_proto4.Marshal(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Record{} - if err := github_com_gogo_protobuf_proto4.Unmarshal(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestRecordMarshalTo(t *testing7.T) { - popr := math_rand7.New(math_rand7.NewSource(time7.Now().UnixNano())) +func TestRecordMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRecord(popr, false) size := p.Size() data := make([]byte, size) @@ -600,25 +678,25 @@ func TestRecordMarshalTo(t *testing7.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Record{} - if err := github_com_gogo_protobuf_proto4.Unmarshal(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkRecordProtoMarshal(b *testing7.B) { - popr := math_rand7.New(math_rand7.NewSource(616)) +func BenchmarkRecordProtoMarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 pops := make([]*Record, 10000) for i := 0; i < 10000; i++ { @@ -626,7 +704,7 @@ func BenchmarkRecordProtoMarshal(b *testing7.B) { } b.ResetTimer() for i := 0; i < b.N; i++ { - data, err := github_com_gogo_protobuf_proto4.Marshal(pops[i%10000]) + data, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) if err != nil { panic(err) } @@ -635,12 +713,12 @@ func BenchmarkRecordProtoMarshal(b *testing7.B) { b.SetBytes(int64(total / b.N)) } -func BenchmarkRecordProtoUnmarshal(b *testing7.B) { - popr := math_rand7.New(math_rand7.NewSource(616)) +func BenchmarkRecordProtoUnmarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 datas := make([][]byte, 10000) for i := 0; i < 10000; i++ { - data, err := github_com_gogo_protobuf_proto4.Marshal(NewPopulatedRecord(popr, false)) + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedRecord(popr, false)) if err != nil { panic(err) } @@ -650,37 +728,50 @@ func BenchmarkRecordProtoUnmarshal(b *testing7.B) { b.ResetTimer() for i := 0; i < b.N; i++ { total += len(datas[i%10000]) - if err := github_com_gogo_protobuf_proto4.Unmarshal(datas[i%10000], msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { panic(err) } } b.SetBytes(int64(total / b.N)) } -func TestPromiseRequestProto(t *testing7.T) { - popr := math_rand7.New(math_rand7.NewSource(time7.Now().UnixNano())) +func TestPromiseRequestProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedPromiseRequest(popr, false) - data, err := github_com_gogo_protobuf_proto4.Marshal(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &PromiseRequest{} - if err := github_com_gogo_protobuf_proto4.Unmarshal(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestPromiseRequestMarshalTo(t *testing7.T) { - popr := math_rand7.New(math_rand7.NewSource(time7.Now().UnixNano())) +func TestPromiseRequestMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedPromiseRequest(popr, false) size := p.Size() data := make([]byte, size) @@ -689,25 +780,25 @@ func TestPromiseRequestMarshalTo(t *testing7.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &PromiseRequest{} - if err := github_com_gogo_protobuf_proto4.Unmarshal(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkPromiseRequestProtoMarshal(b *testing7.B) { - popr := math_rand7.New(math_rand7.NewSource(616)) +func BenchmarkPromiseRequestProtoMarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 pops := make([]*PromiseRequest, 10000) for i := 0; i < 10000; i++ { @@ -715,7 +806,7 @@ func BenchmarkPromiseRequestProtoMarshal(b *testing7.B) { } b.ResetTimer() for i := 0; i < b.N; i++ { - data, err := github_com_gogo_protobuf_proto4.Marshal(pops[i%10000]) + data, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) if err != nil { panic(err) } @@ -724,12 +815,12 @@ func BenchmarkPromiseRequestProtoMarshal(b *testing7.B) { b.SetBytes(int64(total / b.N)) } -func BenchmarkPromiseRequestProtoUnmarshal(b *testing7.B) { - popr := math_rand7.New(math_rand7.NewSource(616)) +func BenchmarkPromiseRequestProtoUnmarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 datas := make([][]byte, 10000) for i := 0; i < 10000; i++ { - data, err := github_com_gogo_protobuf_proto4.Marshal(NewPopulatedPromiseRequest(popr, false)) + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedPromiseRequest(popr, false)) if err != nil { panic(err) } @@ -739,37 +830,50 @@ func BenchmarkPromiseRequestProtoUnmarshal(b *testing7.B) { b.ResetTimer() for i := 0; i < b.N; i++ { total += len(datas[i%10000]) - if err := github_com_gogo_protobuf_proto4.Unmarshal(datas[i%10000], msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { panic(err) } } b.SetBytes(int64(total / b.N)) } -func TestPromiseResponseProto(t *testing7.T) { - popr := math_rand7.New(math_rand7.NewSource(time7.Now().UnixNano())) +func TestPromiseResponseProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedPromiseResponse(popr, false) - data, err := github_com_gogo_protobuf_proto4.Marshal(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &PromiseResponse{} - if err := github_com_gogo_protobuf_proto4.Unmarshal(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestPromiseResponseMarshalTo(t *testing7.T) { - popr := math_rand7.New(math_rand7.NewSource(time7.Now().UnixNano())) +func TestPromiseResponseMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedPromiseResponse(popr, false) size := p.Size() data := make([]byte, size) @@ -778,25 +882,25 @@ func TestPromiseResponseMarshalTo(t *testing7.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &PromiseResponse{} - if err := github_com_gogo_protobuf_proto4.Unmarshal(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkPromiseResponseProtoMarshal(b *testing7.B) { - popr := math_rand7.New(math_rand7.NewSource(616)) +func BenchmarkPromiseResponseProtoMarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 pops := make([]*PromiseResponse, 10000) for i := 0; i < 10000; i++ { @@ -804,7 +908,7 @@ func BenchmarkPromiseResponseProtoMarshal(b *testing7.B) { } b.ResetTimer() for i := 0; i < b.N; i++ { - data, err := github_com_gogo_protobuf_proto4.Marshal(pops[i%10000]) + data, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) if err != nil { panic(err) } @@ -813,12 +917,12 @@ func BenchmarkPromiseResponseProtoMarshal(b *testing7.B) { b.SetBytes(int64(total / b.N)) } -func BenchmarkPromiseResponseProtoUnmarshal(b *testing7.B) { - popr := math_rand7.New(math_rand7.NewSource(616)) +func BenchmarkPromiseResponseProtoUnmarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 datas := make([][]byte, 10000) for i := 0; i < 10000; i++ { - data, err := github_com_gogo_protobuf_proto4.Marshal(NewPopulatedPromiseResponse(popr, false)) + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedPromiseResponse(popr, false)) if err != nil { panic(err) } @@ -828,37 +932,50 @@ func BenchmarkPromiseResponseProtoUnmarshal(b *testing7.B) { b.ResetTimer() for i := 0; i < b.N; i++ { total += len(datas[i%10000]) - if err := github_com_gogo_protobuf_proto4.Unmarshal(datas[i%10000], msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { panic(err) } } b.SetBytes(int64(total / b.N)) } -func TestWriteRequestProto(t *testing7.T) { - popr := math_rand7.New(math_rand7.NewSource(time7.Now().UnixNano())) +func TestWriteRequestProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedWriteRequest(popr, false) - data, err := github_com_gogo_protobuf_proto4.Marshal(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &WriteRequest{} - if err := github_com_gogo_protobuf_proto4.Unmarshal(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestWriteRequestMarshalTo(t *testing7.T) { - popr := math_rand7.New(math_rand7.NewSource(time7.Now().UnixNano())) +func TestWriteRequestMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedWriteRequest(popr, false) size := p.Size() data := make([]byte, size) @@ -867,25 +984,25 @@ func TestWriteRequestMarshalTo(t *testing7.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &WriteRequest{} - if err := github_com_gogo_protobuf_proto4.Unmarshal(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkWriteRequestProtoMarshal(b *testing7.B) { - popr := math_rand7.New(math_rand7.NewSource(616)) +func BenchmarkWriteRequestProtoMarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 pops := make([]*WriteRequest, 10000) for i := 0; i < 10000; i++ { @@ -893,7 +1010,7 @@ func BenchmarkWriteRequestProtoMarshal(b *testing7.B) { } b.ResetTimer() for i := 0; i < b.N; i++ { - data, err := github_com_gogo_protobuf_proto4.Marshal(pops[i%10000]) + data, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) if err != nil { panic(err) } @@ -902,12 +1019,12 @@ func BenchmarkWriteRequestProtoMarshal(b *testing7.B) { b.SetBytes(int64(total / b.N)) } -func BenchmarkWriteRequestProtoUnmarshal(b *testing7.B) { - popr := math_rand7.New(math_rand7.NewSource(616)) +func BenchmarkWriteRequestProtoUnmarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 datas := make([][]byte, 10000) for i := 0; i < 10000; i++ { - data, err := github_com_gogo_protobuf_proto4.Marshal(NewPopulatedWriteRequest(popr, false)) + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedWriteRequest(popr, false)) if err != nil { panic(err) } @@ -917,37 +1034,50 @@ func BenchmarkWriteRequestProtoUnmarshal(b *testing7.B) { b.ResetTimer() for i := 0; i < b.N; i++ { total += len(datas[i%10000]) - if err := github_com_gogo_protobuf_proto4.Unmarshal(datas[i%10000], msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { panic(err) } } b.SetBytes(int64(total / b.N)) } -func TestWriteResponseProto(t *testing7.T) { - popr := math_rand7.New(math_rand7.NewSource(time7.Now().UnixNano())) +func TestWriteResponseProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedWriteResponse(popr, false) - data, err := github_com_gogo_protobuf_proto4.Marshal(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &WriteResponse{} - if err := github_com_gogo_protobuf_proto4.Unmarshal(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestWriteResponseMarshalTo(t *testing7.T) { - popr := math_rand7.New(math_rand7.NewSource(time7.Now().UnixNano())) +func TestWriteResponseMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedWriteResponse(popr, false) size := p.Size() data := make([]byte, size) @@ -956,25 +1086,25 @@ func TestWriteResponseMarshalTo(t *testing7.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &WriteResponse{} - if err := github_com_gogo_protobuf_proto4.Unmarshal(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkWriteResponseProtoMarshal(b *testing7.B) { - popr := math_rand7.New(math_rand7.NewSource(616)) +func BenchmarkWriteResponseProtoMarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 pops := make([]*WriteResponse, 10000) for i := 0; i < 10000; i++ { @@ -982,7 +1112,7 @@ func BenchmarkWriteResponseProtoMarshal(b *testing7.B) { } b.ResetTimer() for i := 0; i < b.N; i++ { - data, err := github_com_gogo_protobuf_proto4.Marshal(pops[i%10000]) + data, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) if err != nil { panic(err) } @@ -991,12 +1121,12 @@ func BenchmarkWriteResponseProtoMarshal(b *testing7.B) { b.SetBytes(int64(total / b.N)) } -func BenchmarkWriteResponseProtoUnmarshal(b *testing7.B) { - popr := math_rand7.New(math_rand7.NewSource(616)) +func BenchmarkWriteResponseProtoUnmarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 datas := make([][]byte, 10000) for i := 0; i < 10000; i++ { - data, err := github_com_gogo_protobuf_proto4.Marshal(NewPopulatedWriteResponse(popr, false)) + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedWriteResponse(popr, false)) if err != nil { panic(err) } @@ -1006,37 +1136,50 @@ func BenchmarkWriteResponseProtoUnmarshal(b *testing7.B) { b.ResetTimer() for i := 0; i < b.N; i++ { total += len(datas[i%10000]) - if err := github_com_gogo_protobuf_proto4.Unmarshal(datas[i%10000], msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { panic(err) } } b.SetBytes(int64(total / b.N)) } -func TestLearnedMessageProto(t *testing7.T) { - popr := math_rand7.New(math_rand7.NewSource(time7.Now().UnixNano())) +func TestLearnedMessageProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedLearnedMessage(popr, false) - data, err := github_com_gogo_protobuf_proto4.Marshal(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &LearnedMessage{} - if err := github_com_gogo_protobuf_proto4.Unmarshal(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestLearnedMessageMarshalTo(t *testing7.T) { - popr := math_rand7.New(math_rand7.NewSource(time7.Now().UnixNano())) +func TestLearnedMessageMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedLearnedMessage(popr, false) size := p.Size() data := make([]byte, size) @@ -1045,25 +1188,25 @@ func TestLearnedMessageMarshalTo(t *testing7.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &LearnedMessage{} - if err := github_com_gogo_protobuf_proto4.Unmarshal(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkLearnedMessageProtoMarshal(b *testing7.B) { - popr := math_rand7.New(math_rand7.NewSource(616)) +func BenchmarkLearnedMessageProtoMarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 pops := make([]*LearnedMessage, 10000) for i := 0; i < 10000; i++ { @@ -1071,7 +1214,7 @@ func BenchmarkLearnedMessageProtoMarshal(b *testing7.B) { } b.ResetTimer() for i := 0; i < b.N; i++ { - data, err := github_com_gogo_protobuf_proto4.Marshal(pops[i%10000]) + data, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) if err != nil { panic(err) } @@ -1080,12 +1223,12 @@ func BenchmarkLearnedMessageProtoMarshal(b *testing7.B) { b.SetBytes(int64(total / b.N)) } -func BenchmarkLearnedMessageProtoUnmarshal(b *testing7.B) { - popr := math_rand7.New(math_rand7.NewSource(616)) +func BenchmarkLearnedMessageProtoUnmarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 datas := make([][]byte, 10000) for i := 0; i < 10000; i++ { - data, err := github_com_gogo_protobuf_proto4.Marshal(NewPopulatedLearnedMessage(popr, false)) + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedLearnedMessage(popr, false)) if err != nil { panic(err) } @@ -1095,37 +1238,50 @@ func BenchmarkLearnedMessageProtoUnmarshal(b *testing7.B) { b.ResetTimer() for i := 0; i < b.N; i++ { total += len(datas[i%10000]) - if err := github_com_gogo_protobuf_proto4.Unmarshal(datas[i%10000], msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { panic(err) } } b.SetBytes(int64(total / b.N)) } -func TestRecoverRequestProto(t *testing7.T) { - popr := math_rand7.New(math_rand7.NewSource(time7.Now().UnixNano())) +func TestRecoverRequestProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRecoverRequest(popr, false) - data, err := github_com_gogo_protobuf_proto4.Marshal(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &RecoverRequest{} - if err := github_com_gogo_protobuf_proto4.Unmarshal(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestRecoverRequestMarshalTo(t *testing7.T) { - popr := math_rand7.New(math_rand7.NewSource(time7.Now().UnixNano())) +func TestRecoverRequestMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRecoverRequest(popr, false) size := p.Size() data := make([]byte, size) @@ -1134,25 +1290,25 @@ func TestRecoverRequestMarshalTo(t *testing7.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &RecoverRequest{} - if err := github_com_gogo_protobuf_proto4.Unmarshal(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkRecoverRequestProtoMarshal(b *testing7.B) { - popr := math_rand7.New(math_rand7.NewSource(616)) +func BenchmarkRecoverRequestProtoMarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 pops := make([]*RecoverRequest, 10000) for i := 0; i < 10000; i++ { @@ -1160,7 +1316,7 @@ func BenchmarkRecoverRequestProtoMarshal(b *testing7.B) { } b.ResetTimer() for i := 0; i < b.N; i++ { - data, err := github_com_gogo_protobuf_proto4.Marshal(pops[i%10000]) + data, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) if err != nil { panic(err) } @@ -1169,12 +1325,12 @@ func BenchmarkRecoverRequestProtoMarshal(b *testing7.B) { b.SetBytes(int64(total / b.N)) } -func BenchmarkRecoverRequestProtoUnmarshal(b *testing7.B) { - popr := math_rand7.New(math_rand7.NewSource(616)) +func BenchmarkRecoverRequestProtoUnmarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 datas := make([][]byte, 10000) for i := 0; i < 10000; i++ { - data, err := github_com_gogo_protobuf_proto4.Marshal(NewPopulatedRecoverRequest(popr, false)) + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedRecoverRequest(popr, false)) if err != nil { panic(err) } @@ -1184,37 +1340,50 @@ func BenchmarkRecoverRequestProtoUnmarshal(b *testing7.B) { b.ResetTimer() for i := 0; i < b.N; i++ { total += len(datas[i%10000]) - if err := github_com_gogo_protobuf_proto4.Unmarshal(datas[i%10000], msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { panic(err) } } b.SetBytes(int64(total / b.N)) } -func TestRecoverResponseProto(t *testing7.T) { - popr := math_rand7.New(math_rand7.NewSource(time7.Now().UnixNano())) +func TestRecoverResponseProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRecoverResponse(popr, false) - data, err := github_com_gogo_protobuf_proto4.Marshal(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &RecoverResponse{} - if err := github_com_gogo_protobuf_proto4.Unmarshal(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestRecoverResponseMarshalTo(t *testing7.T) { - popr := math_rand7.New(math_rand7.NewSource(time7.Now().UnixNano())) +func TestRecoverResponseMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRecoverResponse(popr, false) size := p.Size() data := make([]byte, size) @@ -1223,25 +1392,25 @@ func TestRecoverResponseMarshalTo(t *testing7.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &RecoverResponse{} - if err := github_com_gogo_protobuf_proto4.Unmarshal(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkRecoverResponseProtoMarshal(b *testing7.B) { - popr := math_rand7.New(math_rand7.NewSource(616)) +func BenchmarkRecoverResponseProtoMarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 pops := make([]*RecoverResponse, 10000) for i := 0; i < 10000; i++ { @@ -1249,7 +1418,7 @@ func BenchmarkRecoverResponseProtoMarshal(b *testing7.B) { } b.ResetTimer() for i := 0; i < b.N; i++ { - data, err := github_com_gogo_protobuf_proto4.Marshal(pops[i%10000]) + data, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) if err != nil { panic(err) } @@ -1258,12 +1427,12 @@ func BenchmarkRecoverResponseProtoMarshal(b *testing7.B) { b.SetBytes(int64(total / b.N)) } -func BenchmarkRecoverResponseProtoUnmarshal(b *testing7.B) { - popr := math_rand7.New(math_rand7.NewSource(616)) +func BenchmarkRecoverResponseProtoUnmarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 datas := make([][]byte, 10000) for i := 0; i < 10000; i++ { - data, err := github_com_gogo_protobuf_proto4.Marshal(NewPopulatedRecoverResponse(popr, false)) + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedRecoverResponse(popr, false)) if err != nil { panic(err) } @@ -1273,876 +1442,1199 @@ func BenchmarkRecoverResponseProtoUnmarshal(b *testing7.B) { b.ResetTimer() for i := 0; i < b.N; i++ { total += len(datas[i%10000]) - if err := github_com_gogo_protobuf_proto4.Unmarshal(datas[i%10000], msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { panic(err) } } b.SetBytes(int64(total / b.N)) } -func TestPromiseJSON(t *testing8.T) { - popr := math_rand8.New(math_rand8.NewSource(time8.Now().UnixNano())) +func TestPromiseJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedPromise(popr, true) - jsondata, err := encoding_json1.Marshal(p) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Promise{} - err = encoding_json1.Unmarshal(jsondata, msg) + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } -func TestActionJSON(t *testing8.T) { - popr := math_rand8.New(math_rand8.NewSource(time8.Now().UnixNano())) +func TestActionJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedAction(popr, true) - jsondata, err := encoding_json1.Marshal(p) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Action{} - err = encoding_json1.Unmarshal(jsondata, msg) + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } -func TestAction_NopJSON(t *testing8.T) { - popr := math_rand8.New(math_rand8.NewSource(time8.Now().UnixNano())) +func TestAction_NopJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedAction_Nop(popr, true) - jsondata, err := encoding_json1.Marshal(p) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Action_Nop{} - err = encoding_json1.Unmarshal(jsondata, msg) + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } -func TestAction_AppendJSON(t *testing8.T) { - popr := math_rand8.New(math_rand8.NewSource(time8.Now().UnixNano())) +func TestAction_AppendJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedAction_Append(popr, true) - jsondata, err := encoding_json1.Marshal(p) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Action_Append{} - err = encoding_json1.Unmarshal(jsondata, msg) + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } -func TestAction_TruncateJSON(t *testing8.T) { - popr := math_rand8.New(math_rand8.NewSource(time8.Now().UnixNano())) +func TestAction_TruncateJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedAction_Truncate(popr, true) - jsondata, err := encoding_json1.Marshal(p) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Action_Truncate{} - err = encoding_json1.Unmarshal(jsondata, msg) + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } -func TestMetadataJSON(t *testing8.T) { - popr := math_rand8.New(math_rand8.NewSource(time8.Now().UnixNano())) +func TestMetadataJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedMetadata(popr, true) - jsondata, err := encoding_json1.Marshal(p) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Metadata{} - err = encoding_json1.Unmarshal(jsondata, msg) + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } -func TestRecordJSON(t *testing8.T) { - popr := math_rand8.New(math_rand8.NewSource(time8.Now().UnixNano())) +func TestRecordJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRecord(popr, true) - jsondata, err := encoding_json1.Marshal(p) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Record{} - err = encoding_json1.Unmarshal(jsondata, msg) + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } -func TestPromiseRequestJSON(t *testing8.T) { - popr := math_rand8.New(math_rand8.NewSource(time8.Now().UnixNano())) +func TestPromiseRequestJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedPromiseRequest(popr, true) - jsondata, err := encoding_json1.Marshal(p) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &PromiseRequest{} - err = encoding_json1.Unmarshal(jsondata, msg) + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } -func TestPromiseResponseJSON(t *testing8.T) { - popr := math_rand8.New(math_rand8.NewSource(time8.Now().UnixNano())) +func TestPromiseResponseJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedPromiseResponse(popr, true) - jsondata, err := encoding_json1.Marshal(p) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &PromiseResponse{} - err = encoding_json1.Unmarshal(jsondata, msg) + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } -func TestWriteRequestJSON(t *testing8.T) { - popr := math_rand8.New(math_rand8.NewSource(time8.Now().UnixNano())) +func TestWriteRequestJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedWriteRequest(popr, true) - jsondata, err := encoding_json1.Marshal(p) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &WriteRequest{} - err = encoding_json1.Unmarshal(jsondata, msg) + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } -func TestWriteResponseJSON(t *testing8.T) { - popr := math_rand8.New(math_rand8.NewSource(time8.Now().UnixNano())) +func TestWriteResponseJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedWriteResponse(popr, true) - jsondata, err := encoding_json1.Marshal(p) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &WriteResponse{} - err = encoding_json1.Unmarshal(jsondata, msg) + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } -func TestLearnedMessageJSON(t *testing8.T) { - popr := math_rand8.New(math_rand8.NewSource(time8.Now().UnixNano())) +func TestLearnedMessageJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedLearnedMessage(popr, true) - jsondata, err := encoding_json1.Marshal(p) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &LearnedMessage{} - err = encoding_json1.Unmarshal(jsondata, msg) + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } -func TestRecoverRequestJSON(t *testing8.T) { - popr := math_rand8.New(math_rand8.NewSource(time8.Now().UnixNano())) +func TestRecoverRequestJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRecoverRequest(popr, true) - jsondata, err := encoding_json1.Marshal(p) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &RecoverRequest{} - err = encoding_json1.Unmarshal(jsondata, msg) + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } -func TestRecoverResponseJSON(t *testing8.T) { - popr := math_rand8.New(math_rand8.NewSource(time8.Now().UnixNano())) +func TestRecoverResponseJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRecoverResponse(popr, true) - jsondata, err := encoding_json1.Marshal(p) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &RecoverResponse{} - err = encoding_json1.Unmarshal(jsondata, msg) + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } -func TestPromiseProtoText(t *testing9.T) { - popr := math_rand9.New(math_rand9.NewSource(time9.Now().UnixNano())) +func TestPromiseProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedPromise(popr, true) - data := github_com_gogo_protobuf_proto5.MarshalTextString(p) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) msg := &Promise{} - if err := github_com_gogo_protobuf_proto5.UnmarshalText(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestPromiseProtoCompactText(t *testing9.T) { - popr := math_rand9.New(math_rand9.NewSource(time9.Now().UnixNano())) +func TestPromiseProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedPromise(popr, true) - data := github_com_gogo_protobuf_proto5.CompactTextString(p) + data := github_com_gogo_protobuf_proto.CompactTextString(p) msg := &Promise{} - if err := github_com_gogo_protobuf_proto5.UnmarshalText(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestActionProtoText(t *testing9.T) { - popr := math_rand9.New(math_rand9.NewSource(time9.Now().UnixNano())) +func TestActionProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedAction(popr, true) - data := github_com_gogo_protobuf_proto5.MarshalTextString(p) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) msg := &Action{} - if err := github_com_gogo_protobuf_proto5.UnmarshalText(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestActionProtoCompactText(t *testing9.T) { - popr := math_rand9.New(math_rand9.NewSource(time9.Now().UnixNano())) +func TestActionProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedAction(popr, true) - data := github_com_gogo_protobuf_proto5.CompactTextString(p) + data := github_com_gogo_protobuf_proto.CompactTextString(p) msg := &Action{} - if err := github_com_gogo_protobuf_proto5.UnmarshalText(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestAction_NopProtoText(t *testing9.T) { - popr := math_rand9.New(math_rand9.NewSource(time9.Now().UnixNano())) +func TestAction_NopProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedAction_Nop(popr, true) - data := github_com_gogo_protobuf_proto5.MarshalTextString(p) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) msg := &Action_Nop{} - if err := github_com_gogo_protobuf_proto5.UnmarshalText(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestAction_NopProtoCompactText(t *testing9.T) { - popr := math_rand9.New(math_rand9.NewSource(time9.Now().UnixNano())) +func TestAction_NopProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedAction_Nop(popr, true) - data := github_com_gogo_protobuf_proto5.CompactTextString(p) + data := github_com_gogo_protobuf_proto.CompactTextString(p) msg := &Action_Nop{} - if err := github_com_gogo_protobuf_proto5.UnmarshalText(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestAction_AppendProtoText(t *testing9.T) { - popr := math_rand9.New(math_rand9.NewSource(time9.Now().UnixNano())) +func TestAction_AppendProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedAction_Append(popr, true) - data := github_com_gogo_protobuf_proto5.MarshalTextString(p) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) msg := &Action_Append{} - if err := github_com_gogo_protobuf_proto5.UnmarshalText(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestAction_AppendProtoCompactText(t *testing9.T) { - popr := math_rand9.New(math_rand9.NewSource(time9.Now().UnixNano())) +func TestAction_AppendProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedAction_Append(popr, true) - data := github_com_gogo_protobuf_proto5.CompactTextString(p) + data := github_com_gogo_protobuf_proto.CompactTextString(p) msg := &Action_Append{} - if err := github_com_gogo_protobuf_proto5.UnmarshalText(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestAction_TruncateProtoText(t *testing9.T) { - popr := math_rand9.New(math_rand9.NewSource(time9.Now().UnixNano())) +func TestAction_TruncateProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedAction_Truncate(popr, true) - data := github_com_gogo_protobuf_proto5.MarshalTextString(p) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) msg := &Action_Truncate{} - if err := github_com_gogo_protobuf_proto5.UnmarshalText(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestAction_TruncateProtoCompactText(t *testing9.T) { - popr := math_rand9.New(math_rand9.NewSource(time9.Now().UnixNano())) +func TestAction_TruncateProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedAction_Truncate(popr, true) - data := github_com_gogo_protobuf_proto5.CompactTextString(p) + data := github_com_gogo_protobuf_proto.CompactTextString(p) msg := &Action_Truncate{} - if err := github_com_gogo_protobuf_proto5.UnmarshalText(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestMetadataProtoText(t *testing9.T) { - popr := math_rand9.New(math_rand9.NewSource(time9.Now().UnixNano())) +func TestMetadataProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedMetadata(popr, true) - data := github_com_gogo_protobuf_proto5.MarshalTextString(p) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) msg := &Metadata{} - if err := github_com_gogo_protobuf_proto5.UnmarshalText(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestMetadataProtoCompactText(t *testing9.T) { - popr := math_rand9.New(math_rand9.NewSource(time9.Now().UnixNano())) +func TestMetadataProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedMetadata(popr, true) - data := github_com_gogo_protobuf_proto5.CompactTextString(p) + data := github_com_gogo_protobuf_proto.CompactTextString(p) msg := &Metadata{} - if err := github_com_gogo_protobuf_proto5.UnmarshalText(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestRecordProtoText(t *testing9.T) { - popr := math_rand9.New(math_rand9.NewSource(time9.Now().UnixNano())) +func TestRecordProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRecord(popr, true) - data := github_com_gogo_protobuf_proto5.MarshalTextString(p) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) msg := &Record{} - if err := github_com_gogo_protobuf_proto5.UnmarshalText(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestRecordProtoCompactText(t *testing9.T) { - popr := math_rand9.New(math_rand9.NewSource(time9.Now().UnixNano())) +func TestRecordProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRecord(popr, true) - data := github_com_gogo_protobuf_proto5.CompactTextString(p) + data := github_com_gogo_protobuf_proto.CompactTextString(p) msg := &Record{} - if err := github_com_gogo_protobuf_proto5.UnmarshalText(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestPromiseRequestProtoText(t *testing9.T) { - popr := math_rand9.New(math_rand9.NewSource(time9.Now().UnixNano())) +func TestPromiseRequestProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedPromiseRequest(popr, true) - data := github_com_gogo_protobuf_proto5.MarshalTextString(p) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) msg := &PromiseRequest{} - if err := github_com_gogo_protobuf_proto5.UnmarshalText(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestPromiseRequestProtoCompactText(t *testing9.T) { - popr := math_rand9.New(math_rand9.NewSource(time9.Now().UnixNano())) +func TestPromiseRequestProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedPromiseRequest(popr, true) - data := github_com_gogo_protobuf_proto5.CompactTextString(p) + data := github_com_gogo_protobuf_proto.CompactTextString(p) msg := &PromiseRequest{} - if err := github_com_gogo_protobuf_proto5.UnmarshalText(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestPromiseResponseProtoText(t *testing9.T) { - popr := math_rand9.New(math_rand9.NewSource(time9.Now().UnixNano())) +func TestPromiseResponseProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedPromiseResponse(popr, true) - data := github_com_gogo_protobuf_proto5.MarshalTextString(p) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) msg := &PromiseResponse{} - if err := github_com_gogo_protobuf_proto5.UnmarshalText(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestPromiseResponseProtoCompactText(t *testing9.T) { - popr := math_rand9.New(math_rand9.NewSource(time9.Now().UnixNano())) +func TestPromiseResponseProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedPromiseResponse(popr, true) - data := github_com_gogo_protobuf_proto5.CompactTextString(p) + data := github_com_gogo_protobuf_proto.CompactTextString(p) msg := &PromiseResponse{} - if err := github_com_gogo_protobuf_proto5.UnmarshalText(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestWriteRequestProtoText(t *testing9.T) { - popr := math_rand9.New(math_rand9.NewSource(time9.Now().UnixNano())) +func TestWriteRequestProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedWriteRequest(popr, true) - data := github_com_gogo_protobuf_proto5.MarshalTextString(p) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) msg := &WriteRequest{} - if err := github_com_gogo_protobuf_proto5.UnmarshalText(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestWriteRequestProtoCompactText(t *testing9.T) { - popr := math_rand9.New(math_rand9.NewSource(time9.Now().UnixNano())) +func TestWriteRequestProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedWriteRequest(popr, true) - data := github_com_gogo_protobuf_proto5.CompactTextString(p) + data := github_com_gogo_protobuf_proto.CompactTextString(p) msg := &WriteRequest{} - if err := github_com_gogo_protobuf_proto5.UnmarshalText(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestWriteResponseProtoText(t *testing9.T) { - popr := math_rand9.New(math_rand9.NewSource(time9.Now().UnixNano())) +func TestWriteResponseProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedWriteResponse(popr, true) - data := github_com_gogo_protobuf_proto5.MarshalTextString(p) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) msg := &WriteResponse{} - if err := github_com_gogo_protobuf_proto5.UnmarshalText(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestWriteResponseProtoCompactText(t *testing9.T) { - popr := math_rand9.New(math_rand9.NewSource(time9.Now().UnixNano())) +func TestWriteResponseProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedWriteResponse(popr, true) - data := github_com_gogo_protobuf_proto5.CompactTextString(p) + data := github_com_gogo_protobuf_proto.CompactTextString(p) msg := &WriteResponse{} - if err := github_com_gogo_protobuf_proto5.UnmarshalText(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestLearnedMessageProtoText(t *testing9.T) { - popr := math_rand9.New(math_rand9.NewSource(time9.Now().UnixNano())) +func TestLearnedMessageProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedLearnedMessage(popr, true) - data := github_com_gogo_protobuf_proto5.MarshalTextString(p) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) msg := &LearnedMessage{} - if err := github_com_gogo_protobuf_proto5.UnmarshalText(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestLearnedMessageProtoCompactText(t *testing9.T) { - popr := math_rand9.New(math_rand9.NewSource(time9.Now().UnixNano())) +func TestLearnedMessageProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedLearnedMessage(popr, true) - data := github_com_gogo_protobuf_proto5.CompactTextString(p) + data := github_com_gogo_protobuf_proto.CompactTextString(p) msg := &LearnedMessage{} - if err := github_com_gogo_protobuf_proto5.UnmarshalText(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestRecoverRequestProtoText(t *testing9.T) { - popr := math_rand9.New(math_rand9.NewSource(time9.Now().UnixNano())) +func TestRecoverRequestProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRecoverRequest(popr, true) - data := github_com_gogo_protobuf_proto5.MarshalTextString(p) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) msg := &RecoverRequest{} - if err := github_com_gogo_protobuf_proto5.UnmarshalText(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestRecoverRequestProtoCompactText(t *testing9.T) { - popr := math_rand9.New(math_rand9.NewSource(time9.Now().UnixNano())) +func TestRecoverRequestProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRecoverRequest(popr, true) - data := github_com_gogo_protobuf_proto5.CompactTextString(p) + data := github_com_gogo_protobuf_proto.CompactTextString(p) msg := &RecoverRequest{} - if err := github_com_gogo_protobuf_proto5.UnmarshalText(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestRecoverResponseProtoText(t *testing9.T) { - popr := math_rand9.New(math_rand9.NewSource(time9.Now().UnixNano())) +func TestRecoverResponseProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRecoverResponse(popr, true) - data := github_com_gogo_protobuf_proto5.MarshalTextString(p) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) msg := &RecoverResponse{} - if err := github_com_gogo_protobuf_proto5.UnmarshalText(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestRecoverResponseProtoCompactText(t *testing9.T) { - popr := math_rand9.New(math_rand9.NewSource(time9.Now().UnixNano())) +func TestRecoverResponseProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRecoverResponse(popr, true) - data := github_com_gogo_protobuf_proto5.CompactTextString(p) + data := github_com_gogo_protobuf_proto.CompactTextString(p) msg := &RecoverResponse{} - if err := github_com_gogo_protobuf_proto5.UnmarshalText(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestPromiseStringer(t *testing10.T) { - popr := math_rand10.New(math_rand10.NewSource(time10.Now().UnixNano())) +func TestPromiseVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedPromise(popr, false) - s1 := p.String() - s2 := fmt2.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + panic(err) + } + msg := &Promise{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + panic(err) + } + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) } } -func TestActionStringer(t *testing10.T) { - popr := math_rand10.New(math_rand10.NewSource(time10.Now().UnixNano())) +func TestActionVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedAction(popr, false) - s1 := p.String() - s2 := fmt2.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + panic(err) + } + msg := &Action{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + panic(err) + } + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) } } -func TestAction_NopStringer(t *testing10.T) { - popr := math_rand10.New(math_rand10.NewSource(time10.Now().UnixNano())) +func TestAction_NopVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedAction_Nop(popr, false) - s1 := p.String() - s2 := fmt2.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + panic(err) + } + msg := &Action_Nop{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + panic(err) + } + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) } } -func TestAction_AppendStringer(t *testing10.T) { - popr := math_rand10.New(math_rand10.NewSource(time10.Now().UnixNano())) +func TestAction_AppendVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedAction_Append(popr, false) - s1 := p.String() - s2 := fmt2.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + panic(err) + } + msg := &Action_Append{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + panic(err) + } + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) } } -func TestAction_TruncateStringer(t *testing10.T) { - popr := math_rand10.New(math_rand10.NewSource(time10.Now().UnixNano())) +func TestAction_TruncateVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedAction_Truncate(popr, false) - s1 := p.String() - s2 := fmt2.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + panic(err) + } + msg := &Action_Truncate{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + panic(err) + } + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) } } -func TestMetadataStringer(t *testing10.T) { - popr := math_rand10.New(math_rand10.NewSource(time10.Now().UnixNano())) +func TestMetadataVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedMetadata(popr, false) - s1 := p.String() - s2 := fmt2.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + panic(err) + } + msg := &Metadata{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + panic(err) + } + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) } } -func TestRecordStringer(t *testing10.T) { - popr := math_rand10.New(math_rand10.NewSource(time10.Now().UnixNano())) +func TestRecordVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedRecord(popr, false) - s1 := p.String() - s2 := fmt2.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + panic(err) + } + msg := &Record{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + panic(err) + } + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) } } -func TestPromiseRequestStringer(t *testing10.T) { - popr := math_rand10.New(math_rand10.NewSource(time10.Now().UnixNano())) +func TestPromiseRequestVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedPromiseRequest(popr, false) - s1 := p.String() - s2 := fmt2.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + panic(err) + } + msg := &PromiseRequest{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + panic(err) + } + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) } } -func TestPromiseResponseStringer(t *testing10.T) { - popr := math_rand10.New(math_rand10.NewSource(time10.Now().UnixNano())) +func TestPromiseResponseVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedPromiseResponse(popr, false) - s1 := p.String() - s2 := fmt2.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + panic(err) + } + msg := &PromiseResponse{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + panic(err) + } + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) } } -func TestWriteRequestStringer(t *testing10.T) { - popr := math_rand10.New(math_rand10.NewSource(time10.Now().UnixNano())) +func TestWriteRequestVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedWriteRequest(popr, false) - s1 := p.String() - s2 := fmt2.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + panic(err) + } + msg := &WriteRequest{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + panic(err) + } + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) } } -func TestWriteResponseStringer(t *testing10.T) { - popr := math_rand10.New(math_rand10.NewSource(time10.Now().UnixNano())) +func TestWriteResponseVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedWriteResponse(popr, false) - s1 := p.String() - s2 := fmt2.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + panic(err) } -} -func TestLearnedMessageStringer(t *testing10.T) { - popr := math_rand10.New(math_rand10.NewSource(time10.Now().UnixNano())) + msg := &WriteResponse{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + panic(err) + } + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) + } +} +func TestLearnedMessageVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedLearnedMessage(popr, false) - s1 := p.String() - s2 := fmt2.Sprintf("%v", p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + panic(err) + } + msg := &LearnedMessage{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + panic(err) + } + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) + } +} +func TestRecoverRequestVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedRecoverRequest(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + panic(err) + } + msg := &RecoverRequest{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + panic(err) + } + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) + } +} +func TestRecoverResponseVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedRecoverResponse(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + panic(err) + } + msg := &RecoverResponse{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + panic(err) + } + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) + } +} +func TestPromiseGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedPromise(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) } } -func TestRecoverRequestStringer(t *testing10.T) { - popr := math_rand10.New(math_rand10.NewSource(time10.Now().UnixNano())) +func TestActionGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedAction(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestAction_NopGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedAction_Nop(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestAction_AppendGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedAction_Append(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestAction_TruncateGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedAction_Truncate(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestMetadataGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedMetadata(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestRecordGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedRecord(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestPromiseRequestGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedPromiseRequest(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestPromiseResponseGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedPromiseResponse(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestWriteRequestGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedWriteRequest(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestWriteResponseGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedWriteResponse(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestLearnedMessageGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedLearnedMessage(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestRecoverRequestGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedRecoverRequest(popr, false) - s1 := p.String() - s2 := fmt2.Sprintf("%v", p) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) } } -func TestRecoverResponseStringer(t *testing10.T) { - popr := math_rand10.New(math_rand10.NewSource(time10.Now().UnixNano())) +func TestRecoverResponseGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedRecoverResponse(popr, false) - s1 := p.String() - s2 := fmt2.Sprintf("%v", p) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) } } -func TestPromiseSize(t *testing11.T) { - popr := math_rand11.New(math_rand11.NewSource(time11.Now().UnixNano())) +func TestPromiseSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedPromise(popr, true) - size2 := github_com_gogo_protobuf_proto6.Size(p) - data, err := github_com_gogo_protobuf_proto6.Marshal(p) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } size := p.Size() if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) } if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := github_com_gogo_protobuf_proto6.Size(p) + size3 := github_com_gogo_protobuf_proto.Size(p) if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } } -func BenchmarkPromiseSize(b *testing11.B) { - popr := math_rand11.New(math_rand11.NewSource(616)) +func BenchmarkPromiseSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 pops := make([]*Promise, 1000) for i := 0; i < 1000; i++ { @@ -2155,29 +2647,30 @@ func BenchmarkPromiseSize(b *testing11.B) { b.SetBytes(int64(total / b.N)) } -func TestActionSize(t *testing11.T) { - popr := math_rand11.New(math_rand11.NewSource(time11.Now().UnixNano())) +func TestActionSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedAction(popr, true) - size2 := github_com_gogo_protobuf_proto6.Size(p) - data, err := github_com_gogo_protobuf_proto6.Marshal(p) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } size := p.Size() if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) } if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := github_com_gogo_protobuf_proto6.Size(p) + size3 := github_com_gogo_protobuf_proto.Size(p) if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } } -func BenchmarkActionSize(b *testing11.B) { - popr := math_rand11.New(math_rand11.NewSource(616)) +func BenchmarkActionSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 pops := make([]*Action, 1000) for i := 0; i < 1000; i++ { @@ -2190,29 +2683,30 @@ func BenchmarkActionSize(b *testing11.B) { b.SetBytes(int64(total / b.N)) } -func TestAction_NopSize(t *testing11.T) { - popr := math_rand11.New(math_rand11.NewSource(time11.Now().UnixNano())) +func TestAction_NopSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedAction_Nop(popr, true) - size2 := github_com_gogo_protobuf_proto6.Size(p) - data, err := github_com_gogo_protobuf_proto6.Marshal(p) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } size := p.Size() if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) } if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := github_com_gogo_protobuf_proto6.Size(p) + size3 := github_com_gogo_protobuf_proto.Size(p) if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } } -func BenchmarkAction_NopSize(b *testing11.B) { - popr := math_rand11.New(math_rand11.NewSource(616)) +func BenchmarkAction_NopSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 pops := make([]*Action_Nop, 1000) for i := 0; i < 1000; i++ { @@ -2225,29 +2719,30 @@ func BenchmarkAction_NopSize(b *testing11.B) { b.SetBytes(int64(total / b.N)) } -func TestAction_AppendSize(t *testing11.T) { - popr := math_rand11.New(math_rand11.NewSource(time11.Now().UnixNano())) +func TestAction_AppendSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedAction_Append(popr, true) - size2 := github_com_gogo_protobuf_proto6.Size(p) - data, err := github_com_gogo_protobuf_proto6.Marshal(p) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } size := p.Size() if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) } if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := github_com_gogo_protobuf_proto6.Size(p) + size3 := github_com_gogo_protobuf_proto.Size(p) if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } } -func BenchmarkAction_AppendSize(b *testing11.B) { - popr := math_rand11.New(math_rand11.NewSource(616)) +func BenchmarkAction_AppendSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 pops := make([]*Action_Append, 1000) for i := 0; i < 1000; i++ { @@ -2260,29 +2755,30 @@ func BenchmarkAction_AppendSize(b *testing11.B) { b.SetBytes(int64(total / b.N)) } -func TestAction_TruncateSize(t *testing11.T) { - popr := math_rand11.New(math_rand11.NewSource(time11.Now().UnixNano())) +func TestAction_TruncateSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedAction_Truncate(popr, true) - size2 := github_com_gogo_protobuf_proto6.Size(p) - data, err := github_com_gogo_protobuf_proto6.Marshal(p) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } size := p.Size() if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) } if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := github_com_gogo_protobuf_proto6.Size(p) + size3 := github_com_gogo_protobuf_proto.Size(p) if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } } -func BenchmarkAction_TruncateSize(b *testing11.B) { - popr := math_rand11.New(math_rand11.NewSource(616)) +func BenchmarkAction_TruncateSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 pops := make([]*Action_Truncate, 1000) for i := 0; i < 1000; i++ { @@ -2295,29 +2791,30 @@ func BenchmarkAction_TruncateSize(b *testing11.B) { b.SetBytes(int64(total / b.N)) } -func TestMetadataSize(t *testing11.T) { - popr := math_rand11.New(math_rand11.NewSource(time11.Now().UnixNano())) +func TestMetadataSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedMetadata(popr, true) - size2 := github_com_gogo_protobuf_proto6.Size(p) - data, err := github_com_gogo_protobuf_proto6.Marshal(p) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } size := p.Size() if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) } if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := github_com_gogo_protobuf_proto6.Size(p) + size3 := github_com_gogo_protobuf_proto.Size(p) if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } } -func BenchmarkMetadataSize(b *testing11.B) { - popr := math_rand11.New(math_rand11.NewSource(616)) +func BenchmarkMetadataSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 pops := make([]*Metadata, 1000) for i := 0; i < 1000; i++ { @@ -2330,29 +2827,30 @@ func BenchmarkMetadataSize(b *testing11.B) { b.SetBytes(int64(total / b.N)) } -func TestRecordSize(t *testing11.T) { - popr := math_rand11.New(math_rand11.NewSource(time11.Now().UnixNano())) +func TestRecordSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRecord(popr, true) - size2 := github_com_gogo_protobuf_proto6.Size(p) - data, err := github_com_gogo_protobuf_proto6.Marshal(p) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } size := p.Size() if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) } if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := github_com_gogo_protobuf_proto6.Size(p) + size3 := github_com_gogo_protobuf_proto.Size(p) if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } } -func BenchmarkRecordSize(b *testing11.B) { - popr := math_rand11.New(math_rand11.NewSource(616)) +func BenchmarkRecordSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 pops := make([]*Record, 1000) for i := 0; i < 1000; i++ { @@ -2365,29 +2863,30 @@ func BenchmarkRecordSize(b *testing11.B) { b.SetBytes(int64(total / b.N)) } -func TestPromiseRequestSize(t *testing11.T) { - popr := math_rand11.New(math_rand11.NewSource(time11.Now().UnixNano())) +func TestPromiseRequestSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedPromiseRequest(popr, true) - size2 := github_com_gogo_protobuf_proto6.Size(p) - data, err := github_com_gogo_protobuf_proto6.Marshal(p) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } size := p.Size() if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) } if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := github_com_gogo_protobuf_proto6.Size(p) + size3 := github_com_gogo_protobuf_proto.Size(p) if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } } -func BenchmarkPromiseRequestSize(b *testing11.B) { - popr := math_rand11.New(math_rand11.NewSource(616)) +func BenchmarkPromiseRequestSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 pops := make([]*PromiseRequest, 1000) for i := 0; i < 1000; i++ { @@ -2400,29 +2899,30 @@ func BenchmarkPromiseRequestSize(b *testing11.B) { b.SetBytes(int64(total / b.N)) } -func TestPromiseResponseSize(t *testing11.T) { - popr := math_rand11.New(math_rand11.NewSource(time11.Now().UnixNano())) +func TestPromiseResponseSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedPromiseResponse(popr, true) - size2 := github_com_gogo_protobuf_proto6.Size(p) - data, err := github_com_gogo_protobuf_proto6.Marshal(p) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } size := p.Size() if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) } if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := github_com_gogo_protobuf_proto6.Size(p) + size3 := github_com_gogo_protobuf_proto.Size(p) if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } } -func BenchmarkPromiseResponseSize(b *testing11.B) { - popr := math_rand11.New(math_rand11.NewSource(616)) +func BenchmarkPromiseResponseSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 pops := make([]*PromiseResponse, 1000) for i := 0; i < 1000; i++ { @@ -2435,29 +2935,30 @@ func BenchmarkPromiseResponseSize(b *testing11.B) { b.SetBytes(int64(total / b.N)) } -func TestWriteRequestSize(t *testing11.T) { - popr := math_rand11.New(math_rand11.NewSource(time11.Now().UnixNano())) +func TestWriteRequestSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedWriteRequest(popr, true) - size2 := github_com_gogo_protobuf_proto6.Size(p) - data, err := github_com_gogo_protobuf_proto6.Marshal(p) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } size := p.Size() if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) } if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := github_com_gogo_protobuf_proto6.Size(p) + size3 := github_com_gogo_protobuf_proto.Size(p) if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } } -func BenchmarkWriteRequestSize(b *testing11.B) { - popr := math_rand11.New(math_rand11.NewSource(616)) +func BenchmarkWriteRequestSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 pops := make([]*WriteRequest, 1000) for i := 0; i < 1000; i++ { @@ -2470,29 +2971,30 @@ func BenchmarkWriteRequestSize(b *testing11.B) { b.SetBytes(int64(total / b.N)) } -func TestWriteResponseSize(t *testing11.T) { - popr := math_rand11.New(math_rand11.NewSource(time11.Now().UnixNano())) +func TestWriteResponseSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedWriteResponse(popr, true) - size2 := github_com_gogo_protobuf_proto6.Size(p) - data, err := github_com_gogo_protobuf_proto6.Marshal(p) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } size := p.Size() if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) } if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := github_com_gogo_protobuf_proto6.Size(p) + size3 := github_com_gogo_protobuf_proto.Size(p) if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } } -func BenchmarkWriteResponseSize(b *testing11.B) { - popr := math_rand11.New(math_rand11.NewSource(616)) +func BenchmarkWriteResponseSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 pops := make([]*WriteResponse, 1000) for i := 0; i < 1000; i++ { @@ -2505,29 +3007,30 @@ func BenchmarkWriteResponseSize(b *testing11.B) { b.SetBytes(int64(total / b.N)) } -func TestLearnedMessageSize(t *testing11.T) { - popr := math_rand11.New(math_rand11.NewSource(time11.Now().UnixNano())) +func TestLearnedMessageSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedLearnedMessage(popr, true) - size2 := github_com_gogo_protobuf_proto6.Size(p) - data, err := github_com_gogo_protobuf_proto6.Marshal(p) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } size := p.Size() if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) } if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := github_com_gogo_protobuf_proto6.Size(p) + size3 := github_com_gogo_protobuf_proto.Size(p) if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } } -func BenchmarkLearnedMessageSize(b *testing11.B) { - popr := math_rand11.New(math_rand11.NewSource(616)) +func BenchmarkLearnedMessageSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 pops := make([]*LearnedMessage, 1000) for i := 0; i < 1000; i++ { @@ -2540,29 +3043,30 @@ func BenchmarkLearnedMessageSize(b *testing11.B) { b.SetBytes(int64(total / b.N)) } -func TestRecoverRequestSize(t *testing11.T) { - popr := math_rand11.New(math_rand11.NewSource(time11.Now().UnixNano())) +func TestRecoverRequestSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRecoverRequest(popr, true) - size2 := github_com_gogo_protobuf_proto6.Size(p) - data, err := github_com_gogo_protobuf_proto6.Marshal(p) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } size := p.Size() if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) } if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := github_com_gogo_protobuf_proto6.Size(p) + size3 := github_com_gogo_protobuf_proto.Size(p) if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } } -func BenchmarkRecoverRequestSize(b *testing11.B) { - popr := math_rand11.New(math_rand11.NewSource(616)) +func BenchmarkRecoverRequestSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 pops := make([]*RecoverRequest, 1000) for i := 0; i < 1000; i++ { @@ -2575,29 +3079,30 @@ func BenchmarkRecoverRequestSize(b *testing11.B) { b.SetBytes(int64(total / b.N)) } -func TestRecoverResponseSize(t *testing11.T) { - popr := math_rand11.New(math_rand11.NewSource(time11.Now().UnixNano())) +func TestRecoverResponseSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRecoverResponse(popr, true) - size2 := github_com_gogo_protobuf_proto6.Size(p) - data, err := github_com_gogo_protobuf_proto6.Marshal(p) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } size := p.Size() if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) } if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := github_com_gogo_protobuf_proto6.Size(p) + size3 := github_com_gogo_protobuf_proto.Size(p) if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } } -func BenchmarkRecoverResponseSize(b *testing11.B) { - popr := math_rand11.New(math_rand11.NewSource(616)) +func BenchmarkRecoverResponseSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 pops := make([]*RecoverResponse, 1000) for i := 0; i < 1000; i++ { @@ -2610,396 +3115,130 @@ func BenchmarkRecoverResponseSize(b *testing11.B) { b.SetBytes(int64(total / b.N)) } -func TestPromiseGoString(t *testing12.T) { - popr := math_rand12.New(math_rand12.NewSource(time12.Now().UnixNano())) +func TestPromiseStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedPromise(popr, false) - s1 := p.GoString() - s2 := fmt3.Sprintf("%#v", p) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) - } - _, err := go_parser1.ParseExpr(s1) - if err != nil { - panic(err) + t.Fatalf("String want %v got %v", s1, s2) } } -func TestActionGoString(t *testing12.T) { - popr := math_rand12.New(math_rand12.NewSource(time12.Now().UnixNano())) +func TestActionStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedAction(popr, false) - s1 := p.GoString() - s2 := fmt3.Sprintf("%#v", p) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) - } - _, err := go_parser1.ParseExpr(s1) - if err != nil { - panic(err) + t.Fatalf("String want %v got %v", s1, s2) } } -func TestAction_NopGoString(t *testing12.T) { - popr := math_rand12.New(math_rand12.NewSource(time12.Now().UnixNano())) +func TestAction_NopStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedAction_Nop(popr, false) - s1 := p.GoString() - s2 := fmt3.Sprintf("%#v", p) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) - } - _, err := go_parser1.ParseExpr(s1) - if err != nil { - panic(err) + t.Fatalf("String want %v got %v", s1, s2) } } -func TestAction_AppendGoString(t *testing12.T) { - popr := math_rand12.New(math_rand12.NewSource(time12.Now().UnixNano())) +func TestAction_AppendStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedAction_Append(popr, false) - s1 := p.GoString() - s2 := fmt3.Sprintf("%#v", p) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) - } - _, err := go_parser1.ParseExpr(s1) - if err != nil { - panic(err) + t.Fatalf("String want %v got %v", s1, s2) } } -func TestAction_TruncateGoString(t *testing12.T) { - popr := math_rand12.New(math_rand12.NewSource(time12.Now().UnixNano())) +func TestAction_TruncateStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedAction_Truncate(popr, false) - s1 := p.GoString() - s2 := fmt3.Sprintf("%#v", p) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) - } - _, err := go_parser1.ParseExpr(s1) - if err != nil { - panic(err) + t.Fatalf("String want %v got %v", s1, s2) } } -func TestMetadataGoString(t *testing12.T) { - popr := math_rand12.New(math_rand12.NewSource(time12.Now().UnixNano())) +func TestMetadataStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedMetadata(popr, false) - s1 := p.GoString() - s2 := fmt3.Sprintf("%#v", p) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) - } - _, err := go_parser1.ParseExpr(s1) - if err != nil { - panic(err) + t.Fatalf("String want %v got %v", s1, s2) } } -func TestRecordGoString(t *testing12.T) { - popr := math_rand12.New(math_rand12.NewSource(time12.Now().UnixNano())) +func TestRecordStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedRecord(popr, false) - s1 := p.GoString() - s2 := fmt3.Sprintf("%#v", p) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) - } - _, err := go_parser1.ParseExpr(s1) - if err != nil { - panic(err) + t.Fatalf("String want %v got %v", s1, s2) } } -func TestPromiseRequestGoString(t *testing12.T) { - popr := math_rand12.New(math_rand12.NewSource(time12.Now().UnixNano())) +func TestPromiseRequestStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedPromiseRequest(popr, false) - s1 := p.GoString() - s2 := fmt3.Sprintf("%#v", p) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) - } - _, err := go_parser1.ParseExpr(s1) - if err != nil { - panic(err) + t.Fatalf("String want %v got %v", s1, s2) } } -func TestPromiseResponseGoString(t *testing12.T) { - popr := math_rand12.New(math_rand12.NewSource(time12.Now().UnixNano())) +func TestPromiseResponseStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedPromiseResponse(popr, false) - s1 := p.GoString() - s2 := fmt3.Sprintf("%#v", p) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) - } - _, err := go_parser1.ParseExpr(s1) - if err != nil { - panic(err) + t.Fatalf("String want %v got %v", s1, s2) } } -func TestWriteRequestGoString(t *testing12.T) { - popr := math_rand12.New(math_rand12.NewSource(time12.Now().UnixNano())) +func TestWriteRequestStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedWriteRequest(popr, false) - s1 := p.GoString() - s2 := fmt3.Sprintf("%#v", p) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) - } - _, err := go_parser1.ParseExpr(s1) - if err != nil { - panic(err) + t.Fatalf("String want %v got %v", s1, s2) } } -func TestWriteResponseGoString(t *testing12.T) { - popr := math_rand12.New(math_rand12.NewSource(time12.Now().UnixNano())) +func TestWriteResponseStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedWriteResponse(popr, false) - s1 := p.GoString() - s2 := fmt3.Sprintf("%#v", p) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) - } - _, err := go_parser1.ParseExpr(s1) - if err != nil { - panic(err) + t.Fatalf("String want %v got %v", s1, s2) } } -func TestLearnedMessageGoString(t *testing12.T) { - popr := math_rand12.New(math_rand12.NewSource(time12.Now().UnixNano())) +func TestLearnedMessageStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedLearnedMessage(popr, false) - s1 := p.GoString() - s2 := fmt3.Sprintf("%#v", p) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) - } - _, err := go_parser1.ParseExpr(s1) - if err != nil { - panic(err) + t.Fatalf("String want %v got %v", s1, s2) } } -func TestRecoverRequestGoString(t *testing12.T) { - popr := math_rand12.New(math_rand12.NewSource(time12.Now().UnixNano())) +func TestRecoverRequestStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedRecoverRequest(popr, false) - s1 := p.GoString() - s2 := fmt3.Sprintf("%#v", p) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) - } - _, err := go_parser1.ParseExpr(s1) - if err != nil { - panic(err) + t.Fatalf("String want %v got %v", s1, s2) } } -func TestRecoverResponseGoString(t *testing12.T) { - popr := math_rand12.New(math_rand12.NewSource(time12.Now().UnixNano())) +func TestRecoverResponseStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedRecoverResponse(popr, false) - s1 := p.GoString() - s2 := fmt3.Sprintf("%#v", p) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) - } - _, err := go_parser1.ParseExpr(s1) - if err != nil { - panic(err) - } -} -func TestPromiseVerboseEqual(t *testing13.T) { - popr := math_rand13.New(math_rand13.NewSource(time13.Now().UnixNano())) - p := NewPopulatedPromise(popr, false) - data, err := github_com_gogo_protobuf_proto7.Marshal(p) - if err != nil { - panic(err) - } - msg := &Promise{} - if err := github_com_gogo_protobuf_proto7.Unmarshal(data, msg); err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) - } -} -func TestActionVerboseEqual(t *testing13.T) { - popr := math_rand13.New(math_rand13.NewSource(time13.Now().UnixNano())) - p := NewPopulatedAction(popr, false) - data, err := github_com_gogo_protobuf_proto7.Marshal(p) - if err != nil { - panic(err) - } - msg := &Action{} - if err := github_com_gogo_protobuf_proto7.Unmarshal(data, msg); err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) - } -} -func TestAction_NopVerboseEqual(t *testing13.T) { - popr := math_rand13.New(math_rand13.NewSource(time13.Now().UnixNano())) - p := NewPopulatedAction_Nop(popr, false) - data, err := github_com_gogo_protobuf_proto7.Marshal(p) - if err != nil { - panic(err) - } - msg := &Action_Nop{} - if err := github_com_gogo_protobuf_proto7.Unmarshal(data, msg); err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) - } -} -func TestAction_AppendVerboseEqual(t *testing13.T) { - popr := math_rand13.New(math_rand13.NewSource(time13.Now().UnixNano())) - p := NewPopulatedAction_Append(popr, false) - data, err := github_com_gogo_protobuf_proto7.Marshal(p) - if err != nil { - panic(err) - } - msg := &Action_Append{} - if err := github_com_gogo_protobuf_proto7.Unmarshal(data, msg); err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) - } -} -func TestAction_TruncateVerboseEqual(t *testing13.T) { - popr := math_rand13.New(math_rand13.NewSource(time13.Now().UnixNano())) - p := NewPopulatedAction_Truncate(popr, false) - data, err := github_com_gogo_protobuf_proto7.Marshal(p) - if err != nil { - panic(err) - } - msg := &Action_Truncate{} - if err := github_com_gogo_protobuf_proto7.Unmarshal(data, msg); err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) - } -} -func TestMetadataVerboseEqual(t *testing13.T) { - popr := math_rand13.New(math_rand13.NewSource(time13.Now().UnixNano())) - p := NewPopulatedMetadata(popr, false) - data, err := github_com_gogo_protobuf_proto7.Marshal(p) - if err != nil { - panic(err) - } - msg := &Metadata{} - if err := github_com_gogo_protobuf_proto7.Unmarshal(data, msg); err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) - } -} -func TestRecordVerboseEqual(t *testing13.T) { - popr := math_rand13.New(math_rand13.NewSource(time13.Now().UnixNano())) - p := NewPopulatedRecord(popr, false) - data, err := github_com_gogo_protobuf_proto7.Marshal(p) - if err != nil { - panic(err) - } - msg := &Record{} - if err := github_com_gogo_protobuf_proto7.Unmarshal(data, msg); err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) - } -} -func TestPromiseRequestVerboseEqual(t *testing13.T) { - popr := math_rand13.New(math_rand13.NewSource(time13.Now().UnixNano())) - p := NewPopulatedPromiseRequest(popr, false) - data, err := github_com_gogo_protobuf_proto7.Marshal(p) - if err != nil { - panic(err) - } - msg := &PromiseRequest{} - if err := github_com_gogo_protobuf_proto7.Unmarshal(data, msg); err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) - } -} -func TestPromiseResponseVerboseEqual(t *testing13.T) { - popr := math_rand13.New(math_rand13.NewSource(time13.Now().UnixNano())) - p := NewPopulatedPromiseResponse(popr, false) - data, err := github_com_gogo_protobuf_proto7.Marshal(p) - if err != nil { - panic(err) - } - msg := &PromiseResponse{} - if err := github_com_gogo_protobuf_proto7.Unmarshal(data, msg); err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) - } -} -func TestWriteRequestVerboseEqual(t *testing13.T) { - popr := math_rand13.New(math_rand13.NewSource(time13.Now().UnixNano())) - p := NewPopulatedWriteRequest(popr, false) - data, err := github_com_gogo_protobuf_proto7.Marshal(p) - if err != nil { - panic(err) - } - msg := &WriteRequest{} - if err := github_com_gogo_protobuf_proto7.Unmarshal(data, msg); err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) - } -} -func TestWriteResponseVerboseEqual(t *testing13.T) { - popr := math_rand13.New(math_rand13.NewSource(time13.Now().UnixNano())) - p := NewPopulatedWriteResponse(popr, false) - data, err := github_com_gogo_protobuf_proto7.Marshal(p) - if err != nil { - panic(err) - } - msg := &WriteResponse{} - if err := github_com_gogo_protobuf_proto7.Unmarshal(data, msg); err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) - } -} -func TestLearnedMessageVerboseEqual(t *testing13.T) { - popr := math_rand13.New(math_rand13.NewSource(time13.Now().UnixNano())) - p := NewPopulatedLearnedMessage(popr, false) - data, err := github_com_gogo_protobuf_proto7.Marshal(p) - if err != nil { - panic(err) - } - msg := &LearnedMessage{} - if err := github_com_gogo_protobuf_proto7.Unmarshal(data, msg); err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) - } -} -func TestRecoverRequestVerboseEqual(t *testing13.T) { - popr := math_rand13.New(math_rand13.NewSource(time13.Now().UnixNano())) - p := NewPopulatedRecoverRequest(popr, false) - data, err := github_com_gogo_protobuf_proto7.Marshal(p) - if err != nil { - panic(err) - } - msg := &RecoverRequest{} - if err := github_com_gogo_protobuf_proto7.Unmarshal(data, msg); err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) - } -} -func TestRecoverResponseVerboseEqual(t *testing13.T) { - popr := math_rand13.New(math_rand13.NewSource(time13.Now().UnixNano())) - p := NewPopulatedRecoverResponse(popr, false) - data, err := github_com_gogo_protobuf_proto7.Marshal(p) - if err != nil { - panic(err) - } - msg := &RecoverResponse{} - if err := github_com_gogo_protobuf_proto7.Unmarshal(data, msg); err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) + t.Fatalf("String want %v got %v", s1, s2) } } diff --git a/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/mesos.pb.go b/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/mesos.pb.go index a39d1cc6c8c0..007d24d3fdb4 100644 --- a/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/mesos.pb.go +++ b/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/mesos.pb.go @@ -5,33 +5,24 @@ package mesosproto import proto "github.com/gogo/protobuf/proto" +import fmt "fmt" import math "math" -// discarding unused import gogoproto "github.com/gogo/protobuf/gogoproto/gogo.pb" +// discarding unused import gogoproto "github.com/gogo/protobuf/gogoproto" -import io "io" -import math1 "math" -import fmt "fmt" -import github_com_gogo_protobuf_proto "github.com/gogo/protobuf/proto" +import bytes "bytes" -import fmt1 "fmt" import strings "strings" -import reflect "reflect" - -import math2 "math" - -import fmt2 "fmt" -import strings1 "strings" -import github_com_gogo_protobuf_proto1 "github.com/gogo/protobuf/proto" +import github_com_gogo_protobuf_proto "github.com/gogo/protobuf/proto" import sort "sort" import strconv "strconv" -import reflect1 "reflect" +import reflect "reflect" -import fmt3 "fmt" -import bytes "bytes" +import io "io" // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal +var _ = fmt.Errorf var _ = math.Inf // * @@ -92,9 +83,7 @@ const ( TaskState_TASK_FAILED TaskState = 3 TaskState_TASK_KILLED TaskState = 4 TaskState_TASK_LOST TaskState = 5 - // TASK_ERROR is currently unused but will be introduced in 0.22.0. - // TODO(dhamon): Start using TASK_ERROR. - TaskState_TASK_ERROR TaskState = 7 + TaskState_TASK_ERROR TaskState = 7 ) var TaskState_name = map[int32]string{ @@ -135,6 +124,39 @@ func (x *TaskState) UnmarshalJSON(data []byte) error { return nil } +type FrameworkInfo_Capability_Type int32 + +const ( + // Receive offers with revocable resources. See 'Resource' + // message for details. + // TODO(vinod): This is currently a no-op. + FrameworkInfo_Capability_REVOCABLE_RESOURCES FrameworkInfo_Capability_Type = 1 +) + +var FrameworkInfo_Capability_Type_name = map[int32]string{ + 1: "REVOCABLE_RESOURCES", +} +var FrameworkInfo_Capability_Type_value = map[string]int32{ + "REVOCABLE_RESOURCES": 1, +} + +func (x FrameworkInfo_Capability_Type) Enum() *FrameworkInfo_Capability_Type { + p := new(FrameworkInfo_Capability_Type) + *p = x + return p +} +func (x FrameworkInfo_Capability_Type) String() string { + return proto.EnumName(FrameworkInfo_Capability_Type_name, int32(x)) +} +func (x *FrameworkInfo_Capability_Type) UnmarshalJSON(data []byte) error { + value, err := proto.UnmarshalJSONEnum(FrameworkInfo_Capability_Type_value, data, "FrameworkInfo_Capability_Type") + if err != nil { + return err + } + *x = FrameworkInfo_Capability_Type(value) + return nil +} + type Value_Type int32 const ( @@ -174,7 +196,49 @@ func (x *Value_Type) UnmarshalJSON(data []byte) error { return nil } -// * Describes the source of the task status update. +type Offer_Operation_Type int32 + +const ( + Offer_Operation_LAUNCH Offer_Operation_Type = 1 + Offer_Operation_RESERVE Offer_Operation_Type = 2 + Offer_Operation_UNRESERVE Offer_Operation_Type = 3 + Offer_Operation_CREATE Offer_Operation_Type = 4 + Offer_Operation_DESTROY Offer_Operation_Type = 5 +) + +var Offer_Operation_Type_name = map[int32]string{ + 1: "LAUNCH", + 2: "RESERVE", + 3: "UNRESERVE", + 4: "CREATE", + 5: "DESTROY", +} +var Offer_Operation_Type_value = map[string]int32{ + "LAUNCH": 1, + "RESERVE": 2, + "UNRESERVE": 3, + "CREATE": 4, + "DESTROY": 5, +} + +func (x Offer_Operation_Type) Enum() *Offer_Operation_Type { + p := new(Offer_Operation_Type) + *p = x + return p +} +func (x Offer_Operation_Type) String() string { + return proto.EnumName(Offer_Operation_Type_name, int32(x)) +} +func (x *Offer_Operation_Type) UnmarshalJSON(data []byte) error { + value, err := proto.UnmarshalJSONEnum(Offer_Operation_Type_value, data, "Offer_Operation_Type") + if err != nil { + return err + } + *x = Offer_Operation_Type(value) + return nil +} + +// Describes the source of the task status update. type TaskStatus_Source int32 const ( @@ -211,11 +275,15 @@ func (x *TaskStatus_Source) UnmarshalJSON(data []byte) error { return nil } -// * Detailed reason for the task status update. +// Detailed reason for the task status update. +// +// TODO(bmahler): Differentiate between slave removal reasons +// (e.g. unhealthy vs. unregistered for maintenance). type TaskStatus_Reason int32 const ( TaskStatus_REASON_COMMAND_EXECUTOR_FAILED TaskStatus_Reason = 0 + TaskStatus_REASON_EXECUTOR_PREEMPTED TaskStatus_Reason = 17 TaskStatus_REASON_EXECUTOR_TERMINATED TaskStatus_Reason = 1 TaskStatus_REASON_EXECUTOR_UNREGISTERED TaskStatus_Reason = 2 TaskStatus_REASON_FRAMEWORK_REMOVED TaskStatus_Reason = 3 @@ -225,6 +293,7 @@ const ( TaskStatus_REASON_MASTER_DISCONNECTED TaskStatus_Reason = 7 TaskStatus_REASON_MEMORY_LIMIT TaskStatus_Reason = 8 TaskStatus_REASON_RECONCILIATION TaskStatus_Reason = 9 + TaskStatus_REASON_RESOURCES_UNKNOWN TaskStatus_Reason = 18 TaskStatus_REASON_SLAVE_DISCONNECTED TaskStatus_Reason = 10 TaskStatus_REASON_SLAVE_REMOVED TaskStatus_Reason = 11 TaskStatus_REASON_SLAVE_RESTARTED TaskStatus_Reason = 12 @@ -236,6 +305,7 @@ const ( var TaskStatus_Reason_name = map[int32]string{ 0: "REASON_COMMAND_EXECUTOR_FAILED", + 17: "REASON_EXECUTOR_PREEMPTED", 1: "REASON_EXECUTOR_TERMINATED", 2: "REASON_EXECUTOR_UNREGISTERED", 3: "REASON_FRAMEWORK_REMOVED", @@ -245,6 +315,7 @@ var TaskStatus_Reason_name = map[int32]string{ 7: "REASON_MASTER_DISCONNECTED", 8: "REASON_MEMORY_LIMIT", 9: "REASON_RECONCILIATION", + 18: "REASON_RESOURCES_UNKNOWN", 10: "REASON_SLAVE_DISCONNECTED", 11: "REASON_SLAVE_REMOVED", 12: "REASON_SLAVE_RESTARTED", @@ -255,6 +326,7 @@ var TaskStatus_Reason_name = map[int32]string{ } var TaskStatus_Reason_value = map[string]int32{ "REASON_COMMAND_EXECUTOR_FAILED": 0, + "REASON_EXECUTOR_PREEMPTED": 17, "REASON_EXECUTOR_TERMINATED": 1, "REASON_EXECUTOR_UNREGISTERED": 2, "REASON_FRAMEWORK_REMOVED": 3, @@ -264,6 +336,7 @@ var TaskStatus_Reason_value = map[string]int32{ "REASON_MASTER_DISCONNECTED": 7, "REASON_MEMORY_LIMIT": 8, "REASON_RECONCILIATION": 9, + "REASON_RESOURCES_UNKNOWN": 18, "REASON_SLAVE_DISCONNECTED": 10, "REASON_SLAVE_REMOVED": 11, "REASON_SLAVE_RESTARTED": 12, @@ -430,6 +503,42 @@ func (x *ContainerInfo_DockerInfo_Network) UnmarshalJSON(data []byte) error { return nil } +type DiscoveryInfo_Visibility int32 + +const ( + DiscoveryInfo_FRAMEWORK DiscoveryInfo_Visibility = 0 + DiscoveryInfo_CLUSTER DiscoveryInfo_Visibility = 1 + DiscoveryInfo_EXTERNAL DiscoveryInfo_Visibility = 2 +) + +var DiscoveryInfo_Visibility_name = map[int32]string{ + 0: "FRAMEWORK", + 1: "CLUSTER", + 2: "EXTERNAL", +} +var DiscoveryInfo_Visibility_value = map[string]int32{ + "FRAMEWORK": 0, + "CLUSTER": 1, + "EXTERNAL": 2, +} + +func (x DiscoveryInfo_Visibility) Enum() *DiscoveryInfo_Visibility { + p := new(DiscoveryInfo_Visibility) + *p = x + return p +} +func (x DiscoveryInfo_Visibility) String() string { + return proto.EnumName(DiscoveryInfo_Visibility_name, int32(x)) +} +func (x *DiscoveryInfo_Visibility) UnmarshalJSON(data []byte) error { + value, err := proto.UnmarshalJSONEnum(DiscoveryInfo_Visibility_value, data, "DiscoveryInfo_Visibility") + if err != nil { + return err + } + *x = DiscoveryInfo_Visibility(value) + return nil +} + // * // A unique ID assigned to a framework. A framework can reuse this ID // in order to do failover (see MesosSchedulerDriver). @@ -544,41 +653,51 @@ func (m *ContainerID) GetValue() string { } // * -// Describes a framework. The user field is used to determine the -// Unix user that an executor/task should be launched as. If the user -// field is set to an empty string Mesos will automagically set it -// to the current user. Note that the ID is only available after a -// framework has registered, however, it is included here in order to -// facilitate scheduler failover (i.e., if it is set then the -// MesosSchedulerDriver expects the scheduler is performing failover). -// The amount of time that the master will wait for the scheduler to -// failover before removing the framework is specified by -// failover_timeout. If checkpoint is set, framework pid, executor -// pids and status updates are checkpointed to disk by the slaves. -// Checkpointing allows a restarted slave to reconnect with old -// executors and recover status updates, at the cost of disk I/O. -// The role field is used to group frameworks for allocation -// decisions, depending on the allocation policy being used. -// If the hostname field is set to an empty string Mesos will -// automagically set it to the current hostname. -// The principal field should match the credential the framework uses -// in authentication. This field is used for framework API rate -// exporting and limiting and should be set even if authentication is -// not enabled if these features are desired. -// The webui_url field allows a framework to advertise its web UI, so -// that the Mesos web UI can link to it. It is expected to be a full -// URL, for example http://my-scheduler.example.com:8080/. +// Describes a framework. type FrameworkInfo struct { - User *string `protobuf:"bytes,1,req,name=user" json:"user,omitempty"` - Name *string `protobuf:"bytes,2,req,name=name" json:"name,omitempty"` - Id *FrameworkID `protobuf:"bytes,3,opt,name=id" json:"id,omitempty"` - FailoverTimeout *float64 `protobuf:"fixed64,4,opt,name=failover_timeout,def=0" json:"failover_timeout,omitempty"` - Checkpoint *bool `protobuf:"varint,5,opt,name=checkpoint,def=0" json:"checkpoint,omitempty"` - Role *string `protobuf:"bytes,6,opt,name=role,def=*" json:"role,omitempty"` - Hostname *string `protobuf:"bytes,7,opt,name=hostname" json:"hostname,omitempty"` - Principal *string `protobuf:"bytes,8,opt,name=principal" json:"principal,omitempty"` - WebuiUrl *string `protobuf:"bytes,9,opt,name=webui_url" json:"webui_url,omitempty"` - XXX_unrecognized []byte `json:"-"` + // Used to determine the Unix user that an executor or task should + // be launched as. If the user field is set to an empty string Mesos + // will automagically set it to the current user. + User *string `protobuf:"bytes,1,req,name=user" json:"user,omitempty"` + // Name of the framework that shows up in the Mesos Web UI. + Name *string `protobuf:"bytes,2,req,name=name" json:"name,omitempty"` + // Note that 'id' is only available after a framework has + // registered, however, it is included here in order to facilitate + // scheduler failover (i.e., if it is set then the + // MesosSchedulerDriver expects the scheduler is performing + // failover). + Id *FrameworkID `protobuf:"bytes,3,opt,name=id" json:"id,omitempty"` + // The amount of time that the master will wait for the scheduler to + // failover before it tears down the framework by killing all its + // tasks/executors. This should be non-zero if a framework expects + // to reconnect after a failover and not lose its tasks/executors. + FailoverTimeout *float64 `protobuf:"fixed64,4,opt,name=failover_timeout,def=0" json:"failover_timeout,omitempty"` + // If set, framework pid, executor pids and status updates are + // checkpointed to disk by the slaves. Checkpointing allows a + // restarted slave to reconnect with old executors and recover + // status updates, at the cost of disk I/O. + Checkpoint *bool `protobuf:"varint,5,opt,name=checkpoint,def=0" json:"checkpoint,omitempty"` + // Used to group frameworks for allocation decisions, depending on + // the allocation policy being used. + Role *string `protobuf:"bytes,6,opt,name=role,def=*" json:"role,omitempty"` + // Used to indicate the current host from which the scheduler is + // registered in the Mesos Web UI. If set to an empty string Mesos + // will automagically set it to the current hostname. + Hostname *string `protobuf:"bytes,7,opt,name=hostname" json:"hostname,omitempty"` + // This field should match the credential's principal the framework + // uses for authentication. This field is used for framework API + // rate limiting and dynamic reservations. It should be set even + // if authentication is not enabled if these features are desired. + Principal *string `protobuf:"bytes,8,opt,name=principal" json:"principal,omitempty"` + // This field allows a framework to advertise its web UI, so that + // the Mesos web UI can link to it. It is expected to be a full URL, + // for example http://my-scheduler.example.com:8080/. + WebuiUrl *string `protobuf:"bytes,9,opt,name=webui_url" json:"webui_url,omitempty"` + // This field allows a framework to advertise its set of + // capabilities (e.g., ability to receive offers for revocable + // resources). + Capabilities []*FrameworkInfo_Capability `protobuf:"bytes,10,rep,name=capabilities" json:"capabilities,omitempty"` + XXX_unrecognized []byte `json:"-"` } func (m *FrameworkInfo) Reset() { *m = FrameworkInfo{} } @@ -651,12 +770,35 @@ func (m *FrameworkInfo) GetWebuiUrl() string { return "" } +func (m *FrameworkInfo) GetCapabilities() []*FrameworkInfo_Capability { + if m != nil { + return m.Capabilities + } + return nil +} + +type FrameworkInfo_Capability struct { + Type *FrameworkInfo_Capability_Type `protobuf:"varint,1,req,name=type,enum=mesosproto.FrameworkInfo_Capability_Type" json:"type,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *FrameworkInfo_Capability) Reset() { *m = FrameworkInfo_Capability{} } +func (*FrameworkInfo_Capability) ProtoMessage() {} + +func (m *FrameworkInfo_Capability) GetType() FrameworkInfo_Capability_Type { + if m != nil && m.Type != nil { + return *m.Type + } + return FrameworkInfo_Capability_REVOCABLE_RESOURCES +} + // * // Describes a health check for a task or executor (or any arbitrary // process/command). A "strategy" is picked by specifying one of the -// optional fields, currently only 'http' and 'command' are -// supported. Specifying more than one strategy is an error. +// optional fields; currently only 'command' is supported. +// Specifying more than one strategy is an error. type HealthCheck struct { + // HTTP health check - not yet recommended for use, see MESOS-2533. Http *HealthCheck_HTTP `protobuf:"bytes,1,opt,name=http" json:"http,omitempty"` // Amount of time to wait until starting the health checks. DelaySeconds *float64 `protobuf:"fixed64,2,opt,name=delay_seconds,def=15" json:"delay_seconds,omitempty"` @@ -731,7 +873,8 @@ func (m *HealthCheck) GetCommand() *CommandInfo { return nil } -// Describes an HTTP health check. +// Describes an HTTP health check. This is not fully implemented and not +// recommended for use - see MESOS-2533. type HealthCheck_HTTP struct { // Port to send the HTTP request. Port *uint32 `protobuf:"varint,1,req,name=port" json:"port,omitempty"` @@ -862,10 +1005,25 @@ func (m *CommandInfo) GetUser() string { } type CommandInfo_URI struct { - Value *string `protobuf:"bytes,1,req,name=value" json:"value,omitempty"` - Executable *bool `protobuf:"varint,2,opt,name=executable" json:"executable,omitempty"` - Extract *bool `protobuf:"varint,3,opt,name=extract,def=1" json:"extract,omitempty"` - XXX_unrecognized []byte `json:"-"` + Value *string `protobuf:"bytes,1,req,name=value" json:"value,omitempty"` + Executable *bool `protobuf:"varint,2,opt,name=executable" json:"executable,omitempty"` + // In case the fetched file is recognized as an archive, extract + // its contents into the sandbox. Note that a cached archive is + // not copied from the cache to the sandbox in case extraction + // originates from an archive in the cache. + Extract *bool `protobuf:"varint,3,opt,name=extract,def=1" json:"extract,omitempty"` + // If this field is "true", the fetcher cache will be used. If not, + // fetching bypasses the cache and downloads directly into the + // sandbox directory, no matter whether a suitable cache file is + // available or not. The former directs the fetcher to download to + // the file cache, then copy from there to the sandbox. Subsequent + // fetch attempts with the same URI will omit downloading and copy + // from the cache as long as the file is resident there. Cache files + // may get evicted at any time, which then leads to renewed + // downloading. See also "docs/fetcher.md" and + // "docs/fetcher-cache-internals.md". + Cache *bool `protobuf:"varint,4,opt,name=cache" json:"cache,omitempty"` + XXX_unrecognized []byte `json:"-"` } func (m *CommandInfo_URI) Reset() { *m = CommandInfo_URI{} } @@ -894,6 +1052,13 @@ func (m *CommandInfo_URI) GetExtract() bool { return Default_CommandInfo_URI_Extract } +func (m *CommandInfo_URI) GetCache() bool { + if m != nil && m.Cache != nil { + return *m.Cache + } + return false +} + // Describes a container. // Not all containerizers currently implement ContainerInfo, so it // is possible that a launched task will fail due to supplying this @@ -947,9 +1112,14 @@ type ExecutorInfo struct { // NOTE: Source is exposed alongside the resource usage of the // executor via JSON on the slave. This allows users to import // usage information into a time series database for monitoring. - Source *string `protobuf:"bytes,10,opt,name=source" json:"source,omitempty"` - Data []byte `protobuf:"bytes,4,opt,name=data" json:"data,omitempty"` - XXX_unrecognized []byte `json:"-"` + Source *string `protobuf:"bytes,10,opt,name=source" json:"source,omitempty"` + Data []byte `protobuf:"bytes,4,opt,name=data" json:"data,omitempty"` + // Service discovery information for the executor. It is not + // interpreted or acted upon by Mesos. It is up to a service + // discovery system to use this information as needed and to handle + // executors without service discovery information. + Discovery *DiscoveryInfo `protobuf:"bytes,12,opt,name=discovery" json:"discovery,omitempty"` + XXX_unrecognized []byte `json:"-"` } func (m *ExecutorInfo) Reset() { *m = ExecutorInfo{} } @@ -1011,6 +1181,13 @@ func (m *ExecutorInfo) GetData() []byte { return nil } +func (m *ExecutorInfo) GetDiscovery() *DiscoveryInfo { + if m != nil { + return m.Discovery + } + return nil +} + // * // Describes a master. This will probably have more fields in the // future which might be used, for example, to link a framework webui @@ -1021,6 +1198,7 @@ type MasterInfo struct { Port *uint32 `protobuf:"varint,3,req,name=port,def=5050" json:"port,omitempty"` Pid *string `protobuf:"bytes,4,opt,name=pid" json:"pid,omitempty"` Hostname *string `protobuf:"bytes,5,opt,name=hostname" json:"hostname,omitempty"` + Version *string `protobuf:"bytes,6,opt,name=version" json:"version,omitempty"` XXX_unrecognized []byte `json:"-"` } @@ -1064,6 +1242,13 @@ func (m *MasterInfo) GetHostname() string { return "" } +func (m *MasterInfo) GetVersion() string { + if m != nil && m.Version != nil { + return *m.Version + } + return "" +} + // * // Describes a slave. Note that the 'id' field is only available after // a slave is registered with the master, and is made available here @@ -1071,13 +1256,15 @@ func (m *MasterInfo) GetHostname() string { // checkpointing its own information and potentially frameworks' // information (if a framework has checkpointing enabled). type SlaveInfo struct { - Hostname *string `protobuf:"bytes,1,req,name=hostname" json:"hostname,omitempty"` - Port *int32 `protobuf:"varint,8,opt,name=port,def=5051" json:"port,omitempty"` - Resources []*Resource `protobuf:"bytes,3,rep,name=resources" json:"resources,omitempty"` - Attributes []*Attribute `protobuf:"bytes,5,rep,name=attributes" json:"attributes,omitempty"` - Id *SlaveID `protobuf:"bytes,6,opt,name=id" json:"id,omitempty"` - Checkpoint *bool `protobuf:"varint,7,opt,name=checkpoint,def=0" json:"checkpoint,omitempty"` - XXX_unrecognized []byte `json:"-"` + Hostname *string `protobuf:"bytes,1,req,name=hostname" json:"hostname,omitempty"` + Port *int32 `protobuf:"varint,8,opt,name=port,def=5051" json:"port,omitempty"` + Resources []*Resource `protobuf:"bytes,3,rep,name=resources" json:"resources,omitempty"` + Attributes []*Attribute `protobuf:"bytes,5,rep,name=attributes" json:"attributes,omitempty"` + Id *SlaveID `protobuf:"bytes,6,opt,name=id" json:"id,omitempty"` + // TODO(joerg84): Remove checkpoint field as with 0.22.0 + // slave checkpointing is enabled for all slaves (MESOS-2317). + Checkpoint *bool `protobuf:"varint,7,opt,name=checkpoint,def=0" json:"checkpoint,omitempty"` + XXX_unrecognized []byte `json:"-"` } func (m *SlaveInfo) Reset() { *m = SlaveInfo{} } @@ -1329,13 +1516,25 @@ func (m *Attribute) GetText() *Value_Text { // TODO(benh): Add better support for "expected" resources (e.g., // cpus, memory, disk, network). type Resource struct { - Name *string `protobuf:"bytes,1,req,name=name" json:"name,omitempty"` - Type *Value_Type `protobuf:"varint,2,req,name=type,enum=mesosproto.Value_Type" json:"type,omitempty"` - Scalar *Value_Scalar `protobuf:"bytes,3,opt,name=scalar" json:"scalar,omitempty"` - Ranges *Value_Ranges `protobuf:"bytes,4,opt,name=ranges" json:"ranges,omitempty"` - Set *Value_Set `protobuf:"bytes,5,opt,name=set" json:"set,omitempty"` - Role *string `protobuf:"bytes,6,opt,name=role,def=*" json:"role,omitempty"` - XXX_unrecognized []byte `json:"-"` + Name *string `protobuf:"bytes,1,req,name=name" json:"name,omitempty"` + Type *Value_Type `protobuf:"varint,2,req,name=type,enum=mesosproto.Value_Type" json:"type,omitempty"` + Scalar *Value_Scalar `protobuf:"bytes,3,opt,name=scalar" json:"scalar,omitempty"` + Ranges *Value_Ranges `protobuf:"bytes,4,opt,name=ranges" json:"ranges,omitempty"` + Set *Value_Set `protobuf:"bytes,5,opt,name=set" json:"set,omitempty"` + Role *string `protobuf:"bytes,6,opt,name=role,def=*" json:"role,omitempty"` + // If this is set, this resource was dynamically reserved by an + // operator or a framework. Otherwise, this resource is either unreserved + // or statically reserved by an operator via the --resources flag. + Reservation *Resource_ReservationInfo `protobuf:"bytes,8,opt,name=reservation" json:"reservation,omitempty"` + Disk *Resource_DiskInfo `protobuf:"bytes,7,opt,name=disk" json:"disk,omitempty"` + // If this is set, the resources are revocable, i.e., any tasks or + // executors launched using these resources could get preempted or + // throttled at any time. This could be used by frameworks to run + // best effort tasks that do not need strict uptime or performance + // guarantees. Note that if this is set, 'disk' or 'reservation' + // cannot be set. + Revocable *Resource_RevocableInfo `protobuf:"bytes,9,opt,name=revocable" json:"revocable,omitempty"` + XXX_unrecognized []byte `json:"-"` } func (m *Resource) Reset() { *m = Resource{} } @@ -1385,10 +1584,232 @@ func (m *Resource) GetRole() string { return Default_Resource_Role } +func (m *Resource) GetReservation() *Resource_ReservationInfo { + if m != nil { + return m.Reservation + } + return nil +} + +func (m *Resource) GetDisk() *Resource_DiskInfo { + if m != nil { + return m.Disk + } + return nil +} + +func (m *Resource) GetRevocable() *Resource_RevocableInfo { + if m != nil { + return m.Revocable + } + return nil +} + +type Resource_ReservationInfo struct { + // This field indicates the principal of the operator or framework + // that reserved this resource. It is used in conjunction with the + // "unreserve" ACL to determine whether the entity attempting to + // unreserve this resource is permitted to do so. + // NOTE: This field should match the FrameworkInfo.principal of + // the framework that reserved this resource. + Principal *string `protobuf:"bytes,1,req,name=principal" json:"principal,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *Resource_ReservationInfo) Reset() { *m = Resource_ReservationInfo{} } +func (*Resource_ReservationInfo) ProtoMessage() {} + +func (m *Resource_ReservationInfo) GetPrincipal() string { + if m != nil && m.Principal != nil { + return *m.Principal + } + return "" +} + +type Resource_DiskInfo struct { + Persistence *Resource_DiskInfo_Persistence `protobuf:"bytes,1,opt,name=persistence" json:"persistence,omitempty"` + // Describes how this disk resource will be mounted in the + // container. If not set, the disk resource will be used as the + // sandbox. Otherwise, it will be mounted according to the + // 'container_path' inside 'volume'. The 'host_path' inside + // 'volume' is ignored. + // NOTE: If 'volume' is set but 'persistence' is not set, the + // volume will be automatically garbage collected after + // task/executor terminates. Currently, if 'persistence' is set, + // 'volume' must be set. + Volume *Volume `protobuf:"bytes,2,opt,name=volume" json:"volume,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *Resource_DiskInfo) Reset() { *m = Resource_DiskInfo{} } +func (*Resource_DiskInfo) ProtoMessage() {} + +func (m *Resource_DiskInfo) GetPersistence() *Resource_DiskInfo_Persistence { + if m != nil { + return m.Persistence + } + return nil +} + +func (m *Resource_DiskInfo) GetVolume() *Volume { + if m != nil { + return m.Volume + } + return nil +} + +// Describes a persistent disk volume. +// A persistent disk volume will not be automatically garbage +// collected if the task/executor/slave terminates, but is +// re-offered to the framework(s) belonging to the 'role'. +// A framework can set the ID (if it is not set yet) to express +// the intention to create a new persistent disk volume from a +// regular disk resource. To reuse a previously created volume, a +// framework can launch a task/executor when it receives an offer +// with a persistent volume, i.e., ID is set. +// NOTE: Currently, we do not allow a persistent disk volume +// without a reservation (i.e., 'role' should not be '*'). +type Resource_DiskInfo_Persistence struct { + // A unique ID for the persistent disk volume. + // NOTE: The ID needs to be unique per role on each slave. + Id *string `protobuf:"bytes,1,req,name=id" json:"id,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *Resource_DiskInfo_Persistence) Reset() { *m = Resource_DiskInfo_Persistence{} } +func (*Resource_DiskInfo_Persistence) ProtoMessage() {} + +func (m *Resource_DiskInfo_Persistence) GetId() string { + if m != nil && m.Id != nil { + return *m.Id + } + return "" +} + +type Resource_RevocableInfo struct { + XXX_unrecognized []byte `json:"-"` +} + +func (m *Resource_RevocableInfo) Reset() { *m = Resource_RevocableInfo{} } +func (*Resource_RevocableInfo) ProtoMessage() {} + +// * +// When the network bandwidth caps are enabled and the container +// is over its limit, outbound packets may be either delayed or +// dropped completely either because it exceeds the maximum bandwidth +// allocation for a single container (the cap) or because the combined +// network traffic of multiple containers on the host exceeds the +// transmit capacity of the host (the share). We can report the +// following statistics for each of these conditions exported directly +// from the Linux Traffic Control Queueing Discipline. // +// id : name of the limiter, e.g. 'tx_bw_cap' +// backlog : number of packets currently delayed +// bytes : total bytes seen +// drops : number of packets dropped in total +// overlimits : number of packets which exceeded allocation +// packets : total packets seen +// qlen : number of packets currently queued +// rate_bps : throughput in bytes/sec +// rate_pps : throughput in packets/sec +// requeues : number of times a packet has been delayed due to +// locking or device contention issues +// +// More information on the operation of Linux Traffic Control can be +// found at http://www.lartc.org/lartc.html. +type TrafficControlStatistics struct { + Id *string `protobuf:"bytes,1,req,name=id" json:"id,omitempty"` + Backlog *uint64 `protobuf:"varint,2,opt,name=backlog" json:"backlog,omitempty"` + Bytes *uint64 `protobuf:"varint,3,opt,name=bytes" json:"bytes,omitempty"` + Drops *uint64 `protobuf:"varint,4,opt,name=drops" json:"drops,omitempty"` + Overlimits *uint64 `protobuf:"varint,5,opt,name=overlimits" json:"overlimits,omitempty"` + Packets *uint64 `protobuf:"varint,6,opt,name=packets" json:"packets,omitempty"` + Qlen *uint64 `protobuf:"varint,7,opt,name=qlen" json:"qlen,omitempty"` + Ratebps *uint64 `protobuf:"varint,8,opt,name=ratebps" json:"ratebps,omitempty"` + Ratepps *uint64 `protobuf:"varint,9,opt,name=ratepps" json:"ratepps,omitempty"` + Requeues *uint64 `protobuf:"varint,10,opt,name=requeues" json:"requeues,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *TrafficControlStatistics) Reset() { *m = TrafficControlStatistics{} } +func (*TrafficControlStatistics) ProtoMessage() {} + +func (m *TrafficControlStatistics) GetId() string { + if m != nil && m.Id != nil { + return *m.Id + } + return "" +} + +func (m *TrafficControlStatistics) GetBacklog() uint64 { + if m != nil && m.Backlog != nil { + return *m.Backlog + } + return 0 +} + +func (m *TrafficControlStatistics) GetBytes() uint64 { + if m != nil && m.Bytes != nil { + return *m.Bytes + } + return 0 +} + +func (m *TrafficControlStatistics) GetDrops() uint64 { + if m != nil && m.Drops != nil { + return *m.Drops + } + return 0 +} + +func (m *TrafficControlStatistics) GetOverlimits() uint64 { + if m != nil && m.Overlimits != nil { + return *m.Overlimits + } + return 0 +} + +func (m *TrafficControlStatistics) GetPackets() uint64 { + if m != nil && m.Packets != nil { + return *m.Packets + } + return 0 +} + +func (m *TrafficControlStatistics) GetQlen() uint64 { + if m != nil && m.Qlen != nil { + return *m.Qlen + } + return 0 +} + +func (m *TrafficControlStatistics) GetRatebps() uint64 { + if m != nil && m.Ratebps != nil { + return *m.Ratebps + } + return 0 +} + +func (m *TrafficControlStatistics) GetRatepps() uint64 { + if m != nil && m.Ratepps != nil { + return *m.Ratepps + } + return 0 +} + +func (m *TrafficControlStatistics) GetRequeues() uint64 { + if m != nil && m.Requeues != nil { + return *m.Requeues + } + return 0 +} + +// * // A snapshot of resource usage statistics. type ResourceStatistics struct { Timestamp *float64 `protobuf:"fixed64,1,req,name=timestamp" json:"timestamp,omitempty"` + Processes *uint32 `protobuf:"varint,30,opt,name=processes" json:"processes,omitempty"` + Threads *uint32 `protobuf:"varint,31,opt,name=threads" json:"threads,omitempty"` // CPU Usage Information: // Total CPU time spent in user mode, and kernel mode. CpusUserTimeSecs *float64 `protobuf:"fixed64,2,opt,name=cpus_user_time_secs" json:"cpus_user_time_secs,omitempty"` @@ -1399,14 +1820,42 @@ type ResourceStatistics struct { CpusNrPeriods *uint32 `protobuf:"varint,7,opt,name=cpus_nr_periods" json:"cpus_nr_periods,omitempty"` CpusNrThrottled *uint32 `protobuf:"varint,8,opt,name=cpus_nr_throttled" json:"cpus_nr_throttled,omitempty"` CpusThrottledTimeSecs *float64 `protobuf:"fixed64,9,opt,name=cpus_throttled_time_secs" json:"cpus_throttled_time_secs,omitempty"` - // Memory Usage Information: - MemRssBytes *uint64 `protobuf:"varint,5,opt,name=mem_rss_bytes" json:"mem_rss_bytes,omitempty"` - // Amount of memory resources allocated. + // mem_total_bytes was added in 0.23.0 to represent the total memory + // of a process in RAM (as opposed to in Swap). This was previously + // reported as mem_rss_bytes, which was also changed in 0.23.0 to + // represent only the anonymous memory usage, to keep in sync with + // Linux kernel's (arguably erroneous) use of terminology. + MemTotalBytes *uint64 `protobuf:"varint,36,opt,name=mem_total_bytes" json:"mem_total_bytes,omitempty"` + // Total memory + swap usage. This is set if swap is enabled. + MemTotalMemswBytes *uint64 `protobuf:"varint,37,opt,name=mem_total_memsw_bytes" json:"mem_total_memsw_bytes,omitempty"` + // Hard memory limit for a container. MemLimitBytes *uint64 `protobuf:"varint,6,opt,name=mem_limit_bytes" json:"mem_limit_bytes,omitempty"` - // Broken out memory usage information (files, anonymous, and mmaped files) - MemFileBytes *uint64 `protobuf:"varint,10,opt,name=mem_file_bytes" json:"mem_file_bytes,omitempty"` - MemAnonBytes *uint64 `protobuf:"varint,11,opt,name=mem_anon_bytes" json:"mem_anon_bytes,omitempty"` + // Soft memory limit for a container. + MemSoftLimitBytes *uint64 `protobuf:"varint,38,opt,name=mem_soft_limit_bytes" json:"mem_soft_limit_bytes,omitempty"` + // TODO(chzhcn) mem_file_bytes and mem_anon_bytes are deprecated in + // 0.23.0 and will be removed in 0.24.0. + MemFileBytes *uint64 `protobuf:"varint,10,opt,name=mem_file_bytes" json:"mem_file_bytes,omitempty"` + MemAnonBytes *uint64 `protobuf:"varint,11,opt,name=mem_anon_bytes" json:"mem_anon_bytes,omitempty"` + // mem_cache_bytes is added in 0.23.0 to represent page cache usage. + MemCacheBytes *uint64 `protobuf:"varint,39,opt,name=mem_cache_bytes" json:"mem_cache_bytes,omitempty"` + // Since 0.23.0, mem_rss_bytes is changed to represent only + // anonymous memory usage. Note that neither its requiredness, type, + // name nor numeric tag has been changed. + MemRssBytes *uint64 `protobuf:"varint,5,opt,name=mem_rss_bytes" json:"mem_rss_bytes,omitempty"` MemMappedFileBytes *uint64 `protobuf:"varint,12,opt,name=mem_mapped_file_bytes" json:"mem_mapped_file_bytes,omitempty"` + // This is only set if swap is enabled. + MemSwapBytes *uint64 `protobuf:"varint,40,opt,name=mem_swap_bytes" json:"mem_swap_bytes,omitempty"` + // Number of occurrences of different levels of memory pressure + // events reported by memory cgroup. Pressure listening (re)starts + // with these values set to 0 when slave (re)starts. See + // https://www.kernel.org/doc/Documentation/cgroups/memory.txt for + // more details. + MemLowPressureCounter *uint64 `protobuf:"varint,32,opt,name=mem_low_pressure_counter" json:"mem_low_pressure_counter,omitempty"` + MemMediumPressureCounter *uint64 `protobuf:"varint,33,opt,name=mem_medium_pressure_counter" json:"mem_medium_pressure_counter,omitempty"` + MemCriticalPressureCounter *uint64 `protobuf:"varint,34,opt,name=mem_critical_pressure_counter" json:"mem_critical_pressure_counter,omitempty"` + // Disk Usage Information for executor working directory. + DiskLimitBytes *uint64 `protobuf:"varint,26,opt,name=disk_limit_bytes" json:"disk_limit_bytes,omitempty"` + DiskUsedBytes *uint64 `protobuf:"varint,27,opt,name=disk_used_bytes" json:"disk_used_bytes,omitempty"` // Perf statistics. Perf *PerfStatistics `protobuf:"bytes,13,opt,name=perf" json:"perf,omitempty"` // Network Usage Information: @@ -1420,11 +1869,17 @@ type ResourceStatistics struct { NetTxDropped *uint64 `protobuf:"varint,21,opt,name=net_tx_dropped" json:"net_tx_dropped,omitempty"` // The kernel keeps track of RTT (round-trip time) for its TCP // sockets. RTT is a way to tell the latency of a container. - NetTcpRttMicrosecsP50 *float64 `protobuf:"fixed64,22,opt,name=net_tcp_rtt_microsecs_p50" json:"net_tcp_rtt_microsecs_p50,omitempty"` - NetTcpRttMicrosecsP90 *float64 `protobuf:"fixed64,23,opt,name=net_tcp_rtt_microsecs_p90" json:"net_tcp_rtt_microsecs_p90,omitempty"` - NetTcpRttMicrosecsP95 *float64 `protobuf:"fixed64,24,opt,name=net_tcp_rtt_microsecs_p95" json:"net_tcp_rtt_microsecs_p95,omitempty"` - NetTcpRttMicrosecsP99 *float64 `protobuf:"fixed64,25,opt,name=net_tcp_rtt_microsecs_p99" json:"net_tcp_rtt_microsecs_p99,omitempty"` - XXX_unrecognized []byte `json:"-"` + NetTcpRttMicrosecsP50 *float64 `protobuf:"fixed64,22,opt,name=net_tcp_rtt_microsecs_p50" json:"net_tcp_rtt_microsecs_p50,omitempty"` + NetTcpRttMicrosecsP90 *float64 `protobuf:"fixed64,23,opt,name=net_tcp_rtt_microsecs_p90" json:"net_tcp_rtt_microsecs_p90,omitempty"` + NetTcpRttMicrosecsP95 *float64 `protobuf:"fixed64,24,opt,name=net_tcp_rtt_microsecs_p95" json:"net_tcp_rtt_microsecs_p95,omitempty"` + NetTcpRttMicrosecsP99 *float64 `protobuf:"fixed64,25,opt,name=net_tcp_rtt_microsecs_p99" json:"net_tcp_rtt_microsecs_p99,omitempty"` + NetTcpActiveConnections *float64 `protobuf:"fixed64,28,opt,name=net_tcp_active_connections" json:"net_tcp_active_connections,omitempty"` + NetTcpTimeWaitConnections *float64 `protobuf:"fixed64,29,opt,name=net_tcp_time_wait_connections" json:"net_tcp_time_wait_connections,omitempty"` + // Network traffic flowing into or out of a container can be delayed + // or dropped due to congestion or policy inside and outside the + // container. + NetTrafficControlStatistics []*TrafficControlStatistics `protobuf:"bytes,35,rep,name=net_traffic_control_statistics" json:"net_traffic_control_statistics,omitempty"` + XXX_unrecognized []byte `json:"-"` } func (m *ResourceStatistics) Reset() { *m = ResourceStatistics{} } @@ -1437,6 +1892,20 @@ func (m *ResourceStatistics) GetTimestamp() float64 { return 0 } +func (m *ResourceStatistics) GetProcesses() uint32 { + if m != nil && m.Processes != nil { + return *m.Processes + } + return 0 +} + +func (m *ResourceStatistics) GetThreads() uint32 { + if m != nil && m.Threads != nil { + return *m.Threads + } + return 0 +} + func (m *ResourceStatistics) GetCpusUserTimeSecs() float64 { if m != nil && m.CpusUserTimeSecs != nil { return *m.CpusUserTimeSecs @@ -1479,9 +1948,16 @@ func (m *ResourceStatistics) GetCpusThrottledTimeSecs() float64 { return 0 } -func (m *ResourceStatistics) GetMemRssBytes() uint64 { - if m != nil && m.MemRssBytes != nil { - return *m.MemRssBytes +func (m *ResourceStatistics) GetMemTotalBytes() uint64 { + if m != nil && m.MemTotalBytes != nil { + return *m.MemTotalBytes + } + return 0 +} + +func (m *ResourceStatistics) GetMemTotalMemswBytes() uint64 { + if m != nil && m.MemTotalMemswBytes != nil { + return *m.MemTotalMemswBytes } return 0 } @@ -1493,6 +1969,13 @@ func (m *ResourceStatistics) GetMemLimitBytes() uint64 { return 0 } +func (m *ResourceStatistics) GetMemSoftLimitBytes() uint64 { + if m != nil && m.MemSoftLimitBytes != nil { + return *m.MemSoftLimitBytes + } + return 0 +} + func (m *ResourceStatistics) GetMemFileBytes() uint64 { if m != nil && m.MemFileBytes != nil { return *m.MemFileBytes @@ -1507,6 +1990,20 @@ func (m *ResourceStatistics) GetMemAnonBytes() uint64 { return 0 } +func (m *ResourceStatistics) GetMemCacheBytes() uint64 { + if m != nil && m.MemCacheBytes != nil { + return *m.MemCacheBytes + } + return 0 +} + +func (m *ResourceStatistics) GetMemRssBytes() uint64 { + if m != nil && m.MemRssBytes != nil { + return *m.MemRssBytes + } + return 0 +} + func (m *ResourceStatistics) GetMemMappedFileBytes() uint64 { if m != nil && m.MemMappedFileBytes != nil { return *m.MemMappedFileBytes @@ -1514,37 +2011,79 @@ func (m *ResourceStatistics) GetMemMappedFileBytes() uint64 { return 0 } -func (m *ResourceStatistics) GetPerf() *PerfStatistics { - if m != nil { - return m.Perf +func (m *ResourceStatistics) GetMemSwapBytes() uint64 { + if m != nil && m.MemSwapBytes != nil { + return *m.MemSwapBytes } - return nil + return 0 } -func (m *ResourceStatistics) GetNetRxPackets() uint64 { - if m != nil && m.NetRxPackets != nil { - return *m.NetRxPackets +func (m *ResourceStatistics) GetMemLowPressureCounter() uint64 { + if m != nil && m.MemLowPressureCounter != nil { + return *m.MemLowPressureCounter } return 0 } -func (m *ResourceStatistics) GetNetRxBytes() uint64 { - if m != nil && m.NetRxBytes != nil { - return *m.NetRxBytes +func (m *ResourceStatistics) GetMemMediumPressureCounter() uint64 { + if m != nil && m.MemMediumPressureCounter != nil { + return *m.MemMediumPressureCounter } return 0 } -func (m *ResourceStatistics) GetNetRxErrors() uint64 { - if m != nil && m.NetRxErrors != nil { - return *m.NetRxErrors +func (m *ResourceStatistics) GetMemCriticalPressureCounter() uint64 { + if m != nil && m.MemCriticalPressureCounter != nil { + return *m.MemCriticalPressureCounter } return 0 } -func (m *ResourceStatistics) GetNetRxDropped() uint64 { - if m != nil && m.NetRxDropped != nil { - return *m.NetRxDropped +func (m *ResourceStatistics) GetDiskLimitBytes() uint64 { + if m != nil && m.DiskLimitBytes != nil { + return *m.DiskLimitBytes + } + return 0 +} + +func (m *ResourceStatistics) GetDiskUsedBytes() uint64 { + if m != nil && m.DiskUsedBytes != nil { + return *m.DiskUsedBytes + } + return 0 +} + +func (m *ResourceStatistics) GetPerf() *PerfStatistics { + if m != nil { + return m.Perf + } + return nil +} + +func (m *ResourceStatistics) GetNetRxPackets() uint64 { + if m != nil && m.NetRxPackets != nil { + return *m.NetRxPackets + } + return 0 +} + +func (m *ResourceStatistics) GetNetRxBytes() uint64 { + if m != nil && m.NetRxBytes != nil { + return *m.NetRxBytes + } + return 0 +} + +func (m *ResourceStatistics) GetNetRxErrors() uint64 { + if m != nil && m.NetRxErrors != nil { + return *m.NetRxErrors + } + return 0 +} + +func (m *ResourceStatistics) GetNetRxDropped() uint64 { + if m != nil && m.NetRxDropped != nil { + return *m.NetRxDropped } return 0 } @@ -1605,63 +2144,73 @@ func (m *ResourceStatistics) GetNetTcpRttMicrosecsP99() float64 { return 0 } +func (m *ResourceStatistics) GetNetTcpActiveConnections() float64 { + if m != nil && m.NetTcpActiveConnections != nil { + return *m.NetTcpActiveConnections + } + return 0 +} + +func (m *ResourceStatistics) GetNetTcpTimeWaitConnections() float64 { + if m != nil && m.NetTcpTimeWaitConnections != nil { + return *m.NetTcpTimeWaitConnections + } + return 0 +} + +func (m *ResourceStatistics) GetNetTrafficControlStatistics() []*TrafficControlStatistics { + if m != nil { + return m.NetTrafficControlStatistics + } + return nil +} + // * -// Describes a snapshot of the resource usage for an executor. -// -// TODO(bmahler): Note that we want to be sending this information -// to the master, and subsequently to the relevant scheduler. So -// this proto is designed to be easy for the scheduler to use, this -// is why we provide the slave id, executor info / task info. +// Describes a snapshot of the resource usage for executors. type ResourceUsage struct { - SlaveId *SlaveID `protobuf:"bytes,1,req,name=slave_id" json:"slave_id,omitempty"` - FrameworkId *FrameworkID `protobuf:"bytes,2,req,name=framework_id" json:"framework_id,omitempty"` - ExecutorId *ExecutorID `protobuf:"bytes,3,opt,name=executor_id" json:"executor_id,omitempty"` - ExecutorName *string `protobuf:"bytes,4,opt,name=executor_name" json:"executor_name,omitempty"` - TaskId *TaskID `protobuf:"bytes,5,opt,name=task_id" json:"task_id,omitempty"` - // If missing, the isolation module cannot provide resource usage. - Statistics *ResourceStatistics `protobuf:"bytes,6,opt,name=statistics" json:"statistics,omitempty"` - XXX_unrecognized []byte `json:"-"` + Executors []*ResourceUsage_Executor `protobuf:"bytes,1,rep,name=executors" json:"executors,omitempty"` + XXX_unrecognized []byte `json:"-"` } func (m *ResourceUsage) Reset() { *m = ResourceUsage{} } func (*ResourceUsage) ProtoMessage() {} -func (m *ResourceUsage) GetSlaveId() *SlaveID { +func (m *ResourceUsage) GetExecutors() []*ResourceUsage_Executor { if m != nil { - return m.SlaveId + return m.Executors } return nil } -func (m *ResourceUsage) GetFrameworkId() *FrameworkID { - if m != nil { - return m.FrameworkId - } - return nil +type ResourceUsage_Executor struct { + ExecutorInfo *ExecutorInfo `protobuf:"bytes,1,req,name=executor_info" json:"executor_info,omitempty"` + // This includes resources used by the executor itself + // as well as its active tasks. + Allocated []*Resource `protobuf:"bytes,2,rep,name=allocated" json:"allocated,omitempty"` + // Current resource usage. If absent, the containerizer + // cannot provide resource usage. + Statistics *ResourceStatistics `protobuf:"bytes,3,opt,name=statistics" json:"statistics,omitempty"` + XXX_unrecognized []byte `json:"-"` } -func (m *ResourceUsage) GetExecutorId() *ExecutorID { +func (m *ResourceUsage_Executor) Reset() { *m = ResourceUsage_Executor{} } +func (*ResourceUsage_Executor) ProtoMessage() {} + +func (m *ResourceUsage_Executor) GetExecutorInfo() *ExecutorInfo { if m != nil { - return m.ExecutorId + return m.ExecutorInfo } return nil } -func (m *ResourceUsage) GetExecutorName() string { - if m != nil && m.ExecutorName != nil { - return *m.ExecutorName - } - return "" -} - -func (m *ResourceUsage) GetTaskId() *TaskID { +func (m *ResourceUsage_Executor) GetAllocated() []*Resource { if m != nil { - return m.TaskId + return m.Allocated } return nil } -func (m *ResourceUsage) GetStatistics() *ResourceStatistics { +func (m *ResourceUsage_Executor) GetStatistics() *ResourceStatistics { if m != nil { return m.Statistics } @@ -2118,6 +2667,8 @@ func (m *PerfStatistics) GetNodePrefetchMisses() uint64 { // to proactively influence the allocator. If 'slave_id' is provided // then this request is assumed to only apply to resources on that // slave. +// +// TODO(vinod): Remove this once the old driver is removed. type Request struct { SlaveId *SlaveID `protobuf:"bytes,1,opt,name=slave_id" json:"slave_id,omitempty"` Resources []*Resource `protobuf:"bytes,2,rep,name=resources" json:"resources,omitempty"` @@ -2207,6 +2758,137 @@ func (m *Offer) GetExecutorIds() []*ExecutorID { return nil } +// Defines an operation that can be performed against offers. +type Offer_Operation struct { + Type *Offer_Operation_Type `protobuf:"varint,1,req,name=type,enum=mesosproto.Offer_Operation_Type" json:"type,omitempty"` + Launch *Offer_Operation_Launch `protobuf:"bytes,2,opt,name=launch" json:"launch,omitempty"` + Reserve *Offer_Operation_Reserve `protobuf:"bytes,3,opt,name=reserve" json:"reserve,omitempty"` + Unreserve *Offer_Operation_Unreserve `protobuf:"bytes,4,opt,name=unreserve" json:"unreserve,omitempty"` + Create *Offer_Operation_Create `protobuf:"bytes,5,opt,name=create" json:"create,omitempty"` + Destroy *Offer_Operation_Destroy `protobuf:"bytes,6,opt,name=destroy" json:"destroy,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *Offer_Operation) Reset() { *m = Offer_Operation{} } +func (*Offer_Operation) ProtoMessage() {} + +func (m *Offer_Operation) GetType() Offer_Operation_Type { + if m != nil && m.Type != nil { + return *m.Type + } + return Offer_Operation_LAUNCH +} + +func (m *Offer_Operation) GetLaunch() *Offer_Operation_Launch { + if m != nil { + return m.Launch + } + return nil +} + +func (m *Offer_Operation) GetReserve() *Offer_Operation_Reserve { + if m != nil { + return m.Reserve + } + return nil +} + +func (m *Offer_Operation) GetUnreserve() *Offer_Operation_Unreserve { + if m != nil { + return m.Unreserve + } + return nil +} + +func (m *Offer_Operation) GetCreate() *Offer_Operation_Create { + if m != nil { + return m.Create + } + return nil +} + +func (m *Offer_Operation) GetDestroy() *Offer_Operation_Destroy { + if m != nil { + return m.Destroy + } + return nil +} + +type Offer_Operation_Launch struct { + TaskInfos []*TaskInfo `protobuf:"bytes,1,rep,name=task_infos" json:"task_infos,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *Offer_Operation_Launch) Reset() { *m = Offer_Operation_Launch{} } +func (*Offer_Operation_Launch) ProtoMessage() {} + +func (m *Offer_Operation_Launch) GetTaskInfos() []*TaskInfo { + if m != nil { + return m.TaskInfos + } + return nil +} + +type Offer_Operation_Reserve struct { + Resources []*Resource `protobuf:"bytes,1,rep,name=resources" json:"resources,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *Offer_Operation_Reserve) Reset() { *m = Offer_Operation_Reserve{} } +func (*Offer_Operation_Reserve) ProtoMessage() {} + +func (m *Offer_Operation_Reserve) GetResources() []*Resource { + if m != nil { + return m.Resources + } + return nil +} + +type Offer_Operation_Unreserve struct { + Resources []*Resource `protobuf:"bytes,1,rep,name=resources" json:"resources,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *Offer_Operation_Unreserve) Reset() { *m = Offer_Operation_Unreserve{} } +func (*Offer_Operation_Unreserve) ProtoMessage() {} + +func (m *Offer_Operation_Unreserve) GetResources() []*Resource { + if m != nil { + return m.Resources + } + return nil +} + +type Offer_Operation_Create struct { + Volumes []*Resource `protobuf:"bytes,1,rep,name=volumes" json:"volumes,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *Offer_Operation_Create) Reset() { *m = Offer_Operation_Create{} } +func (*Offer_Operation_Create) ProtoMessage() {} + +func (m *Offer_Operation_Create) GetVolumes() []*Resource { + if m != nil { + return m.Volumes + } + return nil +} + +type Offer_Operation_Destroy struct { + Volumes []*Resource `protobuf:"bytes,1,rep,name=volumes" json:"volumes,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *Offer_Operation_Destroy) Reset() { *m = Offer_Operation_Destroy{} } +func (*Offer_Operation_Destroy) ProtoMessage() {} + +func (m *Offer_Operation_Destroy) GetVolumes() []*Resource { + if m != nil { + return m.Volumes + } + return nil +} + // * // Describes a task. Passed from the scheduler all the way to an // executor (see SchedulerDriver::launchTasks and @@ -2226,8 +2908,19 @@ type TaskInfo struct { Data []byte `protobuf:"bytes,6,opt,name=data" json:"data,omitempty"` // A health check for the task (currently in *alpha* and initial // support will only be for TaskInfo's that have a CommandInfo). - HealthCheck *HealthCheck `protobuf:"bytes,8,opt,name=health_check" json:"health_check,omitempty"` - XXX_unrecognized []byte `json:"-"` + HealthCheck *HealthCheck `protobuf:"bytes,8,opt,name=health_check" json:"health_check,omitempty"` + // Labels are free-form key value pairs which are exposed through + // master and slave endpoints. Labels will not be interpreted or + // acted upon by Mesos itself. As opposed to the data field, labels + // will be kept in memory on master and slave processes. Therefore, + // labels should be used to tag tasks with light-weight meta-data. + Labels *Labels `protobuf:"bytes,10,opt,name=labels" json:"labels,omitempty"` + // Service discovery information for the task. It is not interpreted + // or acted upon by Mesos. It is up to a service discovery system + // to use this information as needed and to handle tasks without + // service discovery information. + Discovery *DiscoveryInfo `protobuf:"bytes,11,opt,name=discovery" json:"discovery,omitempty"` + XXX_unrecognized []byte `json:"-"` } func (m *TaskInfo) Reset() { *m = TaskInfo{} } @@ -2296,6 +2989,20 @@ func (m *TaskInfo) GetHealthCheck() *HealthCheck { return nil } +func (m *TaskInfo) GetLabels() *Labels { + if m != nil { + return m.Labels + } + return nil +} + +func (m *TaskInfo) GetDiscovery() *DiscoveryInfo { + if m != nil { + return m.Discovery + } + return nil +} + // * // Describes the current status of a task. type TaskStatus struct { @@ -2308,6 +3015,16 @@ type TaskStatus struct { SlaveId *SlaveID `protobuf:"bytes,5,opt,name=slave_id" json:"slave_id,omitempty"` ExecutorId *ExecutorID `protobuf:"bytes,7,opt,name=executor_id" json:"executor_id,omitempty"` Timestamp *float64 `protobuf:"fixed64,6,opt,name=timestamp" json:"timestamp,omitempty"` + // Statuses that are delivered reliably to the scheduler will + // include a 'uuid'. The status is considered delivered once + // it is acknowledged by the scheduler. Schedulers can choose + // to either explicitly acknowledge statuses or let the scheduler + // driver implicitly acknowledge (default). + // + // TODO(bmahler): This is currently overwritten in the scheduler + // driver and executor driver, but executors will need to set this + // to a valid RFC-4122 UUID if using the HTTP API. + Uuid []byte `protobuf:"bytes,11,opt,name=uuid" json:"uuid,omitempty"` // Describes whether the task has been determined to be healthy // (true) or unhealthy (false) according to the HealthCheck field in // the command info. @@ -2381,6 +3098,13 @@ func (m *TaskStatus) GetTimestamp() float64 { return 0 } +func (m *TaskStatus) GetUuid() []byte { + if m != nil { + return m.Uuid + } + return nil +} + func (m *TaskStatus) GetHealthy() bool { if m != nil && m.Healthy != nil { return *m.Healthy @@ -2895,11 +3619,15 @@ type ContainerInfo_DockerInfo struct { PortMappings []*ContainerInfo_DockerInfo_PortMapping `protobuf:"bytes,3,rep,name=port_mappings" json:"port_mappings,omitempty"` Privileged *bool `protobuf:"varint,4,opt,name=privileged,def=0" json:"privileged,omitempty"` // Allowing arbitrary parameters to be passed to docker CLI. - // Note that anything passed to this field is not guranteed + // Note that anything passed to this field is not guaranteed // to be supported moving forward, as we might move away from // the docker CLI. - Parameters []*Parameter `protobuf:"bytes,5,rep,name=parameters" json:"parameters,omitempty"` - XXX_unrecognized []byte `json:"-"` + Parameters []*Parameter `protobuf:"bytes,5,rep,name=parameters" json:"parameters,omitempty"` + // With this flag set to true, the docker containerizer will + // pull the docker image from the registry even if the image + // is already downloaded on the slave. + ForcePullImage *bool `protobuf:"varint,6,opt,name=force_pull_image" json:"force_pull_image,omitempty"` + XXX_unrecognized []byte `json:"-"` } func (m *ContainerInfo_DockerInfo) Reset() { *m = ContainerInfo_DockerInfo{} } @@ -2943,6 +3671,13 @@ func (m *ContainerInfo_DockerInfo) GetParameters() []*Parameter { return nil } +func (m *ContainerInfo_DockerInfo) GetForcePullImage() bool { + if m != nil && m.ForcePullImage != nil { + return *m.ForcePullImage + } + return false +} + type ContainerInfo_DockerInfo_PortMapping struct { HostPort *uint32 `protobuf:"varint,1,req,name=host_port" json:"host_port,omitempty"` ContainerPort *uint32 `protobuf:"varint,2,req,name=container_port" json:"container_port,omitempty"` @@ -2975,10588 +3710,11961 @@ func (m *ContainerInfo_DockerInfo_PortMapping) GetProtocol() string { return "" } -func init() { - proto.RegisterEnum("mesosproto.Status", Status_name, Status_value) - proto.RegisterEnum("mesosproto.TaskState", TaskState_name, TaskState_value) - proto.RegisterEnum("mesosproto.Value_Type", Value_Type_name, Value_Type_value) - proto.RegisterEnum("mesosproto.TaskStatus_Source", TaskStatus_Source_name, TaskStatus_Source_value) - proto.RegisterEnum("mesosproto.TaskStatus_Reason", TaskStatus_Reason_name, TaskStatus_Reason_value) - proto.RegisterEnum("mesosproto.ACL_Entity_Type", ACL_Entity_Type_name, ACL_Entity_Type_value) - proto.RegisterEnum("mesosproto.Volume_Mode", Volume_Mode_name, Volume_Mode_value) - proto.RegisterEnum("mesosproto.ContainerInfo_Type", ContainerInfo_Type_name, ContainerInfo_Type_value) - proto.RegisterEnum("mesosproto.ContainerInfo_DockerInfo_Network", ContainerInfo_DockerInfo_Network_name, ContainerInfo_DockerInfo_Network_value) +// * +// Collection of labels. +type Labels struct { + Labels []*Label `protobuf:"bytes,1,rep,name=labels" json:"labels,omitempty"` + XXX_unrecognized []byte `json:"-"` } -func (m *FrameworkID) 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 Value", 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 - } - s := string(data[index:postIndex]) - m.Value = &s - 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 - } + +func (m *Labels) Reset() { *m = Labels{} } +func (*Labels) ProtoMessage() {} + +func (m *Labels) GetLabels() []*Label { + if m != nil { + return m.Labels } return nil } -func (m *OfferID) 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 Value", 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 - } - s := string(data[index:postIndex]) - m.Value = &s - 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 - } + +// * +// Key, value pair used to store free form user-data. +type Label struct { + Key *string `protobuf:"bytes,1,req,name=key" json:"key,omitempty"` + Value *string `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *Label) Reset() { *m = Label{} } +func (*Label) ProtoMessage() {} + +func (m *Label) GetKey() string { + if m != nil && m.Key != nil { + return *m.Key + } + return "" +} + +func (m *Label) GetValue() string { + if m != nil && m.Value != nil { + return *m.Value + } + return "" +} + +// * +// Named port used for service discovery. +type Port struct { + Number *uint32 `protobuf:"varint,1,req,name=number" json:"number,omitempty"` + Name *string `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"` + Protocol *string `protobuf:"bytes,3,opt,name=protocol" json:"protocol,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *Port) Reset() { *m = Port{} } +func (*Port) ProtoMessage() {} + +func (m *Port) GetNumber() uint32 { + if m != nil && m.Number != nil { + return *m.Number + } + return 0 +} + +func (m *Port) GetName() string { + if m != nil && m.Name != nil { + return *m.Name + } + return "" +} + +func (m *Port) GetProtocol() string { + if m != nil && m.Protocol != nil { + return *m.Protocol + } + return "" +} + +// * +// Collection of ports. +type Ports struct { + Ports []*Port `protobuf:"bytes,1,rep,name=ports" json:"ports,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *Ports) Reset() { *m = Ports{} } +func (*Ports) ProtoMessage() {} + +func (m *Ports) GetPorts() []*Port { + if m != nil { + return m.Ports } return nil } -func (m *SlaveID) 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 Value", 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 - } - s := string(data[index:postIndex]) - m.Value = &s - 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 - } + +// * +// Service discovery information. +// The visibility field restricts discovery within a framework +// (FRAMEWORK), within a Mesos cluster (CLUSTER), or places no +// restrictions (EXTERNAL). +// The environment, location, and version fields provide first class +// support for common attributes used to differentiate between +// similar services. The environment may receive values such as +// PROD/QA/DEV, the location field may receive values like +// EAST-US/WEST-US/EUROPE/AMEA, and the version field may receive +// values like v2.0/v0.9. The exact use of these fields is up to each +// service discovery system. +type DiscoveryInfo struct { + Visibility *DiscoveryInfo_Visibility `protobuf:"varint,1,req,name=visibility,enum=mesosproto.DiscoveryInfo_Visibility" json:"visibility,omitempty"` + Name *string `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"` + Environment *string `protobuf:"bytes,3,opt,name=environment" json:"environment,omitempty"` + Location *string `protobuf:"bytes,4,opt,name=location" json:"location,omitempty"` + Version *string `protobuf:"bytes,5,opt,name=version" json:"version,omitempty"` + Ports *Ports `protobuf:"bytes,6,opt,name=ports" json:"ports,omitempty"` + Labels *Labels `protobuf:"bytes,7,opt,name=labels" json:"labels,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *DiscoveryInfo) Reset() { *m = DiscoveryInfo{} } +func (*DiscoveryInfo) ProtoMessage() {} + +func (m *DiscoveryInfo) GetVisibility() DiscoveryInfo_Visibility { + if m != nil && m.Visibility != nil { + return *m.Visibility + } + return DiscoveryInfo_FRAMEWORK +} + +func (m *DiscoveryInfo) GetName() string { + if m != nil && m.Name != nil { + return *m.Name + } + return "" +} + +func (m *DiscoveryInfo) GetEnvironment() string { + if m != nil && m.Environment != nil { + return *m.Environment + } + return "" +} + +func (m *DiscoveryInfo) GetLocation() string { + if m != nil && m.Location != nil { + return *m.Location + } + return "" +} + +func (m *DiscoveryInfo) GetVersion() string { + if m != nil && m.Version != nil { + return *m.Version + } + return "" +} + +func (m *DiscoveryInfo) GetPorts() *Ports { + if m != nil { + return m.Ports } return nil } -func (m *TaskID) 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 - } + +func (m *DiscoveryInfo) GetLabels() *Labels { + if m != nil { + return m.Labels + } + return nil +} + +func init() { + proto.RegisterEnum("mesosproto.Status", Status_name, Status_value) + proto.RegisterEnum("mesosproto.TaskState", TaskState_name, TaskState_value) + proto.RegisterEnum("mesosproto.FrameworkInfo_Capability_Type", FrameworkInfo_Capability_Type_name, FrameworkInfo_Capability_Type_value) + proto.RegisterEnum("mesosproto.Value_Type", Value_Type_name, Value_Type_value) + proto.RegisterEnum("mesosproto.Offer_Operation_Type", Offer_Operation_Type_name, Offer_Operation_Type_value) + proto.RegisterEnum("mesosproto.TaskStatus_Source", TaskStatus_Source_name, TaskStatus_Source_value) + proto.RegisterEnum("mesosproto.TaskStatus_Reason", TaskStatus_Reason_name, TaskStatus_Reason_value) + proto.RegisterEnum("mesosproto.ACL_Entity_Type", ACL_Entity_Type_name, ACL_Entity_Type_value) + proto.RegisterEnum("mesosproto.Volume_Mode", Volume_Mode_name, Volume_Mode_value) + proto.RegisterEnum("mesosproto.ContainerInfo_Type", ContainerInfo_Type_name, ContainerInfo_Type_value) + proto.RegisterEnum("mesosproto.ContainerInfo_DockerInfo_Network", ContainerInfo_DockerInfo_Network_name, ContainerInfo_DockerInfo_Network_value) + proto.RegisterEnum("mesosproto.DiscoveryInfo_Visibility", DiscoveryInfo_Visibility_name, DiscoveryInfo_Visibility_value) +} +func (this *FrameworkID) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", 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 - } - s := string(data[index:postIndex]) - m.Value = &s - 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 fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*FrameworkID) + if !ok { + return fmt.Errorf("that is not of type *FrameworkID") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *FrameworkID but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *FrameworkIDbut is not nil && this == nil") + } + if this.Value != nil && that1.Value != nil { + if *this.Value != *that1.Value { + return fmt.Errorf("Value this(%v) Not Equal that(%v)", *this.Value, *that1.Value) } + } else if this.Value != nil { + return fmt.Errorf("this.Value == nil && that.Value != nil") + } else if that1.Value != nil { + return fmt.Errorf("Value this(%v) Not Equal that(%v)", this.Value, that1.Value) + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) } return nil } -func (m *ExecutorID) 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 - } +func (this *FrameworkID) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", 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 - } - s := string(data[index:postIndex]) - m.Value = &s - 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 false + } + + that1, ok := that.(*FrameworkID) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if this.Value != nil && that1.Value != nil { + if *this.Value != *that1.Value { + return false + } + } else if this.Value != nil { + return false + } else if that1.Value != nil { + return false + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *OfferID) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*OfferID) + if !ok { + return fmt.Errorf("that is not of type *OfferID") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *OfferID but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *OfferIDbut is not nil && this == nil") + } + if this.Value != nil && that1.Value != nil { + if *this.Value != *that1.Value { + return fmt.Errorf("Value this(%v) Not Equal that(%v)", *this.Value, *that1.Value) } + } else if this.Value != nil { + return fmt.Errorf("this.Value == nil && that.Value != nil") + } else if that1.Value != nil { + return fmt.Errorf("Value this(%v) Not Equal that(%v)", this.Value, that1.Value) + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) } return nil } -func (m *ContainerID) 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 - } +func (this *OfferID) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", 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 - } - s := string(data[index:postIndex]) - m.Value = &s - 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 false + } + + that1, ok := that.(*OfferID) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if this.Value != nil && that1.Value != nil { + if *this.Value != *that1.Value { + return false + } + } else if this.Value != nil { + return false + } else if that1.Value != nil { + return false + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *SlaveID) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*SlaveID) + if !ok { + return fmt.Errorf("that is not of type *SlaveID") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *SlaveID but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *SlaveIDbut is not nil && this == nil") + } + if this.Value != nil && that1.Value != nil { + if *this.Value != *that1.Value { + return fmt.Errorf("Value this(%v) Not Equal that(%v)", *this.Value, *that1.Value) } + } else if this.Value != nil { + return fmt.Errorf("this.Value == nil && that.Value != nil") + } else if that1.Value != nil { + return fmt.Errorf("Value this(%v) Not Equal that(%v)", this.Value, that1.Value) + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) } return nil } -func (m *FrameworkInfo) 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 - } +func (this *SlaveID) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field User", 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 - } - s := string(data[index:postIndex]) - m.User = &s - index = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", 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 - } - s := string(data[index:postIndex]) - m.Name = &s - index = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Id == nil { - m.Id = &FrameworkID{} - } - if err := m.Id.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - case 4: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field FailoverTimeout", wireType) - } - var v uint64 - i := index + 8 - if i > l { - return io.ErrUnexpectedEOF - } - index = i - v = uint64(data[i-8]) - v |= uint64(data[i-7]) << 8 - v |= uint64(data[i-6]) << 16 - v |= uint64(data[i-5]) << 24 - v |= uint64(data[i-4]) << 32 - v |= uint64(data[i-3]) << 40 - v |= uint64(data[i-2]) << 48 - v |= uint64(data[i-1]) << 56 - v2 := math1.Float64frombits(v) - m.FailoverTimeout = &v2 - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Checkpoint", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - b := bool(v != 0) - m.Checkpoint = &b - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Role", 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 - } - s := string(data[index:postIndex]) - m.Role = &s - index = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Hostname", 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 - } - s := string(data[index:postIndex]) - m.Hostname = &s - index = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Principal", 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 - } - s := string(data[index:postIndex]) - m.Principal = &s - index = postIndex - case 9: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field WebuiUrl", 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 - } - s := string(data[index:postIndex]) - m.WebuiUrl = &s - 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 false + } + + that1, ok := that.(*SlaveID) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true } + return false + } else if this == nil { + return false } - return nil + if this.Value != nil && that1.Value != nil { + if *this.Value != *that1.Value { + return false + } + } else if this.Value != nil { + return false + } else if that1.Value != nil { + return false + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true } -func (m *HealthCheck) 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 - } +func (this *TaskID) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Http", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Http == nil { - m.Http = &HealthCheck_HTTP{} - } - if err := m.Http.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - case 2: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field DelaySeconds", wireType) - } - var v uint64 - i := index + 8 - if i > l { - return io.ErrUnexpectedEOF - } - index = i - v = uint64(data[i-8]) - v |= uint64(data[i-7]) << 8 - v |= uint64(data[i-6]) << 16 - v |= uint64(data[i-5]) << 24 - v |= uint64(data[i-4]) << 32 - v |= uint64(data[i-3]) << 40 - v |= uint64(data[i-2]) << 48 - v |= uint64(data[i-1]) << 56 - v2 := math1.Float64frombits(v) - m.DelaySeconds = &v2 - case 3: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field IntervalSeconds", wireType) - } - var v uint64 - i := index + 8 - if i > l { - return io.ErrUnexpectedEOF - } - index = i - v = uint64(data[i-8]) - v |= uint64(data[i-7]) << 8 - v |= uint64(data[i-6]) << 16 - v |= uint64(data[i-5]) << 24 - v |= uint64(data[i-4]) << 32 - v |= uint64(data[i-3]) << 40 - v |= uint64(data[i-2]) << 48 - v |= uint64(data[i-1]) << 56 - v2 := math1.Float64frombits(v) - m.IntervalSeconds = &v2 - case 4: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field TimeoutSeconds", wireType) - } - var v uint64 - i := index + 8 - if i > l { - return io.ErrUnexpectedEOF - } - index = i - v = uint64(data[i-8]) - v |= uint64(data[i-7]) << 8 - v |= uint64(data[i-6]) << 16 - v |= uint64(data[i-5]) << 24 - v |= uint64(data[i-4]) << 32 - v |= uint64(data[i-3]) << 40 - v |= uint64(data[i-2]) << 48 - v |= uint64(data[i-1]) << 56 - v2 := math1.Float64frombits(v) - m.TimeoutSeconds = &v2 - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ConsecutiveFailures", wireType) - } - var v uint32 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint32(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.ConsecutiveFailures = &v - case 6: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field GracePeriodSeconds", wireType) - } - var v uint64 - i := index + 8 - if i > l { - return io.ErrUnexpectedEOF - } - index = i - v = uint64(data[i-8]) - v |= uint64(data[i-7]) << 8 - v |= uint64(data[i-6]) << 16 - v |= uint64(data[i-5]) << 24 - v |= uint64(data[i-4]) << 32 - v |= uint64(data[i-3]) << 40 - v |= uint64(data[i-2]) << 48 - v |= uint64(data[i-1]) << 56 - v2 := math1.Float64frombits(v) - m.GracePeriodSeconds = &v2 - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Command", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Command == nil { - m.Command = &CommandInfo{} - } - if err := m.Command.Unmarshal(data[index:postIndex]); err != nil { - return err - } - 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 fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*TaskID) + if !ok { + return fmt.Errorf("that is not of type *TaskID") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *TaskID but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *TaskIDbut is not nil && this == nil") + } + if this.Value != nil && that1.Value != nil { + if *this.Value != *that1.Value { + return fmt.Errorf("Value this(%v) Not Equal that(%v)", *this.Value, *that1.Value) } + } else if this.Value != nil { + return fmt.Errorf("this.Value == nil && that.Value != nil") + } else if that1.Value != nil { + return fmt.Errorf("Value this(%v) Not Equal that(%v)", this.Value, that1.Value) + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) } return nil } -func (m *HealthCheck_HTTP) 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 != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Port", wireType) - } - var v uint32 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint32(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Port = &v - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Path", 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 - } - s := string(data[index:postIndex]) - m.Path = &s - index = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Statuses", wireType) - } - var v uint32 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint32(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Statuses = append(m.Statuses, v) - 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 +func (this *TaskID) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true } + return false } - return nil -} -func (m *CommandInfo) 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 - } + + that1, ok := that.(*TaskID) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Container", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Container == nil { - m.Container = &CommandInfo_ContainerInfo{} - } - if err := m.Container.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Uris", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Uris = append(m.Uris, &CommandInfo_URI{}) - m.Uris[len(m.Uris)-1].Unmarshal(data[index:postIndex]) - index = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Environment", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Environment == nil { - m.Environment = &Environment{} - } - if err := m.Environment.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Shell", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - b := bool(v != 0) - m.Shell = &b - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", 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 - } - s := string(data[index:postIndex]) - m.Value = &s - index = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Arguments", 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.Arguments = append(m.Arguments, string(data[index:postIndex])) - index = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field User", 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 - } - s := string(data[index:postIndex]) - m.User = &s - 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 false + } else if this == nil { + return false + } + if this.Value != nil && that1.Value != nil { + if *this.Value != *that1.Value { + return false } + } else if this.Value != nil { + return false + } else if that1.Value != nil { + return false } - return nil + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true } -func (m *CommandInfo_URI) 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 Value", 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 - } - s := string(data[index:postIndex]) - m.Value = &s - index = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Executable", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - b := bool(v != 0) - m.Executable = &b - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Extract", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - b := bool(v != 0) - m.Extract = &b - 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 +func (this *ExecutorID) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*ExecutorID) + if !ok { + return fmt.Errorf("that is not of type *ExecutorID") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *ExecutorID but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *ExecutorIDbut is not nil && this == nil") + } + if this.Value != nil && that1.Value != nil { + if *this.Value != *that1.Value { + return fmt.Errorf("Value this(%v) Not Equal that(%v)", *this.Value, *that1.Value) } + } else if this.Value != nil { + return fmt.Errorf("this.Value == nil && that.Value != nil") + } else if that1.Value != nil { + return fmt.Errorf("Value this(%v) Not Equal that(%v)", this.Value, that1.Value) + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) } return nil } -func (m *CommandInfo_ContainerInfo) 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 - } +func (this *ExecutorID) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Image", 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 - } - s := string(data[index:postIndex]) - m.Image = &s - index = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Options", 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.Options = append(m.Options, 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 false + } + + that1, ok := that.(*ExecutorID) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if this.Value != nil && that1.Value != nil { + if *this.Value != *that1.Value { + return false + } + } else if this.Value != nil { + return false + } else if that1.Value != nil { + return false + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *ContainerID) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*ContainerID) + if !ok { + return fmt.Errorf("that is not of type *ContainerID") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *ContainerID but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *ContainerIDbut is not nil && this == nil") + } + if this.Value != nil && that1.Value != nil { + if *this.Value != *that1.Value { + return fmt.Errorf("Value this(%v) Not Equal that(%v)", *this.Value, *that1.Value) } + } else if this.Value != nil { + return fmt.Errorf("this.Value == nil && that.Value != nil") + } else if that1.Value != nil { + return fmt.Errorf("Value this(%v) Not Equal that(%v)", this.Value, that1.Value) + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) } return nil } -func (m *ExecutorInfo) 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 - } +func (this *ContainerID) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ExecutorId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ExecutorId == nil { - m.ExecutorId = &ExecutorID{} - } - if err := m.ExecutorId.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FrameworkId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.FrameworkId == nil { - m.FrameworkId = &FrameworkID{} - } - if err := m.FrameworkId.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Command", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Command == nil { - m.Command = &CommandInfo{} - } - if err := m.Command.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - case 11: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Container", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Container == nil { - m.Container = &ContainerInfo{} - } - if err := m.Container.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Resources", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Resources = append(m.Resources, &Resource{}) - m.Resources[len(m.Resources)-1].Unmarshal(data[index:postIndex]) - index = postIndex - case 9: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", 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 - } - s := string(data[index:postIndex]) - m.Name = &s - index = postIndex - case 10: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Source", 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 - } - s := string(data[index:postIndex]) - m.Source = &s - index = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - byteLen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + byteLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Data = append([]byte{}, 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 false + } + + that1, ok := that.(*ContainerID) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if this.Value != nil && that1.Value != nil { + if *this.Value != *that1.Value { + return false + } + } else if this.Value != nil { + return false + } else if that1.Value != nil { + return false + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *FrameworkInfo) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*FrameworkInfo) + if !ok { + return fmt.Errorf("that is not of type *FrameworkInfo") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *FrameworkInfo but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *FrameworkInfobut is not nil && this == nil") + } + if this.User != nil && that1.User != nil { + if *this.User != *that1.User { + return fmt.Errorf("User this(%v) Not Equal that(%v)", *this.User, *that1.User) + } + } else if this.User != nil { + return fmt.Errorf("this.User == nil && that.User != nil") + } else if that1.User != nil { + return fmt.Errorf("User this(%v) Not Equal that(%v)", this.User, that1.User) + } + if this.Name != nil && that1.Name != nil { + if *this.Name != *that1.Name { + return fmt.Errorf("Name this(%v) Not Equal that(%v)", *this.Name, *that1.Name) + } + } else if this.Name != nil { + return fmt.Errorf("this.Name == nil && that.Name != nil") + } else if that1.Name != nil { + return fmt.Errorf("Name this(%v) Not Equal that(%v)", this.Name, that1.Name) + } + if !this.Id.Equal(that1.Id) { + return fmt.Errorf("Id this(%v) Not Equal that(%v)", this.Id, that1.Id) + } + if this.FailoverTimeout != nil && that1.FailoverTimeout != nil { + if *this.FailoverTimeout != *that1.FailoverTimeout { + return fmt.Errorf("FailoverTimeout this(%v) Not Equal that(%v)", *this.FailoverTimeout, *that1.FailoverTimeout) + } + } else if this.FailoverTimeout != nil { + return fmt.Errorf("this.FailoverTimeout == nil && that.FailoverTimeout != nil") + } else if that1.FailoverTimeout != nil { + return fmt.Errorf("FailoverTimeout this(%v) Not Equal that(%v)", this.FailoverTimeout, that1.FailoverTimeout) + } + if this.Checkpoint != nil && that1.Checkpoint != nil { + if *this.Checkpoint != *that1.Checkpoint { + return fmt.Errorf("Checkpoint this(%v) Not Equal that(%v)", *this.Checkpoint, *that1.Checkpoint) } + } else if this.Checkpoint != nil { + return fmt.Errorf("this.Checkpoint == nil && that.Checkpoint != nil") + } else if that1.Checkpoint != nil { + return fmt.Errorf("Checkpoint this(%v) Not Equal that(%v)", this.Checkpoint, that1.Checkpoint) + } + if this.Role != nil && that1.Role != nil { + if *this.Role != *that1.Role { + return fmt.Errorf("Role this(%v) Not Equal that(%v)", *this.Role, *that1.Role) + } + } else if this.Role != nil { + return fmt.Errorf("this.Role == nil && that.Role != nil") + } else if that1.Role != nil { + return fmt.Errorf("Role this(%v) Not Equal that(%v)", this.Role, that1.Role) + } + if this.Hostname != nil && that1.Hostname != nil { + if *this.Hostname != *that1.Hostname { + return fmt.Errorf("Hostname this(%v) Not Equal that(%v)", *this.Hostname, *that1.Hostname) + } + } else if this.Hostname != nil { + return fmt.Errorf("this.Hostname == nil && that.Hostname != nil") + } else if that1.Hostname != nil { + return fmt.Errorf("Hostname this(%v) Not Equal that(%v)", this.Hostname, that1.Hostname) + } + if this.Principal != nil && that1.Principal != nil { + if *this.Principal != *that1.Principal { + return fmt.Errorf("Principal this(%v) Not Equal that(%v)", *this.Principal, *that1.Principal) + } + } else if this.Principal != nil { + return fmt.Errorf("this.Principal == nil && that.Principal != nil") + } else if that1.Principal != nil { + return fmt.Errorf("Principal this(%v) Not Equal that(%v)", this.Principal, that1.Principal) + } + if this.WebuiUrl != nil && that1.WebuiUrl != nil { + if *this.WebuiUrl != *that1.WebuiUrl { + return fmt.Errorf("WebuiUrl this(%v) Not Equal that(%v)", *this.WebuiUrl, *that1.WebuiUrl) + } + } else if this.WebuiUrl != nil { + return fmt.Errorf("this.WebuiUrl == nil && that.WebuiUrl != nil") + } else if that1.WebuiUrl != nil { + return fmt.Errorf("WebuiUrl this(%v) Not Equal that(%v)", this.WebuiUrl, that1.WebuiUrl) + } + if len(this.Capabilities) != len(that1.Capabilities) { + return fmt.Errorf("Capabilities this(%v) Not Equal that(%v)", len(this.Capabilities), len(that1.Capabilities)) + } + for i := range this.Capabilities { + if !this.Capabilities[i].Equal(that1.Capabilities[i]) { + return fmt.Errorf("Capabilities this[%v](%v) Not Equal that[%v](%v)", i, this.Capabilities[i], i, that1.Capabilities[i]) + } + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) } return nil } -func (m *MasterInfo) 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 - } +func (this *FrameworkInfo) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", 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 - } - s := string(data[index:postIndex]) - m.Id = &s - index = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Ip", wireType) - } - var v uint32 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint32(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Ip = &v - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Port", wireType) - } - var v uint32 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint32(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Port = &v - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pid", 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 - } - s := string(data[index:postIndex]) - m.Pid = &s - index = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Hostname", 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 - } - s := string(data[index:postIndex]) - m.Hostname = &s - 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 false + } + + that1, ok := that.(*FrameworkInfo) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true } + return false + } else if this == nil { + return false } - return nil -} -func (m *SlaveInfo) 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 - } + if this.User != nil && that1.User != nil { + if *this.User != *that1.User { + return false } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Hostname", 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 - } - s := string(data[index:postIndex]) - m.Hostname = &s - index = postIndex - case 8: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Port", wireType) - } - var v int32 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (int32(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Port = &v - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Resources", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Resources = append(m.Resources, &Resource{}) - m.Resources[len(m.Resources)-1].Unmarshal(data[index:postIndex]) - index = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Attributes", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Attributes = append(m.Attributes, &Attribute{}) - m.Attributes[len(m.Attributes)-1].Unmarshal(data[index:postIndex]) - index = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Id == nil { - m.Id = &SlaveID{} - } - if err := m.Id.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - case 7: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Checkpoint", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - b := bool(v != 0) - m.Checkpoint = &b - 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 + } else if this.User != nil { + return false + } else if that1.User != nil { + return false + } + if this.Name != nil && that1.Name != nil { + if *this.Name != *that1.Name { + return false } + } else if this.Name != nil { + return false + } else if that1.Name != nil { + return false } - return nil -} -func (m *Value) 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 - } + if !this.Id.Equal(that1.Id) { + return false + } + if this.FailoverTimeout != nil && that1.FailoverTimeout != nil { + if *this.FailoverTimeout != *that1.FailoverTimeout { + return false } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - var v Value_Type - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (Value_Type(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Type = &v - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Scalar", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Scalar == nil { - m.Scalar = &Value_Scalar{} - } - if err := m.Scalar.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Ranges", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Ranges == nil { - m.Ranges = &Value_Ranges{} - } - if err := m.Ranges.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Set", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Set == nil { - m.Set = &Value_Set{} - } - if err := m.Set.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Text", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Text == nil { - m.Text = &Value_Text{} - } - if err := m.Text.Unmarshal(data[index:postIndex]); err != nil { - return err - } - 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 + } else if this.FailoverTimeout != nil { + return false + } else if that1.FailoverTimeout != nil { + return false + } + if this.Checkpoint != nil && that1.Checkpoint != nil { + if *this.Checkpoint != *that1.Checkpoint { + return false } + } else if this.Checkpoint != nil { + return false + } else if that1.Checkpoint != nil { + return false } - return nil -} -func (m *Value_Scalar) 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 - } + if this.Role != nil && that1.Role != nil { + if *this.Role != *that1.Role { + return false } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - var v uint64 - i := index + 8 - if i > l { - return io.ErrUnexpectedEOF - } - index = i - v = uint64(data[i-8]) - v |= uint64(data[i-7]) << 8 - v |= uint64(data[i-6]) << 16 - v |= uint64(data[i-5]) << 24 - v |= uint64(data[i-4]) << 32 - v |= uint64(data[i-3]) << 40 - v |= uint64(data[i-2]) << 48 - v |= uint64(data[i-1]) << 56 - v2 := math1.Float64frombits(v) - m.Value = &v2 - 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 + } else if this.Role != nil { + return false + } else if that1.Role != nil { + return false + } + if this.Hostname != nil && that1.Hostname != nil { + if *this.Hostname != *that1.Hostname { + return false } + } else if this.Hostname != nil { + return false + } else if that1.Hostname != nil { + return false } - return nil -} -func (m *Value_Range) 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 - } + if this.Principal != nil && that1.Principal != nil { + if *this.Principal != *that1.Principal { + return false } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Begin", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Begin = &v - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field End", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.End = &v - 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 + } else if this.Principal != nil { + return false + } else if that1.Principal != nil { + return false + } + if this.WebuiUrl != nil && that1.WebuiUrl != nil { + if *this.WebuiUrl != *that1.WebuiUrl { + return false } + } else if this.WebuiUrl != nil { + return false + } else if that1.WebuiUrl != nil { + return false } - return nil + if len(this.Capabilities) != len(that1.Capabilities) { + return false + } + for i := range this.Capabilities { + if !this.Capabilities[i].Equal(that1.Capabilities[i]) { + return false + } + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true } -func (m *Value_Ranges) 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 - } +func (this *FrameworkInfo_Capability) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Range", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Range = append(m.Range, &Value_Range{}) - m.Range[len(m.Range)-1].Unmarshal(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 fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*FrameworkInfo_Capability) + if !ok { + return fmt.Errorf("that is not of type *FrameworkInfo_Capability") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *FrameworkInfo_Capability but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *FrameworkInfo_Capabilitybut is not nil && this == nil") + } + if this.Type != nil && that1.Type != nil { + if *this.Type != *that1.Type { + return fmt.Errorf("Type this(%v) Not Equal that(%v)", *this.Type, *that1.Type) } + } else if this.Type != nil { + return fmt.Errorf("this.Type == nil && that.Type != nil") + } else if that1.Type != nil { + return fmt.Errorf("Type this(%v) Not Equal that(%v)", this.Type, that1.Type) + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) } return nil } -func (m *Value_Set) 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 - } +func (this *FrameworkInfo_Capability) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Item", 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.Item = append(m.Item, 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 false + } + + that1, ok := that.(*FrameworkInfo_Capability) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true } + return false + } else if this == nil { + return false } - return nil + if this.Type != nil && that1.Type != nil { + if *this.Type != *that1.Type { + return false + } + } else if this.Type != nil { + return false + } else if that1.Type != nil { + return false + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true } -func (m *Value_Text) 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 - } +func (this *HealthCheck) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", 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 - } - s := string(data[index:postIndex]) - m.Value = &s - 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 fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*HealthCheck) + if !ok { + return fmt.Errorf("that is not of type *HealthCheck") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *HealthCheck but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *HealthCheckbut is not nil && this == nil") + } + if !this.Http.Equal(that1.Http) { + return fmt.Errorf("Http this(%v) Not Equal that(%v)", this.Http, that1.Http) + } + if this.DelaySeconds != nil && that1.DelaySeconds != nil { + if *this.DelaySeconds != *that1.DelaySeconds { + return fmt.Errorf("DelaySeconds this(%v) Not Equal that(%v)", *this.DelaySeconds, *that1.DelaySeconds) + } + } else if this.DelaySeconds != nil { + return fmt.Errorf("this.DelaySeconds == nil && that.DelaySeconds != nil") + } else if that1.DelaySeconds != nil { + return fmt.Errorf("DelaySeconds this(%v) Not Equal that(%v)", this.DelaySeconds, that1.DelaySeconds) + } + if this.IntervalSeconds != nil && that1.IntervalSeconds != nil { + if *this.IntervalSeconds != *that1.IntervalSeconds { + return fmt.Errorf("IntervalSeconds this(%v) Not Equal that(%v)", *this.IntervalSeconds, *that1.IntervalSeconds) + } + } else if this.IntervalSeconds != nil { + return fmt.Errorf("this.IntervalSeconds == nil && that.IntervalSeconds != nil") + } else if that1.IntervalSeconds != nil { + return fmt.Errorf("IntervalSeconds this(%v) Not Equal that(%v)", this.IntervalSeconds, that1.IntervalSeconds) + } + if this.TimeoutSeconds != nil && that1.TimeoutSeconds != nil { + if *this.TimeoutSeconds != *that1.TimeoutSeconds { + return fmt.Errorf("TimeoutSeconds this(%v) Not Equal that(%v)", *this.TimeoutSeconds, *that1.TimeoutSeconds) + } + } else if this.TimeoutSeconds != nil { + return fmt.Errorf("this.TimeoutSeconds == nil && that.TimeoutSeconds != nil") + } else if that1.TimeoutSeconds != nil { + return fmt.Errorf("TimeoutSeconds this(%v) Not Equal that(%v)", this.TimeoutSeconds, that1.TimeoutSeconds) + } + if this.ConsecutiveFailures != nil && that1.ConsecutiveFailures != nil { + if *this.ConsecutiveFailures != *that1.ConsecutiveFailures { + return fmt.Errorf("ConsecutiveFailures this(%v) Not Equal that(%v)", *this.ConsecutiveFailures, *that1.ConsecutiveFailures) } + } else if this.ConsecutiveFailures != nil { + return fmt.Errorf("this.ConsecutiveFailures == nil && that.ConsecutiveFailures != nil") + } else if that1.ConsecutiveFailures != nil { + return fmt.Errorf("ConsecutiveFailures this(%v) Not Equal that(%v)", this.ConsecutiveFailures, that1.ConsecutiveFailures) + } + if this.GracePeriodSeconds != nil && that1.GracePeriodSeconds != nil { + if *this.GracePeriodSeconds != *that1.GracePeriodSeconds { + return fmt.Errorf("GracePeriodSeconds this(%v) Not Equal that(%v)", *this.GracePeriodSeconds, *that1.GracePeriodSeconds) + } + } else if this.GracePeriodSeconds != nil { + return fmt.Errorf("this.GracePeriodSeconds == nil && that.GracePeriodSeconds != nil") + } else if that1.GracePeriodSeconds != nil { + return fmt.Errorf("GracePeriodSeconds this(%v) Not Equal that(%v)", this.GracePeriodSeconds, that1.GracePeriodSeconds) + } + if !this.Command.Equal(that1.Command) { + return fmt.Errorf("Command this(%v) Not Equal that(%v)", this.Command, that1.Command) + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) } return nil } -func (m *Attribute) 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 - } +func (this *HealthCheck) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", 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 - } - s := string(data[index:postIndex]) - m.Name = &s - index = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - var v Value_Type - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (Value_Type(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Type = &v - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Scalar", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Scalar == nil { - m.Scalar = &Value_Scalar{} - } - if err := m.Scalar.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Ranges", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Ranges == nil { - m.Ranges = &Value_Ranges{} - } - if err := m.Ranges.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Set", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Set == nil { - m.Set = &Value_Set{} - } - if err := m.Set.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Text", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Text == nil { - m.Text = &Value_Text{} - } - if err := m.Text.Unmarshal(data[index:postIndex]); err != nil { - return err - } - 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 false + } + + that1, ok := that.(*HealthCheck) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true } + return false + } else if this == nil { + return false + } + if !this.Http.Equal(that1.Http) { + return false + } + if this.DelaySeconds != nil && that1.DelaySeconds != nil { + if *this.DelaySeconds != *that1.DelaySeconds { + return false + } + } else if this.DelaySeconds != nil { + return false + } else if that1.DelaySeconds != nil { + return false + } + if this.IntervalSeconds != nil && that1.IntervalSeconds != nil { + if *this.IntervalSeconds != *that1.IntervalSeconds { + return false + } + } else if this.IntervalSeconds != nil { + return false + } else if that1.IntervalSeconds != nil { + return false + } + if this.TimeoutSeconds != nil && that1.TimeoutSeconds != nil { + if *this.TimeoutSeconds != *that1.TimeoutSeconds { + return false + } + } else if this.TimeoutSeconds != nil { + return false + } else if that1.TimeoutSeconds != nil { + return false + } + if this.ConsecutiveFailures != nil && that1.ConsecutiveFailures != nil { + if *this.ConsecutiveFailures != *that1.ConsecutiveFailures { + return false + } + } else if this.ConsecutiveFailures != nil { + return false + } else if that1.ConsecutiveFailures != nil { + return false + } + if this.GracePeriodSeconds != nil && that1.GracePeriodSeconds != nil { + if *this.GracePeriodSeconds != *that1.GracePeriodSeconds { + return false + } + } else if this.GracePeriodSeconds != nil { + return false + } else if that1.GracePeriodSeconds != nil { + return false + } + if !this.Command.Equal(that1.Command) { + return false + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *HealthCheck_HTTP) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*HealthCheck_HTTP) + if !ok { + return fmt.Errorf("that is not of type *HealthCheck_HTTP") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *HealthCheck_HTTP but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *HealthCheck_HTTPbut is not nil && this == nil") + } + if this.Port != nil && that1.Port != nil { + if *this.Port != *that1.Port { + return fmt.Errorf("Port this(%v) Not Equal that(%v)", *this.Port, *that1.Port) + } + } else if this.Port != nil { + return fmt.Errorf("this.Port == nil && that.Port != nil") + } else if that1.Port != nil { + return fmt.Errorf("Port this(%v) Not Equal that(%v)", this.Port, that1.Port) + } + if this.Path != nil && that1.Path != nil { + if *this.Path != *that1.Path { + return fmt.Errorf("Path this(%v) Not Equal that(%v)", *this.Path, *that1.Path) + } + } else if this.Path != nil { + return fmt.Errorf("this.Path == nil && that.Path != nil") + } else if that1.Path != nil { + return fmt.Errorf("Path this(%v) Not Equal that(%v)", this.Path, that1.Path) + } + if len(this.Statuses) != len(that1.Statuses) { + return fmt.Errorf("Statuses this(%v) Not Equal that(%v)", len(this.Statuses), len(that1.Statuses)) + } + for i := range this.Statuses { + if this.Statuses[i] != that1.Statuses[i] { + return fmt.Errorf("Statuses this[%v](%v) Not Equal that[%v](%v)", i, this.Statuses[i], i, that1.Statuses[i]) + } + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) } return nil } -func (m *Resource) 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 - } +func (this *HealthCheck_HTTP) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", 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 - } - s := string(data[index:postIndex]) - m.Name = &s - index = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - var v Value_Type - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (Value_Type(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Type = &v - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Scalar", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Scalar == nil { - m.Scalar = &Value_Scalar{} - } - if err := m.Scalar.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Ranges", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Ranges == nil { - m.Ranges = &Value_Ranges{} - } - if err := m.Ranges.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Set", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Set == nil { - m.Set = &Value_Set{} - } - if err := m.Set.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Role", 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 - } - s := string(data[index:postIndex]) - m.Role = &s - 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 false + } + + that1, ok := that.(*HealthCheck_HTTP) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if this.Port != nil && that1.Port != nil { + if *this.Port != *that1.Port { + return false + } + } else if this.Port != nil { + return false + } else if that1.Port != nil { + return false + } + if this.Path != nil && that1.Path != nil { + if *this.Path != *that1.Path { + return false + } + } else if this.Path != nil { + return false + } else if that1.Path != nil { + return false + } + if len(this.Statuses) != len(that1.Statuses) { + return false + } + for i := range this.Statuses { + if this.Statuses[i] != that1.Statuses[i] { + return false + } + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *CommandInfo) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*CommandInfo) + if !ok { + return fmt.Errorf("that is not of type *CommandInfo") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *CommandInfo but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *CommandInfobut is not nil && this == nil") + } + if !this.Container.Equal(that1.Container) { + return fmt.Errorf("Container this(%v) Not Equal that(%v)", this.Container, that1.Container) + } + if len(this.Uris) != len(that1.Uris) { + return fmt.Errorf("Uris this(%v) Not Equal that(%v)", len(this.Uris), len(that1.Uris)) + } + for i := range this.Uris { + if !this.Uris[i].Equal(that1.Uris[i]) { + return fmt.Errorf("Uris this[%v](%v) Not Equal that[%v](%v)", i, this.Uris[i], i, that1.Uris[i]) + } + } + if !this.Environment.Equal(that1.Environment) { + return fmt.Errorf("Environment this(%v) Not Equal that(%v)", this.Environment, that1.Environment) + } + if this.Shell != nil && that1.Shell != nil { + if *this.Shell != *that1.Shell { + return fmt.Errorf("Shell this(%v) Not Equal that(%v)", *this.Shell, *that1.Shell) + } + } else if this.Shell != nil { + return fmt.Errorf("this.Shell == nil && that.Shell != nil") + } else if that1.Shell != nil { + return fmt.Errorf("Shell this(%v) Not Equal that(%v)", this.Shell, that1.Shell) + } + if this.Value != nil && that1.Value != nil { + if *this.Value != *that1.Value { + return fmt.Errorf("Value this(%v) Not Equal that(%v)", *this.Value, *that1.Value) + } + } else if this.Value != nil { + return fmt.Errorf("this.Value == nil && that.Value != nil") + } else if that1.Value != nil { + return fmt.Errorf("Value this(%v) Not Equal that(%v)", this.Value, that1.Value) + } + if len(this.Arguments) != len(that1.Arguments) { + return fmt.Errorf("Arguments this(%v) Not Equal that(%v)", len(this.Arguments), len(that1.Arguments)) + } + for i := range this.Arguments { + if this.Arguments[i] != that1.Arguments[i] { + return fmt.Errorf("Arguments this[%v](%v) Not Equal that[%v](%v)", i, this.Arguments[i], i, that1.Arguments[i]) + } + } + if this.User != nil && that1.User != nil { + if *this.User != *that1.User { + return fmt.Errorf("User this(%v) Not Equal that(%v)", *this.User, *that1.User) } + } else if this.User != nil { + return fmt.Errorf("this.User == nil && that.User != nil") + } else if that1.User != nil { + return fmt.Errorf("User this(%v) Not Equal that(%v)", this.User, that1.User) + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) } return nil } -func (m *ResourceStatistics) 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 - } +func (this *CommandInfo) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) - } - var v uint64 - i := index + 8 - if i > l { - return io.ErrUnexpectedEOF - } - index = i - v = uint64(data[i-8]) - v |= uint64(data[i-7]) << 8 - v |= uint64(data[i-6]) << 16 - v |= uint64(data[i-5]) << 24 - v |= uint64(data[i-4]) << 32 - v |= uint64(data[i-3]) << 40 - v |= uint64(data[i-2]) << 48 - v |= uint64(data[i-1]) << 56 - v2 := math1.Float64frombits(v) - m.Timestamp = &v2 - case 2: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field CpusUserTimeSecs", wireType) - } - var v uint64 - i := index + 8 - if i > l { - return io.ErrUnexpectedEOF - } - index = i - v = uint64(data[i-8]) - v |= uint64(data[i-7]) << 8 - v |= uint64(data[i-6]) << 16 - v |= uint64(data[i-5]) << 24 - v |= uint64(data[i-4]) << 32 - v |= uint64(data[i-3]) << 40 - v |= uint64(data[i-2]) << 48 - v |= uint64(data[i-1]) << 56 - v2 := math1.Float64frombits(v) - m.CpusUserTimeSecs = &v2 - case 3: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field CpusSystemTimeSecs", wireType) - } - var v uint64 - i := index + 8 - if i > l { - return io.ErrUnexpectedEOF - } - index = i - v = uint64(data[i-8]) - v |= uint64(data[i-7]) << 8 - v |= uint64(data[i-6]) << 16 - v |= uint64(data[i-5]) << 24 - v |= uint64(data[i-4]) << 32 - v |= uint64(data[i-3]) << 40 - v |= uint64(data[i-2]) << 48 - v |= uint64(data[i-1]) << 56 - v2 := math1.Float64frombits(v) - m.CpusSystemTimeSecs = &v2 - case 4: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field CpusLimit", wireType) - } - var v uint64 - i := index + 8 - if i > l { - return io.ErrUnexpectedEOF - } - index = i - v = uint64(data[i-8]) - v |= uint64(data[i-7]) << 8 - v |= uint64(data[i-6]) << 16 - v |= uint64(data[i-5]) << 24 - v |= uint64(data[i-4]) << 32 - v |= uint64(data[i-3]) << 40 - v |= uint64(data[i-2]) << 48 - v |= uint64(data[i-1]) << 56 - v2 := math1.Float64frombits(v) - m.CpusLimit = &v2 - case 7: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field CpusNrPeriods", wireType) - } - var v uint32 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint32(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.CpusNrPeriods = &v - case 8: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field CpusNrThrottled", wireType) - } - var v uint32 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint32(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.CpusNrThrottled = &v - case 9: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field CpusThrottledTimeSecs", wireType) - } - var v uint64 - i := index + 8 - if i > l { - return io.ErrUnexpectedEOF - } - index = i - v = uint64(data[i-8]) - v |= uint64(data[i-7]) << 8 - v |= uint64(data[i-6]) << 16 - v |= uint64(data[i-5]) << 24 - v |= uint64(data[i-4]) << 32 - v |= uint64(data[i-3]) << 40 - v |= uint64(data[i-2]) << 48 - v |= uint64(data[i-1]) << 56 - v2 := math1.Float64frombits(v) - m.CpusThrottledTimeSecs = &v2 - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MemRssBytes", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.MemRssBytes = &v - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MemLimitBytes", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.MemLimitBytes = &v - case 10: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MemFileBytes", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.MemFileBytes = &v - case 11: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MemAnonBytes", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.MemAnonBytes = &v - case 12: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MemMappedFileBytes", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.MemMappedFileBytes = &v - case 13: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Perf", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Perf == nil { - m.Perf = &PerfStatistics{} - } - if err := m.Perf.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - case 14: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NetRxPackets", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.NetRxPackets = &v - case 15: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NetRxBytes", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.NetRxBytes = &v - case 16: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NetRxErrors", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.NetRxErrors = &v - case 17: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NetRxDropped", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.NetRxDropped = &v - case 18: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NetTxPackets", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.NetTxPackets = &v - case 19: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NetTxBytes", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.NetTxBytes = &v - case 20: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NetTxErrors", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.NetTxErrors = &v - case 21: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NetTxDropped", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.NetTxDropped = &v - case 22: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field NetTcpRttMicrosecsP50", wireType) - } - var v uint64 - i := index + 8 - if i > l { - return io.ErrUnexpectedEOF - } - index = i - v = uint64(data[i-8]) - v |= uint64(data[i-7]) << 8 - v |= uint64(data[i-6]) << 16 - v |= uint64(data[i-5]) << 24 - v |= uint64(data[i-4]) << 32 - v |= uint64(data[i-3]) << 40 - v |= uint64(data[i-2]) << 48 - v |= uint64(data[i-1]) << 56 - v2 := math1.Float64frombits(v) - m.NetTcpRttMicrosecsP50 = &v2 - case 23: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field NetTcpRttMicrosecsP90", wireType) - } - var v uint64 - i := index + 8 - if i > l { - return io.ErrUnexpectedEOF - } - index = i - v = uint64(data[i-8]) - v |= uint64(data[i-7]) << 8 - v |= uint64(data[i-6]) << 16 - v |= uint64(data[i-5]) << 24 - v |= uint64(data[i-4]) << 32 - v |= uint64(data[i-3]) << 40 - v |= uint64(data[i-2]) << 48 - v |= uint64(data[i-1]) << 56 - v2 := math1.Float64frombits(v) - m.NetTcpRttMicrosecsP90 = &v2 - case 24: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field NetTcpRttMicrosecsP95", wireType) - } - var v uint64 - i := index + 8 - if i > l { - return io.ErrUnexpectedEOF - } - index = i - v = uint64(data[i-8]) - v |= uint64(data[i-7]) << 8 - v |= uint64(data[i-6]) << 16 - v |= uint64(data[i-5]) << 24 - v |= uint64(data[i-4]) << 32 - v |= uint64(data[i-3]) << 40 - v |= uint64(data[i-2]) << 48 - v |= uint64(data[i-1]) << 56 - v2 := math1.Float64frombits(v) - m.NetTcpRttMicrosecsP95 = &v2 - case 25: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field NetTcpRttMicrosecsP99", wireType) - } - var v uint64 - i := index + 8 - if i > l { - return io.ErrUnexpectedEOF - } - index = i - v = uint64(data[i-8]) - v |= uint64(data[i-7]) << 8 - v |= uint64(data[i-6]) << 16 - v |= uint64(data[i-5]) << 24 - v |= uint64(data[i-4]) << 32 - v |= uint64(data[i-3]) << 40 - v |= uint64(data[i-2]) << 48 - v |= uint64(data[i-1]) << 56 - v2 := math1.Float64frombits(v) - m.NetTcpRttMicrosecsP99 = &v2 - 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 *ResourceUsage) 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 SlaveId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.SlaveId == nil { - m.SlaveId = &SlaveID{} - } - if err := m.SlaveId.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FrameworkId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.FrameworkId == nil { - m.FrameworkId = &FrameworkID{} - } - if err := m.FrameworkId.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ExecutorId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ExecutorId == nil { - m.ExecutorId = &ExecutorID{} - } - if err := m.ExecutorId.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ExecutorName", 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 - } - s := string(data[index:postIndex]) - m.ExecutorName = &s - index = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TaskId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.TaskId == nil { - m.TaskId = &TaskID{} - } - if err := m.TaskId.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Statistics", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Statistics == nil { - m.Statistics = &ResourceStatistics{} - } - if err := m.Statistics.Unmarshal(data[index:postIndex]); err != nil { - return err - } - 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 *PerfStatistics) 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 != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) - } - var v uint64 - i := index + 8 - if i > l { - return io.ErrUnexpectedEOF - } - index = i - v = uint64(data[i-8]) - v |= uint64(data[i-7]) << 8 - v |= uint64(data[i-6]) << 16 - v |= uint64(data[i-5]) << 24 - v |= uint64(data[i-4]) << 32 - v |= uint64(data[i-3]) << 40 - v |= uint64(data[i-2]) << 48 - v |= uint64(data[i-1]) << 56 - v2 := math1.Float64frombits(v) - m.Timestamp = &v2 - case 2: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field Duration", wireType) - } - var v uint64 - i := index + 8 - if i > l { - return io.ErrUnexpectedEOF - } - index = i - v = uint64(data[i-8]) - v |= uint64(data[i-7]) << 8 - v |= uint64(data[i-6]) << 16 - v |= uint64(data[i-5]) << 24 - v |= uint64(data[i-4]) << 32 - v |= uint64(data[i-3]) << 40 - v |= uint64(data[i-2]) << 48 - v |= uint64(data[i-1]) << 56 - v2 := math1.Float64frombits(v) - m.Duration = &v2 - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Cycles", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Cycles = &v - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field StalledCyclesFrontend", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.StalledCyclesFrontend = &v - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field StalledCyclesBackend", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.StalledCyclesBackend = &v - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Instructions", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Instructions = &v - case 7: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field CacheReferences", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.CacheReferences = &v - case 8: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field CacheMisses", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.CacheMisses = &v - case 9: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Branches", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Branches = &v - case 10: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field BranchMisses", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.BranchMisses = &v - case 11: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field BusCycles", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.BusCycles = &v - case 12: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field RefCycles", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.RefCycles = &v - case 13: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field CpuClock", wireType) - } - var v uint64 - i := index + 8 - if i > l { - return io.ErrUnexpectedEOF - } - index = i - v = uint64(data[i-8]) - v |= uint64(data[i-7]) << 8 - v |= uint64(data[i-6]) << 16 - v |= uint64(data[i-5]) << 24 - v |= uint64(data[i-4]) << 32 - v |= uint64(data[i-3]) << 40 - v |= uint64(data[i-2]) << 48 - v |= uint64(data[i-1]) << 56 - v2 := math1.Float64frombits(v) - m.CpuClock = &v2 - case 14: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field TaskClock", wireType) - } - var v uint64 - i := index + 8 - if i > l { - return io.ErrUnexpectedEOF - } - index = i - v = uint64(data[i-8]) - v |= uint64(data[i-7]) << 8 - v |= uint64(data[i-6]) << 16 - v |= uint64(data[i-5]) << 24 - v |= uint64(data[i-4]) << 32 - v |= uint64(data[i-3]) << 40 - v |= uint64(data[i-2]) << 48 - v |= uint64(data[i-1]) << 56 - v2 := math1.Float64frombits(v) - m.TaskClock = &v2 - case 15: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PageFaults", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.PageFaults = &v - case 16: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MinorFaults", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.MinorFaults = &v - case 17: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MajorFaults", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.MajorFaults = &v - case 18: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ContextSwitches", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.ContextSwitches = &v - case 19: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field CpuMigrations", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.CpuMigrations = &v - case 20: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AlignmentFaults", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.AlignmentFaults = &v - case 21: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field EmulationFaults", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.EmulationFaults = &v - case 22: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field L1DcacheLoads", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.L1DcacheLoads = &v - case 23: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field L1DcacheLoadMisses", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.L1DcacheLoadMisses = &v - case 24: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field L1DcacheStores", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.L1DcacheStores = &v - case 25: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field L1DcacheStoreMisses", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.L1DcacheStoreMisses = &v - case 26: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field L1DcachePrefetches", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.L1DcachePrefetches = &v - case 27: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field L1DcachePrefetchMisses", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.L1DcachePrefetchMisses = &v - case 28: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field L1IcacheLoads", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.L1IcacheLoads = &v - case 29: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field L1IcacheLoadMisses", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.L1IcacheLoadMisses = &v - case 30: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field L1IcachePrefetches", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.L1IcachePrefetches = &v - case 31: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field L1IcachePrefetchMisses", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.L1IcachePrefetchMisses = &v - case 32: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field LlcLoads", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.LlcLoads = &v - case 33: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field LlcLoadMisses", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.LlcLoadMisses = &v - case 34: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field LlcStores", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.LlcStores = &v - case 35: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field LlcStoreMisses", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.LlcStoreMisses = &v - case 36: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field LlcPrefetches", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.LlcPrefetches = &v - case 37: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field LlcPrefetchMisses", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.LlcPrefetchMisses = &v - case 38: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DtlbLoads", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.DtlbLoads = &v - case 39: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DtlbLoadMisses", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.DtlbLoadMisses = &v - case 40: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DtlbStores", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.DtlbStores = &v - case 41: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DtlbStoreMisses", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.DtlbStoreMisses = &v - case 42: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DtlbPrefetches", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.DtlbPrefetches = &v - case 43: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DtlbPrefetchMisses", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.DtlbPrefetchMisses = &v - case 44: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ItlbLoads", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.ItlbLoads = &v - case 45: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ItlbLoadMisses", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.ItlbLoadMisses = &v - case 46: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field BranchLoads", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.BranchLoads = &v - case 47: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field BranchLoadMisses", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.BranchLoadMisses = &v - case 48: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NodeLoads", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.NodeLoads = &v - case 49: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NodeLoadMisses", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.NodeLoadMisses = &v - case 50: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NodeStores", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.NodeStores = &v - case 51: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NodeStoreMisses", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.NodeStoreMisses = &v - case 52: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NodePrefetches", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.NodePrefetches = &v - case 53: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NodePrefetchMisses", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.NodePrefetchMisses = &v - 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 false + } + + that1, ok := that.(*CommandInfo) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if !this.Container.Equal(that1.Container) { + return false + } + if len(this.Uris) != len(that1.Uris) { + return false + } + for i := range this.Uris { + if !this.Uris[i].Equal(that1.Uris[i]) { + return false + } + } + if !this.Environment.Equal(that1.Environment) { + return false + } + if this.Shell != nil && that1.Shell != nil { + if *this.Shell != *that1.Shell { + return false + } + } else if this.Shell != nil { + return false + } else if that1.Shell != nil { + return false + } + if this.Value != nil && that1.Value != nil { + if *this.Value != *that1.Value { + return false + } + } else if this.Value != nil { + return false + } else if that1.Value != nil { + return false + } + if len(this.Arguments) != len(that1.Arguments) { + return false + } + for i := range this.Arguments { + if this.Arguments[i] != that1.Arguments[i] { + return false + } + } + if this.User != nil && that1.User != nil { + if *this.User != *that1.User { + return false + } + } else if this.User != nil { + return false + } else if that1.User != nil { + return false + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *CommandInfo_URI) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*CommandInfo_URI) + if !ok { + return fmt.Errorf("that is not of type *CommandInfo_URI") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *CommandInfo_URI but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *CommandInfo_URIbut is not nil && this == nil") + } + if this.Value != nil && that1.Value != nil { + if *this.Value != *that1.Value { + return fmt.Errorf("Value this(%v) Not Equal that(%v)", *this.Value, *that1.Value) + } + } else if this.Value != nil { + return fmt.Errorf("this.Value == nil && that.Value != nil") + } else if that1.Value != nil { + return fmt.Errorf("Value this(%v) Not Equal that(%v)", this.Value, that1.Value) + } + if this.Executable != nil && that1.Executable != nil { + if *this.Executable != *that1.Executable { + return fmt.Errorf("Executable this(%v) Not Equal that(%v)", *this.Executable, *that1.Executable) + } + } else if this.Executable != nil { + return fmt.Errorf("this.Executable == nil && that.Executable != nil") + } else if that1.Executable != nil { + return fmt.Errorf("Executable this(%v) Not Equal that(%v)", this.Executable, that1.Executable) + } + if this.Extract != nil && that1.Extract != nil { + if *this.Extract != *that1.Extract { + return fmt.Errorf("Extract this(%v) Not Equal that(%v)", *this.Extract, *that1.Extract) + } + } else if this.Extract != nil { + return fmt.Errorf("this.Extract == nil && that.Extract != nil") + } else if that1.Extract != nil { + return fmt.Errorf("Extract this(%v) Not Equal that(%v)", this.Extract, that1.Extract) + } + if this.Cache != nil && that1.Cache != nil { + if *this.Cache != *that1.Cache { + return fmt.Errorf("Cache this(%v) Not Equal that(%v)", *this.Cache, *that1.Cache) + } + } else if this.Cache != nil { + return fmt.Errorf("this.Cache == nil && that.Cache != nil") + } else if that1.Cache != nil { + return fmt.Errorf("Cache this(%v) Not Equal that(%v)", this.Cache, that1.Cache) + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + } + return nil +} +func (this *CommandInfo_URI) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } + + that1, ok := that.(*CommandInfo_URI) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if this.Value != nil && that1.Value != nil { + if *this.Value != *that1.Value { + return false + } + } else if this.Value != nil { + return false + } else if that1.Value != nil { + return false + } + if this.Executable != nil && that1.Executable != nil { + if *this.Executable != *that1.Executable { + return false + } + } else if this.Executable != nil { + return false + } else if that1.Executable != nil { + return false + } + if this.Extract != nil && that1.Extract != nil { + if *this.Extract != *that1.Extract { + return false + } + } else if this.Extract != nil { + return false + } else if that1.Extract != nil { + return false + } + if this.Cache != nil && that1.Cache != nil { + if *this.Cache != *that1.Cache { + return false + } + } else if this.Cache != nil { + return false + } else if that1.Cache != nil { + return false + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *CommandInfo_ContainerInfo) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*CommandInfo_ContainerInfo) + if !ok { + return fmt.Errorf("that is not of type *CommandInfo_ContainerInfo") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *CommandInfo_ContainerInfo but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *CommandInfo_ContainerInfobut is not nil && this == nil") + } + if this.Image != nil && that1.Image != nil { + if *this.Image != *that1.Image { + return fmt.Errorf("Image this(%v) Not Equal that(%v)", *this.Image, *that1.Image) + } + } else if this.Image != nil { + return fmt.Errorf("this.Image == nil && that.Image != nil") + } else if that1.Image != nil { + return fmt.Errorf("Image this(%v) Not Equal that(%v)", this.Image, that1.Image) + } + if len(this.Options) != len(that1.Options) { + return fmt.Errorf("Options this(%v) Not Equal that(%v)", len(this.Options), len(that1.Options)) + } + for i := range this.Options { + if this.Options[i] != that1.Options[i] { + return fmt.Errorf("Options this[%v](%v) Not Equal that[%v](%v)", i, this.Options[i], i, that1.Options[i]) + } + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + } + return nil +} +func (this *CommandInfo_ContainerInfo) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } + + that1, ok := that.(*CommandInfo_ContainerInfo) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if this.Image != nil && that1.Image != nil { + if *this.Image != *that1.Image { + return false + } + } else if this.Image != nil { + return false + } else if that1.Image != nil { + return false + } + if len(this.Options) != len(that1.Options) { + return false + } + for i := range this.Options { + if this.Options[i] != that1.Options[i] { + return false + } + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *ExecutorInfo) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*ExecutorInfo) + if !ok { + return fmt.Errorf("that is not of type *ExecutorInfo") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *ExecutorInfo but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *ExecutorInfobut is not nil && this == nil") + } + if !this.ExecutorId.Equal(that1.ExecutorId) { + return fmt.Errorf("ExecutorId this(%v) Not Equal that(%v)", this.ExecutorId, that1.ExecutorId) + } + if !this.FrameworkId.Equal(that1.FrameworkId) { + return fmt.Errorf("FrameworkId this(%v) Not Equal that(%v)", this.FrameworkId, that1.FrameworkId) + } + if !this.Command.Equal(that1.Command) { + return fmt.Errorf("Command this(%v) Not Equal that(%v)", this.Command, that1.Command) + } + if !this.Container.Equal(that1.Container) { + return fmt.Errorf("Container this(%v) Not Equal that(%v)", this.Container, that1.Container) + } + if len(this.Resources) != len(that1.Resources) { + return fmt.Errorf("Resources this(%v) Not Equal that(%v)", len(this.Resources), len(that1.Resources)) + } + for i := range this.Resources { + if !this.Resources[i].Equal(that1.Resources[i]) { + return fmt.Errorf("Resources this[%v](%v) Not Equal that[%v](%v)", i, this.Resources[i], i, that1.Resources[i]) + } + } + if this.Name != nil && that1.Name != nil { + if *this.Name != *that1.Name { + return fmt.Errorf("Name this(%v) Not Equal that(%v)", *this.Name, *that1.Name) + } + } else if this.Name != nil { + return fmt.Errorf("this.Name == nil && that.Name != nil") + } else if that1.Name != nil { + return fmt.Errorf("Name this(%v) Not Equal that(%v)", this.Name, that1.Name) + } + if this.Source != nil && that1.Source != nil { + if *this.Source != *that1.Source { + return fmt.Errorf("Source this(%v) Not Equal that(%v)", *this.Source, *that1.Source) + } + } else if this.Source != nil { + return fmt.Errorf("this.Source == nil && that.Source != nil") + } else if that1.Source != nil { + return fmt.Errorf("Source this(%v) Not Equal that(%v)", this.Source, that1.Source) + } + if !bytes.Equal(this.Data, that1.Data) { + return fmt.Errorf("Data this(%v) Not Equal that(%v)", this.Data, that1.Data) + } + if !this.Discovery.Equal(that1.Discovery) { + return fmt.Errorf("Discovery this(%v) Not Equal that(%v)", this.Discovery, that1.Discovery) + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + } + return nil +} +func (this *ExecutorInfo) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } + + that1, ok := that.(*ExecutorInfo) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if !this.ExecutorId.Equal(that1.ExecutorId) { + return false + } + if !this.FrameworkId.Equal(that1.FrameworkId) { + return false + } + if !this.Command.Equal(that1.Command) { + return false + } + if !this.Container.Equal(that1.Container) { + return false + } + if len(this.Resources) != len(that1.Resources) { + return false + } + for i := range this.Resources { + if !this.Resources[i].Equal(that1.Resources[i]) { + return false + } + } + if this.Name != nil && that1.Name != nil { + if *this.Name != *that1.Name { + return false + } + } else if this.Name != nil { + return false + } else if that1.Name != nil { + return false + } + if this.Source != nil && that1.Source != nil { + if *this.Source != *that1.Source { + return false + } + } else if this.Source != nil { + return false + } else if that1.Source != nil { + return false + } + if !bytes.Equal(this.Data, that1.Data) { + return false + } + if !this.Discovery.Equal(that1.Discovery) { + return false + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *MasterInfo) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*MasterInfo) + if !ok { + return fmt.Errorf("that is not of type *MasterInfo") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *MasterInfo but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *MasterInfobut is not nil && this == nil") + } + if this.Id != nil && that1.Id != nil { + if *this.Id != *that1.Id { + return fmt.Errorf("Id this(%v) Not Equal that(%v)", *this.Id, *that1.Id) + } + } else if this.Id != nil { + return fmt.Errorf("this.Id == nil && that.Id != nil") + } else if that1.Id != nil { + return fmt.Errorf("Id this(%v) Not Equal that(%v)", this.Id, that1.Id) + } + if this.Ip != nil && that1.Ip != nil { + if *this.Ip != *that1.Ip { + return fmt.Errorf("Ip this(%v) Not Equal that(%v)", *this.Ip, *that1.Ip) + } + } else if this.Ip != nil { + return fmt.Errorf("this.Ip == nil && that.Ip != nil") + } else if that1.Ip != nil { + return fmt.Errorf("Ip this(%v) Not Equal that(%v)", this.Ip, that1.Ip) + } + if this.Port != nil && that1.Port != nil { + if *this.Port != *that1.Port { + return fmt.Errorf("Port this(%v) Not Equal that(%v)", *this.Port, *that1.Port) + } + } else if this.Port != nil { + return fmt.Errorf("this.Port == nil && that.Port != nil") + } else if that1.Port != nil { + return fmt.Errorf("Port this(%v) Not Equal that(%v)", this.Port, that1.Port) + } + if this.Pid != nil && that1.Pid != nil { + if *this.Pid != *that1.Pid { + return fmt.Errorf("Pid this(%v) Not Equal that(%v)", *this.Pid, *that1.Pid) + } + } else if this.Pid != nil { + return fmt.Errorf("this.Pid == nil && that.Pid != nil") + } else if that1.Pid != nil { + return fmt.Errorf("Pid this(%v) Not Equal that(%v)", this.Pid, that1.Pid) + } + if this.Hostname != nil && that1.Hostname != nil { + if *this.Hostname != *that1.Hostname { + return fmt.Errorf("Hostname this(%v) Not Equal that(%v)", *this.Hostname, *that1.Hostname) + } + } else if this.Hostname != nil { + return fmt.Errorf("this.Hostname == nil && that.Hostname != nil") + } else if that1.Hostname != nil { + return fmt.Errorf("Hostname this(%v) Not Equal that(%v)", this.Hostname, that1.Hostname) + } + if this.Version != nil && that1.Version != nil { + if *this.Version != *that1.Version { + return fmt.Errorf("Version this(%v) Not Equal that(%v)", *this.Version, *that1.Version) + } + } else if this.Version != nil { + return fmt.Errorf("this.Version == nil && that.Version != nil") + } else if that1.Version != nil { + return fmt.Errorf("Version this(%v) Not Equal that(%v)", this.Version, that1.Version) + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + } + return nil +} +func (this *MasterInfo) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } + + that1, ok := that.(*MasterInfo) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if this.Id != nil && that1.Id != nil { + if *this.Id != *that1.Id { + return false + } + } else if this.Id != nil { + return false + } else if that1.Id != nil { + return false + } + if this.Ip != nil && that1.Ip != nil { + if *this.Ip != *that1.Ip { + return false + } + } else if this.Ip != nil { + return false + } else if that1.Ip != nil { + return false + } + if this.Port != nil && that1.Port != nil { + if *this.Port != *that1.Port { + return false + } + } else if this.Port != nil { + return false + } else if that1.Port != nil { + return false + } + if this.Pid != nil && that1.Pid != nil { + if *this.Pid != *that1.Pid { + return false + } + } else if this.Pid != nil { + return false + } else if that1.Pid != nil { + return false + } + if this.Hostname != nil && that1.Hostname != nil { + if *this.Hostname != *that1.Hostname { + return false + } + } else if this.Hostname != nil { + return false + } else if that1.Hostname != nil { + return false + } + if this.Version != nil && that1.Version != nil { + if *this.Version != *that1.Version { + return false + } + } else if this.Version != nil { + return false + } else if that1.Version != nil { + return false + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *SlaveInfo) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*SlaveInfo) + if !ok { + return fmt.Errorf("that is not of type *SlaveInfo") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *SlaveInfo but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *SlaveInfobut is not nil && this == nil") + } + if this.Hostname != nil && that1.Hostname != nil { + if *this.Hostname != *that1.Hostname { + return fmt.Errorf("Hostname this(%v) Not Equal that(%v)", *this.Hostname, *that1.Hostname) + } + } else if this.Hostname != nil { + return fmt.Errorf("this.Hostname == nil && that.Hostname != nil") + } else if that1.Hostname != nil { + return fmt.Errorf("Hostname this(%v) Not Equal that(%v)", this.Hostname, that1.Hostname) + } + if this.Port != nil && that1.Port != nil { + if *this.Port != *that1.Port { + return fmt.Errorf("Port this(%v) Not Equal that(%v)", *this.Port, *that1.Port) + } + } else if this.Port != nil { + return fmt.Errorf("this.Port == nil && that.Port != nil") + } else if that1.Port != nil { + return fmt.Errorf("Port this(%v) Not Equal that(%v)", this.Port, that1.Port) + } + if len(this.Resources) != len(that1.Resources) { + return fmt.Errorf("Resources this(%v) Not Equal that(%v)", len(this.Resources), len(that1.Resources)) + } + for i := range this.Resources { + if !this.Resources[i].Equal(that1.Resources[i]) { + return fmt.Errorf("Resources this[%v](%v) Not Equal that[%v](%v)", i, this.Resources[i], i, that1.Resources[i]) + } + } + if len(this.Attributes) != len(that1.Attributes) { + return fmt.Errorf("Attributes this(%v) Not Equal that(%v)", len(this.Attributes), len(that1.Attributes)) + } + for i := range this.Attributes { + if !this.Attributes[i].Equal(that1.Attributes[i]) { + return fmt.Errorf("Attributes this[%v](%v) Not Equal that[%v](%v)", i, this.Attributes[i], i, that1.Attributes[i]) + } + } + if !this.Id.Equal(that1.Id) { + return fmt.Errorf("Id this(%v) Not Equal that(%v)", this.Id, that1.Id) + } + if this.Checkpoint != nil && that1.Checkpoint != nil { + if *this.Checkpoint != *that1.Checkpoint { + return fmt.Errorf("Checkpoint this(%v) Not Equal that(%v)", *this.Checkpoint, *that1.Checkpoint) + } + } else if this.Checkpoint != nil { + return fmt.Errorf("this.Checkpoint == nil && that.Checkpoint != nil") + } else if that1.Checkpoint != nil { + return fmt.Errorf("Checkpoint this(%v) Not Equal that(%v)", this.Checkpoint, that1.Checkpoint) + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + } + return nil +} +func (this *SlaveInfo) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } + + that1, ok := that.(*SlaveInfo) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if this.Hostname != nil && that1.Hostname != nil { + if *this.Hostname != *that1.Hostname { + return false + } + } else if this.Hostname != nil { + return false + } else if that1.Hostname != nil { + return false + } + if this.Port != nil && that1.Port != nil { + if *this.Port != *that1.Port { + return false + } + } else if this.Port != nil { + return false + } else if that1.Port != nil { + return false + } + if len(this.Resources) != len(that1.Resources) { + return false + } + for i := range this.Resources { + if !this.Resources[i].Equal(that1.Resources[i]) { + return false + } + } + if len(this.Attributes) != len(that1.Attributes) { + return false + } + for i := range this.Attributes { + if !this.Attributes[i].Equal(that1.Attributes[i]) { + return false + } + } + if !this.Id.Equal(that1.Id) { + return false + } + if this.Checkpoint != nil && that1.Checkpoint != nil { + if *this.Checkpoint != *that1.Checkpoint { + return false + } + } else if this.Checkpoint != nil { + return false + } else if that1.Checkpoint != nil { + return false + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *Value) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*Value) + if !ok { + return fmt.Errorf("that is not of type *Value") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *Value but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *Valuebut is not nil && this == nil") + } + if this.Type != nil && that1.Type != nil { + if *this.Type != *that1.Type { + return fmt.Errorf("Type this(%v) Not Equal that(%v)", *this.Type, *that1.Type) + } + } else if this.Type != nil { + return fmt.Errorf("this.Type == nil && that.Type != nil") + } else if that1.Type != nil { + return fmt.Errorf("Type this(%v) Not Equal that(%v)", this.Type, that1.Type) + } + if !this.Scalar.Equal(that1.Scalar) { + return fmt.Errorf("Scalar this(%v) Not Equal that(%v)", this.Scalar, that1.Scalar) + } + if !this.Ranges.Equal(that1.Ranges) { + return fmt.Errorf("Ranges this(%v) Not Equal that(%v)", this.Ranges, that1.Ranges) + } + if !this.Set.Equal(that1.Set) { + return fmt.Errorf("Set this(%v) Not Equal that(%v)", this.Set, that1.Set) + } + if !this.Text.Equal(that1.Text) { + return fmt.Errorf("Text this(%v) Not Equal that(%v)", this.Text, that1.Text) + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + } + return nil +} +func (this *Value) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } + + that1, ok := that.(*Value) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if this.Type != nil && that1.Type != nil { + if *this.Type != *that1.Type { + return false + } + } else if this.Type != nil { + return false + } else if that1.Type != nil { + return false + } + if !this.Scalar.Equal(that1.Scalar) { + return false + } + if !this.Ranges.Equal(that1.Ranges) { + return false + } + if !this.Set.Equal(that1.Set) { + return false + } + if !this.Text.Equal(that1.Text) { + return false + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *Value_Scalar) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*Value_Scalar) + if !ok { + return fmt.Errorf("that is not of type *Value_Scalar") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *Value_Scalar but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *Value_Scalarbut is not nil && this == nil") + } + if this.Value != nil && that1.Value != nil { + if *this.Value != *that1.Value { + return fmt.Errorf("Value this(%v) Not Equal that(%v)", *this.Value, *that1.Value) + } + } else if this.Value != nil { + return fmt.Errorf("this.Value == nil && that.Value != nil") + } else if that1.Value != nil { + return fmt.Errorf("Value this(%v) Not Equal that(%v)", this.Value, that1.Value) + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + } + return nil +} +func (this *Value_Scalar) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } + + that1, ok := that.(*Value_Scalar) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if this.Value != nil && that1.Value != nil { + if *this.Value != *that1.Value { + return false + } + } else if this.Value != nil { + return false + } else if that1.Value != nil { + return false + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *Value_Range) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*Value_Range) + if !ok { + return fmt.Errorf("that is not of type *Value_Range") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *Value_Range but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *Value_Rangebut is not nil && this == nil") + } + if this.Begin != nil && that1.Begin != nil { + if *this.Begin != *that1.Begin { + return fmt.Errorf("Begin this(%v) Not Equal that(%v)", *this.Begin, *that1.Begin) + } + } else if this.Begin != nil { + return fmt.Errorf("this.Begin == nil && that.Begin != nil") + } else if that1.Begin != nil { + return fmt.Errorf("Begin this(%v) Not Equal that(%v)", this.Begin, that1.Begin) + } + if this.End != nil && that1.End != nil { + if *this.End != *that1.End { + return fmt.Errorf("End this(%v) Not Equal that(%v)", *this.End, *that1.End) + } + } else if this.End != nil { + return fmt.Errorf("this.End == nil && that.End != nil") + } else if that1.End != nil { + return fmt.Errorf("End this(%v) Not Equal that(%v)", this.End, that1.End) + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + } + return nil +} +func (this *Value_Range) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } + + that1, ok := that.(*Value_Range) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if this.Begin != nil && that1.Begin != nil { + if *this.Begin != *that1.Begin { + return false + } + } else if this.Begin != nil { + return false + } else if that1.Begin != nil { + return false + } + if this.End != nil && that1.End != nil { + if *this.End != *that1.End { + return false + } + } else if this.End != nil { + return false + } else if that1.End != nil { + return false + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *Value_Ranges) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*Value_Ranges) + if !ok { + return fmt.Errorf("that is not of type *Value_Ranges") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *Value_Ranges but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *Value_Rangesbut is not nil && this == nil") + } + if len(this.Range) != len(that1.Range) { + return fmt.Errorf("Range this(%v) Not Equal that(%v)", len(this.Range), len(that1.Range)) + } + for i := range this.Range { + if !this.Range[i].Equal(that1.Range[i]) { + return fmt.Errorf("Range this[%v](%v) Not Equal that[%v](%v)", i, this.Range[i], i, that1.Range[i]) + } + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + } + return nil +} +func (this *Value_Ranges) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } + + that1, ok := that.(*Value_Ranges) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if len(this.Range) != len(that1.Range) { + return false + } + for i := range this.Range { + if !this.Range[i].Equal(that1.Range[i]) { + return false + } + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *Value_Set) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*Value_Set) + if !ok { + return fmt.Errorf("that is not of type *Value_Set") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *Value_Set but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *Value_Setbut is not nil && this == nil") + } + if len(this.Item) != len(that1.Item) { + return fmt.Errorf("Item this(%v) Not Equal that(%v)", len(this.Item), len(that1.Item)) + } + for i := range this.Item { + if this.Item[i] != that1.Item[i] { + return fmt.Errorf("Item this[%v](%v) Not Equal that[%v](%v)", i, this.Item[i], i, that1.Item[i]) + } + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + } + return nil +} +func (this *Value_Set) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } + + that1, ok := that.(*Value_Set) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if len(this.Item) != len(that1.Item) { + return false + } + for i := range this.Item { + if this.Item[i] != that1.Item[i] { + return false + } + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *Value_Text) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*Value_Text) + if !ok { + return fmt.Errorf("that is not of type *Value_Text") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *Value_Text but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *Value_Textbut is not nil && this == nil") + } + if this.Value != nil && that1.Value != nil { + if *this.Value != *that1.Value { + return fmt.Errorf("Value this(%v) Not Equal that(%v)", *this.Value, *that1.Value) + } + } else if this.Value != nil { + return fmt.Errorf("this.Value == nil && that.Value != nil") + } else if that1.Value != nil { + return fmt.Errorf("Value this(%v) Not Equal that(%v)", this.Value, that1.Value) + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + } + return nil +} +func (this *Value_Text) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } + + that1, ok := that.(*Value_Text) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if this.Value != nil && that1.Value != nil { + if *this.Value != *that1.Value { + return false + } + } else if this.Value != nil { + return false + } else if that1.Value != nil { + return false + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *Attribute) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*Attribute) + if !ok { + return fmt.Errorf("that is not of type *Attribute") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *Attribute but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *Attributebut is not nil && this == nil") + } + if this.Name != nil && that1.Name != nil { + if *this.Name != *that1.Name { + return fmt.Errorf("Name this(%v) Not Equal that(%v)", *this.Name, *that1.Name) + } + } else if this.Name != nil { + return fmt.Errorf("this.Name == nil && that.Name != nil") + } else if that1.Name != nil { + return fmt.Errorf("Name this(%v) Not Equal that(%v)", this.Name, that1.Name) + } + if this.Type != nil && that1.Type != nil { + if *this.Type != *that1.Type { + return fmt.Errorf("Type this(%v) Not Equal that(%v)", *this.Type, *that1.Type) + } + } else if this.Type != nil { + return fmt.Errorf("this.Type == nil && that.Type != nil") + } else if that1.Type != nil { + return fmt.Errorf("Type this(%v) Not Equal that(%v)", this.Type, that1.Type) + } + if !this.Scalar.Equal(that1.Scalar) { + return fmt.Errorf("Scalar this(%v) Not Equal that(%v)", this.Scalar, that1.Scalar) + } + if !this.Ranges.Equal(that1.Ranges) { + return fmt.Errorf("Ranges this(%v) Not Equal that(%v)", this.Ranges, that1.Ranges) + } + if !this.Set.Equal(that1.Set) { + return fmt.Errorf("Set this(%v) Not Equal that(%v)", this.Set, that1.Set) + } + if !this.Text.Equal(that1.Text) { + return fmt.Errorf("Text this(%v) Not Equal that(%v)", this.Text, that1.Text) + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + } + return nil +} +func (this *Attribute) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } + + that1, ok := that.(*Attribute) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if this.Name != nil && that1.Name != nil { + if *this.Name != *that1.Name { + return false + } + } else if this.Name != nil { + return false + } else if that1.Name != nil { + return false + } + if this.Type != nil && that1.Type != nil { + if *this.Type != *that1.Type { + return false + } + } else if this.Type != nil { + return false + } else if that1.Type != nil { + return false + } + if !this.Scalar.Equal(that1.Scalar) { + return false + } + if !this.Ranges.Equal(that1.Ranges) { + return false + } + if !this.Set.Equal(that1.Set) { + return false + } + if !this.Text.Equal(that1.Text) { + return false + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *Resource) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*Resource) + if !ok { + return fmt.Errorf("that is not of type *Resource") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *Resource but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *Resourcebut is not nil && this == nil") + } + if this.Name != nil && that1.Name != nil { + if *this.Name != *that1.Name { + return fmt.Errorf("Name this(%v) Not Equal that(%v)", *this.Name, *that1.Name) + } + } else if this.Name != nil { + return fmt.Errorf("this.Name == nil && that.Name != nil") + } else if that1.Name != nil { + return fmt.Errorf("Name this(%v) Not Equal that(%v)", this.Name, that1.Name) + } + if this.Type != nil && that1.Type != nil { + if *this.Type != *that1.Type { + return fmt.Errorf("Type this(%v) Not Equal that(%v)", *this.Type, *that1.Type) + } + } else if this.Type != nil { + return fmt.Errorf("this.Type == nil && that.Type != nil") + } else if that1.Type != nil { + return fmt.Errorf("Type this(%v) Not Equal that(%v)", this.Type, that1.Type) + } + if !this.Scalar.Equal(that1.Scalar) { + return fmt.Errorf("Scalar this(%v) Not Equal that(%v)", this.Scalar, that1.Scalar) + } + if !this.Ranges.Equal(that1.Ranges) { + return fmt.Errorf("Ranges this(%v) Not Equal that(%v)", this.Ranges, that1.Ranges) + } + if !this.Set.Equal(that1.Set) { + return fmt.Errorf("Set this(%v) Not Equal that(%v)", this.Set, that1.Set) + } + if this.Role != nil && that1.Role != nil { + if *this.Role != *that1.Role { + return fmt.Errorf("Role this(%v) Not Equal that(%v)", *this.Role, *that1.Role) + } + } else if this.Role != nil { + return fmt.Errorf("this.Role == nil && that.Role != nil") + } else if that1.Role != nil { + return fmt.Errorf("Role this(%v) Not Equal that(%v)", this.Role, that1.Role) + } + if !this.Reservation.Equal(that1.Reservation) { + return fmt.Errorf("Reservation this(%v) Not Equal that(%v)", this.Reservation, that1.Reservation) + } + if !this.Disk.Equal(that1.Disk) { + return fmt.Errorf("Disk this(%v) Not Equal that(%v)", this.Disk, that1.Disk) + } + if !this.Revocable.Equal(that1.Revocable) { + return fmt.Errorf("Revocable this(%v) Not Equal that(%v)", this.Revocable, that1.Revocable) + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + } + return nil +} +func (this *Resource) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } + + that1, ok := that.(*Resource) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if this.Name != nil && that1.Name != nil { + if *this.Name != *that1.Name { + return false + } + } else if this.Name != nil { + return false + } else if that1.Name != nil { + return false + } + if this.Type != nil && that1.Type != nil { + if *this.Type != *that1.Type { + return false + } + } else if this.Type != nil { + return false + } else if that1.Type != nil { + return false + } + if !this.Scalar.Equal(that1.Scalar) { + return false + } + if !this.Ranges.Equal(that1.Ranges) { + return false + } + if !this.Set.Equal(that1.Set) { + return false + } + if this.Role != nil && that1.Role != nil { + if *this.Role != *that1.Role { + return false + } + } else if this.Role != nil { + return false + } else if that1.Role != nil { + return false + } + if !this.Reservation.Equal(that1.Reservation) { + return false + } + if !this.Disk.Equal(that1.Disk) { + return false + } + if !this.Revocable.Equal(that1.Revocable) { + return false + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *Resource_ReservationInfo) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*Resource_ReservationInfo) + if !ok { + return fmt.Errorf("that is not of type *Resource_ReservationInfo") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *Resource_ReservationInfo but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *Resource_ReservationInfobut is not nil && this == nil") + } + if this.Principal != nil && that1.Principal != nil { + if *this.Principal != *that1.Principal { + return fmt.Errorf("Principal this(%v) Not Equal that(%v)", *this.Principal, *that1.Principal) + } + } else if this.Principal != nil { + return fmt.Errorf("this.Principal == nil && that.Principal != nil") + } else if that1.Principal != nil { + return fmt.Errorf("Principal this(%v) Not Equal that(%v)", this.Principal, that1.Principal) + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + } + return nil +} +func (this *Resource_ReservationInfo) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } + + that1, ok := that.(*Resource_ReservationInfo) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if this.Principal != nil && that1.Principal != nil { + if *this.Principal != *that1.Principal { + return false + } + } else if this.Principal != nil { + return false + } else if that1.Principal != nil { + return false + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *Resource_DiskInfo) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*Resource_DiskInfo) + if !ok { + return fmt.Errorf("that is not of type *Resource_DiskInfo") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *Resource_DiskInfo but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *Resource_DiskInfobut is not nil && this == nil") + } + if !this.Persistence.Equal(that1.Persistence) { + return fmt.Errorf("Persistence this(%v) Not Equal that(%v)", this.Persistence, that1.Persistence) + } + if !this.Volume.Equal(that1.Volume) { + return fmt.Errorf("Volume this(%v) Not Equal that(%v)", this.Volume, that1.Volume) + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + } + return nil +} +func (this *Resource_DiskInfo) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } + + that1, ok := that.(*Resource_DiskInfo) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if !this.Persistence.Equal(that1.Persistence) { + return false + } + if !this.Volume.Equal(that1.Volume) { + return false + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *Resource_DiskInfo_Persistence) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*Resource_DiskInfo_Persistence) + if !ok { + return fmt.Errorf("that is not of type *Resource_DiskInfo_Persistence") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *Resource_DiskInfo_Persistence but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *Resource_DiskInfo_Persistencebut is not nil && this == nil") + } + if this.Id != nil && that1.Id != nil { + if *this.Id != *that1.Id { + return fmt.Errorf("Id this(%v) Not Equal that(%v)", *this.Id, *that1.Id) + } + } else if this.Id != nil { + return fmt.Errorf("this.Id == nil && that.Id != nil") + } else if that1.Id != nil { + return fmt.Errorf("Id this(%v) Not Equal that(%v)", this.Id, that1.Id) + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + } + return nil +} +func (this *Resource_DiskInfo_Persistence) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } + + that1, ok := that.(*Resource_DiskInfo_Persistence) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if this.Id != nil && that1.Id != nil { + if *this.Id != *that1.Id { + return false + } + } else if this.Id != nil { + return false + } else if that1.Id != nil { + return false + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *Resource_RevocableInfo) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*Resource_RevocableInfo) + if !ok { + return fmt.Errorf("that is not of type *Resource_RevocableInfo") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *Resource_RevocableInfo but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *Resource_RevocableInfobut is not nil && this == nil") + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + } + return nil +} +func (this *Resource_RevocableInfo) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } + + that1, ok := that.(*Resource_RevocableInfo) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *TrafficControlStatistics) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*TrafficControlStatistics) + if !ok { + return fmt.Errorf("that is not of type *TrafficControlStatistics") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *TrafficControlStatistics but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *TrafficControlStatisticsbut is not nil && this == nil") + } + if this.Id != nil && that1.Id != nil { + if *this.Id != *that1.Id { + return fmt.Errorf("Id this(%v) Not Equal that(%v)", *this.Id, *that1.Id) + } + } else if this.Id != nil { + return fmt.Errorf("this.Id == nil && that.Id != nil") + } else if that1.Id != nil { + return fmt.Errorf("Id this(%v) Not Equal that(%v)", this.Id, that1.Id) + } + if this.Backlog != nil && that1.Backlog != nil { + if *this.Backlog != *that1.Backlog { + return fmt.Errorf("Backlog this(%v) Not Equal that(%v)", *this.Backlog, *that1.Backlog) + } + } else if this.Backlog != nil { + return fmt.Errorf("this.Backlog == nil && that.Backlog != nil") + } else if that1.Backlog != nil { + return fmt.Errorf("Backlog this(%v) Not Equal that(%v)", this.Backlog, that1.Backlog) + } + if this.Bytes != nil && that1.Bytes != nil { + if *this.Bytes != *that1.Bytes { + return fmt.Errorf("Bytes this(%v) Not Equal that(%v)", *this.Bytes, *that1.Bytes) + } + } else if this.Bytes != nil { + return fmt.Errorf("this.Bytes == nil && that.Bytes != nil") + } else if that1.Bytes != nil { + return fmt.Errorf("Bytes this(%v) Not Equal that(%v)", this.Bytes, that1.Bytes) + } + if this.Drops != nil && that1.Drops != nil { + if *this.Drops != *that1.Drops { + return fmt.Errorf("Drops this(%v) Not Equal that(%v)", *this.Drops, *that1.Drops) + } + } else if this.Drops != nil { + return fmt.Errorf("this.Drops == nil && that.Drops != nil") + } else if that1.Drops != nil { + return fmt.Errorf("Drops this(%v) Not Equal that(%v)", this.Drops, that1.Drops) + } + if this.Overlimits != nil && that1.Overlimits != nil { + if *this.Overlimits != *that1.Overlimits { + return fmt.Errorf("Overlimits this(%v) Not Equal that(%v)", *this.Overlimits, *that1.Overlimits) + } + } else if this.Overlimits != nil { + return fmt.Errorf("this.Overlimits == nil && that.Overlimits != nil") + } else if that1.Overlimits != nil { + return fmt.Errorf("Overlimits this(%v) Not Equal that(%v)", this.Overlimits, that1.Overlimits) + } + if this.Packets != nil && that1.Packets != nil { + if *this.Packets != *that1.Packets { + return fmt.Errorf("Packets this(%v) Not Equal that(%v)", *this.Packets, *that1.Packets) + } + } else if this.Packets != nil { + return fmt.Errorf("this.Packets == nil && that.Packets != nil") + } else if that1.Packets != nil { + return fmt.Errorf("Packets this(%v) Not Equal that(%v)", this.Packets, that1.Packets) + } + if this.Qlen != nil && that1.Qlen != nil { + if *this.Qlen != *that1.Qlen { + return fmt.Errorf("Qlen this(%v) Not Equal that(%v)", *this.Qlen, *that1.Qlen) + } + } else if this.Qlen != nil { + return fmt.Errorf("this.Qlen == nil && that.Qlen != nil") + } else if that1.Qlen != nil { + return fmt.Errorf("Qlen this(%v) Not Equal that(%v)", this.Qlen, that1.Qlen) + } + if this.Ratebps != nil && that1.Ratebps != nil { + if *this.Ratebps != *that1.Ratebps { + return fmt.Errorf("Ratebps this(%v) Not Equal that(%v)", *this.Ratebps, *that1.Ratebps) + } + } else if this.Ratebps != nil { + return fmt.Errorf("this.Ratebps == nil && that.Ratebps != nil") + } else if that1.Ratebps != nil { + return fmt.Errorf("Ratebps this(%v) Not Equal that(%v)", this.Ratebps, that1.Ratebps) + } + if this.Ratepps != nil && that1.Ratepps != nil { + if *this.Ratepps != *that1.Ratepps { + return fmt.Errorf("Ratepps this(%v) Not Equal that(%v)", *this.Ratepps, *that1.Ratepps) + } + } else if this.Ratepps != nil { + return fmt.Errorf("this.Ratepps == nil && that.Ratepps != nil") + } else if that1.Ratepps != nil { + return fmt.Errorf("Ratepps this(%v) Not Equal that(%v)", this.Ratepps, that1.Ratepps) + } + if this.Requeues != nil && that1.Requeues != nil { + if *this.Requeues != *that1.Requeues { + return fmt.Errorf("Requeues this(%v) Not Equal that(%v)", *this.Requeues, *that1.Requeues) + } + } else if this.Requeues != nil { + return fmt.Errorf("this.Requeues == nil && that.Requeues != nil") + } else if that1.Requeues != nil { + return fmt.Errorf("Requeues this(%v) Not Equal that(%v)", this.Requeues, that1.Requeues) + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + } + return nil +} +func (this *TrafficControlStatistics) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } + + that1, ok := that.(*TrafficControlStatistics) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if this.Id != nil && that1.Id != nil { + if *this.Id != *that1.Id { + return false + } + } else if this.Id != nil { + return false + } else if that1.Id != nil { + return false + } + if this.Backlog != nil && that1.Backlog != nil { + if *this.Backlog != *that1.Backlog { + return false + } + } else if this.Backlog != nil { + return false + } else if that1.Backlog != nil { + return false + } + if this.Bytes != nil && that1.Bytes != nil { + if *this.Bytes != *that1.Bytes { + return false + } + } else if this.Bytes != nil { + return false + } else if that1.Bytes != nil { + return false + } + if this.Drops != nil && that1.Drops != nil { + if *this.Drops != *that1.Drops { + return false + } + } else if this.Drops != nil { + return false + } else if that1.Drops != nil { + return false + } + if this.Overlimits != nil && that1.Overlimits != nil { + if *this.Overlimits != *that1.Overlimits { + return false + } + } else if this.Overlimits != nil { + return false + } else if that1.Overlimits != nil { + return false + } + if this.Packets != nil && that1.Packets != nil { + if *this.Packets != *that1.Packets { + return false + } + } else if this.Packets != nil { + return false + } else if that1.Packets != nil { + return false + } + if this.Qlen != nil && that1.Qlen != nil { + if *this.Qlen != *that1.Qlen { + return false + } + } else if this.Qlen != nil { + return false + } else if that1.Qlen != nil { + return false + } + if this.Ratebps != nil && that1.Ratebps != nil { + if *this.Ratebps != *that1.Ratebps { + return false + } + } else if this.Ratebps != nil { + return false + } else if that1.Ratebps != nil { + return false + } + if this.Ratepps != nil && that1.Ratepps != nil { + if *this.Ratepps != *that1.Ratepps { + return false + } + } else if this.Ratepps != nil { + return false + } else if that1.Ratepps != nil { + return false + } + if this.Requeues != nil && that1.Requeues != nil { + if *this.Requeues != *that1.Requeues { + return false + } + } else if this.Requeues != nil { + return false + } else if that1.Requeues != nil { + return false + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *ResourceStatistics) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*ResourceStatistics) + if !ok { + return fmt.Errorf("that is not of type *ResourceStatistics") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *ResourceStatistics but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *ResourceStatisticsbut is not nil && this == nil") + } + if this.Timestamp != nil && that1.Timestamp != nil { + if *this.Timestamp != *that1.Timestamp { + return fmt.Errorf("Timestamp this(%v) Not Equal that(%v)", *this.Timestamp, *that1.Timestamp) + } + } else if this.Timestamp != nil { + return fmt.Errorf("this.Timestamp == nil && that.Timestamp != nil") + } else if that1.Timestamp != nil { + return fmt.Errorf("Timestamp this(%v) Not Equal that(%v)", this.Timestamp, that1.Timestamp) + } + if this.Processes != nil && that1.Processes != nil { + if *this.Processes != *that1.Processes { + return fmt.Errorf("Processes this(%v) Not Equal that(%v)", *this.Processes, *that1.Processes) + } + } else if this.Processes != nil { + return fmt.Errorf("this.Processes == nil && that.Processes != nil") + } else if that1.Processes != nil { + return fmt.Errorf("Processes this(%v) Not Equal that(%v)", this.Processes, that1.Processes) + } + if this.Threads != nil && that1.Threads != nil { + if *this.Threads != *that1.Threads { + return fmt.Errorf("Threads this(%v) Not Equal that(%v)", *this.Threads, *that1.Threads) + } + } else if this.Threads != nil { + return fmt.Errorf("this.Threads == nil && that.Threads != nil") + } else if that1.Threads != nil { + return fmt.Errorf("Threads this(%v) Not Equal that(%v)", this.Threads, that1.Threads) + } + if this.CpusUserTimeSecs != nil && that1.CpusUserTimeSecs != nil { + if *this.CpusUserTimeSecs != *that1.CpusUserTimeSecs { + return fmt.Errorf("CpusUserTimeSecs this(%v) Not Equal that(%v)", *this.CpusUserTimeSecs, *that1.CpusUserTimeSecs) + } + } else if this.CpusUserTimeSecs != nil { + return fmt.Errorf("this.CpusUserTimeSecs == nil && that.CpusUserTimeSecs != nil") + } else if that1.CpusUserTimeSecs != nil { + return fmt.Errorf("CpusUserTimeSecs this(%v) Not Equal that(%v)", this.CpusUserTimeSecs, that1.CpusUserTimeSecs) + } + if this.CpusSystemTimeSecs != nil && that1.CpusSystemTimeSecs != nil { + if *this.CpusSystemTimeSecs != *that1.CpusSystemTimeSecs { + return fmt.Errorf("CpusSystemTimeSecs this(%v) Not Equal that(%v)", *this.CpusSystemTimeSecs, *that1.CpusSystemTimeSecs) + } + } else if this.CpusSystemTimeSecs != nil { + return fmt.Errorf("this.CpusSystemTimeSecs == nil && that.CpusSystemTimeSecs != nil") + } else if that1.CpusSystemTimeSecs != nil { + return fmt.Errorf("CpusSystemTimeSecs this(%v) Not Equal that(%v)", this.CpusSystemTimeSecs, that1.CpusSystemTimeSecs) + } + if this.CpusLimit != nil && that1.CpusLimit != nil { + if *this.CpusLimit != *that1.CpusLimit { + return fmt.Errorf("CpusLimit this(%v) Not Equal that(%v)", *this.CpusLimit, *that1.CpusLimit) + } + } else if this.CpusLimit != nil { + return fmt.Errorf("this.CpusLimit == nil && that.CpusLimit != nil") + } else if that1.CpusLimit != nil { + return fmt.Errorf("CpusLimit this(%v) Not Equal that(%v)", this.CpusLimit, that1.CpusLimit) + } + if this.CpusNrPeriods != nil && that1.CpusNrPeriods != nil { + if *this.CpusNrPeriods != *that1.CpusNrPeriods { + return fmt.Errorf("CpusNrPeriods this(%v) Not Equal that(%v)", *this.CpusNrPeriods, *that1.CpusNrPeriods) + } + } else if this.CpusNrPeriods != nil { + return fmt.Errorf("this.CpusNrPeriods == nil && that.CpusNrPeriods != nil") + } else if that1.CpusNrPeriods != nil { + return fmt.Errorf("CpusNrPeriods this(%v) Not Equal that(%v)", this.CpusNrPeriods, that1.CpusNrPeriods) + } + if this.CpusNrThrottled != nil && that1.CpusNrThrottled != nil { + if *this.CpusNrThrottled != *that1.CpusNrThrottled { + return fmt.Errorf("CpusNrThrottled this(%v) Not Equal that(%v)", *this.CpusNrThrottled, *that1.CpusNrThrottled) + } + } else if this.CpusNrThrottled != nil { + return fmt.Errorf("this.CpusNrThrottled == nil && that.CpusNrThrottled != nil") + } else if that1.CpusNrThrottled != nil { + return fmt.Errorf("CpusNrThrottled this(%v) Not Equal that(%v)", this.CpusNrThrottled, that1.CpusNrThrottled) + } + if this.CpusThrottledTimeSecs != nil && that1.CpusThrottledTimeSecs != nil { + if *this.CpusThrottledTimeSecs != *that1.CpusThrottledTimeSecs { + return fmt.Errorf("CpusThrottledTimeSecs this(%v) Not Equal that(%v)", *this.CpusThrottledTimeSecs, *that1.CpusThrottledTimeSecs) + } + } else if this.CpusThrottledTimeSecs != nil { + return fmt.Errorf("this.CpusThrottledTimeSecs == nil && that.CpusThrottledTimeSecs != nil") + } else if that1.CpusThrottledTimeSecs != nil { + return fmt.Errorf("CpusThrottledTimeSecs this(%v) Not Equal that(%v)", this.CpusThrottledTimeSecs, that1.CpusThrottledTimeSecs) + } + if this.MemTotalBytes != nil && that1.MemTotalBytes != nil { + if *this.MemTotalBytes != *that1.MemTotalBytes { + return fmt.Errorf("MemTotalBytes this(%v) Not Equal that(%v)", *this.MemTotalBytes, *that1.MemTotalBytes) + } + } else if this.MemTotalBytes != nil { + return fmt.Errorf("this.MemTotalBytes == nil && that.MemTotalBytes != nil") + } else if that1.MemTotalBytes != nil { + return fmt.Errorf("MemTotalBytes this(%v) Not Equal that(%v)", this.MemTotalBytes, that1.MemTotalBytes) + } + if this.MemTotalMemswBytes != nil && that1.MemTotalMemswBytes != nil { + if *this.MemTotalMemswBytes != *that1.MemTotalMemswBytes { + return fmt.Errorf("MemTotalMemswBytes this(%v) Not Equal that(%v)", *this.MemTotalMemswBytes, *that1.MemTotalMemswBytes) + } + } else if this.MemTotalMemswBytes != nil { + return fmt.Errorf("this.MemTotalMemswBytes == nil && that.MemTotalMemswBytes != nil") + } else if that1.MemTotalMemswBytes != nil { + return fmt.Errorf("MemTotalMemswBytes this(%v) Not Equal that(%v)", this.MemTotalMemswBytes, that1.MemTotalMemswBytes) + } + if this.MemLimitBytes != nil && that1.MemLimitBytes != nil { + if *this.MemLimitBytes != *that1.MemLimitBytes { + return fmt.Errorf("MemLimitBytes this(%v) Not Equal that(%v)", *this.MemLimitBytes, *that1.MemLimitBytes) + } + } else if this.MemLimitBytes != nil { + return fmt.Errorf("this.MemLimitBytes == nil && that.MemLimitBytes != nil") + } else if that1.MemLimitBytes != nil { + return fmt.Errorf("MemLimitBytes this(%v) Not Equal that(%v)", this.MemLimitBytes, that1.MemLimitBytes) + } + if this.MemSoftLimitBytes != nil && that1.MemSoftLimitBytes != nil { + if *this.MemSoftLimitBytes != *that1.MemSoftLimitBytes { + return fmt.Errorf("MemSoftLimitBytes this(%v) Not Equal that(%v)", *this.MemSoftLimitBytes, *that1.MemSoftLimitBytes) + } + } else if this.MemSoftLimitBytes != nil { + return fmt.Errorf("this.MemSoftLimitBytes == nil && that.MemSoftLimitBytes != nil") + } else if that1.MemSoftLimitBytes != nil { + return fmt.Errorf("MemSoftLimitBytes this(%v) Not Equal that(%v)", this.MemSoftLimitBytes, that1.MemSoftLimitBytes) + } + if this.MemFileBytes != nil && that1.MemFileBytes != nil { + if *this.MemFileBytes != *that1.MemFileBytes { + return fmt.Errorf("MemFileBytes this(%v) Not Equal that(%v)", *this.MemFileBytes, *that1.MemFileBytes) + } + } else if this.MemFileBytes != nil { + return fmt.Errorf("this.MemFileBytes == nil && that.MemFileBytes != nil") + } else if that1.MemFileBytes != nil { + return fmt.Errorf("MemFileBytes this(%v) Not Equal that(%v)", this.MemFileBytes, that1.MemFileBytes) + } + if this.MemAnonBytes != nil && that1.MemAnonBytes != nil { + if *this.MemAnonBytes != *that1.MemAnonBytes { + return fmt.Errorf("MemAnonBytes this(%v) Not Equal that(%v)", *this.MemAnonBytes, *that1.MemAnonBytes) + } + } else if this.MemAnonBytes != nil { + return fmt.Errorf("this.MemAnonBytes == nil && that.MemAnonBytes != nil") + } else if that1.MemAnonBytes != nil { + return fmt.Errorf("MemAnonBytes this(%v) Not Equal that(%v)", this.MemAnonBytes, that1.MemAnonBytes) + } + if this.MemCacheBytes != nil && that1.MemCacheBytes != nil { + if *this.MemCacheBytes != *that1.MemCacheBytes { + return fmt.Errorf("MemCacheBytes this(%v) Not Equal that(%v)", *this.MemCacheBytes, *that1.MemCacheBytes) + } + } else if this.MemCacheBytes != nil { + return fmt.Errorf("this.MemCacheBytes == nil && that.MemCacheBytes != nil") + } else if that1.MemCacheBytes != nil { + return fmt.Errorf("MemCacheBytes this(%v) Not Equal that(%v)", this.MemCacheBytes, that1.MemCacheBytes) + } + if this.MemRssBytes != nil && that1.MemRssBytes != nil { + if *this.MemRssBytes != *that1.MemRssBytes { + return fmt.Errorf("MemRssBytes this(%v) Not Equal that(%v)", *this.MemRssBytes, *that1.MemRssBytes) + } + } else if this.MemRssBytes != nil { + return fmt.Errorf("this.MemRssBytes == nil && that.MemRssBytes != nil") + } else if that1.MemRssBytes != nil { + return fmt.Errorf("MemRssBytes this(%v) Not Equal that(%v)", this.MemRssBytes, that1.MemRssBytes) + } + if this.MemMappedFileBytes != nil && that1.MemMappedFileBytes != nil { + if *this.MemMappedFileBytes != *that1.MemMappedFileBytes { + return fmt.Errorf("MemMappedFileBytes this(%v) Not Equal that(%v)", *this.MemMappedFileBytes, *that1.MemMappedFileBytes) + } + } else if this.MemMappedFileBytes != nil { + return fmt.Errorf("this.MemMappedFileBytes == nil && that.MemMappedFileBytes != nil") + } else if that1.MemMappedFileBytes != nil { + return fmt.Errorf("MemMappedFileBytes this(%v) Not Equal that(%v)", this.MemMappedFileBytes, that1.MemMappedFileBytes) + } + if this.MemSwapBytes != nil && that1.MemSwapBytes != nil { + if *this.MemSwapBytes != *that1.MemSwapBytes { + return fmt.Errorf("MemSwapBytes this(%v) Not Equal that(%v)", *this.MemSwapBytes, *that1.MemSwapBytes) + } + } else if this.MemSwapBytes != nil { + return fmt.Errorf("this.MemSwapBytes == nil && that.MemSwapBytes != nil") + } else if that1.MemSwapBytes != nil { + return fmt.Errorf("MemSwapBytes this(%v) Not Equal that(%v)", this.MemSwapBytes, that1.MemSwapBytes) + } + if this.MemLowPressureCounter != nil && that1.MemLowPressureCounter != nil { + if *this.MemLowPressureCounter != *that1.MemLowPressureCounter { + return fmt.Errorf("MemLowPressureCounter this(%v) Not Equal that(%v)", *this.MemLowPressureCounter, *that1.MemLowPressureCounter) + } + } else if this.MemLowPressureCounter != nil { + return fmt.Errorf("this.MemLowPressureCounter == nil && that.MemLowPressureCounter != nil") + } else if that1.MemLowPressureCounter != nil { + return fmt.Errorf("MemLowPressureCounter this(%v) Not Equal that(%v)", this.MemLowPressureCounter, that1.MemLowPressureCounter) + } + if this.MemMediumPressureCounter != nil && that1.MemMediumPressureCounter != nil { + if *this.MemMediumPressureCounter != *that1.MemMediumPressureCounter { + return fmt.Errorf("MemMediumPressureCounter this(%v) Not Equal that(%v)", *this.MemMediumPressureCounter, *that1.MemMediumPressureCounter) + } + } else if this.MemMediumPressureCounter != nil { + return fmt.Errorf("this.MemMediumPressureCounter == nil && that.MemMediumPressureCounter != nil") + } else if that1.MemMediumPressureCounter != nil { + return fmt.Errorf("MemMediumPressureCounter this(%v) Not Equal that(%v)", this.MemMediumPressureCounter, that1.MemMediumPressureCounter) + } + if this.MemCriticalPressureCounter != nil && that1.MemCriticalPressureCounter != nil { + if *this.MemCriticalPressureCounter != *that1.MemCriticalPressureCounter { + return fmt.Errorf("MemCriticalPressureCounter this(%v) Not Equal that(%v)", *this.MemCriticalPressureCounter, *that1.MemCriticalPressureCounter) + } + } else if this.MemCriticalPressureCounter != nil { + return fmt.Errorf("this.MemCriticalPressureCounter == nil && that.MemCriticalPressureCounter != nil") + } else if that1.MemCriticalPressureCounter != nil { + return fmt.Errorf("MemCriticalPressureCounter this(%v) Not Equal that(%v)", this.MemCriticalPressureCounter, that1.MemCriticalPressureCounter) + } + if this.DiskLimitBytes != nil && that1.DiskLimitBytes != nil { + if *this.DiskLimitBytes != *that1.DiskLimitBytes { + return fmt.Errorf("DiskLimitBytes this(%v) Not Equal that(%v)", *this.DiskLimitBytes, *that1.DiskLimitBytes) + } + } else if this.DiskLimitBytes != nil { + return fmt.Errorf("this.DiskLimitBytes == nil && that.DiskLimitBytes != nil") + } else if that1.DiskLimitBytes != nil { + return fmt.Errorf("DiskLimitBytes this(%v) Not Equal that(%v)", this.DiskLimitBytes, that1.DiskLimitBytes) + } + if this.DiskUsedBytes != nil && that1.DiskUsedBytes != nil { + if *this.DiskUsedBytes != *that1.DiskUsedBytes { + return fmt.Errorf("DiskUsedBytes this(%v) Not Equal that(%v)", *this.DiskUsedBytes, *that1.DiskUsedBytes) + } + } else if this.DiskUsedBytes != nil { + return fmt.Errorf("this.DiskUsedBytes == nil && that.DiskUsedBytes != nil") + } else if that1.DiskUsedBytes != nil { + return fmt.Errorf("DiskUsedBytes this(%v) Not Equal that(%v)", this.DiskUsedBytes, that1.DiskUsedBytes) + } + if !this.Perf.Equal(that1.Perf) { + return fmt.Errorf("Perf this(%v) Not Equal that(%v)", this.Perf, that1.Perf) + } + if this.NetRxPackets != nil && that1.NetRxPackets != nil { + if *this.NetRxPackets != *that1.NetRxPackets { + return fmt.Errorf("NetRxPackets this(%v) Not Equal that(%v)", *this.NetRxPackets, *that1.NetRxPackets) + } + } else if this.NetRxPackets != nil { + return fmt.Errorf("this.NetRxPackets == nil && that.NetRxPackets != nil") + } else if that1.NetRxPackets != nil { + return fmt.Errorf("NetRxPackets this(%v) Not Equal that(%v)", this.NetRxPackets, that1.NetRxPackets) + } + if this.NetRxBytes != nil && that1.NetRxBytes != nil { + if *this.NetRxBytes != *that1.NetRxBytes { + return fmt.Errorf("NetRxBytes this(%v) Not Equal that(%v)", *this.NetRxBytes, *that1.NetRxBytes) + } + } else if this.NetRxBytes != nil { + return fmt.Errorf("this.NetRxBytes == nil && that.NetRxBytes != nil") + } else if that1.NetRxBytes != nil { + return fmt.Errorf("NetRxBytes this(%v) Not Equal that(%v)", this.NetRxBytes, that1.NetRxBytes) + } + if this.NetRxErrors != nil && that1.NetRxErrors != nil { + if *this.NetRxErrors != *that1.NetRxErrors { + return fmt.Errorf("NetRxErrors this(%v) Not Equal that(%v)", *this.NetRxErrors, *that1.NetRxErrors) + } + } else if this.NetRxErrors != nil { + return fmt.Errorf("this.NetRxErrors == nil && that.NetRxErrors != nil") + } else if that1.NetRxErrors != nil { + return fmt.Errorf("NetRxErrors this(%v) Not Equal that(%v)", this.NetRxErrors, that1.NetRxErrors) + } + if this.NetRxDropped != nil && that1.NetRxDropped != nil { + if *this.NetRxDropped != *that1.NetRxDropped { + return fmt.Errorf("NetRxDropped this(%v) Not Equal that(%v)", *this.NetRxDropped, *that1.NetRxDropped) + } + } else if this.NetRxDropped != nil { + return fmt.Errorf("this.NetRxDropped == nil && that.NetRxDropped != nil") + } else if that1.NetRxDropped != nil { + return fmt.Errorf("NetRxDropped this(%v) Not Equal that(%v)", this.NetRxDropped, that1.NetRxDropped) + } + if this.NetTxPackets != nil && that1.NetTxPackets != nil { + if *this.NetTxPackets != *that1.NetTxPackets { + return fmt.Errorf("NetTxPackets this(%v) Not Equal that(%v)", *this.NetTxPackets, *that1.NetTxPackets) + } + } else if this.NetTxPackets != nil { + return fmt.Errorf("this.NetTxPackets == nil && that.NetTxPackets != nil") + } else if that1.NetTxPackets != nil { + return fmt.Errorf("NetTxPackets this(%v) Not Equal that(%v)", this.NetTxPackets, that1.NetTxPackets) + } + if this.NetTxBytes != nil && that1.NetTxBytes != nil { + if *this.NetTxBytes != *that1.NetTxBytes { + return fmt.Errorf("NetTxBytes this(%v) Not Equal that(%v)", *this.NetTxBytes, *that1.NetTxBytes) + } + } else if this.NetTxBytes != nil { + return fmt.Errorf("this.NetTxBytes == nil && that.NetTxBytes != nil") + } else if that1.NetTxBytes != nil { + return fmt.Errorf("NetTxBytes this(%v) Not Equal that(%v)", this.NetTxBytes, that1.NetTxBytes) + } + if this.NetTxErrors != nil && that1.NetTxErrors != nil { + if *this.NetTxErrors != *that1.NetTxErrors { + return fmt.Errorf("NetTxErrors this(%v) Not Equal that(%v)", *this.NetTxErrors, *that1.NetTxErrors) + } + } else if this.NetTxErrors != nil { + return fmt.Errorf("this.NetTxErrors == nil && that.NetTxErrors != nil") + } else if that1.NetTxErrors != nil { + return fmt.Errorf("NetTxErrors this(%v) Not Equal that(%v)", this.NetTxErrors, that1.NetTxErrors) + } + if this.NetTxDropped != nil && that1.NetTxDropped != nil { + if *this.NetTxDropped != *that1.NetTxDropped { + return fmt.Errorf("NetTxDropped this(%v) Not Equal that(%v)", *this.NetTxDropped, *that1.NetTxDropped) + } + } else if this.NetTxDropped != nil { + return fmt.Errorf("this.NetTxDropped == nil && that.NetTxDropped != nil") + } else if that1.NetTxDropped != nil { + return fmt.Errorf("NetTxDropped this(%v) Not Equal that(%v)", this.NetTxDropped, that1.NetTxDropped) + } + if this.NetTcpRttMicrosecsP50 != nil && that1.NetTcpRttMicrosecsP50 != nil { + if *this.NetTcpRttMicrosecsP50 != *that1.NetTcpRttMicrosecsP50 { + return fmt.Errorf("NetTcpRttMicrosecsP50 this(%v) Not Equal that(%v)", *this.NetTcpRttMicrosecsP50, *that1.NetTcpRttMicrosecsP50) + } + } else if this.NetTcpRttMicrosecsP50 != nil { + return fmt.Errorf("this.NetTcpRttMicrosecsP50 == nil && that.NetTcpRttMicrosecsP50 != nil") + } else if that1.NetTcpRttMicrosecsP50 != nil { + return fmt.Errorf("NetTcpRttMicrosecsP50 this(%v) Not Equal that(%v)", this.NetTcpRttMicrosecsP50, that1.NetTcpRttMicrosecsP50) + } + if this.NetTcpRttMicrosecsP90 != nil && that1.NetTcpRttMicrosecsP90 != nil { + if *this.NetTcpRttMicrosecsP90 != *that1.NetTcpRttMicrosecsP90 { + return fmt.Errorf("NetTcpRttMicrosecsP90 this(%v) Not Equal that(%v)", *this.NetTcpRttMicrosecsP90, *that1.NetTcpRttMicrosecsP90) + } + } else if this.NetTcpRttMicrosecsP90 != nil { + return fmt.Errorf("this.NetTcpRttMicrosecsP90 == nil && that.NetTcpRttMicrosecsP90 != nil") + } else if that1.NetTcpRttMicrosecsP90 != nil { + return fmt.Errorf("NetTcpRttMicrosecsP90 this(%v) Not Equal that(%v)", this.NetTcpRttMicrosecsP90, that1.NetTcpRttMicrosecsP90) + } + if this.NetTcpRttMicrosecsP95 != nil && that1.NetTcpRttMicrosecsP95 != nil { + if *this.NetTcpRttMicrosecsP95 != *that1.NetTcpRttMicrosecsP95 { + return fmt.Errorf("NetTcpRttMicrosecsP95 this(%v) Not Equal that(%v)", *this.NetTcpRttMicrosecsP95, *that1.NetTcpRttMicrosecsP95) + } + } else if this.NetTcpRttMicrosecsP95 != nil { + return fmt.Errorf("this.NetTcpRttMicrosecsP95 == nil && that.NetTcpRttMicrosecsP95 != nil") + } else if that1.NetTcpRttMicrosecsP95 != nil { + return fmt.Errorf("NetTcpRttMicrosecsP95 this(%v) Not Equal that(%v)", this.NetTcpRttMicrosecsP95, that1.NetTcpRttMicrosecsP95) + } + if this.NetTcpRttMicrosecsP99 != nil && that1.NetTcpRttMicrosecsP99 != nil { + if *this.NetTcpRttMicrosecsP99 != *that1.NetTcpRttMicrosecsP99 { + return fmt.Errorf("NetTcpRttMicrosecsP99 this(%v) Not Equal that(%v)", *this.NetTcpRttMicrosecsP99, *that1.NetTcpRttMicrosecsP99) + } + } else if this.NetTcpRttMicrosecsP99 != nil { + return fmt.Errorf("this.NetTcpRttMicrosecsP99 == nil && that.NetTcpRttMicrosecsP99 != nil") + } else if that1.NetTcpRttMicrosecsP99 != nil { + return fmt.Errorf("NetTcpRttMicrosecsP99 this(%v) Not Equal that(%v)", this.NetTcpRttMicrosecsP99, that1.NetTcpRttMicrosecsP99) + } + if this.NetTcpActiveConnections != nil && that1.NetTcpActiveConnections != nil { + if *this.NetTcpActiveConnections != *that1.NetTcpActiveConnections { + return fmt.Errorf("NetTcpActiveConnections this(%v) Not Equal that(%v)", *this.NetTcpActiveConnections, *that1.NetTcpActiveConnections) + } + } else if this.NetTcpActiveConnections != nil { + return fmt.Errorf("this.NetTcpActiveConnections == nil && that.NetTcpActiveConnections != nil") + } else if that1.NetTcpActiveConnections != nil { + return fmt.Errorf("NetTcpActiveConnections this(%v) Not Equal that(%v)", this.NetTcpActiveConnections, that1.NetTcpActiveConnections) + } + if this.NetTcpTimeWaitConnections != nil && that1.NetTcpTimeWaitConnections != nil { + if *this.NetTcpTimeWaitConnections != *that1.NetTcpTimeWaitConnections { + return fmt.Errorf("NetTcpTimeWaitConnections this(%v) Not Equal that(%v)", *this.NetTcpTimeWaitConnections, *that1.NetTcpTimeWaitConnections) + } + } else if this.NetTcpTimeWaitConnections != nil { + return fmt.Errorf("this.NetTcpTimeWaitConnections == nil && that.NetTcpTimeWaitConnections != nil") + } else if that1.NetTcpTimeWaitConnections != nil { + return fmt.Errorf("NetTcpTimeWaitConnections this(%v) Not Equal that(%v)", this.NetTcpTimeWaitConnections, that1.NetTcpTimeWaitConnections) + } + if len(this.NetTrafficControlStatistics) != len(that1.NetTrafficControlStatistics) { + return fmt.Errorf("NetTrafficControlStatistics this(%v) Not Equal that(%v)", len(this.NetTrafficControlStatistics), len(that1.NetTrafficControlStatistics)) + } + for i := range this.NetTrafficControlStatistics { + if !this.NetTrafficControlStatistics[i].Equal(that1.NetTrafficControlStatistics[i]) { + return fmt.Errorf("NetTrafficControlStatistics this[%v](%v) Not Equal that[%v](%v)", i, this.NetTrafficControlStatistics[i], i, that1.NetTrafficControlStatistics[i]) + } + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + } + return nil +} +func (this *ResourceStatistics) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } + + that1, ok := that.(*ResourceStatistics) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if this.Timestamp != nil && that1.Timestamp != nil { + if *this.Timestamp != *that1.Timestamp { + return false + } + } else if this.Timestamp != nil { + return false + } else if that1.Timestamp != nil { + return false + } + if this.Processes != nil && that1.Processes != nil { + if *this.Processes != *that1.Processes { + return false + } + } else if this.Processes != nil { + return false + } else if that1.Processes != nil { + return false + } + if this.Threads != nil && that1.Threads != nil { + if *this.Threads != *that1.Threads { + return false + } + } else if this.Threads != nil { + return false + } else if that1.Threads != nil { + return false + } + if this.CpusUserTimeSecs != nil && that1.CpusUserTimeSecs != nil { + if *this.CpusUserTimeSecs != *that1.CpusUserTimeSecs { + return false + } + } else if this.CpusUserTimeSecs != nil { + return false + } else if that1.CpusUserTimeSecs != nil { + return false + } + if this.CpusSystemTimeSecs != nil && that1.CpusSystemTimeSecs != nil { + if *this.CpusSystemTimeSecs != *that1.CpusSystemTimeSecs { + return false + } + } else if this.CpusSystemTimeSecs != nil { + return false + } else if that1.CpusSystemTimeSecs != nil { + return false + } + if this.CpusLimit != nil && that1.CpusLimit != nil { + if *this.CpusLimit != *that1.CpusLimit { + return false + } + } else if this.CpusLimit != nil { + return false + } else if that1.CpusLimit != nil { + return false + } + if this.CpusNrPeriods != nil && that1.CpusNrPeriods != nil { + if *this.CpusNrPeriods != *that1.CpusNrPeriods { + return false + } + } else if this.CpusNrPeriods != nil { + return false + } else if that1.CpusNrPeriods != nil { + return false + } + if this.CpusNrThrottled != nil && that1.CpusNrThrottled != nil { + if *this.CpusNrThrottled != *that1.CpusNrThrottled { + return false + } + } else if this.CpusNrThrottled != nil { + return false + } else if that1.CpusNrThrottled != nil { + return false + } + if this.CpusThrottledTimeSecs != nil && that1.CpusThrottledTimeSecs != nil { + if *this.CpusThrottledTimeSecs != *that1.CpusThrottledTimeSecs { + return false + } + } else if this.CpusThrottledTimeSecs != nil { + return false + } else if that1.CpusThrottledTimeSecs != nil { + return false + } + if this.MemTotalBytes != nil && that1.MemTotalBytes != nil { + if *this.MemTotalBytes != *that1.MemTotalBytes { + return false + } + } else if this.MemTotalBytes != nil { + return false + } else if that1.MemTotalBytes != nil { + return false + } + if this.MemTotalMemswBytes != nil && that1.MemTotalMemswBytes != nil { + if *this.MemTotalMemswBytes != *that1.MemTotalMemswBytes { + return false + } + } else if this.MemTotalMemswBytes != nil { + return false + } else if that1.MemTotalMemswBytes != nil { + return false + } + if this.MemLimitBytes != nil && that1.MemLimitBytes != nil { + if *this.MemLimitBytes != *that1.MemLimitBytes { + return false + } + } else if this.MemLimitBytes != nil { + return false + } else if that1.MemLimitBytes != nil { + return false + } + if this.MemSoftLimitBytes != nil && that1.MemSoftLimitBytes != nil { + if *this.MemSoftLimitBytes != *that1.MemSoftLimitBytes { + return false + } + } else if this.MemSoftLimitBytes != nil { + return false + } else if that1.MemSoftLimitBytes != nil { + return false + } + if this.MemFileBytes != nil && that1.MemFileBytes != nil { + if *this.MemFileBytes != *that1.MemFileBytes { + return false + } + } else if this.MemFileBytes != nil { + return false + } else if that1.MemFileBytes != nil { + return false + } + if this.MemAnonBytes != nil && that1.MemAnonBytes != nil { + if *this.MemAnonBytes != *that1.MemAnonBytes { + return false + } + } else if this.MemAnonBytes != nil { + return false + } else if that1.MemAnonBytes != nil { + return false + } + if this.MemCacheBytes != nil && that1.MemCacheBytes != nil { + if *this.MemCacheBytes != *that1.MemCacheBytes { + return false + } + } else if this.MemCacheBytes != nil { + return false + } else if that1.MemCacheBytes != nil { + return false + } + if this.MemRssBytes != nil && that1.MemRssBytes != nil { + if *this.MemRssBytes != *that1.MemRssBytes { + return false + } + } else if this.MemRssBytes != nil { + return false + } else if that1.MemRssBytes != nil { + return false + } + if this.MemMappedFileBytes != nil && that1.MemMappedFileBytes != nil { + if *this.MemMappedFileBytes != *that1.MemMappedFileBytes { + return false + } + } else if this.MemMappedFileBytes != nil { + return false + } else if that1.MemMappedFileBytes != nil { + return false + } + if this.MemSwapBytes != nil && that1.MemSwapBytes != nil { + if *this.MemSwapBytes != *that1.MemSwapBytes { + return false + } + } else if this.MemSwapBytes != nil { + return false + } else if that1.MemSwapBytes != nil { + return false + } + if this.MemLowPressureCounter != nil && that1.MemLowPressureCounter != nil { + if *this.MemLowPressureCounter != *that1.MemLowPressureCounter { + return false + } + } else if this.MemLowPressureCounter != nil { + return false + } else if that1.MemLowPressureCounter != nil { + return false + } + if this.MemMediumPressureCounter != nil && that1.MemMediumPressureCounter != nil { + if *this.MemMediumPressureCounter != *that1.MemMediumPressureCounter { + return false + } + } else if this.MemMediumPressureCounter != nil { + return false + } else if that1.MemMediumPressureCounter != nil { + return false + } + if this.MemCriticalPressureCounter != nil && that1.MemCriticalPressureCounter != nil { + if *this.MemCriticalPressureCounter != *that1.MemCriticalPressureCounter { + return false + } + } else if this.MemCriticalPressureCounter != nil { + return false + } else if that1.MemCriticalPressureCounter != nil { + return false + } + if this.DiskLimitBytes != nil && that1.DiskLimitBytes != nil { + if *this.DiskLimitBytes != *that1.DiskLimitBytes { + return false + } + } else if this.DiskLimitBytes != nil { + return false + } else if that1.DiskLimitBytes != nil { + return false + } + if this.DiskUsedBytes != nil && that1.DiskUsedBytes != nil { + if *this.DiskUsedBytes != *that1.DiskUsedBytes { + return false + } + } else if this.DiskUsedBytes != nil { + return false + } else if that1.DiskUsedBytes != nil { + return false + } + if !this.Perf.Equal(that1.Perf) { + return false + } + if this.NetRxPackets != nil && that1.NetRxPackets != nil { + if *this.NetRxPackets != *that1.NetRxPackets { + return false + } + } else if this.NetRxPackets != nil { + return false + } else if that1.NetRxPackets != nil { + return false + } + if this.NetRxBytes != nil && that1.NetRxBytes != nil { + if *this.NetRxBytes != *that1.NetRxBytes { + return false + } + } else if this.NetRxBytes != nil { + return false + } else if that1.NetRxBytes != nil { + return false + } + if this.NetRxErrors != nil && that1.NetRxErrors != nil { + if *this.NetRxErrors != *that1.NetRxErrors { + return false + } + } else if this.NetRxErrors != nil { + return false + } else if that1.NetRxErrors != nil { + return false + } + if this.NetRxDropped != nil && that1.NetRxDropped != nil { + if *this.NetRxDropped != *that1.NetRxDropped { + return false + } + } else if this.NetRxDropped != nil { + return false + } else if that1.NetRxDropped != nil { + return false + } + if this.NetTxPackets != nil && that1.NetTxPackets != nil { + if *this.NetTxPackets != *that1.NetTxPackets { + return false + } + } else if this.NetTxPackets != nil { + return false + } else if that1.NetTxPackets != nil { + return false + } + if this.NetTxBytes != nil && that1.NetTxBytes != nil { + if *this.NetTxBytes != *that1.NetTxBytes { + return false + } + } else if this.NetTxBytes != nil { + return false + } else if that1.NetTxBytes != nil { + return false + } + if this.NetTxErrors != nil && that1.NetTxErrors != nil { + if *this.NetTxErrors != *that1.NetTxErrors { + return false + } + } else if this.NetTxErrors != nil { + return false + } else if that1.NetTxErrors != nil { + return false + } + if this.NetTxDropped != nil && that1.NetTxDropped != nil { + if *this.NetTxDropped != *that1.NetTxDropped { + return false + } + } else if this.NetTxDropped != nil { + return false + } else if that1.NetTxDropped != nil { + return false + } + if this.NetTcpRttMicrosecsP50 != nil && that1.NetTcpRttMicrosecsP50 != nil { + if *this.NetTcpRttMicrosecsP50 != *that1.NetTcpRttMicrosecsP50 { + return false + } + } else if this.NetTcpRttMicrosecsP50 != nil { + return false + } else if that1.NetTcpRttMicrosecsP50 != nil { + return false + } + if this.NetTcpRttMicrosecsP90 != nil && that1.NetTcpRttMicrosecsP90 != nil { + if *this.NetTcpRttMicrosecsP90 != *that1.NetTcpRttMicrosecsP90 { + return false + } + } else if this.NetTcpRttMicrosecsP90 != nil { + return false + } else if that1.NetTcpRttMicrosecsP90 != nil { + return false + } + if this.NetTcpRttMicrosecsP95 != nil && that1.NetTcpRttMicrosecsP95 != nil { + if *this.NetTcpRttMicrosecsP95 != *that1.NetTcpRttMicrosecsP95 { + return false + } + } else if this.NetTcpRttMicrosecsP95 != nil { + return false + } else if that1.NetTcpRttMicrosecsP95 != nil { + return false + } + if this.NetTcpRttMicrosecsP99 != nil && that1.NetTcpRttMicrosecsP99 != nil { + if *this.NetTcpRttMicrosecsP99 != *that1.NetTcpRttMicrosecsP99 { + return false + } + } else if this.NetTcpRttMicrosecsP99 != nil { + return false + } else if that1.NetTcpRttMicrosecsP99 != nil { + return false + } + if this.NetTcpActiveConnections != nil && that1.NetTcpActiveConnections != nil { + if *this.NetTcpActiveConnections != *that1.NetTcpActiveConnections { + return false + } + } else if this.NetTcpActiveConnections != nil { + return false + } else if that1.NetTcpActiveConnections != nil { + return false + } + if this.NetTcpTimeWaitConnections != nil && that1.NetTcpTimeWaitConnections != nil { + if *this.NetTcpTimeWaitConnections != *that1.NetTcpTimeWaitConnections { + return false + } + } else if this.NetTcpTimeWaitConnections != nil { + return false + } else if that1.NetTcpTimeWaitConnections != nil { + return false + } + if len(this.NetTrafficControlStatistics) != len(that1.NetTrafficControlStatistics) { + return false + } + for i := range this.NetTrafficControlStatistics { + if !this.NetTrafficControlStatistics[i].Equal(that1.NetTrafficControlStatistics[i]) { + return false + } + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *ResourceUsage) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*ResourceUsage) + if !ok { + return fmt.Errorf("that is not of type *ResourceUsage") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *ResourceUsage but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *ResourceUsagebut is not nil && this == nil") + } + if len(this.Executors) != len(that1.Executors) { + return fmt.Errorf("Executors this(%v) Not Equal that(%v)", len(this.Executors), len(that1.Executors)) + } + for i := range this.Executors { + if !this.Executors[i].Equal(that1.Executors[i]) { + return fmt.Errorf("Executors this[%v](%v) Not Equal that[%v](%v)", i, this.Executors[i], i, that1.Executors[i]) + } + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + } + return nil +} +func (this *ResourceUsage) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } + + that1, ok := that.(*ResourceUsage) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if len(this.Executors) != len(that1.Executors) { + return false + } + for i := range this.Executors { + if !this.Executors[i].Equal(that1.Executors[i]) { + return false + } + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *ResourceUsage_Executor) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*ResourceUsage_Executor) + if !ok { + return fmt.Errorf("that is not of type *ResourceUsage_Executor") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *ResourceUsage_Executor but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *ResourceUsage_Executorbut is not nil && this == nil") + } + if !this.ExecutorInfo.Equal(that1.ExecutorInfo) { + return fmt.Errorf("ExecutorInfo this(%v) Not Equal that(%v)", this.ExecutorInfo, that1.ExecutorInfo) + } + if len(this.Allocated) != len(that1.Allocated) { + return fmt.Errorf("Allocated this(%v) Not Equal that(%v)", len(this.Allocated), len(that1.Allocated)) + } + for i := range this.Allocated { + if !this.Allocated[i].Equal(that1.Allocated[i]) { + return fmt.Errorf("Allocated this[%v](%v) Not Equal that[%v](%v)", i, this.Allocated[i], i, that1.Allocated[i]) + } + } + if !this.Statistics.Equal(that1.Statistics) { + return fmt.Errorf("Statistics this(%v) Not Equal that(%v)", this.Statistics, that1.Statistics) + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + } + return nil +} +func (this *ResourceUsage_Executor) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } + + that1, ok := that.(*ResourceUsage_Executor) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if !this.ExecutorInfo.Equal(that1.ExecutorInfo) { + return false + } + if len(this.Allocated) != len(that1.Allocated) { + return false + } + for i := range this.Allocated { + if !this.Allocated[i].Equal(that1.Allocated[i]) { + return false + } + } + if !this.Statistics.Equal(that1.Statistics) { + return false + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *PerfStatistics) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*PerfStatistics) + if !ok { + return fmt.Errorf("that is not of type *PerfStatistics") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *PerfStatistics but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *PerfStatisticsbut is not nil && this == nil") + } + if this.Timestamp != nil && that1.Timestamp != nil { + if *this.Timestamp != *that1.Timestamp { + return fmt.Errorf("Timestamp this(%v) Not Equal that(%v)", *this.Timestamp, *that1.Timestamp) + } + } else if this.Timestamp != nil { + return fmt.Errorf("this.Timestamp == nil && that.Timestamp != nil") + } else if that1.Timestamp != nil { + return fmt.Errorf("Timestamp this(%v) Not Equal that(%v)", this.Timestamp, that1.Timestamp) + } + if this.Duration != nil && that1.Duration != nil { + if *this.Duration != *that1.Duration { + return fmt.Errorf("Duration this(%v) Not Equal that(%v)", *this.Duration, *that1.Duration) + } + } else if this.Duration != nil { + return fmt.Errorf("this.Duration == nil && that.Duration != nil") + } else if that1.Duration != nil { + return fmt.Errorf("Duration this(%v) Not Equal that(%v)", this.Duration, that1.Duration) + } + if this.Cycles != nil && that1.Cycles != nil { + if *this.Cycles != *that1.Cycles { + return fmt.Errorf("Cycles this(%v) Not Equal that(%v)", *this.Cycles, *that1.Cycles) + } + } else if this.Cycles != nil { + return fmt.Errorf("this.Cycles == nil && that.Cycles != nil") + } else if that1.Cycles != nil { + return fmt.Errorf("Cycles this(%v) Not Equal that(%v)", this.Cycles, that1.Cycles) + } + if this.StalledCyclesFrontend != nil && that1.StalledCyclesFrontend != nil { + if *this.StalledCyclesFrontend != *that1.StalledCyclesFrontend { + return fmt.Errorf("StalledCyclesFrontend this(%v) Not Equal that(%v)", *this.StalledCyclesFrontend, *that1.StalledCyclesFrontend) + } + } else if this.StalledCyclesFrontend != nil { + return fmt.Errorf("this.StalledCyclesFrontend == nil && that.StalledCyclesFrontend != nil") + } else if that1.StalledCyclesFrontend != nil { + return fmt.Errorf("StalledCyclesFrontend this(%v) Not Equal that(%v)", this.StalledCyclesFrontend, that1.StalledCyclesFrontend) + } + if this.StalledCyclesBackend != nil && that1.StalledCyclesBackend != nil { + if *this.StalledCyclesBackend != *that1.StalledCyclesBackend { + return fmt.Errorf("StalledCyclesBackend this(%v) Not Equal that(%v)", *this.StalledCyclesBackend, *that1.StalledCyclesBackend) + } + } else if this.StalledCyclesBackend != nil { + return fmt.Errorf("this.StalledCyclesBackend == nil && that.StalledCyclesBackend != nil") + } else if that1.StalledCyclesBackend != nil { + return fmt.Errorf("StalledCyclesBackend this(%v) Not Equal that(%v)", this.StalledCyclesBackend, that1.StalledCyclesBackend) + } + if this.Instructions != nil && that1.Instructions != nil { + if *this.Instructions != *that1.Instructions { + return fmt.Errorf("Instructions this(%v) Not Equal that(%v)", *this.Instructions, *that1.Instructions) + } + } else if this.Instructions != nil { + return fmt.Errorf("this.Instructions == nil && that.Instructions != nil") + } else if that1.Instructions != nil { + return fmt.Errorf("Instructions this(%v) Not Equal that(%v)", this.Instructions, that1.Instructions) + } + if this.CacheReferences != nil && that1.CacheReferences != nil { + if *this.CacheReferences != *that1.CacheReferences { + return fmt.Errorf("CacheReferences this(%v) Not Equal that(%v)", *this.CacheReferences, *that1.CacheReferences) + } + } else if this.CacheReferences != nil { + return fmt.Errorf("this.CacheReferences == nil && that.CacheReferences != nil") + } else if that1.CacheReferences != nil { + return fmt.Errorf("CacheReferences this(%v) Not Equal that(%v)", this.CacheReferences, that1.CacheReferences) + } + if this.CacheMisses != nil && that1.CacheMisses != nil { + if *this.CacheMisses != *that1.CacheMisses { + return fmt.Errorf("CacheMisses this(%v) Not Equal that(%v)", *this.CacheMisses, *that1.CacheMisses) + } + } else if this.CacheMisses != nil { + return fmt.Errorf("this.CacheMisses == nil && that.CacheMisses != nil") + } else if that1.CacheMisses != nil { + return fmt.Errorf("CacheMisses this(%v) Not Equal that(%v)", this.CacheMisses, that1.CacheMisses) + } + if this.Branches != nil && that1.Branches != nil { + if *this.Branches != *that1.Branches { + return fmt.Errorf("Branches this(%v) Not Equal that(%v)", *this.Branches, *that1.Branches) + } + } else if this.Branches != nil { + return fmt.Errorf("this.Branches == nil && that.Branches != nil") + } else if that1.Branches != nil { + return fmt.Errorf("Branches this(%v) Not Equal that(%v)", this.Branches, that1.Branches) + } + if this.BranchMisses != nil && that1.BranchMisses != nil { + if *this.BranchMisses != *that1.BranchMisses { + return fmt.Errorf("BranchMisses this(%v) Not Equal that(%v)", *this.BranchMisses, *that1.BranchMisses) + } + } else if this.BranchMisses != nil { + return fmt.Errorf("this.BranchMisses == nil && that.BranchMisses != nil") + } else if that1.BranchMisses != nil { + return fmt.Errorf("BranchMisses this(%v) Not Equal that(%v)", this.BranchMisses, that1.BranchMisses) + } + if this.BusCycles != nil && that1.BusCycles != nil { + if *this.BusCycles != *that1.BusCycles { + return fmt.Errorf("BusCycles this(%v) Not Equal that(%v)", *this.BusCycles, *that1.BusCycles) + } + } else if this.BusCycles != nil { + return fmt.Errorf("this.BusCycles == nil && that.BusCycles != nil") + } else if that1.BusCycles != nil { + return fmt.Errorf("BusCycles this(%v) Not Equal that(%v)", this.BusCycles, that1.BusCycles) + } + if this.RefCycles != nil && that1.RefCycles != nil { + if *this.RefCycles != *that1.RefCycles { + return fmt.Errorf("RefCycles this(%v) Not Equal that(%v)", *this.RefCycles, *that1.RefCycles) + } + } else if this.RefCycles != nil { + return fmt.Errorf("this.RefCycles == nil && that.RefCycles != nil") + } else if that1.RefCycles != nil { + return fmt.Errorf("RefCycles this(%v) Not Equal that(%v)", this.RefCycles, that1.RefCycles) + } + if this.CpuClock != nil && that1.CpuClock != nil { + if *this.CpuClock != *that1.CpuClock { + return fmt.Errorf("CpuClock this(%v) Not Equal that(%v)", *this.CpuClock, *that1.CpuClock) + } + } else if this.CpuClock != nil { + return fmt.Errorf("this.CpuClock == nil && that.CpuClock != nil") + } else if that1.CpuClock != nil { + return fmt.Errorf("CpuClock this(%v) Not Equal that(%v)", this.CpuClock, that1.CpuClock) + } + if this.TaskClock != nil && that1.TaskClock != nil { + if *this.TaskClock != *that1.TaskClock { + return fmt.Errorf("TaskClock this(%v) Not Equal that(%v)", *this.TaskClock, *that1.TaskClock) + } + } else if this.TaskClock != nil { + return fmt.Errorf("this.TaskClock == nil && that.TaskClock != nil") + } else if that1.TaskClock != nil { + return fmt.Errorf("TaskClock this(%v) Not Equal that(%v)", this.TaskClock, that1.TaskClock) + } + if this.PageFaults != nil && that1.PageFaults != nil { + if *this.PageFaults != *that1.PageFaults { + return fmt.Errorf("PageFaults this(%v) Not Equal that(%v)", *this.PageFaults, *that1.PageFaults) + } + } else if this.PageFaults != nil { + return fmt.Errorf("this.PageFaults == nil && that.PageFaults != nil") + } else if that1.PageFaults != nil { + return fmt.Errorf("PageFaults this(%v) Not Equal that(%v)", this.PageFaults, that1.PageFaults) + } + if this.MinorFaults != nil && that1.MinorFaults != nil { + if *this.MinorFaults != *that1.MinorFaults { + return fmt.Errorf("MinorFaults this(%v) Not Equal that(%v)", *this.MinorFaults, *that1.MinorFaults) + } + } else if this.MinorFaults != nil { + return fmt.Errorf("this.MinorFaults == nil && that.MinorFaults != nil") + } else if that1.MinorFaults != nil { + return fmt.Errorf("MinorFaults this(%v) Not Equal that(%v)", this.MinorFaults, that1.MinorFaults) + } + if this.MajorFaults != nil && that1.MajorFaults != nil { + if *this.MajorFaults != *that1.MajorFaults { + return fmt.Errorf("MajorFaults this(%v) Not Equal that(%v)", *this.MajorFaults, *that1.MajorFaults) + } + } else if this.MajorFaults != nil { + return fmt.Errorf("this.MajorFaults == nil && that.MajorFaults != nil") + } else if that1.MajorFaults != nil { + return fmt.Errorf("MajorFaults this(%v) Not Equal that(%v)", this.MajorFaults, that1.MajorFaults) + } + if this.ContextSwitches != nil && that1.ContextSwitches != nil { + if *this.ContextSwitches != *that1.ContextSwitches { + return fmt.Errorf("ContextSwitches this(%v) Not Equal that(%v)", *this.ContextSwitches, *that1.ContextSwitches) + } + } else if this.ContextSwitches != nil { + return fmt.Errorf("this.ContextSwitches == nil && that.ContextSwitches != nil") + } else if that1.ContextSwitches != nil { + return fmt.Errorf("ContextSwitches this(%v) Not Equal that(%v)", this.ContextSwitches, that1.ContextSwitches) + } + if this.CpuMigrations != nil && that1.CpuMigrations != nil { + if *this.CpuMigrations != *that1.CpuMigrations { + return fmt.Errorf("CpuMigrations this(%v) Not Equal that(%v)", *this.CpuMigrations, *that1.CpuMigrations) + } + } else if this.CpuMigrations != nil { + return fmt.Errorf("this.CpuMigrations == nil && that.CpuMigrations != nil") + } else if that1.CpuMigrations != nil { + return fmt.Errorf("CpuMigrations this(%v) Not Equal that(%v)", this.CpuMigrations, that1.CpuMigrations) + } + if this.AlignmentFaults != nil && that1.AlignmentFaults != nil { + if *this.AlignmentFaults != *that1.AlignmentFaults { + return fmt.Errorf("AlignmentFaults this(%v) Not Equal that(%v)", *this.AlignmentFaults, *that1.AlignmentFaults) + } + } else if this.AlignmentFaults != nil { + return fmt.Errorf("this.AlignmentFaults == nil && that.AlignmentFaults != nil") + } else if that1.AlignmentFaults != nil { + return fmt.Errorf("AlignmentFaults this(%v) Not Equal that(%v)", this.AlignmentFaults, that1.AlignmentFaults) + } + if this.EmulationFaults != nil && that1.EmulationFaults != nil { + if *this.EmulationFaults != *that1.EmulationFaults { + return fmt.Errorf("EmulationFaults this(%v) Not Equal that(%v)", *this.EmulationFaults, *that1.EmulationFaults) + } + } else if this.EmulationFaults != nil { + return fmt.Errorf("this.EmulationFaults == nil && that.EmulationFaults != nil") + } else if that1.EmulationFaults != nil { + return fmt.Errorf("EmulationFaults this(%v) Not Equal that(%v)", this.EmulationFaults, that1.EmulationFaults) + } + if this.L1DcacheLoads != nil && that1.L1DcacheLoads != nil { + if *this.L1DcacheLoads != *that1.L1DcacheLoads { + return fmt.Errorf("L1DcacheLoads this(%v) Not Equal that(%v)", *this.L1DcacheLoads, *that1.L1DcacheLoads) + } + } else if this.L1DcacheLoads != nil { + return fmt.Errorf("this.L1DcacheLoads == nil && that.L1DcacheLoads != nil") + } else if that1.L1DcacheLoads != nil { + return fmt.Errorf("L1DcacheLoads this(%v) Not Equal that(%v)", this.L1DcacheLoads, that1.L1DcacheLoads) + } + if this.L1DcacheLoadMisses != nil && that1.L1DcacheLoadMisses != nil { + if *this.L1DcacheLoadMisses != *that1.L1DcacheLoadMisses { + return fmt.Errorf("L1DcacheLoadMisses this(%v) Not Equal that(%v)", *this.L1DcacheLoadMisses, *that1.L1DcacheLoadMisses) + } + } else if this.L1DcacheLoadMisses != nil { + return fmt.Errorf("this.L1DcacheLoadMisses == nil && that.L1DcacheLoadMisses != nil") + } else if that1.L1DcacheLoadMisses != nil { + return fmt.Errorf("L1DcacheLoadMisses this(%v) Not Equal that(%v)", this.L1DcacheLoadMisses, that1.L1DcacheLoadMisses) + } + if this.L1DcacheStores != nil && that1.L1DcacheStores != nil { + if *this.L1DcacheStores != *that1.L1DcacheStores { + return fmt.Errorf("L1DcacheStores this(%v) Not Equal that(%v)", *this.L1DcacheStores, *that1.L1DcacheStores) + } + } else if this.L1DcacheStores != nil { + return fmt.Errorf("this.L1DcacheStores == nil && that.L1DcacheStores != nil") + } else if that1.L1DcacheStores != nil { + return fmt.Errorf("L1DcacheStores this(%v) Not Equal that(%v)", this.L1DcacheStores, that1.L1DcacheStores) + } + if this.L1DcacheStoreMisses != nil && that1.L1DcacheStoreMisses != nil { + if *this.L1DcacheStoreMisses != *that1.L1DcacheStoreMisses { + return fmt.Errorf("L1DcacheStoreMisses this(%v) Not Equal that(%v)", *this.L1DcacheStoreMisses, *that1.L1DcacheStoreMisses) + } + } else if this.L1DcacheStoreMisses != nil { + return fmt.Errorf("this.L1DcacheStoreMisses == nil && that.L1DcacheStoreMisses != nil") + } else if that1.L1DcacheStoreMisses != nil { + return fmt.Errorf("L1DcacheStoreMisses this(%v) Not Equal that(%v)", this.L1DcacheStoreMisses, that1.L1DcacheStoreMisses) + } + if this.L1DcachePrefetches != nil && that1.L1DcachePrefetches != nil { + if *this.L1DcachePrefetches != *that1.L1DcachePrefetches { + return fmt.Errorf("L1DcachePrefetches this(%v) Not Equal that(%v)", *this.L1DcachePrefetches, *that1.L1DcachePrefetches) + } + } else if this.L1DcachePrefetches != nil { + return fmt.Errorf("this.L1DcachePrefetches == nil && that.L1DcachePrefetches != nil") + } else if that1.L1DcachePrefetches != nil { + return fmt.Errorf("L1DcachePrefetches this(%v) Not Equal that(%v)", this.L1DcachePrefetches, that1.L1DcachePrefetches) + } + if this.L1DcachePrefetchMisses != nil && that1.L1DcachePrefetchMisses != nil { + if *this.L1DcachePrefetchMisses != *that1.L1DcachePrefetchMisses { + return fmt.Errorf("L1DcachePrefetchMisses this(%v) Not Equal that(%v)", *this.L1DcachePrefetchMisses, *that1.L1DcachePrefetchMisses) + } + } else if this.L1DcachePrefetchMisses != nil { + return fmt.Errorf("this.L1DcachePrefetchMisses == nil && that.L1DcachePrefetchMisses != nil") + } else if that1.L1DcachePrefetchMisses != nil { + return fmt.Errorf("L1DcachePrefetchMisses this(%v) Not Equal that(%v)", this.L1DcachePrefetchMisses, that1.L1DcachePrefetchMisses) + } + if this.L1IcacheLoads != nil && that1.L1IcacheLoads != nil { + if *this.L1IcacheLoads != *that1.L1IcacheLoads { + return fmt.Errorf("L1IcacheLoads this(%v) Not Equal that(%v)", *this.L1IcacheLoads, *that1.L1IcacheLoads) + } + } else if this.L1IcacheLoads != nil { + return fmt.Errorf("this.L1IcacheLoads == nil && that.L1IcacheLoads != nil") + } else if that1.L1IcacheLoads != nil { + return fmt.Errorf("L1IcacheLoads this(%v) Not Equal that(%v)", this.L1IcacheLoads, that1.L1IcacheLoads) + } + if this.L1IcacheLoadMisses != nil && that1.L1IcacheLoadMisses != nil { + if *this.L1IcacheLoadMisses != *that1.L1IcacheLoadMisses { + return fmt.Errorf("L1IcacheLoadMisses this(%v) Not Equal that(%v)", *this.L1IcacheLoadMisses, *that1.L1IcacheLoadMisses) + } + } else if this.L1IcacheLoadMisses != nil { + return fmt.Errorf("this.L1IcacheLoadMisses == nil && that.L1IcacheLoadMisses != nil") + } else if that1.L1IcacheLoadMisses != nil { + return fmt.Errorf("L1IcacheLoadMisses this(%v) Not Equal that(%v)", this.L1IcacheLoadMisses, that1.L1IcacheLoadMisses) + } + if this.L1IcachePrefetches != nil && that1.L1IcachePrefetches != nil { + if *this.L1IcachePrefetches != *that1.L1IcachePrefetches { + return fmt.Errorf("L1IcachePrefetches this(%v) Not Equal that(%v)", *this.L1IcachePrefetches, *that1.L1IcachePrefetches) + } + } else if this.L1IcachePrefetches != nil { + return fmt.Errorf("this.L1IcachePrefetches == nil && that.L1IcachePrefetches != nil") + } else if that1.L1IcachePrefetches != nil { + return fmt.Errorf("L1IcachePrefetches this(%v) Not Equal that(%v)", this.L1IcachePrefetches, that1.L1IcachePrefetches) + } + if this.L1IcachePrefetchMisses != nil && that1.L1IcachePrefetchMisses != nil { + if *this.L1IcachePrefetchMisses != *that1.L1IcachePrefetchMisses { + return fmt.Errorf("L1IcachePrefetchMisses this(%v) Not Equal that(%v)", *this.L1IcachePrefetchMisses, *that1.L1IcachePrefetchMisses) + } + } else if this.L1IcachePrefetchMisses != nil { + return fmt.Errorf("this.L1IcachePrefetchMisses == nil && that.L1IcachePrefetchMisses != nil") + } else if that1.L1IcachePrefetchMisses != nil { + return fmt.Errorf("L1IcachePrefetchMisses this(%v) Not Equal that(%v)", this.L1IcachePrefetchMisses, that1.L1IcachePrefetchMisses) + } + if this.LlcLoads != nil && that1.LlcLoads != nil { + if *this.LlcLoads != *that1.LlcLoads { + return fmt.Errorf("LlcLoads this(%v) Not Equal that(%v)", *this.LlcLoads, *that1.LlcLoads) + } + } else if this.LlcLoads != nil { + return fmt.Errorf("this.LlcLoads == nil && that.LlcLoads != nil") + } else if that1.LlcLoads != nil { + return fmt.Errorf("LlcLoads this(%v) Not Equal that(%v)", this.LlcLoads, that1.LlcLoads) + } + if this.LlcLoadMisses != nil && that1.LlcLoadMisses != nil { + if *this.LlcLoadMisses != *that1.LlcLoadMisses { + return fmt.Errorf("LlcLoadMisses this(%v) Not Equal that(%v)", *this.LlcLoadMisses, *that1.LlcLoadMisses) + } + } else if this.LlcLoadMisses != nil { + return fmt.Errorf("this.LlcLoadMisses == nil && that.LlcLoadMisses != nil") + } else if that1.LlcLoadMisses != nil { + return fmt.Errorf("LlcLoadMisses this(%v) Not Equal that(%v)", this.LlcLoadMisses, that1.LlcLoadMisses) + } + if this.LlcStores != nil && that1.LlcStores != nil { + if *this.LlcStores != *that1.LlcStores { + return fmt.Errorf("LlcStores this(%v) Not Equal that(%v)", *this.LlcStores, *that1.LlcStores) + } + } else if this.LlcStores != nil { + return fmt.Errorf("this.LlcStores == nil && that.LlcStores != nil") + } else if that1.LlcStores != nil { + return fmt.Errorf("LlcStores this(%v) Not Equal that(%v)", this.LlcStores, that1.LlcStores) + } + if this.LlcStoreMisses != nil && that1.LlcStoreMisses != nil { + if *this.LlcStoreMisses != *that1.LlcStoreMisses { + return fmt.Errorf("LlcStoreMisses this(%v) Not Equal that(%v)", *this.LlcStoreMisses, *that1.LlcStoreMisses) + } + } else if this.LlcStoreMisses != nil { + return fmt.Errorf("this.LlcStoreMisses == nil && that.LlcStoreMisses != nil") + } else if that1.LlcStoreMisses != nil { + return fmt.Errorf("LlcStoreMisses this(%v) Not Equal that(%v)", this.LlcStoreMisses, that1.LlcStoreMisses) + } + if this.LlcPrefetches != nil && that1.LlcPrefetches != nil { + if *this.LlcPrefetches != *that1.LlcPrefetches { + return fmt.Errorf("LlcPrefetches this(%v) Not Equal that(%v)", *this.LlcPrefetches, *that1.LlcPrefetches) + } + } else if this.LlcPrefetches != nil { + return fmt.Errorf("this.LlcPrefetches == nil && that.LlcPrefetches != nil") + } else if that1.LlcPrefetches != nil { + return fmt.Errorf("LlcPrefetches this(%v) Not Equal that(%v)", this.LlcPrefetches, that1.LlcPrefetches) + } + if this.LlcPrefetchMisses != nil && that1.LlcPrefetchMisses != nil { + if *this.LlcPrefetchMisses != *that1.LlcPrefetchMisses { + return fmt.Errorf("LlcPrefetchMisses this(%v) Not Equal that(%v)", *this.LlcPrefetchMisses, *that1.LlcPrefetchMisses) + } + } else if this.LlcPrefetchMisses != nil { + return fmt.Errorf("this.LlcPrefetchMisses == nil && that.LlcPrefetchMisses != nil") + } else if that1.LlcPrefetchMisses != nil { + return fmt.Errorf("LlcPrefetchMisses this(%v) Not Equal that(%v)", this.LlcPrefetchMisses, that1.LlcPrefetchMisses) + } + if this.DtlbLoads != nil && that1.DtlbLoads != nil { + if *this.DtlbLoads != *that1.DtlbLoads { + return fmt.Errorf("DtlbLoads this(%v) Not Equal that(%v)", *this.DtlbLoads, *that1.DtlbLoads) + } + } else if this.DtlbLoads != nil { + return fmt.Errorf("this.DtlbLoads == nil && that.DtlbLoads != nil") + } else if that1.DtlbLoads != nil { + return fmt.Errorf("DtlbLoads this(%v) Not Equal that(%v)", this.DtlbLoads, that1.DtlbLoads) + } + if this.DtlbLoadMisses != nil && that1.DtlbLoadMisses != nil { + if *this.DtlbLoadMisses != *that1.DtlbLoadMisses { + return fmt.Errorf("DtlbLoadMisses this(%v) Not Equal that(%v)", *this.DtlbLoadMisses, *that1.DtlbLoadMisses) + } + } else if this.DtlbLoadMisses != nil { + return fmt.Errorf("this.DtlbLoadMisses == nil && that.DtlbLoadMisses != nil") + } else if that1.DtlbLoadMisses != nil { + return fmt.Errorf("DtlbLoadMisses this(%v) Not Equal that(%v)", this.DtlbLoadMisses, that1.DtlbLoadMisses) + } + if this.DtlbStores != nil && that1.DtlbStores != nil { + if *this.DtlbStores != *that1.DtlbStores { + return fmt.Errorf("DtlbStores this(%v) Not Equal that(%v)", *this.DtlbStores, *that1.DtlbStores) + } + } else if this.DtlbStores != nil { + return fmt.Errorf("this.DtlbStores == nil && that.DtlbStores != nil") + } else if that1.DtlbStores != nil { + return fmt.Errorf("DtlbStores this(%v) Not Equal that(%v)", this.DtlbStores, that1.DtlbStores) + } + if this.DtlbStoreMisses != nil && that1.DtlbStoreMisses != nil { + if *this.DtlbStoreMisses != *that1.DtlbStoreMisses { + return fmt.Errorf("DtlbStoreMisses this(%v) Not Equal that(%v)", *this.DtlbStoreMisses, *that1.DtlbStoreMisses) + } + } else if this.DtlbStoreMisses != nil { + return fmt.Errorf("this.DtlbStoreMisses == nil && that.DtlbStoreMisses != nil") + } else if that1.DtlbStoreMisses != nil { + return fmt.Errorf("DtlbStoreMisses this(%v) Not Equal that(%v)", this.DtlbStoreMisses, that1.DtlbStoreMisses) + } + if this.DtlbPrefetches != nil && that1.DtlbPrefetches != nil { + if *this.DtlbPrefetches != *that1.DtlbPrefetches { + return fmt.Errorf("DtlbPrefetches this(%v) Not Equal that(%v)", *this.DtlbPrefetches, *that1.DtlbPrefetches) + } + } else if this.DtlbPrefetches != nil { + return fmt.Errorf("this.DtlbPrefetches == nil && that.DtlbPrefetches != nil") + } else if that1.DtlbPrefetches != nil { + return fmt.Errorf("DtlbPrefetches this(%v) Not Equal that(%v)", this.DtlbPrefetches, that1.DtlbPrefetches) + } + if this.DtlbPrefetchMisses != nil && that1.DtlbPrefetchMisses != nil { + if *this.DtlbPrefetchMisses != *that1.DtlbPrefetchMisses { + return fmt.Errorf("DtlbPrefetchMisses this(%v) Not Equal that(%v)", *this.DtlbPrefetchMisses, *that1.DtlbPrefetchMisses) + } + } else if this.DtlbPrefetchMisses != nil { + return fmt.Errorf("this.DtlbPrefetchMisses == nil && that.DtlbPrefetchMisses != nil") + } else if that1.DtlbPrefetchMisses != nil { + return fmt.Errorf("DtlbPrefetchMisses this(%v) Not Equal that(%v)", this.DtlbPrefetchMisses, that1.DtlbPrefetchMisses) + } + if this.ItlbLoads != nil && that1.ItlbLoads != nil { + if *this.ItlbLoads != *that1.ItlbLoads { + return fmt.Errorf("ItlbLoads this(%v) Not Equal that(%v)", *this.ItlbLoads, *that1.ItlbLoads) + } + } else if this.ItlbLoads != nil { + return fmt.Errorf("this.ItlbLoads == nil && that.ItlbLoads != nil") + } else if that1.ItlbLoads != nil { + return fmt.Errorf("ItlbLoads this(%v) Not Equal that(%v)", this.ItlbLoads, that1.ItlbLoads) + } + if this.ItlbLoadMisses != nil && that1.ItlbLoadMisses != nil { + if *this.ItlbLoadMisses != *that1.ItlbLoadMisses { + return fmt.Errorf("ItlbLoadMisses this(%v) Not Equal that(%v)", *this.ItlbLoadMisses, *that1.ItlbLoadMisses) + } + } else if this.ItlbLoadMisses != nil { + return fmt.Errorf("this.ItlbLoadMisses == nil && that.ItlbLoadMisses != nil") + } else if that1.ItlbLoadMisses != nil { + return fmt.Errorf("ItlbLoadMisses this(%v) Not Equal that(%v)", this.ItlbLoadMisses, that1.ItlbLoadMisses) + } + if this.BranchLoads != nil && that1.BranchLoads != nil { + if *this.BranchLoads != *that1.BranchLoads { + return fmt.Errorf("BranchLoads this(%v) Not Equal that(%v)", *this.BranchLoads, *that1.BranchLoads) + } + } else if this.BranchLoads != nil { + return fmt.Errorf("this.BranchLoads == nil && that.BranchLoads != nil") + } else if that1.BranchLoads != nil { + return fmt.Errorf("BranchLoads this(%v) Not Equal that(%v)", this.BranchLoads, that1.BranchLoads) + } + if this.BranchLoadMisses != nil && that1.BranchLoadMisses != nil { + if *this.BranchLoadMisses != *that1.BranchLoadMisses { + return fmt.Errorf("BranchLoadMisses this(%v) Not Equal that(%v)", *this.BranchLoadMisses, *that1.BranchLoadMisses) + } + } else if this.BranchLoadMisses != nil { + return fmt.Errorf("this.BranchLoadMisses == nil && that.BranchLoadMisses != nil") + } else if that1.BranchLoadMisses != nil { + return fmt.Errorf("BranchLoadMisses this(%v) Not Equal that(%v)", this.BranchLoadMisses, that1.BranchLoadMisses) + } + if this.NodeLoads != nil && that1.NodeLoads != nil { + if *this.NodeLoads != *that1.NodeLoads { + return fmt.Errorf("NodeLoads this(%v) Not Equal that(%v)", *this.NodeLoads, *that1.NodeLoads) + } + } else if this.NodeLoads != nil { + return fmt.Errorf("this.NodeLoads == nil && that.NodeLoads != nil") + } else if that1.NodeLoads != nil { + return fmt.Errorf("NodeLoads this(%v) Not Equal that(%v)", this.NodeLoads, that1.NodeLoads) + } + if this.NodeLoadMisses != nil && that1.NodeLoadMisses != nil { + if *this.NodeLoadMisses != *that1.NodeLoadMisses { + return fmt.Errorf("NodeLoadMisses this(%v) Not Equal that(%v)", *this.NodeLoadMisses, *that1.NodeLoadMisses) + } + } else if this.NodeLoadMisses != nil { + return fmt.Errorf("this.NodeLoadMisses == nil && that.NodeLoadMisses != nil") + } else if that1.NodeLoadMisses != nil { + return fmt.Errorf("NodeLoadMisses this(%v) Not Equal that(%v)", this.NodeLoadMisses, that1.NodeLoadMisses) + } + if this.NodeStores != nil && that1.NodeStores != nil { + if *this.NodeStores != *that1.NodeStores { + return fmt.Errorf("NodeStores this(%v) Not Equal that(%v)", *this.NodeStores, *that1.NodeStores) + } + } else if this.NodeStores != nil { + return fmt.Errorf("this.NodeStores == nil && that.NodeStores != nil") + } else if that1.NodeStores != nil { + return fmt.Errorf("NodeStores this(%v) Not Equal that(%v)", this.NodeStores, that1.NodeStores) + } + if this.NodeStoreMisses != nil && that1.NodeStoreMisses != nil { + if *this.NodeStoreMisses != *that1.NodeStoreMisses { + return fmt.Errorf("NodeStoreMisses this(%v) Not Equal that(%v)", *this.NodeStoreMisses, *that1.NodeStoreMisses) + } + } else if this.NodeStoreMisses != nil { + return fmt.Errorf("this.NodeStoreMisses == nil && that.NodeStoreMisses != nil") + } else if that1.NodeStoreMisses != nil { + return fmt.Errorf("NodeStoreMisses this(%v) Not Equal that(%v)", this.NodeStoreMisses, that1.NodeStoreMisses) + } + if this.NodePrefetches != nil && that1.NodePrefetches != nil { + if *this.NodePrefetches != *that1.NodePrefetches { + return fmt.Errorf("NodePrefetches this(%v) Not Equal that(%v)", *this.NodePrefetches, *that1.NodePrefetches) + } + } else if this.NodePrefetches != nil { + return fmt.Errorf("this.NodePrefetches == nil && that.NodePrefetches != nil") + } else if that1.NodePrefetches != nil { + return fmt.Errorf("NodePrefetches this(%v) Not Equal that(%v)", this.NodePrefetches, that1.NodePrefetches) + } + if this.NodePrefetchMisses != nil && that1.NodePrefetchMisses != nil { + if *this.NodePrefetchMisses != *that1.NodePrefetchMisses { + return fmt.Errorf("NodePrefetchMisses this(%v) Not Equal that(%v)", *this.NodePrefetchMisses, *that1.NodePrefetchMisses) + } + } else if this.NodePrefetchMisses != nil { + return fmt.Errorf("this.NodePrefetchMisses == nil && that.NodePrefetchMisses != nil") + } else if that1.NodePrefetchMisses != nil { + return fmt.Errorf("NodePrefetchMisses this(%v) Not Equal that(%v)", this.NodePrefetchMisses, that1.NodePrefetchMisses) + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + } + return nil +} +func (this *PerfStatistics) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } + + that1, ok := that.(*PerfStatistics) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if this.Timestamp != nil && that1.Timestamp != nil { + if *this.Timestamp != *that1.Timestamp { + return false + } + } else if this.Timestamp != nil { + return false + } else if that1.Timestamp != nil { + return false + } + if this.Duration != nil && that1.Duration != nil { + if *this.Duration != *that1.Duration { + return false + } + } else if this.Duration != nil { + return false + } else if that1.Duration != nil { + return false + } + if this.Cycles != nil && that1.Cycles != nil { + if *this.Cycles != *that1.Cycles { + return false + } + } else if this.Cycles != nil { + return false + } else if that1.Cycles != nil { + return false + } + if this.StalledCyclesFrontend != nil && that1.StalledCyclesFrontend != nil { + if *this.StalledCyclesFrontend != *that1.StalledCyclesFrontend { + return false + } + } else if this.StalledCyclesFrontend != nil { + return false + } else if that1.StalledCyclesFrontend != nil { + return false + } + if this.StalledCyclesBackend != nil && that1.StalledCyclesBackend != nil { + if *this.StalledCyclesBackend != *that1.StalledCyclesBackend { + return false + } + } else if this.StalledCyclesBackend != nil { + return false + } else if that1.StalledCyclesBackend != nil { + return false + } + if this.Instructions != nil && that1.Instructions != nil { + if *this.Instructions != *that1.Instructions { + return false + } + } else if this.Instructions != nil { + return false + } else if that1.Instructions != nil { + return false + } + if this.CacheReferences != nil && that1.CacheReferences != nil { + if *this.CacheReferences != *that1.CacheReferences { + return false + } + } else if this.CacheReferences != nil { + return false + } else if that1.CacheReferences != nil { + return false + } + if this.CacheMisses != nil && that1.CacheMisses != nil { + if *this.CacheMisses != *that1.CacheMisses { + return false + } + } else if this.CacheMisses != nil { + return false + } else if that1.CacheMisses != nil { + return false + } + if this.Branches != nil && that1.Branches != nil { + if *this.Branches != *that1.Branches { + return false + } + } else if this.Branches != nil { + return false + } else if that1.Branches != nil { + return false + } + if this.BranchMisses != nil && that1.BranchMisses != nil { + if *this.BranchMisses != *that1.BranchMisses { + return false + } + } else if this.BranchMisses != nil { + return false + } else if that1.BranchMisses != nil { + return false + } + if this.BusCycles != nil && that1.BusCycles != nil { + if *this.BusCycles != *that1.BusCycles { + return false + } + } else if this.BusCycles != nil { + return false + } else if that1.BusCycles != nil { + return false + } + if this.RefCycles != nil && that1.RefCycles != nil { + if *this.RefCycles != *that1.RefCycles { + return false + } + } else if this.RefCycles != nil { + return false + } else if that1.RefCycles != nil { + return false + } + if this.CpuClock != nil && that1.CpuClock != nil { + if *this.CpuClock != *that1.CpuClock { + return false + } + } else if this.CpuClock != nil { + return false + } else if that1.CpuClock != nil { + return false + } + if this.TaskClock != nil && that1.TaskClock != nil { + if *this.TaskClock != *that1.TaskClock { + return false + } + } else if this.TaskClock != nil { + return false + } else if that1.TaskClock != nil { + return false + } + if this.PageFaults != nil && that1.PageFaults != nil { + if *this.PageFaults != *that1.PageFaults { + return false + } + } else if this.PageFaults != nil { + return false + } else if that1.PageFaults != nil { + return false + } + if this.MinorFaults != nil && that1.MinorFaults != nil { + if *this.MinorFaults != *that1.MinorFaults { + return false + } + } else if this.MinorFaults != nil { + return false + } else if that1.MinorFaults != nil { + return false + } + if this.MajorFaults != nil && that1.MajorFaults != nil { + if *this.MajorFaults != *that1.MajorFaults { + return false + } + } else if this.MajorFaults != nil { + return false + } else if that1.MajorFaults != nil { + return false + } + if this.ContextSwitches != nil && that1.ContextSwitches != nil { + if *this.ContextSwitches != *that1.ContextSwitches { + return false + } + } else if this.ContextSwitches != nil { + return false + } else if that1.ContextSwitches != nil { + return false + } + if this.CpuMigrations != nil && that1.CpuMigrations != nil { + if *this.CpuMigrations != *that1.CpuMigrations { + return false + } + } else if this.CpuMigrations != nil { + return false + } else if that1.CpuMigrations != nil { + return false + } + if this.AlignmentFaults != nil && that1.AlignmentFaults != nil { + if *this.AlignmentFaults != *that1.AlignmentFaults { + return false + } + } else if this.AlignmentFaults != nil { + return false + } else if that1.AlignmentFaults != nil { + return false + } + if this.EmulationFaults != nil && that1.EmulationFaults != nil { + if *this.EmulationFaults != *that1.EmulationFaults { + return false + } + } else if this.EmulationFaults != nil { + return false + } else if that1.EmulationFaults != nil { + return false + } + if this.L1DcacheLoads != nil && that1.L1DcacheLoads != nil { + if *this.L1DcacheLoads != *that1.L1DcacheLoads { + return false + } + } else if this.L1DcacheLoads != nil { + return false + } else if that1.L1DcacheLoads != nil { + return false + } + if this.L1DcacheLoadMisses != nil && that1.L1DcacheLoadMisses != nil { + if *this.L1DcacheLoadMisses != *that1.L1DcacheLoadMisses { + return false + } + } else if this.L1DcacheLoadMisses != nil { + return false + } else if that1.L1DcacheLoadMisses != nil { + return false + } + if this.L1DcacheStores != nil && that1.L1DcacheStores != nil { + if *this.L1DcacheStores != *that1.L1DcacheStores { + return false + } + } else if this.L1DcacheStores != nil { + return false + } else if that1.L1DcacheStores != nil { + return false + } + if this.L1DcacheStoreMisses != nil && that1.L1DcacheStoreMisses != nil { + if *this.L1DcacheStoreMisses != *that1.L1DcacheStoreMisses { + return false + } + } else if this.L1DcacheStoreMisses != nil { + return false + } else if that1.L1DcacheStoreMisses != nil { + return false + } + if this.L1DcachePrefetches != nil && that1.L1DcachePrefetches != nil { + if *this.L1DcachePrefetches != *that1.L1DcachePrefetches { + return false + } + } else if this.L1DcachePrefetches != nil { + return false + } else if that1.L1DcachePrefetches != nil { + return false + } + if this.L1DcachePrefetchMisses != nil && that1.L1DcachePrefetchMisses != nil { + if *this.L1DcachePrefetchMisses != *that1.L1DcachePrefetchMisses { + return false + } + } else if this.L1DcachePrefetchMisses != nil { + return false + } else if that1.L1DcachePrefetchMisses != nil { + return false + } + if this.L1IcacheLoads != nil && that1.L1IcacheLoads != nil { + if *this.L1IcacheLoads != *that1.L1IcacheLoads { + return false + } + } else if this.L1IcacheLoads != nil { + return false + } else if that1.L1IcacheLoads != nil { + return false + } + if this.L1IcacheLoadMisses != nil && that1.L1IcacheLoadMisses != nil { + if *this.L1IcacheLoadMisses != *that1.L1IcacheLoadMisses { + return false + } + } else if this.L1IcacheLoadMisses != nil { + return false + } else if that1.L1IcacheLoadMisses != nil { + return false + } + if this.L1IcachePrefetches != nil && that1.L1IcachePrefetches != nil { + if *this.L1IcachePrefetches != *that1.L1IcachePrefetches { + return false + } + } else if this.L1IcachePrefetches != nil { + return false + } else if that1.L1IcachePrefetches != nil { + return false + } + if this.L1IcachePrefetchMisses != nil && that1.L1IcachePrefetchMisses != nil { + if *this.L1IcachePrefetchMisses != *that1.L1IcachePrefetchMisses { + return false + } + } else if this.L1IcachePrefetchMisses != nil { + return false + } else if that1.L1IcachePrefetchMisses != nil { + return false + } + if this.LlcLoads != nil && that1.LlcLoads != nil { + if *this.LlcLoads != *that1.LlcLoads { + return false + } + } else if this.LlcLoads != nil { + return false + } else if that1.LlcLoads != nil { + return false + } + if this.LlcLoadMisses != nil && that1.LlcLoadMisses != nil { + if *this.LlcLoadMisses != *that1.LlcLoadMisses { + return false + } + } else if this.LlcLoadMisses != nil { + return false + } else if that1.LlcLoadMisses != nil { + return false + } + if this.LlcStores != nil && that1.LlcStores != nil { + if *this.LlcStores != *that1.LlcStores { + return false + } + } else if this.LlcStores != nil { + return false + } else if that1.LlcStores != nil { + return false + } + if this.LlcStoreMisses != nil && that1.LlcStoreMisses != nil { + if *this.LlcStoreMisses != *that1.LlcStoreMisses { + return false + } + } else if this.LlcStoreMisses != nil { + return false + } else if that1.LlcStoreMisses != nil { + return false + } + if this.LlcPrefetches != nil && that1.LlcPrefetches != nil { + if *this.LlcPrefetches != *that1.LlcPrefetches { + return false + } + } else if this.LlcPrefetches != nil { + return false + } else if that1.LlcPrefetches != nil { + return false + } + if this.LlcPrefetchMisses != nil && that1.LlcPrefetchMisses != nil { + if *this.LlcPrefetchMisses != *that1.LlcPrefetchMisses { + return false + } + } else if this.LlcPrefetchMisses != nil { + return false + } else if that1.LlcPrefetchMisses != nil { + return false + } + if this.DtlbLoads != nil && that1.DtlbLoads != nil { + if *this.DtlbLoads != *that1.DtlbLoads { + return false + } + } else if this.DtlbLoads != nil { + return false + } else if that1.DtlbLoads != nil { + return false + } + if this.DtlbLoadMisses != nil && that1.DtlbLoadMisses != nil { + if *this.DtlbLoadMisses != *that1.DtlbLoadMisses { + return false + } + } else if this.DtlbLoadMisses != nil { + return false + } else if that1.DtlbLoadMisses != nil { + return false + } + if this.DtlbStores != nil && that1.DtlbStores != nil { + if *this.DtlbStores != *that1.DtlbStores { + return false + } + } else if this.DtlbStores != nil { + return false + } else if that1.DtlbStores != nil { + return false + } + if this.DtlbStoreMisses != nil && that1.DtlbStoreMisses != nil { + if *this.DtlbStoreMisses != *that1.DtlbStoreMisses { + return false + } + } else if this.DtlbStoreMisses != nil { + return false + } else if that1.DtlbStoreMisses != nil { + return false + } + if this.DtlbPrefetches != nil && that1.DtlbPrefetches != nil { + if *this.DtlbPrefetches != *that1.DtlbPrefetches { + return false + } + } else if this.DtlbPrefetches != nil { + return false + } else if that1.DtlbPrefetches != nil { + return false + } + if this.DtlbPrefetchMisses != nil && that1.DtlbPrefetchMisses != nil { + if *this.DtlbPrefetchMisses != *that1.DtlbPrefetchMisses { + return false + } + } else if this.DtlbPrefetchMisses != nil { + return false + } else if that1.DtlbPrefetchMisses != nil { + return false + } + if this.ItlbLoads != nil && that1.ItlbLoads != nil { + if *this.ItlbLoads != *that1.ItlbLoads { + return false + } + } else if this.ItlbLoads != nil { + return false + } else if that1.ItlbLoads != nil { + return false + } + if this.ItlbLoadMisses != nil && that1.ItlbLoadMisses != nil { + if *this.ItlbLoadMisses != *that1.ItlbLoadMisses { + return false + } + } else if this.ItlbLoadMisses != nil { + return false + } else if that1.ItlbLoadMisses != nil { + return false + } + if this.BranchLoads != nil && that1.BranchLoads != nil { + if *this.BranchLoads != *that1.BranchLoads { + return false + } + } else if this.BranchLoads != nil { + return false + } else if that1.BranchLoads != nil { + return false + } + if this.BranchLoadMisses != nil && that1.BranchLoadMisses != nil { + if *this.BranchLoadMisses != *that1.BranchLoadMisses { + return false + } + } else if this.BranchLoadMisses != nil { + return false + } else if that1.BranchLoadMisses != nil { + return false + } + if this.NodeLoads != nil && that1.NodeLoads != nil { + if *this.NodeLoads != *that1.NodeLoads { + return false + } + } else if this.NodeLoads != nil { + return false + } else if that1.NodeLoads != nil { + return false + } + if this.NodeLoadMisses != nil && that1.NodeLoadMisses != nil { + if *this.NodeLoadMisses != *that1.NodeLoadMisses { + return false + } + } else if this.NodeLoadMisses != nil { + return false + } else if that1.NodeLoadMisses != nil { + return false + } + if this.NodeStores != nil && that1.NodeStores != nil { + if *this.NodeStores != *that1.NodeStores { + return false + } + } else if this.NodeStores != nil { + return false + } else if that1.NodeStores != nil { + return false + } + if this.NodeStoreMisses != nil && that1.NodeStoreMisses != nil { + if *this.NodeStoreMisses != *that1.NodeStoreMisses { + return false + } + } else if this.NodeStoreMisses != nil { + return false + } else if that1.NodeStoreMisses != nil { + return false + } + if this.NodePrefetches != nil && that1.NodePrefetches != nil { + if *this.NodePrefetches != *that1.NodePrefetches { + return false + } + } else if this.NodePrefetches != nil { + return false + } else if that1.NodePrefetches != nil { + return false + } + if this.NodePrefetchMisses != nil && that1.NodePrefetchMisses != nil { + if *this.NodePrefetchMisses != *that1.NodePrefetchMisses { + return false + } + } else if this.NodePrefetchMisses != nil { + return false + } else if that1.NodePrefetchMisses != nil { + return false + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *Request) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*Request) + if !ok { + return fmt.Errorf("that is not of type *Request") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *Request but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *Requestbut is not nil && this == nil") + } + if !this.SlaveId.Equal(that1.SlaveId) { + return fmt.Errorf("SlaveId this(%v) Not Equal that(%v)", this.SlaveId, that1.SlaveId) + } + if len(this.Resources) != len(that1.Resources) { + return fmt.Errorf("Resources this(%v) Not Equal that(%v)", len(this.Resources), len(that1.Resources)) + } + for i := range this.Resources { + if !this.Resources[i].Equal(that1.Resources[i]) { + return fmt.Errorf("Resources this[%v](%v) Not Equal that[%v](%v)", i, this.Resources[i], i, that1.Resources[i]) + } + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + } + return nil +} +func (this *Request) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } + + that1, ok := that.(*Request) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if !this.SlaveId.Equal(that1.SlaveId) { + return false + } + if len(this.Resources) != len(that1.Resources) { + return false + } + for i := range this.Resources { + if !this.Resources[i].Equal(that1.Resources[i]) { + return false + } + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *Offer) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*Offer) + if !ok { + return fmt.Errorf("that is not of type *Offer") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *Offer but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *Offerbut is not nil && this == nil") + } + if !this.Id.Equal(that1.Id) { + return fmt.Errorf("Id this(%v) Not Equal that(%v)", this.Id, that1.Id) + } + if !this.FrameworkId.Equal(that1.FrameworkId) { + return fmt.Errorf("FrameworkId this(%v) Not Equal that(%v)", this.FrameworkId, that1.FrameworkId) + } + if !this.SlaveId.Equal(that1.SlaveId) { + return fmt.Errorf("SlaveId this(%v) Not Equal that(%v)", this.SlaveId, that1.SlaveId) + } + if this.Hostname != nil && that1.Hostname != nil { + if *this.Hostname != *that1.Hostname { + return fmt.Errorf("Hostname this(%v) Not Equal that(%v)", *this.Hostname, *that1.Hostname) + } + } else if this.Hostname != nil { + return fmt.Errorf("this.Hostname == nil && that.Hostname != nil") + } else if that1.Hostname != nil { + return fmt.Errorf("Hostname this(%v) Not Equal that(%v)", this.Hostname, that1.Hostname) + } + if len(this.Resources) != len(that1.Resources) { + return fmt.Errorf("Resources this(%v) Not Equal that(%v)", len(this.Resources), len(that1.Resources)) + } + for i := range this.Resources { + if !this.Resources[i].Equal(that1.Resources[i]) { + return fmt.Errorf("Resources this[%v](%v) Not Equal that[%v](%v)", i, this.Resources[i], i, that1.Resources[i]) + } + } + if len(this.Attributes) != len(that1.Attributes) { + return fmt.Errorf("Attributes this(%v) Not Equal that(%v)", len(this.Attributes), len(that1.Attributes)) + } + for i := range this.Attributes { + if !this.Attributes[i].Equal(that1.Attributes[i]) { + return fmt.Errorf("Attributes this[%v](%v) Not Equal that[%v](%v)", i, this.Attributes[i], i, that1.Attributes[i]) + } + } + if len(this.ExecutorIds) != len(that1.ExecutorIds) { + return fmt.Errorf("ExecutorIds this(%v) Not Equal that(%v)", len(this.ExecutorIds), len(that1.ExecutorIds)) + } + for i := range this.ExecutorIds { + if !this.ExecutorIds[i].Equal(that1.ExecutorIds[i]) { + return fmt.Errorf("ExecutorIds this[%v](%v) Not Equal that[%v](%v)", i, this.ExecutorIds[i], i, that1.ExecutorIds[i]) + } + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + } + return nil +} +func (this *Offer) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } + + that1, ok := that.(*Offer) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if !this.Id.Equal(that1.Id) { + return false + } + if !this.FrameworkId.Equal(that1.FrameworkId) { + return false + } + if !this.SlaveId.Equal(that1.SlaveId) { + return false + } + if this.Hostname != nil && that1.Hostname != nil { + if *this.Hostname != *that1.Hostname { + return false + } + } else if this.Hostname != nil { + return false + } else if that1.Hostname != nil { + return false + } + if len(this.Resources) != len(that1.Resources) { + return false + } + for i := range this.Resources { + if !this.Resources[i].Equal(that1.Resources[i]) { + return false + } + } + if len(this.Attributes) != len(that1.Attributes) { + return false + } + for i := range this.Attributes { + if !this.Attributes[i].Equal(that1.Attributes[i]) { + return false + } + } + if len(this.ExecutorIds) != len(that1.ExecutorIds) { + return false + } + for i := range this.ExecutorIds { + if !this.ExecutorIds[i].Equal(that1.ExecutorIds[i]) { + return false + } + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *Offer_Operation) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*Offer_Operation) + if !ok { + return fmt.Errorf("that is not of type *Offer_Operation") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *Offer_Operation but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *Offer_Operationbut is not nil && this == nil") + } + if this.Type != nil && that1.Type != nil { + if *this.Type != *that1.Type { + return fmt.Errorf("Type this(%v) Not Equal that(%v)", *this.Type, *that1.Type) + } + } else if this.Type != nil { + return fmt.Errorf("this.Type == nil && that.Type != nil") + } else if that1.Type != nil { + return fmt.Errorf("Type this(%v) Not Equal that(%v)", this.Type, that1.Type) + } + if !this.Launch.Equal(that1.Launch) { + return fmt.Errorf("Launch this(%v) Not Equal that(%v)", this.Launch, that1.Launch) + } + if !this.Reserve.Equal(that1.Reserve) { + return fmt.Errorf("Reserve this(%v) Not Equal that(%v)", this.Reserve, that1.Reserve) + } + if !this.Unreserve.Equal(that1.Unreserve) { + return fmt.Errorf("Unreserve this(%v) Not Equal that(%v)", this.Unreserve, that1.Unreserve) + } + if !this.Create.Equal(that1.Create) { + return fmt.Errorf("Create this(%v) Not Equal that(%v)", this.Create, that1.Create) + } + if !this.Destroy.Equal(that1.Destroy) { + return fmt.Errorf("Destroy this(%v) Not Equal that(%v)", this.Destroy, that1.Destroy) + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + } + return nil +} +func (this *Offer_Operation) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } + + that1, ok := that.(*Offer_Operation) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if this.Type != nil && that1.Type != nil { + if *this.Type != *that1.Type { + return false + } + } else if this.Type != nil { + return false + } else if that1.Type != nil { + return false + } + if !this.Launch.Equal(that1.Launch) { + return false + } + if !this.Reserve.Equal(that1.Reserve) { + return false + } + if !this.Unreserve.Equal(that1.Unreserve) { + return false + } + if !this.Create.Equal(that1.Create) { + return false + } + if !this.Destroy.Equal(that1.Destroy) { + return false + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *Offer_Operation_Launch) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*Offer_Operation_Launch) + if !ok { + return fmt.Errorf("that is not of type *Offer_Operation_Launch") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *Offer_Operation_Launch but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *Offer_Operation_Launchbut is not nil && this == nil") + } + if len(this.TaskInfos) != len(that1.TaskInfos) { + return fmt.Errorf("TaskInfos this(%v) Not Equal that(%v)", len(this.TaskInfos), len(that1.TaskInfos)) + } + for i := range this.TaskInfos { + if !this.TaskInfos[i].Equal(that1.TaskInfos[i]) { + return fmt.Errorf("TaskInfos this[%v](%v) Not Equal that[%v](%v)", i, this.TaskInfos[i], i, that1.TaskInfos[i]) + } + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + } + return nil +} +func (this *Offer_Operation_Launch) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } + + that1, ok := that.(*Offer_Operation_Launch) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if len(this.TaskInfos) != len(that1.TaskInfos) { + return false + } + for i := range this.TaskInfos { + if !this.TaskInfos[i].Equal(that1.TaskInfos[i]) { + return false + } + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *Offer_Operation_Reserve) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*Offer_Operation_Reserve) + if !ok { + return fmt.Errorf("that is not of type *Offer_Operation_Reserve") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *Offer_Operation_Reserve but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *Offer_Operation_Reservebut is not nil && this == nil") + } + if len(this.Resources) != len(that1.Resources) { + return fmt.Errorf("Resources this(%v) Not Equal that(%v)", len(this.Resources), len(that1.Resources)) + } + for i := range this.Resources { + if !this.Resources[i].Equal(that1.Resources[i]) { + return fmt.Errorf("Resources this[%v](%v) Not Equal that[%v](%v)", i, this.Resources[i], i, that1.Resources[i]) + } + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + } + return nil +} +func (this *Offer_Operation_Reserve) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } + + that1, ok := that.(*Offer_Operation_Reserve) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if len(this.Resources) != len(that1.Resources) { + return false + } + for i := range this.Resources { + if !this.Resources[i].Equal(that1.Resources[i]) { + return false + } + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *Offer_Operation_Unreserve) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*Offer_Operation_Unreserve) + if !ok { + return fmt.Errorf("that is not of type *Offer_Operation_Unreserve") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *Offer_Operation_Unreserve but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *Offer_Operation_Unreservebut is not nil && this == nil") + } + if len(this.Resources) != len(that1.Resources) { + return fmt.Errorf("Resources this(%v) Not Equal that(%v)", len(this.Resources), len(that1.Resources)) + } + for i := range this.Resources { + if !this.Resources[i].Equal(that1.Resources[i]) { + return fmt.Errorf("Resources this[%v](%v) Not Equal that[%v](%v)", i, this.Resources[i], i, that1.Resources[i]) + } + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + } + return nil +} +func (this *Offer_Operation_Unreserve) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } + + that1, ok := that.(*Offer_Operation_Unreserve) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if len(this.Resources) != len(that1.Resources) { + return false + } + for i := range this.Resources { + if !this.Resources[i].Equal(that1.Resources[i]) { + return false + } + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *Offer_Operation_Create) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*Offer_Operation_Create) + if !ok { + return fmt.Errorf("that is not of type *Offer_Operation_Create") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *Offer_Operation_Create but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *Offer_Operation_Createbut is not nil && this == nil") + } + if len(this.Volumes) != len(that1.Volumes) { + return fmt.Errorf("Volumes this(%v) Not Equal that(%v)", len(this.Volumes), len(that1.Volumes)) + } + for i := range this.Volumes { + if !this.Volumes[i].Equal(that1.Volumes[i]) { + return fmt.Errorf("Volumes this[%v](%v) Not Equal that[%v](%v)", i, this.Volumes[i], i, that1.Volumes[i]) + } + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + } + return nil +} +func (this *Offer_Operation_Create) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } + + that1, ok := that.(*Offer_Operation_Create) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if len(this.Volumes) != len(that1.Volumes) { + return false + } + for i := range this.Volumes { + if !this.Volumes[i].Equal(that1.Volumes[i]) { + return false + } + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *Offer_Operation_Destroy) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*Offer_Operation_Destroy) + if !ok { + return fmt.Errorf("that is not of type *Offer_Operation_Destroy") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *Offer_Operation_Destroy but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *Offer_Operation_Destroybut is not nil && this == nil") + } + if len(this.Volumes) != len(that1.Volumes) { + return fmt.Errorf("Volumes this(%v) Not Equal that(%v)", len(this.Volumes), len(that1.Volumes)) + } + for i := range this.Volumes { + if !this.Volumes[i].Equal(that1.Volumes[i]) { + return fmt.Errorf("Volumes this[%v](%v) Not Equal that[%v](%v)", i, this.Volumes[i], i, that1.Volumes[i]) + } + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + } + return nil +} +func (this *Offer_Operation_Destroy) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } + + that1, ok := that.(*Offer_Operation_Destroy) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if len(this.Volumes) != len(that1.Volumes) { + return false + } + for i := range this.Volumes { + if !this.Volumes[i].Equal(that1.Volumes[i]) { + return false + } + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *TaskInfo) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*TaskInfo) + if !ok { + return fmt.Errorf("that is not of type *TaskInfo") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *TaskInfo but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *TaskInfobut is not nil && this == nil") + } + if this.Name != nil && that1.Name != nil { + if *this.Name != *that1.Name { + return fmt.Errorf("Name this(%v) Not Equal that(%v)", *this.Name, *that1.Name) + } + } else if this.Name != nil { + return fmt.Errorf("this.Name == nil && that.Name != nil") + } else if that1.Name != nil { + return fmt.Errorf("Name this(%v) Not Equal that(%v)", this.Name, that1.Name) + } + if !this.TaskId.Equal(that1.TaskId) { + return fmt.Errorf("TaskId this(%v) Not Equal that(%v)", this.TaskId, that1.TaskId) + } + if !this.SlaveId.Equal(that1.SlaveId) { + return fmt.Errorf("SlaveId this(%v) Not Equal that(%v)", this.SlaveId, that1.SlaveId) + } + if len(this.Resources) != len(that1.Resources) { + return fmt.Errorf("Resources this(%v) Not Equal that(%v)", len(this.Resources), len(that1.Resources)) + } + for i := range this.Resources { + if !this.Resources[i].Equal(that1.Resources[i]) { + return fmt.Errorf("Resources this[%v](%v) Not Equal that[%v](%v)", i, this.Resources[i], i, that1.Resources[i]) + } + } + if !this.Executor.Equal(that1.Executor) { + return fmt.Errorf("Executor this(%v) Not Equal that(%v)", this.Executor, that1.Executor) + } + if !this.Command.Equal(that1.Command) { + return fmt.Errorf("Command this(%v) Not Equal that(%v)", this.Command, that1.Command) + } + if !this.Container.Equal(that1.Container) { + return fmt.Errorf("Container this(%v) Not Equal that(%v)", this.Container, that1.Container) + } + if !bytes.Equal(this.Data, that1.Data) { + return fmt.Errorf("Data this(%v) Not Equal that(%v)", this.Data, that1.Data) + } + if !this.HealthCheck.Equal(that1.HealthCheck) { + return fmt.Errorf("HealthCheck this(%v) Not Equal that(%v)", this.HealthCheck, that1.HealthCheck) + } + if !this.Labels.Equal(that1.Labels) { + return fmt.Errorf("Labels this(%v) Not Equal that(%v)", this.Labels, that1.Labels) + } + if !this.Discovery.Equal(that1.Discovery) { + return fmt.Errorf("Discovery this(%v) Not Equal that(%v)", this.Discovery, that1.Discovery) + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + } + return nil +} +func (this *TaskInfo) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } + + that1, ok := that.(*TaskInfo) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if this.Name != nil && that1.Name != nil { + if *this.Name != *that1.Name { + return false + } + } else if this.Name != nil { + return false + } else if that1.Name != nil { + return false + } + if !this.TaskId.Equal(that1.TaskId) { + return false + } + if !this.SlaveId.Equal(that1.SlaveId) { + return false + } + if len(this.Resources) != len(that1.Resources) { + return false + } + for i := range this.Resources { + if !this.Resources[i].Equal(that1.Resources[i]) { + return false + } + } + if !this.Executor.Equal(that1.Executor) { + return false + } + if !this.Command.Equal(that1.Command) { + return false + } + if !this.Container.Equal(that1.Container) { + return false + } + if !bytes.Equal(this.Data, that1.Data) { + return false + } + if !this.HealthCheck.Equal(that1.HealthCheck) { + return false + } + if !this.Labels.Equal(that1.Labels) { + return false + } + if !this.Discovery.Equal(that1.Discovery) { + return false + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *TaskStatus) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*TaskStatus) + if !ok { + return fmt.Errorf("that is not of type *TaskStatus") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *TaskStatus but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *TaskStatusbut is not nil && this == nil") + } + if !this.TaskId.Equal(that1.TaskId) { + return fmt.Errorf("TaskId this(%v) Not Equal that(%v)", this.TaskId, that1.TaskId) + } + if this.State != nil && that1.State != nil { + if *this.State != *that1.State { + return fmt.Errorf("State this(%v) Not Equal that(%v)", *this.State, *that1.State) + } + } else if this.State != nil { + return fmt.Errorf("this.State == nil && that.State != nil") + } else if that1.State != nil { + return fmt.Errorf("State this(%v) Not Equal that(%v)", this.State, that1.State) + } + if this.Message != nil && that1.Message != nil { + if *this.Message != *that1.Message { + return fmt.Errorf("Message this(%v) Not Equal that(%v)", *this.Message, *that1.Message) + } + } else if this.Message != nil { + return fmt.Errorf("this.Message == nil && that.Message != nil") + } else if that1.Message != nil { + return fmt.Errorf("Message this(%v) Not Equal that(%v)", this.Message, that1.Message) + } + if this.Source != nil && that1.Source != nil { + if *this.Source != *that1.Source { + return fmt.Errorf("Source this(%v) Not Equal that(%v)", *this.Source, *that1.Source) + } + } else if this.Source != nil { + return fmt.Errorf("this.Source == nil && that.Source != nil") + } else if that1.Source != nil { + return fmt.Errorf("Source this(%v) Not Equal that(%v)", this.Source, that1.Source) + } + if this.Reason != nil && that1.Reason != nil { + if *this.Reason != *that1.Reason { + return fmt.Errorf("Reason this(%v) Not Equal that(%v)", *this.Reason, *that1.Reason) + } + } else if this.Reason != nil { + return fmt.Errorf("this.Reason == nil && that.Reason != nil") + } else if that1.Reason != nil { + return fmt.Errorf("Reason this(%v) Not Equal that(%v)", this.Reason, that1.Reason) + } + if !bytes.Equal(this.Data, that1.Data) { + return fmt.Errorf("Data this(%v) Not Equal that(%v)", this.Data, that1.Data) + } + if !this.SlaveId.Equal(that1.SlaveId) { + return fmt.Errorf("SlaveId this(%v) Not Equal that(%v)", this.SlaveId, that1.SlaveId) + } + if !this.ExecutorId.Equal(that1.ExecutorId) { + return fmt.Errorf("ExecutorId this(%v) Not Equal that(%v)", this.ExecutorId, that1.ExecutorId) + } + if this.Timestamp != nil && that1.Timestamp != nil { + if *this.Timestamp != *that1.Timestamp { + return fmt.Errorf("Timestamp this(%v) Not Equal that(%v)", *this.Timestamp, *that1.Timestamp) + } + } else if this.Timestamp != nil { + return fmt.Errorf("this.Timestamp == nil && that.Timestamp != nil") + } else if that1.Timestamp != nil { + return fmt.Errorf("Timestamp this(%v) Not Equal that(%v)", this.Timestamp, that1.Timestamp) + } + if !bytes.Equal(this.Uuid, that1.Uuid) { + return fmt.Errorf("Uuid this(%v) Not Equal that(%v)", this.Uuid, that1.Uuid) + } + if this.Healthy != nil && that1.Healthy != nil { + if *this.Healthy != *that1.Healthy { + return fmt.Errorf("Healthy this(%v) Not Equal that(%v)", *this.Healthy, *that1.Healthy) + } + } else if this.Healthy != nil { + return fmt.Errorf("this.Healthy == nil && that.Healthy != nil") + } else if that1.Healthy != nil { + return fmt.Errorf("Healthy this(%v) Not Equal that(%v)", this.Healthy, that1.Healthy) + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + } + return nil +} +func (this *TaskStatus) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } + + that1, ok := that.(*TaskStatus) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if !this.TaskId.Equal(that1.TaskId) { + return false + } + if this.State != nil && that1.State != nil { + if *this.State != *that1.State { + return false + } + } else if this.State != nil { + return false + } else if that1.State != nil { + return false + } + if this.Message != nil && that1.Message != nil { + if *this.Message != *that1.Message { + return false + } + } else if this.Message != nil { + return false + } else if that1.Message != nil { + return false + } + if this.Source != nil && that1.Source != nil { + if *this.Source != *that1.Source { + return false + } + } else if this.Source != nil { + return false + } else if that1.Source != nil { + return false + } + if this.Reason != nil && that1.Reason != nil { + if *this.Reason != *that1.Reason { + return false + } + } else if this.Reason != nil { + return false + } else if that1.Reason != nil { + return false + } + if !bytes.Equal(this.Data, that1.Data) { + return false + } + if !this.SlaveId.Equal(that1.SlaveId) { + return false + } + if !this.ExecutorId.Equal(that1.ExecutorId) { + return false + } + if this.Timestamp != nil && that1.Timestamp != nil { + if *this.Timestamp != *that1.Timestamp { + return false + } + } else if this.Timestamp != nil { + return false + } else if that1.Timestamp != nil { + return false + } + if !bytes.Equal(this.Uuid, that1.Uuid) { + return false + } + if this.Healthy != nil && that1.Healthy != nil { + if *this.Healthy != *that1.Healthy { + return false + } + } else if this.Healthy != nil { + return false + } else if that1.Healthy != nil { + return false + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *Filters) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*Filters) + if !ok { + return fmt.Errorf("that is not of type *Filters") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *Filters but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *Filtersbut is not nil && this == nil") + } + if this.RefuseSeconds != nil && that1.RefuseSeconds != nil { + if *this.RefuseSeconds != *that1.RefuseSeconds { + return fmt.Errorf("RefuseSeconds this(%v) Not Equal that(%v)", *this.RefuseSeconds, *that1.RefuseSeconds) + } + } else if this.RefuseSeconds != nil { + return fmt.Errorf("this.RefuseSeconds == nil && that.RefuseSeconds != nil") + } else if that1.RefuseSeconds != nil { + return fmt.Errorf("RefuseSeconds this(%v) Not Equal that(%v)", this.RefuseSeconds, that1.RefuseSeconds) + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + } + return nil +} +func (this *Filters) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } + + that1, ok := that.(*Filters) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if this.RefuseSeconds != nil && that1.RefuseSeconds != nil { + if *this.RefuseSeconds != *that1.RefuseSeconds { + return false + } + } else if this.RefuseSeconds != nil { + return false + } else if that1.RefuseSeconds != nil { + return false + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *Environment) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*Environment) + if !ok { + return fmt.Errorf("that is not of type *Environment") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *Environment but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *Environmentbut is not nil && this == nil") + } + if len(this.Variables) != len(that1.Variables) { + return fmt.Errorf("Variables this(%v) Not Equal that(%v)", len(this.Variables), len(that1.Variables)) + } + for i := range this.Variables { + if !this.Variables[i].Equal(that1.Variables[i]) { + return fmt.Errorf("Variables this[%v](%v) Not Equal that[%v](%v)", i, this.Variables[i], i, that1.Variables[i]) + } + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + } + return nil +} +func (this *Environment) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } + + that1, ok := that.(*Environment) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if len(this.Variables) != len(that1.Variables) { + return false + } + for i := range this.Variables { + if !this.Variables[i].Equal(that1.Variables[i]) { + return false + } + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *Environment_Variable) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*Environment_Variable) + if !ok { + return fmt.Errorf("that is not of type *Environment_Variable") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *Environment_Variable but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *Environment_Variablebut is not nil && this == nil") + } + if this.Name != nil && that1.Name != nil { + if *this.Name != *that1.Name { + return fmt.Errorf("Name this(%v) Not Equal that(%v)", *this.Name, *that1.Name) + } + } else if this.Name != nil { + return fmt.Errorf("this.Name == nil && that.Name != nil") + } else if that1.Name != nil { + return fmt.Errorf("Name this(%v) Not Equal that(%v)", this.Name, that1.Name) + } + if this.Value != nil && that1.Value != nil { + if *this.Value != *that1.Value { + return fmt.Errorf("Value this(%v) Not Equal that(%v)", *this.Value, *that1.Value) + } + } else if this.Value != nil { + return fmt.Errorf("this.Value == nil && that.Value != nil") + } else if that1.Value != nil { + return fmt.Errorf("Value this(%v) Not Equal that(%v)", this.Value, that1.Value) + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + } + return nil +} +func (this *Environment_Variable) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } + + that1, ok := that.(*Environment_Variable) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if this.Name != nil && that1.Name != nil { + if *this.Name != *that1.Name { + return false + } + } else if this.Name != nil { + return false + } else if that1.Name != nil { + return false + } + if this.Value != nil && that1.Value != nil { + if *this.Value != *that1.Value { + return false + } + } else if this.Value != nil { + return false + } else if that1.Value != nil { + return false + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *Parameter) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*Parameter) + if !ok { + return fmt.Errorf("that is not of type *Parameter") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *Parameter but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *Parameterbut is not nil && this == nil") + } + if this.Key != nil && that1.Key != nil { + if *this.Key != *that1.Key { + return fmt.Errorf("Key this(%v) Not Equal that(%v)", *this.Key, *that1.Key) + } + } else if this.Key != nil { + return fmt.Errorf("this.Key == nil && that.Key != nil") + } else if that1.Key != nil { + return fmt.Errorf("Key this(%v) Not Equal that(%v)", this.Key, that1.Key) + } + if this.Value != nil && that1.Value != nil { + if *this.Value != *that1.Value { + return fmt.Errorf("Value this(%v) Not Equal that(%v)", *this.Value, *that1.Value) + } + } else if this.Value != nil { + return fmt.Errorf("this.Value == nil && that.Value != nil") + } else if that1.Value != nil { + return fmt.Errorf("Value this(%v) Not Equal that(%v)", this.Value, that1.Value) + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + } + return nil +} +func (this *Parameter) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } + + that1, ok := that.(*Parameter) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if this.Key != nil && that1.Key != nil { + if *this.Key != *that1.Key { + return false + } + } else if this.Key != nil { + return false + } else if that1.Key != nil { + return false + } + if this.Value != nil && that1.Value != nil { + if *this.Value != *that1.Value { + return false + } + } else if this.Value != nil { + return false + } else if that1.Value != nil { + return false + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *Parameters) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*Parameters) + if !ok { + return fmt.Errorf("that is not of type *Parameters") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *Parameters but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *Parametersbut is not nil && this == nil") + } + if len(this.Parameter) != len(that1.Parameter) { + return fmt.Errorf("Parameter this(%v) Not Equal that(%v)", len(this.Parameter), len(that1.Parameter)) + } + for i := range this.Parameter { + if !this.Parameter[i].Equal(that1.Parameter[i]) { + return fmt.Errorf("Parameter this[%v](%v) Not Equal that[%v](%v)", i, this.Parameter[i], i, that1.Parameter[i]) + } + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + } + return nil +} +func (this *Parameters) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } + + that1, ok := that.(*Parameters) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if len(this.Parameter) != len(that1.Parameter) { + return false + } + for i := range this.Parameter { + if !this.Parameter[i].Equal(that1.Parameter[i]) { + return false + } + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *Credential) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*Credential) + if !ok { + return fmt.Errorf("that is not of type *Credential") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *Credential but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *Credentialbut is not nil && this == nil") + } + if this.Principal != nil && that1.Principal != nil { + if *this.Principal != *that1.Principal { + return fmt.Errorf("Principal this(%v) Not Equal that(%v)", *this.Principal, *that1.Principal) + } + } else if this.Principal != nil { + return fmt.Errorf("this.Principal == nil && that.Principal != nil") + } else if that1.Principal != nil { + return fmt.Errorf("Principal this(%v) Not Equal that(%v)", this.Principal, that1.Principal) + } + if !bytes.Equal(this.Secret, that1.Secret) { + return fmt.Errorf("Secret this(%v) Not Equal that(%v)", this.Secret, that1.Secret) + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + } + return nil +} +func (this *Credential) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } + + that1, ok := that.(*Credential) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if this.Principal != nil && that1.Principal != nil { + if *this.Principal != *that1.Principal { + return false + } + } else if this.Principal != nil { + return false + } else if that1.Principal != nil { + return false + } + if !bytes.Equal(this.Secret, that1.Secret) { + return false + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *Credentials) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*Credentials) + if !ok { + return fmt.Errorf("that is not of type *Credentials") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *Credentials but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *Credentialsbut is not nil && this == nil") + } + if len(this.Credentials) != len(that1.Credentials) { + return fmt.Errorf("Credentials this(%v) Not Equal that(%v)", len(this.Credentials), len(that1.Credentials)) + } + for i := range this.Credentials { + if !this.Credentials[i].Equal(that1.Credentials[i]) { + return fmt.Errorf("Credentials this[%v](%v) Not Equal that[%v](%v)", i, this.Credentials[i], i, that1.Credentials[i]) + } + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + } + return nil +} +func (this *Credentials) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } + + that1, ok := that.(*Credentials) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if len(this.Credentials) != len(that1.Credentials) { + return false + } + for i := range this.Credentials { + if !this.Credentials[i].Equal(that1.Credentials[i]) { + return false + } + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *ACL) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*ACL) + if !ok { + return fmt.Errorf("that is not of type *ACL") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *ACL but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *ACLbut is not nil && this == nil") + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + } + return nil +} +func (this *ACL) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } + + that1, ok := that.(*ACL) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *ACL_Entity) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*ACL_Entity) + if !ok { + return fmt.Errorf("that is not of type *ACL_Entity") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *ACL_Entity but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *ACL_Entitybut is not nil && this == nil") + } + if this.Type != nil && that1.Type != nil { + if *this.Type != *that1.Type { + return fmt.Errorf("Type this(%v) Not Equal that(%v)", *this.Type, *that1.Type) + } + } else if this.Type != nil { + return fmt.Errorf("this.Type == nil && that.Type != nil") + } else if that1.Type != nil { + return fmt.Errorf("Type this(%v) Not Equal that(%v)", this.Type, that1.Type) + } + if len(this.Values) != len(that1.Values) { + return fmt.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 fmt.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 fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + } + return nil +} +func (this *ACL_Entity) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } + + that1, ok := that.(*ACL_Entity) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if this.Type != nil && that1.Type != nil { + if *this.Type != *that1.Type { + return false + } + } else if this.Type != nil { + return false + } else if that1.Type != 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 *ACL_RegisterFramework) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*ACL_RegisterFramework) + if !ok { + return fmt.Errorf("that is not of type *ACL_RegisterFramework") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *ACL_RegisterFramework but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *ACL_RegisterFrameworkbut is not nil && this == nil") + } + if !this.Principals.Equal(that1.Principals) { + return fmt.Errorf("Principals this(%v) Not Equal that(%v)", this.Principals, that1.Principals) + } + if !this.Roles.Equal(that1.Roles) { + return fmt.Errorf("Roles this(%v) Not Equal that(%v)", this.Roles, that1.Roles) + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + } + return nil +} +func (this *ACL_RegisterFramework) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } + + that1, ok := that.(*ACL_RegisterFramework) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if !this.Principals.Equal(that1.Principals) { + return false + } + if !this.Roles.Equal(that1.Roles) { + return false + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *ACL_RunTask) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*ACL_RunTask) + if !ok { + return fmt.Errorf("that is not of type *ACL_RunTask") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *ACL_RunTask but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *ACL_RunTaskbut is not nil && this == nil") + } + if !this.Principals.Equal(that1.Principals) { + return fmt.Errorf("Principals this(%v) Not Equal that(%v)", this.Principals, that1.Principals) + } + if !this.Users.Equal(that1.Users) { + return fmt.Errorf("Users this(%v) Not Equal that(%v)", this.Users, that1.Users) + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + } + return nil +} +func (this *ACL_RunTask) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } + + that1, ok := that.(*ACL_RunTask) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if !this.Principals.Equal(that1.Principals) { + return false + } + if !this.Users.Equal(that1.Users) { + return false + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *ACL_ShutdownFramework) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*ACL_ShutdownFramework) + if !ok { + return fmt.Errorf("that is not of type *ACL_ShutdownFramework") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *ACL_ShutdownFramework but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *ACL_ShutdownFrameworkbut is not nil && this == nil") + } + if !this.Principals.Equal(that1.Principals) { + return fmt.Errorf("Principals this(%v) Not Equal that(%v)", this.Principals, that1.Principals) + } + if !this.FrameworkPrincipals.Equal(that1.FrameworkPrincipals) { + return fmt.Errorf("FrameworkPrincipals this(%v) Not Equal that(%v)", this.FrameworkPrincipals, that1.FrameworkPrincipals) + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + } + return nil +} +func (this *ACL_ShutdownFramework) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } + + that1, ok := that.(*ACL_ShutdownFramework) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if !this.Principals.Equal(that1.Principals) { + return false + } + if !this.FrameworkPrincipals.Equal(that1.FrameworkPrincipals) { + return false + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *ACLs) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*ACLs) + if !ok { + return fmt.Errorf("that is not of type *ACLs") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *ACLs but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *ACLsbut is not nil && this == nil") + } + if this.Permissive != nil && that1.Permissive != nil { + if *this.Permissive != *that1.Permissive { + return fmt.Errorf("Permissive this(%v) Not Equal that(%v)", *this.Permissive, *that1.Permissive) + } + } else if this.Permissive != nil { + return fmt.Errorf("this.Permissive == nil && that.Permissive != nil") + } else if that1.Permissive != nil { + return fmt.Errorf("Permissive this(%v) Not Equal that(%v)", this.Permissive, that1.Permissive) + } + if len(this.RegisterFrameworks) != len(that1.RegisterFrameworks) { + return fmt.Errorf("RegisterFrameworks this(%v) Not Equal that(%v)", len(this.RegisterFrameworks), len(that1.RegisterFrameworks)) + } + for i := range this.RegisterFrameworks { + if !this.RegisterFrameworks[i].Equal(that1.RegisterFrameworks[i]) { + return fmt.Errorf("RegisterFrameworks this[%v](%v) Not Equal that[%v](%v)", i, this.RegisterFrameworks[i], i, that1.RegisterFrameworks[i]) + } + } + if len(this.RunTasks) != len(that1.RunTasks) { + return fmt.Errorf("RunTasks this(%v) Not Equal that(%v)", len(this.RunTasks), len(that1.RunTasks)) + } + for i := range this.RunTasks { + if !this.RunTasks[i].Equal(that1.RunTasks[i]) { + return fmt.Errorf("RunTasks this[%v](%v) Not Equal that[%v](%v)", i, this.RunTasks[i], i, that1.RunTasks[i]) + } + } + if len(this.ShutdownFrameworks) != len(that1.ShutdownFrameworks) { + return fmt.Errorf("ShutdownFrameworks this(%v) Not Equal that(%v)", len(this.ShutdownFrameworks), len(that1.ShutdownFrameworks)) + } + for i := range this.ShutdownFrameworks { + if !this.ShutdownFrameworks[i].Equal(that1.ShutdownFrameworks[i]) { + return fmt.Errorf("ShutdownFrameworks this[%v](%v) Not Equal that[%v](%v)", i, this.ShutdownFrameworks[i], i, that1.ShutdownFrameworks[i]) + } + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + } + return nil +} +func (this *ACLs) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } + + that1, ok := that.(*ACLs) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if this.Permissive != nil && that1.Permissive != nil { + if *this.Permissive != *that1.Permissive { + return false + } + } else if this.Permissive != nil { + return false + } else if that1.Permissive != nil { + return false + } + if len(this.RegisterFrameworks) != len(that1.RegisterFrameworks) { + return false + } + for i := range this.RegisterFrameworks { + if !this.RegisterFrameworks[i].Equal(that1.RegisterFrameworks[i]) { + return false + } + } + if len(this.RunTasks) != len(that1.RunTasks) { + return false + } + for i := range this.RunTasks { + if !this.RunTasks[i].Equal(that1.RunTasks[i]) { + return false + } + } + if len(this.ShutdownFrameworks) != len(that1.ShutdownFrameworks) { + return false + } + for i := range this.ShutdownFrameworks { + if !this.ShutdownFrameworks[i].Equal(that1.ShutdownFrameworks[i]) { + return false + } + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *RateLimit) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*RateLimit) + if !ok { + return fmt.Errorf("that is not of type *RateLimit") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *RateLimit but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *RateLimitbut is not nil && this == nil") + } + if this.Qps != nil && that1.Qps != nil { + if *this.Qps != *that1.Qps { + return fmt.Errorf("Qps this(%v) Not Equal that(%v)", *this.Qps, *that1.Qps) + } + } else if this.Qps != nil { + return fmt.Errorf("this.Qps == nil && that.Qps != nil") + } else if that1.Qps != nil { + return fmt.Errorf("Qps this(%v) Not Equal that(%v)", this.Qps, that1.Qps) + } + if this.Principal != nil && that1.Principal != nil { + if *this.Principal != *that1.Principal { + return fmt.Errorf("Principal this(%v) Not Equal that(%v)", *this.Principal, *that1.Principal) + } + } else if this.Principal != nil { + return fmt.Errorf("this.Principal == nil && that.Principal != nil") + } else if that1.Principal != nil { + return fmt.Errorf("Principal this(%v) Not Equal that(%v)", this.Principal, that1.Principal) + } + if this.Capacity != nil && that1.Capacity != nil { + if *this.Capacity != *that1.Capacity { + return fmt.Errorf("Capacity this(%v) Not Equal that(%v)", *this.Capacity, *that1.Capacity) + } + } else if this.Capacity != nil { + return fmt.Errorf("this.Capacity == nil && that.Capacity != nil") + } else if that1.Capacity != nil { + return fmt.Errorf("Capacity this(%v) Not Equal that(%v)", this.Capacity, that1.Capacity) + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + } + return nil +} +func (this *RateLimit) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true } + return false } - return nil -} -func (m *Request) 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 - } + + that1, ok := that.(*RateLimit) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SlaveId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.SlaveId == nil { - m.SlaveId = &SlaveID{} - } - if err := m.SlaveId.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Resources", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Resources = append(m.Resources, &Resource{}) - m.Resources[len(m.Resources)-1].Unmarshal(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 false + } else if this == nil { + return false + } + if this.Qps != nil && that1.Qps != nil { + if *this.Qps != *that1.Qps { + return false } + } else if this.Qps != nil { + return false + } else if that1.Qps != nil { + return false } - return nil -} -func (m *Offer) 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 - } + if this.Principal != nil && that1.Principal != nil { + if *this.Principal != *that1.Principal { + return false } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Id == nil { - m.Id = &OfferID{} - } - if err := m.Id.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FrameworkId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.FrameworkId == nil { - m.FrameworkId = &FrameworkID{} - } - if err := m.FrameworkId.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SlaveId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.SlaveId == nil { - m.SlaveId = &SlaveID{} - } - if err := m.SlaveId.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Hostname", 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 - } - s := string(data[index:postIndex]) - m.Hostname = &s - index = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Resources", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Resources = append(m.Resources, &Resource{}) - m.Resources[len(m.Resources)-1].Unmarshal(data[index:postIndex]) - index = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Attributes", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Attributes = append(m.Attributes, &Attribute{}) - m.Attributes[len(m.Attributes)-1].Unmarshal(data[index:postIndex]) - index = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ExecutorIds", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ExecutorIds = append(m.ExecutorIds, &ExecutorID{}) - m.ExecutorIds[len(m.ExecutorIds)-1].Unmarshal(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 + } else if this.Principal != nil { + return false + } else if that1.Principal != nil { + return false + } + if this.Capacity != nil && that1.Capacity != nil { + if *this.Capacity != *that1.Capacity { + return false + } + } else if this.Capacity != nil { + return false + } else if that1.Capacity != nil { + return false + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *RateLimits) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*RateLimits) + if !ok { + return fmt.Errorf("that is not of type *RateLimits") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *RateLimits but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *RateLimitsbut is not nil && this == nil") + } + if len(this.Limits) != len(that1.Limits) { + return fmt.Errorf("Limits this(%v) Not Equal that(%v)", len(this.Limits), len(that1.Limits)) + } + for i := range this.Limits { + if !this.Limits[i].Equal(that1.Limits[i]) { + return fmt.Errorf("Limits this[%v](%v) Not Equal that[%v](%v)", i, this.Limits[i], i, that1.Limits[i]) + } + } + if this.AggregateDefaultQps != nil && that1.AggregateDefaultQps != nil { + if *this.AggregateDefaultQps != *that1.AggregateDefaultQps { + return fmt.Errorf("AggregateDefaultQps this(%v) Not Equal that(%v)", *this.AggregateDefaultQps, *that1.AggregateDefaultQps) + } + } else if this.AggregateDefaultQps != nil { + return fmt.Errorf("this.AggregateDefaultQps == nil && that.AggregateDefaultQps != nil") + } else if that1.AggregateDefaultQps != nil { + return fmt.Errorf("AggregateDefaultQps this(%v) Not Equal that(%v)", this.AggregateDefaultQps, that1.AggregateDefaultQps) + } + if this.AggregateDefaultCapacity != nil && that1.AggregateDefaultCapacity != nil { + if *this.AggregateDefaultCapacity != *that1.AggregateDefaultCapacity { + return fmt.Errorf("AggregateDefaultCapacity this(%v) Not Equal that(%v)", *this.AggregateDefaultCapacity, *that1.AggregateDefaultCapacity) } + } else if this.AggregateDefaultCapacity != nil { + return fmt.Errorf("this.AggregateDefaultCapacity == nil && that.AggregateDefaultCapacity != nil") + } else if that1.AggregateDefaultCapacity != nil { + return fmt.Errorf("AggregateDefaultCapacity this(%v) Not Equal that(%v)", this.AggregateDefaultCapacity, that1.AggregateDefaultCapacity) + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) } return nil } -func (m *TaskInfo) 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 - } +func (this *RateLimits) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", 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 - } - s := string(data[index:postIndex]) - m.Name = &s - index = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TaskId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.TaskId == nil { - m.TaskId = &TaskID{} - } - if err := m.TaskId.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SlaveId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.SlaveId == nil { - m.SlaveId = &SlaveID{} - } - if err := m.SlaveId.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Resources", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Resources = append(m.Resources, &Resource{}) - m.Resources[len(m.Resources)-1].Unmarshal(data[index:postIndex]) - index = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Executor", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Executor == nil { - m.Executor = &ExecutorInfo{} - } - if err := m.Executor.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Command", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Command == nil { - m.Command = &CommandInfo{} - } - if err := m.Command.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - case 9: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Container", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Container == nil { - m.Container = &ContainerInfo{} - } - if err := m.Container.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - byteLen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + byteLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Data = append([]byte{}, data[index:postIndex]...) - index = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field HealthCheck", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.HealthCheck == nil { - m.HealthCheck = &HealthCheck{} - } - if err := m.HealthCheck.Unmarshal(data[index:postIndex]); err != nil { - return err - } - 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 false + } + + that1, ok := that.(*RateLimits) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true } + return false + } else if this == nil { + return false } - return nil + if len(this.Limits) != len(that1.Limits) { + return false + } + for i := range this.Limits { + if !this.Limits[i].Equal(that1.Limits[i]) { + return false + } + } + if this.AggregateDefaultQps != nil && that1.AggregateDefaultQps != nil { + if *this.AggregateDefaultQps != *that1.AggregateDefaultQps { + return false + } + } else if this.AggregateDefaultQps != nil { + return false + } else if that1.AggregateDefaultQps != nil { + return false + } + if this.AggregateDefaultCapacity != nil && that1.AggregateDefaultCapacity != nil { + if *this.AggregateDefaultCapacity != *that1.AggregateDefaultCapacity { + return false + } + } else if this.AggregateDefaultCapacity != nil { + return false + } else if that1.AggregateDefaultCapacity != nil { + return false + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true } -func (m *TaskStatus) 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 - } +func (this *Volume) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TaskId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.TaskId == nil { - m.TaskId = &TaskID{} - } - if err := m.TaskId.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field State", wireType) - } - var v TaskState - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (TaskState(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.State = &v - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Message", 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 - } - s := string(data[index:postIndex]) - m.Message = &s - index = postIndex - case 9: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Source", wireType) - } - var v TaskStatus_Source - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (TaskStatus_Source(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Source = &v - case 10: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Reason", wireType) - } - var v TaskStatus_Reason - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (TaskStatus_Reason(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Reason = &v - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - byteLen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + byteLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Data = append([]byte{}, data[index:postIndex]...) - index = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SlaveId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.SlaveId == nil { - m.SlaveId = &SlaveID{} - } - if err := m.SlaveId.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ExecutorId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ExecutorId == nil { - m.ExecutorId = &ExecutorID{} - } - if err := m.ExecutorId.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - case 6: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) - } - var v uint64 - i := index + 8 - if i > l { - return io.ErrUnexpectedEOF - } - index = i - v = uint64(data[i-8]) - v |= uint64(data[i-7]) << 8 - v |= uint64(data[i-6]) << 16 - v |= uint64(data[i-5]) << 24 - v |= uint64(data[i-4]) << 32 - v |= uint64(data[i-3]) << 40 - v |= uint64(data[i-2]) << 48 - v |= uint64(data[i-1]) << 56 - v2 := math1.Float64frombits(v) - m.Timestamp = &v2 - case 8: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Healthy", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - b := bool(v != 0) - m.Healthy = &b - 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 fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*Volume) + if !ok { + return fmt.Errorf("that is not of type *Volume") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *Volume but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *Volumebut is not nil && this == nil") + } + if this.ContainerPath != nil && that1.ContainerPath != nil { + if *this.ContainerPath != *that1.ContainerPath { + return fmt.Errorf("ContainerPath this(%v) Not Equal that(%v)", *this.ContainerPath, *that1.ContainerPath) + } + } else if this.ContainerPath != nil { + return fmt.Errorf("this.ContainerPath == nil && that.ContainerPath != nil") + } else if that1.ContainerPath != nil { + return fmt.Errorf("ContainerPath this(%v) Not Equal that(%v)", this.ContainerPath, that1.ContainerPath) + } + if this.HostPath != nil && that1.HostPath != nil { + if *this.HostPath != *that1.HostPath { + return fmt.Errorf("HostPath this(%v) Not Equal that(%v)", *this.HostPath, *that1.HostPath) + } + } else if this.HostPath != nil { + return fmt.Errorf("this.HostPath == nil && that.HostPath != nil") + } else if that1.HostPath != nil { + return fmt.Errorf("HostPath this(%v) Not Equal that(%v)", this.HostPath, that1.HostPath) + } + if this.Mode != nil && that1.Mode != nil { + if *this.Mode != *that1.Mode { + return fmt.Errorf("Mode this(%v) Not Equal that(%v)", *this.Mode, *that1.Mode) } + } else if this.Mode != nil { + return fmt.Errorf("this.Mode == nil && that.Mode != nil") + } else if that1.Mode != nil { + return fmt.Errorf("Mode this(%v) Not Equal that(%v)", this.Mode, that1.Mode) + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) } return nil } -func (m *Filters) 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 != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field RefuseSeconds", wireType) - } - var v uint64 - i := index + 8 - if i > l { - return io.ErrUnexpectedEOF - } - index = i - v = uint64(data[i-8]) - v |= uint64(data[i-7]) << 8 - v |= uint64(data[i-6]) << 16 - v |= uint64(data[i-5]) << 24 - v |= uint64(data[i-4]) << 32 - v |= uint64(data[i-3]) << 40 - v |= uint64(data[i-2]) << 48 - v |= uint64(data[i-1]) << 56 - v2 := math1.Float64frombits(v) - m.RefuseSeconds = &v2 - 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 +func (this *Volume) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true } + return false } - return nil -} -func (m *Environment) 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 - } + + that1, ok := that.(*Volume) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Variables", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Variables = append(m.Variables, &Environment_Variable{}) - m.Variables[len(m.Variables)-1].Unmarshal(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 false + } else if this == nil { + return false + } + if this.ContainerPath != nil && that1.ContainerPath != nil { + if *this.ContainerPath != *that1.ContainerPath { + return false } + } else if this.ContainerPath != nil { + return false + } else if that1.ContainerPath != nil { + return false } - return nil -} -func (m *Environment_Variable) 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 - } + if this.HostPath != nil && that1.HostPath != nil { + if *this.HostPath != *that1.HostPath { + return false } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", 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 - } - s := string(data[index:postIndex]) - m.Name = &s - index = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", 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 - } - s := string(data[index:postIndex]) - m.Value = &s - 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 + } else if this.HostPath != nil { + return false + } else if that1.HostPath != nil { + return false + } + if this.Mode != nil && that1.Mode != nil { + if *this.Mode != *that1.Mode { + return false } + } else if this.Mode != nil { + return false + } else if that1.Mode != nil { + return false } - return nil + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true } -func (m *Parameter) 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 Key", 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 - } - s := string(data[index:postIndex]) - m.Key = &s - index = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", 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 - } - s := string(data[index:postIndex]) - m.Value = &s - 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 +func (this *ContainerInfo) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil } + return fmt.Errorf("that == nil && this != nil") } - return nil -} -func (m *Parameters) 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 - } + + that1, ok := that.(*ContainerInfo) + if !ok { + return fmt.Errorf("that is not of type *ContainerInfo") + } + if that1 == nil { + if this == nil { + return nil } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Parameter", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Parameter = append(m.Parameter, &Parameter{}) - m.Parameter[len(m.Parameter)-1].Unmarshal(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 fmt.Errorf("that is type *ContainerInfo but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *ContainerInfobut is not nil && this == nil") + } + if this.Type != nil && that1.Type != nil { + if *this.Type != *that1.Type { + return fmt.Errorf("Type this(%v) Not Equal that(%v)", *this.Type, *that1.Type) } + } else if this.Type != nil { + return fmt.Errorf("this.Type == nil && that.Type != nil") + } else if that1.Type != nil { + return fmt.Errorf("Type this(%v) Not Equal that(%v)", this.Type, that1.Type) } - return nil -} -func (m *Credential) 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 - } + if len(this.Volumes) != len(that1.Volumes) { + return fmt.Errorf("Volumes this(%v) Not Equal that(%v)", len(this.Volumes), len(that1.Volumes)) + } + for i := range this.Volumes { + if !this.Volumes[i].Equal(that1.Volumes[i]) { + return fmt.Errorf("Volumes this[%v](%v) Not Equal that[%v](%v)", i, this.Volumes[i], i, that1.Volumes[i]) } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Principal", 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 - } - s := string(data[index:postIndex]) - m.Principal = &s - index = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Secret", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - byteLen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + byteLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Secret = append([]byte{}, 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 + } + if this.Hostname != nil && that1.Hostname != nil { + if *this.Hostname != *that1.Hostname { + return fmt.Errorf("Hostname this(%v) Not Equal that(%v)", *this.Hostname, *that1.Hostname) } + } else if this.Hostname != nil { + return fmt.Errorf("this.Hostname == nil && that.Hostname != nil") + } else if that1.Hostname != nil { + return fmt.Errorf("Hostname this(%v) Not Equal that(%v)", this.Hostname, that1.Hostname) + } + if !this.Docker.Equal(that1.Docker) { + return fmt.Errorf("Docker this(%v) Not Equal that(%v)", this.Docker, that1.Docker) + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) } return nil } -func (m *Credentials) 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 - } +func (this *ContainerInfo) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Credentials", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Credentials = append(m.Credentials, &Credential{}) - m.Credentials[len(m.Credentials)-1].Unmarshal(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 false + } + + that1, ok := that.(*ContainerInfo) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true } + return false + } else if this == nil { + return false } - return nil + if this.Type != nil && that1.Type != nil { + if *this.Type != *that1.Type { + return false + } + } else if this.Type != nil { + return false + } else if that1.Type != nil { + return false + } + if len(this.Volumes) != len(that1.Volumes) { + return false + } + for i := range this.Volumes { + if !this.Volumes[i].Equal(that1.Volumes[i]) { + return false + } + } + if this.Hostname != nil && that1.Hostname != nil { + if *this.Hostname != *that1.Hostname { + return false + } + } else if this.Hostname != nil { + return false + } else if that1.Hostname != nil { + return false + } + if !this.Docker.Equal(that1.Docker) { + return false + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true } -func (m *ACL) 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 - } +func (this *ContainerInfo_DockerInfo) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*ContainerInfo_DockerInfo) + if !ok { + return fmt.Errorf("that is not of type *ContainerInfo_DockerInfo") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *ContainerInfo_DockerInfo but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *ContainerInfo_DockerInfobut is not nil && this == nil") + } + if this.Image != nil && that1.Image != nil { + if *this.Image != *that1.Image { + return fmt.Errorf("Image this(%v) Not Equal that(%v)", *this.Image, *that1.Image) } - fieldNum := int32(wire >> 3) - switch fieldNum { - 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 + } else if this.Image != nil { + return fmt.Errorf("this.Image == nil && that.Image != nil") + } else if that1.Image != nil { + return fmt.Errorf("Image this(%v) Not Equal that(%v)", this.Image, that1.Image) + } + if this.Network != nil && that1.Network != nil { + if *this.Network != *that1.Network { + return fmt.Errorf("Network this(%v) Not Equal that(%v)", *this.Network, *that1.Network) } + } else if this.Network != nil { + return fmt.Errorf("this.Network == nil && that.Network != nil") + } else if that1.Network != nil { + return fmt.Errorf("Network this(%v) Not Equal that(%v)", this.Network, that1.Network) } - return nil -} -func (m *ACL_Entity) 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 - } + if len(this.PortMappings) != len(that1.PortMappings) { + return fmt.Errorf("PortMappings this(%v) Not Equal that(%v)", len(this.PortMappings), len(that1.PortMappings)) + } + for i := range this.PortMappings { + if !this.PortMappings[i].Equal(that1.PortMappings[i]) { + return fmt.Errorf("PortMappings this[%v](%v) Not Equal that[%v](%v)", i, this.PortMappings[i], i, that1.PortMappings[i]) } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - var v ACL_Entity_Type - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (ACL_Entity_Type(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Type = &v - case 2: - 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 + } + if this.Privileged != nil && that1.Privileged != nil { + if *this.Privileged != *that1.Privileged { + return fmt.Errorf("Privileged this(%v) Not Equal that(%v)", *this.Privileged, *that1.Privileged) } + } else if this.Privileged != nil { + return fmt.Errorf("this.Privileged == nil && that.Privileged != nil") + } else if that1.Privileged != nil { + return fmt.Errorf("Privileged this(%v) Not Equal that(%v)", this.Privileged, that1.Privileged) } - return nil -} -func (m *ACL_RegisterFramework) 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 - } + if len(this.Parameters) != len(that1.Parameters) { + return fmt.Errorf("Parameters this(%v) Not Equal that(%v)", len(this.Parameters), len(that1.Parameters)) + } + for i := range this.Parameters { + if !this.Parameters[i].Equal(that1.Parameters[i]) { + return fmt.Errorf("Parameters this[%v](%v) Not Equal that[%v](%v)", i, this.Parameters[i], i, that1.Parameters[i]) } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Principals", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Principals == nil { - m.Principals = &ACL_Entity{} - } - if err := m.Principals.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Roles", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Roles == nil { - m.Roles = &ACL_Entity{} - } - if err := m.Roles.Unmarshal(data[index:postIndex]); err != nil { - return err - } - 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 + } + if this.ForcePullImage != nil && that1.ForcePullImage != nil { + if *this.ForcePullImage != *that1.ForcePullImage { + return fmt.Errorf("ForcePullImage this(%v) Not Equal that(%v)", *this.ForcePullImage, *that1.ForcePullImage) } + } else if this.ForcePullImage != nil { + return fmt.Errorf("this.ForcePullImage == nil && that.ForcePullImage != nil") + } else if that1.ForcePullImage != nil { + return fmt.Errorf("ForcePullImage this(%v) Not Equal that(%v)", this.ForcePullImage, that1.ForcePullImage) + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) } return nil } -func (m *ACL_RunTask) 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 - } +func (this *ContainerInfo_DockerInfo) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Principals", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Principals == nil { - m.Principals = &ACL_Entity{} - } - if err := m.Principals.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Users", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Users == nil { - m.Users = &ACL_Entity{} - } - if err := m.Users.Unmarshal(data[index:postIndex]); err != nil { - return err - } - 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 false + } + + that1, ok := that.(*ContainerInfo_DockerInfo) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true } + return false + } else if this == nil { + return false } - return nil + if this.Image != nil && that1.Image != nil { + if *this.Image != *that1.Image { + return false + } + } else if this.Image != nil { + return false + } else if that1.Image != nil { + return false + } + if this.Network != nil && that1.Network != nil { + if *this.Network != *that1.Network { + return false + } + } else if this.Network != nil { + return false + } else if that1.Network != nil { + return false + } + if len(this.PortMappings) != len(that1.PortMappings) { + return false + } + for i := range this.PortMappings { + if !this.PortMappings[i].Equal(that1.PortMappings[i]) { + return false + } + } + if this.Privileged != nil && that1.Privileged != nil { + if *this.Privileged != *that1.Privileged { + return false + } + } else if this.Privileged != nil { + return false + } else if that1.Privileged != nil { + return false + } + if len(this.Parameters) != len(that1.Parameters) { + return false + } + for i := range this.Parameters { + if !this.Parameters[i].Equal(that1.Parameters[i]) { + return false + } + } + if this.ForcePullImage != nil && that1.ForcePullImage != nil { + if *this.ForcePullImage != *that1.ForcePullImage { + return false + } + } else if this.ForcePullImage != nil { + return false + } else if that1.ForcePullImage != nil { + return false + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true } -func (m *ACL_ShutdownFramework) 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 - } +func (this *ContainerInfo_DockerInfo_PortMapping) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Principals", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Principals == nil { - m.Principals = &ACL_Entity{} - } - if err := m.Principals.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FrameworkPrincipals", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.FrameworkPrincipals == nil { - m.FrameworkPrincipals = &ACL_Entity{} - } - if err := m.FrameworkPrincipals.Unmarshal(data[index:postIndex]); err != nil { - return err - } - 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 fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*ContainerInfo_DockerInfo_PortMapping) + if !ok { + return fmt.Errorf("that is not of type *ContainerInfo_DockerInfo_PortMapping") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *ContainerInfo_DockerInfo_PortMapping but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *ContainerInfo_DockerInfo_PortMappingbut is not nil && this == nil") + } + if this.HostPort != nil && that1.HostPort != nil { + if *this.HostPort != *that1.HostPort { + return fmt.Errorf("HostPort this(%v) Not Equal that(%v)", *this.HostPort, *that1.HostPort) + } + } else if this.HostPort != nil { + return fmt.Errorf("this.HostPort == nil && that.HostPort != nil") + } else if that1.HostPort != nil { + return fmt.Errorf("HostPort this(%v) Not Equal that(%v)", this.HostPort, that1.HostPort) + } + if this.ContainerPort != nil && that1.ContainerPort != nil { + if *this.ContainerPort != *that1.ContainerPort { + return fmt.Errorf("ContainerPort this(%v) Not Equal that(%v)", *this.ContainerPort, *that1.ContainerPort) + } + } else if this.ContainerPort != nil { + return fmt.Errorf("this.ContainerPort == nil && that.ContainerPort != nil") + } else if that1.ContainerPort != nil { + return fmt.Errorf("ContainerPort this(%v) Not Equal that(%v)", this.ContainerPort, that1.ContainerPort) + } + if this.Protocol != nil && that1.Protocol != nil { + if *this.Protocol != *that1.Protocol { + return fmt.Errorf("Protocol this(%v) Not Equal that(%v)", *this.Protocol, *that1.Protocol) } + } else if this.Protocol != nil { + return fmt.Errorf("this.Protocol == nil && that.Protocol != nil") + } else if that1.Protocol != nil { + return fmt.Errorf("Protocol this(%v) Not Equal that(%v)", this.Protocol, that1.Protocol) + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) } return nil } -func (m *ACLs) 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 != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Permissive", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - b := bool(v != 0) - m.Permissive = &b - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RegisterFrameworks", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.RegisterFrameworks = append(m.RegisterFrameworks, &ACL_RegisterFramework{}) - m.RegisterFrameworks[len(m.RegisterFrameworks)-1].Unmarshal(data[index:postIndex]) - index = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RunTasks", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.RunTasks = append(m.RunTasks, &ACL_RunTask{}) - m.RunTasks[len(m.RunTasks)-1].Unmarshal(data[index:postIndex]) - index = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ShutdownFrameworks", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ShutdownFrameworks = append(m.ShutdownFrameworks, &ACL_ShutdownFramework{}) - m.ShutdownFrameworks[len(m.ShutdownFrameworks)-1].Unmarshal(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 +func (this *ContainerInfo_DockerInfo_PortMapping) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true } + return false + } + + that1, ok := that.(*ContainerInfo_DockerInfo_PortMapping) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if this.HostPort != nil && that1.HostPort != nil { + if *this.HostPort != *that1.HostPort { + return false + } + } else if this.HostPort != nil { + return false + } else if that1.HostPort != nil { + return false + } + if this.ContainerPort != nil && that1.ContainerPort != nil { + if *this.ContainerPort != *that1.ContainerPort { + return false + } + } else if this.ContainerPort != nil { + return false + } else if that1.ContainerPort != nil { + return false + } + if this.Protocol != nil && that1.Protocol != nil { + if *this.Protocol != *that1.Protocol { + return false + } + } else if this.Protocol != nil { + return false + } else if that1.Protocol != nil { + return false + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *Labels) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*Labels) + if !ok { + return fmt.Errorf("that is not of type *Labels") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *Labels but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *Labelsbut is not nil && this == nil") + } + if len(this.Labels) != len(that1.Labels) { + return fmt.Errorf("Labels this(%v) Not Equal that(%v)", len(this.Labels), len(that1.Labels)) + } + for i := range this.Labels { + if !this.Labels[i].Equal(that1.Labels[i]) { + return fmt.Errorf("Labels this[%v](%v) Not Equal that[%v](%v)", i, this.Labels[i], i, that1.Labels[i]) + } + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) } return nil } -func (m *RateLimit) 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 - } +func (this *Labels) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field Qps", wireType) - } - var v uint64 - i := index + 8 - if i > l { - return io.ErrUnexpectedEOF - } - index = i - v = uint64(data[i-8]) - v |= uint64(data[i-7]) << 8 - v |= uint64(data[i-6]) << 16 - v |= uint64(data[i-5]) << 24 - v |= uint64(data[i-4]) << 32 - v |= uint64(data[i-3]) << 40 - v |= uint64(data[i-2]) << 48 - v |= uint64(data[i-1]) << 56 - v2 := math1.Float64frombits(v) - m.Qps = &v2 - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Principal", 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 - } - s := string(data[index:postIndex]) - m.Principal = &s - index = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Capacity", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Capacity = &v - 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 false + } + + that1, ok := that.(*Labels) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if len(this.Labels) != len(that1.Labels) { + return false + } + for i := range this.Labels { + if !this.Labels[i].Equal(that1.Labels[i]) { + return false + } + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *Label) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*Label) + if !ok { + return fmt.Errorf("that is not of type *Label") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *Label but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *Labelbut is not nil && this == nil") + } + if this.Key != nil && that1.Key != nil { + if *this.Key != *that1.Key { + return fmt.Errorf("Key this(%v) Not Equal that(%v)", *this.Key, *that1.Key) + } + } else if this.Key != nil { + return fmt.Errorf("this.Key == nil && that.Key != nil") + } else if that1.Key != nil { + return fmt.Errorf("Key this(%v) Not Equal that(%v)", this.Key, that1.Key) + } + if this.Value != nil && that1.Value != nil { + if *this.Value != *that1.Value { + return fmt.Errorf("Value this(%v) Not Equal that(%v)", *this.Value, *that1.Value) } + } else if this.Value != nil { + return fmt.Errorf("this.Value == nil && that.Value != nil") + } else if that1.Value != nil { + return fmt.Errorf("Value this(%v) Not Equal that(%v)", this.Value, that1.Value) + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) } return nil } -func (m *RateLimits) 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 - } +func (this *Label) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Limits", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Limits = append(m.Limits, &RateLimit{}) - m.Limits[len(m.Limits)-1].Unmarshal(data[index:postIndex]) - index = postIndex - case 2: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field AggregateDefaultQps", wireType) - } - var v uint64 - i := index + 8 - if i > l { - return io.ErrUnexpectedEOF - } - index = i - v = uint64(data[i-8]) - v |= uint64(data[i-7]) << 8 - v |= uint64(data[i-6]) << 16 - v |= uint64(data[i-5]) << 24 - v |= uint64(data[i-4]) << 32 - v |= uint64(data[i-3]) << 40 - v |= uint64(data[i-2]) << 48 - v |= uint64(data[i-1]) << 56 - v2 := math1.Float64frombits(v) - m.AggregateDefaultQps = &v2 - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AggregateDefaultCapacity", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.AggregateDefaultCapacity = &v - 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 false + } + + that1, ok := that.(*Label) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true } + return false + } else if this == nil { + return false } - return nil + if this.Key != nil && that1.Key != nil { + if *this.Key != *that1.Key { + return false + } + } else if this.Key != nil { + return false + } else if that1.Key != nil { + return false + } + if this.Value != nil && that1.Value != nil { + if *this.Value != *that1.Value { + return false + } + } else if this.Value != nil { + return false + } else if that1.Value != nil { + return false + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true } -func (m *Volume) 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 - } +func (this *Port) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ContainerPath", 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 - } - s := string(data[index:postIndex]) - m.ContainerPath = &s - index = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field HostPath", 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 - } - s := string(data[index:postIndex]) - m.HostPath = &s - index = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Mode", wireType) - } - var v Volume_Mode - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (Volume_Mode(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Mode = &v - 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 fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*Port) + if !ok { + return fmt.Errorf("that is not of type *Port") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *Port but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *Portbut is not nil && this == nil") + } + if this.Number != nil && that1.Number != nil { + if *this.Number != *that1.Number { + return fmt.Errorf("Number this(%v) Not Equal that(%v)", *this.Number, *that1.Number) + } + } else if this.Number != nil { + return fmt.Errorf("this.Number == nil && that.Number != nil") + } else if that1.Number != nil { + return fmt.Errorf("Number this(%v) Not Equal that(%v)", this.Number, that1.Number) + } + if this.Name != nil && that1.Name != nil { + if *this.Name != *that1.Name { + return fmt.Errorf("Name this(%v) Not Equal that(%v)", *this.Name, *that1.Name) } + } else if this.Name != nil { + return fmt.Errorf("this.Name == nil && that.Name != nil") + } else if that1.Name != nil { + return fmt.Errorf("Name this(%v) Not Equal that(%v)", this.Name, that1.Name) + } + if this.Protocol != nil && that1.Protocol != nil { + if *this.Protocol != *that1.Protocol { + return fmt.Errorf("Protocol this(%v) Not Equal that(%v)", *this.Protocol, *that1.Protocol) + } + } else if this.Protocol != nil { + return fmt.Errorf("this.Protocol == nil && that.Protocol != nil") + } else if that1.Protocol != nil { + return fmt.Errorf("Protocol this(%v) Not Equal that(%v)", this.Protocol, that1.Protocol) + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) } return nil } -func (m *ContainerInfo) 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 - } +func (this *Port) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - var v ContainerInfo_Type - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (ContainerInfo_Type(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Type = &v - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Volumes", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Volumes = append(m.Volumes, &Volume{}) - m.Volumes[len(m.Volumes)-1].Unmarshal(data[index:postIndex]) - index = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Hostname", 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 - } - s := string(data[index:postIndex]) - m.Hostname = &s - index = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Docker", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Docker == nil { - m.Docker = &ContainerInfo_DockerInfo{} - } - if err := m.Docker.Unmarshal(data[index:postIndex]); err != nil { - return err - } - 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 false + } + + that1, ok := that.(*Port) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + if this.Number != nil && that1.Number != nil { + if *this.Number != *that1.Number { + return false + } + } else if this.Number != nil { + return false + } else if that1.Number != nil { + return false + } + if this.Name != nil && that1.Name != nil { + if *this.Name != *that1.Name { + return false + } + } else if this.Name != nil { + return false + } else if that1.Name != nil { + return false + } + if this.Protocol != nil && that1.Protocol != nil { + if *this.Protocol != *that1.Protocol { + return false } + } else if this.Protocol != nil { + return false + } else if that1.Protocol != nil { + return false } - return nil + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true } -func (m *ContainerInfo_DockerInfo) 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 - } +func (this *Ports) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Image", 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 - } - s := string(data[index:postIndex]) - m.Image = &s - index = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Network", wireType) - } - var v ContainerInfo_DockerInfo_Network - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (ContainerInfo_DockerInfo_Network(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Network = &v - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PortMappings", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.PortMappings = append(m.PortMappings, &ContainerInfo_DockerInfo_PortMapping{}) - m.PortMappings[len(m.PortMappings)-1].Unmarshal(data[index:postIndex]) - index = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Privileged", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - b := bool(v != 0) - m.Privileged = &b - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Parameters", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Parameters = append(m.Parameters, &Parameter{}) - m.Parameters[len(m.Parameters)-1].Unmarshal(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 fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*Ports) + if !ok { + return fmt.Errorf("that is not of type *Ports") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *Ports but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *Portsbut is not nil && this == nil") + } + if len(this.Ports) != len(that1.Ports) { + return fmt.Errorf("Ports this(%v) Not Equal that(%v)", len(this.Ports), len(that1.Ports)) + } + for i := range this.Ports { + if !this.Ports[i].Equal(that1.Ports[i]) { + return fmt.Errorf("Ports this[%v](%v) Not Equal that[%v](%v)", i, this.Ports[i], i, that1.Ports[i]) } } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + } return nil } -func (m *ContainerInfo_DockerInfo_PortMapping) 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 - } +func (this *Ports) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field HostPort", wireType) - } - var v uint32 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint32(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.HostPort = &v - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ContainerPort", wireType) - } - var v uint32 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (uint32(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.ContainerPort = &v - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Protocol", 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 - } - s := string(data[index:postIndex]) - m.Protocol = &s - 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 false + } + + that1, ok := that.(*Ports) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true } + return false + } else if this == nil { + return false } - return nil + if len(this.Ports) != len(that1.Ports) { + return false + } + for i := range this.Ports { + if !this.Ports[i].Equal(that1.Ports[i]) { + return false + } + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true } -func (this *FrameworkID) String() string { - if this == nil { - return "nil" +func (this *DiscoveryInfo) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } + + that1, ok := that.(*DiscoveryInfo) + if !ok { + return fmt.Errorf("that is not of type *DiscoveryInfo") + } + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *DiscoveryInfo but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *DiscoveryInfobut is not nil && this == nil") + } + if this.Visibility != nil && that1.Visibility != nil { + if *this.Visibility != *that1.Visibility { + return fmt.Errorf("Visibility this(%v) Not Equal that(%v)", *this.Visibility, *that1.Visibility) + } + } else if this.Visibility != nil { + return fmt.Errorf("this.Visibility == nil && that.Visibility != nil") + } else if that1.Visibility != nil { + return fmt.Errorf("Visibility this(%v) Not Equal that(%v)", this.Visibility, that1.Visibility) + } + if this.Name != nil && that1.Name != nil { + if *this.Name != *that1.Name { + return fmt.Errorf("Name this(%v) Not Equal that(%v)", *this.Name, *that1.Name) + } + } else if this.Name != nil { + return fmt.Errorf("this.Name == nil && that.Name != nil") + } else if that1.Name != nil { + return fmt.Errorf("Name this(%v) Not Equal that(%v)", this.Name, that1.Name) } - s := strings.Join([]string{`&FrameworkID{`, - `Value:` + valueToStringMesos(this.Value) + `,`, - `XXX_unrecognized:` + fmt1.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *OfferID) String() string { - if this == nil { - return "nil" + if this.Environment != nil && that1.Environment != nil { + if *this.Environment != *that1.Environment { + return fmt.Errorf("Environment this(%v) Not Equal that(%v)", *this.Environment, *that1.Environment) + } + } else if this.Environment != nil { + return fmt.Errorf("this.Environment == nil && that.Environment != nil") + } else if that1.Environment != nil { + return fmt.Errorf("Environment this(%v) Not Equal that(%v)", this.Environment, that1.Environment) } - s := strings.Join([]string{`&OfferID{`, - `Value:` + valueToStringMesos(this.Value) + `,`, - `XXX_unrecognized:` + fmt1.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *SlaveID) String() string { - if this == nil { - return "nil" + if this.Location != nil && that1.Location != nil { + if *this.Location != *that1.Location { + return fmt.Errorf("Location this(%v) Not Equal that(%v)", *this.Location, *that1.Location) + } + } else if this.Location != nil { + return fmt.Errorf("this.Location == nil && that.Location != nil") + } else if that1.Location != nil { + return fmt.Errorf("Location this(%v) Not Equal that(%v)", this.Location, that1.Location) } - s := strings.Join([]string{`&SlaveID{`, - `Value:` + valueToStringMesos(this.Value) + `,`, - `XXX_unrecognized:` + fmt1.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *TaskID) String() string { - if this == nil { - return "nil" + if this.Version != nil && that1.Version != nil { + if *this.Version != *that1.Version { + return fmt.Errorf("Version this(%v) Not Equal that(%v)", *this.Version, *that1.Version) + } + } else if this.Version != nil { + return fmt.Errorf("this.Version == nil && that.Version != nil") + } else if that1.Version != nil { + return fmt.Errorf("Version this(%v) Not Equal that(%v)", this.Version, that1.Version) } - s := strings.Join([]string{`&TaskID{`, - `Value:` + valueToStringMesos(this.Value) + `,`, - `XXX_unrecognized:` + fmt1.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *ExecutorID) String() string { - if this == nil { - return "nil" + if !this.Ports.Equal(that1.Ports) { + return fmt.Errorf("Ports this(%v) Not Equal that(%v)", this.Ports, that1.Ports) } - s := strings.Join([]string{`&ExecutorID{`, - `Value:` + valueToStringMesos(this.Value) + `,`, - `XXX_unrecognized:` + fmt1.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *ContainerID) String() string { - if this == nil { - return "nil" + if !this.Labels.Equal(that1.Labels) { + return fmt.Errorf("Labels this(%v) Not Equal that(%v)", this.Labels, that1.Labels) } - s := strings.Join([]string{`&ContainerID{`, - `Value:` + valueToStringMesos(this.Value) + `,`, - `XXX_unrecognized:` + fmt1.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *FrameworkInfo) String() string { - if this == nil { - return "nil" + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) } - s := strings.Join([]string{`&FrameworkInfo{`, - `User:` + valueToStringMesos(this.User) + `,`, - `Name:` + valueToStringMesos(this.Name) + `,`, - `Id:` + strings.Replace(fmt1.Sprintf("%v", this.Id), "FrameworkID", "FrameworkID", 1) + `,`, - `FailoverTimeout:` + valueToStringMesos(this.FailoverTimeout) + `,`, - `Checkpoint:` + valueToStringMesos(this.Checkpoint) + `,`, - `Role:` + valueToStringMesos(this.Role) + `,`, - `Hostname:` + valueToStringMesos(this.Hostname) + `,`, - `Principal:` + valueToStringMesos(this.Principal) + `,`, - `WebuiUrl:` + valueToStringMesos(this.WebuiUrl) + `,`, - `XXX_unrecognized:` + fmt1.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s + return nil } -func (this *HealthCheck) String() string { - if this == nil { - return "nil" +func (this *DiscoveryInfo) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false } - s := strings.Join([]string{`&HealthCheck{`, - `Http:` + strings.Replace(fmt1.Sprintf("%v", this.Http), "HealthCheck_HTTP", "HealthCheck_HTTP", 1) + `,`, - `DelaySeconds:` + valueToStringMesos(this.DelaySeconds) + `,`, - `IntervalSeconds:` + valueToStringMesos(this.IntervalSeconds) + `,`, - `TimeoutSeconds:` + valueToStringMesos(this.TimeoutSeconds) + `,`, - `ConsecutiveFailures:` + valueToStringMesos(this.ConsecutiveFailures) + `,`, - `GracePeriodSeconds:` + valueToStringMesos(this.GracePeriodSeconds) + `,`, - `Command:` + strings.Replace(fmt1.Sprintf("%v", this.Command), "CommandInfo", "CommandInfo", 1) + `,`, - `XXX_unrecognized:` + fmt1.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *HealthCheck_HTTP) String() string { - if this == nil { - return "nil" + + that1, ok := that.(*DiscoveryInfo) + if !ok { + return false } - s := strings.Join([]string{`&HealthCheck_HTTP{`, - `Port:` + valueToStringMesos(this.Port) + `,`, - `Path:` + valueToStringMesos(this.Path) + `,`, - `Statuses:` + fmt1.Sprintf("%v", this.Statuses) + `,`, - `XXX_unrecognized:` + fmt1.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *CommandInfo) String() string { - if this == nil { - return "nil" + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false } - s := strings.Join([]string{`&CommandInfo{`, - `Container:` + strings.Replace(fmt1.Sprintf("%v", this.Container), "CommandInfo_ContainerInfo", "CommandInfo_ContainerInfo", 1) + `,`, - `Uris:` + strings.Replace(fmt1.Sprintf("%v", this.Uris), "CommandInfo_URI", "CommandInfo_URI", 1) + `,`, - `Environment:` + strings.Replace(fmt1.Sprintf("%v", this.Environment), "Environment", "Environment", 1) + `,`, - `Shell:` + valueToStringMesos(this.Shell) + `,`, - `Value:` + valueToStringMesos(this.Value) + `,`, - `Arguments:` + fmt1.Sprintf("%v", this.Arguments) + `,`, - `User:` + valueToStringMesos(this.User) + `,`, - `XXX_unrecognized:` + fmt1.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *CommandInfo_URI) String() string { - if this == nil { - return "nil" + if this.Visibility != nil && that1.Visibility != nil { + if *this.Visibility != *that1.Visibility { + return false + } + } else if this.Visibility != nil { + return false + } else if that1.Visibility != nil { + return false } - s := strings.Join([]string{`&CommandInfo_URI{`, - `Value:` + valueToStringMesos(this.Value) + `,`, - `Executable:` + valueToStringMesos(this.Executable) + `,`, - `Extract:` + valueToStringMesos(this.Extract) + `,`, - `XXX_unrecognized:` + fmt1.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *CommandInfo_ContainerInfo) String() string { - if this == nil { - return "nil" + if this.Name != nil && that1.Name != nil { + if *this.Name != *that1.Name { + return false + } + } else if this.Name != nil { + return false + } else if that1.Name != nil { + return false } - s := strings.Join([]string{`&CommandInfo_ContainerInfo{`, - `Image:` + valueToStringMesos(this.Image) + `,`, - `Options:` + fmt1.Sprintf("%v", this.Options) + `,`, - `XXX_unrecognized:` + fmt1.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *ExecutorInfo) String() string { - if this == nil { - return "nil" + if this.Environment != nil && that1.Environment != nil { + if *this.Environment != *that1.Environment { + return false + } + } else if this.Environment != nil { + return false + } else if that1.Environment != nil { + return false } - s := strings.Join([]string{`&ExecutorInfo{`, - `ExecutorId:` + strings.Replace(fmt1.Sprintf("%v", this.ExecutorId), "ExecutorID", "ExecutorID", 1) + `,`, - `FrameworkId:` + strings.Replace(fmt1.Sprintf("%v", this.FrameworkId), "FrameworkID", "FrameworkID", 1) + `,`, - `Command:` + strings.Replace(fmt1.Sprintf("%v", this.Command), "CommandInfo", "CommandInfo", 1) + `,`, - `Container:` + strings.Replace(fmt1.Sprintf("%v", this.Container), "ContainerInfo", "ContainerInfo", 1) + `,`, - `Resources:` + strings.Replace(fmt1.Sprintf("%v", this.Resources), "Resource", "Resource", 1) + `,`, - `Name:` + valueToStringMesos(this.Name) + `,`, - `Source:` + valueToStringMesos(this.Source) + `,`, - `Data:` + valueToStringMesos(this.Data) + `,`, - `XXX_unrecognized:` + fmt1.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *MasterInfo) String() string { - if this == nil { - return "nil" + if this.Location != nil && that1.Location != nil { + if *this.Location != *that1.Location { + return false + } + } else if this.Location != nil { + return false + } else if that1.Location != nil { + return false } - s := strings.Join([]string{`&MasterInfo{`, - `Id:` + valueToStringMesos(this.Id) + `,`, - `Ip:` + valueToStringMesos(this.Ip) + `,`, - `Port:` + valueToStringMesos(this.Port) + `,`, - `Pid:` + valueToStringMesos(this.Pid) + `,`, - `Hostname:` + valueToStringMesos(this.Hostname) + `,`, - `XXX_unrecognized:` + fmt1.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *SlaveInfo) String() string { - if this == nil { - return "nil" + if this.Version != nil && that1.Version != nil { + if *this.Version != *that1.Version { + return false + } + } else if this.Version != nil { + return false + } else if that1.Version != nil { + return false } - s := strings.Join([]string{`&SlaveInfo{`, - `Hostname:` + valueToStringMesos(this.Hostname) + `,`, - `Port:` + valueToStringMesos(this.Port) + `,`, - `Resources:` + strings.Replace(fmt1.Sprintf("%v", this.Resources), "Resource", "Resource", 1) + `,`, - `Attributes:` + strings.Replace(fmt1.Sprintf("%v", this.Attributes), "Attribute", "Attribute", 1) + `,`, - `Id:` + strings.Replace(fmt1.Sprintf("%v", this.Id), "SlaveID", "SlaveID", 1) + `,`, - `Checkpoint:` + valueToStringMesos(this.Checkpoint) + `,`, - `XXX_unrecognized:` + fmt1.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *Value) String() string { - if this == nil { - return "nil" + if !this.Ports.Equal(that1.Ports) { + return false } - s := strings.Join([]string{`&Value{`, - `Type:` + valueToStringMesos(this.Type) + `,`, - `Scalar:` + strings.Replace(fmt1.Sprintf("%v", this.Scalar), "Value_Scalar", "Value_Scalar", 1) + `,`, - `Ranges:` + strings.Replace(fmt1.Sprintf("%v", this.Ranges), "Value_Ranges", "Value_Ranges", 1) + `,`, - `Set:` + strings.Replace(fmt1.Sprintf("%v", this.Set), "Value_Set", "Value_Set", 1) + `,`, - `Text:` + strings.Replace(fmt1.Sprintf("%v", this.Text), "Value_Text", "Value_Text", 1) + `,`, - `XXX_unrecognized:` + fmt1.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *Value_Scalar) String() string { - if this == nil { - return "nil" + if !this.Labels.Equal(that1.Labels) { + return false } - s := strings.Join([]string{`&Value_Scalar{`, - `Value:` + valueToStringMesos(this.Value) + `,`, - `XXX_unrecognized:` + fmt1.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *Value_Range) String() string { - if this == nil { - return "nil" + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false } - s := strings.Join([]string{`&Value_Range{`, - `Begin:` + valueToStringMesos(this.Begin) + `,`, - `End:` + valueToStringMesos(this.End) + `,`, - `XXX_unrecognized:` + fmt1.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s + return true } -func (this *Value_Ranges) String() string { +func (this *FrameworkID) GoString() string { if this == nil { return "nil" } - s := strings.Join([]string{`&Value_Ranges{`, - `Range:` + strings.Replace(fmt1.Sprintf("%v", this.Range), "Value_Range", "Value_Range", 1) + `,`, - `XXX_unrecognized:` + fmt1.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *Value_Set) String() string { - if this == nil { - return "nil" + s := make([]string, 0, 5) + s = append(s, "&mesosproto.FrameworkID{") + if this.Value != nil { + s = append(s, "Value: "+valueToGoStringMesos(this.Value, "string")+",\n") } - s := strings.Join([]string{`&Value_Set{`, - `Item:` + fmt1.Sprintf("%v", this.Item) + `,`, - `XXX_unrecognized:` + fmt1.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") } -func (this *Value_Text) String() string { +func (this *OfferID) GoString() string { if this == nil { - return "nil" - } - s := strings.Join([]string{`&Value_Text{`, - `Value:` + valueToStringMesos(this.Value) + `,`, - `XXX_unrecognized:` + fmt1.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s + return "nil" + } + s := make([]string, 0, 5) + s = append(s, "&mesosproto.OfferID{") + if this.Value != nil { + s = append(s, "Value: "+valueToGoStringMesos(this.Value, "string")+",\n") + } + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") } -func (this *Attribute) String() string { +func (this *SlaveID) GoString() string { if this == nil { return "nil" } - s := strings.Join([]string{`&Attribute{`, - `Name:` + valueToStringMesos(this.Name) + `,`, - `Type:` + valueToStringMesos(this.Type) + `,`, - `Scalar:` + strings.Replace(fmt1.Sprintf("%v", this.Scalar), "Value_Scalar", "Value_Scalar", 1) + `,`, - `Ranges:` + strings.Replace(fmt1.Sprintf("%v", this.Ranges), "Value_Ranges", "Value_Ranges", 1) + `,`, - `Set:` + strings.Replace(fmt1.Sprintf("%v", this.Set), "Value_Set", "Value_Set", 1) + `,`, - `Text:` + strings.Replace(fmt1.Sprintf("%v", this.Text), "Value_Text", "Value_Text", 1) + `,`, - `XXX_unrecognized:` + fmt1.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s + s := make([]string, 0, 5) + s = append(s, "&mesosproto.SlaveID{") + if this.Value != nil { + s = append(s, "Value: "+valueToGoStringMesos(this.Value, "string")+",\n") + } + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") } -func (this *Resource) String() string { +func (this *TaskID) GoString() string { if this == nil { return "nil" } - s := strings.Join([]string{`&Resource{`, - `Name:` + valueToStringMesos(this.Name) + `,`, - `Type:` + valueToStringMesos(this.Type) + `,`, - `Scalar:` + strings.Replace(fmt1.Sprintf("%v", this.Scalar), "Value_Scalar", "Value_Scalar", 1) + `,`, - `Ranges:` + strings.Replace(fmt1.Sprintf("%v", this.Ranges), "Value_Ranges", "Value_Ranges", 1) + `,`, - `Set:` + strings.Replace(fmt1.Sprintf("%v", this.Set), "Value_Set", "Value_Set", 1) + `,`, - `Role:` + valueToStringMesos(this.Role) + `,`, - `XXX_unrecognized:` + fmt1.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s + s := make([]string, 0, 5) + s = append(s, "&mesosproto.TaskID{") + if this.Value != nil { + s = append(s, "Value: "+valueToGoStringMesos(this.Value, "string")+",\n") + } + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") } -func (this *ResourceStatistics) String() string { +func (this *ExecutorID) GoString() string { if this == nil { return "nil" } - s := strings.Join([]string{`&ResourceStatistics{`, - `Timestamp:` + valueToStringMesos(this.Timestamp) + `,`, - `CpusUserTimeSecs:` + valueToStringMesos(this.CpusUserTimeSecs) + `,`, - `CpusSystemTimeSecs:` + valueToStringMesos(this.CpusSystemTimeSecs) + `,`, - `CpusLimit:` + valueToStringMesos(this.CpusLimit) + `,`, - `CpusNrPeriods:` + valueToStringMesos(this.CpusNrPeriods) + `,`, - `CpusNrThrottled:` + valueToStringMesos(this.CpusNrThrottled) + `,`, - `CpusThrottledTimeSecs:` + valueToStringMesos(this.CpusThrottledTimeSecs) + `,`, - `MemRssBytes:` + valueToStringMesos(this.MemRssBytes) + `,`, - `MemLimitBytes:` + valueToStringMesos(this.MemLimitBytes) + `,`, - `MemFileBytes:` + valueToStringMesos(this.MemFileBytes) + `,`, - `MemAnonBytes:` + valueToStringMesos(this.MemAnonBytes) + `,`, - `MemMappedFileBytes:` + valueToStringMesos(this.MemMappedFileBytes) + `,`, - `Perf:` + strings.Replace(fmt1.Sprintf("%v", this.Perf), "PerfStatistics", "PerfStatistics", 1) + `,`, - `NetRxPackets:` + valueToStringMesos(this.NetRxPackets) + `,`, - `NetRxBytes:` + valueToStringMesos(this.NetRxBytes) + `,`, - `NetRxErrors:` + valueToStringMesos(this.NetRxErrors) + `,`, - `NetRxDropped:` + valueToStringMesos(this.NetRxDropped) + `,`, - `NetTxPackets:` + valueToStringMesos(this.NetTxPackets) + `,`, - `NetTxBytes:` + valueToStringMesos(this.NetTxBytes) + `,`, - `NetTxErrors:` + valueToStringMesos(this.NetTxErrors) + `,`, - `NetTxDropped:` + valueToStringMesos(this.NetTxDropped) + `,`, - `NetTcpRttMicrosecsP50:` + valueToStringMesos(this.NetTcpRttMicrosecsP50) + `,`, - `NetTcpRttMicrosecsP90:` + valueToStringMesos(this.NetTcpRttMicrosecsP90) + `,`, - `NetTcpRttMicrosecsP95:` + valueToStringMesos(this.NetTcpRttMicrosecsP95) + `,`, - `NetTcpRttMicrosecsP99:` + valueToStringMesos(this.NetTcpRttMicrosecsP99) + `,`, - `XXX_unrecognized:` + fmt1.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s + s := make([]string, 0, 5) + s = append(s, "&mesosproto.ExecutorID{") + if this.Value != nil { + s = append(s, "Value: "+valueToGoStringMesos(this.Value, "string")+",\n") + } + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") } -func (this *ResourceUsage) String() string { +func (this *ContainerID) GoString() string { if this == nil { return "nil" } - s := strings.Join([]string{`&ResourceUsage{`, - `SlaveId:` + strings.Replace(fmt1.Sprintf("%v", this.SlaveId), "SlaveID", "SlaveID", 1) + `,`, - `FrameworkId:` + strings.Replace(fmt1.Sprintf("%v", this.FrameworkId), "FrameworkID", "FrameworkID", 1) + `,`, - `ExecutorId:` + strings.Replace(fmt1.Sprintf("%v", this.ExecutorId), "ExecutorID", "ExecutorID", 1) + `,`, - `ExecutorName:` + valueToStringMesos(this.ExecutorName) + `,`, - `TaskId:` + strings.Replace(fmt1.Sprintf("%v", this.TaskId), "TaskID", "TaskID", 1) + `,`, - `Statistics:` + strings.Replace(fmt1.Sprintf("%v", this.Statistics), "ResourceStatistics", "ResourceStatistics", 1) + `,`, - `XXX_unrecognized:` + fmt1.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s + s := make([]string, 0, 5) + s = append(s, "&mesosproto.ContainerID{") + if this.Value != nil { + s = append(s, "Value: "+valueToGoStringMesos(this.Value, "string")+",\n") + } + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") } -func (this *PerfStatistics) String() string { +func (this *FrameworkInfo) GoString() string { if this == nil { return "nil" } - s := strings.Join([]string{`&PerfStatistics{`, - `Timestamp:` + valueToStringMesos(this.Timestamp) + `,`, - `Duration:` + valueToStringMesos(this.Duration) + `,`, - `Cycles:` + valueToStringMesos(this.Cycles) + `,`, - `StalledCyclesFrontend:` + valueToStringMesos(this.StalledCyclesFrontend) + `,`, - `StalledCyclesBackend:` + valueToStringMesos(this.StalledCyclesBackend) + `,`, - `Instructions:` + valueToStringMesos(this.Instructions) + `,`, - `CacheReferences:` + valueToStringMesos(this.CacheReferences) + `,`, - `CacheMisses:` + valueToStringMesos(this.CacheMisses) + `,`, - `Branches:` + valueToStringMesos(this.Branches) + `,`, - `BranchMisses:` + valueToStringMesos(this.BranchMisses) + `,`, - `BusCycles:` + valueToStringMesos(this.BusCycles) + `,`, - `RefCycles:` + valueToStringMesos(this.RefCycles) + `,`, - `CpuClock:` + valueToStringMesos(this.CpuClock) + `,`, - `TaskClock:` + valueToStringMesos(this.TaskClock) + `,`, - `PageFaults:` + valueToStringMesos(this.PageFaults) + `,`, - `MinorFaults:` + valueToStringMesos(this.MinorFaults) + `,`, - `MajorFaults:` + valueToStringMesos(this.MajorFaults) + `,`, - `ContextSwitches:` + valueToStringMesos(this.ContextSwitches) + `,`, - `CpuMigrations:` + valueToStringMesos(this.CpuMigrations) + `,`, - `AlignmentFaults:` + valueToStringMesos(this.AlignmentFaults) + `,`, - `EmulationFaults:` + valueToStringMesos(this.EmulationFaults) + `,`, - `L1DcacheLoads:` + valueToStringMesos(this.L1DcacheLoads) + `,`, - `L1DcacheLoadMisses:` + valueToStringMesos(this.L1DcacheLoadMisses) + `,`, - `L1DcacheStores:` + valueToStringMesos(this.L1DcacheStores) + `,`, - `L1DcacheStoreMisses:` + valueToStringMesos(this.L1DcacheStoreMisses) + `,`, - `L1DcachePrefetches:` + valueToStringMesos(this.L1DcachePrefetches) + `,`, - `L1DcachePrefetchMisses:` + valueToStringMesos(this.L1DcachePrefetchMisses) + `,`, - `L1IcacheLoads:` + valueToStringMesos(this.L1IcacheLoads) + `,`, - `L1IcacheLoadMisses:` + valueToStringMesos(this.L1IcacheLoadMisses) + `,`, - `L1IcachePrefetches:` + valueToStringMesos(this.L1IcachePrefetches) + `,`, - `L1IcachePrefetchMisses:` + valueToStringMesos(this.L1IcachePrefetchMisses) + `,`, - `LlcLoads:` + valueToStringMesos(this.LlcLoads) + `,`, - `LlcLoadMisses:` + valueToStringMesos(this.LlcLoadMisses) + `,`, - `LlcStores:` + valueToStringMesos(this.LlcStores) + `,`, - `LlcStoreMisses:` + valueToStringMesos(this.LlcStoreMisses) + `,`, - `LlcPrefetches:` + valueToStringMesos(this.LlcPrefetches) + `,`, - `LlcPrefetchMisses:` + valueToStringMesos(this.LlcPrefetchMisses) + `,`, - `DtlbLoads:` + valueToStringMesos(this.DtlbLoads) + `,`, - `DtlbLoadMisses:` + valueToStringMesos(this.DtlbLoadMisses) + `,`, - `DtlbStores:` + valueToStringMesos(this.DtlbStores) + `,`, - `DtlbStoreMisses:` + valueToStringMesos(this.DtlbStoreMisses) + `,`, - `DtlbPrefetches:` + valueToStringMesos(this.DtlbPrefetches) + `,`, - `DtlbPrefetchMisses:` + valueToStringMesos(this.DtlbPrefetchMisses) + `,`, - `ItlbLoads:` + valueToStringMesos(this.ItlbLoads) + `,`, - `ItlbLoadMisses:` + valueToStringMesos(this.ItlbLoadMisses) + `,`, - `BranchLoads:` + valueToStringMesos(this.BranchLoads) + `,`, - `BranchLoadMisses:` + valueToStringMesos(this.BranchLoadMisses) + `,`, - `NodeLoads:` + valueToStringMesos(this.NodeLoads) + `,`, - `NodeLoadMisses:` + valueToStringMesos(this.NodeLoadMisses) + `,`, - `NodeStores:` + valueToStringMesos(this.NodeStores) + `,`, - `NodeStoreMisses:` + valueToStringMesos(this.NodeStoreMisses) + `,`, - `NodePrefetches:` + valueToStringMesos(this.NodePrefetches) + `,`, - `NodePrefetchMisses:` + valueToStringMesos(this.NodePrefetchMisses) + `,`, - `XXX_unrecognized:` + fmt1.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s + s := make([]string, 0, 14) + s = append(s, "&mesosproto.FrameworkInfo{") + if this.User != nil { + s = append(s, "User: "+valueToGoStringMesos(this.User, "string")+",\n") + } + if this.Name != nil { + s = append(s, "Name: "+valueToGoStringMesos(this.Name, "string")+",\n") + } + if this.Id != nil { + s = append(s, "Id: "+fmt.Sprintf("%#v", this.Id)+",\n") + } + if this.FailoverTimeout != nil { + s = append(s, "FailoverTimeout: "+valueToGoStringMesos(this.FailoverTimeout, "float64")+",\n") + } + if this.Checkpoint != nil { + s = append(s, "Checkpoint: "+valueToGoStringMesos(this.Checkpoint, "bool")+",\n") + } + if this.Role != nil { + s = append(s, "Role: "+valueToGoStringMesos(this.Role, "string")+",\n") + } + if this.Hostname != nil { + s = append(s, "Hostname: "+valueToGoStringMesos(this.Hostname, "string")+",\n") + } + if this.Principal != nil { + s = append(s, "Principal: "+valueToGoStringMesos(this.Principal, "string")+",\n") + } + if this.WebuiUrl != nil { + s = append(s, "WebuiUrl: "+valueToGoStringMesos(this.WebuiUrl, "string")+",\n") + } + if this.Capabilities != nil { + s = append(s, "Capabilities: "+fmt.Sprintf("%#v", this.Capabilities)+",\n") + } + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") } -func (this *Request) String() string { +func (this *FrameworkInfo_Capability) GoString() string { if this == nil { return "nil" } - s := strings.Join([]string{`&Request{`, - `SlaveId:` + strings.Replace(fmt1.Sprintf("%v", this.SlaveId), "SlaveID", "SlaveID", 1) + `,`, - `Resources:` + strings.Replace(fmt1.Sprintf("%v", this.Resources), "Resource", "Resource", 1) + `,`, - `XXX_unrecognized:` + fmt1.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s + s := make([]string, 0, 5) + s = append(s, "&mesosproto.FrameworkInfo_Capability{") + if this.Type != nil { + s = append(s, "Type: "+valueToGoStringMesos(this.Type, "mesosproto.FrameworkInfo_Capability_Type")+",\n") + } + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") } -func (this *Offer) String() string { +func (this *HealthCheck) GoString() string { if this == nil { return "nil" } - s := strings.Join([]string{`&Offer{`, - `Id:` + strings.Replace(fmt1.Sprintf("%v", this.Id), "OfferID", "OfferID", 1) + `,`, - `FrameworkId:` + strings.Replace(fmt1.Sprintf("%v", this.FrameworkId), "FrameworkID", "FrameworkID", 1) + `,`, - `SlaveId:` + strings.Replace(fmt1.Sprintf("%v", this.SlaveId), "SlaveID", "SlaveID", 1) + `,`, - `Hostname:` + valueToStringMesos(this.Hostname) + `,`, - `Resources:` + strings.Replace(fmt1.Sprintf("%v", this.Resources), "Resource", "Resource", 1) + `,`, - `Attributes:` + strings.Replace(fmt1.Sprintf("%v", this.Attributes), "Attribute", "Attribute", 1) + `,`, - `ExecutorIds:` + strings.Replace(fmt1.Sprintf("%v", this.ExecutorIds), "ExecutorID", "ExecutorID", 1) + `,`, - `XXX_unrecognized:` + fmt1.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s + s := make([]string, 0, 11) + s = append(s, "&mesosproto.HealthCheck{") + if this.Http != nil { + s = append(s, "Http: "+fmt.Sprintf("%#v", this.Http)+",\n") + } + if this.DelaySeconds != nil { + s = append(s, "DelaySeconds: "+valueToGoStringMesos(this.DelaySeconds, "float64")+",\n") + } + if this.IntervalSeconds != nil { + s = append(s, "IntervalSeconds: "+valueToGoStringMesos(this.IntervalSeconds, "float64")+",\n") + } + if this.TimeoutSeconds != nil { + s = append(s, "TimeoutSeconds: "+valueToGoStringMesos(this.TimeoutSeconds, "float64")+",\n") + } + if this.ConsecutiveFailures != nil { + s = append(s, "ConsecutiveFailures: "+valueToGoStringMesos(this.ConsecutiveFailures, "uint32")+",\n") + } + if this.GracePeriodSeconds != nil { + s = append(s, "GracePeriodSeconds: "+valueToGoStringMesos(this.GracePeriodSeconds, "float64")+",\n") + } + if this.Command != nil { + s = append(s, "Command: "+fmt.Sprintf("%#v", this.Command)+",\n") + } + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") } -func (this *TaskInfo) String() string { +func (this *HealthCheck_HTTP) GoString() string { if this == nil { return "nil" } - s := strings.Join([]string{`&TaskInfo{`, - `Name:` + valueToStringMesos(this.Name) + `,`, - `TaskId:` + strings.Replace(fmt1.Sprintf("%v", this.TaskId), "TaskID", "TaskID", 1) + `,`, - `SlaveId:` + strings.Replace(fmt1.Sprintf("%v", this.SlaveId), "SlaveID", "SlaveID", 1) + `,`, - `Resources:` + strings.Replace(fmt1.Sprintf("%v", this.Resources), "Resource", "Resource", 1) + `,`, - `Executor:` + strings.Replace(fmt1.Sprintf("%v", this.Executor), "ExecutorInfo", "ExecutorInfo", 1) + `,`, - `Command:` + strings.Replace(fmt1.Sprintf("%v", this.Command), "CommandInfo", "CommandInfo", 1) + `,`, - `Container:` + strings.Replace(fmt1.Sprintf("%v", this.Container), "ContainerInfo", "ContainerInfo", 1) + `,`, - `Data:` + valueToStringMesos(this.Data) + `,`, - `HealthCheck:` + strings.Replace(fmt1.Sprintf("%v", this.HealthCheck), "HealthCheck", "HealthCheck", 1) + `,`, - `XXX_unrecognized:` + fmt1.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s + s := make([]string, 0, 7) + s = append(s, "&mesosproto.HealthCheck_HTTP{") + if this.Port != nil { + s = append(s, "Port: "+valueToGoStringMesos(this.Port, "uint32")+",\n") + } + if this.Path != nil { + s = append(s, "Path: "+valueToGoStringMesos(this.Path, "string")+",\n") + } + if this.Statuses != nil { + s = append(s, "Statuses: "+fmt.Sprintf("%#v", this.Statuses)+",\n") + } + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") } -func (this *TaskStatus) String() string { +func (this *CommandInfo) GoString() string { if this == nil { return "nil" } - s := strings.Join([]string{`&TaskStatus{`, - `TaskId:` + strings.Replace(fmt1.Sprintf("%v", this.TaskId), "TaskID", "TaskID", 1) + `,`, - `State:` + valueToStringMesos(this.State) + `,`, - `Message:` + valueToStringMesos(this.Message) + `,`, - `Source:` + valueToStringMesos(this.Source) + `,`, - `Reason:` + valueToStringMesos(this.Reason) + `,`, - `Data:` + valueToStringMesos(this.Data) + `,`, - `SlaveId:` + strings.Replace(fmt1.Sprintf("%v", this.SlaveId), "SlaveID", "SlaveID", 1) + `,`, - `ExecutorId:` + strings.Replace(fmt1.Sprintf("%v", this.ExecutorId), "ExecutorID", "ExecutorID", 1) + `,`, - `Timestamp:` + valueToStringMesos(this.Timestamp) + `,`, - `Healthy:` + valueToStringMesos(this.Healthy) + `,`, - `XXX_unrecognized:` + fmt1.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s + s := make([]string, 0, 11) + s = append(s, "&mesosproto.CommandInfo{") + if this.Container != nil { + s = append(s, "Container: "+fmt.Sprintf("%#v", this.Container)+",\n") + } + if this.Uris != nil { + s = append(s, "Uris: "+fmt.Sprintf("%#v", this.Uris)+",\n") + } + if this.Environment != nil { + s = append(s, "Environment: "+fmt.Sprintf("%#v", this.Environment)+",\n") + } + if this.Shell != nil { + s = append(s, "Shell: "+valueToGoStringMesos(this.Shell, "bool")+",\n") + } + if this.Value != nil { + s = append(s, "Value: "+valueToGoStringMesos(this.Value, "string")+",\n") + } + if this.Arguments != nil { + s = append(s, "Arguments: "+fmt.Sprintf("%#v", this.Arguments)+",\n") + } + if this.User != nil { + s = append(s, "User: "+valueToGoStringMesos(this.User, "string")+",\n") + } + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") } -func (this *Filters) String() string { +func (this *CommandInfo_URI) GoString() string { if this == nil { return "nil" } - s := strings.Join([]string{`&Filters{`, - `RefuseSeconds:` + valueToStringMesos(this.RefuseSeconds) + `,`, - `XXX_unrecognized:` + fmt1.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s + s := make([]string, 0, 8) + s = append(s, "&mesosproto.CommandInfo_URI{") + if this.Value != nil { + s = append(s, "Value: "+valueToGoStringMesos(this.Value, "string")+",\n") + } + if this.Executable != nil { + s = append(s, "Executable: "+valueToGoStringMesos(this.Executable, "bool")+",\n") + } + if this.Extract != nil { + s = append(s, "Extract: "+valueToGoStringMesos(this.Extract, "bool")+",\n") + } + if this.Cache != nil { + s = append(s, "Cache: "+valueToGoStringMesos(this.Cache, "bool")+",\n") + } + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") } -func (this *Environment) String() string { +func (this *CommandInfo_ContainerInfo) GoString() string { if this == nil { return "nil" } - s := strings.Join([]string{`&Environment{`, - `Variables:` + strings.Replace(fmt1.Sprintf("%v", this.Variables), "Environment_Variable", "Environment_Variable", 1) + `,`, - `XXX_unrecognized:` + fmt1.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s + s := make([]string, 0, 6) + s = append(s, "&mesosproto.CommandInfo_ContainerInfo{") + if this.Image != nil { + s = append(s, "Image: "+valueToGoStringMesos(this.Image, "string")+",\n") + } + if this.Options != nil { + s = append(s, "Options: "+fmt.Sprintf("%#v", this.Options)+",\n") + } + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") } -func (this *Environment_Variable) String() string { +func (this *ExecutorInfo) GoString() string { if this == nil { return "nil" } - s := strings.Join([]string{`&Environment_Variable{`, - `Name:` + valueToStringMesos(this.Name) + `,`, - `Value:` + valueToStringMesos(this.Value) + `,`, - `XXX_unrecognized:` + fmt1.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s + s := make([]string, 0, 13) + s = append(s, "&mesosproto.ExecutorInfo{") + if this.ExecutorId != nil { + s = append(s, "ExecutorId: "+fmt.Sprintf("%#v", this.ExecutorId)+",\n") + } + if this.FrameworkId != nil { + s = append(s, "FrameworkId: "+fmt.Sprintf("%#v", this.FrameworkId)+",\n") + } + if this.Command != nil { + s = append(s, "Command: "+fmt.Sprintf("%#v", this.Command)+",\n") + } + if this.Container != nil { + s = append(s, "Container: "+fmt.Sprintf("%#v", this.Container)+",\n") + } + if this.Resources != nil { + s = append(s, "Resources: "+fmt.Sprintf("%#v", this.Resources)+",\n") + } + if this.Name != nil { + s = append(s, "Name: "+valueToGoStringMesos(this.Name, "string")+",\n") + } + if this.Source != nil { + s = append(s, "Source: "+valueToGoStringMesos(this.Source, "string")+",\n") + } + if this.Data != nil { + s = append(s, "Data: "+valueToGoStringMesos(this.Data, "byte")+",\n") + } + if this.Discovery != nil { + s = append(s, "Discovery: "+fmt.Sprintf("%#v", this.Discovery)+",\n") + } + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") } -func (this *Parameter) String() string { +func (this *MasterInfo) GoString() string { if this == nil { return "nil" } - s := strings.Join([]string{`&Parameter{`, - `Key:` + valueToStringMesos(this.Key) + `,`, - `Value:` + valueToStringMesos(this.Value) + `,`, - `XXX_unrecognized:` + fmt1.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s + s := make([]string, 0, 10) + s = append(s, "&mesosproto.MasterInfo{") + if this.Id != nil { + s = append(s, "Id: "+valueToGoStringMesos(this.Id, "string")+",\n") + } + if this.Ip != nil { + s = append(s, "Ip: "+valueToGoStringMesos(this.Ip, "uint32")+",\n") + } + if this.Port != nil { + s = append(s, "Port: "+valueToGoStringMesos(this.Port, "uint32")+",\n") + } + if this.Pid != nil { + s = append(s, "Pid: "+valueToGoStringMesos(this.Pid, "string")+",\n") + } + if this.Hostname != nil { + s = append(s, "Hostname: "+valueToGoStringMesos(this.Hostname, "string")+",\n") + } + if this.Version != nil { + s = append(s, "Version: "+valueToGoStringMesos(this.Version, "string")+",\n") + } + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") } -func (this *Parameters) String() string { +func (this *SlaveInfo) GoString() string { if this == nil { return "nil" } - s := strings.Join([]string{`&Parameters{`, - `Parameter:` + strings.Replace(fmt1.Sprintf("%v", this.Parameter), "Parameter", "Parameter", 1) + `,`, - `XXX_unrecognized:` + fmt1.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s + s := make([]string, 0, 10) + s = append(s, "&mesosproto.SlaveInfo{") + if this.Hostname != nil { + s = append(s, "Hostname: "+valueToGoStringMesos(this.Hostname, "string")+",\n") + } + if this.Port != nil { + s = append(s, "Port: "+valueToGoStringMesos(this.Port, "int32")+",\n") + } + if this.Resources != nil { + s = append(s, "Resources: "+fmt.Sprintf("%#v", this.Resources)+",\n") + } + if this.Attributes != nil { + s = append(s, "Attributes: "+fmt.Sprintf("%#v", this.Attributes)+",\n") + } + if this.Id != nil { + s = append(s, "Id: "+fmt.Sprintf("%#v", this.Id)+",\n") + } + if this.Checkpoint != nil { + s = append(s, "Checkpoint: "+valueToGoStringMesos(this.Checkpoint, "bool")+",\n") + } + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") } -func (this *Credential) String() string { +func (this *Value) GoString() string { if this == nil { return "nil" } - s := strings.Join([]string{`&Credential{`, - `Principal:` + valueToStringMesos(this.Principal) + `,`, - `Secret:` + valueToStringMesos(this.Secret) + `,`, - `XXX_unrecognized:` + fmt1.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s + s := make([]string, 0, 9) + s = append(s, "&mesosproto.Value{") + if this.Type != nil { + s = append(s, "Type: "+valueToGoStringMesos(this.Type, "mesosproto.Value_Type")+",\n") + } + if this.Scalar != nil { + s = append(s, "Scalar: "+fmt.Sprintf("%#v", this.Scalar)+",\n") + } + if this.Ranges != nil { + s = append(s, "Ranges: "+fmt.Sprintf("%#v", this.Ranges)+",\n") + } + if this.Set != nil { + s = append(s, "Set: "+fmt.Sprintf("%#v", this.Set)+",\n") + } + if this.Text != nil { + s = append(s, "Text: "+fmt.Sprintf("%#v", this.Text)+",\n") + } + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") } -func (this *Credentials) String() string { +func (this *Value_Scalar) GoString() string { if this == nil { return "nil" } - s := strings.Join([]string{`&Credentials{`, - `Credentials:` + strings.Replace(fmt1.Sprintf("%v", this.Credentials), "Credential", "Credential", 1) + `,`, - `XXX_unrecognized:` + fmt1.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s + s := make([]string, 0, 5) + s = append(s, "&mesosproto.Value_Scalar{") + if this.Value != nil { + s = append(s, "Value: "+valueToGoStringMesos(this.Value, "float64")+",\n") + } + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") } -func (this *ACL) String() string { +func (this *Value_Range) GoString() string { if this == nil { return "nil" } - s := strings.Join([]string{`&ACL{`, - `XXX_unrecognized:` + fmt1.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s + s := make([]string, 0, 6) + s = append(s, "&mesosproto.Value_Range{") + if this.Begin != nil { + s = append(s, "Begin: "+valueToGoStringMesos(this.Begin, "uint64")+",\n") + } + if this.End != nil { + s = append(s, "End: "+valueToGoStringMesos(this.End, "uint64")+",\n") + } + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") } -func (this *ACL_Entity) String() string { +func (this *Value_Ranges) GoString() string { if this == nil { return "nil" } - s := strings.Join([]string{`&ACL_Entity{`, - `Type:` + valueToStringMesos(this.Type) + `,`, - `Values:` + fmt1.Sprintf("%v", this.Values) + `,`, - `XXX_unrecognized:` + fmt1.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s + s := make([]string, 0, 5) + s = append(s, "&mesosproto.Value_Ranges{") + if this.Range != nil { + s = append(s, "Range: "+fmt.Sprintf("%#v", this.Range)+",\n") + } + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") } -func (this *ACL_RegisterFramework) String() string { +func (this *Value_Set) GoString() string { if this == nil { return "nil" } - s := strings.Join([]string{`&ACL_RegisterFramework{`, - `Principals:` + strings.Replace(fmt1.Sprintf("%v", this.Principals), "ACL_Entity", "ACL_Entity", 1) + `,`, - `Roles:` + strings.Replace(fmt1.Sprintf("%v", this.Roles), "ACL_Entity", "ACL_Entity", 1) + `,`, - `XXX_unrecognized:` + fmt1.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s + s := make([]string, 0, 5) + s = append(s, "&mesosproto.Value_Set{") + if this.Item != nil { + s = append(s, "Item: "+fmt.Sprintf("%#v", this.Item)+",\n") + } + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") } -func (this *ACL_RunTask) String() string { +func (this *Value_Text) GoString() string { if this == nil { return "nil" } - s := strings.Join([]string{`&ACL_RunTask{`, - `Principals:` + strings.Replace(fmt1.Sprintf("%v", this.Principals), "ACL_Entity", "ACL_Entity", 1) + `,`, - `Users:` + strings.Replace(fmt1.Sprintf("%v", this.Users), "ACL_Entity", "ACL_Entity", 1) + `,`, - `XXX_unrecognized:` + fmt1.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s + s := make([]string, 0, 5) + s = append(s, "&mesosproto.Value_Text{") + if this.Value != nil { + s = append(s, "Value: "+valueToGoStringMesos(this.Value, "string")+",\n") + } + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") } -func (this *ACL_ShutdownFramework) String() string { +func (this *Attribute) GoString() string { if this == nil { return "nil" } - s := strings.Join([]string{`&ACL_ShutdownFramework{`, - `Principals:` + strings.Replace(fmt1.Sprintf("%v", this.Principals), "ACL_Entity", "ACL_Entity", 1) + `,`, - `FrameworkPrincipals:` + strings.Replace(fmt1.Sprintf("%v", this.FrameworkPrincipals), "ACL_Entity", "ACL_Entity", 1) + `,`, - `XXX_unrecognized:` + fmt1.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s + s := make([]string, 0, 10) + s = append(s, "&mesosproto.Attribute{") + if this.Name != nil { + s = append(s, "Name: "+valueToGoStringMesos(this.Name, "string")+",\n") + } + if this.Type != nil { + s = append(s, "Type: "+valueToGoStringMesos(this.Type, "mesosproto.Value_Type")+",\n") + } + if this.Scalar != nil { + s = append(s, "Scalar: "+fmt.Sprintf("%#v", this.Scalar)+",\n") + } + if this.Ranges != nil { + s = append(s, "Ranges: "+fmt.Sprintf("%#v", this.Ranges)+",\n") + } + if this.Set != nil { + s = append(s, "Set: "+fmt.Sprintf("%#v", this.Set)+",\n") + } + if this.Text != nil { + s = append(s, "Text: "+fmt.Sprintf("%#v", this.Text)+",\n") + } + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") } -func (this *ACLs) String() string { +func (this *Resource) GoString() string { if this == nil { return "nil" } - s := strings.Join([]string{`&ACLs{`, - `Permissive:` + valueToStringMesos(this.Permissive) + `,`, - `RegisterFrameworks:` + strings.Replace(fmt1.Sprintf("%v", this.RegisterFrameworks), "ACL_RegisterFramework", "ACL_RegisterFramework", 1) + `,`, - `RunTasks:` + strings.Replace(fmt1.Sprintf("%v", this.RunTasks), "ACL_RunTask", "ACL_RunTask", 1) + `,`, - `ShutdownFrameworks:` + strings.Replace(fmt1.Sprintf("%v", this.ShutdownFrameworks), "ACL_ShutdownFramework", "ACL_ShutdownFramework", 1) + `,`, - `XXX_unrecognized:` + fmt1.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s + s := make([]string, 0, 13) + s = append(s, "&mesosproto.Resource{") + if this.Name != nil { + s = append(s, "Name: "+valueToGoStringMesos(this.Name, "string")+",\n") + } + if this.Type != nil { + s = append(s, "Type: "+valueToGoStringMesos(this.Type, "mesosproto.Value_Type")+",\n") + } + if this.Scalar != nil { + s = append(s, "Scalar: "+fmt.Sprintf("%#v", this.Scalar)+",\n") + } + if this.Ranges != nil { + s = append(s, "Ranges: "+fmt.Sprintf("%#v", this.Ranges)+",\n") + } + if this.Set != nil { + s = append(s, "Set: "+fmt.Sprintf("%#v", this.Set)+",\n") + } + if this.Role != nil { + s = append(s, "Role: "+valueToGoStringMesos(this.Role, "string")+",\n") + } + if this.Reservation != nil { + s = append(s, "Reservation: "+fmt.Sprintf("%#v", this.Reservation)+",\n") + } + if this.Disk != nil { + s = append(s, "Disk: "+fmt.Sprintf("%#v", this.Disk)+",\n") + } + if this.Revocable != nil { + s = append(s, "Revocable: "+fmt.Sprintf("%#v", this.Revocable)+",\n") + } + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") } -func (this *RateLimit) String() string { +func (this *Resource_ReservationInfo) GoString() string { if this == nil { return "nil" } - s := strings.Join([]string{`&RateLimit{`, - `Qps:` + valueToStringMesos(this.Qps) + `,`, - `Principal:` + valueToStringMesos(this.Principal) + `,`, - `Capacity:` + valueToStringMesos(this.Capacity) + `,`, - `XXX_unrecognized:` + fmt1.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s + s := make([]string, 0, 5) + s = append(s, "&mesosproto.Resource_ReservationInfo{") + if this.Principal != nil { + s = append(s, "Principal: "+valueToGoStringMesos(this.Principal, "string")+",\n") + } + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") } -func (this *RateLimits) String() string { +func (this *Resource_DiskInfo) GoString() string { if this == nil { return "nil" } - s := strings.Join([]string{`&RateLimits{`, - `Limits:` + strings.Replace(fmt1.Sprintf("%v", this.Limits), "RateLimit", "RateLimit", 1) + `,`, - `AggregateDefaultQps:` + valueToStringMesos(this.AggregateDefaultQps) + `,`, - `AggregateDefaultCapacity:` + valueToStringMesos(this.AggregateDefaultCapacity) + `,`, - `XXX_unrecognized:` + fmt1.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s + s := make([]string, 0, 6) + s = append(s, "&mesosproto.Resource_DiskInfo{") + if this.Persistence != nil { + s = append(s, "Persistence: "+fmt.Sprintf("%#v", this.Persistence)+",\n") + } + if this.Volume != nil { + s = append(s, "Volume: "+fmt.Sprintf("%#v", this.Volume)+",\n") + } + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") } -func (this *Volume) String() string { +func (this *Resource_DiskInfo_Persistence) GoString() string { if this == nil { return "nil" } - s := strings.Join([]string{`&Volume{`, - `ContainerPath:` + valueToStringMesos(this.ContainerPath) + `,`, - `HostPath:` + valueToStringMesos(this.HostPath) + `,`, - `Mode:` + valueToStringMesos(this.Mode) + `,`, - `XXX_unrecognized:` + fmt1.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s + s := make([]string, 0, 5) + s = append(s, "&mesosproto.Resource_DiskInfo_Persistence{") + if this.Id != nil { + s = append(s, "Id: "+valueToGoStringMesos(this.Id, "string")+",\n") + } + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") } -func (this *ContainerInfo) String() string { +func (this *Resource_RevocableInfo) GoString() string { if this == nil { return "nil" } - s := strings.Join([]string{`&ContainerInfo{`, - `Type:` + valueToStringMesos(this.Type) + `,`, - `Volumes:` + strings.Replace(fmt1.Sprintf("%v", this.Volumes), "Volume", "Volume", 1) + `,`, - `Hostname:` + valueToStringMesos(this.Hostname) + `,`, - `Docker:` + strings.Replace(fmt1.Sprintf("%v", this.Docker), "ContainerInfo_DockerInfo", "ContainerInfo_DockerInfo", 1) + `,`, - `XXX_unrecognized:` + fmt1.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s + s := make([]string, 0, 4) + s = append(s, "&mesosproto.Resource_RevocableInfo{") + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") } -func (this *ContainerInfo_DockerInfo) String() string { +func (this *TrafficControlStatistics) GoString() string { if this == nil { return "nil" } - s := strings.Join([]string{`&ContainerInfo_DockerInfo{`, - `Image:` + valueToStringMesos(this.Image) + `,`, - `Network:` + valueToStringMesos(this.Network) + `,`, - `PortMappings:` + strings.Replace(fmt1.Sprintf("%v", this.PortMappings), "ContainerInfo_DockerInfo_PortMapping", "ContainerInfo_DockerInfo_PortMapping", 1) + `,`, - `Privileged:` + valueToStringMesos(this.Privileged) + `,`, - `Parameters:` + strings.Replace(fmt1.Sprintf("%v", this.Parameters), "Parameter", "Parameter", 1) + `,`, - `XXX_unrecognized:` + fmt1.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s + s := make([]string, 0, 14) + s = append(s, "&mesosproto.TrafficControlStatistics{") + if this.Id != nil { + s = append(s, "Id: "+valueToGoStringMesos(this.Id, "string")+",\n") + } + if this.Backlog != nil { + s = append(s, "Backlog: "+valueToGoStringMesos(this.Backlog, "uint64")+",\n") + } + if this.Bytes != nil { + s = append(s, "Bytes: "+valueToGoStringMesos(this.Bytes, "uint64")+",\n") + } + if this.Drops != nil { + s = append(s, "Drops: "+valueToGoStringMesos(this.Drops, "uint64")+",\n") + } + if this.Overlimits != nil { + s = append(s, "Overlimits: "+valueToGoStringMesos(this.Overlimits, "uint64")+",\n") + } + if this.Packets != nil { + s = append(s, "Packets: "+valueToGoStringMesos(this.Packets, "uint64")+",\n") + } + if this.Qlen != nil { + s = append(s, "Qlen: "+valueToGoStringMesos(this.Qlen, "uint64")+",\n") + } + if this.Ratebps != nil { + s = append(s, "Ratebps: "+valueToGoStringMesos(this.Ratebps, "uint64")+",\n") + } + if this.Ratepps != nil { + s = append(s, "Ratepps: "+valueToGoStringMesos(this.Ratepps, "uint64")+",\n") + } + if this.Requeues != nil { + s = append(s, "Requeues: "+valueToGoStringMesos(this.Requeues, "uint64")+",\n") + } + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") } -func (this *ContainerInfo_DockerInfo_PortMapping) String() string { +func (this *ResourceStatistics) GoString() string { if this == nil { return "nil" } - s := strings.Join([]string{`&ContainerInfo_DockerInfo_PortMapping{`, - `HostPort:` + valueToStringMesos(this.HostPort) + `,`, - `ContainerPort:` + valueToStringMesos(this.ContainerPort) + `,`, - `Protocol:` + valueToStringMesos(this.Protocol) + `,`, - `XXX_unrecognized:` + fmt1.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func valueToStringMesos(v interface{}) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" + s := make([]string, 0, 44) + s = append(s, "&mesosproto.ResourceStatistics{") + if this.Timestamp != nil { + s = append(s, "Timestamp: "+valueToGoStringMesos(this.Timestamp, "float64")+",\n") } - pv := reflect.Indirect(rv).Interface() - return fmt1.Sprintf("*%v", pv) -} -func (m *FrameworkID) Size() (n int) { - var l int - _ = l - if m.Value != nil { - l = len(*m.Value) - n += 1 + l + sovMesos(uint64(l)) + if this.Processes != nil { + s = append(s, "Processes: "+valueToGoStringMesos(this.Processes, "uint32")+",\n") } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + if this.Threads != nil { + s = append(s, "Threads: "+valueToGoStringMesos(this.Threads, "uint32")+",\n") } - return n -} - -func (m *OfferID) Size() (n int) { - var l int - _ = l - if m.Value != nil { - l = len(*m.Value) - n += 1 + l + sovMesos(uint64(l)) + if this.CpusUserTimeSecs != nil { + s = append(s, "CpusUserTimeSecs: "+valueToGoStringMesos(this.CpusUserTimeSecs, "float64")+",\n") } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + if this.CpusSystemTimeSecs != nil { + s = append(s, "CpusSystemTimeSecs: "+valueToGoStringMesos(this.CpusSystemTimeSecs, "float64")+",\n") } - return n + if this.CpusLimit != nil { + s = append(s, "CpusLimit: "+valueToGoStringMesos(this.CpusLimit, "float64")+",\n") + } + if this.CpusNrPeriods != nil { + s = append(s, "CpusNrPeriods: "+valueToGoStringMesos(this.CpusNrPeriods, "uint32")+",\n") + } + if this.CpusNrThrottled != nil { + s = append(s, "CpusNrThrottled: "+valueToGoStringMesos(this.CpusNrThrottled, "uint32")+",\n") + } + if this.CpusThrottledTimeSecs != nil { + s = append(s, "CpusThrottledTimeSecs: "+valueToGoStringMesos(this.CpusThrottledTimeSecs, "float64")+",\n") + } + if this.MemTotalBytes != nil { + s = append(s, "MemTotalBytes: "+valueToGoStringMesos(this.MemTotalBytes, "uint64")+",\n") + } + if this.MemTotalMemswBytes != nil { + s = append(s, "MemTotalMemswBytes: "+valueToGoStringMesos(this.MemTotalMemswBytes, "uint64")+",\n") + } + if this.MemLimitBytes != nil { + s = append(s, "MemLimitBytes: "+valueToGoStringMesos(this.MemLimitBytes, "uint64")+",\n") + } + if this.MemSoftLimitBytes != nil { + s = append(s, "MemSoftLimitBytes: "+valueToGoStringMesos(this.MemSoftLimitBytes, "uint64")+",\n") + } + if this.MemFileBytes != nil { + s = append(s, "MemFileBytes: "+valueToGoStringMesos(this.MemFileBytes, "uint64")+",\n") + } + if this.MemAnonBytes != nil { + s = append(s, "MemAnonBytes: "+valueToGoStringMesos(this.MemAnonBytes, "uint64")+",\n") + } + if this.MemCacheBytes != nil { + s = append(s, "MemCacheBytes: "+valueToGoStringMesos(this.MemCacheBytes, "uint64")+",\n") + } + if this.MemRssBytes != nil { + s = append(s, "MemRssBytes: "+valueToGoStringMesos(this.MemRssBytes, "uint64")+",\n") + } + if this.MemMappedFileBytes != nil { + s = append(s, "MemMappedFileBytes: "+valueToGoStringMesos(this.MemMappedFileBytes, "uint64")+",\n") + } + if this.MemSwapBytes != nil { + s = append(s, "MemSwapBytes: "+valueToGoStringMesos(this.MemSwapBytes, "uint64")+",\n") + } + if this.MemLowPressureCounter != nil { + s = append(s, "MemLowPressureCounter: "+valueToGoStringMesos(this.MemLowPressureCounter, "uint64")+",\n") + } + if this.MemMediumPressureCounter != nil { + s = append(s, "MemMediumPressureCounter: "+valueToGoStringMesos(this.MemMediumPressureCounter, "uint64")+",\n") + } + if this.MemCriticalPressureCounter != nil { + s = append(s, "MemCriticalPressureCounter: "+valueToGoStringMesos(this.MemCriticalPressureCounter, "uint64")+",\n") + } + if this.DiskLimitBytes != nil { + s = append(s, "DiskLimitBytes: "+valueToGoStringMesos(this.DiskLimitBytes, "uint64")+",\n") + } + if this.DiskUsedBytes != nil { + s = append(s, "DiskUsedBytes: "+valueToGoStringMesos(this.DiskUsedBytes, "uint64")+",\n") + } + if this.Perf != nil { + s = append(s, "Perf: "+fmt.Sprintf("%#v", this.Perf)+",\n") + } + if this.NetRxPackets != nil { + s = append(s, "NetRxPackets: "+valueToGoStringMesos(this.NetRxPackets, "uint64")+",\n") + } + if this.NetRxBytes != nil { + s = append(s, "NetRxBytes: "+valueToGoStringMesos(this.NetRxBytes, "uint64")+",\n") + } + if this.NetRxErrors != nil { + s = append(s, "NetRxErrors: "+valueToGoStringMesos(this.NetRxErrors, "uint64")+",\n") + } + if this.NetRxDropped != nil { + s = append(s, "NetRxDropped: "+valueToGoStringMesos(this.NetRxDropped, "uint64")+",\n") + } + if this.NetTxPackets != nil { + s = append(s, "NetTxPackets: "+valueToGoStringMesos(this.NetTxPackets, "uint64")+",\n") + } + if this.NetTxBytes != nil { + s = append(s, "NetTxBytes: "+valueToGoStringMesos(this.NetTxBytes, "uint64")+",\n") + } + if this.NetTxErrors != nil { + s = append(s, "NetTxErrors: "+valueToGoStringMesos(this.NetTxErrors, "uint64")+",\n") + } + if this.NetTxDropped != nil { + s = append(s, "NetTxDropped: "+valueToGoStringMesos(this.NetTxDropped, "uint64")+",\n") + } + if this.NetTcpRttMicrosecsP50 != nil { + s = append(s, "NetTcpRttMicrosecsP50: "+valueToGoStringMesos(this.NetTcpRttMicrosecsP50, "float64")+",\n") + } + if this.NetTcpRttMicrosecsP90 != nil { + s = append(s, "NetTcpRttMicrosecsP90: "+valueToGoStringMesos(this.NetTcpRttMicrosecsP90, "float64")+",\n") + } + if this.NetTcpRttMicrosecsP95 != nil { + s = append(s, "NetTcpRttMicrosecsP95: "+valueToGoStringMesos(this.NetTcpRttMicrosecsP95, "float64")+",\n") + } + if this.NetTcpRttMicrosecsP99 != nil { + s = append(s, "NetTcpRttMicrosecsP99: "+valueToGoStringMesos(this.NetTcpRttMicrosecsP99, "float64")+",\n") + } + if this.NetTcpActiveConnections != nil { + s = append(s, "NetTcpActiveConnections: "+valueToGoStringMesos(this.NetTcpActiveConnections, "float64")+",\n") + } + if this.NetTcpTimeWaitConnections != nil { + s = append(s, "NetTcpTimeWaitConnections: "+valueToGoStringMesos(this.NetTcpTimeWaitConnections, "float64")+",\n") + } + if this.NetTrafficControlStatistics != nil { + s = append(s, "NetTrafficControlStatistics: "+fmt.Sprintf("%#v", this.NetTrafficControlStatistics)+",\n") + } + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") } - -func (m *SlaveID) Size() (n int) { - var l int - _ = l - if m.Value != nil { - l = len(*m.Value) - n += 1 + l + sovMesos(uint64(l)) +func (this *ResourceUsage) GoString() string { + if this == nil { + return "nil" } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + s := make([]string, 0, 5) + s = append(s, "&mesosproto.ResourceUsage{") + if this.Executors != nil { + s = append(s, "Executors: "+fmt.Sprintf("%#v", this.Executors)+",\n") } - return n + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") } - -func (m *TaskID) Size() (n int) { - var l int - _ = l - if m.Value != nil { - l = len(*m.Value) - n += 1 + l + sovMesos(uint64(l)) +func (this *ResourceUsage_Executor) GoString() string { + if this == nil { + return "nil" } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + s := make([]string, 0, 7) + s = append(s, "&mesosproto.ResourceUsage_Executor{") + if this.ExecutorInfo != nil { + s = append(s, "ExecutorInfo: "+fmt.Sprintf("%#v", this.ExecutorInfo)+",\n") } - return n + if this.Allocated != nil { + s = append(s, "Allocated: "+fmt.Sprintf("%#v", this.Allocated)+",\n") + } + if this.Statistics != nil { + s = append(s, "Statistics: "+fmt.Sprintf("%#v", this.Statistics)+",\n") + } + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") } - -func (m *ExecutorID) Size() (n int) { - var l int - _ = l - if m.Value != nil { - l = len(*m.Value) - n += 1 + l + sovMesos(uint64(l)) +func (this *PerfStatistics) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 57) + s = append(s, "&mesosproto.PerfStatistics{") + if this.Timestamp != nil { + s = append(s, "Timestamp: "+valueToGoStringMesos(this.Timestamp, "float64")+",\n") } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + if this.Duration != nil { + s = append(s, "Duration: "+valueToGoStringMesos(this.Duration, "float64")+",\n") } - return n -} - -func (m *ContainerID) Size() (n int) { - var l int - _ = l - if m.Value != nil { - l = len(*m.Value) - n += 1 + l + sovMesos(uint64(l)) + if this.Cycles != nil { + s = append(s, "Cycles: "+valueToGoStringMesos(this.Cycles, "uint64")+",\n") } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + if this.StalledCyclesFrontend != nil { + s = append(s, "StalledCyclesFrontend: "+valueToGoStringMesos(this.StalledCyclesFrontend, "uint64")+",\n") } - return n -} - -func (m *FrameworkInfo) Size() (n int) { - var l int - _ = l - if m.User != nil { - l = len(*m.User) - n += 1 + l + sovMesos(uint64(l)) + if this.StalledCyclesBackend != nil { + s = append(s, "StalledCyclesBackend: "+valueToGoStringMesos(this.StalledCyclesBackend, "uint64")+",\n") } - if m.Name != nil { - l = len(*m.Name) - n += 1 + l + sovMesos(uint64(l)) + if this.Instructions != nil { + s = append(s, "Instructions: "+valueToGoStringMesos(this.Instructions, "uint64")+",\n") } - if m.Id != nil { - l = m.Id.Size() - n += 1 + l + sovMesos(uint64(l)) + if this.CacheReferences != nil { + s = append(s, "CacheReferences: "+valueToGoStringMesos(this.CacheReferences, "uint64")+",\n") } - if m.FailoverTimeout != nil { - n += 9 + if this.CacheMisses != nil { + s = append(s, "CacheMisses: "+valueToGoStringMesos(this.CacheMisses, "uint64")+",\n") } - if m.Checkpoint != nil { - n += 2 + if this.Branches != nil { + s = append(s, "Branches: "+valueToGoStringMesos(this.Branches, "uint64")+",\n") } - if m.Role != nil { - l = len(*m.Role) - n += 1 + l + sovMesos(uint64(l)) + if this.BranchMisses != nil { + s = append(s, "BranchMisses: "+valueToGoStringMesos(this.BranchMisses, "uint64")+",\n") } - if m.Hostname != nil { - l = len(*m.Hostname) - n += 1 + l + sovMesos(uint64(l)) + if this.BusCycles != nil { + s = append(s, "BusCycles: "+valueToGoStringMesos(this.BusCycles, "uint64")+",\n") } - if m.Principal != nil { - l = len(*m.Principal) - n += 1 + l + sovMesos(uint64(l)) + if this.RefCycles != nil { + s = append(s, "RefCycles: "+valueToGoStringMesos(this.RefCycles, "uint64")+",\n") } - if m.WebuiUrl != nil { - l = len(*m.WebuiUrl) - n += 1 + l + sovMesos(uint64(l)) + if this.CpuClock != nil { + s = append(s, "CpuClock: "+valueToGoStringMesos(this.CpuClock, "float64")+",\n") } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + if this.TaskClock != nil { + s = append(s, "TaskClock: "+valueToGoStringMesos(this.TaskClock, "float64")+",\n") } - return n -} - -func (m *HealthCheck) Size() (n int) { - var l int - _ = l - if m.Http != nil { - l = m.Http.Size() - n += 1 + l + sovMesos(uint64(l)) + if this.PageFaults != nil { + s = append(s, "PageFaults: "+valueToGoStringMesos(this.PageFaults, "uint64")+",\n") } - if m.DelaySeconds != nil { - n += 9 + if this.MinorFaults != nil { + s = append(s, "MinorFaults: "+valueToGoStringMesos(this.MinorFaults, "uint64")+",\n") } - if m.IntervalSeconds != nil { - n += 9 + if this.MajorFaults != nil { + s = append(s, "MajorFaults: "+valueToGoStringMesos(this.MajorFaults, "uint64")+",\n") } - if m.TimeoutSeconds != nil { - n += 9 + if this.ContextSwitches != nil { + s = append(s, "ContextSwitches: "+valueToGoStringMesos(this.ContextSwitches, "uint64")+",\n") } - if m.ConsecutiveFailures != nil { - n += 1 + sovMesos(uint64(*m.ConsecutiveFailures)) + if this.CpuMigrations != nil { + s = append(s, "CpuMigrations: "+valueToGoStringMesos(this.CpuMigrations, "uint64")+",\n") } - if m.GracePeriodSeconds != nil { - n += 9 + if this.AlignmentFaults != nil { + s = append(s, "AlignmentFaults: "+valueToGoStringMesos(this.AlignmentFaults, "uint64")+",\n") } - if m.Command != nil { - l = m.Command.Size() - n += 1 + l + sovMesos(uint64(l)) + if this.EmulationFaults != nil { + s = append(s, "EmulationFaults: "+valueToGoStringMesos(this.EmulationFaults, "uint64")+",\n") } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + if this.L1DcacheLoads != nil { + s = append(s, "L1DcacheLoads: "+valueToGoStringMesos(this.L1DcacheLoads, "uint64")+",\n") } - return n -} - -func (m *HealthCheck_HTTP) Size() (n int) { - var l int - _ = l - if m.Port != nil { - n += 1 + sovMesos(uint64(*m.Port)) + if this.L1DcacheLoadMisses != nil { + s = append(s, "L1DcacheLoadMisses: "+valueToGoStringMesos(this.L1DcacheLoadMisses, "uint64")+",\n") } - if m.Path != nil { - l = len(*m.Path) - n += 1 + l + sovMesos(uint64(l)) + if this.L1DcacheStores != nil { + s = append(s, "L1DcacheStores: "+valueToGoStringMesos(this.L1DcacheStores, "uint64")+",\n") } - if len(m.Statuses) > 0 { - for _, e := range m.Statuses { - n += 1 + sovMesos(uint64(e)) - } + if this.L1DcacheStoreMisses != nil { + s = append(s, "L1DcacheStoreMisses: "+valueToGoStringMesos(this.L1DcacheStoreMisses, "uint64")+",\n") } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + if this.L1DcachePrefetches != nil { + s = append(s, "L1DcachePrefetches: "+valueToGoStringMesos(this.L1DcachePrefetches, "uint64")+",\n") } - return n -} - -func (m *CommandInfo) Size() (n int) { - var l int - _ = l - if m.Container != nil { - l = m.Container.Size() - n += 1 + l + sovMesos(uint64(l)) + if this.L1DcachePrefetchMisses != nil { + s = append(s, "L1DcachePrefetchMisses: "+valueToGoStringMesos(this.L1DcachePrefetchMisses, "uint64")+",\n") } - if len(m.Uris) > 0 { - for _, e := range m.Uris { - l = e.Size() - n += 1 + l + sovMesos(uint64(l)) - } + if this.L1IcacheLoads != nil { + s = append(s, "L1IcacheLoads: "+valueToGoStringMesos(this.L1IcacheLoads, "uint64")+",\n") } - if m.Environment != nil { - l = m.Environment.Size() - n += 1 + l + sovMesos(uint64(l)) + if this.L1IcacheLoadMisses != nil { + s = append(s, "L1IcacheLoadMisses: "+valueToGoStringMesos(this.L1IcacheLoadMisses, "uint64")+",\n") } - if m.Shell != nil { - n += 2 + if this.L1IcachePrefetches != nil { + s = append(s, "L1IcachePrefetches: "+valueToGoStringMesos(this.L1IcachePrefetches, "uint64")+",\n") } - if m.Value != nil { - l = len(*m.Value) - n += 1 + l + sovMesos(uint64(l)) + if this.L1IcachePrefetchMisses != nil { + s = append(s, "L1IcachePrefetchMisses: "+valueToGoStringMesos(this.L1IcachePrefetchMisses, "uint64")+",\n") } - if len(m.Arguments) > 0 { - for _, s := range m.Arguments { - l = len(s) - n += 1 + l + sovMesos(uint64(l)) - } + if this.LlcLoads != nil { + s = append(s, "LlcLoads: "+valueToGoStringMesos(this.LlcLoads, "uint64")+",\n") } - if m.User != nil { - l = len(*m.User) - n += 1 + l + sovMesos(uint64(l)) + if this.LlcLoadMisses != nil { + s = append(s, "LlcLoadMisses: "+valueToGoStringMesos(this.LlcLoadMisses, "uint64")+",\n") } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + if this.LlcStores != nil { + s = append(s, "LlcStores: "+valueToGoStringMesos(this.LlcStores, "uint64")+",\n") } - return n -} - -func (m *CommandInfo_URI) Size() (n int) { - var l int - _ = l - if m.Value != nil { - l = len(*m.Value) - n += 1 + l + sovMesos(uint64(l)) + if this.LlcStoreMisses != nil { + s = append(s, "LlcStoreMisses: "+valueToGoStringMesos(this.LlcStoreMisses, "uint64")+",\n") } - if m.Executable != nil { - n += 2 + if this.LlcPrefetches != nil { + s = append(s, "LlcPrefetches: "+valueToGoStringMesos(this.LlcPrefetches, "uint64")+",\n") } - if m.Extract != nil { - n += 2 + if this.LlcPrefetchMisses != nil { + s = append(s, "LlcPrefetchMisses: "+valueToGoStringMesos(this.LlcPrefetchMisses, "uint64")+",\n") } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + if this.DtlbLoads != nil { + s = append(s, "DtlbLoads: "+valueToGoStringMesos(this.DtlbLoads, "uint64")+",\n") } - return n -} - -func (m *CommandInfo_ContainerInfo) Size() (n int) { - var l int - _ = l - if m.Image != nil { - l = len(*m.Image) - n += 1 + l + sovMesos(uint64(l)) + if this.DtlbLoadMisses != nil { + s = append(s, "DtlbLoadMisses: "+valueToGoStringMesos(this.DtlbLoadMisses, "uint64")+",\n") } - if len(m.Options) > 0 { - for _, s := range m.Options { - l = len(s) - n += 1 + l + sovMesos(uint64(l)) - } + if this.DtlbStores != nil { + s = append(s, "DtlbStores: "+valueToGoStringMesos(this.DtlbStores, "uint64")+",\n") } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + if this.DtlbStoreMisses != nil { + s = append(s, "DtlbStoreMisses: "+valueToGoStringMesos(this.DtlbStoreMisses, "uint64")+",\n") } - return n -} - -func (m *ExecutorInfo) Size() (n int) { - var l int - _ = l - if m.ExecutorId != nil { - l = m.ExecutorId.Size() - n += 1 + l + sovMesos(uint64(l)) + if this.DtlbPrefetches != nil { + s = append(s, "DtlbPrefetches: "+valueToGoStringMesos(this.DtlbPrefetches, "uint64")+",\n") } - if m.FrameworkId != nil { - l = m.FrameworkId.Size() - n += 1 + l + sovMesos(uint64(l)) + if this.DtlbPrefetchMisses != nil { + s = append(s, "DtlbPrefetchMisses: "+valueToGoStringMesos(this.DtlbPrefetchMisses, "uint64")+",\n") } - if m.Command != nil { - l = m.Command.Size() - n += 1 + l + sovMesos(uint64(l)) + if this.ItlbLoads != nil { + s = append(s, "ItlbLoads: "+valueToGoStringMesos(this.ItlbLoads, "uint64")+",\n") } - if m.Container != nil { - l = m.Container.Size() - n += 1 + l + sovMesos(uint64(l)) + if this.ItlbLoadMisses != nil { + s = append(s, "ItlbLoadMisses: "+valueToGoStringMesos(this.ItlbLoadMisses, "uint64")+",\n") } - if len(m.Resources) > 0 { - for _, e := range m.Resources { - l = e.Size() - n += 1 + l + sovMesos(uint64(l)) - } + if this.BranchLoads != nil { + s = append(s, "BranchLoads: "+valueToGoStringMesos(this.BranchLoads, "uint64")+",\n") } - if m.Name != nil { - l = len(*m.Name) - n += 1 + l + sovMesos(uint64(l)) + if this.BranchLoadMisses != nil { + s = append(s, "BranchLoadMisses: "+valueToGoStringMesos(this.BranchLoadMisses, "uint64")+",\n") } - if m.Source != nil { - l = len(*m.Source) - n += 1 + l + sovMesos(uint64(l)) + if this.NodeLoads != nil { + s = append(s, "NodeLoads: "+valueToGoStringMesos(this.NodeLoads, "uint64")+",\n") } - if m.Data != nil { - l = len(m.Data) - n += 1 + l + sovMesos(uint64(l)) + if this.NodeLoadMisses != nil { + s = append(s, "NodeLoadMisses: "+valueToGoStringMesos(this.NodeLoadMisses, "uint64")+",\n") } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + if this.NodeStores != nil { + s = append(s, "NodeStores: "+valueToGoStringMesos(this.NodeStores, "uint64")+",\n") } - return n -} - -func (m *MasterInfo) Size() (n int) { - var l int - _ = l - if m.Id != nil { - l = len(*m.Id) - n += 1 + l + sovMesos(uint64(l)) + if this.NodeStoreMisses != nil { + s = append(s, "NodeStoreMisses: "+valueToGoStringMesos(this.NodeStoreMisses, "uint64")+",\n") } - if m.Ip != nil { - n += 1 + sovMesos(uint64(*m.Ip)) + if this.NodePrefetches != nil { + s = append(s, "NodePrefetches: "+valueToGoStringMesos(this.NodePrefetches, "uint64")+",\n") } - if m.Port != nil { - n += 1 + sovMesos(uint64(*m.Port)) + if this.NodePrefetchMisses != nil { + s = append(s, "NodePrefetchMisses: "+valueToGoStringMesos(this.NodePrefetchMisses, "uint64")+",\n") } - if m.Pid != nil { - l = len(*m.Pid) - n += 1 + l + sovMesos(uint64(l)) + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") } - if m.Hostname != nil { - l = len(*m.Hostname) - n += 1 + l + sovMesos(uint64(l)) + s = append(s, "}") + return strings.Join(s, "") +} +func (this *Request) GoString() string { + if this == nil { + return "nil" } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + s := make([]string, 0, 6) + s = append(s, "&mesosproto.Request{") + if this.SlaveId != nil { + s = append(s, "SlaveId: "+fmt.Sprintf("%#v", this.SlaveId)+",\n") } - return n + if this.Resources != nil { + s = append(s, "Resources: "+fmt.Sprintf("%#v", this.Resources)+",\n") + } + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") } - -func (m *SlaveInfo) Size() (n int) { - var l int - _ = l - if m.Hostname != nil { - l = len(*m.Hostname) - n += 1 + l + sovMesos(uint64(l)) +func (this *Offer) GoString() string { + if this == nil { + return "nil" } - if m.Port != nil { - n += 1 + sovMesos(uint64(*m.Port)) + s := make([]string, 0, 11) + s = append(s, "&mesosproto.Offer{") + if this.Id != nil { + s = append(s, "Id: "+fmt.Sprintf("%#v", this.Id)+",\n") } - if len(m.Resources) > 0 { - for _, e := range m.Resources { - l = e.Size() - n += 1 + l + sovMesos(uint64(l)) - } + if this.FrameworkId != nil { + s = append(s, "FrameworkId: "+fmt.Sprintf("%#v", this.FrameworkId)+",\n") } - if len(m.Attributes) > 0 { - for _, e := range m.Attributes { - l = e.Size() - n += 1 + l + sovMesos(uint64(l)) - } + if this.SlaveId != nil { + s = append(s, "SlaveId: "+fmt.Sprintf("%#v", this.SlaveId)+",\n") } - if m.Id != nil { - l = m.Id.Size() - n += 1 + l + sovMesos(uint64(l)) + if this.Hostname != nil { + s = append(s, "Hostname: "+valueToGoStringMesos(this.Hostname, "string")+",\n") } - if m.Checkpoint != nil { - n += 2 + if this.Resources != nil { + s = append(s, "Resources: "+fmt.Sprintf("%#v", this.Resources)+",\n") } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + if this.Attributes != nil { + s = append(s, "Attributes: "+fmt.Sprintf("%#v", this.Attributes)+",\n") } - return n + if this.ExecutorIds != nil { + s = append(s, "ExecutorIds: "+fmt.Sprintf("%#v", this.ExecutorIds)+",\n") + } + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") } - -func (m *Value) Size() (n int) { - var l int - _ = l - if m.Type != nil { - n += 1 + sovMesos(uint64(*m.Type)) +func (this *Offer_Operation) GoString() string { + if this == nil { + return "nil" } - if m.Scalar != nil { - l = m.Scalar.Size() - n += 1 + l + sovMesos(uint64(l)) + s := make([]string, 0, 10) + s = append(s, "&mesosproto.Offer_Operation{") + if this.Type != nil { + s = append(s, "Type: "+valueToGoStringMesos(this.Type, "mesosproto.Offer_Operation_Type")+",\n") + } + if this.Launch != nil { + s = append(s, "Launch: "+fmt.Sprintf("%#v", this.Launch)+",\n") } - if m.Ranges != nil { - l = m.Ranges.Size() - n += 1 + l + sovMesos(uint64(l)) + if this.Reserve != nil { + s = append(s, "Reserve: "+fmt.Sprintf("%#v", this.Reserve)+",\n") } - if m.Set != nil { - l = m.Set.Size() - n += 1 + l + sovMesos(uint64(l)) + if this.Unreserve != nil { + s = append(s, "Unreserve: "+fmt.Sprintf("%#v", this.Unreserve)+",\n") } - if m.Text != nil { - l = m.Text.Size() - n += 1 + l + sovMesos(uint64(l)) + if this.Create != nil { + s = append(s, "Create: "+fmt.Sprintf("%#v", this.Create)+",\n") } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + if this.Destroy != nil { + s = append(s, "Destroy: "+fmt.Sprintf("%#v", this.Destroy)+",\n") } - return n + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") } - -func (m *Value_Scalar) Size() (n int) { - var l int - _ = l - if m.Value != nil { - n += 9 +func (this *Offer_Operation_Launch) GoString() string { + if this == nil { + return "nil" } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + s := make([]string, 0, 5) + s = append(s, "&mesosproto.Offer_Operation_Launch{") + if this.TaskInfos != nil { + s = append(s, "TaskInfos: "+fmt.Sprintf("%#v", this.TaskInfos)+",\n") } - return n + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") } - -func (m *Value_Range) Size() (n int) { - var l int - _ = l - if m.Begin != nil { - n += 1 + sovMesos(uint64(*m.Begin)) +func (this *Offer_Operation_Reserve) GoString() string { + if this == nil { + return "nil" } - if m.End != nil { - n += 1 + sovMesos(uint64(*m.End)) + s := make([]string, 0, 5) + s = append(s, "&mesosproto.Offer_Operation_Reserve{") + if this.Resources != nil { + s = append(s, "Resources: "+fmt.Sprintf("%#v", this.Resources)+",\n") } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") } - return n + s = append(s, "}") + return strings.Join(s, "") } - -func (m *Value_Ranges) Size() (n int) { - var l int - _ = l - if len(m.Range) > 0 { - for _, e := range m.Range { - l = e.Size() - n += 1 + l + sovMesos(uint64(l)) - } +func (this *Offer_Operation_Unreserve) GoString() string { + if this == nil { + return "nil" } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + s := make([]string, 0, 5) + s = append(s, "&mesosproto.Offer_Operation_Unreserve{") + if this.Resources != nil { + s = append(s, "Resources: "+fmt.Sprintf("%#v", this.Resources)+",\n") } - return n + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") } - -func (m *Value_Set) Size() (n int) { - var l int - _ = l - if len(m.Item) > 0 { - for _, s := range m.Item { - l = len(s) - n += 1 + l + sovMesos(uint64(l)) - } +func (this *Offer_Operation_Create) GoString() string { + if this == nil { + return "nil" } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + s := make([]string, 0, 5) + s = append(s, "&mesosproto.Offer_Operation_Create{") + if this.Volumes != nil { + s = append(s, "Volumes: "+fmt.Sprintf("%#v", this.Volumes)+",\n") } - return n + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") } - -func (m *Value_Text) Size() (n int) { - var l int - _ = l - if m.Value != nil { - l = len(*m.Value) - n += 1 + l + sovMesos(uint64(l)) +func (this *Offer_Operation_Destroy) GoString() string { + if this == nil { + return "nil" } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + s := make([]string, 0, 5) + s = append(s, "&mesosproto.Offer_Operation_Destroy{") + if this.Volumes != nil { + s = append(s, "Volumes: "+fmt.Sprintf("%#v", this.Volumes)+",\n") } - return n -} - -func (m *Attribute) Size() (n int) { - var l int - _ = l - if m.Name != nil { - l = len(*m.Name) - n += 1 + l + sovMesos(uint64(l)) + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") } - if m.Type != nil { - n += 1 + sovMesos(uint64(*m.Type)) + s = append(s, "}") + return strings.Join(s, "") +} +func (this *TaskInfo) GoString() string { + if this == nil { + return "nil" } - if m.Scalar != nil { - l = m.Scalar.Size() - n += 1 + l + sovMesos(uint64(l)) + s := make([]string, 0, 15) + s = append(s, "&mesosproto.TaskInfo{") + if this.Name != nil { + s = append(s, "Name: "+valueToGoStringMesos(this.Name, "string")+",\n") } - if m.Ranges != nil { - l = m.Ranges.Size() - n += 1 + l + sovMesos(uint64(l)) + if this.TaskId != nil { + s = append(s, "TaskId: "+fmt.Sprintf("%#v", this.TaskId)+",\n") } - if m.Set != nil { - l = m.Set.Size() - n += 1 + l + sovMesos(uint64(l)) + if this.SlaveId != nil { + s = append(s, "SlaveId: "+fmt.Sprintf("%#v", this.SlaveId)+",\n") } - if m.Text != nil { - l = m.Text.Size() - n += 1 + l + sovMesos(uint64(l)) + if this.Resources != nil { + s = append(s, "Resources: "+fmt.Sprintf("%#v", this.Resources)+",\n") } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + if this.Executor != nil { + s = append(s, "Executor: "+fmt.Sprintf("%#v", this.Executor)+",\n") } - return n -} - -func (m *Resource) Size() (n int) { - var l int - _ = l - if m.Name != nil { - l = len(*m.Name) - n += 1 + l + sovMesos(uint64(l)) + if this.Command != nil { + s = append(s, "Command: "+fmt.Sprintf("%#v", this.Command)+",\n") } - if m.Type != nil { - n += 1 + sovMesos(uint64(*m.Type)) + if this.Container != nil { + s = append(s, "Container: "+fmt.Sprintf("%#v", this.Container)+",\n") } - if m.Scalar != nil { - l = m.Scalar.Size() - n += 1 + l + sovMesos(uint64(l)) + if this.Data != nil { + s = append(s, "Data: "+valueToGoStringMesos(this.Data, "byte")+",\n") } - if m.Ranges != nil { - l = m.Ranges.Size() - n += 1 + l + sovMesos(uint64(l)) + if this.HealthCheck != nil { + s = append(s, "HealthCheck: "+fmt.Sprintf("%#v", this.HealthCheck)+",\n") } - if m.Set != nil { - l = m.Set.Size() - n += 1 + l + sovMesos(uint64(l)) + if this.Labels != nil { + s = append(s, "Labels: "+fmt.Sprintf("%#v", this.Labels)+",\n") } - if m.Role != nil { - l = len(*m.Role) - n += 1 + l + sovMesos(uint64(l)) + if this.Discovery != nil { + s = append(s, "Discovery: "+fmt.Sprintf("%#v", this.Discovery)+",\n") } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") } - return n + s = append(s, "}") + return strings.Join(s, "") } - -func (m *ResourceStatistics) Size() (n int) { - var l int - _ = l - if m.Timestamp != nil { - n += 9 +func (this *TaskStatus) GoString() string { + if this == nil { + return "nil" } - if m.CpusUserTimeSecs != nil { - n += 9 + s := make([]string, 0, 15) + s = append(s, "&mesosproto.TaskStatus{") + if this.TaskId != nil { + s = append(s, "TaskId: "+fmt.Sprintf("%#v", this.TaskId)+",\n") } - if m.CpusSystemTimeSecs != nil { - n += 9 + if this.State != nil { + s = append(s, "State: "+valueToGoStringMesos(this.State, "mesosproto.TaskState")+",\n") } - if m.CpusLimit != nil { - n += 9 + if this.Message != nil { + s = append(s, "Message: "+valueToGoStringMesos(this.Message, "string")+",\n") } - if m.CpusNrPeriods != nil { - n += 1 + sovMesos(uint64(*m.CpusNrPeriods)) + if this.Source != nil { + s = append(s, "Source: "+valueToGoStringMesos(this.Source, "mesosproto.TaskStatus_Source")+",\n") } - if m.CpusNrThrottled != nil { - n += 1 + sovMesos(uint64(*m.CpusNrThrottled)) + if this.Reason != nil { + s = append(s, "Reason: "+valueToGoStringMesos(this.Reason, "mesosproto.TaskStatus_Reason")+",\n") } - if m.CpusThrottledTimeSecs != nil { - n += 9 + if this.Data != nil { + s = append(s, "Data: "+valueToGoStringMesos(this.Data, "byte")+",\n") } - if m.MemRssBytes != nil { - n += 1 + sovMesos(uint64(*m.MemRssBytes)) + if this.SlaveId != nil { + s = append(s, "SlaveId: "+fmt.Sprintf("%#v", this.SlaveId)+",\n") } - if m.MemLimitBytes != nil { - n += 1 + sovMesos(uint64(*m.MemLimitBytes)) + if this.ExecutorId != nil { + s = append(s, "ExecutorId: "+fmt.Sprintf("%#v", this.ExecutorId)+",\n") } - if m.MemFileBytes != nil { - n += 1 + sovMesos(uint64(*m.MemFileBytes)) + if this.Timestamp != nil { + s = append(s, "Timestamp: "+valueToGoStringMesos(this.Timestamp, "float64")+",\n") } - if m.MemAnonBytes != nil { - n += 1 + sovMesos(uint64(*m.MemAnonBytes)) + if this.Uuid != nil { + s = append(s, "Uuid: "+valueToGoStringMesos(this.Uuid, "byte")+",\n") } - if m.MemMappedFileBytes != nil { - n += 1 + sovMesos(uint64(*m.MemMappedFileBytes)) + if this.Healthy != nil { + s = append(s, "Healthy: "+valueToGoStringMesos(this.Healthy, "bool")+",\n") } - if m.Perf != nil { - l = m.Perf.Size() - n += 1 + l + sovMesos(uint64(l)) + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") } - if m.NetRxPackets != nil { - n += 1 + sovMesos(uint64(*m.NetRxPackets)) + s = append(s, "}") + return strings.Join(s, "") +} +func (this *Filters) GoString() string { + if this == nil { + return "nil" } - if m.NetRxBytes != nil { - n += 1 + sovMesos(uint64(*m.NetRxBytes)) + s := make([]string, 0, 5) + s = append(s, "&mesosproto.Filters{") + if this.RefuseSeconds != nil { + s = append(s, "RefuseSeconds: "+valueToGoStringMesos(this.RefuseSeconds, "float64")+",\n") } - if m.NetRxErrors != nil { - n += 2 + sovMesos(uint64(*m.NetRxErrors)) + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") } - if m.NetRxDropped != nil { - n += 2 + sovMesos(uint64(*m.NetRxDropped)) + s = append(s, "}") + return strings.Join(s, "") +} +func (this *Environment) GoString() string { + if this == nil { + return "nil" } - if m.NetTxPackets != nil { - n += 2 + sovMesos(uint64(*m.NetTxPackets)) + s := make([]string, 0, 5) + s = append(s, "&mesosproto.Environment{") + if this.Variables != nil { + s = append(s, "Variables: "+fmt.Sprintf("%#v", this.Variables)+",\n") } - if m.NetTxBytes != nil { - n += 2 + sovMesos(uint64(*m.NetTxBytes)) + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") } - if m.NetTxErrors != nil { - n += 2 + sovMesos(uint64(*m.NetTxErrors)) + s = append(s, "}") + return strings.Join(s, "") +} +func (this *Environment_Variable) GoString() string { + if this == nil { + return "nil" } - if m.NetTxDropped != nil { - n += 2 + sovMesos(uint64(*m.NetTxDropped)) + s := make([]string, 0, 6) + s = append(s, "&mesosproto.Environment_Variable{") + if this.Name != nil { + s = append(s, "Name: "+valueToGoStringMesos(this.Name, "string")+",\n") } - if m.NetTcpRttMicrosecsP50 != nil { - n += 10 + if this.Value != nil { + s = append(s, "Value: "+valueToGoStringMesos(this.Value, "string")+",\n") } - if m.NetTcpRttMicrosecsP90 != nil { - n += 10 + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") } - if m.NetTcpRttMicrosecsP95 != nil { - n += 10 + s = append(s, "}") + return strings.Join(s, "") +} +func (this *Parameter) GoString() string { + if this == nil { + return "nil" } - if m.NetTcpRttMicrosecsP99 != nil { - n += 10 + s := make([]string, 0, 6) + s = append(s, "&mesosproto.Parameter{") + if this.Key != nil { + s = append(s, "Key: "+valueToGoStringMesos(this.Key, "string")+",\n") } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + if this.Value != nil { + s = append(s, "Value: "+valueToGoStringMesos(this.Value, "string")+",\n") } - return n + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") } - -func (m *ResourceUsage) Size() (n int) { - var l int - _ = l - if m.SlaveId != nil { - l = m.SlaveId.Size() - n += 1 + l + sovMesos(uint64(l)) +func (this *Parameters) GoString() string { + if this == nil { + return "nil" } - if m.FrameworkId != nil { - l = m.FrameworkId.Size() - n += 1 + l + sovMesos(uint64(l)) + s := make([]string, 0, 5) + s = append(s, "&mesosproto.Parameters{") + if this.Parameter != nil { + s = append(s, "Parameter: "+fmt.Sprintf("%#v", this.Parameter)+",\n") } - if m.ExecutorId != nil { - l = m.ExecutorId.Size() - n += 1 + l + sovMesos(uint64(l)) + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") } - if m.ExecutorName != nil { - l = len(*m.ExecutorName) - n += 1 + l + sovMesos(uint64(l)) + s = append(s, "}") + return strings.Join(s, "") +} +func (this *Credential) GoString() string { + if this == nil { + return "nil" } - if m.TaskId != nil { - l = m.TaskId.Size() - n += 1 + l + sovMesos(uint64(l)) + s := make([]string, 0, 6) + s = append(s, "&mesosproto.Credential{") + if this.Principal != nil { + s = append(s, "Principal: "+valueToGoStringMesos(this.Principal, "string")+",\n") } - if m.Statistics != nil { - l = m.Statistics.Size() - n += 1 + l + sovMesos(uint64(l)) + if this.Secret != nil { + s = append(s, "Secret: "+valueToGoStringMesos(this.Secret, "byte")+",\n") } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") } - return n + s = append(s, "}") + return strings.Join(s, "") } - -func (m *PerfStatistics) Size() (n int) { - var l int - _ = l - if m.Timestamp != nil { - n += 9 - } - if m.Duration != nil { - n += 9 +func (this *Credentials) GoString() string { + if this == nil { + return "nil" } - if m.Cycles != nil { - n += 1 + sovMesos(uint64(*m.Cycles)) + s := make([]string, 0, 5) + s = append(s, "&mesosproto.Credentials{") + if this.Credentials != nil { + s = append(s, "Credentials: "+fmt.Sprintf("%#v", this.Credentials)+",\n") } - if m.StalledCyclesFrontend != nil { - n += 1 + sovMesos(uint64(*m.StalledCyclesFrontend)) + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") } - if m.StalledCyclesBackend != nil { - n += 1 + sovMesos(uint64(*m.StalledCyclesBackend)) + s = append(s, "}") + return strings.Join(s, "") +} +func (this *ACL) GoString() string { + if this == nil { + return "nil" } - if m.Instructions != nil { - n += 1 + sovMesos(uint64(*m.Instructions)) + s := make([]string, 0, 4) + s = append(s, "&mesosproto.ACL{") + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") } - if m.CacheReferences != nil { - n += 1 + sovMesos(uint64(*m.CacheReferences)) + s = append(s, "}") + return strings.Join(s, "") +} +func (this *ACL_Entity) GoString() string { + if this == nil { + return "nil" } - if m.CacheMisses != nil { - n += 1 + sovMesos(uint64(*m.CacheMisses)) + s := make([]string, 0, 6) + s = append(s, "&mesosproto.ACL_Entity{") + if this.Type != nil { + s = append(s, "Type: "+valueToGoStringMesos(this.Type, "mesosproto.ACL_Entity_Type")+",\n") } - if m.Branches != nil { - n += 1 + sovMesos(uint64(*m.Branches)) + if this.Values != nil { + s = append(s, "Values: "+fmt.Sprintf("%#v", this.Values)+",\n") } - if m.BranchMisses != nil { - n += 1 + sovMesos(uint64(*m.BranchMisses)) + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") } - if m.BusCycles != nil { - n += 1 + sovMesos(uint64(*m.BusCycles)) + s = append(s, "}") + return strings.Join(s, "") +} +func (this *ACL_RegisterFramework) GoString() string { + if this == nil { + return "nil" } - if m.RefCycles != nil { - n += 1 + sovMesos(uint64(*m.RefCycles)) + s := make([]string, 0, 6) + s = append(s, "&mesosproto.ACL_RegisterFramework{") + if this.Principals != nil { + s = append(s, "Principals: "+fmt.Sprintf("%#v", this.Principals)+",\n") } - if m.CpuClock != nil { - n += 9 + if this.Roles != nil { + s = append(s, "Roles: "+fmt.Sprintf("%#v", this.Roles)+",\n") } - if m.TaskClock != nil { - n += 9 + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") } - if m.PageFaults != nil { - n += 1 + sovMesos(uint64(*m.PageFaults)) + s = append(s, "}") + return strings.Join(s, "") +} +func (this *ACL_RunTask) GoString() string { + if this == nil { + return "nil" } - if m.MinorFaults != nil { - n += 2 + sovMesos(uint64(*m.MinorFaults)) + s := make([]string, 0, 6) + s = append(s, "&mesosproto.ACL_RunTask{") + if this.Principals != nil { + s = append(s, "Principals: "+fmt.Sprintf("%#v", this.Principals)+",\n") } - if m.MajorFaults != nil { - n += 2 + sovMesos(uint64(*m.MajorFaults)) + if this.Users != nil { + s = append(s, "Users: "+fmt.Sprintf("%#v", this.Users)+",\n") } - if m.ContextSwitches != nil { - n += 2 + sovMesos(uint64(*m.ContextSwitches)) + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") } - if m.CpuMigrations != nil { - n += 2 + sovMesos(uint64(*m.CpuMigrations)) + s = append(s, "}") + return strings.Join(s, "") +} +func (this *ACL_ShutdownFramework) GoString() string { + if this == nil { + return "nil" } - if m.AlignmentFaults != nil { - n += 2 + sovMesos(uint64(*m.AlignmentFaults)) + s := make([]string, 0, 6) + s = append(s, "&mesosproto.ACL_ShutdownFramework{") + if this.Principals != nil { + s = append(s, "Principals: "+fmt.Sprintf("%#v", this.Principals)+",\n") } - if m.EmulationFaults != nil { - n += 2 + sovMesos(uint64(*m.EmulationFaults)) + if this.FrameworkPrincipals != nil { + s = append(s, "FrameworkPrincipals: "+fmt.Sprintf("%#v", this.FrameworkPrincipals)+",\n") } - if m.L1DcacheLoads != nil { - n += 2 + sovMesos(uint64(*m.L1DcacheLoads)) + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") } - if m.L1DcacheLoadMisses != nil { - n += 2 + sovMesos(uint64(*m.L1DcacheLoadMisses)) + s = append(s, "}") + return strings.Join(s, "") +} +func (this *ACLs) GoString() string { + if this == nil { + return "nil" } - if m.L1DcacheStores != nil { - n += 2 + sovMesos(uint64(*m.L1DcacheStores)) + s := make([]string, 0, 8) + s = append(s, "&mesosproto.ACLs{") + if this.Permissive != nil { + s = append(s, "Permissive: "+valueToGoStringMesos(this.Permissive, "bool")+",\n") } - if m.L1DcacheStoreMisses != nil { - n += 2 + sovMesos(uint64(*m.L1DcacheStoreMisses)) + if this.RegisterFrameworks != nil { + s = append(s, "RegisterFrameworks: "+fmt.Sprintf("%#v", this.RegisterFrameworks)+",\n") } - if m.L1DcachePrefetches != nil { - n += 2 + sovMesos(uint64(*m.L1DcachePrefetches)) + if this.RunTasks != nil { + s = append(s, "RunTasks: "+fmt.Sprintf("%#v", this.RunTasks)+",\n") } - if m.L1DcachePrefetchMisses != nil { - n += 2 + sovMesos(uint64(*m.L1DcachePrefetchMisses)) + if this.ShutdownFrameworks != nil { + s = append(s, "ShutdownFrameworks: "+fmt.Sprintf("%#v", this.ShutdownFrameworks)+",\n") } - if m.L1IcacheLoads != nil { - n += 2 + sovMesos(uint64(*m.L1IcacheLoads)) + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") } - if m.L1IcacheLoadMisses != nil { - n += 2 + sovMesos(uint64(*m.L1IcacheLoadMisses)) + s = append(s, "}") + return strings.Join(s, "") +} +func (this *RateLimit) GoString() string { + if this == nil { + return "nil" } - if m.L1IcachePrefetches != nil { - n += 2 + sovMesos(uint64(*m.L1IcachePrefetches)) + s := make([]string, 0, 7) + s = append(s, "&mesosproto.RateLimit{") + if this.Qps != nil { + s = append(s, "Qps: "+valueToGoStringMesos(this.Qps, "float64")+",\n") } - if m.L1IcachePrefetchMisses != nil { - n += 2 + sovMesos(uint64(*m.L1IcachePrefetchMisses)) + if this.Principal != nil { + s = append(s, "Principal: "+valueToGoStringMesos(this.Principal, "string")+",\n") } - if m.LlcLoads != nil { - n += 2 + sovMesos(uint64(*m.LlcLoads)) + if this.Capacity != nil { + s = append(s, "Capacity: "+valueToGoStringMesos(this.Capacity, "uint64")+",\n") } - if m.LlcLoadMisses != nil { - n += 2 + sovMesos(uint64(*m.LlcLoadMisses)) + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") } - if m.LlcStores != nil { - n += 2 + sovMesos(uint64(*m.LlcStores)) + s = append(s, "}") + return strings.Join(s, "") +} +func (this *RateLimits) GoString() string { + if this == nil { + return "nil" } - if m.LlcStoreMisses != nil { - n += 2 + sovMesos(uint64(*m.LlcStoreMisses)) + s := make([]string, 0, 7) + s = append(s, "&mesosproto.RateLimits{") + if this.Limits != nil { + s = append(s, "Limits: "+fmt.Sprintf("%#v", this.Limits)+",\n") } - if m.LlcPrefetches != nil { - n += 2 + sovMesos(uint64(*m.LlcPrefetches)) + if this.AggregateDefaultQps != nil { + s = append(s, "AggregateDefaultQps: "+valueToGoStringMesos(this.AggregateDefaultQps, "float64")+",\n") } - if m.LlcPrefetchMisses != nil { - n += 2 + sovMesos(uint64(*m.LlcPrefetchMisses)) + if this.AggregateDefaultCapacity != nil { + s = append(s, "AggregateDefaultCapacity: "+valueToGoStringMesos(this.AggregateDefaultCapacity, "uint64")+",\n") } - if m.DtlbLoads != nil { - n += 2 + sovMesos(uint64(*m.DtlbLoads)) + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") } - if m.DtlbLoadMisses != nil { - n += 2 + sovMesos(uint64(*m.DtlbLoadMisses)) + s = append(s, "}") + return strings.Join(s, "") +} +func (this *Volume) GoString() string { + if this == nil { + return "nil" } - if m.DtlbStores != nil { - n += 2 + sovMesos(uint64(*m.DtlbStores)) + s := make([]string, 0, 7) + s = append(s, "&mesosproto.Volume{") + if this.ContainerPath != nil { + s = append(s, "ContainerPath: "+valueToGoStringMesos(this.ContainerPath, "string")+",\n") } - if m.DtlbStoreMisses != nil { - n += 2 + sovMesos(uint64(*m.DtlbStoreMisses)) + if this.HostPath != nil { + s = append(s, "HostPath: "+valueToGoStringMesos(this.HostPath, "string")+",\n") } - if m.DtlbPrefetches != nil { - n += 2 + sovMesos(uint64(*m.DtlbPrefetches)) + if this.Mode != nil { + s = append(s, "Mode: "+valueToGoStringMesos(this.Mode, "mesosproto.Volume_Mode")+",\n") } - if m.DtlbPrefetchMisses != nil { - n += 2 + sovMesos(uint64(*m.DtlbPrefetchMisses)) + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") } - if m.ItlbLoads != nil { - n += 2 + sovMesos(uint64(*m.ItlbLoads)) + s = append(s, "}") + return strings.Join(s, "") +} +func (this *ContainerInfo) GoString() string { + if this == nil { + return "nil" } - if m.ItlbLoadMisses != nil { - n += 2 + sovMesos(uint64(*m.ItlbLoadMisses)) + s := make([]string, 0, 8) + s = append(s, "&mesosproto.ContainerInfo{") + if this.Type != nil { + s = append(s, "Type: "+valueToGoStringMesos(this.Type, "mesosproto.ContainerInfo_Type")+",\n") } - if m.BranchLoads != nil { - n += 2 + sovMesos(uint64(*m.BranchLoads)) + if this.Volumes != nil { + s = append(s, "Volumes: "+fmt.Sprintf("%#v", this.Volumes)+",\n") } - if m.BranchLoadMisses != nil { - n += 2 + sovMesos(uint64(*m.BranchLoadMisses)) + if this.Hostname != nil { + s = append(s, "Hostname: "+valueToGoStringMesos(this.Hostname, "string")+",\n") } - if m.NodeLoads != nil { - n += 2 + sovMesos(uint64(*m.NodeLoads)) + if this.Docker != nil { + s = append(s, "Docker: "+fmt.Sprintf("%#v", this.Docker)+",\n") } - if m.NodeLoadMisses != nil { - n += 2 + sovMesos(uint64(*m.NodeLoadMisses)) + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") } - if m.NodeStores != nil { - n += 2 + sovMesos(uint64(*m.NodeStores)) + s = append(s, "}") + return strings.Join(s, "") +} +func (this *ContainerInfo_DockerInfo) GoString() string { + if this == nil { + return "nil" } - if m.NodeStoreMisses != nil { - n += 2 + sovMesos(uint64(*m.NodeStoreMisses)) + s := make([]string, 0, 10) + s = append(s, "&mesosproto.ContainerInfo_DockerInfo{") + if this.Image != nil { + s = append(s, "Image: "+valueToGoStringMesos(this.Image, "string")+",\n") } - if m.NodePrefetches != nil { - n += 2 + sovMesos(uint64(*m.NodePrefetches)) + if this.Network != nil { + s = append(s, "Network: "+valueToGoStringMesos(this.Network, "mesosproto.ContainerInfo_DockerInfo_Network")+",\n") } - if m.NodePrefetchMisses != nil { - n += 2 + sovMesos(uint64(*m.NodePrefetchMisses)) + if this.PortMappings != nil { + s = append(s, "PortMappings: "+fmt.Sprintf("%#v", this.PortMappings)+",\n") } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + if this.Privileged != nil { + s = append(s, "Privileged: "+valueToGoStringMesos(this.Privileged, "bool")+",\n") } - return n -} - -func (m *Request) Size() (n int) { - var l int - _ = l - if m.SlaveId != nil { - l = m.SlaveId.Size() - n += 1 + l + sovMesos(uint64(l)) + if this.Parameters != nil { + s = append(s, "Parameters: "+fmt.Sprintf("%#v", this.Parameters)+",\n") } - if len(m.Resources) > 0 { - for _, e := range m.Resources { - l = e.Size() - n += 1 + l + sovMesos(uint64(l)) - } + if this.ForcePullImage != nil { + s = append(s, "ForcePullImage: "+valueToGoStringMesos(this.ForcePullImage, "bool")+",\n") } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") } - return n + s = append(s, "}") + return strings.Join(s, "") } - -func (m *Offer) Size() (n int) { - var l int - _ = l - if m.Id != nil { - l = m.Id.Size() - n += 1 + l + sovMesos(uint64(l)) +func (this *ContainerInfo_DockerInfo_PortMapping) GoString() string { + if this == nil { + return "nil" } - if m.FrameworkId != nil { - l = m.FrameworkId.Size() - n += 1 + l + sovMesos(uint64(l)) + s := make([]string, 0, 7) + s = append(s, "&mesosproto.ContainerInfo_DockerInfo_PortMapping{") + if this.HostPort != nil { + s = append(s, "HostPort: "+valueToGoStringMesos(this.HostPort, "uint32")+",\n") } - if m.SlaveId != nil { - l = m.SlaveId.Size() - n += 1 + l + sovMesos(uint64(l)) + if this.ContainerPort != nil { + s = append(s, "ContainerPort: "+valueToGoStringMesos(this.ContainerPort, "uint32")+",\n") } - if m.Hostname != nil { - l = len(*m.Hostname) - n += 1 + l + sovMesos(uint64(l)) + if this.Protocol != nil { + s = append(s, "Protocol: "+valueToGoStringMesos(this.Protocol, "string")+",\n") } - if len(m.Resources) > 0 { - for _, e := range m.Resources { - l = e.Size() - n += 1 + l + sovMesos(uint64(l)) - } + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") } - if len(m.Attributes) > 0 { - for _, e := range m.Attributes { - l = e.Size() - n += 1 + l + sovMesos(uint64(l)) - } + s = append(s, "}") + return strings.Join(s, "") +} +func (this *Labels) GoString() string { + if this == nil { + return "nil" } - if len(m.ExecutorIds) > 0 { - for _, e := range m.ExecutorIds { - l = e.Size() - n += 1 + l + sovMesos(uint64(l)) - } + s := make([]string, 0, 5) + s = append(s, "&mesosproto.Labels{") + if this.Labels != nil { + s = append(s, "Labels: "+fmt.Sprintf("%#v", this.Labels)+",\n") } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") } - return n + s = append(s, "}") + return strings.Join(s, "") } - -func (m *TaskInfo) Size() (n int) { - var l int - _ = l - if m.Name != nil { - l = len(*m.Name) - n += 1 + l + sovMesos(uint64(l)) - } - if m.TaskId != nil { - l = m.TaskId.Size() - n += 1 + l + sovMesos(uint64(l)) +func (this *Label) GoString() string { + if this == nil { + return "nil" } - if m.SlaveId != nil { - l = m.SlaveId.Size() - n += 1 + l + sovMesos(uint64(l)) + s := make([]string, 0, 6) + s = append(s, "&mesosproto.Label{") + if this.Key != nil { + s = append(s, "Key: "+valueToGoStringMesos(this.Key, "string")+",\n") } - if len(m.Resources) > 0 { - for _, e := range m.Resources { - l = e.Size() - n += 1 + l + sovMesos(uint64(l)) - } + if this.Value != nil { + s = append(s, "Value: "+valueToGoStringMesos(this.Value, "string")+",\n") } - if m.Executor != nil { - l = m.Executor.Size() - n += 1 + l + sovMesos(uint64(l)) + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") } - if m.Command != nil { - l = m.Command.Size() - n += 1 + l + sovMesos(uint64(l)) + s = append(s, "}") + return strings.Join(s, "") +} +func (this *Port) GoString() string { + if this == nil { + return "nil" } - if m.Container != nil { - l = m.Container.Size() - n += 1 + l + sovMesos(uint64(l)) + s := make([]string, 0, 7) + s = append(s, "&mesosproto.Port{") + if this.Number != nil { + s = append(s, "Number: "+valueToGoStringMesos(this.Number, "uint32")+",\n") } - if m.Data != nil { - l = len(m.Data) - n += 1 + l + sovMesos(uint64(l)) + if this.Name != nil { + s = append(s, "Name: "+valueToGoStringMesos(this.Name, "string")+",\n") } - if m.HealthCheck != nil { - l = m.HealthCheck.Size() - n += 1 + l + sovMesos(uint64(l)) + if this.Protocol != nil { + s = append(s, "Protocol: "+valueToGoStringMesos(this.Protocol, "string")+",\n") } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") } - return n + s = append(s, "}") + return strings.Join(s, "") } - -func (m *TaskStatus) Size() (n int) { - var l int - _ = l - if m.TaskId != nil { - l = m.TaskId.Size() - n += 1 + l + sovMesos(uint64(l)) +func (this *Ports) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 5) + s = append(s, "&mesosproto.Ports{") + if this.Ports != nil { + s = append(s, "Ports: "+fmt.Sprintf("%#v", this.Ports)+",\n") + } + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") } - if m.State != nil { - n += 1 + sovMesos(uint64(*m.State)) + s = append(s, "}") + return strings.Join(s, "") +} +func (this *DiscoveryInfo) GoString() string { + if this == nil { + return "nil" } - if m.Message != nil { - l = len(*m.Message) - n += 1 + l + sovMesos(uint64(l)) + s := make([]string, 0, 11) + s = append(s, "&mesosproto.DiscoveryInfo{") + if this.Visibility != nil { + s = append(s, "Visibility: "+valueToGoStringMesos(this.Visibility, "mesosproto.DiscoveryInfo_Visibility")+",\n") } - if m.Source != nil { - n += 1 + sovMesos(uint64(*m.Source)) + if this.Name != nil { + s = append(s, "Name: "+valueToGoStringMesos(this.Name, "string")+",\n") } - if m.Reason != nil { - n += 1 + sovMesos(uint64(*m.Reason)) + if this.Environment != nil { + s = append(s, "Environment: "+valueToGoStringMesos(this.Environment, "string")+",\n") } - if m.Data != nil { - l = len(m.Data) - n += 1 + l + sovMesos(uint64(l)) + if this.Location != nil { + s = append(s, "Location: "+valueToGoStringMesos(this.Location, "string")+",\n") } - if m.SlaveId != nil { - l = m.SlaveId.Size() - n += 1 + l + sovMesos(uint64(l)) + if this.Version != nil { + s = append(s, "Version: "+valueToGoStringMesos(this.Version, "string")+",\n") } - if m.ExecutorId != nil { - l = m.ExecutorId.Size() - n += 1 + l + sovMesos(uint64(l)) + if this.Ports != nil { + s = append(s, "Ports: "+fmt.Sprintf("%#v", this.Ports)+",\n") } - if m.Timestamp != nil { - n += 9 + if this.Labels != nil { + s = append(s, "Labels: "+fmt.Sprintf("%#v", this.Labels)+",\n") } - if m.Healthy != nil { - n += 2 + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + s = append(s, "}") + return strings.Join(s, "") +} +func valueToGoStringMesos(v interface{}, typ string) string { + rv := reflect.ValueOf(v) + if rv.IsNil() { + return "nil" } - return n + pv := reflect.Indirect(rv).Interface() + return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) } - -func (m *Filters) Size() (n int) { - var l int - _ = l - if m.RefuseSeconds != nil { - n += 9 +func extensionToGoStringMesos(e map[int32]github_com_gogo_protobuf_proto.Extension) string { + if e == nil { + return "nil" } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + s := "map[int32]proto.Extension{" + keys := make([]int, 0, len(e)) + for k := range e { + keys = append(keys, int(k)) } - return n -} - -func (m *Environment) Size() (n int) { - var l int - _ = l - if len(m.Variables) > 0 { - for _, e := range m.Variables { - l = e.Size() - n += 1 + l + sovMesos(uint64(l)) - } + sort.Ints(keys) + ss := []string{} + for _, k := range keys { + ss = append(ss, strconv.Itoa(k)+": "+e[int32(k)].GoString()) } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + s += strings.Join(ss, ",") + "}" + return s +} +func (m *FrameworkID) Marshal() (data []byte, err error) { + size := m.Size() + data = make([]byte, size) + n, err := m.MarshalTo(data) + if err != nil { + return nil, err } - return n + return data[:n], nil } -func (m *Environment_Variable) Size() (n int) { +func (m *FrameworkID) MarshalTo(data []byte) (int, error) { + var i int + _ = i var l int _ = l - if m.Name != nil { - l = len(*m.Name) - n += 1 + l + sovMesos(uint64(l)) - } - if m.Value != nil { - l = len(*m.Value) - n += 1 + l + sovMesos(uint64(l)) + if m.Value == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("value") + } else { + data[i] = 0xa + i++ + i = encodeVarintMesos(data, i, uint64(len(*m.Value))) + i += copy(data[i:], *m.Value) } if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + i += copy(data[i:], m.XXX_unrecognized) } - return n + return i, nil } -func (m *Parameter) Size() (n int) { - var l int - _ = l - if m.Key != nil { - l = len(*m.Key) - n += 1 + l + sovMesos(uint64(l)) - } - if m.Value != nil { - l = len(*m.Value) - n += 1 + l + sovMesos(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) +func (m *OfferID) Marshal() (data []byte, err error) { + size := m.Size() + data = make([]byte, size) + n, err := m.MarshalTo(data) + if err != nil { + return nil, err } - return n + return data[:n], nil } -func (m *Parameters) Size() (n int) { +func (m *OfferID) MarshalTo(data []byte) (int, error) { + var i int + _ = i var l int _ = l - if len(m.Parameter) > 0 { - for _, e := range m.Parameter { - l = e.Size() - n += 1 + l + sovMesos(uint64(l)) - } + if m.Value == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("value") + } else { + data[i] = 0xa + i++ + i = encodeVarintMesos(data, i, uint64(len(*m.Value))) + i += copy(data[i:], *m.Value) } if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + i += copy(data[i:], m.XXX_unrecognized) } - return n + return i, nil } -func (m *Credential) Size() (n int) { - var l int - _ = l - if m.Principal != nil { - l = len(*m.Principal) - n += 1 + l + sovMesos(uint64(l)) - } - if m.Secret != nil { - l = len(m.Secret) - n += 1 + l + sovMesos(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) +func (m *SlaveID) Marshal() (data []byte, err error) { + size := m.Size() + data = make([]byte, size) + n, err := m.MarshalTo(data) + if err != nil { + return nil, err } - return n + return data[:n], nil } -func (m *Credentials) Size() (n int) { +func (m *SlaveID) MarshalTo(data []byte) (int, error) { + var i int + _ = i var l int _ = l - if len(m.Credentials) > 0 { - for _, e := range m.Credentials { - l = e.Size() - n += 1 + l + sovMesos(uint64(l)) - } + if m.Value == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("value") + } else { + data[i] = 0xa + i++ + i = encodeVarintMesos(data, i, uint64(len(*m.Value))) + i += copy(data[i:], *m.Value) } if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + i += copy(data[i:], m.XXX_unrecognized) } - return n + return i, nil } -func (m *ACL) Size() (n int) { - var l int - _ = l - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) +func (m *TaskID) Marshal() (data []byte, err error) { + size := m.Size() + data = make([]byte, size) + n, err := m.MarshalTo(data) + if err != nil { + return nil, err } - return n + return data[:n], nil } -func (m *ACL_Entity) Size() (n int) { +func (m *TaskID) MarshalTo(data []byte) (int, error) { + var i int + _ = i var l int _ = l - if m.Type != nil { - n += 1 + sovMesos(uint64(*m.Type)) - } - if len(m.Values) > 0 { - for _, s := range m.Values { - l = len(s) - n += 1 + l + sovMesos(uint64(l)) - } + if m.Value == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("value") + } else { + data[i] = 0xa + i++ + i = encodeVarintMesos(data, i, uint64(len(*m.Value))) + i += copy(data[i:], *m.Value) } if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + i += copy(data[i:], m.XXX_unrecognized) } - return n + return i, nil } -func (m *ACL_RegisterFramework) Size() (n int) { - var l int - _ = l - if m.Principals != nil { - l = m.Principals.Size() - n += 1 + l + sovMesos(uint64(l)) - } - if m.Roles != nil { - l = m.Roles.Size() - n += 1 + l + sovMesos(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) +func (m *ExecutorID) Marshal() (data []byte, err error) { + size := m.Size() + data = make([]byte, size) + n, err := m.MarshalTo(data) + if err != nil { + return nil, err } - return n + return data[:n], nil } -func (m *ACL_RunTask) Size() (n int) { +func (m *ExecutorID) MarshalTo(data []byte) (int, error) { + var i int + _ = i var l int _ = l - if m.Principals != nil { - l = m.Principals.Size() - n += 1 + l + sovMesos(uint64(l)) - } - if m.Users != nil { - l = m.Users.Size() - n += 1 + l + sovMesos(uint64(l)) + if m.Value == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("value") + } else { + data[i] = 0xa + i++ + i = encodeVarintMesos(data, i, uint64(len(*m.Value))) + i += copy(data[i:], *m.Value) } if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + i += copy(data[i:], m.XXX_unrecognized) } - return n + return i, nil } -func (m *ACL_ShutdownFramework) Size() (n int) { - var l int - _ = l - if m.Principals != nil { - l = m.Principals.Size() - n += 1 + l + sovMesos(uint64(l)) +func (m *ContainerID) Marshal() (data []byte, err error) { + size := m.Size() + data = make([]byte, size) + n, err := m.MarshalTo(data) + if err != nil { + return nil, err } - if m.FrameworkPrincipals != nil { - l = m.FrameworkPrincipals.Size() - n += 1 + l + sovMesos(uint64(l)) + return data[:n], nil +} + +func (m *ContainerID) MarshalTo(data []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.Value == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("value") + } else { + data[i] = 0xa + i++ + i = encodeVarintMesos(data, i, uint64(len(*m.Value))) + i += copy(data[i:], *m.Value) } if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + i += copy(data[i:], m.XXX_unrecognized) } - return n + return i, nil } -func (m *ACLs) Size() (n int) { +func (m *FrameworkInfo) 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 *FrameworkInfo) MarshalTo(data []byte) (int, error) { + var i int + _ = i var l int _ = l - if m.Permissive != nil { - n += 2 + if m.User == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("user") + } else { + data[i] = 0xa + i++ + i = encodeVarintMesos(data, i, uint64(len(*m.User))) + i += copy(data[i:], *m.User) } - if len(m.RegisterFrameworks) > 0 { - for _, e := range m.RegisterFrameworks { - l = e.Size() - n += 1 + l + sovMesos(uint64(l)) - } + if m.Name == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("name") + } else { + data[i] = 0x12 + i++ + i = encodeVarintMesos(data, i, uint64(len(*m.Name))) + i += copy(data[i:], *m.Name) } - if len(m.RunTasks) > 0 { - for _, e := range m.RunTasks { - l = e.Size() - n += 1 + l + sovMesos(uint64(l)) + if m.Id != nil { + data[i] = 0x1a + i++ + i = encodeVarintMesos(data, i, uint64(m.Id.Size())) + n1, err := m.Id.MarshalTo(data[i:]) + if err != nil { + return 0, err } + i += n1 } - if len(m.ShutdownFrameworks) > 0 { - for _, e := range m.ShutdownFrameworks { - l = e.Size() - n += 1 + l + sovMesos(uint64(l)) + if m.FailoverTimeout != nil { + data[i] = 0x21 + i++ + i = encodeFixed64Mesos(data, i, uint64(math.Float64bits(*m.FailoverTimeout))) + } + if m.Checkpoint != nil { + data[i] = 0x28 + i++ + if *m.Checkpoint { + data[i] = 1 + } else { + data[i] = 0 } + i++ } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + if m.Role != nil { + data[i] = 0x32 + i++ + i = encodeVarintMesos(data, i, uint64(len(*m.Role))) + i += copy(data[i:], *m.Role) } - return n -} - -func (m *RateLimit) Size() (n int) { - var l int - _ = l - if m.Qps != nil { - n += 9 + if m.Hostname != nil { + data[i] = 0x3a + i++ + i = encodeVarintMesos(data, i, uint64(len(*m.Hostname))) + i += copy(data[i:], *m.Hostname) } if m.Principal != nil { - l = len(*m.Principal) - n += 1 + l + sovMesos(uint64(l)) + data[i] = 0x42 + i++ + i = encodeVarintMesos(data, i, uint64(len(*m.Principal))) + i += copy(data[i:], *m.Principal) } - if m.Capacity != nil { - n += 1 + sovMesos(uint64(*m.Capacity)) + if m.WebuiUrl != nil { + data[i] = 0x4a + i++ + i = encodeVarintMesos(data, i, uint64(len(*m.WebuiUrl))) + i += copy(data[i:], *m.WebuiUrl) + } + if len(m.Capabilities) > 0 { + for _, msg := range m.Capabilities { + data[i] = 0x52 + i++ + i = encodeVarintMesos(data, i, uint64(msg.Size())) + n, err := msg.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n + } } if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + i += copy(data[i:], m.XXX_unrecognized) } - return n + return i, nil } -func (m *RateLimits) Size() (n int) { - var l int - _ = l - if len(m.Limits) > 0 { - for _, e := range m.Limits { - l = e.Size() - n += 1 + l + sovMesos(uint64(l)) - } - } - if m.AggregateDefaultQps != nil { - n += 9 - } - if m.AggregateDefaultCapacity != nil { - n += 1 + sovMesos(uint64(*m.AggregateDefaultCapacity)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) +func (m *FrameworkInfo_Capability) Marshal() (data []byte, err error) { + size := m.Size() + data = make([]byte, size) + n, err := m.MarshalTo(data) + if err != nil { + return nil, err } - return n + return data[:n], nil } -func (m *Volume) Size() (n int) { +func (m *FrameworkInfo_Capability) MarshalTo(data []byte) (int, error) { + var i int + _ = i var l int _ = l - if m.ContainerPath != nil { - l = len(*m.ContainerPath) - n += 1 + l + sovMesos(uint64(l)) - } - if m.HostPath != nil { - l = len(*m.HostPath) - n += 1 + l + sovMesos(uint64(l)) - } - if m.Mode != nil { - n += 1 + sovMesos(uint64(*m.Mode)) + if m.Type == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("type") + } else { + data[i] = 0x8 + i++ + i = encodeVarintMesos(data, i, uint64(*m.Type)) } if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + i += copy(data[i:], m.XXX_unrecognized) } - return n + return i, nil } -func (m *ContainerInfo) Size() (n int) { +func (m *HealthCheck) 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 *HealthCheck) MarshalTo(data []byte) (int, error) { + var i int + _ = i var l int _ = l - if m.Type != nil { - n += 1 + sovMesos(uint64(*m.Type)) - } - if len(m.Volumes) > 0 { - for _, e := range m.Volumes { - l = e.Size() - n += 1 + l + sovMesos(uint64(l)) + if m.Http != nil { + data[i] = 0xa + i++ + i = encodeVarintMesos(data, i, uint64(m.Http.Size())) + n2, err := m.Http.MarshalTo(data[i:]) + if err != nil { + return 0, err } + i += n2 } - if m.Hostname != nil { - l = len(*m.Hostname) - n += 1 + l + sovMesos(uint64(l)) + if m.DelaySeconds != nil { + data[i] = 0x11 + i++ + i = encodeFixed64Mesos(data, i, uint64(math.Float64bits(*m.DelaySeconds))) } - if m.Docker != nil { - l = m.Docker.Size() - n += 1 + l + sovMesos(uint64(l)) + if m.IntervalSeconds != nil { + data[i] = 0x19 + i++ + i = encodeFixed64Mesos(data, i, uint64(math.Float64bits(*m.IntervalSeconds))) + } + if m.TimeoutSeconds != nil { + data[i] = 0x21 + i++ + i = encodeFixed64Mesos(data, i, uint64(math.Float64bits(*m.TimeoutSeconds))) + } + if m.ConsecutiveFailures != nil { + data[i] = 0x28 + i++ + i = encodeVarintMesos(data, i, uint64(*m.ConsecutiveFailures)) + } + if m.GracePeriodSeconds != nil { + data[i] = 0x31 + i++ + i = encodeFixed64Mesos(data, i, uint64(math.Float64bits(*m.GracePeriodSeconds))) + } + if m.Command != nil { + data[i] = 0x3a + i++ + i = encodeVarintMesos(data, i, uint64(m.Command.Size())) + n3, err := m.Command.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n3 } if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + i += copy(data[i:], m.XXX_unrecognized) } - return n + return i, nil } -func (m *ContainerInfo_DockerInfo) Size() (n int) { +func (m *HealthCheck_HTTP) 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 *HealthCheck_HTTP) MarshalTo(data []byte) (int, error) { + var i int + _ = i var l int _ = l - if m.Image != nil { - l = len(*m.Image) - n += 1 + l + sovMesos(uint64(l)) - } - if m.Network != nil { - n += 1 + sovMesos(uint64(*m.Network)) - } - if len(m.PortMappings) > 0 { - for _, e := range m.PortMappings { - l = e.Size() - n += 1 + l + sovMesos(uint64(l)) - } - } - if m.Privileged != nil { - n += 2 + if m.Port == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("port") + } else { + data[i] = 0x8 + i++ + i = encodeVarintMesos(data, i, uint64(*m.Port)) } - if len(m.Parameters) > 0 { - for _, e := range m.Parameters { - l = e.Size() - n += 1 + l + sovMesos(uint64(l)) + if m.Path != nil { + data[i] = 0x12 + i++ + i = encodeVarintMesos(data, i, uint64(len(*m.Path))) + i += copy(data[i:], *m.Path) + } + if len(m.Statuses) > 0 { + for _, num := range m.Statuses { + data[i] = 0x20 + i++ + i = encodeVarintMesos(data, i, uint64(num)) } } if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + i += copy(data[i:], m.XXX_unrecognized) } - return n + return i, nil } -func (m *ContainerInfo_DockerInfo_PortMapping) Size() (n int) { +func (m *CommandInfo) 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 *CommandInfo) MarshalTo(data []byte) (int, error) { + var i int + _ = i var l int _ = l - if m.HostPort != nil { - n += 1 + sovMesos(uint64(*m.HostPort)) - } - if m.ContainerPort != nil { - n += 1 + sovMesos(uint64(*m.ContainerPort)) + if len(m.Uris) > 0 { + for _, msg := range m.Uris { + data[i] = 0xa + i++ + i = encodeVarintMesos(data, i, uint64(msg.Size())) + n, err := msg.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n + } } - if m.Protocol != nil { - l = len(*m.Protocol) - n += 1 + l + sovMesos(uint64(l)) + if m.Environment != nil { + data[i] = 0x12 + i++ + i = encodeVarintMesos(data, i, uint64(m.Environment.Size())) + n4, err := m.Environment.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n4 } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + if m.Value != nil { + data[i] = 0x1a + i++ + i = encodeVarintMesos(data, i, uint64(len(*m.Value))) + i += copy(data[i:], *m.Value) } - return n -} - -func sovMesos(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break + if m.Container != nil { + data[i] = 0x22 + i++ + i = encodeVarintMesos(data, i, uint64(m.Container.Size())) + n5, err := m.Container.MarshalTo(data[i:]) + if err != nil { + return 0, err } + i += n5 } - return n -} -func sozMesos(x uint64) (n int) { - return sovMesos(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func NewPopulatedFrameworkID(r randyMesos, easy bool) *FrameworkID { - this := &FrameworkID{} - v1 := randStringMesos(r) - this.Value = &v1 - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 2) + if m.User != nil { + data[i] = 0x2a + i++ + i = encodeVarintMesos(data, i, uint64(len(*m.User))) + i += copy(data[i:], *m.User) } - return this -} - -func NewPopulatedOfferID(r randyMesos, easy bool) *OfferID { - this := &OfferID{} - v2 := randStringMesos(r) - this.Value = &v2 - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 2) + if m.Shell != nil { + data[i] = 0x30 + i++ + if *m.Shell { + data[i] = 1 + } else { + data[i] = 0 + } + i++ } - return this -} - -func NewPopulatedSlaveID(r randyMesos, easy bool) *SlaveID { - this := &SlaveID{} - v3 := randStringMesos(r) - this.Value = &v3 - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 2) + if len(m.Arguments) > 0 { + for _, s := range m.Arguments { + data[i] = 0x3a + 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) + } } - return this -} - -func NewPopulatedTaskID(r randyMesos, easy bool) *TaskID { - this := &TaskID{} - v4 := randStringMesos(r) - this.Value = &v4 - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 2) + if m.XXX_unrecognized != nil { + i += copy(data[i:], m.XXX_unrecognized) } - return this + return i, nil } -func NewPopulatedExecutorID(r randyMesos, easy bool) *ExecutorID { - this := &ExecutorID{} - v5 := randStringMesos(r) - this.Value = &v5 - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 2) +func (m *CommandInfo_URI) Marshal() (data []byte, err error) { + size := m.Size() + data = make([]byte, size) + n, err := m.MarshalTo(data) + if err != nil { + return nil, err } - return this + return data[:n], nil } -func NewPopulatedContainerID(r randyMesos, easy bool) *ContainerID { - this := &ContainerID{} - v6 := randStringMesos(r) - this.Value = &v6 - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 2) +func (m *CommandInfo_URI) MarshalTo(data []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.Value == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("value") + } else { + data[i] = 0xa + i++ + i = encodeVarintMesos(data, i, uint64(len(*m.Value))) + i += copy(data[i:], *m.Value) } - return this -} - -func NewPopulatedFrameworkInfo(r randyMesos, easy bool) *FrameworkInfo { - this := &FrameworkInfo{} - v7 := randStringMesos(r) - this.User = &v7 - v8 := randStringMesos(r) - this.Name = &v8 - if r.Intn(10) != 0 { - this.Id = NewPopulatedFrameworkID(r, easy) + if m.Executable != nil { + data[i] = 0x10 + i++ + if *m.Executable { + data[i] = 1 + } else { + data[i] = 0 + } + i++ } - if r.Intn(10) != 0 { - v9 := r.Float64() - if r.Intn(2) == 0 { - v9 *= -1 + if m.Extract != nil { + data[i] = 0x18 + i++ + if *m.Extract { + data[i] = 1 + } else { + data[i] = 0 } - this.FailoverTimeout = &v9 + i++ } - if r.Intn(10) != 0 { - v10 := bool(r.Intn(2) == 0) - this.Checkpoint = &v10 + if m.Cache != nil { + data[i] = 0x20 + i++ + if *m.Cache { + data[i] = 1 + } else { + data[i] = 0 + } + i++ } - if r.Intn(10) != 0 { - v11 := randStringMesos(r) - this.Role = &v11 + if m.XXX_unrecognized != nil { + i += copy(data[i:], m.XXX_unrecognized) } - if r.Intn(10) != 0 { - v12 := randStringMesos(r) - this.Hostname = &v12 + return i, nil +} + +func (m *CommandInfo_ContainerInfo) Marshal() (data []byte, err error) { + size := m.Size() + data = make([]byte, size) + n, err := m.MarshalTo(data) + if err != nil { + return nil, err } - if r.Intn(10) != 0 { - v13 := randStringMesos(r) - this.Principal = &v13 + return data[:n], nil +} + +func (m *CommandInfo_ContainerInfo) MarshalTo(data []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.Image == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("image") + } else { + data[i] = 0xa + i++ + i = encodeVarintMesos(data, i, uint64(len(*m.Image))) + i += copy(data[i:], *m.Image) } - if r.Intn(10) != 0 { - v14 := randStringMesos(r) - this.WebuiUrl = &v14 + if len(m.Options) > 0 { + for _, s := range m.Options { + data[i] = 0x12 + 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 !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 10) + if m.XXX_unrecognized != nil { + i += copy(data[i:], m.XXX_unrecognized) } - return this + return i, nil } -func NewPopulatedHealthCheck(r randyMesos, easy bool) *HealthCheck { - this := &HealthCheck{} - if r.Intn(10) != 0 { - this.Http = NewPopulatedHealthCheck_HTTP(r, easy) +func (m *ExecutorInfo) Marshal() (data []byte, err error) { + size := m.Size() + data = make([]byte, size) + n, err := m.MarshalTo(data) + if err != nil { + return nil, err } - if r.Intn(10) != 0 { - v15 := r.Float64() - if r.Intn(2) == 0 { - v15 *= -1 + return data[:n], nil +} + +func (m *ExecutorInfo) MarshalTo(data []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.ExecutorId == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("executor_id") + } else { + data[i] = 0xa + i++ + i = encodeVarintMesos(data, i, uint64(m.ExecutorId.Size())) + n6, err := m.ExecutorId.MarshalTo(data[i:]) + if err != nil { + return 0, err } - this.DelaySeconds = &v15 + i += n6 } - if r.Intn(10) != 0 { - v16 := r.Float64() - if r.Intn(2) == 0 { - v16 *= -1 - } - this.IntervalSeconds = &v16 + if m.Data != nil { + data[i] = 0x22 + i++ + i = encodeVarintMesos(data, i, uint64(len(m.Data))) + i += copy(data[i:], m.Data) } - if r.Intn(10) != 0 { - v17 := r.Float64() - if r.Intn(2) == 0 { - v17 *= -1 + if len(m.Resources) > 0 { + for _, msg := range m.Resources { + data[i] = 0x2a + i++ + i = encodeVarintMesos(data, i, uint64(msg.Size())) + n, err := msg.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n } - this.TimeoutSeconds = &v17 } - if r.Intn(10) != 0 { - v18 := r.Uint32() - this.ConsecutiveFailures = &v18 + if m.Command == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("command") + } else { + data[i] = 0x3a + i++ + i = encodeVarintMesos(data, i, uint64(m.Command.Size())) + n7, err := m.Command.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n7 } - if r.Intn(10) != 0 { - v19 := r.Float64() - if r.Intn(2) == 0 { - v19 *= -1 + if m.FrameworkId != nil { + data[i] = 0x42 + i++ + i = encodeVarintMesos(data, i, uint64(m.FrameworkId.Size())) + n8, err := m.FrameworkId.MarshalTo(data[i:]) + if err != nil { + return 0, err } - this.GracePeriodSeconds = &v19 + i += n8 } - if r.Intn(10) != 0 { - this.Command = NewPopulatedCommandInfo(r, easy) + if m.Name != nil { + data[i] = 0x4a + i++ + i = encodeVarintMesos(data, i, uint64(len(*m.Name))) + i += copy(data[i:], *m.Name) } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 8) + if m.Source != nil { + data[i] = 0x52 + i++ + i = encodeVarintMesos(data, i, uint64(len(*m.Source))) + i += copy(data[i:], *m.Source) } - return this -} - -func NewPopulatedHealthCheck_HTTP(r randyMesos, easy bool) *HealthCheck_HTTP { - this := &HealthCheck_HTTP{} - v20 := r.Uint32() - this.Port = &v20 - if r.Intn(10) != 0 { - v21 := randStringMesos(r) - this.Path = &v21 + if m.Container != nil { + data[i] = 0x5a + i++ + i = encodeVarintMesos(data, i, uint64(m.Container.Size())) + n9, err := m.Container.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n9 } - if r.Intn(10) != 0 { - v22 := r.Intn(100) - this.Statuses = make([]uint32, v22) - for i := 0; i < v22; i++ { - this.Statuses[i] = r.Uint32() + if m.Discovery != nil { + data[i] = 0x62 + i++ + i = encodeVarintMesos(data, i, uint64(m.Discovery.Size())) + n10, err := m.Discovery.MarshalTo(data[i:]) + if err != nil { + return 0, err } + i += n10 } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 5) + if m.XXX_unrecognized != nil { + i += copy(data[i:], m.XXX_unrecognized) } - return this + return i, nil } -func NewPopulatedCommandInfo(r randyMesos, easy bool) *CommandInfo { - this := &CommandInfo{} - if r.Intn(10) != 0 { - this.Container = NewPopulatedCommandInfo_ContainerInfo(r, easy) - } - if r.Intn(10) != 0 { - v23 := r.Intn(10) - this.Uris = make([]*CommandInfo_URI, v23) - for i := 0; i < v23; i++ { - this.Uris[i] = NewPopulatedCommandInfo_URI(r, easy) - } - } - if r.Intn(10) != 0 { - this.Environment = NewPopulatedEnvironment(r, easy) - } - if r.Intn(10) != 0 { - v24 := bool(r.Intn(2) == 0) - this.Shell = &v24 +func (m *MasterInfo) Marshal() (data []byte, err error) { + size := m.Size() + data = make([]byte, size) + n, err := m.MarshalTo(data) + if err != nil { + return nil, err } - if r.Intn(10) != 0 { - v25 := randStringMesos(r) - this.Value = &v25 + return data[:n], nil +} + +func (m *MasterInfo) MarshalTo(data []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.Id == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("id") + } else { + data[i] = 0xa + i++ + i = encodeVarintMesos(data, i, uint64(len(*m.Id))) + i += copy(data[i:], *m.Id) } - if r.Intn(10) != 0 { - v26 := r.Intn(10) - this.Arguments = make([]string, v26) - for i := 0; i < v26; i++ { - this.Arguments[i] = randStringMesos(r) - } + if m.Ip == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("ip") + } else { + data[i] = 0x10 + i++ + i = encodeVarintMesos(data, i, uint64(*m.Ip)) } - if r.Intn(10) != 0 { - v27 := randStringMesos(r) - this.User = &v27 + if m.Port == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("port") + } else { + data[i] = 0x18 + i++ + i = encodeVarintMesos(data, i, uint64(*m.Port)) } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 8) + if m.Pid != nil { + data[i] = 0x22 + i++ + i = encodeVarintMesos(data, i, uint64(len(*m.Pid))) + i += copy(data[i:], *m.Pid) } - return this -} - -func NewPopulatedCommandInfo_URI(r randyMesos, easy bool) *CommandInfo_URI { - this := &CommandInfo_URI{} - v28 := randStringMesos(r) - this.Value = &v28 - if r.Intn(10) != 0 { - v29 := bool(r.Intn(2) == 0) - this.Executable = &v29 + if m.Hostname != nil { + data[i] = 0x2a + i++ + i = encodeVarintMesos(data, i, uint64(len(*m.Hostname))) + i += copy(data[i:], *m.Hostname) } - if r.Intn(10) != 0 { - v30 := bool(r.Intn(2) == 0) - this.Extract = &v30 + if m.Version != nil { + data[i] = 0x32 + i++ + i = encodeVarintMesos(data, i, uint64(len(*m.Version))) + i += copy(data[i:], *m.Version) } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 4) + if m.XXX_unrecognized != nil { + i += copy(data[i:], m.XXX_unrecognized) } - return this + return i, nil } -func NewPopulatedCommandInfo_ContainerInfo(r randyMesos, easy bool) *CommandInfo_ContainerInfo { - this := &CommandInfo_ContainerInfo{} - v31 := randStringMesos(r) - this.Image = &v31 - if r.Intn(10) != 0 { - v32 := r.Intn(10) - this.Options = make([]string, v32) - for i := 0; i < v32; i++ { - this.Options[i] = randStringMesos(r) - } - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 3) +func (m *SlaveInfo) Marshal() (data []byte, err error) { + size := m.Size() + data = make([]byte, size) + n, err := m.MarshalTo(data) + if err != nil { + return nil, err } - return this + return data[:n], nil } -func NewPopulatedExecutorInfo(r randyMesos, easy bool) *ExecutorInfo { - this := &ExecutorInfo{} - this.ExecutorId = NewPopulatedExecutorID(r, easy) - if r.Intn(10) != 0 { - this.FrameworkId = NewPopulatedFrameworkID(r, easy) - } - this.Command = NewPopulatedCommandInfo(r, easy) - if r.Intn(10) != 0 { - this.Container = NewPopulatedContainerInfo(r, easy) +func (m *SlaveInfo) MarshalTo(data []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.Hostname == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("hostname") + } else { + data[i] = 0xa + i++ + i = encodeVarintMesos(data, i, uint64(len(*m.Hostname))) + i += copy(data[i:], *m.Hostname) } - if r.Intn(10) != 0 { - v33 := r.Intn(10) - this.Resources = make([]*Resource, v33) - for i := 0; i < v33; i++ { - this.Resources[i] = NewPopulatedResource(r, easy) + if len(m.Resources) > 0 { + for _, msg := range m.Resources { + data[i] = 0x1a + i++ + i = encodeVarintMesos(data, i, uint64(msg.Size())) + n, err := msg.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n } } - if r.Intn(10) != 0 { - v34 := randStringMesos(r) - this.Name = &v34 + if len(m.Attributes) > 0 { + for _, msg := range m.Attributes { + data[i] = 0x2a + i++ + i = encodeVarintMesos(data, i, uint64(msg.Size())) + n, err := msg.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n + } } - if r.Intn(10) != 0 { - v35 := randStringMesos(r) - this.Source = &v35 + if m.Id != nil { + data[i] = 0x32 + i++ + i = encodeVarintMesos(data, i, uint64(m.Id.Size())) + n11, err := m.Id.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n11 } - if r.Intn(10) != 0 { - v36 := r.Intn(100) - this.Data = make([]byte, v36) - for i := 0; i < v36; i++ { - this.Data[i] = byte(r.Intn(256)) + if m.Checkpoint != nil { + data[i] = 0x38 + i++ + if *m.Checkpoint { + data[i] = 1 + } else { + data[i] = 0 } + i++ } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 12) + if m.Port != nil { + data[i] = 0x40 + i++ + i = encodeVarintMesos(data, i, uint64(*m.Port)) } - return this + if m.XXX_unrecognized != nil { + i += copy(data[i:], m.XXX_unrecognized) + } + return i, nil } -func NewPopulatedMasterInfo(r randyMesos, easy bool) *MasterInfo { - this := &MasterInfo{} - v37 := randStringMesos(r) - this.Id = &v37 - v38 := r.Uint32() - this.Ip = &v38 - v39 := r.Uint32() - this.Port = &v39 - if r.Intn(10) != 0 { - v40 := randStringMesos(r) - this.Pid = &v40 - } - if r.Intn(10) != 0 { - v41 := randStringMesos(r) - this.Hostname = &v41 - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 6) +func (m *Value) Marshal() (data []byte, err error) { + size := m.Size() + data = make([]byte, size) + n, err := m.MarshalTo(data) + if err != nil { + return nil, err } - return this + return data[:n], nil } -func NewPopulatedSlaveInfo(r randyMesos, easy bool) *SlaveInfo { - this := &SlaveInfo{} - v42 := randStringMesos(r) - this.Hostname = &v42 - if r.Intn(10) != 0 { - v43 := r.Int31() - if r.Intn(2) == 0 { - v43 *= -1 - } - this.Port = &v43 +func (m *Value) MarshalTo(data []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.Type == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("type") + } else { + data[i] = 0x8 + i++ + i = encodeVarintMesos(data, i, uint64(*m.Type)) } - if r.Intn(10) != 0 { - v44 := r.Intn(10) - this.Resources = make([]*Resource, v44) - for i := 0; i < v44; i++ { - this.Resources[i] = NewPopulatedResource(r, easy) + if m.Scalar != nil { + data[i] = 0x12 + i++ + i = encodeVarintMesos(data, i, uint64(m.Scalar.Size())) + n12, err := m.Scalar.MarshalTo(data[i:]) + if err != nil { + return 0, err } + i += n12 } - if r.Intn(10) != 0 { - v45 := r.Intn(10) - this.Attributes = make([]*Attribute, v45) - for i := 0; i < v45; i++ { - this.Attributes[i] = NewPopulatedAttribute(r, easy) + if m.Ranges != nil { + data[i] = 0x1a + i++ + i = encodeVarintMesos(data, i, uint64(m.Ranges.Size())) + n13, err := m.Ranges.MarshalTo(data[i:]) + if err != nil { + return 0, err } + i += n13 } - if r.Intn(10) != 0 { - this.Id = NewPopulatedSlaveID(r, easy) + if m.Set != nil { + data[i] = 0x22 + i++ + i = encodeVarintMesos(data, i, uint64(m.Set.Size())) + n14, err := m.Set.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n14 } - if r.Intn(10) != 0 { - v46 := bool(r.Intn(2) == 0) - this.Checkpoint = &v46 + if m.Text != nil { + data[i] = 0x2a + i++ + i = encodeVarintMesos(data, i, uint64(m.Text.Size())) + n15, err := m.Text.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n15 } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 9) + if m.XXX_unrecognized != nil { + i += copy(data[i:], m.XXX_unrecognized) } - return this + return i, nil } -func NewPopulatedValue(r randyMesos, easy bool) *Value { - this := &Value{} - v47 := Value_Type([]int32{0, 1, 2, 3}[r.Intn(4)]) - this.Type = &v47 - if r.Intn(10) != 0 { - this.Scalar = NewPopulatedValue_Scalar(r, easy) - } - if r.Intn(10) != 0 { - this.Ranges = NewPopulatedValue_Ranges(r, easy) - } - if r.Intn(10) != 0 { - this.Set = NewPopulatedValue_Set(r, easy) - } - if r.Intn(10) != 0 { - this.Text = NewPopulatedValue_Text(r, easy) - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 6) +func (m *Value_Scalar) Marshal() (data []byte, err error) { + size := m.Size() + data = make([]byte, size) + n, err := m.MarshalTo(data) + if err != nil { + return nil, err } - return this + return data[:n], nil } -func NewPopulatedValue_Scalar(r randyMesos, easy bool) *Value_Scalar { - this := &Value_Scalar{} - v48 := r.Float64() - if r.Intn(2) == 0 { - v48 *= -1 +func (m *Value_Scalar) MarshalTo(data []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.Value == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("value") + } else { + data[i] = 0x9 + i++ + i = encodeFixed64Mesos(data, i, uint64(math.Float64bits(*m.Value))) } - this.Value = &v48 - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 2) + if m.XXX_unrecognized != nil { + i += copy(data[i:], m.XXX_unrecognized) } - return this + return i, nil } -func NewPopulatedValue_Range(r randyMesos, easy bool) *Value_Range { - this := &Value_Range{} - v49 := uint64(r.Uint32()) - this.Begin = &v49 - v50 := uint64(r.Uint32()) - this.End = &v50 - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 3) +func (m *Value_Range) Marshal() (data []byte, err error) { + size := m.Size() + data = make([]byte, size) + n, err := m.MarshalTo(data) + if err != nil { + return nil, err } - return this + return data[:n], nil } -func NewPopulatedValue_Ranges(r randyMesos, easy bool) *Value_Ranges { - this := &Value_Ranges{} - if r.Intn(10) != 0 { - v51 := r.Intn(10) - this.Range = make([]*Value_Range, v51) - for i := 0; i < v51; i++ { - this.Range[i] = NewPopulatedValue_Range(r, easy) - } +func (m *Value_Range) MarshalTo(data []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.Begin == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("begin") + } else { + data[i] = 0x8 + i++ + i = encodeVarintMesos(data, i, uint64(*m.Begin)) } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 2) + if m.End == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("end") + } else { + data[i] = 0x10 + i++ + i = encodeVarintMesos(data, i, uint64(*m.End)) } - return this + if m.XXX_unrecognized != nil { + i += copy(data[i:], m.XXX_unrecognized) + } + return i, nil } -func NewPopulatedValue_Set(r randyMesos, easy bool) *Value_Set { - this := &Value_Set{} - if r.Intn(10) != 0 { - v52 := r.Intn(10) - this.Item = make([]string, v52) - for i := 0; i < v52; i++ { - this.Item[i] = randStringMesos(r) +func (m *Value_Ranges) 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 *Value_Ranges) MarshalTo(data []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if len(m.Range) > 0 { + for _, msg := range m.Range { + data[i] = 0xa + i++ + i = encodeVarintMesos(data, i, uint64(msg.Size())) + n, err := msg.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n } } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 2) + if m.XXX_unrecognized != nil { + i += copy(data[i:], m.XXX_unrecognized) } - return this + return i, nil } -func NewPopulatedValue_Text(r randyMesos, easy bool) *Value_Text { - this := &Value_Text{} - v53 := randStringMesos(r) - this.Value = &v53 - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 2) +func (m *Value_Set) Marshal() (data []byte, err error) { + size := m.Size() + data = make([]byte, size) + n, err := m.MarshalTo(data) + if err != nil { + return nil, err } - return this + return data[:n], nil } -func NewPopulatedAttribute(r randyMesos, easy bool) *Attribute { - this := &Attribute{} - v54 := randStringMesos(r) - this.Name = &v54 - v55 := Value_Type([]int32{0, 1, 2, 3}[r.Intn(4)]) - this.Type = &v55 - if r.Intn(10) != 0 { - this.Scalar = NewPopulatedValue_Scalar(r, easy) - } - if r.Intn(10) != 0 { - this.Ranges = NewPopulatedValue_Ranges(r, easy) - } - if r.Intn(10) != 0 { - this.Set = NewPopulatedValue_Set(r, easy) +func (m *Value_Set) MarshalTo(data []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if len(m.Item) > 0 { + for _, s := range m.Item { + 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 r.Intn(10) != 0 { - this.Text = NewPopulatedValue_Text(r, easy) + if m.XXX_unrecognized != nil { + i += copy(data[i:], m.XXX_unrecognized) } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 7) + return i, nil +} + +func (m *Value_Text) Marshal() (data []byte, err error) { + size := m.Size() + data = make([]byte, size) + n, err := m.MarshalTo(data) + if err != nil { + return nil, err } - return this + return data[:n], nil } -func NewPopulatedResource(r randyMesos, easy bool) *Resource { - this := &Resource{} - v56 := randStringMesos(r) - this.Name = &v56 - v57 := Value_Type([]int32{0, 1, 2, 3}[r.Intn(4)]) - this.Type = &v57 - if r.Intn(10) != 0 { - this.Scalar = NewPopulatedValue_Scalar(r, easy) - } - if r.Intn(10) != 0 { - this.Ranges = NewPopulatedValue_Ranges(r, easy) - } - if r.Intn(10) != 0 { - this.Set = NewPopulatedValue_Set(r, easy) +func (m *Value_Text) MarshalTo(data []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.Value == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("value") + } else { + data[i] = 0xa + i++ + i = encodeVarintMesos(data, i, uint64(len(*m.Value))) + i += copy(data[i:], *m.Value) } - if r.Intn(10) != 0 { - v58 := randStringMesos(r) - this.Role = &v58 + if m.XXX_unrecognized != nil { + i += copy(data[i:], m.XXX_unrecognized) } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 7) + return i, nil +} + +func (m *Attribute) Marshal() (data []byte, err error) { + size := m.Size() + data = make([]byte, size) + n, err := m.MarshalTo(data) + if err != nil { + return nil, err } - return this + return data[:n], nil } -func NewPopulatedResourceStatistics(r randyMesos, easy bool) *ResourceStatistics { - this := &ResourceStatistics{} - v59 := r.Float64() - if r.Intn(2) == 0 { - v59 *= -1 +func (m *Attribute) MarshalTo(data []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.Name == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("name") + } else { + data[i] = 0xa + i++ + i = encodeVarintMesos(data, i, uint64(len(*m.Name))) + i += copy(data[i:], *m.Name) } - this.Timestamp = &v59 - if r.Intn(10) != 0 { - v60 := r.Float64() - if r.Intn(2) == 0 { - v60 *= -1 - } - this.CpusUserTimeSecs = &v60 + if m.Type == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("type") + } else { + data[i] = 0x10 + i++ + i = encodeVarintMesos(data, i, uint64(*m.Type)) } - if r.Intn(10) != 0 { - v61 := r.Float64() - if r.Intn(2) == 0 { - v61 *= -1 + if m.Scalar != nil { + data[i] = 0x1a + i++ + i = encodeVarintMesos(data, i, uint64(m.Scalar.Size())) + n16, err := m.Scalar.MarshalTo(data[i:]) + if err != nil { + return 0, err } - this.CpusSystemTimeSecs = &v61 + i += n16 } - if r.Intn(10) != 0 { - v62 := r.Float64() - if r.Intn(2) == 0 { - v62 *= -1 + if m.Ranges != nil { + data[i] = 0x22 + i++ + i = encodeVarintMesos(data, i, uint64(m.Ranges.Size())) + n17, err := m.Ranges.MarshalTo(data[i:]) + if err != nil { + return 0, err } - this.CpusLimit = &v62 - } - if r.Intn(10) != 0 { - v63 := r.Uint32() - this.CpusNrPeriods = &v63 - } - if r.Intn(10) != 0 { - v64 := r.Uint32() - this.CpusNrThrottled = &v64 + i += n17 } - if r.Intn(10) != 0 { - v65 := r.Float64() - if r.Intn(2) == 0 { - v65 *= -1 + if m.Text != nil { + data[i] = 0x2a + i++ + i = encodeVarintMesos(data, i, uint64(m.Text.Size())) + n18, err := m.Text.MarshalTo(data[i:]) + if err != nil { + return 0, err } - this.CpusThrottledTimeSecs = &v65 - } - if r.Intn(10) != 0 { - v66 := uint64(r.Uint32()) - this.MemRssBytes = &v66 - } - if r.Intn(10) != 0 { - v67 := uint64(r.Uint32()) - this.MemLimitBytes = &v67 - } - if r.Intn(10) != 0 { - v68 := uint64(r.Uint32()) - this.MemFileBytes = &v68 - } - if r.Intn(10) != 0 { - v69 := uint64(r.Uint32()) - this.MemAnonBytes = &v69 - } - if r.Intn(10) != 0 { - v70 := uint64(r.Uint32()) - this.MemMappedFileBytes = &v70 - } - if r.Intn(10) != 0 { - this.Perf = NewPopulatedPerfStatistics(r, easy) - } - if r.Intn(10) != 0 { - v71 := uint64(r.Uint32()) - this.NetRxPackets = &v71 + i += n18 } - if r.Intn(10) != 0 { - v72 := uint64(r.Uint32()) - this.NetRxBytes = &v72 + if m.Set != nil { + data[i] = 0x32 + i++ + i = encodeVarintMesos(data, i, uint64(m.Set.Size())) + n19, err := m.Set.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n19 } - if r.Intn(10) != 0 { - v73 := uint64(r.Uint32()) - this.NetRxErrors = &v73 + if m.XXX_unrecognized != nil { + i += copy(data[i:], m.XXX_unrecognized) } - if r.Intn(10) != 0 { - v74 := uint64(r.Uint32()) - this.NetRxDropped = &v74 + return i, nil +} + +func (m *Resource) Marshal() (data []byte, err error) { + size := m.Size() + data = make([]byte, size) + n, err := m.MarshalTo(data) + if err != nil { + return nil, err } - if r.Intn(10) != 0 { - v75 := uint64(r.Uint32()) - this.NetTxPackets = &v75 + return data[:n], nil +} + +func (m *Resource) MarshalTo(data []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.Name == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("name") + } else { + data[i] = 0xa + i++ + i = encodeVarintMesos(data, i, uint64(len(*m.Name))) + i += copy(data[i:], *m.Name) } - if r.Intn(10) != 0 { - v76 := uint64(r.Uint32()) - this.NetTxBytes = &v76 + if m.Type == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("type") + } else { + data[i] = 0x10 + i++ + i = encodeVarintMesos(data, i, uint64(*m.Type)) } - if r.Intn(10) != 0 { - v77 := uint64(r.Uint32()) - this.NetTxErrors = &v77 + if m.Scalar != nil { + data[i] = 0x1a + i++ + i = encodeVarintMesos(data, i, uint64(m.Scalar.Size())) + n20, err := m.Scalar.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n20 } - if r.Intn(10) != 0 { - v78 := uint64(r.Uint32()) - this.NetTxDropped = &v78 + if m.Ranges != nil { + data[i] = 0x22 + i++ + i = encodeVarintMesos(data, i, uint64(m.Ranges.Size())) + n21, err := m.Ranges.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n21 } - if r.Intn(10) != 0 { - v79 := r.Float64() - if r.Intn(2) == 0 { - v79 *= -1 + if m.Set != nil { + data[i] = 0x2a + i++ + i = encodeVarintMesos(data, i, uint64(m.Set.Size())) + n22, err := m.Set.MarshalTo(data[i:]) + if err != nil { + return 0, err } - this.NetTcpRttMicrosecsP50 = &v79 + i += n22 } - if r.Intn(10) != 0 { - v80 := r.Float64() - if r.Intn(2) == 0 { - v80 *= -1 + if m.Role != nil { + data[i] = 0x32 + i++ + i = encodeVarintMesos(data, i, uint64(len(*m.Role))) + i += copy(data[i:], *m.Role) + } + if m.Disk != nil { + data[i] = 0x3a + i++ + i = encodeVarintMesos(data, i, uint64(m.Disk.Size())) + n23, err := m.Disk.MarshalTo(data[i:]) + if err != nil { + return 0, err } - this.NetTcpRttMicrosecsP90 = &v80 + i += n23 } - if r.Intn(10) != 0 { - v81 := r.Float64() - if r.Intn(2) == 0 { - v81 *= -1 + if m.Reservation != nil { + data[i] = 0x42 + i++ + i = encodeVarintMesos(data, i, uint64(m.Reservation.Size())) + n24, err := m.Reservation.MarshalTo(data[i:]) + if err != nil { + return 0, err } - this.NetTcpRttMicrosecsP95 = &v81 + i += n24 } - if r.Intn(10) != 0 { - v82 := r.Float64() - if r.Intn(2) == 0 { - v82 *= -1 + if m.Revocable != nil { + data[i] = 0x4a + i++ + i = encodeVarintMesos(data, i, uint64(m.Revocable.Size())) + n25, err := m.Revocable.MarshalTo(data[i:]) + if err != nil { + return 0, err } - this.NetTcpRttMicrosecsP99 = &v82 + i += n25 } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 26) + if m.XXX_unrecognized != nil { + i += copy(data[i:], m.XXX_unrecognized) } - return this + return i, nil } -func NewPopulatedResourceUsage(r randyMesos, easy bool) *ResourceUsage { - this := &ResourceUsage{} - this.SlaveId = NewPopulatedSlaveID(r, easy) - this.FrameworkId = NewPopulatedFrameworkID(r, easy) - if r.Intn(10) != 0 { - this.ExecutorId = NewPopulatedExecutorID(r, easy) - } - if r.Intn(10) != 0 { - v83 := randStringMesos(r) - this.ExecutorName = &v83 - } - if r.Intn(10) != 0 { - this.TaskId = NewPopulatedTaskID(r, easy) - } - if r.Intn(10) != 0 { - this.Statistics = NewPopulatedResourceStatistics(r, easy) - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 7) +func (m *Resource_ReservationInfo) Marshal() (data []byte, err error) { + size := m.Size() + data = make([]byte, size) + n, err := m.MarshalTo(data) + if err != nil { + return nil, err } - return this + return data[:n], nil } -func NewPopulatedPerfStatistics(r randyMesos, easy bool) *PerfStatistics { - this := &PerfStatistics{} - v84 := r.Float64() - if r.Intn(2) == 0 { - v84 *= -1 - } - this.Timestamp = &v84 - v85 := r.Float64() - if r.Intn(2) == 0 { - v85 *= -1 - } - this.Duration = &v85 - if r.Intn(10) != 0 { - v86 := uint64(r.Uint32()) - this.Cycles = &v86 - } - if r.Intn(10) != 0 { - v87 := uint64(r.Uint32()) - this.StalledCyclesFrontend = &v87 - } - if r.Intn(10) != 0 { - v88 := uint64(r.Uint32()) - this.StalledCyclesBackend = &v88 - } - if r.Intn(10) != 0 { - v89 := uint64(r.Uint32()) - this.Instructions = &v89 - } - if r.Intn(10) != 0 { - v90 := uint64(r.Uint32()) - this.CacheReferences = &v90 - } - if r.Intn(10) != 0 { - v91 := uint64(r.Uint32()) - this.CacheMisses = &v91 - } - if r.Intn(10) != 0 { - v92 := uint64(r.Uint32()) - this.Branches = &v92 - } - if r.Intn(10) != 0 { - v93 := uint64(r.Uint32()) - this.BranchMisses = &v93 +func (m *Resource_ReservationInfo) MarshalTo(data []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.Principal == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("principal") + } else { + data[i] = 0xa + i++ + i = encodeVarintMesos(data, i, uint64(len(*m.Principal))) + i += copy(data[i:], *m.Principal) } - if r.Intn(10) != 0 { - v94 := uint64(r.Uint32()) - this.BusCycles = &v94 + if m.XXX_unrecognized != nil { + i += copy(data[i:], m.XXX_unrecognized) } - if r.Intn(10) != 0 { - v95 := uint64(r.Uint32()) - this.RefCycles = &v95 + return i, nil +} + +func (m *Resource_DiskInfo) Marshal() (data []byte, err error) { + size := m.Size() + data = make([]byte, size) + n, err := m.MarshalTo(data) + if err != nil { + return nil, err } - if r.Intn(10) != 0 { - v96 := r.Float64() - if r.Intn(2) == 0 { - v96 *= -1 + return data[:n], nil +} + +func (m *Resource_DiskInfo) MarshalTo(data []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.Persistence != nil { + data[i] = 0xa + i++ + i = encodeVarintMesos(data, i, uint64(m.Persistence.Size())) + n26, err := m.Persistence.MarshalTo(data[i:]) + if err != nil { + return 0, err } - this.CpuClock = &v96 + i += n26 } - if r.Intn(10) != 0 { - v97 := r.Float64() - if r.Intn(2) == 0 { - v97 *= -1 + if m.Volume != nil { + data[i] = 0x12 + i++ + i = encodeVarintMesos(data, i, uint64(m.Volume.Size())) + n27, err := m.Volume.MarshalTo(data[i:]) + if err != nil { + return 0, err } - this.TaskClock = &v97 - } - if r.Intn(10) != 0 { - v98 := uint64(r.Uint32()) - this.PageFaults = &v98 - } - if r.Intn(10) != 0 { - v99 := uint64(r.Uint32()) - this.MinorFaults = &v99 - } - if r.Intn(10) != 0 { - v100 := uint64(r.Uint32()) - this.MajorFaults = &v100 - } - if r.Intn(10) != 0 { - v101 := uint64(r.Uint32()) - this.ContextSwitches = &v101 + i += n27 } - if r.Intn(10) != 0 { - v102 := uint64(r.Uint32()) - this.CpuMigrations = &v102 + if m.XXX_unrecognized != nil { + i += copy(data[i:], m.XXX_unrecognized) } - if r.Intn(10) != 0 { - v103 := uint64(r.Uint32()) - this.AlignmentFaults = &v103 + return i, nil +} + +func (m *Resource_DiskInfo_Persistence) Marshal() (data []byte, err error) { + size := m.Size() + data = make([]byte, size) + n, err := m.MarshalTo(data) + if err != nil { + return nil, err } - if r.Intn(10) != 0 { - v104 := uint64(r.Uint32()) - this.EmulationFaults = &v104 + return data[:n], nil +} + +func (m *Resource_DiskInfo_Persistence) MarshalTo(data []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.Id == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("id") + } else { + data[i] = 0xa + i++ + i = encodeVarintMesos(data, i, uint64(len(*m.Id))) + i += copy(data[i:], *m.Id) } - if r.Intn(10) != 0 { - v105 := uint64(r.Uint32()) - this.L1DcacheLoads = &v105 + if m.XXX_unrecognized != nil { + i += copy(data[i:], m.XXX_unrecognized) } - if r.Intn(10) != 0 { - v106 := uint64(r.Uint32()) - this.L1DcacheLoadMisses = &v106 + return i, nil +} + +func (m *Resource_RevocableInfo) Marshal() (data []byte, err error) { + size := m.Size() + data = make([]byte, size) + n, err := m.MarshalTo(data) + if err != nil { + return nil, err } - if r.Intn(10) != 0 { - v107 := uint64(r.Uint32()) - this.L1DcacheStores = &v107 + return data[:n], nil +} + +func (m *Resource_RevocableInfo) MarshalTo(data []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i += copy(data[i:], m.XXX_unrecognized) } - if r.Intn(10) != 0 { - v108 := uint64(r.Uint32()) - this.L1DcacheStoreMisses = &v108 + return i, nil +} + +func (m *TrafficControlStatistics) Marshal() (data []byte, err error) { + size := m.Size() + data = make([]byte, size) + n, err := m.MarshalTo(data) + if err != nil { + return nil, err } - if r.Intn(10) != 0 { - v109 := uint64(r.Uint32()) - this.L1DcachePrefetches = &v109 + return data[:n], nil +} + +func (m *TrafficControlStatistics) MarshalTo(data []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.Id == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("id") + } else { + data[i] = 0xa + i++ + i = encodeVarintMesos(data, i, uint64(len(*m.Id))) + i += copy(data[i:], *m.Id) } - if r.Intn(10) != 0 { - v110 := uint64(r.Uint32()) - this.L1DcachePrefetchMisses = &v110 + if m.Backlog != nil { + data[i] = 0x10 + i++ + i = encodeVarintMesos(data, i, uint64(*m.Backlog)) } - if r.Intn(10) != 0 { - v111 := uint64(r.Uint32()) - this.L1IcacheLoads = &v111 + if m.Bytes != nil { + data[i] = 0x18 + i++ + i = encodeVarintMesos(data, i, uint64(*m.Bytes)) } - if r.Intn(10) != 0 { - v112 := uint64(r.Uint32()) - this.L1IcacheLoadMisses = &v112 + if m.Drops != nil { + data[i] = 0x20 + i++ + i = encodeVarintMesos(data, i, uint64(*m.Drops)) } - if r.Intn(10) != 0 { - v113 := uint64(r.Uint32()) - this.L1IcachePrefetches = &v113 + if m.Overlimits != nil { + data[i] = 0x28 + i++ + i = encodeVarintMesos(data, i, uint64(*m.Overlimits)) } - if r.Intn(10) != 0 { - v114 := uint64(r.Uint32()) - this.L1IcachePrefetchMisses = &v114 + if m.Packets != nil { + data[i] = 0x30 + i++ + i = encodeVarintMesos(data, i, uint64(*m.Packets)) } - if r.Intn(10) != 0 { - v115 := uint64(r.Uint32()) - this.LlcLoads = &v115 + if m.Qlen != nil { + data[i] = 0x38 + i++ + i = encodeVarintMesos(data, i, uint64(*m.Qlen)) } - if r.Intn(10) != 0 { - v116 := uint64(r.Uint32()) - this.LlcLoadMisses = &v116 + if m.Ratebps != nil { + data[i] = 0x40 + i++ + i = encodeVarintMesos(data, i, uint64(*m.Ratebps)) } - if r.Intn(10) != 0 { - v117 := uint64(r.Uint32()) - this.LlcStores = &v117 + if m.Ratepps != nil { + data[i] = 0x48 + i++ + i = encodeVarintMesos(data, i, uint64(*m.Ratepps)) } - if r.Intn(10) != 0 { - v118 := uint64(r.Uint32()) - this.LlcStoreMisses = &v118 + if m.Requeues != nil { + data[i] = 0x50 + i++ + i = encodeVarintMesos(data, i, uint64(*m.Requeues)) } - if r.Intn(10) != 0 { - v119 := uint64(r.Uint32()) - this.LlcPrefetches = &v119 + if m.XXX_unrecognized != nil { + i += copy(data[i:], m.XXX_unrecognized) } - if r.Intn(10) != 0 { - v120 := uint64(r.Uint32()) - this.LlcPrefetchMisses = &v120 + return i, nil +} + +func (m *ResourceStatistics) Marshal() (data []byte, err error) { + size := m.Size() + data = make([]byte, size) + n, err := m.MarshalTo(data) + if err != nil { + return nil, err } - if r.Intn(10) != 0 { - v121 := uint64(r.Uint32()) - this.DtlbLoads = &v121 + return data[:n], nil +} + +func (m *ResourceStatistics) MarshalTo(data []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.Timestamp == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("timestamp") + } else { + data[i] = 0x9 + i++ + i = encodeFixed64Mesos(data, i, uint64(math.Float64bits(*m.Timestamp))) } - if r.Intn(10) != 0 { - v122 := uint64(r.Uint32()) - this.DtlbLoadMisses = &v122 + if m.CpusUserTimeSecs != nil { + data[i] = 0x11 + i++ + i = encodeFixed64Mesos(data, i, uint64(math.Float64bits(*m.CpusUserTimeSecs))) } - if r.Intn(10) != 0 { - v123 := uint64(r.Uint32()) - this.DtlbStores = &v123 + if m.CpusSystemTimeSecs != nil { + data[i] = 0x19 + i++ + i = encodeFixed64Mesos(data, i, uint64(math.Float64bits(*m.CpusSystemTimeSecs))) } - if r.Intn(10) != 0 { - v124 := uint64(r.Uint32()) - this.DtlbStoreMisses = &v124 + if m.CpusLimit != nil { + data[i] = 0x21 + i++ + i = encodeFixed64Mesos(data, i, uint64(math.Float64bits(*m.CpusLimit))) } - if r.Intn(10) != 0 { - v125 := uint64(r.Uint32()) - this.DtlbPrefetches = &v125 + if m.MemRssBytes != nil { + data[i] = 0x28 + i++ + i = encodeVarintMesos(data, i, uint64(*m.MemRssBytes)) } - if r.Intn(10) != 0 { - v126 := uint64(r.Uint32()) - this.DtlbPrefetchMisses = &v126 + if m.MemLimitBytes != nil { + data[i] = 0x30 + i++ + i = encodeVarintMesos(data, i, uint64(*m.MemLimitBytes)) } - if r.Intn(10) != 0 { - v127 := uint64(r.Uint32()) - this.ItlbLoads = &v127 + if m.CpusNrPeriods != nil { + data[i] = 0x38 + i++ + i = encodeVarintMesos(data, i, uint64(*m.CpusNrPeriods)) } - if r.Intn(10) != 0 { - v128 := uint64(r.Uint32()) - this.ItlbLoadMisses = &v128 + if m.CpusNrThrottled != nil { + data[i] = 0x40 + i++ + i = encodeVarintMesos(data, i, uint64(*m.CpusNrThrottled)) } - if r.Intn(10) != 0 { - v129 := uint64(r.Uint32()) - this.BranchLoads = &v129 + if m.CpusThrottledTimeSecs != nil { + data[i] = 0x49 + i++ + i = encodeFixed64Mesos(data, i, uint64(math.Float64bits(*m.CpusThrottledTimeSecs))) } - if r.Intn(10) != 0 { - v130 := uint64(r.Uint32()) - this.BranchLoadMisses = &v130 + if m.MemFileBytes != nil { + data[i] = 0x50 + i++ + i = encodeVarintMesos(data, i, uint64(*m.MemFileBytes)) } - if r.Intn(10) != 0 { - v131 := uint64(r.Uint32()) - this.NodeLoads = &v131 + if m.MemAnonBytes != nil { + data[i] = 0x58 + i++ + i = encodeVarintMesos(data, i, uint64(*m.MemAnonBytes)) } - if r.Intn(10) != 0 { - v132 := uint64(r.Uint32()) - this.NodeLoadMisses = &v132 + if m.MemMappedFileBytes != nil { + data[i] = 0x60 + i++ + i = encodeVarintMesos(data, i, uint64(*m.MemMappedFileBytes)) } - if r.Intn(10) != 0 { - v133 := uint64(r.Uint32()) - this.NodeStores = &v133 + if m.Perf != nil { + data[i] = 0x6a + i++ + i = encodeVarintMesos(data, i, uint64(m.Perf.Size())) + n28, err := m.Perf.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n28 } - if r.Intn(10) != 0 { - v134 := uint64(r.Uint32()) - this.NodeStoreMisses = &v134 + if m.NetRxPackets != nil { + data[i] = 0x70 + i++ + i = encodeVarintMesos(data, i, uint64(*m.NetRxPackets)) } - if r.Intn(10) != 0 { - v135 := uint64(r.Uint32()) - this.NodePrefetches = &v135 + if m.NetRxBytes != nil { + data[i] = 0x78 + i++ + i = encodeVarintMesos(data, i, uint64(*m.NetRxBytes)) } - if r.Intn(10) != 0 { - v136 := uint64(r.Uint32()) - this.NodePrefetchMisses = &v136 + if m.NetRxErrors != nil { + data[i] = 0x80 + i++ + data[i] = 0x1 + i++ + i = encodeVarintMesos(data, i, uint64(*m.NetRxErrors)) } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 54) + if m.NetRxDropped != nil { + data[i] = 0x88 + i++ + data[i] = 0x1 + i++ + i = encodeVarintMesos(data, i, uint64(*m.NetRxDropped)) } - return this -} - -func NewPopulatedRequest(r randyMesos, easy bool) *Request { - this := &Request{} - if r.Intn(10) != 0 { - this.SlaveId = NewPopulatedSlaveID(r, easy) + if m.NetTxPackets != nil { + data[i] = 0x90 + i++ + data[i] = 0x1 + i++ + i = encodeVarintMesos(data, i, uint64(*m.NetTxPackets)) } - if r.Intn(10) != 0 { - v137 := r.Intn(10) - this.Resources = make([]*Resource, v137) - for i := 0; i < v137; i++ { - this.Resources[i] = NewPopulatedResource(r, easy) - } + if m.NetTxBytes != nil { + data[i] = 0x98 + i++ + data[i] = 0x1 + i++ + i = encodeVarintMesos(data, i, uint64(*m.NetTxBytes)) } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 3) + if m.NetTxErrors != nil { + data[i] = 0xa0 + i++ + data[i] = 0x1 + i++ + i = encodeVarintMesos(data, i, uint64(*m.NetTxErrors)) } - return this -} - -func NewPopulatedOffer(r randyMesos, easy bool) *Offer { - this := &Offer{} - this.Id = NewPopulatedOfferID(r, easy) - this.FrameworkId = NewPopulatedFrameworkID(r, easy) - this.SlaveId = NewPopulatedSlaveID(r, easy) - v138 := randStringMesos(r) - this.Hostname = &v138 - if r.Intn(10) != 0 { - v139 := r.Intn(10) - this.Resources = make([]*Resource, v139) - for i := 0; i < v139; i++ { - this.Resources[i] = NewPopulatedResource(r, easy) - } + if m.NetTxDropped != nil { + data[i] = 0xa8 + i++ + data[i] = 0x1 + i++ + i = encodeVarintMesos(data, i, uint64(*m.NetTxDropped)) } - if r.Intn(10) != 0 { - v140 := r.Intn(10) - this.Attributes = make([]*Attribute, v140) - for i := 0; i < v140; i++ { - this.Attributes[i] = NewPopulatedAttribute(r, easy) - } + if m.NetTcpRttMicrosecsP50 != nil { + data[i] = 0xb1 + i++ + data[i] = 0x1 + i++ + i = encodeFixed64Mesos(data, i, uint64(math.Float64bits(*m.NetTcpRttMicrosecsP50))) } - if r.Intn(10) != 0 { - v141 := r.Intn(10) - this.ExecutorIds = make([]*ExecutorID, v141) - for i := 0; i < v141; i++ { - this.ExecutorIds[i] = NewPopulatedExecutorID(r, easy) - } + if m.NetTcpRttMicrosecsP90 != nil { + data[i] = 0xb9 + i++ + data[i] = 0x1 + i++ + i = encodeFixed64Mesos(data, i, uint64(math.Float64bits(*m.NetTcpRttMicrosecsP90))) } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 8) + if m.NetTcpRttMicrosecsP95 != nil { + data[i] = 0xc1 + i++ + data[i] = 0x1 + i++ + i = encodeFixed64Mesos(data, i, uint64(math.Float64bits(*m.NetTcpRttMicrosecsP95))) } - return this -} - -func NewPopulatedTaskInfo(r randyMesos, easy bool) *TaskInfo { - this := &TaskInfo{} - v142 := randStringMesos(r) - this.Name = &v142 - this.TaskId = NewPopulatedTaskID(r, easy) - this.SlaveId = NewPopulatedSlaveID(r, easy) - if r.Intn(10) != 0 { - v143 := r.Intn(10) - this.Resources = make([]*Resource, v143) - for i := 0; i < v143; i++ { - this.Resources[i] = NewPopulatedResource(r, easy) - } + if m.NetTcpRttMicrosecsP99 != nil { + data[i] = 0xc9 + i++ + data[i] = 0x1 + i++ + i = encodeFixed64Mesos(data, i, uint64(math.Float64bits(*m.NetTcpRttMicrosecsP99))) } - if r.Intn(10) != 0 { - this.Executor = NewPopulatedExecutorInfo(r, easy) + if m.DiskLimitBytes != nil { + data[i] = 0xd0 + i++ + data[i] = 0x1 + i++ + i = encodeVarintMesos(data, i, uint64(*m.DiskLimitBytes)) } - if r.Intn(10) != 0 { - this.Command = NewPopulatedCommandInfo(r, easy) + if m.DiskUsedBytes != nil { + data[i] = 0xd8 + i++ + data[i] = 0x1 + i++ + i = encodeVarintMesos(data, i, uint64(*m.DiskUsedBytes)) } - if r.Intn(10) != 0 { - this.Container = NewPopulatedContainerInfo(r, easy) + if m.NetTcpActiveConnections != nil { + data[i] = 0xe1 + i++ + data[i] = 0x1 + i++ + i = encodeFixed64Mesos(data, i, uint64(math.Float64bits(*m.NetTcpActiveConnections))) } - if r.Intn(10) != 0 { - v144 := r.Intn(100) - this.Data = make([]byte, v144) - for i := 0; i < v144; i++ { - this.Data[i] = byte(r.Intn(256)) - } + if m.NetTcpTimeWaitConnections != nil { + data[i] = 0xe9 + i++ + data[i] = 0x1 + i++ + i = encodeFixed64Mesos(data, i, uint64(math.Float64bits(*m.NetTcpTimeWaitConnections))) } - if r.Intn(10) != 0 { - this.HealthCheck = NewPopulatedHealthCheck(r, easy) + if m.Processes != nil { + data[i] = 0xf0 + i++ + data[i] = 0x1 + i++ + i = encodeVarintMesos(data, i, uint64(*m.Processes)) } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 10) + if m.Threads != nil { + data[i] = 0xf8 + i++ + data[i] = 0x1 + i++ + i = encodeVarintMesos(data, i, uint64(*m.Threads)) } - return this -} - -func NewPopulatedTaskStatus(r randyMesos, easy bool) *TaskStatus { - this := &TaskStatus{} - this.TaskId = NewPopulatedTaskID(r, easy) - v145 := TaskState([]int32{6, 0, 1, 2, 3, 4, 5, 7}[r.Intn(8)]) - this.State = &v145 - if r.Intn(10) != 0 { - v146 := randStringMesos(r) - this.Message = &v146 + if m.MemLowPressureCounter != nil { + data[i] = 0x80 + i++ + data[i] = 0x2 + i++ + i = encodeVarintMesos(data, i, uint64(*m.MemLowPressureCounter)) } - if r.Intn(10) != 0 { - v147 := TaskStatus_Source([]int32{0, 1, 2}[r.Intn(3)]) - this.Source = &v147 + if m.MemMediumPressureCounter != nil { + data[i] = 0x88 + i++ + data[i] = 0x2 + i++ + i = encodeVarintMesos(data, i, uint64(*m.MemMediumPressureCounter)) } - if r.Intn(10) != 0 { - v148 := TaskStatus_Reason([]int32{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}[r.Intn(17)]) - this.Reason = &v148 + if m.MemCriticalPressureCounter != nil { + data[i] = 0x90 + i++ + data[i] = 0x2 + i++ + i = encodeVarintMesos(data, i, uint64(*m.MemCriticalPressureCounter)) } - if r.Intn(10) != 0 { - v149 := r.Intn(100) - this.Data = make([]byte, v149) - for i := 0; i < v149; i++ { - this.Data[i] = byte(r.Intn(256)) + if len(m.NetTrafficControlStatistics) > 0 { + for _, msg := range m.NetTrafficControlStatistics { + data[i] = 0x9a + i++ + data[i] = 0x2 + i++ + i = encodeVarintMesos(data, i, uint64(msg.Size())) + n, err := msg.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n } } - if r.Intn(10) != 0 { - this.SlaveId = NewPopulatedSlaveID(r, easy) + if m.MemTotalBytes != nil { + data[i] = 0xa0 + i++ + data[i] = 0x2 + i++ + i = encodeVarintMesos(data, i, uint64(*m.MemTotalBytes)) } - if r.Intn(10) != 0 { - this.ExecutorId = NewPopulatedExecutorID(r, easy) + if m.MemTotalMemswBytes != nil { + data[i] = 0xa8 + i++ + data[i] = 0x2 + i++ + i = encodeVarintMesos(data, i, uint64(*m.MemTotalMemswBytes)) } - if r.Intn(10) != 0 { - v150 := r.Float64() - if r.Intn(2) == 0 { - v150 *= -1 - } - this.Timestamp = &v150 + if m.MemSoftLimitBytes != nil { + data[i] = 0xb0 + i++ + data[i] = 0x2 + i++ + i = encodeVarintMesos(data, i, uint64(*m.MemSoftLimitBytes)) } - if r.Intn(10) != 0 { - v151 := bool(r.Intn(2) == 0) - this.Healthy = &v151 + if m.MemCacheBytes != nil { + data[i] = 0xb8 + i++ + data[i] = 0x2 + i++ + i = encodeVarintMesos(data, i, uint64(*m.MemCacheBytes)) } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 11) + if m.MemSwapBytes != nil { + data[i] = 0xc0 + i++ + data[i] = 0x2 + i++ + i = encodeVarintMesos(data, i, uint64(*m.MemSwapBytes)) } - return this + if m.XXX_unrecognized != nil { + i += copy(data[i:], m.XXX_unrecognized) + } + return i, nil } -func NewPopulatedFilters(r randyMesos, easy bool) *Filters { - this := &Filters{} - if r.Intn(10) != 0 { - v152 := r.Float64() - if r.Intn(2) == 0 { - v152 *= -1 - } - this.RefuseSeconds = &v152 - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 2) +func (m *ResourceUsage) Marshal() (data []byte, err error) { + size := m.Size() + data = make([]byte, size) + n, err := m.MarshalTo(data) + if err != nil { + return nil, err } - return this + return data[:n], nil } -func NewPopulatedEnvironment(r randyMesos, easy bool) *Environment { - this := &Environment{} - if r.Intn(10) != 0 { - v153 := r.Intn(10) - this.Variables = make([]*Environment_Variable, v153) - for i := 0; i < v153; i++ { - this.Variables[i] = NewPopulatedEnvironment_Variable(r, easy) +func (m *ResourceUsage) MarshalTo(data []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if len(m.Executors) > 0 { + for _, msg := range m.Executors { + data[i] = 0xa + i++ + i = encodeVarintMesos(data, i, uint64(msg.Size())) + n, err := msg.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n } } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 2) - } - return this -} - -func NewPopulatedEnvironment_Variable(r randyMesos, easy bool) *Environment_Variable { - this := &Environment_Variable{} - v154 := randStringMesos(r) - this.Name = &v154 - v155 := randStringMesos(r) - this.Value = &v155 - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 3) + if m.XXX_unrecognized != nil { + i += copy(data[i:], m.XXX_unrecognized) } - return this + return i, nil } -func NewPopulatedParameter(r randyMesos, easy bool) *Parameter { - this := &Parameter{} - v156 := randStringMesos(r) - this.Key = &v156 - v157 := randStringMesos(r) - this.Value = &v157 - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 3) +func (m *ResourceUsage_Executor) Marshal() (data []byte, err error) { + size := m.Size() + data = make([]byte, size) + n, err := m.MarshalTo(data) + if err != nil { + return nil, err } - return this + return data[:n], nil } -func NewPopulatedParameters(r randyMesos, easy bool) *Parameters { - this := &Parameters{} - if r.Intn(10) != 0 { - v158 := r.Intn(10) - this.Parameter = make([]*Parameter, v158) - for i := 0; i < v158; i++ { - this.Parameter[i] = NewPopulatedParameter(r, easy) +func (m *ResourceUsage_Executor) MarshalTo(data []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.ExecutorInfo == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("executor_info") + } else { + data[i] = 0xa + i++ + i = encodeVarintMesos(data, i, uint64(m.ExecutorInfo.Size())) + n29, err := m.ExecutorInfo.MarshalTo(data[i:]) + if err != nil { + return 0, err } + i += n29 } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 2) - } - return this -} - -func NewPopulatedCredential(r randyMesos, easy bool) *Credential { - this := &Credential{} - v159 := randStringMesos(r) - this.Principal = &v159 - if r.Intn(10) != 0 { - v160 := r.Intn(100) - this.Secret = make([]byte, v160) - for i := 0; i < v160; i++ { - this.Secret[i] = byte(r.Intn(256)) + if len(m.Allocated) > 0 { + for _, msg := range m.Allocated { + data[i] = 0x12 + i++ + i = encodeVarintMesos(data, i, uint64(msg.Size())) + n, err := msg.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n } } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 3) - } - return this -} - -func NewPopulatedCredentials(r randyMesos, easy bool) *Credentials { - this := &Credentials{} - if r.Intn(10) != 0 { - v161 := r.Intn(10) - this.Credentials = make([]*Credential, v161) - for i := 0; i < v161; i++ { - this.Credentials[i] = NewPopulatedCredential(r, easy) + if m.Statistics != nil { + data[i] = 0x1a + i++ + i = encodeVarintMesos(data, i, uint64(m.Statistics.Size())) + n30, err := m.Statistics.MarshalTo(data[i:]) + if err != nil { + return 0, err } + i += n30 } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 2) + if m.XXX_unrecognized != nil { + i += copy(data[i:], m.XXX_unrecognized) } - return this + return i, nil } -func NewPopulatedACL(r randyMesos, easy bool) *ACL { - this := &ACL{} - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 1) +func (m *PerfStatistics) Marshal() (data []byte, err error) { + size := m.Size() + data = make([]byte, size) + n, err := m.MarshalTo(data) + if err != nil { + return nil, err } - return this + return data[:n], nil } -func NewPopulatedACL_Entity(r randyMesos, easy bool) *ACL_Entity { - this := &ACL_Entity{} - if r.Intn(10) != 0 { - v162 := ACL_Entity_Type([]int32{0, 1, 2}[r.Intn(3)]) - this.Type = &v162 +func (m *PerfStatistics) MarshalTo(data []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.Timestamp == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("timestamp") + } else { + data[i] = 0x9 + i++ + i = encodeFixed64Mesos(data, i, uint64(math.Float64bits(*m.Timestamp))) } - if r.Intn(10) != 0 { - v163 := r.Intn(10) - this.Values = make([]string, v163) - for i := 0; i < v163; i++ { - this.Values[i] = randStringMesos(r) - } + if m.Duration == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("duration") + } else { + data[i] = 0x11 + i++ + i = encodeFixed64Mesos(data, i, uint64(math.Float64bits(*m.Duration))) } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 3) + if m.Cycles != nil { + data[i] = 0x18 + i++ + i = encodeVarintMesos(data, i, uint64(*m.Cycles)) } - return this -} - -func NewPopulatedACL_RegisterFramework(r randyMesos, easy bool) *ACL_RegisterFramework { - this := &ACL_RegisterFramework{} - this.Principals = NewPopulatedACL_Entity(r, easy) - this.Roles = NewPopulatedACL_Entity(r, easy) - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 3) + if m.StalledCyclesFrontend != nil { + data[i] = 0x20 + i++ + i = encodeVarintMesos(data, i, uint64(*m.StalledCyclesFrontend)) } - return this -} - -func NewPopulatedACL_RunTask(r randyMesos, easy bool) *ACL_RunTask { - this := &ACL_RunTask{} - this.Principals = NewPopulatedACL_Entity(r, easy) - this.Users = NewPopulatedACL_Entity(r, easy) - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 3) + if m.StalledCyclesBackend != nil { + data[i] = 0x28 + i++ + i = encodeVarintMesos(data, i, uint64(*m.StalledCyclesBackend)) } - return this -} - -func NewPopulatedACL_ShutdownFramework(r randyMesos, easy bool) *ACL_ShutdownFramework { - this := &ACL_ShutdownFramework{} - this.Principals = NewPopulatedACL_Entity(r, easy) - this.FrameworkPrincipals = NewPopulatedACL_Entity(r, easy) - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 3) + if m.Instructions != nil { + data[i] = 0x30 + i++ + i = encodeVarintMesos(data, i, uint64(*m.Instructions)) } - return this -} - -func NewPopulatedACLs(r randyMesos, easy bool) *ACLs { - this := &ACLs{} - if r.Intn(10) != 0 { - v164 := bool(r.Intn(2) == 0) - this.Permissive = &v164 + if m.CacheReferences != nil { + data[i] = 0x38 + i++ + i = encodeVarintMesos(data, i, uint64(*m.CacheReferences)) } - if r.Intn(10) != 0 { - v165 := r.Intn(10) - this.RegisterFrameworks = make([]*ACL_RegisterFramework, v165) - for i := 0; i < v165; i++ { - this.RegisterFrameworks[i] = NewPopulatedACL_RegisterFramework(r, easy) - } + if m.CacheMisses != nil { + data[i] = 0x40 + i++ + i = encodeVarintMesos(data, i, uint64(*m.CacheMisses)) } - if r.Intn(10) != 0 { - v166 := r.Intn(10) - this.RunTasks = make([]*ACL_RunTask, v166) - for i := 0; i < v166; i++ { - this.RunTasks[i] = NewPopulatedACL_RunTask(r, easy) - } + if m.Branches != nil { + data[i] = 0x48 + i++ + i = encodeVarintMesos(data, i, uint64(*m.Branches)) } - if r.Intn(10) != 0 { - v167 := r.Intn(10) - this.ShutdownFrameworks = make([]*ACL_ShutdownFramework, v167) - for i := 0; i < v167; i++ { - this.ShutdownFrameworks[i] = NewPopulatedACL_ShutdownFramework(r, easy) - } + if m.BranchMisses != nil { + data[i] = 0x50 + i++ + i = encodeVarintMesos(data, i, uint64(*m.BranchMisses)) } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 5) + if m.BusCycles != nil { + data[i] = 0x58 + i++ + i = encodeVarintMesos(data, i, uint64(*m.BusCycles)) } - return this -} - -func NewPopulatedRateLimit(r randyMesos, easy bool) *RateLimit { - this := &RateLimit{} - if r.Intn(10) != 0 { - v168 := r.Float64() - if r.Intn(2) == 0 { - v168 *= -1 - } - this.Qps = &v168 + if m.RefCycles != nil { + data[i] = 0x60 + i++ + i = encodeVarintMesos(data, i, uint64(*m.RefCycles)) } - v169 := randStringMesos(r) - this.Principal = &v169 - if r.Intn(10) != 0 { - v170 := uint64(r.Uint32()) - this.Capacity = &v170 + if m.CpuClock != nil { + data[i] = 0x69 + i++ + i = encodeFixed64Mesos(data, i, uint64(math.Float64bits(*m.CpuClock))) } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 4) + if m.TaskClock != nil { + data[i] = 0x71 + i++ + i = encodeFixed64Mesos(data, i, uint64(math.Float64bits(*m.TaskClock))) } - return this -} - -func NewPopulatedRateLimits(r randyMesos, easy bool) *RateLimits { - this := &RateLimits{} - if r.Intn(10) != 0 { - v171 := r.Intn(10) - this.Limits = make([]*RateLimit, v171) - for i := 0; i < v171; i++ { - this.Limits[i] = NewPopulatedRateLimit(r, easy) - } + if m.PageFaults != nil { + data[i] = 0x78 + i++ + i = encodeVarintMesos(data, i, uint64(*m.PageFaults)) } - if r.Intn(10) != 0 { - v172 := r.Float64() - if r.Intn(2) == 0 { - v172 *= -1 - } - this.AggregateDefaultQps = &v172 + if m.MinorFaults != nil { + data[i] = 0x80 + i++ + data[i] = 0x1 + i++ + i = encodeVarintMesos(data, i, uint64(*m.MinorFaults)) } - if r.Intn(10) != 0 { - v173 := uint64(r.Uint32()) - this.AggregateDefaultCapacity = &v173 + if m.MajorFaults != nil { + data[i] = 0x88 + i++ + data[i] = 0x1 + i++ + i = encodeVarintMesos(data, i, uint64(*m.MajorFaults)) } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 4) + if m.ContextSwitches != nil { + data[i] = 0x90 + i++ + data[i] = 0x1 + i++ + i = encodeVarintMesos(data, i, uint64(*m.ContextSwitches)) } - return this -} - -func NewPopulatedVolume(r randyMesos, easy bool) *Volume { - this := &Volume{} - v174 := randStringMesos(r) - this.ContainerPath = &v174 - if r.Intn(10) != 0 { - v175 := randStringMesos(r) - this.HostPath = &v175 + if m.CpuMigrations != nil { + data[i] = 0x98 + i++ + data[i] = 0x1 + i++ + i = encodeVarintMesos(data, i, uint64(*m.CpuMigrations)) } - v176 := Volume_Mode([]int32{1, 2}[r.Intn(2)]) - this.Mode = &v176 - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 4) + if m.AlignmentFaults != nil { + data[i] = 0xa0 + i++ + data[i] = 0x1 + i++ + i = encodeVarintMesos(data, i, uint64(*m.AlignmentFaults)) } - return this -} - -func NewPopulatedContainerInfo(r randyMesos, easy bool) *ContainerInfo { - this := &ContainerInfo{} - v177 := ContainerInfo_Type([]int32{1, 2}[r.Intn(2)]) - this.Type = &v177 - if r.Intn(10) != 0 { - v178 := r.Intn(10) - this.Volumes = make([]*Volume, v178) - for i := 0; i < v178; i++ { - this.Volumes[i] = NewPopulatedVolume(r, easy) - } + if m.EmulationFaults != nil { + data[i] = 0xa8 + i++ + data[i] = 0x1 + i++ + i = encodeVarintMesos(data, i, uint64(*m.EmulationFaults)) } - if r.Intn(10) != 0 { - v179 := randStringMesos(r) - this.Hostname = &v179 + if m.L1DcacheLoads != nil { + data[i] = 0xb0 + i++ + data[i] = 0x1 + i++ + i = encodeVarintMesos(data, i, uint64(*m.L1DcacheLoads)) } - if r.Intn(10) != 0 { - this.Docker = NewPopulatedContainerInfo_DockerInfo(r, easy) + if m.L1DcacheLoadMisses != nil { + data[i] = 0xb8 + i++ + data[i] = 0x1 + i++ + i = encodeVarintMesos(data, i, uint64(*m.L1DcacheLoadMisses)) + } + if m.L1DcacheStores != nil { + data[i] = 0xc0 + i++ + data[i] = 0x1 + i++ + i = encodeVarintMesos(data, i, uint64(*m.L1DcacheStores)) + } + if m.L1DcacheStoreMisses != nil { + data[i] = 0xc8 + i++ + data[i] = 0x1 + i++ + i = encodeVarintMesos(data, i, uint64(*m.L1DcacheStoreMisses)) } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 5) + if m.L1DcachePrefetches != nil { + data[i] = 0xd0 + i++ + data[i] = 0x1 + i++ + i = encodeVarintMesos(data, i, uint64(*m.L1DcachePrefetches)) } - return this -} - -func NewPopulatedContainerInfo_DockerInfo(r randyMesos, easy bool) *ContainerInfo_DockerInfo { - this := &ContainerInfo_DockerInfo{} - v180 := randStringMesos(r) - this.Image = &v180 - if r.Intn(10) != 0 { - v181 := ContainerInfo_DockerInfo_Network([]int32{1, 2, 3}[r.Intn(3)]) - this.Network = &v181 + if m.L1DcachePrefetchMisses != nil { + data[i] = 0xd8 + i++ + data[i] = 0x1 + i++ + i = encodeVarintMesos(data, i, uint64(*m.L1DcachePrefetchMisses)) } - if r.Intn(10) != 0 { - v182 := r.Intn(10) - this.PortMappings = make([]*ContainerInfo_DockerInfo_PortMapping, v182) - for i := 0; i < v182; i++ { - this.PortMappings[i] = NewPopulatedContainerInfo_DockerInfo_PortMapping(r, easy) - } + if m.L1IcacheLoads != nil { + data[i] = 0xe0 + i++ + data[i] = 0x1 + i++ + i = encodeVarintMesos(data, i, uint64(*m.L1IcacheLoads)) } - if r.Intn(10) != 0 { - v183 := bool(r.Intn(2) == 0) - this.Privileged = &v183 + if m.L1IcacheLoadMisses != nil { + data[i] = 0xe8 + i++ + data[i] = 0x1 + i++ + i = encodeVarintMesos(data, i, uint64(*m.L1IcacheLoadMisses)) } - if r.Intn(10) != 0 { - v184 := r.Intn(10) - this.Parameters = make([]*Parameter, v184) - for i := 0; i < v184; i++ { - this.Parameters[i] = NewPopulatedParameter(r, easy) - } + if m.L1IcachePrefetches != nil { + data[i] = 0xf0 + i++ + data[i] = 0x1 + i++ + i = encodeVarintMesos(data, i, uint64(*m.L1IcachePrefetches)) } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 6) + if m.L1IcachePrefetchMisses != nil { + data[i] = 0xf8 + i++ + data[i] = 0x1 + i++ + i = encodeVarintMesos(data, i, uint64(*m.L1IcachePrefetchMisses)) } - return this -} - -func NewPopulatedContainerInfo_DockerInfo_PortMapping(r randyMesos, easy bool) *ContainerInfo_DockerInfo_PortMapping { - this := &ContainerInfo_DockerInfo_PortMapping{} - v185 := r.Uint32() - this.HostPort = &v185 - v186 := r.Uint32() - this.ContainerPort = &v186 - if r.Intn(10) != 0 { - v187 := randStringMesos(r) - this.Protocol = &v187 + if m.LlcLoads != nil { + data[i] = 0x80 + i++ + data[i] = 0x2 + i++ + i = encodeVarintMesos(data, i, uint64(*m.LlcLoads)) } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 4) + if m.LlcLoadMisses != nil { + data[i] = 0x88 + i++ + data[i] = 0x2 + i++ + i = encodeVarintMesos(data, i, uint64(*m.LlcLoadMisses)) } - return this -} - -type randyMesos interface { - Float32() float32 - Float64() float64 - Int63() int64 - Int31() int32 - Uint32() uint32 - Intn(n int) int -} - -func randUTF8RuneMesos(r randyMesos) rune { - res := rune(r.Uint32() % 1112064) - if 55296 <= res { - res += 2047 + if m.LlcStores != nil { + data[i] = 0x90 + i++ + data[i] = 0x2 + i++ + i = encodeVarintMesos(data, i, uint64(*m.LlcStores)) } - return res -} -func randStringMesos(r randyMesos) string { - v188 := r.Intn(100) - tmps := make([]rune, v188) - for i := 0; i < v188; i++ { - tmps[i] = randUTF8RuneMesos(r) + if m.LlcStoreMisses != nil { + data[i] = 0x98 + i++ + data[i] = 0x2 + i++ + i = encodeVarintMesos(data, i, uint64(*m.LlcStoreMisses)) } - return string(tmps) -} -func randUnrecognizedMesos(r randyMesos, 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 = randFieldMesos(data, r, fieldNumber, wire) + if m.LlcPrefetches != nil { + data[i] = 0xa0 + i++ + data[i] = 0x2 + i++ + i = encodeVarintMesos(data, i, uint64(*m.LlcPrefetches)) } - return data -} -func randFieldMesos(data []byte, r randyMesos, fieldNumber int, wire int) []byte { - key := uint32(fieldNumber)<<3 | uint32(wire) - switch wire { - case 0: - data = encodeVarintPopulateMesos(data, uint64(key)) - v189 := r.Int63() - if r.Intn(2) == 0 { - v189 *= -1 - } - data = encodeVarintPopulateMesos(data, uint64(v189)) - case 1: - data = encodeVarintPopulateMesos(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 = encodeVarintPopulateMesos(data, uint64(key)) - ll := r.Intn(100) - data = encodeVarintPopulateMesos(data, uint64(ll)) - for j := 0; j < ll; j++ { - data = append(data, byte(r.Intn(256))) - } - default: - data = encodeVarintPopulateMesos(data, uint64(key)) - data = append(data, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) + if m.LlcPrefetchMisses != nil { + data[i] = 0xa8 + i++ + data[i] = 0x2 + i++ + i = encodeVarintMesos(data, i, uint64(*m.LlcPrefetchMisses)) } - return data -} -func encodeVarintPopulateMesos(data []byte, v uint64) []byte { - for v >= 1<<7 { - data = append(data, uint8(uint64(v)&0x7f|0x80)) - v >>= 7 + if m.DtlbLoads != nil { + data[i] = 0xb0 + i++ + data[i] = 0x2 + i++ + i = encodeVarintMesos(data, i, uint64(*m.DtlbLoads)) } - data = append(data, uint8(v)) - return data -} -func (m *FrameworkID) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err + if m.DtlbLoadMisses != nil { + data[i] = 0xb8 + i++ + data[i] = 0x2 + i++ + i = encodeVarintMesos(data, i, uint64(*m.DtlbLoadMisses)) } - return data[:n], nil -} - -func (m *FrameworkID) MarshalTo(data []byte) (n int, err error) { - var i int - _ = i - var l int - _ = l - if m.Value != nil { - data[i] = 0xa + if m.DtlbStores != nil { + data[i] = 0xc0 i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Value))) - i += copy(data[i:], *m.Value) + data[i] = 0x2 + i++ + i = encodeVarintMesos(data, i, uint64(*m.DtlbStores)) } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) + if m.DtlbStoreMisses != nil { + data[i] = 0xc8 + i++ + data[i] = 0x2 + i++ + i = encodeVarintMesos(data, i, uint64(*m.DtlbStoreMisses)) } - return i, nil -} - -func (m *OfferID) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err + if m.DtlbPrefetches != nil { + data[i] = 0xd0 + i++ + data[i] = 0x2 + i++ + i = encodeVarintMesos(data, i, uint64(*m.DtlbPrefetches)) } - return data[:n], nil -} - -func (m *OfferID) MarshalTo(data []byte) (n int, err error) { - var i int - _ = i - var l int - _ = l - if m.Value != nil { - data[i] = 0xa + if m.DtlbPrefetchMisses != nil { + data[i] = 0xd8 i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Value))) - i += copy(data[i:], *m.Value) + data[i] = 0x2 + i++ + i = encodeVarintMesos(data, i, uint64(*m.DtlbPrefetchMisses)) } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) + if m.ItlbLoads != nil { + data[i] = 0xe0 + i++ + data[i] = 0x2 + i++ + i = encodeVarintMesos(data, i, uint64(*m.ItlbLoads)) } - return i, nil -} - -func (m *SlaveID) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err + if m.ItlbLoadMisses != nil { + data[i] = 0xe8 + i++ + data[i] = 0x2 + i++ + i = encodeVarintMesos(data, i, uint64(*m.ItlbLoadMisses)) } - return data[:n], nil -} - -func (m *SlaveID) MarshalTo(data []byte) (n int, err error) { - var i int - _ = i - var l int - _ = l - if m.Value != nil { - data[i] = 0xa + if m.BranchLoads != nil { + data[i] = 0xf0 i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Value))) - i += copy(data[i:], *m.Value) + data[i] = 0x2 + i++ + i = encodeVarintMesos(data, i, uint64(*m.BranchLoads)) } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) + if m.BranchLoadMisses != nil { + data[i] = 0xf8 + i++ + data[i] = 0x2 + i++ + i = encodeVarintMesos(data, i, uint64(*m.BranchLoadMisses)) } - return i, nil -} - -func (m *TaskID) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err + if m.NodeLoads != nil { + data[i] = 0x80 + i++ + data[i] = 0x3 + i++ + i = encodeVarintMesos(data, i, uint64(*m.NodeLoads)) } - return data[:n], nil -} - -func (m *TaskID) MarshalTo(data []byte) (n int, err error) { - var i int - _ = i - var l int - _ = l - if m.Value != nil { - data[i] = 0xa + if m.NodeLoadMisses != nil { + data[i] = 0x88 i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Value))) - i += copy(data[i:], *m.Value) + data[i] = 0x3 + i++ + i = encodeVarintMesos(data, i, uint64(*m.NodeLoadMisses)) } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) + if m.NodeStores != nil { + data[i] = 0x90 + i++ + data[i] = 0x3 + i++ + i = encodeVarintMesos(data, i, uint64(*m.NodeStores)) } - return i, nil -} - -func (m *ExecutorID) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err + if m.NodeStoreMisses != nil { + data[i] = 0x98 + i++ + data[i] = 0x3 + i++ + i = encodeVarintMesos(data, i, uint64(*m.NodeStoreMisses)) } - return data[:n], nil -} - -func (m *ExecutorID) MarshalTo(data []byte) (n int, err error) { - var i int - _ = i - var l int - _ = l - if m.Value != nil { - data[i] = 0xa + if m.NodePrefetches != nil { + data[i] = 0xa0 i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Value))) - i += copy(data[i:], *m.Value) + data[i] = 0x3 + i++ + i = encodeVarintMesos(data, i, uint64(*m.NodePrefetches)) + } + if m.NodePrefetchMisses != nil { + data[i] = 0xa8 + i++ + data[i] = 0x3 + i++ + i = encodeVarintMesos(data, i, uint64(*m.NodePrefetchMisses)) } if m.XXX_unrecognized != nil { i += copy(data[i:], m.XXX_unrecognized) @@ -13564,7 +15672,7 @@ func (m *ExecutorID) MarshalTo(data []byte) (n int, err error) { return i, nil } -func (m *ContainerID) Marshal() (data []byte, err error) { +func (m *Request) Marshal() (data []byte, err error) { size := m.Size() data = make([]byte, size) n, err := m.MarshalTo(data) @@ -13574,16 +15682,32 @@ func (m *ContainerID) Marshal() (data []byte, err error) { return data[:n], nil } -func (m *ContainerID) MarshalTo(data []byte) (n int, err error) { +func (m *Request) MarshalTo(data []byte) (int, error) { var i int _ = i var l int _ = l - if m.Value != nil { + if m.SlaveId != nil { data[i] = 0xa i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Value))) - i += copy(data[i:], *m.Value) + i = encodeVarintMesos(data, i, uint64(m.SlaveId.Size())) + n31, err := m.SlaveId.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n31 + } + if len(m.Resources) > 0 { + for _, msg := range m.Resources { + data[i] = 0x12 + i++ + i = encodeVarintMesos(data, i, uint64(msg.Size())) + n, err := msg.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n + } } if m.XXX_unrecognized != nil { i += copy(data[i:], m.XXX_unrecognized) @@ -13591,7 +15715,7 @@ func (m *ContainerID) MarshalTo(data []byte) (n int, err error) { return i, nil } -func (m *FrameworkInfo) Marshal() (data []byte, err error) { +func (m *Offer) Marshal() (data []byte, err error) { size := m.Size() data = make([]byte, size) n, err := m.MarshalTo(data) @@ -13601,71 +15725,90 @@ func (m *FrameworkInfo) Marshal() (data []byte, err error) { return data[:n], nil } -func (m *FrameworkInfo) MarshalTo(data []byte) (n int, err error) { +func (m *Offer) MarshalTo(data []byte) (int, error) { var i int _ = i var l int _ = l - if m.User != nil { + if m.Id == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("id") + } else { data[i] = 0xa i++ - i = encodeVarintMesos(data, i, uint64(len(*m.User))) - i += copy(data[i:], *m.User) - } - if m.Name != nil { - data[i] = 0x12 - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Name))) - i += copy(data[i:], *m.Name) - } - if m.Id != nil { - data[i] = 0x1a - i++ i = encodeVarintMesos(data, i, uint64(m.Id.Size())) - n1, err := m.Id.MarshalTo(data[i:]) + n32, err := m.Id.MarshalTo(data[i:]) if err != nil { return 0, err } - i += n1 - } - if m.FailoverTimeout != nil { - data[i] = 0x21 - i++ - i = encodeFixed64Mesos(data, i, uint64(math2.Float64bits(*m.FailoverTimeout))) + i += n32 } - if m.Checkpoint != nil { - data[i] = 0x28 + if m.FrameworkId == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("framework_id") + } else { + data[i] = 0x12 i++ - if *m.Checkpoint { - data[i] = 1 - } else { - data[i] = 0 + i = encodeVarintMesos(data, i, uint64(m.FrameworkId.Size())) + n33, err := m.FrameworkId.MarshalTo(data[i:]) + if err != nil { + return 0, err } - i++ + i += n33 } - if m.Role != nil { - data[i] = 0x32 + if m.SlaveId == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("slave_id") + } else { + data[i] = 0x1a i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Role))) - i += copy(data[i:], *m.Role) + i = encodeVarintMesos(data, i, uint64(m.SlaveId.Size())) + n34, err := m.SlaveId.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n34 } - if m.Hostname != nil { - data[i] = 0x3a + if m.Hostname == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("hostname") + } else { + data[i] = 0x22 i++ i = encodeVarintMesos(data, i, uint64(len(*m.Hostname))) i += copy(data[i:], *m.Hostname) } - if m.Principal != nil { - data[i] = 0x42 - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Principal))) - i += copy(data[i:], *m.Principal) + if len(m.Resources) > 0 { + for _, msg := range m.Resources { + data[i] = 0x2a + i++ + i = encodeVarintMesos(data, i, uint64(msg.Size())) + n, err := msg.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n + } } - if m.WebuiUrl != nil { - data[i] = 0x4a - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.WebuiUrl))) - i += copy(data[i:], *m.WebuiUrl) + if len(m.ExecutorIds) > 0 { + for _, msg := range m.ExecutorIds { + data[i] = 0x32 + i++ + i = encodeVarintMesos(data, i, uint64(msg.Size())) + n, err := msg.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n + } + } + if len(m.Attributes) > 0 { + for _, msg := range m.Attributes { + data[i] = 0x3a + i++ + i = encodeVarintMesos(data, i, uint64(msg.Size())) + n, err := msg.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n + } } if m.XXX_unrecognized != nil { i += copy(data[i:], m.XXX_unrecognized) @@ -13673,7 +15816,7 @@ func (m *FrameworkInfo) MarshalTo(data []byte) (n int, err error) { return i, nil } -func (m *HealthCheck) Marshal() (data []byte, err error) { +func (m *Offer_Operation) Marshal() (data []byte, err error) { size := m.Size() data = make([]byte, size) n, err := m.MarshalTo(data) @@ -13683,55 +15826,67 @@ func (m *HealthCheck) Marshal() (data []byte, err error) { return data[:n], nil } -func (m *HealthCheck) MarshalTo(data []byte) (n int, err error) { +func (m *Offer_Operation) MarshalTo(data []byte) (int, error) { var i int _ = i var l int _ = l - if m.Http != nil { - data[i] = 0xa + if m.Type == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("type") + } else { + data[i] = 0x8 i++ - i = encodeVarintMesos(data, i, uint64(m.Http.Size())) - n2, err := m.Http.MarshalTo(data[i:]) + i = encodeVarintMesos(data, i, uint64(*m.Type)) + } + if m.Launch != nil { + data[i] = 0x12 + i++ + i = encodeVarintMesos(data, i, uint64(m.Launch.Size())) + n35, err := m.Launch.MarshalTo(data[i:]) if err != nil { return 0, err } - i += n2 - } - if m.DelaySeconds != nil { - data[i] = 0x11 - i++ - i = encodeFixed64Mesos(data, i, uint64(math2.Float64bits(*m.DelaySeconds))) - } - if m.IntervalSeconds != nil { - data[i] = 0x19 - i++ - i = encodeFixed64Mesos(data, i, uint64(math2.Float64bits(*m.IntervalSeconds))) + i += n35 } - if m.TimeoutSeconds != nil { - data[i] = 0x21 + if m.Reserve != nil { + data[i] = 0x1a i++ - i = encodeFixed64Mesos(data, i, uint64(math2.Float64bits(*m.TimeoutSeconds))) + i = encodeVarintMesos(data, i, uint64(m.Reserve.Size())) + n36, err := m.Reserve.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n36 } - if m.ConsecutiveFailures != nil { - data[i] = 0x28 + if m.Unreserve != nil { + data[i] = 0x22 i++ - i = encodeVarintMesos(data, i, uint64(*m.ConsecutiveFailures)) + i = encodeVarintMesos(data, i, uint64(m.Unreserve.Size())) + n37, err := m.Unreserve.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n37 } - if m.GracePeriodSeconds != nil { - data[i] = 0x31 + if m.Create != nil { + data[i] = 0x2a i++ - i = encodeFixed64Mesos(data, i, uint64(math2.Float64bits(*m.GracePeriodSeconds))) + i = encodeVarintMesos(data, i, uint64(m.Create.Size())) + n38, err := m.Create.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n38 } - if m.Command != nil { - data[i] = 0x3a + if m.Destroy != nil { + data[i] = 0x32 i++ - i = encodeVarintMesos(data, i, uint64(m.Command.Size())) - n3, err := m.Command.MarshalTo(data[i:]) + i = encodeVarintMesos(data, i, uint64(m.Destroy.Size())) + n39, err := m.Destroy.MarshalTo(data[i:]) if err != nil { return 0, err } - i += n3 + i += n39 } if m.XXX_unrecognized != nil { i += copy(data[i:], m.XXX_unrecognized) @@ -13739,7 +15894,7 @@ func (m *HealthCheck) MarshalTo(data []byte) (n int, err error) { return i, nil } -func (m *HealthCheck_HTTP) Marshal() (data []byte, err error) { +func (m *Offer_Operation_Launch) Marshal() (data []byte, err error) { size := m.Size() data = make([]byte, size) n, err := m.MarshalTo(data) @@ -13749,27 +15904,21 @@ func (m *HealthCheck_HTTP) Marshal() (data []byte, err error) { return data[:n], nil } -func (m *HealthCheck_HTTP) MarshalTo(data []byte) (n int, err error) { +func (m *Offer_Operation_Launch) MarshalTo(data []byte) (int, error) { var i int _ = i var l int _ = l - if m.Port != nil { - data[i] = 0x8 - i++ - i = encodeVarintMesos(data, i, uint64(*m.Port)) - } - if m.Path != nil { - data[i] = 0x12 - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Path))) - i += copy(data[i:], *m.Path) - } - if len(m.Statuses) > 0 { - for _, num := range m.Statuses { - data[i] = 0x20 + if len(m.TaskInfos) > 0 { + for _, msg := range m.TaskInfos { + data[i] = 0xa i++ - i = encodeVarintMesos(data, i, uint64(num)) + i = encodeVarintMesos(data, i, uint64(msg.Size())) + n, err := msg.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n } } if m.XXX_unrecognized != nil { @@ -13778,7 +15927,7 @@ func (m *HealthCheck_HTTP) MarshalTo(data []byte) (n int, err error) { return i, nil } -func (m *CommandInfo) Marshal() (data []byte, err error) { +func (m *Offer_Operation_Reserve) Marshal() (data []byte, err error) { size := m.Size() data = make([]byte, size) n, err := m.MarshalTo(data) @@ -13788,23 +15937,13 @@ func (m *CommandInfo) Marshal() (data []byte, err error) { return data[:n], nil } -func (m *CommandInfo) MarshalTo(data []byte) (n int, err error) { +func (m *Offer_Operation_Reserve) MarshalTo(data []byte) (int, error) { var i int _ = i var l int _ = l - if m.Container != nil { - data[i] = 0x22 - i++ - i = encodeVarintMesos(data, i, uint64(m.Container.Size())) - n4, err := m.Container.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n4 - } - if len(m.Uris) > 0 { - for _, msg := range m.Uris { + if len(m.Resources) > 0 { + for _, msg := range m.Resources { data[i] = 0xa i++ i = encodeVarintMesos(data, i, uint64(msg.Size())) @@ -13815,60 +15954,46 @@ func (m *CommandInfo) MarshalTo(data []byte) (n int, err error) { i += n } } - if m.Environment != nil { - data[i] = 0x12 - i++ - i = encodeVarintMesos(data, i, uint64(m.Environment.Size())) - n5, err := m.Environment.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n5 - } - if m.Shell != nil { - data[i] = 0x30 - i++ - if *m.Shell { - data[i] = 1 - } else { - data[i] = 0 - } - i++ + if m.XXX_unrecognized != nil { + i += copy(data[i:], m.XXX_unrecognized) } - if m.Value != nil { - data[i] = 0x1a - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Value))) - i += copy(data[i:], *m.Value) + return i, nil +} + +func (m *Offer_Operation_Unreserve) Marshal() (data []byte, err error) { + size := m.Size() + data = make([]byte, size) + n, err := m.MarshalTo(data) + if err != nil { + return nil, err } - if len(m.Arguments) > 0 { - for _, s := range m.Arguments { - data[i] = 0x3a + return data[:n], nil +} + +func (m *Offer_Operation_Unreserve) MarshalTo(data []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if len(m.Resources) > 0 { + for _, msg := range m.Resources { + data[i] = 0xa i++ - l = len(s) - for l >= 1<<7 { - data[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ + i = encodeVarintMesos(data, i, uint64(msg.Size())) + n, err := msg.MarshalTo(data[i:]) + if err != nil { + return 0, err } - data[i] = uint8(l) - i++ - i += copy(data[i:], s) + i += n } } - if m.User != nil { - data[i] = 0x2a - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.User))) - i += copy(data[i:], *m.User) - } if m.XXX_unrecognized != nil { i += copy(data[i:], m.XXX_unrecognized) } return i, nil } -func (m *CommandInfo_URI) Marshal() (data []byte, err error) { +func (m *Offer_Operation_Create) Marshal() (data []byte, err error) { size := m.Size() data = make([]byte, size) n, err := m.MarshalTo(data) @@ -13878,36 +16003,22 @@ func (m *CommandInfo_URI) Marshal() (data []byte, err error) { return data[:n], nil } -func (m *CommandInfo_URI) MarshalTo(data []byte) (n int, err error) { +func (m *Offer_Operation_Create) MarshalTo(data []byte) (int, error) { var i int _ = i var l int _ = l - if m.Value != nil { - data[i] = 0xa - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Value))) - i += copy(data[i:], *m.Value) - } - if m.Executable != nil { - data[i] = 0x10 - i++ - if *m.Executable { - data[i] = 1 - } else { - data[i] = 0 - } - i++ - } - if m.Extract != nil { - data[i] = 0x18 - i++ - if *m.Extract { - data[i] = 1 - } else { - data[i] = 0 + if len(m.Volumes) > 0 { + for _, msg := range m.Volumes { + data[i] = 0xa + i++ + i = encodeVarintMesos(data, i, uint64(msg.Size())) + n, err := msg.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n } - i++ } if m.XXX_unrecognized != nil { i += copy(data[i:], m.XXX_unrecognized) @@ -13915,7 +16026,7 @@ func (m *CommandInfo_URI) MarshalTo(data []byte) (n int, err error) { return i, nil } -func (m *CommandInfo_ContainerInfo) Marshal() (data []byte, err error) { +func (m *Offer_Operation_Destroy) Marshal() (data []byte, err error) { size := m.Size() data = make([]byte, size) n, err := m.MarshalTo(data) @@ -13925,30 +16036,21 @@ func (m *CommandInfo_ContainerInfo) Marshal() (data []byte, err error) { return data[:n], nil } -func (m *CommandInfo_ContainerInfo) MarshalTo(data []byte) (n int, err error) { +func (m *Offer_Operation_Destroy) MarshalTo(data []byte) (int, error) { var i int _ = i var l int _ = l - if m.Image != nil { - data[i] = 0xa - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Image))) - i += copy(data[i:], *m.Image) - } - if len(m.Options) > 0 { - for _, s := range m.Options { - data[i] = 0x12 + if len(m.Volumes) > 0 { + for _, msg := range m.Volumes { + data[i] = 0xa i++ - l = len(s) - for l >= 1<<7 { - data[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ + i = encodeVarintMesos(data, i, uint64(msg.Size())) + n, err := msg.MarshalTo(data[i:]) + if err != nil { + return 0, err } - data[i] = uint8(l) - i++ - i += copy(data[i:], s) + i += n } } if m.XXX_unrecognized != nil { @@ -13957,7 +16059,7 @@ func (m *CommandInfo_ContainerInfo) MarshalTo(data []byte) (n int, err error) { return i, nil } -func (m *ExecutorInfo) Marshal() (data []byte, err error) { +func (m *TaskInfo) Marshal() (data []byte, err error) { size := m.Size() data = make([]byte, size) n, err := m.MarshalTo(data) @@ -13967,54 +16069,46 @@ func (m *ExecutorInfo) Marshal() (data []byte, err error) { return data[:n], nil } -func (m *ExecutorInfo) MarshalTo(data []byte) (n int, err error) { +func (m *TaskInfo) MarshalTo(data []byte) (int, error) { var i int _ = i var l int _ = l - if m.ExecutorId != nil { + if m.Name == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("name") + } else { data[i] = 0xa i++ - i = encodeVarintMesos(data, i, uint64(m.ExecutorId.Size())) - n6, err := m.ExecutorId.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n6 - } - if m.FrameworkId != nil { - data[i] = 0x42 - i++ - i = encodeVarintMesos(data, i, uint64(m.FrameworkId.Size())) - n7, err := m.FrameworkId.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n7 + i = encodeVarintMesos(data, i, uint64(len(*m.Name))) + i += copy(data[i:], *m.Name) } - if m.Command != nil { - data[i] = 0x3a + if m.TaskId == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("task_id") + } else { + data[i] = 0x12 i++ - i = encodeVarintMesos(data, i, uint64(m.Command.Size())) - n8, err := m.Command.MarshalTo(data[i:]) + i = encodeVarintMesos(data, i, uint64(m.TaskId.Size())) + n40, err := m.TaskId.MarshalTo(data[i:]) if err != nil { return 0, err } - i += n8 + i += n40 } - if m.Container != nil { - data[i] = 0x5a + if m.SlaveId == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("slave_id") + } else { + data[i] = 0x1a i++ - i = encodeVarintMesos(data, i, uint64(m.Container.Size())) - n9, err := m.Container.MarshalTo(data[i:]) + i = encodeVarintMesos(data, i, uint64(m.SlaveId.Size())) + n41, err := m.SlaveId.MarshalTo(data[i:]) if err != nil { return 0, err } - i += n9 + i += n41 } if len(m.Resources) > 0 { for _, msg := range m.Resources { - data[i] = 0x2a + data[i] = 0x22 i++ i = encodeVarintMesos(data, i, uint64(msg.Size())) n, err := msg.MarshalTo(data[i:]) @@ -14024,23 +16118,71 @@ func (m *ExecutorInfo) MarshalTo(data []byte) (n int, err error) { i += n } } - if m.Name != nil { + if m.Executor != nil { + data[i] = 0x2a + i++ + i = encodeVarintMesos(data, i, uint64(m.Executor.Size())) + n42, err := m.Executor.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n42 + } + if m.Data != nil { + data[i] = 0x32 + i++ + i = encodeVarintMesos(data, i, uint64(len(m.Data))) + i += copy(data[i:], m.Data) + } + if m.Command != nil { + data[i] = 0x3a + i++ + i = encodeVarintMesos(data, i, uint64(m.Command.Size())) + n43, err := m.Command.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n43 + } + if m.HealthCheck != nil { + data[i] = 0x42 + i++ + i = encodeVarintMesos(data, i, uint64(m.HealthCheck.Size())) + n44, err := m.HealthCheck.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n44 + } + if m.Container != nil { data[i] = 0x4a i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Name))) - i += copy(data[i:], *m.Name) + i = encodeVarintMesos(data, i, uint64(m.Container.Size())) + n45, err := m.Container.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n45 } - if m.Source != nil { + if m.Labels != nil { data[i] = 0x52 i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Source))) - i += copy(data[i:], *m.Source) + i = encodeVarintMesos(data, i, uint64(m.Labels.Size())) + n46, err := m.Labels.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n46 } - if m.Data != nil { - data[i] = 0x22 + if m.Discovery != nil { + data[i] = 0x5a i++ - i = encodeVarintMesos(data, i, uint64(len(m.Data))) - i += copy(data[i:], m.Data) + i = encodeVarintMesos(data, i, uint64(m.Discovery.Size())) + n47, err := m.Discovery.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n47 } if m.XXX_unrecognized != nil { i += copy(data[i:], m.XXX_unrecognized) @@ -14048,7 +16190,7 @@ func (m *ExecutorInfo) MarshalTo(data []byte) (n int, err error) { return i, nil } -func (m *MasterInfo) Marshal() (data []byte, err error) { +func (m *TaskStatus) Marshal() (data []byte, err error) { size := m.Size() data = make([]byte, size) n, err := m.MarshalTo(data) @@ -14058,122 +16200,100 @@ func (m *MasterInfo) Marshal() (data []byte, err error) { return data[:n], nil } -func (m *MasterInfo) MarshalTo(data []byte) (n int, err error) { +func (m *TaskStatus) MarshalTo(data []byte) (int, error) { var i int _ = i var l int _ = l - if m.Id != nil { + if m.TaskId == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("task_id") + } else { data[i] = 0xa i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Id))) - i += copy(data[i:], *m.Id) + i = encodeVarintMesos(data, i, uint64(m.TaskId.Size())) + n48, err := m.TaskId.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n48 } - if m.Ip != nil { + if m.State == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("state") + } else { data[i] = 0x10 i++ - i = encodeVarintMesos(data, i, uint64(*m.Ip)) + i = encodeVarintMesos(data, i, uint64(*m.State)) } - if m.Port != nil { - data[i] = 0x18 + if m.Data != nil { + data[i] = 0x1a i++ - i = encodeVarintMesos(data, i, uint64(*m.Port)) + i = encodeVarintMesos(data, i, uint64(len(m.Data))) + i += copy(data[i:], m.Data) } - if m.Pid != nil { + if m.Message != nil { data[i] = 0x22 i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Pid))) - i += copy(data[i:], *m.Pid) + i = encodeVarintMesos(data, i, uint64(len(*m.Message))) + i += copy(data[i:], *m.Message) } - if m.Hostname != nil { + if m.SlaveId != nil { data[i] = 0x2a i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Hostname))) - i += copy(data[i:], *m.Hostname) - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *SlaveInfo) 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 *SlaveInfo) MarshalTo(data []byte) (n int, err error) { - var i int - _ = i - var l int - _ = l - if m.Hostname != nil { - data[i] = 0xa - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Hostname))) - i += copy(data[i:], *m.Hostname) - } - if m.Port != nil { - data[i] = 0x40 - i++ - i = encodeVarintMesos(data, i, uint64(*m.Port)) - } - if len(m.Resources) > 0 { - for _, msg := range m.Resources { - data[i] = 0x1a - i++ - i = encodeVarintMesos(data, i, uint64(msg.Size())) - n, err := msg.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n + i = encodeVarintMesos(data, i, uint64(m.SlaveId.Size())) + n49, err := m.SlaveId.MarshalTo(data[i:]) + if err != nil { + return 0, err } + i += n49 } - if len(m.Attributes) > 0 { - for _, msg := range m.Attributes { - data[i] = 0x2a - i++ - i = encodeVarintMesos(data, i, uint64(msg.Size())) - n, err := msg.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n - } + if m.Timestamp != nil { + data[i] = 0x31 + i++ + i = encodeFixed64Mesos(data, i, uint64(math.Float64bits(*m.Timestamp))) } - if m.Id != nil { - data[i] = 0x32 + if m.ExecutorId != nil { + data[i] = 0x3a i++ - i = encodeVarintMesos(data, i, uint64(m.Id.Size())) - n10, err := m.Id.MarshalTo(data[i:]) + i = encodeVarintMesos(data, i, uint64(m.ExecutorId.Size())) + n50, err := m.ExecutorId.MarshalTo(data[i:]) if err != nil { return 0, err } - i += n10 + i += n50 } - if m.Checkpoint != nil { - data[i] = 0x38 + if m.Healthy != nil { + data[i] = 0x40 i++ - if *m.Checkpoint { + if *m.Healthy { data[i] = 1 } else { data[i] = 0 } i++ } + if m.Source != nil { + data[i] = 0x48 + i++ + i = encodeVarintMesos(data, i, uint64(*m.Source)) + } + if m.Reason != nil { + data[i] = 0x50 + i++ + i = encodeVarintMesos(data, i, uint64(*m.Reason)) + } + if m.Uuid != nil { + data[i] = 0x5a + i++ + i = encodeVarintMesos(data, i, uint64(len(m.Uuid))) + i += copy(data[i:], m.Uuid) + } if m.XXX_unrecognized != nil { i += copy(data[i:], m.XXX_unrecognized) } return i, nil } -func (m *Value) Marshal() (data []byte, err error) { +func (m *Filters) Marshal() (data []byte, err error) { size := m.Size() data = make([]byte, size) n, err := m.MarshalTo(data) @@ -14183,55 +16303,15 @@ func (m *Value) Marshal() (data []byte, err error) { return data[:n], nil } -func (m *Value) MarshalTo(data []byte) (n int, err error) { +func (m *Filters) MarshalTo(data []byte) (int, error) { var i int _ = i var l int _ = l - if m.Type != nil { - data[i] = 0x8 - i++ - i = encodeVarintMesos(data, i, uint64(*m.Type)) - } - if m.Scalar != nil { - data[i] = 0x12 - i++ - i = encodeVarintMesos(data, i, uint64(m.Scalar.Size())) - n11, err := m.Scalar.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n11 - } - if m.Ranges != nil { - data[i] = 0x1a - i++ - i = encodeVarintMesos(data, i, uint64(m.Ranges.Size())) - n12, err := m.Ranges.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n12 - } - if m.Set != nil { - data[i] = 0x22 - i++ - i = encodeVarintMesos(data, i, uint64(m.Set.Size())) - n13, err := m.Set.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n13 - } - if m.Text != nil { - data[i] = 0x2a + if m.RefuseSeconds != nil { + data[i] = 0x9 i++ - i = encodeVarintMesos(data, i, uint64(m.Text.Size())) - n14, err := m.Text.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n14 + i = encodeFixed64Mesos(data, i, uint64(math.Float64bits(*m.RefuseSeconds))) } if m.XXX_unrecognized != nil { i += copy(data[i:], m.XXX_unrecognized) @@ -14239,7 +16319,7 @@ func (m *Value) MarshalTo(data []byte) (n int, err error) { return i, nil } -func (m *Value_Scalar) Marshal() (data []byte, err error) { +func (m *Environment) Marshal() (data []byte, err error) { size := m.Size() data = make([]byte, size) n, err := m.MarshalTo(data) @@ -14249,15 +16329,22 @@ func (m *Value_Scalar) Marshal() (data []byte, err error) { return data[:n], nil } -func (m *Value_Scalar) MarshalTo(data []byte) (n int, err error) { +func (m *Environment) MarshalTo(data []byte) (int, error) { var i int _ = i var l int _ = l - if m.Value != nil { - data[i] = 0x9 - i++ - i = encodeFixed64Mesos(data, i, uint64(math2.Float64bits(*m.Value))) + if len(m.Variables) > 0 { + for _, msg := range m.Variables { + data[i] = 0xa + i++ + i = encodeVarintMesos(data, i, uint64(msg.Size())) + n, err := msg.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n + } } if m.XXX_unrecognized != nil { i += copy(data[i:], m.XXX_unrecognized) @@ -14265,7 +16352,7 @@ func (m *Value_Scalar) MarshalTo(data []byte) (n int, err error) { return i, nil } -func (m *Value_Range) Marshal() (data []byte, err error) { +func (m *Environment_Variable) Marshal() (data []byte, err error) { size := m.Size() data = make([]byte, size) n, err := m.MarshalTo(data) @@ -14275,20 +16362,26 @@ func (m *Value_Range) Marshal() (data []byte, err error) { return data[:n], nil } -func (m *Value_Range) MarshalTo(data []byte) (n int, err error) { +func (m *Environment_Variable) MarshalTo(data []byte) (int, error) { var i int _ = i var l int _ = l - if m.Begin != nil { - data[i] = 0x8 + if m.Name == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("name") + } else { + data[i] = 0xa i++ - i = encodeVarintMesos(data, i, uint64(*m.Begin)) + i = encodeVarintMesos(data, i, uint64(len(*m.Name))) + i += copy(data[i:], *m.Name) } - if m.End != nil { - data[i] = 0x10 + if m.Value == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("value") + } else { + data[i] = 0x12 i++ - i = encodeVarintMesos(data, i, uint64(*m.End)) + i = encodeVarintMesos(data, i, uint64(len(*m.Value))) + i += copy(data[i:], *m.Value) } if m.XXX_unrecognized != nil { i += copy(data[i:], m.XXX_unrecognized) @@ -14296,7 +16389,7 @@ func (m *Value_Range) MarshalTo(data []byte) (n int, err error) { return i, nil } -func (m *Value_Ranges) Marshal() (data []byte, err error) { +func (m *Parameter) Marshal() (data []byte, err error) { size := m.Size() data = make([]byte, size) n, err := m.MarshalTo(data) @@ -14306,22 +16399,26 @@ func (m *Value_Ranges) Marshal() (data []byte, err error) { return data[:n], nil } -func (m *Value_Ranges) MarshalTo(data []byte) (n int, err error) { +func (m *Parameter) MarshalTo(data []byte) (int, error) { var i int _ = i var l int _ = l - if len(m.Range) > 0 { - for _, msg := range m.Range { - data[i] = 0xa - i++ - i = encodeVarintMesos(data, i, uint64(msg.Size())) - n, err := msg.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n - } + if m.Key == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("key") + } else { + data[i] = 0xa + i++ + i = encodeVarintMesos(data, i, uint64(len(*m.Key))) + i += copy(data[i:], *m.Key) + } + if m.Value == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("value") + } else { + data[i] = 0x12 + i++ + i = encodeVarintMesos(data, i, uint64(len(*m.Value))) + i += copy(data[i:], *m.Value) } if m.XXX_unrecognized != nil { i += copy(data[i:], m.XXX_unrecognized) @@ -14329,7 +16426,7 @@ func (m *Value_Ranges) MarshalTo(data []byte) (n int, err error) { return i, nil } -func (m *Value_Set) Marshal() (data []byte, err error) { +func (m *Parameters) Marshal() (data []byte, err error) { size := m.Size() data = make([]byte, size) n, err := m.MarshalTo(data) @@ -14339,24 +16436,21 @@ func (m *Value_Set) Marshal() (data []byte, err error) { return data[:n], nil } -func (m *Value_Set) MarshalTo(data []byte) (n int, err error) { +func (m *Parameters) MarshalTo(data []byte) (int, error) { var i int _ = i var l int _ = l - if len(m.Item) > 0 { - for _, s := range m.Item { + if len(m.Parameter) > 0 { + for _, msg := range m.Parameter { data[i] = 0xa i++ - l = len(s) - for l >= 1<<7 { - data[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ + i = encodeVarintMesos(data, i, uint64(msg.Size())) + n, err := msg.MarshalTo(data[i:]) + if err != nil { + return 0, err } - data[i] = uint8(l) - i++ - i += copy(data[i:], s) + i += n } } if m.XXX_unrecognized != nil { @@ -14365,7 +16459,7 @@ func (m *Value_Set) MarshalTo(data []byte) (n int, err error) { return i, nil } -func (m *Value_Text) Marshal() (data []byte, err error) { +func (m *Credential) Marshal() (data []byte, err error) { size := m.Size() data = make([]byte, size) n, err := m.MarshalTo(data) @@ -14375,16 +16469,24 @@ func (m *Value_Text) Marshal() (data []byte, err error) { return data[:n], nil } -func (m *Value_Text) MarshalTo(data []byte) (n int, err error) { +func (m *Credential) MarshalTo(data []byte) (int, error) { var i int _ = i var l int _ = l - if m.Value != nil { + if m.Principal == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("principal") + } else { data[i] = 0xa i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Value))) - i += copy(data[i:], *m.Value) + i = encodeVarintMesos(data, i, uint64(len(*m.Principal))) + i += copy(data[i:], *m.Principal) + } + if m.Secret != nil { + data[i] = 0x12 + i++ + i = encodeVarintMesos(data, i, uint64(len(m.Secret))) + i += copy(data[i:], m.Secret) } if m.XXX_unrecognized != nil { i += copy(data[i:], m.XXX_unrecognized) @@ -14392,7 +16494,7 @@ func (m *Value_Text) MarshalTo(data []byte) (n int, err error) { return i, nil } -func (m *Attribute) Marshal() (data []byte, err error) { +func (m *Credentials) Marshal() (data []byte, err error) { size := m.Size() data = make([]byte, size) n, err := m.MarshalTo(data) @@ -14402,61 +16504,22 @@ func (m *Attribute) Marshal() (data []byte, err error) { return data[:n], nil } -func (m *Attribute) MarshalTo(data []byte) (n int, err error) { +func (m *Credentials) MarshalTo(data []byte) (int, error) { var i int _ = i var l int _ = l - if m.Name != nil { - data[i] = 0xa - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Name))) - i += copy(data[i:], *m.Name) - } - if m.Type != nil { - data[i] = 0x10 - i++ - i = encodeVarintMesos(data, i, uint64(*m.Type)) - } - if m.Scalar != nil { - data[i] = 0x1a - i++ - i = encodeVarintMesos(data, i, uint64(m.Scalar.Size())) - n15, err := m.Scalar.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n15 - } - if m.Ranges != nil { - data[i] = 0x22 - i++ - i = encodeVarintMesos(data, i, uint64(m.Ranges.Size())) - n16, err := m.Ranges.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n16 - } - if m.Set != nil { - data[i] = 0x32 - i++ - i = encodeVarintMesos(data, i, uint64(m.Set.Size())) - n17, err := m.Set.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n17 - } - if m.Text != nil { - data[i] = 0x2a - i++ - i = encodeVarintMesos(data, i, uint64(m.Text.Size())) - n18, err := m.Text.MarshalTo(data[i:]) - if err != nil { - return 0, err + if len(m.Credentials) > 0 { + for _, msg := range m.Credentials { + data[i] = 0xa + i++ + i = encodeVarintMesos(data, i, uint64(msg.Size())) + n, err := msg.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n } - i += n18 } if m.XXX_unrecognized != nil { i += copy(data[i:], m.XXX_unrecognized) @@ -14464,7 +16527,7 @@ func (m *Attribute) MarshalTo(data []byte) (n int, err error) { return i, nil } -func (m *Resource) Marshal() (data []byte, err error) { +func (m *ACL) Marshal() (data []byte, err error) { size := m.Size() data = make([]byte, size) n, err := m.MarshalTo(data) @@ -14474,65 +16537,18 @@ func (m *Resource) Marshal() (data []byte, err error) { return data[:n], nil } -func (m *Resource) MarshalTo(data []byte) (n int, err error) { +func (m *ACL) MarshalTo(data []byte) (int, error) { var i int _ = i var l int _ = l - if m.Name != nil { - data[i] = 0xa - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Name))) - i += copy(data[i:], *m.Name) - } - if m.Type != nil { - data[i] = 0x10 - i++ - i = encodeVarintMesos(data, i, uint64(*m.Type)) - } - if m.Scalar != nil { - data[i] = 0x1a - i++ - i = encodeVarintMesos(data, i, uint64(m.Scalar.Size())) - n19, err := m.Scalar.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n19 - } - if m.Ranges != nil { - data[i] = 0x22 - i++ - i = encodeVarintMesos(data, i, uint64(m.Ranges.Size())) - n20, err := m.Ranges.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n20 - } - if m.Set != nil { - data[i] = 0x2a - i++ - i = encodeVarintMesos(data, i, uint64(m.Set.Size())) - n21, err := m.Set.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n21 - } - if m.Role != nil { - data[i] = 0x32 - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Role))) - i += copy(data[i:], *m.Role) - } if m.XXX_unrecognized != nil { i += copy(data[i:], m.XXX_unrecognized) } return i, nil } -func (m *ResourceStatistics) Marshal() (data []byte, err error) { +func (m *ACL_Entity) Marshal() (data []byte, err error) { size := m.Size() data = make([]byte, size) n, err := m.MarshalTo(data) @@ -14542,160 +16558,30 @@ func (m *ResourceStatistics) Marshal() (data []byte, err error) { return data[:n], nil } -func (m *ResourceStatistics) MarshalTo(data []byte) (n int, err error) { +func (m *ACL_Entity) MarshalTo(data []byte) (int, error) { var i int _ = i var l int _ = l - if m.Timestamp != nil { - data[i] = 0x9 - i++ - i = encodeFixed64Mesos(data, i, uint64(math2.Float64bits(*m.Timestamp))) - } - if m.CpusUserTimeSecs != nil { - data[i] = 0x11 - i++ - i = encodeFixed64Mesos(data, i, uint64(math2.Float64bits(*m.CpusUserTimeSecs))) - } - if m.CpusSystemTimeSecs != nil { - data[i] = 0x19 - i++ - i = encodeFixed64Mesos(data, i, uint64(math2.Float64bits(*m.CpusSystemTimeSecs))) - } - if m.CpusLimit != nil { - data[i] = 0x21 - i++ - i = encodeFixed64Mesos(data, i, uint64(math2.Float64bits(*m.CpusLimit))) - } - if m.CpusNrPeriods != nil { - data[i] = 0x38 - i++ - i = encodeVarintMesos(data, i, uint64(*m.CpusNrPeriods)) - } - if m.CpusNrThrottled != nil { - data[i] = 0x40 - i++ - i = encodeVarintMesos(data, i, uint64(*m.CpusNrThrottled)) - } - if m.CpusThrottledTimeSecs != nil { - data[i] = 0x49 - i++ - i = encodeFixed64Mesos(data, i, uint64(math2.Float64bits(*m.CpusThrottledTimeSecs))) - } - if m.MemRssBytes != nil { - data[i] = 0x28 - i++ - i = encodeVarintMesos(data, i, uint64(*m.MemRssBytes)) - } - if m.MemLimitBytes != nil { - data[i] = 0x30 - i++ - i = encodeVarintMesos(data, i, uint64(*m.MemLimitBytes)) - } - if m.MemFileBytes != nil { - data[i] = 0x50 - i++ - i = encodeVarintMesos(data, i, uint64(*m.MemFileBytes)) - } - if m.MemAnonBytes != nil { - data[i] = 0x58 - i++ - i = encodeVarintMesos(data, i, uint64(*m.MemAnonBytes)) - } - if m.MemMappedFileBytes != nil { - data[i] = 0x60 - i++ - i = encodeVarintMesos(data, i, uint64(*m.MemMappedFileBytes)) - } - if m.Perf != nil { - data[i] = 0x6a - i++ - i = encodeVarintMesos(data, i, uint64(m.Perf.Size())) - n22, err := m.Perf.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n22 - } - if m.NetRxPackets != nil { - data[i] = 0x70 - i++ - i = encodeVarintMesos(data, i, uint64(*m.NetRxPackets)) - } - if m.NetRxBytes != nil { - data[i] = 0x78 - i++ - i = encodeVarintMesos(data, i, uint64(*m.NetRxBytes)) - } - if m.NetRxErrors != nil { - data[i] = 0x80 - i++ - data[i] = 0x1 - i++ - i = encodeVarintMesos(data, i, uint64(*m.NetRxErrors)) - } - if m.NetRxDropped != nil { - data[i] = 0x88 - i++ - data[i] = 0x1 - i++ - i = encodeVarintMesos(data, i, uint64(*m.NetRxDropped)) - } - if m.NetTxPackets != nil { - data[i] = 0x90 - i++ - data[i] = 0x1 - i++ - i = encodeVarintMesos(data, i, uint64(*m.NetTxPackets)) - } - if m.NetTxBytes != nil { - data[i] = 0x98 - i++ - data[i] = 0x1 - i++ - i = encodeVarintMesos(data, i, uint64(*m.NetTxBytes)) - } - if m.NetTxErrors != nil { - data[i] = 0xa0 - i++ - data[i] = 0x1 - i++ - i = encodeVarintMesos(data, i, uint64(*m.NetTxErrors)) - } - if m.NetTxDropped != nil { - data[i] = 0xa8 - i++ - data[i] = 0x1 - i++ - i = encodeVarintMesos(data, i, uint64(*m.NetTxDropped)) - } - if m.NetTcpRttMicrosecsP50 != nil { - data[i] = 0xb1 - i++ - data[i] = 0x1 - i++ - i = encodeFixed64Mesos(data, i, uint64(math2.Float64bits(*m.NetTcpRttMicrosecsP50))) - } - if m.NetTcpRttMicrosecsP90 != nil { - data[i] = 0xb9 - i++ - data[i] = 0x1 - i++ - i = encodeFixed64Mesos(data, i, uint64(math2.Float64bits(*m.NetTcpRttMicrosecsP90))) - } - if m.NetTcpRttMicrosecsP95 != nil { - data[i] = 0xc1 - i++ - data[i] = 0x1 + if m.Type != nil { + data[i] = 0x8 i++ - i = encodeFixed64Mesos(data, i, uint64(math2.Float64bits(*m.NetTcpRttMicrosecsP95))) + i = encodeVarintMesos(data, i, uint64(*m.Type)) } - if m.NetTcpRttMicrosecsP99 != nil { - data[i] = 0xc9 - i++ - data[i] = 0x1 - i++ - i = encodeFixed64Mesos(data, i, uint64(math2.Float64bits(*m.NetTcpRttMicrosecsP99))) + if len(m.Values) > 0 { + for _, s := range m.Values { + data[i] = 0x12 + 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) @@ -14703,7 +16589,7 @@ func (m *ResourceStatistics) MarshalTo(data []byte) (n int, err error) { return i, nil } -func (m *ResourceUsage) Marshal() (data []byte, err error) { +func (m *ACL_RegisterFramework) Marshal() (data []byte, err error) { size := m.Size() data = make([]byte, size) n, err := m.MarshalTo(data) @@ -14713,66 +16599,79 @@ func (m *ResourceUsage) Marshal() (data []byte, err error) { return data[:n], nil } -func (m *ResourceUsage) MarshalTo(data []byte) (n int, err error) { +func (m *ACL_RegisterFramework) MarshalTo(data []byte) (int, error) { var i int _ = i var l int _ = l - if m.SlaveId != nil { + if m.Principals == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("principals") + } else { data[i] = 0xa i++ - i = encodeVarintMesos(data, i, uint64(m.SlaveId.Size())) - n23, err := m.SlaveId.MarshalTo(data[i:]) + i = encodeVarintMesos(data, i, uint64(m.Principals.Size())) + n51, err := m.Principals.MarshalTo(data[i:]) if err != nil { return 0, err } - i += n23 + i += n51 } - if m.FrameworkId != nil { + if m.Roles == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("roles") + } else { data[i] = 0x12 i++ - i = encodeVarintMesos(data, i, uint64(m.FrameworkId.Size())) - n24, err := m.FrameworkId.MarshalTo(data[i:]) + i = encodeVarintMesos(data, i, uint64(m.Roles.Size())) + n52, err := m.Roles.MarshalTo(data[i:]) if err != nil { return 0, err } - i += n24 + i += n52 } - if m.ExecutorId != nil { - data[i] = 0x1a - i++ - i = encodeVarintMesos(data, i, uint64(m.ExecutorId.Size())) - n25, err := m.ExecutorId.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n25 + if m.XXX_unrecognized != nil { + i += copy(data[i:], m.XXX_unrecognized) } - if m.ExecutorName != nil { - data[i] = 0x22 - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.ExecutorName))) - i += copy(data[i:], *m.ExecutorName) + return i, nil +} + +func (m *ACL_RunTask) Marshal() (data []byte, err error) { + size := m.Size() + data = make([]byte, size) + n, err := m.MarshalTo(data) + if err != nil { + return nil, err } - if m.TaskId != nil { - data[i] = 0x2a + return data[:n], nil +} + +func (m *ACL_RunTask) MarshalTo(data []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.Principals == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("principals") + } else { + data[i] = 0xa i++ - i = encodeVarintMesos(data, i, uint64(m.TaskId.Size())) - n26, err := m.TaskId.MarshalTo(data[i:]) + i = encodeVarintMesos(data, i, uint64(m.Principals.Size())) + n53, err := m.Principals.MarshalTo(data[i:]) if err != nil { return 0, err } - i += n26 + i += n53 } - if m.Statistics != nil { - data[i] = 0x32 + if m.Users == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("users") + } else { + data[i] = 0x12 i++ - i = encodeVarintMesos(data, i, uint64(m.Statistics.Size())) - n27, err := m.Statistics.MarshalTo(data[i:]) + i = encodeVarintMesos(data, i, uint64(m.Users.Size())) + n54, err := m.Users.MarshalTo(data[i:]) if err != nil { return 0, err } - i += n27 + i += n54 } if m.XXX_unrecognized != nil { i += copy(data[i:], m.XXX_unrecognized) @@ -14780,7 +16679,7 @@ func (m *ResourceUsage) MarshalTo(data []byte) (n int, err error) { return i, nil } -func (m *PerfStatistics) Marshal() (data []byte, err error) { +func (m *ACL_ShutdownFramework) Marshal() (data []byte, err error) { size := m.Size() data = make([]byte, size) n, err := m.MarshalTo(data) @@ -14790,351 +16689,225 @@ func (m *PerfStatistics) Marshal() (data []byte, err error) { return data[:n], nil } -func (m *PerfStatistics) MarshalTo(data []byte) (n int, err error) { +func (m *ACL_ShutdownFramework) MarshalTo(data []byte) (int, error) { var i int _ = i var l int _ = l - if m.Timestamp != nil { - data[i] = 0x9 - i++ - i = encodeFixed64Mesos(data, i, uint64(math2.Float64bits(*m.Timestamp))) - } - if m.Duration != nil { - data[i] = 0x11 - i++ - i = encodeFixed64Mesos(data, i, uint64(math2.Float64bits(*m.Duration))) - } - if m.Cycles != nil { - data[i] = 0x18 - i++ - i = encodeVarintMesos(data, i, uint64(*m.Cycles)) - } - if m.StalledCyclesFrontend != nil { - data[i] = 0x20 - i++ - i = encodeVarintMesos(data, i, uint64(*m.StalledCyclesFrontend)) - } - if m.StalledCyclesBackend != nil { - data[i] = 0x28 - i++ - i = encodeVarintMesos(data, i, uint64(*m.StalledCyclesBackend)) - } - if m.Instructions != nil { - data[i] = 0x30 - i++ - i = encodeVarintMesos(data, i, uint64(*m.Instructions)) - } - if m.CacheReferences != nil { - data[i] = 0x38 - i++ - i = encodeVarintMesos(data, i, uint64(*m.CacheReferences)) - } - if m.CacheMisses != nil { - data[i] = 0x40 - i++ - i = encodeVarintMesos(data, i, uint64(*m.CacheMisses)) - } - if m.Branches != nil { - data[i] = 0x48 - i++ - i = encodeVarintMesos(data, i, uint64(*m.Branches)) - } - if m.BranchMisses != nil { - data[i] = 0x50 - i++ - i = encodeVarintMesos(data, i, uint64(*m.BranchMisses)) - } - if m.BusCycles != nil { - data[i] = 0x58 - i++ - i = encodeVarintMesos(data, i, uint64(*m.BusCycles)) - } - if m.RefCycles != nil { - data[i] = 0x60 - i++ - i = encodeVarintMesos(data, i, uint64(*m.RefCycles)) - } - if m.CpuClock != nil { - data[i] = 0x69 - i++ - i = encodeFixed64Mesos(data, i, uint64(math2.Float64bits(*m.CpuClock))) - } - if m.TaskClock != nil { - data[i] = 0x71 - i++ - i = encodeFixed64Mesos(data, i, uint64(math2.Float64bits(*m.TaskClock))) - } - if m.PageFaults != nil { - data[i] = 0x78 - i++ - i = encodeVarintMesos(data, i, uint64(*m.PageFaults)) - } - if m.MinorFaults != nil { - data[i] = 0x80 - i++ - data[i] = 0x1 - i++ - i = encodeVarintMesos(data, i, uint64(*m.MinorFaults)) - } - if m.MajorFaults != nil { - data[i] = 0x88 - i++ - data[i] = 0x1 - i++ - i = encodeVarintMesos(data, i, uint64(*m.MajorFaults)) - } - if m.ContextSwitches != nil { - data[i] = 0x90 - i++ - data[i] = 0x1 - i++ - i = encodeVarintMesos(data, i, uint64(*m.ContextSwitches)) - } - if m.CpuMigrations != nil { - data[i] = 0x98 - i++ - data[i] = 0x1 - i++ - i = encodeVarintMesos(data, i, uint64(*m.CpuMigrations)) - } - if m.AlignmentFaults != nil { - data[i] = 0xa0 - i++ - data[i] = 0x1 - i++ - i = encodeVarintMesos(data, i, uint64(*m.AlignmentFaults)) - } - if m.EmulationFaults != nil { - data[i] = 0xa8 - i++ - data[i] = 0x1 - i++ - i = encodeVarintMesos(data, i, uint64(*m.EmulationFaults)) - } - if m.L1DcacheLoads != nil { - data[i] = 0xb0 - i++ - data[i] = 0x1 - i++ - i = encodeVarintMesos(data, i, uint64(*m.L1DcacheLoads)) - } - if m.L1DcacheLoadMisses != nil { - data[i] = 0xb8 - i++ - data[i] = 0x1 - i++ - i = encodeVarintMesos(data, i, uint64(*m.L1DcacheLoadMisses)) - } - if m.L1DcacheStores != nil { - data[i] = 0xc0 - i++ - data[i] = 0x1 - i++ - i = encodeVarintMesos(data, i, uint64(*m.L1DcacheStores)) - } - if m.L1DcacheStoreMisses != nil { - data[i] = 0xc8 - i++ - data[i] = 0x1 - i++ - i = encodeVarintMesos(data, i, uint64(*m.L1DcacheStoreMisses)) - } - if m.L1DcachePrefetches != nil { - data[i] = 0xd0 - i++ - data[i] = 0x1 - i++ - i = encodeVarintMesos(data, i, uint64(*m.L1DcachePrefetches)) - } - if m.L1DcachePrefetchMisses != nil { - data[i] = 0xd8 - i++ - data[i] = 0x1 - i++ - i = encodeVarintMesos(data, i, uint64(*m.L1DcachePrefetchMisses)) - } - if m.L1IcacheLoads != nil { - data[i] = 0xe0 - i++ - data[i] = 0x1 - i++ - i = encodeVarintMesos(data, i, uint64(*m.L1IcacheLoads)) - } - if m.L1IcacheLoadMisses != nil { - data[i] = 0xe8 - i++ - data[i] = 0x1 - i++ - i = encodeVarintMesos(data, i, uint64(*m.L1IcacheLoadMisses)) - } - if m.L1IcachePrefetches != nil { - data[i] = 0xf0 - i++ - data[i] = 0x1 - i++ - i = encodeVarintMesos(data, i, uint64(*m.L1IcachePrefetches)) - } - if m.L1IcachePrefetchMisses != nil { - data[i] = 0xf8 - i++ - data[i] = 0x1 - i++ - i = encodeVarintMesos(data, i, uint64(*m.L1IcachePrefetchMisses)) - } - if m.LlcLoads != nil { - data[i] = 0x80 - i++ - data[i] = 0x2 - i++ - i = encodeVarintMesos(data, i, uint64(*m.LlcLoads)) - } - if m.LlcLoadMisses != nil { - data[i] = 0x88 - i++ - data[i] = 0x2 - i++ - i = encodeVarintMesos(data, i, uint64(*m.LlcLoadMisses)) - } - if m.LlcStores != nil { - data[i] = 0x90 - i++ - data[i] = 0x2 + if m.Principals == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("principals") + } else { + data[i] = 0xa i++ - i = encodeVarintMesos(data, i, uint64(*m.LlcStores)) + i = encodeVarintMesos(data, i, uint64(m.Principals.Size())) + n55, err := m.Principals.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n55 } - if m.LlcStoreMisses != nil { - data[i] = 0x98 - i++ - data[i] = 0x2 + if m.FrameworkPrincipals == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("framework_principals") + } else { + data[i] = 0x12 i++ - i = encodeVarintMesos(data, i, uint64(*m.LlcStoreMisses)) + i = encodeVarintMesos(data, i, uint64(m.FrameworkPrincipals.Size())) + n56, err := m.FrameworkPrincipals.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n56 } - if m.LlcPrefetches != nil { - data[i] = 0xa0 - i++ - data[i] = 0x2 - i++ - i = encodeVarintMesos(data, i, uint64(*m.LlcPrefetches)) + if m.XXX_unrecognized != nil { + i += copy(data[i:], m.XXX_unrecognized) } - if m.LlcPrefetchMisses != nil { - data[i] = 0xa8 - i++ - data[i] = 0x2 - i++ - i = encodeVarintMesos(data, i, uint64(*m.LlcPrefetchMisses)) + return i, nil +} + +func (m *ACLs) Marshal() (data []byte, err error) { + size := m.Size() + data = make([]byte, size) + n, err := m.MarshalTo(data) + if err != nil { + return nil, err } - if m.DtlbLoads != nil { - data[i] = 0xb0 + return data[:n], nil +} + +func (m *ACLs) MarshalTo(data []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.Permissive != nil { + data[i] = 0x8 i++ - data[i] = 0x2 + if *m.Permissive { + data[i] = 1 + } else { + data[i] = 0 + } i++ - i = encodeVarintMesos(data, i, uint64(*m.DtlbLoads)) } - if m.DtlbLoadMisses != nil { - data[i] = 0xb8 - i++ - data[i] = 0x2 - i++ - i = encodeVarintMesos(data, i, uint64(*m.DtlbLoadMisses)) + if len(m.RegisterFrameworks) > 0 { + for _, msg := range m.RegisterFrameworks { + data[i] = 0x12 + i++ + i = encodeVarintMesos(data, i, uint64(msg.Size())) + n, err := msg.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n + } } - if m.DtlbStores != nil { - data[i] = 0xc0 - i++ - data[i] = 0x2 - i++ - i = encodeVarintMesos(data, i, uint64(*m.DtlbStores)) + if len(m.RunTasks) > 0 { + for _, msg := range m.RunTasks { + data[i] = 0x1a + i++ + i = encodeVarintMesos(data, i, uint64(msg.Size())) + n, err := msg.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n + } } - if m.DtlbStoreMisses != nil { - data[i] = 0xc8 - i++ - data[i] = 0x2 - i++ - i = encodeVarintMesos(data, i, uint64(*m.DtlbStoreMisses)) + if len(m.ShutdownFrameworks) > 0 { + for _, msg := range m.ShutdownFrameworks { + data[i] = 0x22 + i++ + i = encodeVarintMesos(data, i, uint64(msg.Size())) + n, err := msg.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n + } } - if m.DtlbPrefetches != nil { - data[i] = 0xd0 - i++ - data[i] = 0x2 - i++ - i = encodeVarintMesos(data, i, uint64(*m.DtlbPrefetches)) + if m.XXX_unrecognized != nil { + i += copy(data[i:], m.XXX_unrecognized) } - if m.DtlbPrefetchMisses != nil { - data[i] = 0xd8 - i++ - data[i] = 0x2 - i++ - i = encodeVarintMesos(data, i, uint64(*m.DtlbPrefetchMisses)) + return i, nil +} + +func (m *RateLimit) Marshal() (data []byte, err error) { + size := m.Size() + data = make([]byte, size) + n, err := m.MarshalTo(data) + if err != nil { + return nil, err } - if m.ItlbLoads != nil { - data[i] = 0xe0 - i++ - data[i] = 0x2 + return data[:n], nil +} + +func (m *RateLimit) MarshalTo(data []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.Qps != nil { + data[i] = 0x9 i++ - i = encodeVarintMesos(data, i, uint64(*m.ItlbLoads)) + i = encodeFixed64Mesos(data, i, uint64(math.Float64bits(*m.Qps))) } - if m.ItlbLoadMisses != nil { - data[i] = 0xe8 - i++ - data[i] = 0x2 + if m.Principal == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("principal") + } else { + data[i] = 0x12 i++ - i = encodeVarintMesos(data, i, uint64(*m.ItlbLoadMisses)) + i = encodeVarintMesos(data, i, uint64(len(*m.Principal))) + i += copy(data[i:], *m.Principal) } - if m.BranchLoads != nil { - data[i] = 0xf0 - i++ - data[i] = 0x2 + if m.Capacity != nil { + data[i] = 0x18 i++ - i = encodeVarintMesos(data, i, uint64(*m.BranchLoads)) + i = encodeVarintMesos(data, i, uint64(*m.Capacity)) } - if m.BranchLoadMisses != nil { - data[i] = 0xf8 - i++ - data[i] = 0x2 - i++ - i = encodeVarintMesos(data, i, uint64(*m.BranchLoadMisses)) + if m.XXX_unrecognized != nil { + i += copy(data[i:], m.XXX_unrecognized) } - if m.NodeLoads != nil { - data[i] = 0x80 - i++ - data[i] = 0x3 - i++ - i = encodeVarintMesos(data, i, uint64(*m.NodeLoads)) + return i, nil +} + +func (m *RateLimits) Marshal() (data []byte, err error) { + size := m.Size() + data = make([]byte, size) + n, err := m.MarshalTo(data) + if err != nil { + return nil, err } - if m.NodeLoadMisses != nil { - data[i] = 0x88 - i++ - data[i] = 0x3 - i++ - i = encodeVarintMesos(data, i, uint64(*m.NodeLoadMisses)) + return data[:n], nil +} + +func (m *RateLimits) MarshalTo(data []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if len(m.Limits) > 0 { + for _, msg := range m.Limits { + data[i] = 0xa + i++ + i = encodeVarintMesos(data, i, uint64(msg.Size())) + n, err := msg.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n + } } - if m.NodeStores != nil { - data[i] = 0x90 - i++ - data[i] = 0x3 + if m.AggregateDefaultQps != nil { + data[i] = 0x11 i++ - i = encodeVarintMesos(data, i, uint64(*m.NodeStores)) + i = encodeFixed64Mesos(data, i, uint64(math.Float64bits(*m.AggregateDefaultQps))) } - if m.NodeStoreMisses != nil { - data[i] = 0x98 - i++ - data[i] = 0x3 + if m.AggregateDefaultCapacity != nil { + data[i] = 0x18 i++ - i = encodeVarintMesos(data, i, uint64(*m.NodeStoreMisses)) + i = encodeVarintMesos(data, i, uint64(*m.AggregateDefaultCapacity)) } - if m.NodePrefetches != nil { - data[i] = 0xa0 - i++ - data[i] = 0x3 + if m.XXX_unrecognized != nil { + i += copy(data[i:], m.XXX_unrecognized) + } + return i, nil +} + +func (m *Volume) 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 *Volume) MarshalTo(data []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.ContainerPath == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("container_path") + } else { + data[i] = 0xa i++ - i = encodeVarintMesos(data, i, uint64(*m.NodePrefetches)) + i = encodeVarintMesos(data, i, uint64(len(*m.ContainerPath))) + i += copy(data[i:], *m.ContainerPath) } - if m.NodePrefetchMisses != nil { - data[i] = 0xa8 + if m.HostPath != nil { + data[i] = 0x12 i++ - data[i] = 0x3 + i = encodeVarintMesos(data, i, uint64(len(*m.HostPath))) + i += copy(data[i:], *m.HostPath) + } + if m.Mode == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("mode") + } else { + data[i] = 0x18 i++ - i = encodeVarintMesos(data, i, uint64(*m.NodePrefetchMisses)) + i = encodeVarintMesos(data, i, uint64(*m.Mode)) } if m.XXX_unrecognized != nil { i += copy(data[i:], m.XXX_unrecognized) @@ -15142,7 +16915,7 @@ func (m *PerfStatistics) MarshalTo(data []byte) (n int, err error) { return i, nil } -func (m *Request) Marshal() (data []byte, err error) { +func (m *ContainerInfo) Marshal() (data []byte, err error) { size := m.Size() data = make([]byte, size) n, err := m.MarshalTo(data) @@ -15152,23 +16925,20 @@ func (m *Request) Marshal() (data []byte, err error) { return data[:n], nil } -func (m *Request) MarshalTo(data []byte) (n int, err error) { +func (m *ContainerInfo) MarshalTo(data []byte) (int, error) { var i int _ = i var l int _ = l - if m.SlaveId != nil { - data[i] = 0xa + if m.Type == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("type") + } else { + data[i] = 0x8 i++ - i = encodeVarintMesos(data, i, uint64(m.SlaveId.Size())) - n28, err := m.SlaveId.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n28 + i = encodeVarintMesos(data, i, uint64(*m.Type)) } - if len(m.Resources) > 0 { - for _, msg := range m.Resources { + if len(m.Volumes) > 0 { + for _, msg := range m.Volumes { data[i] = 0x12 i++ i = encodeVarintMesos(data, i, uint64(msg.Size())) @@ -15179,13 +16949,29 @@ func (m *Request) MarshalTo(data []byte) (n int, err error) { i += n } } + if m.Docker != nil { + data[i] = 0x1a + i++ + i = encodeVarintMesos(data, i, uint64(m.Docker.Size())) + n57, err := m.Docker.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n57 + } + if m.Hostname != nil { + data[i] = 0x22 + i++ + i = encodeVarintMesos(data, i, uint64(len(*m.Hostname))) + i += copy(data[i:], *m.Hostname) + } if m.XXX_unrecognized != nil { i += copy(data[i:], m.XXX_unrecognized) } return i, nil } -func (m *Offer) Marshal() (data []byte, err error) { +func (m *ContainerInfo_DockerInfo) Marshal() (data []byte, err error) { size := m.Size() data = make([]byte, size) n, err := m.MarshalTo(data) @@ -15195,50 +16981,27 @@ func (m *Offer) Marshal() (data []byte, err error) { return data[:n], nil } -func (m *Offer) MarshalTo(data []byte) (n int, err error) { +func (m *ContainerInfo_DockerInfo) MarshalTo(data []byte) (int, error) { var i int _ = i var l int _ = l - if m.Id != nil { + if m.Image == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("image") + } else { data[i] = 0xa i++ - i = encodeVarintMesos(data, i, uint64(m.Id.Size())) - n29, err := m.Id.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n29 - } - if m.FrameworkId != nil { - data[i] = 0x12 - i++ - i = encodeVarintMesos(data, i, uint64(m.FrameworkId.Size())) - n30, err := m.FrameworkId.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n30 - } - if m.SlaveId != nil { - data[i] = 0x1a - i++ - i = encodeVarintMesos(data, i, uint64(m.SlaveId.Size())) - n31, err := m.SlaveId.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n31 + i = encodeVarintMesos(data, i, uint64(len(*m.Image))) + i += copy(data[i:], *m.Image) } - if m.Hostname != nil { - data[i] = 0x22 + if m.Network != nil { + data[i] = 0x10 i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Hostname))) - i += copy(data[i:], *m.Hostname) + i = encodeVarintMesos(data, i, uint64(*m.Network)) } - if len(m.Resources) > 0 { - for _, msg := range m.Resources { - data[i] = 0x2a + if len(m.PortMappings) > 0 { + for _, msg := range m.PortMappings { + data[i] = 0x1a i++ i = encodeVarintMesos(data, i, uint64(msg.Size())) n, err := msg.MarshalTo(data[i:]) @@ -15248,21 +17011,19 @@ func (m *Offer) MarshalTo(data []byte) (n int, err error) { i += n } } - if len(m.Attributes) > 0 { - for _, msg := range m.Attributes { - data[i] = 0x3a - i++ - i = encodeVarintMesos(data, i, uint64(msg.Size())) - n, err := msg.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n + if m.Privileged != nil { + data[i] = 0x20 + i++ + if *m.Privileged { + data[i] = 1 + } else { + data[i] = 0 } + i++ } - if len(m.ExecutorIds) > 0 { - for _, msg := range m.ExecutorIds { - data[i] = 0x32 + if len(m.Parameters) > 0 { + for _, msg := range m.Parameters { + data[i] = 0x2a i++ i = encodeVarintMesos(data, i, uint64(msg.Size())) n, err := msg.MarshalTo(data[i:]) @@ -15272,13 +17033,23 @@ func (m *Offer) MarshalTo(data []byte) (n int, err error) { i += n } } + if m.ForcePullImage != nil { + data[i] = 0x30 + i++ + if *m.ForcePullImage { + data[i] = 1 + } else { + data[i] = 0 + } + i++ + } if m.XXX_unrecognized != nil { i += copy(data[i:], m.XXX_unrecognized) } return i, nil } -func (m *TaskInfo) Marshal() (data []byte, err error) { +func (m *ContainerInfo_DockerInfo_PortMapping) Marshal() (data []byte, err error) { size := m.Size() data = make([]byte, size) n, err := m.MarshalTo(data) @@ -15288,40 +17059,55 @@ func (m *TaskInfo) Marshal() (data []byte, err error) { return data[:n], nil } -func (m *TaskInfo) MarshalTo(data []byte) (n int, err error) { +func (m *ContainerInfo_DockerInfo_PortMapping) MarshalTo(data []byte) (int, error) { var i int _ = i var l int _ = l - if m.Name != nil { - data[i] = 0xa + if m.HostPort == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("host_port") + } else { + data[i] = 0x8 i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Name))) - i += copy(data[i:], *m.Name) + i = encodeVarintMesos(data, i, uint64(*m.HostPort)) } - if m.TaskId != nil { - data[i] = 0x12 + if m.ContainerPort == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("container_port") + } else { + data[i] = 0x10 i++ - i = encodeVarintMesos(data, i, uint64(m.TaskId.Size())) - n32, err := m.TaskId.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n32 + i = encodeVarintMesos(data, i, uint64(*m.ContainerPort)) } - if m.SlaveId != nil { + if m.Protocol != nil { data[i] = 0x1a i++ - i = encodeVarintMesos(data, i, uint64(m.SlaveId.Size())) - n33, err := m.SlaveId.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n33 + i = encodeVarintMesos(data, i, uint64(len(*m.Protocol))) + i += copy(data[i:], *m.Protocol) } - if len(m.Resources) > 0 { - for _, msg := range m.Resources { - data[i] = 0x22 + if m.XXX_unrecognized != nil { + i += copy(data[i:], m.XXX_unrecognized) + } + return i, nil +} + +func (m *Labels) 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 *Labels) MarshalTo(data []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if len(m.Labels) > 0 { + for _, msg := range m.Labels { + data[i] = 0xa i++ i = encodeVarintMesos(data, i, uint64(msg.Size())) n, err := msg.MarshalTo(data[i:]) @@ -15331,51 +17117,113 @@ func (m *TaskInfo) MarshalTo(data []byte) (n int, err error) { i += n } } - if m.Executor != nil { - data[i] = 0x2a + if m.XXX_unrecognized != nil { + i += copy(data[i:], m.XXX_unrecognized) + } + return i, nil +} + +func (m *Label) 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 *Label) MarshalTo(data []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.Key == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("key") + } else { + data[i] = 0xa i++ - i = encodeVarintMesos(data, i, uint64(m.Executor.Size())) - n34, err := m.Executor.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n34 + i = encodeVarintMesos(data, i, uint64(len(*m.Key))) + i += copy(data[i:], *m.Key) } - if m.Command != nil { - data[i] = 0x3a + if m.Value != nil { + data[i] = 0x12 i++ - i = encodeVarintMesos(data, i, uint64(m.Command.Size())) - n35, err := m.Command.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n35 + i = encodeVarintMesos(data, i, uint64(len(*m.Value))) + i += copy(data[i:], *m.Value) } - if m.Container != nil { - data[i] = 0x4a + if m.XXX_unrecognized != nil { + i += copy(data[i:], m.XXX_unrecognized) + } + return i, nil +} + +func (m *Port) 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 *Port) MarshalTo(data []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.Number == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("number") + } else { + data[i] = 0x8 i++ - i = encodeVarintMesos(data, i, uint64(m.Container.Size())) - n36, err := m.Container.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n36 + i = encodeVarintMesos(data, i, uint64(*m.Number)) } - if m.Data != nil { - data[i] = 0x32 + if m.Name != nil { + data[i] = 0x12 i++ - i = encodeVarintMesos(data, i, uint64(len(m.Data))) - i += copy(data[i:], m.Data) + i = encodeVarintMesos(data, i, uint64(len(*m.Name))) + i += copy(data[i:], *m.Name) } - if m.HealthCheck != nil { - data[i] = 0x42 + if m.Protocol != nil { + data[i] = 0x1a i++ - i = encodeVarintMesos(data, i, uint64(m.HealthCheck.Size())) - n37, err := m.HealthCheck.MarshalTo(data[i:]) - if err != nil { - return 0, err + i = encodeVarintMesos(data, i, uint64(len(*m.Protocol))) + i += copy(data[i:], *m.Protocol) + } + if m.XXX_unrecognized != nil { + i += copy(data[i:], m.XXX_unrecognized) + } + return i, nil +} + +func (m *Ports) 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 *Ports) MarshalTo(data []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if len(m.Ports) > 0 { + for _, msg := range m.Ports { + data[i] = 0xa + i++ + i = encodeVarintMesos(data, i, uint64(msg.Size())) + n, err := msg.MarshalTo(data[i:]) + if err != nil { + return 0, err + } + i += n } - i += n37 } if m.XXX_unrecognized != nil { i += copy(data[i:], m.XXX_unrecognized) @@ -15383,7 +17231,7 @@ func (m *TaskInfo) MarshalTo(data []byte) (n int, err error) { return i, nil } -func (m *TaskStatus) Marshal() (data []byte, err error) { +func (m *DiscoveryInfo) Marshal() (data []byte, err error) { size := m.Size() data = make([]byte, size) n, err := m.MarshalTo(data) @@ -15393,7515 +17241,14929 @@ func (m *TaskStatus) Marshal() (data []byte, err error) { return data[:n], nil } -func (m *TaskStatus) MarshalTo(data []byte) (n int, err error) { +func (m *DiscoveryInfo) MarshalTo(data []byte) (int, error) { var i int _ = i var l int _ = l - if m.TaskId != nil { - data[i] = 0xa - i++ - i = encodeVarintMesos(data, i, uint64(m.TaskId.Size())) - n38, err := m.TaskId.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n38 - } - if m.State != nil { - data[i] = 0x10 + if m.Visibility == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("visibility") + } else { + data[i] = 0x8 i++ - i = encodeVarintMesos(data, i, uint64(*m.State)) + i = encodeVarintMesos(data, i, uint64(*m.Visibility)) } - if m.Message != nil { - data[i] = 0x22 + if m.Name != nil { + data[i] = 0x12 i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Message))) - i += copy(data[i:], *m.Message) + i = encodeVarintMesos(data, i, uint64(len(*m.Name))) + i += copy(data[i:], *m.Name) } - if m.Source != nil { - data[i] = 0x48 + if m.Environment != nil { + data[i] = 0x1a i++ - i = encodeVarintMesos(data, i, uint64(*m.Source)) + i = encodeVarintMesos(data, i, uint64(len(*m.Environment))) + i += copy(data[i:], *m.Environment) } - if m.Reason != nil { - data[i] = 0x50 + if m.Location != nil { + data[i] = 0x22 i++ - i = encodeVarintMesos(data, i, uint64(*m.Reason)) + i = encodeVarintMesos(data, i, uint64(len(*m.Location))) + i += copy(data[i:], *m.Location) } - if m.Data != nil { - data[i] = 0x1a + if m.Version != nil { + data[i] = 0x2a i++ - i = encodeVarintMesos(data, i, uint64(len(m.Data))) - i += copy(data[i:], m.Data) + i = encodeVarintMesos(data, i, uint64(len(*m.Version))) + i += copy(data[i:], *m.Version) } - if m.SlaveId != nil { - data[i] = 0x2a + if m.Ports != nil { + data[i] = 0x32 i++ - i = encodeVarintMesos(data, i, uint64(m.SlaveId.Size())) - n39, err := m.SlaveId.MarshalTo(data[i:]) + i = encodeVarintMesos(data, i, uint64(m.Ports.Size())) + n58, err := m.Ports.MarshalTo(data[i:]) if err != nil { return 0, err } - i += n39 + i += n58 } - if m.ExecutorId != nil { + if m.Labels != nil { data[i] = 0x3a i++ - i = encodeVarintMesos(data, i, uint64(m.ExecutorId.Size())) - n40, err := m.ExecutorId.MarshalTo(data[i:]) + i = encodeVarintMesos(data, i, uint64(m.Labels.Size())) + n59, err := m.Labels.MarshalTo(data[i:]) if err != nil { return 0, err } - i += n40 + i += n59 + } + if m.XXX_unrecognized != nil { + i += copy(data[i:], m.XXX_unrecognized) + } + return i, nil +} + +func encodeFixed64Mesos(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 encodeFixed32Mesos(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 encodeVarintMesos(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 NewPopulatedFrameworkID(r randyMesos, easy bool) *FrameworkID { + this := &FrameworkID{} + v1 := randStringMesos(r) + this.Value = &v1 + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 2) + } + return this +} + +func NewPopulatedOfferID(r randyMesos, easy bool) *OfferID { + this := &OfferID{} + v2 := randStringMesos(r) + this.Value = &v2 + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 2) + } + return this +} + +func NewPopulatedSlaveID(r randyMesos, easy bool) *SlaveID { + this := &SlaveID{} + v3 := randStringMesos(r) + this.Value = &v3 + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 2) + } + return this +} + +func NewPopulatedTaskID(r randyMesos, easy bool) *TaskID { + this := &TaskID{} + v4 := randStringMesos(r) + this.Value = &v4 + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 2) + } + return this +} + +func NewPopulatedExecutorID(r randyMesos, easy bool) *ExecutorID { + this := &ExecutorID{} + v5 := randStringMesos(r) + this.Value = &v5 + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 2) + } + return this +} + +func NewPopulatedContainerID(r randyMesos, easy bool) *ContainerID { + this := &ContainerID{} + v6 := randStringMesos(r) + this.Value = &v6 + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 2) + } + return this +} + +func NewPopulatedFrameworkInfo(r randyMesos, easy bool) *FrameworkInfo { + this := &FrameworkInfo{} + v7 := randStringMesos(r) + this.User = &v7 + v8 := randStringMesos(r) + this.Name = &v8 + if r.Intn(10) != 0 { + this.Id = NewPopulatedFrameworkID(r, easy) + } + if r.Intn(10) != 0 { + v9 := float64(r.Float64()) + if r.Intn(2) == 0 { + v9 *= -1 + } + this.FailoverTimeout = &v9 + } + if r.Intn(10) != 0 { + v10 := bool(bool(r.Intn(2) == 0)) + this.Checkpoint = &v10 + } + if r.Intn(10) != 0 { + v11 := randStringMesos(r) + this.Role = &v11 + } + if r.Intn(10) != 0 { + v12 := randStringMesos(r) + this.Hostname = &v12 + } + if r.Intn(10) != 0 { + v13 := randStringMesos(r) + this.Principal = &v13 + } + if r.Intn(10) != 0 { + v14 := randStringMesos(r) + this.WebuiUrl = &v14 + } + if r.Intn(10) != 0 { + v15 := r.Intn(10) + this.Capabilities = make([]*FrameworkInfo_Capability, v15) + for i := 0; i < v15; i++ { + this.Capabilities[i] = NewPopulatedFrameworkInfo_Capability(r, easy) + } + } + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 11) + } + return this +} + +func NewPopulatedFrameworkInfo_Capability(r randyMesos, easy bool) *FrameworkInfo_Capability { + this := &FrameworkInfo_Capability{} + v16 := FrameworkInfo_Capability_Type([]int32{1}[r.Intn(1)]) + this.Type = &v16 + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 2) + } + return this +} + +func NewPopulatedHealthCheck(r randyMesos, easy bool) *HealthCheck { + this := &HealthCheck{} + if r.Intn(10) != 0 { + this.Http = NewPopulatedHealthCheck_HTTP(r, easy) + } + if r.Intn(10) != 0 { + v17 := float64(r.Float64()) + if r.Intn(2) == 0 { + v17 *= -1 + } + this.DelaySeconds = &v17 + } + if r.Intn(10) != 0 { + v18 := float64(r.Float64()) + if r.Intn(2) == 0 { + v18 *= -1 + } + this.IntervalSeconds = &v18 + } + if r.Intn(10) != 0 { + v19 := float64(r.Float64()) + if r.Intn(2) == 0 { + v19 *= -1 + } + this.TimeoutSeconds = &v19 + } + if r.Intn(10) != 0 { + v20 := uint32(r.Uint32()) + this.ConsecutiveFailures = &v20 + } + if r.Intn(10) != 0 { + v21 := float64(r.Float64()) + if r.Intn(2) == 0 { + v21 *= -1 + } + this.GracePeriodSeconds = &v21 + } + if r.Intn(10) != 0 { + this.Command = NewPopulatedCommandInfo(r, easy) + } + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 8) + } + return this +} + +func NewPopulatedHealthCheck_HTTP(r randyMesos, easy bool) *HealthCheck_HTTP { + this := &HealthCheck_HTTP{} + v22 := uint32(r.Uint32()) + this.Port = &v22 + if r.Intn(10) != 0 { + v23 := randStringMesos(r) + this.Path = &v23 + } + if r.Intn(10) != 0 { + v24 := r.Intn(100) + this.Statuses = make([]uint32, v24) + for i := 0; i < v24; i++ { + this.Statuses[i] = uint32(r.Uint32()) + } + } + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 5) + } + return this +} + +func NewPopulatedCommandInfo(r randyMesos, easy bool) *CommandInfo { + this := &CommandInfo{} + if r.Intn(10) != 0 { + v25 := r.Intn(10) + this.Uris = make([]*CommandInfo_URI, v25) + for i := 0; i < v25; i++ { + this.Uris[i] = NewPopulatedCommandInfo_URI(r, easy) + } + } + if r.Intn(10) != 0 { + this.Environment = NewPopulatedEnvironment(r, easy) } - if m.Timestamp != nil { - data[i] = 0x31 - i++ - i = encodeFixed64Mesos(data, i, uint64(math2.Float64bits(*m.Timestamp))) + if r.Intn(10) != 0 { + v26 := randStringMesos(r) + this.Value = &v26 } - if m.Healthy != nil { - data[i] = 0x40 - i++ - if *m.Healthy { - data[i] = 1 - } else { - data[i] = 0 + if r.Intn(10) != 0 { + this.Container = NewPopulatedCommandInfo_ContainerInfo(r, easy) + } + if r.Intn(10) != 0 { + v27 := randStringMesos(r) + this.User = &v27 + } + if r.Intn(10) != 0 { + v28 := bool(bool(r.Intn(2) == 0)) + this.Shell = &v28 + } + if r.Intn(10) != 0 { + v29 := r.Intn(10) + this.Arguments = make([]string, v29) + for i := 0; i < v29; i++ { + this.Arguments[i] = randStringMesos(r) } - i++ } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 8) } - return i, nil + return this } -func (m *Filters) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err +func NewPopulatedCommandInfo_URI(r randyMesos, easy bool) *CommandInfo_URI { + this := &CommandInfo_URI{} + v30 := randStringMesos(r) + this.Value = &v30 + if r.Intn(10) != 0 { + v31 := bool(bool(r.Intn(2) == 0)) + this.Executable = &v31 } - return data[:n], nil -} - -func (m *Filters) MarshalTo(data []byte) (n int, err error) { - var i int - _ = i - var l int - _ = l - if m.RefuseSeconds != nil { - data[i] = 0x9 - i++ - i = encodeFixed64Mesos(data, i, uint64(math2.Float64bits(*m.RefuseSeconds))) + if r.Intn(10) != 0 { + v32 := bool(bool(r.Intn(2) == 0)) + this.Extract = &v32 } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) + if r.Intn(10) != 0 { + v33 := bool(bool(r.Intn(2) == 0)) + this.Cache = &v33 } - return i, nil -} - -func (m *Environment) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 5) } - return data[:n], nil + return this } -func (m *Environment) MarshalTo(data []byte) (n int, err error) { - var i int - _ = i - var l int - _ = l - if len(m.Variables) > 0 { - for _, msg := range m.Variables { - data[i] = 0xa - i++ - i = encodeVarintMesos(data, i, uint64(msg.Size())) - n, err := msg.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n +func NewPopulatedCommandInfo_ContainerInfo(r randyMesos, easy bool) *CommandInfo_ContainerInfo { + this := &CommandInfo_ContainerInfo{} + v34 := randStringMesos(r) + this.Image = &v34 + if r.Intn(10) != 0 { + v35 := r.Intn(10) + this.Options = make([]string, v35) + for i := 0; i < v35; i++ { + this.Options[i] = randStringMesos(r) } } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 3) } - return i, nil + return this } -func (m *Environment_Variable) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err +func NewPopulatedExecutorInfo(r randyMesos, easy bool) *ExecutorInfo { + this := &ExecutorInfo{} + this.ExecutorId = NewPopulatedExecutorID(r, easy) + if r.Intn(10) != 0 { + v36 := r.Intn(100) + this.Data = make([]byte, v36) + for i := 0; i < v36; i++ { + this.Data[i] = byte(r.Intn(256)) + } } - return data[:n], nil -} - -func (m *Environment_Variable) MarshalTo(data []byte) (n int, err error) { - var i int - _ = i - var l int - _ = l - if m.Name != nil { - data[i] = 0xa - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Name))) - i += copy(data[i:], *m.Name) + if r.Intn(10) != 0 { + v37 := r.Intn(10) + this.Resources = make([]*Resource, v37) + for i := 0; i < v37; i++ { + this.Resources[i] = NewPopulatedResource(r, easy) + } } - if m.Value != nil { - data[i] = 0x12 - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Value))) - i += copy(data[i:], *m.Value) + this.Command = NewPopulatedCommandInfo(r, easy) + if r.Intn(10) != 0 { + this.FrameworkId = NewPopulatedFrameworkID(r, easy) } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) + if r.Intn(10) != 0 { + v38 := randStringMesos(r) + this.Name = &v38 } - return i, nil -} - -func (m *Parameter) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err + if r.Intn(10) != 0 { + v39 := randStringMesos(r) + this.Source = &v39 } - return data[:n], nil -} - -func (m *Parameter) MarshalTo(data []byte) (n int, err error) { - var i int - _ = i - var l int - _ = l - if m.Key != nil { - data[i] = 0xa - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Key))) - i += copy(data[i:], *m.Key) + if r.Intn(10) != 0 { + this.Container = NewPopulatedContainerInfo(r, easy) } - if m.Value != nil { - data[i] = 0x12 - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Value))) - i += copy(data[i:], *m.Value) + if r.Intn(10) != 0 { + this.Discovery = NewPopulatedDiscoveryInfo(r, easy) } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 13) } - return i, nil + return this } -func (m *Parameters) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err +func NewPopulatedMasterInfo(r randyMesos, easy bool) *MasterInfo { + this := &MasterInfo{} + v40 := randStringMesos(r) + this.Id = &v40 + v41 := uint32(r.Uint32()) + this.Ip = &v41 + v42 := uint32(r.Uint32()) + this.Port = &v42 + if r.Intn(10) != 0 { + v43 := randStringMesos(r) + this.Pid = &v43 } - return data[:n], nil + if r.Intn(10) != 0 { + v44 := randStringMesos(r) + this.Hostname = &v44 + } + if r.Intn(10) != 0 { + v45 := randStringMesos(r) + this.Version = &v45 + } + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 7) + } + return this } -func (m *Parameters) MarshalTo(data []byte) (n int, err error) { - var i int - _ = i - var l int - _ = l - if len(m.Parameter) > 0 { - for _, msg := range m.Parameter { - data[i] = 0xa - i++ - i = encodeVarintMesos(data, i, uint64(msg.Size())) - n, err := msg.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n +func NewPopulatedSlaveInfo(r randyMesos, easy bool) *SlaveInfo { + this := &SlaveInfo{} + v46 := randStringMesos(r) + this.Hostname = &v46 + if r.Intn(10) != 0 { + v47 := r.Intn(10) + this.Resources = make([]*Resource, v47) + for i := 0; i < v47; i++ { + this.Resources[i] = NewPopulatedResource(r, easy) } } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) + if r.Intn(10) != 0 { + v48 := r.Intn(10) + this.Attributes = make([]*Attribute, v48) + for i := 0; i < v48; i++ { + this.Attributes[i] = NewPopulatedAttribute(r, easy) + } } - return i, nil -} - -func (m *Credential) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err + if r.Intn(10) != 0 { + this.Id = NewPopulatedSlaveID(r, easy) } - return data[:n], nil + if r.Intn(10) != 0 { + v49 := bool(bool(r.Intn(2) == 0)) + this.Checkpoint = &v49 + } + if r.Intn(10) != 0 { + v50 := int32(r.Int31()) + if r.Intn(2) == 0 { + v50 *= -1 + } + this.Port = &v50 + } + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 9) + } + return this } -func (m *Credential) MarshalTo(data []byte) (n int, err error) { - var i int - _ = i - var l int - _ = l - if m.Principal != nil { - data[i] = 0xa - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Principal))) - i += copy(data[i:], *m.Principal) +func NewPopulatedValue(r randyMesos, easy bool) *Value { + this := &Value{} + v51 := Value_Type([]int32{0, 1, 2, 3}[r.Intn(4)]) + this.Type = &v51 + if r.Intn(10) != 0 { + this.Scalar = NewPopulatedValue_Scalar(r, easy) } - if m.Secret != nil { - data[i] = 0x12 - i++ - i = encodeVarintMesos(data, i, uint64(len(m.Secret))) - i += copy(data[i:], m.Secret) + if r.Intn(10) != 0 { + this.Ranges = NewPopulatedValue_Ranges(r, easy) + } + if r.Intn(10) != 0 { + this.Set = NewPopulatedValue_Set(r, easy) + } + if r.Intn(10) != 0 { + this.Text = NewPopulatedValue_Text(r, easy) + } + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 6) } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) + return this +} + +func NewPopulatedValue_Scalar(r randyMesos, easy bool) *Value_Scalar { + this := &Value_Scalar{} + v52 := float64(r.Float64()) + if r.Intn(2) == 0 { + v52 *= -1 } - return i, nil + this.Value = &v52 + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 2) + } + return this } -func (m *Credentials) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err +func NewPopulatedValue_Range(r randyMesos, easy bool) *Value_Range { + this := &Value_Range{} + v53 := uint64(uint64(r.Uint32())) + this.Begin = &v53 + v54 := uint64(uint64(r.Uint32())) + this.End = &v54 + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 3) } - return data[:n], nil + return this } -func (m *Credentials) MarshalTo(data []byte) (n int, err error) { - var i int - _ = i - var l int - _ = l - if len(m.Credentials) > 0 { - for _, msg := range m.Credentials { - data[i] = 0xa - i++ - i = encodeVarintMesos(data, i, uint64(msg.Size())) - n, err := msg.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n +func NewPopulatedValue_Ranges(r randyMesos, easy bool) *Value_Ranges { + this := &Value_Ranges{} + if r.Intn(10) != 0 { + v55 := r.Intn(10) + this.Range = make([]*Value_Range, v55) + for i := 0; i < v55; i++ { + this.Range[i] = NewPopulatedValue_Range(r, easy) } } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 2) } - return i, nil + return this } -func (m *ACL) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err +func NewPopulatedValue_Set(r randyMesos, easy bool) *Value_Set { + this := &Value_Set{} + if r.Intn(10) != 0 { + v56 := r.Intn(10) + this.Item = make([]string, v56) + for i := 0; i < v56; i++ { + this.Item[i] = randStringMesos(r) + } } - return data[:n], nil -} - -func (m *ACL) MarshalTo(data []byte) (n int, err error) { - var i int - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 2) } - return i, nil + return this } -func (m *ACL_Entity) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err +func NewPopulatedValue_Text(r randyMesos, easy bool) *Value_Text { + this := &Value_Text{} + v57 := randStringMesos(r) + this.Value = &v57 + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 2) } - return data[:n], nil + return this } -func (m *ACL_Entity) MarshalTo(data []byte) (n int, err error) { - var i int - _ = i - var l int - _ = l - if m.Type != nil { - data[i] = 0x8 - i++ - i = encodeVarintMesos(data, i, uint64(*m.Type)) +func NewPopulatedAttribute(r randyMesos, easy bool) *Attribute { + this := &Attribute{} + v58 := randStringMesos(r) + this.Name = &v58 + v59 := Value_Type([]int32{0, 1, 2, 3}[r.Intn(4)]) + this.Type = &v59 + if r.Intn(10) != 0 { + this.Scalar = NewPopulatedValue_Scalar(r, easy) } - if len(m.Values) > 0 { - for _, s := range m.Values { - data[i] = 0x12 - 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 r.Intn(10) != 0 { + this.Ranges = NewPopulatedValue_Ranges(r, easy) } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) + if r.Intn(10) != 0 { + this.Text = NewPopulatedValue_Text(r, easy) } - return i, nil -} - -func (m *ACL_RegisterFramework) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err + if r.Intn(10) != 0 { + this.Set = NewPopulatedValue_Set(r, easy) } - return data[:n], nil + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 7) + } + return this } -func (m *ACL_RegisterFramework) MarshalTo(data []byte) (n int, err error) { - var i int - _ = i - var l int - _ = l - if m.Principals != nil { - data[i] = 0xa - i++ - i = encodeVarintMesos(data, i, uint64(m.Principals.Size())) - n41, err := m.Principals.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n41 +func NewPopulatedResource(r randyMesos, easy bool) *Resource { + this := &Resource{} + v60 := randStringMesos(r) + this.Name = &v60 + v61 := Value_Type([]int32{0, 1, 2, 3}[r.Intn(4)]) + this.Type = &v61 + if r.Intn(10) != 0 { + this.Scalar = NewPopulatedValue_Scalar(r, easy) } - if m.Roles != nil { - data[i] = 0x12 - i++ - i = encodeVarintMesos(data, i, uint64(m.Roles.Size())) - n42, err := m.Roles.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n42 + if r.Intn(10) != 0 { + this.Ranges = NewPopulatedValue_Ranges(r, easy) } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) + if r.Intn(10) != 0 { + this.Set = NewPopulatedValue_Set(r, easy) } - return i, nil + if r.Intn(10) != 0 { + v62 := randStringMesos(r) + this.Role = &v62 + } + if r.Intn(10) != 0 { + this.Disk = NewPopulatedResource_DiskInfo(r, easy) + } + if r.Intn(10) != 0 { + this.Reservation = NewPopulatedResource_ReservationInfo(r, easy) + } + if r.Intn(10) != 0 { + this.Revocable = NewPopulatedResource_RevocableInfo(r, easy) + } + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 10) + } + return this } -func (m *ACL_RunTask) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err +func NewPopulatedResource_ReservationInfo(r randyMesos, easy bool) *Resource_ReservationInfo { + this := &Resource_ReservationInfo{} + v63 := randStringMesos(r) + this.Principal = &v63 + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 2) } - return data[:n], nil + return this } -func (m *ACL_RunTask) MarshalTo(data []byte) (n int, err error) { - var i int - _ = i - var l int - _ = l - if m.Principals != nil { - data[i] = 0xa - i++ - i = encodeVarintMesos(data, i, uint64(m.Principals.Size())) - n43, err := m.Principals.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n43 +func NewPopulatedResource_DiskInfo(r randyMesos, easy bool) *Resource_DiskInfo { + this := &Resource_DiskInfo{} + if r.Intn(10) != 0 { + this.Persistence = NewPopulatedResource_DiskInfo_Persistence(r, easy) } - if m.Users != nil { - data[i] = 0x12 - i++ - i = encodeVarintMesos(data, i, uint64(m.Users.Size())) - n44, err := m.Users.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n44 + if r.Intn(10) != 0 { + this.Volume = NewPopulatedVolume(r, easy) } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 3) } - return i, nil + return this } -func (m *ACL_ShutdownFramework) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err +func NewPopulatedResource_DiskInfo_Persistence(r randyMesos, easy bool) *Resource_DiskInfo_Persistence { + this := &Resource_DiskInfo_Persistence{} + v64 := randStringMesos(r) + this.Id = &v64 + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 2) } - return data[:n], nil + return this } -func (m *ACL_ShutdownFramework) MarshalTo(data []byte) (n int, err error) { - var i int - _ = i - var l int - _ = l - if m.Principals != nil { - data[i] = 0xa - i++ - i = encodeVarintMesos(data, i, uint64(m.Principals.Size())) - n45, err := m.Principals.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n45 +func NewPopulatedResource_RevocableInfo(r randyMesos, easy bool) *Resource_RevocableInfo { + this := &Resource_RevocableInfo{} + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 1) + } + return this +} + +func NewPopulatedTrafficControlStatistics(r randyMesos, easy bool) *TrafficControlStatistics { + this := &TrafficControlStatistics{} + v65 := randStringMesos(r) + this.Id = &v65 + if r.Intn(10) != 0 { + v66 := uint64(uint64(r.Uint32())) + this.Backlog = &v66 + } + if r.Intn(10) != 0 { + v67 := uint64(uint64(r.Uint32())) + this.Bytes = &v67 + } + if r.Intn(10) != 0 { + v68 := uint64(uint64(r.Uint32())) + this.Drops = &v68 + } + if r.Intn(10) != 0 { + v69 := uint64(uint64(r.Uint32())) + this.Overlimits = &v69 + } + if r.Intn(10) != 0 { + v70 := uint64(uint64(r.Uint32())) + this.Packets = &v70 + } + if r.Intn(10) != 0 { + v71 := uint64(uint64(r.Uint32())) + this.Qlen = &v71 + } + if r.Intn(10) != 0 { + v72 := uint64(uint64(r.Uint32())) + this.Ratebps = &v72 } - if m.FrameworkPrincipals != nil { - data[i] = 0x12 - i++ - i = encodeVarintMesos(data, i, uint64(m.FrameworkPrincipals.Size())) - n46, err := m.FrameworkPrincipals.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n46 + if r.Intn(10) != 0 { + v73 := uint64(uint64(r.Uint32())) + this.Ratepps = &v73 } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) + if r.Intn(10) != 0 { + v74 := uint64(uint64(r.Uint32())) + this.Requeues = &v74 } - return i, nil -} - -func (m *ACLs) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 11) } - return data[:n], nil + return this } -func (m *ACLs) MarshalTo(data []byte) (n int, err error) { - var i int - _ = i - var l int - _ = l - if m.Permissive != nil { - data[i] = 0x8 - i++ - if *m.Permissive { - data[i] = 1 - } else { - data[i] = 0 +func NewPopulatedResourceStatistics(r randyMesos, easy bool) *ResourceStatistics { + this := &ResourceStatistics{} + v75 := float64(r.Float64()) + if r.Intn(2) == 0 { + v75 *= -1 + } + this.Timestamp = &v75 + if r.Intn(10) != 0 { + v76 := float64(r.Float64()) + if r.Intn(2) == 0 { + v76 *= -1 } - i++ + this.CpusUserTimeSecs = &v76 } - if len(m.RegisterFrameworks) > 0 { - for _, msg := range m.RegisterFrameworks { - data[i] = 0x12 - i++ - i = encodeVarintMesos(data, i, uint64(msg.Size())) - n, err := msg.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n + if r.Intn(10) != 0 { + v77 := float64(r.Float64()) + if r.Intn(2) == 0 { + v77 *= -1 } + this.CpusSystemTimeSecs = &v77 } - if len(m.RunTasks) > 0 { - for _, msg := range m.RunTasks { - data[i] = 0x1a - i++ - i = encodeVarintMesos(data, i, uint64(msg.Size())) - n, err := msg.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n + if r.Intn(10) != 0 { + v78 := float64(r.Float64()) + if r.Intn(2) == 0 { + v78 *= -1 } + this.CpusLimit = &v78 } - if len(m.ShutdownFrameworks) > 0 { - for _, msg := range m.ShutdownFrameworks { - data[i] = 0x22 - i++ - i = encodeVarintMesos(data, i, uint64(msg.Size())) - n, err := msg.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n + if r.Intn(10) != 0 { + v79 := uint64(uint64(r.Uint32())) + this.MemRssBytes = &v79 + } + if r.Intn(10) != 0 { + v80 := uint64(uint64(r.Uint32())) + this.MemLimitBytes = &v80 + } + if r.Intn(10) != 0 { + v81 := uint32(r.Uint32()) + this.CpusNrPeriods = &v81 + } + if r.Intn(10) != 0 { + v82 := uint32(r.Uint32()) + this.CpusNrThrottled = &v82 + } + if r.Intn(10) != 0 { + v83 := float64(r.Float64()) + if r.Intn(2) == 0 { + v83 *= -1 } + this.CpusThrottledTimeSecs = &v83 } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) + if r.Intn(10) != 0 { + v84 := uint64(uint64(r.Uint32())) + this.MemFileBytes = &v84 } - return i, nil -} - -func (m *RateLimit) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err + if r.Intn(10) != 0 { + v85 := uint64(uint64(r.Uint32())) + this.MemAnonBytes = &v85 } - return data[:n], nil -} - -func (m *RateLimit) MarshalTo(data []byte) (n int, err error) { - var i int - _ = i - var l int - _ = l - if m.Qps != nil { - data[i] = 0x9 - i++ - i = encodeFixed64Mesos(data, i, uint64(math2.Float64bits(*m.Qps))) + if r.Intn(10) != 0 { + v86 := uint64(uint64(r.Uint32())) + this.MemMappedFileBytes = &v86 } - if m.Principal != nil { - data[i] = 0x12 - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Principal))) - i += copy(data[i:], *m.Principal) + if r.Intn(10) != 0 { + this.Perf = NewPopulatedPerfStatistics(r, easy) } - if m.Capacity != nil { - data[i] = 0x18 - i++ - i = encodeVarintMesos(data, i, uint64(*m.Capacity)) + if r.Intn(10) != 0 { + v87 := uint64(uint64(r.Uint32())) + this.NetRxPackets = &v87 } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) + if r.Intn(10) != 0 { + v88 := uint64(uint64(r.Uint32())) + this.NetRxBytes = &v88 } - return i, nil -} - -func (m *RateLimits) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err + if r.Intn(10) != 0 { + v89 := uint64(uint64(r.Uint32())) + this.NetRxErrors = &v89 } - return data[:n], nil -} - -func (m *RateLimits) MarshalTo(data []byte) (n int, err error) { - var i int - _ = i - var l int - _ = l - if len(m.Limits) > 0 { - for _, msg := range m.Limits { - data[i] = 0xa - i++ - i = encodeVarintMesos(data, i, uint64(msg.Size())) - n, err := msg.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n - } + if r.Intn(10) != 0 { + v90 := uint64(uint64(r.Uint32())) + this.NetRxDropped = &v90 } - if m.AggregateDefaultQps != nil { - data[i] = 0x11 - i++ - i = encodeFixed64Mesos(data, i, uint64(math2.Float64bits(*m.AggregateDefaultQps))) + if r.Intn(10) != 0 { + v91 := uint64(uint64(r.Uint32())) + this.NetTxPackets = &v91 } - if m.AggregateDefaultCapacity != nil { - data[i] = 0x18 - i++ - i = encodeVarintMesos(data, i, uint64(*m.AggregateDefaultCapacity)) + if r.Intn(10) != 0 { + v92 := uint64(uint64(r.Uint32())) + this.NetTxBytes = &v92 } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) + if r.Intn(10) != 0 { + v93 := uint64(uint64(r.Uint32())) + this.NetTxErrors = &v93 } - return i, nil -} - -func (m *Volume) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err + if r.Intn(10) != 0 { + v94 := uint64(uint64(r.Uint32())) + this.NetTxDropped = &v94 } - return data[:n], nil -} - -func (m *Volume) MarshalTo(data []byte) (n int, err error) { - var i int - _ = i - var l int - _ = l - if m.ContainerPath != nil { - data[i] = 0xa - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.ContainerPath))) - i += copy(data[i:], *m.ContainerPath) + if r.Intn(10) != 0 { + v95 := float64(r.Float64()) + if r.Intn(2) == 0 { + v95 *= -1 + } + this.NetTcpRttMicrosecsP50 = &v95 } - if m.HostPath != nil { - data[i] = 0x12 - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.HostPath))) - i += copy(data[i:], *m.HostPath) + if r.Intn(10) != 0 { + v96 := float64(r.Float64()) + if r.Intn(2) == 0 { + v96 *= -1 + } + this.NetTcpRttMicrosecsP90 = &v96 } - if m.Mode != nil { - data[i] = 0x18 - i++ - i = encodeVarintMesos(data, i, uint64(*m.Mode)) + if r.Intn(10) != 0 { + v97 := float64(r.Float64()) + if r.Intn(2) == 0 { + v97 *= -1 + } + this.NetTcpRttMicrosecsP95 = &v97 } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) + if r.Intn(10) != 0 { + v98 := float64(r.Float64()) + if r.Intn(2) == 0 { + v98 *= -1 + } + this.NetTcpRttMicrosecsP99 = &v98 } - return i, nil -} - -func (m *ContainerInfo) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err + if r.Intn(10) != 0 { + v99 := uint64(uint64(r.Uint32())) + this.DiskLimitBytes = &v99 } - return data[:n], nil -} - -func (m *ContainerInfo) MarshalTo(data []byte) (n int, err error) { - var i int - _ = i - var l int - _ = l - if m.Type != nil { - data[i] = 0x8 - i++ - i = encodeVarintMesos(data, i, uint64(*m.Type)) + if r.Intn(10) != 0 { + v100 := uint64(uint64(r.Uint32())) + this.DiskUsedBytes = &v100 } - if len(m.Volumes) > 0 { - for _, msg := range m.Volumes { - data[i] = 0x12 - i++ - i = encodeVarintMesos(data, i, uint64(msg.Size())) - n, err := msg.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n + if r.Intn(10) != 0 { + v101 := float64(r.Float64()) + if r.Intn(2) == 0 { + v101 *= -1 } + this.NetTcpActiveConnections = &v101 + } + if r.Intn(10) != 0 { + v102 := float64(r.Float64()) + if r.Intn(2) == 0 { + v102 *= -1 + } + this.NetTcpTimeWaitConnections = &v102 + } + if r.Intn(10) != 0 { + v103 := uint32(r.Uint32()) + this.Processes = &v103 + } + if r.Intn(10) != 0 { + v104 := uint32(r.Uint32()) + this.Threads = &v104 } - if m.Hostname != nil { - data[i] = 0x22 - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Hostname))) - i += copy(data[i:], *m.Hostname) + if r.Intn(10) != 0 { + v105 := uint64(uint64(r.Uint32())) + this.MemLowPressureCounter = &v105 } - if m.Docker != nil { - data[i] = 0x1a - i++ - i = encodeVarintMesos(data, i, uint64(m.Docker.Size())) - n47, err := m.Docker.MarshalTo(data[i:]) - if err != nil { - return 0, err + if r.Intn(10) != 0 { + v106 := uint64(uint64(r.Uint32())) + this.MemMediumPressureCounter = &v106 + } + if r.Intn(10) != 0 { + v107 := uint64(uint64(r.Uint32())) + this.MemCriticalPressureCounter = &v107 + } + if r.Intn(10) != 0 { + v108 := r.Intn(10) + this.NetTrafficControlStatistics = make([]*TrafficControlStatistics, v108) + for i := 0; i < v108; i++ { + this.NetTrafficControlStatistics[i] = NewPopulatedTrafficControlStatistics(r, easy) } - i += n47 } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) + if r.Intn(10) != 0 { + v109 := uint64(uint64(r.Uint32())) + this.MemTotalBytes = &v109 } - return i, nil -} - -func (m *ContainerInfo_DockerInfo) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err + if r.Intn(10) != 0 { + v110 := uint64(uint64(r.Uint32())) + this.MemTotalMemswBytes = &v110 } - return data[:n], nil -} - -func (m *ContainerInfo_DockerInfo) MarshalTo(data []byte) (n int, err error) { - var i int - _ = i - var l int - _ = l - if m.Image != nil { - data[i] = 0xa - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Image))) - i += copy(data[i:], *m.Image) + if r.Intn(10) != 0 { + v111 := uint64(uint64(r.Uint32())) + this.MemSoftLimitBytes = &v111 } - if m.Network != nil { - data[i] = 0x10 - i++ - i = encodeVarintMesos(data, i, uint64(*m.Network)) + if r.Intn(10) != 0 { + v112 := uint64(uint64(r.Uint32())) + this.MemCacheBytes = &v112 } - if len(m.PortMappings) > 0 { - for _, msg := range m.PortMappings { - data[i] = 0x1a - i++ - i = encodeVarintMesos(data, i, uint64(msg.Size())) - n, err := msg.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n - } + if r.Intn(10) != 0 { + v113 := uint64(uint64(r.Uint32())) + this.MemSwapBytes = &v113 } - if m.Privileged != nil { - data[i] = 0x20 - i++ - if *m.Privileged { - data[i] = 1 - } else { - data[i] = 0 - } - i++ + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 41) } - if len(m.Parameters) > 0 { - for _, msg := range m.Parameters { - data[i] = 0x2a - i++ - i = encodeVarintMesos(data, i, uint64(msg.Size())) - n, err := msg.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n + return this +} + +func NewPopulatedResourceUsage(r randyMesos, easy bool) *ResourceUsage { + this := &ResourceUsage{} + if r.Intn(10) != 0 { + v114 := r.Intn(10) + this.Executors = make([]*ResourceUsage_Executor, v114) + for i := 0; i < v114; i++ { + this.Executors[i] = NewPopulatedResourceUsage_Executor(r, easy) } } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 2) } - return i, nil + return this } -func (m *ContainerInfo_DockerInfo_PortMapping) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err +func NewPopulatedResourceUsage_Executor(r randyMesos, easy bool) *ResourceUsage_Executor { + this := &ResourceUsage_Executor{} + this.ExecutorInfo = NewPopulatedExecutorInfo(r, easy) + if r.Intn(10) != 0 { + v115 := r.Intn(10) + this.Allocated = make([]*Resource, v115) + for i := 0; i < v115; i++ { + this.Allocated[i] = NewPopulatedResource(r, easy) + } } - return data[:n], nil + if r.Intn(10) != 0 { + this.Statistics = NewPopulatedResourceStatistics(r, easy) + } + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 4) + } + return this } -func (m *ContainerInfo_DockerInfo_PortMapping) MarshalTo(data []byte) (n int, err error) { - var i int - _ = i - var l int - _ = l - if m.HostPort != nil { - data[i] = 0x8 - i++ - i = encodeVarintMesos(data, i, uint64(*m.HostPort)) +func NewPopulatedPerfStatistics(r randyMesos, easy bool) *PerfStatistics { + this := &PerfStatistics{} + v116 := float64(r.Float64()) + if r.Intn(2) == 0 { + v116 *= -1 } - if m.ContainerPort != nil { - data[i] = 0x10 - i++ - i = encodeVarintMesos(data, i, uint64(*m.ContainerPort)) + this.Timestamp = &v116 + v117 := float64(r.Float64()) + if r.Intn(2) == 0 { + v117 *= -1 } - if m.Protocol != nil { - data[i] = 0x1a - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Protocol))) - i += copy(data[i:], *m.Protocol) + this.Duration = &v117 + if r.Intn(10) != 0 { + v118 := uint64(uint64(r.Uint32())) + this.Cycles = &v118 } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) + if r.Intn(10) != 0 { + v119 := uint64(uint64(r.Uint32())) + this.StalledCyclesFrontend = &v119 } - return i, nil -} - -func encodeFixed64Mesos(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 encodeFixed32Mesos(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 encodeVarintMesos(data []byte, offset int, v uint64) int { - for v >= 1<<7 { - data[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ + if r.Intn(10) != 0 { + v120 := uint64(uint64(r.Uint32())) + this.StalledCyclesBackend = &v120 } - data[offset] = uint8(v) - return offset + 1 -} -func (this *FrameworkID) GoString() string { - if this == nil { - return "nil" + if r.Intn(10) != 0 { + v121 := uint64(uint64(r.Uint32())) + this.Instructions = &v121 } - s := strings1.Join([]string{`&mesosproto.FrameworkID{` + - `Value:` + valueToGoStringMesos(this.Value, "string"), - `XXX_unrecognized:` + fmt2.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s -} -func (this *OfferID) GoString() string { - if this == nil { - return "nil" + if r.Intn(10) != 0 { + v122 := uint64(uint64(r.Uint32())) + this.CacheReferences = &v122 } - s := strings1.Join([]string{`&mesosproto.OfferID{` + - `Value:` + valueToGoStringMesos(this.Value, "string"), - `XXX_unrecognized:` + fmt2.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s -} -func (this *SlaveID) GoString() string { - if this == nil { - return "nil" + if r.Intn(10) != 0 { + v123 := uint64(uint64(r.Uint32())) + this.CacheMisses = &v123 } - s := strings1.Join([]string{`&mesosproto.SlaveID{` + - `Value:` + valueToGoStringMesos(this.Value, "string"), - `XXX_unrecognized:` + fmt2.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s -} -func (this *TaskID) GoString() string { - if this == nil { - return "nil" + if r.Intn(10) != 0 { + v124 := uint64(uint64(r.Uint32())) + this.Branches = &v124 } - s := strings1.Join([]string{`&mesosproto.TaskID{` + - `Value:` + valueToGoStringMesos(this.Value, "string"), - `XXX_unrecognized:` + fmt2.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s -} -func (this *ExecutorID) GoString() string { - if this == nil { - return "nil" + if r.Intn(10) != 0 { + v125 := uint64(uint64(r.Uint32())) + this.BranchMisses = &v125 } - s := strings1.Join([]string{`&mesosproto.ExecutorID{` + - `Value:` + valueToGoStringMesos(this.Value, "string"), - `XXX_unrecognized:` + fmt2.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s -} -func (this *ContainerID) GoString() string { - if this == nil { - return "nil" + if r.Intn(10) != 0 { + v126 := uint64(uint64(r.Uint32())) + this.BusCycles = &v126 } - s := strings1.Join([]string{`&mesosproto.ContainerID{` + - `Value:` + valueToGoStringMesos(this.Value, "string"), - `XXX_unrecognized:` + fmt2.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s -} -func (this *FrameworkInfo) GoString() string { - if this == nil { - return "nil" + if r.Intn(10) != 0 { + v127 := uint64(uint64(r.Uint32())) + this.RefCycles = &v127 } - s := strings1.Join([]string{`&mesosproto.FrameworkInfo{` + - `User:` + valueToGoStringMesos(this.User, "string"), - `Name:` + valueToGoStringMesos(this.Name, "string"), - `Id:` + fmt2.Sprintf("%#v", this.Id), - `FailoverTimeout:` + valueToGoStringMesos(this.FailoverTimeout, "float64"), - `Checkpoint:` + valueToGoStringMesos(this.Checkpoint, "bool"), - `Role:` + valueToGoStringMesos(this.Role, "string"), - `Hostname:` + valueToGoStringMesos(this.Hostname, "string"), - `Principal:` + valueToGoStringMesos(this.Principal, "string"), - `WebuiUrl:` + valueToGoStringMesos(this.WebuiUrl, "string"), - `XXX_unrecognized:` + fmt2.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s -} -func (this *HealthCheck) GoString() string { - if this == nil { - return "nil" + if r.Intn(10) != 0 { + v128 := float64(r.Float64()) + if r.Intn(2) == 0 { + v128 *= -1 + } + this.CpuClock = &v128 } - s := strings1.Join([]string{`&mesosproto.HealthCheck{` + - `Http:` + fmt2.Sprintf("%#v", this.Http), - `DelaySeconds:` + valueToGoStringMesos(this.DelaySeconds, "float64"), - `IntervalSeconds:` + valueToGoStringMesos(this.IntervalSeconds, "float64"), - `TimeoutSeconds:` + valueToGoStringMesos(this.TimeoutSeconds, "float64"), - `ConsecutiveFailures:` + valueToGoStringMesos(this.ConsecutiveFailures, "uint32"), - `GracePeriodSeconds:` + valueToGoStringMesos(this.GracePeriodSeconds, "float64"), - `Command:` + fmt2.Sprintf("%#v", this.Command), - `XXX_unrecognized:` + fmt2.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s -} -func (this *HealthCheck_HTTP) GoString() string { - if this == nil { - return "nil" + if r.Intn(10) != 0 { + v129 := float64(r.Float64()) + if r.Intn(2) == 0 { + v129 *= -1 + } + this.TaskClock = &v129 } - s := strings1.Join([]string{`&mesosproto.HealthCheck_HTTP{` + - `Port:` + valueToGoStringMesos(this.Port, "uint32"), - `Path:` + valueToGoStringMesos(this.Path, "string"), - `Statuses:` + fmt2.Sprintf("%#v", this.Statuses), - `XXX_unrecognized:` + fmt2.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s -} -func (this *CommandInfo) GoString() string { - if this == nil { - return "nil" + if r.Intn(10) != 0 { + v130 := uint64(uint64(r.Uint32())) + this.PageFaults = &v130 } - s := strings1.Join([]string{`&mesosproto.CommandInfo{` + - `Container:` + fmt2.Sprintf("%#v", this.Container), - `Uris:` + fmt2.Sprintf("%#v", this.Uris), - `Environment:` + fmt2.Sprintf("%#v", this.Environment), - `Shell:` + valueToGoStringMesos(this.Shell, "bool"), - `Value:` + valueToGoStringMesos(this.Value, "string"), - `Arguments:` + fmt2.Sprintf("%#v", this.Arguments), - `User:` + valueToGoStringMesos(this.User, "string"), - `XXX_unrecognized:` + fmt2.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s -} -func (this *CommandInfo_URI) GoString() string { - if this == nil { - return "nil" + if r.Intn(10) != 0 { + v131 := uint64(uint64(r.Uint32())) + this.MinorFaults = &v131 } - s := strings1.Join([]string{`&mesosproto.CommandInfo_URI{` + - `Value:` + valueToGoStringMesos(this.Value, "string"), - `Executable:` + valueToGoStringMesos(this.Executable, "bool"), - `Extract:` + valueToGoStringMesos(this.Extract, "bool"), - `XXX_unrecognized:` + fmt2.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s -} -func (this *CommandInfo_ContainerInfo) GoString() string { - if this == nil { - return "nil" + if r.Intn(10) != 0 { + v132 := uint64(uint64(r.Uint32())) + this.MajorFaults = &v132 + } + if r.Intn(10) != 0 { + v133 := uint64(uint64(r.Uint32())) + this.ContextSwitches = &v133 + } + if r.Intn(10) != 0 { + v134 := uint64(uint64(r.Uint32())) + this.CpuMigrations = &v134 + } + if r.Intn(10) != 0 { + v135 := uint64(uint64(r.Uint32())) + this.AlignmentFaults = &v135 + } + if r.Intn(10) != 0 { + v136 := uint64(uint64(r.Uint32())) + this.EmulationFaults = &v136 + } + if r.Intn(10) != 0 { + v137 := uint64(uint64(r.Uint32())) + this.L1DcacheLoads = &v137 + } + if r.Intn(10) != 0 { + v138 := uint64(uint64(r.Uint32())) + this.L1DcacheLoadMisses = &v138 + } + if r.Intn(10) != 0 { + v139 := uint64(uint64(r.Uint32())) + this.L1DcacheStores = &v139 + } + if r.Intn(10) != 0 { + v140 := uint64(uint64(r.Uint32())) + this.L1DcacheStoreMisses = &v140 + } + if r.Intn(10) != 0 { + v141 := uint64(uint64(r.Uint32())) + this.L1DcachePrefetches = &v141 } - s := strings1.Join([]string{`&mesosproto.CommandInfo_ContainerInfo{` + - `Image:` + valueToGoStringMesos(this.Image, "string"), - `Options:` + fmt2.Sprintf("%#v", this.Options), - `XXX_unrecognized:` + fmt2.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s -} -func (this *ExecutorInfo) GoString() string { - if this == nil { - return "nil" + if r.Intn(10) != 0 { + v142 := uint64(uint64(r.Uint32())) + this.L1DcachePrefetchMisses = &v142 } - s := strings1.Join([]string{`&mesosproto.ExecutorInfo{` + - `ExecutorId:` + fmt2.Sprintf("%#v", this.ExecutorId), - `FrameworkId:` + fmt2.Sprintf("%#v", this.FrameworkId), - `Command:` + fmt2.Sprintf("%#v", this.Command), - `Container:` + fmt2.Sprintf("%#v", this.Container), - `Resources:` + fmt2.Sprintf("%#v", this.Resources), - `Name:` + valueToGoStringMesos(this.Name, "string"), - `Source:` + valueToGoStringMesos(this.Source, "string"), - `Data:` + valueToGoStringMesos(this.Data, "byte"), - `XXX_unrecognized:` + fmt2.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s -} -func (this *MasterInfo) GoString() string { - if this == nil { - return "nil" + if r.Intn(10) != 0 { + v143 := uint64(uint64(r.Uint32())) + this.L1IcacheLoads = &v143 } - s := strings1.Join([]string{`&mesosproto.MasterInfo{` + - `Id:` + valueToGoStringMesos(this.Id, "string"), - `Ip:` + valueToGoStringMesos(this.Ip, "uint32"), - `Port:` + valueToGoStringMesos(this.Port, "uint32"), - `Pid:` + valueToGoStringMesos(this.Pid, "string"), - `Hostname:` + valueToGoStringMesos(this.Hostname, "string"), - `XXX_unrecognized:` + fmt2.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s -} -func (this *SlaveInfo) GoString() string { - if this == nil { - return "nil" + if r.Intn(10) != 0 { + v144 := uint64(uint64(r.Uint32())) + this.L1IcacheLoadMisses = &v144 } - s := strings1.Join([]string{`&mesosproto.SlaveInfo{` + - `Hostname:` + valueToGoStringMesos(this.Hostname, "string"), - `Port:` + valueToGoStringMesos(this.Port, "int32"), - `Resources:` + fmt2.Sprintf("%#v", this.Resources), - `Attributes:` + fmt2.Sprintf("%#v", this.Attributes), - `Id:` + fmt2.Sprintf("%#v", this.Id), - `Checkpoint:` + valueToGoStringMesos(this.Checkpoint, "bool"), - `XXX_unrecognized:` + fmt2.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s -} -func (this *Value) GoString() string { - if this == nil { - return "nil" + if r.Intn(10) != 0 { + v145 := uint64(uint64(r.Uint32())) + this.L1IcachePrefetches = &v145 } - s := strings1.Join([]string{`&mesosproto.Value{` + - `Type:` + valueToGoStringMesos(this.Type, "mesosproto.Value_Type"), - `Scalar:` + fmt2.Sprintf("%#v", this.Scalar), - `Ranges:` + fmt2.Sprintf("%#v", this.Ranges), - `Set:` + fmt2.Sprintf("%#v", this.Set), - `Text:` + fmt2.Sprintf("%#v", this.Text), - `XXX_unrecognized:` + fmt2.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s -} -func (this *Value_Scalar) GoString() string { - if this == nil { - return "nil" + if r.Intn(10) != 0 { + v146 := uint64(uint64(r.Uint32())) + this.L1IcachePrefetchMisses = &v146 } - s := strings1.Join([]string{`&mesosproto.Value_Scalar{` + - `Value:` + valueToGoStringMesos(this.Value, "float64"), - `XXX_unrecognized:` + fmt2.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s -} -func (this *Value_Range) GoString() string { - if this == nil { - return "nil" + if r.Intn(10) != 0 { + v147 := uint64(uint64(r.Uint32())) + this.LlcLoads = &v147 } - s := strings1.Join([]string{`&mesosproto.Value_Range{` + - `Begin:` + valueToGoStringMesos(this.Begin, "uint64"), - `End:` + valueToGoStringMesos(this.End, "uint64"), - `XXX_unrecognized:` + fmt2.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s -} -func (this *Value_Ranges) GoString() string { - if this == nil { - return "nil" + if r.Intn(10) != 0 { + v148 := uint64(uint64(r.Uint32())) + this.LlcLoadMisses = &v148 } - s := strings1.Join([]string{`&mesosproto.Value_Ranges{` + - `Range:` + fmt2.Sprintf("%#v", this.Range), - `XXX_unrecognized:` + fmt2.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s -} -func (this *Value_Set) GoString() string { - if this == nil { - return "nil" + if r.Intn(10) != 0 { + v149 := uint64(uint64(r.Uint32())) + this.LlcStores = &v149 } - s := strings1.Join([]string{`&mesosproto.Value_Set{` + - `Item:` + fmt2.Sprintf("%#v", this.Item), - `XXX_unrecognized:` + fmt2.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s -} -func (this *Value_Text) GoString() string { - if this == nil { - return "nil" + if r.Intn(10) != 0 { + v150 := uint64(uint64(r.Uint32())) + this.LlcStoreMisses = &v150 } - s := strings1.Join([]string{`&mesosproto.Value_Text{` + - `Value:` + valueToGoStringMesos(this.Value, "string"), - `XXX_unrecognized:` + fmt2.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s -} -func (this *Attribute) GoString() string { - if this == nil { - return "nil" + if r.Intn(10) != 0 { + v151 := uint64(uint64(r.Uint32())) + this.LlcPrefetches = &v151 } - s := strings1.Join([]string{`&mesosproto.Attribute{` + - `Name:` + valueToGoStringMesos(this.Name, "string"), - `Type:` + valueToGoStringMesos(this.Type, "mesosproto.Value_Type"), - `Scalar:` + fmt2.Sprintf("%#v", this.Scalar), - `Ranges:` + fmt2.Sprintf("%#v", this.Ranges), - `Set:` + fmt2.Sprintf("%#v", this.Set), - `Text:` + fmt2.Sprintf("%#v", this.Text), - `XXX_unrecognized:` + fmt2.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s -} -func (this *Resource) GoString() string { - if this == nil { - return "nil" + if r.Intn(10) != 0 { + v152 := uint64(uint64(r.Uint32())) + this.LlcPrefetchMisses = &v152 } - s := strings1.Join([]string{`&mesosproto.Resource{` + - `Name:` + valueToGoStringMesos(this.Name, "string"), - `Type:` + valueToGoStringMesos(this.Type, "mesosproto.Value_Type"), - `Scalar:` + fmt2.Sprintf("%#v", this.Scalar), - `Ranges:` + fmt2.Sprintf("%#v", this.Ranges), - `Set:` + fmt2.Sprintf("%#v", this.Set), - `Role:` + valueToGoStringMesos(this.Role, "string"), - `XXX_unrecognized:` + fmt2.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s -} -func (this *ResourceStatistics) GoString() string { - if this == nil { - return "nil" + if r.Intn(10) != 0 { + v153 := uint64(uint64(r.Uint32())) + this.DtlbLoads = &v153 } - s := strings1.Join([]string{`&mesosproto.ResourceStatistics{` + - `Timestamp:` + valueToGoStringMesos(this.Timestamp, "float64"), - `CpusUserTimeSecs:` + valueToGoStringMesos(this.CpusUserTimeSecs, "float64"), - `CpusSystemTimeSecs:` + valueToGoStringMesos(this.CpusSystemTimeSecs, "float64"), - `CpusLimit:` + valueToGoStringMesos(this.CpusLimit, "float64"), - `CpusNrPeriods:` + valueToGoStringMesos(this.CpusNrPeriods, "uint32"), - `CpusNrThrottled:` + valueToGoStringMesos(this.CpusNrThrottled, "uint32"), - `CpusThrottledTimeSecs:` + valueToGoStringMesos(this.CpusThrottledTimeSecs, "float64"), - `MemRssBytes:` + valueToGoStringMesos(this.MemRssBytes, "uint64"), - `MemLimitBytes:` + valueToGoStringMesos(this.MemLimitBytes, "uint64"), - `MemFileBytes:` + valueToGoStringMesos(this.MemFileBytes, "uint64"), - `MemAnonBytes:` + valueToGoStringMesos(this.MemAnonBytes, "uint64"), - `MemMappedFileBytes:` + valueToGoStringMesos(this.MemMappedFileBytes, "uint64"), - `Perf:` + fmt2.Sprintf("%#v", this.Perf), - `NetRxPackets:` + valueToGoStringMesos(this.NetRxPackets, "uint64"), - `NetRxBytes:` + valueToGoStringMesos(this.NetRxBytes, "uint64"), - `NetRxErrors:` + valueToGoStringMesos(this.NetRxErrors, "uint64"), - `NetRxDropped:` + valueToGoStringMesos(this.NetRxDropped, "uint64"), - `NetTxPackets:` + valueToGoStringMesos(this.NetTxPackets, "uint64"), - `NetTxBytes:` + valueToGoStringMesos(this.NetTxBytes, "uint64"), - `NetTxErrors:` + valueToGoStringMesos(this.NetTxErrors, "uint64"), - `NetTxDropped:` + valueToGoStringMesos(this.NetTxDropped, "uint64"), - `NetTcpRttMicrosecsP50:` + valueToGoStringMesos(this.NetTcpRttMicrosecsP50, "float64"), - `NetTcpRttMicrosecsP90:` + valueToGoStringMesos(this.NetTcpRttMicrosecsP90, "float64"), - `NetTcpRttMicrosecsP95:` + valueToGoStringMesos(this.NetTcpRttMicrosecsP95, "float64"), - `NetTcpRttMicrosecsP99:` + valueToGoStringMesos(this.NetTcpRttMicrosecsP99, "float64"), - `XXX_unrecognized:` + fmt2.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s -} -func (this *ResourceUsage) GoString() string { - if this == nil { - return "nil" + if r.Intn(10) != 0 { + v154 := uint64(uint64(r.Uint32())) + this.DtlbLoadMisses = &v154 } - s := strings1.Join([]string{`&mesosproto.ResourceUsage{` + - `SlaveId:` + fmt2.Sprintf("%#v", this.SlaveId), - `FrameworkId:` + fmt2.Sprintf("%#v", this.FrameworkId), - `ExecutorId:` + fmt2.Sprintf("%#v", this.ExecutorId), - `ExecutorName:` + valueToGoStringMesos(this.ExecutorName, "string"), - `TaskId:` + fmt2.Sprintf("%#v", this.TaskId), - `Statistics:` + fmt2.Sprintf("%#v", this.Statistics), - `XXX_unrecognized:` + fmt2.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s -} -func (this *PerfStatistics) GoString() string { - if this == nil { - return "nil" + if r.Intn(10) != 0 { + v155 := uint64(uint64(r.Uint32())) + this.DtlbStores = &v155 } - s := strings1.Join([]string{`&mesosproto.PerfStatistics{` + - `Timestamp:` + valueToGoStringMesos(this.Timestamp, "float64"), - `Duration:` + valueToGoStringMesos(this.Duration, "float64"), - `Cycles:` + valueToGoStringMesos(this.Cycles, "uint64"), - `StalledCyclesFrontend:` + valueToGoStringMesos(this.StalledCyclesFrontend, "uint64"), - `StalledCyclesBackend:` + valueToGoStringMesos(this.StalledCyclesBackend, "uint64"), - `Instructions:` + valueToGoStringMesos(this.Instructions, "uint64"), - `CacheReferences:` + valueToGoStringMesos(this.CacheReferences, "uint64"), - `CacheMisses:` + valueToGoStringMesos(this.CacheMisses, "uint64"), - `Branches:` + valueToGoStringMesos(this.Branches, "uint64"), - `BranchMisses:` + valueToGoStringMesos(this.BranchMisses, "uint64"), - `BusCycles:` + valueToGoStringMesos(this.BusCycles, "uint64"), - `RefCycles:` + valueToGoStringMesos(this.RefCycles, "uint64"), - `CpuClock:` + valueToGoStringMesos(this.CpuClock, "float64"), - `TaskClock:` + valueToGoStringMesos(this.TaskClock, "float64"), - `PageFaults:` + valueToGoStringMesos(this.PageFaults, "uint64"), - `MinorFaults:` + valueToGoStringMesos(this.MinorFaults, "uint64"), - `MajorFaults:` + valueToGoStringMesos(this.MajorFaults, "uint64"), - `ContextSwitches:` + valueToGoStringMesos(this.ContextSwitches, "uint64"), - `CpuMigrations:` + valueToGoStringMesos(this.CpuMigrations, "uint64"), - `AlignmentFaults:` + valueToGoStringMesos(this.AlignmentFaults, "uint64"), - `EmulationFaults:` + valueToGoStringMesos(this.EmulationFaults, "uint64"), - `L1DcacheLoads:` + valueToGoStringMesos(this.L1DcacheLoads, "uint64"), - `L1DcacheLoadMisses:` + valueToGoStringMesos(this.L1DcacheLoadMisses, "uint64"), - `L1DcacheStores:` + valueToGoStringMesos(this.L1DcacheStores, "uint64"), - `L1DcacheStoreMisses:` + valueToGoStringMesos(this.L1DcacheStoreMisses, "uint64"), - `L1DcachePrefetches:` + valueToGoStringMesos(this.L1DcachePrefetches, "uint64"), - `L1DcachePrefetchMisses:` + valueToGoStringMesos(this.L1DcachePrefetchMisses, "uint64"), - `L1IcacheLoads:` + valueToGoStringMesos(this.L1IcacheLoads, "uint64"), - `L1IcacheLoadMisses:` + valueToGoStringMesos(this.L1IcacheLoadMisses, "uint64"), - `L1IcachePrefetches:` + valueToGoStringMesos(this.L1IcachePrefetches, "uint64"), - `L1IcachePrefetchMisses:` + valueToGoStringMesos(this.L1IcachePrefetchMisses, "uint64"), - `LlcLoads:` + valueToGoStringMesos(this.LlcLoads, "uint64"), - `LlcLoadMisses:` + valueToGoStringMesos(this.LlcLoadMisses, "uint64"), - `LlcStores:` + valueToGoStringMesos(this.LlcStores, "uint64"), - `LlcStoreMisses:` + valueToGoStringMesos(this.LlcStoreMisses, "uint64"), - `LlcPrefetches:` + valueToGoStringMesos(this.LlcPrefetches, "uint64"), - `LlcPrefetchMisses:` + valueToGoStringMesos(this.LlcPrefetchMisses, "uint64"), - `DtlbLoads:` + valueToGoStringMesos(this.DtlbLoads, "uint64"), - `DtlbLoadMisses:` + valueToGoStringMesos(this.DtlbLoadMisses, "uint64"), - `DtlbStores:` + valueToGoStringMesos(this.DtlbStores, "uint64"), - `DtlbStoreMisses:` + valueToGoStringMesos(this.DtlbStoreMisses, "uint64"), - `DtlbPrefetches:` + valueToGoStringMesos(this.DtlbPrefetches, "uint64"), - `DtlbPrefetchMisses:` + valueToGoStringMesos(this.DtlbPrefetchMisses, "uint64"), - `ItlbLoads:` + valueToGoStringMesos(this.ItlbLoads, "uint64"), - `ItlbLoadMisses:` + valueToGoStringMesos(this.ItlbLoadMisses, "uint64"), - `BranchLoads:` + valueToGoStringMesos(this.BranchLoads, "uint64"), - `BranchLoadMisses:` + valueToGoStringMesos(this.BranchLoadMisses, "uint64"), - `NodeLoads:` + valueToGoStringMesos(this.NodeLoads, "uint64"), - `NodeLoadMisses:` + valueToGoStringMesos(this.NodeLoadMisses, "uint64"), - `NodeStores:` + valueToGoStringMesos(this.NodeStores, "uint64"), - `NodeStoreMisses:` + valueToGoStringMesos(this.NodeStoreMisses, "uint64"), - `NodePrefetches:` + valueToGoStringMesos(this.NodePrefetches, "uint64"), - `NodePrefetchMisses:` + valueToGoStringMesos(this.NodePrefetchMisses, "uint64"), - `XXX_unrecognized:` + fmt2.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s -} -func (this *Request) GoString() string { - if this == nil { - return "nil" + if r.Intn(10) != 0 { + v156 := uint64(uint64(r.Uint32())) + this.DtlbStoreMisses = &v156 } - s := strings1.Join([]string{`&mesosproto.Request{` + - `SlaveId:` + fmt2.Sprintf("%#v", this.SlaveId), - `Resources:` + fmt2.Sprintf("%#v", this.Resources), - `XXX_unrecognized:` + fmt2.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s -} -func (this *Offer) GoString() string { - if this == nil { - return "nil" + if r.Intn(10) != 0 { + v157 := uint64(uint64(r.Uint32())) + this.DtlbPrefetches = &v157 } - s := strings1.Join([]string{`&mesosproto.Offer{` + - `Id:` + fmt2.Sprintf("%#v", this.Id), - `FrameworkId:` + fmt2.Sprintf("%#v", this.FrameworkId), - `SlaveId:` + fmt2.Sprintf("%#v", this.SlaveId), - `Hostname:` + valueToGoStringMesos(this.Hostname, "string"), - `Resources:` + fmt2.Sprintf("%#v", this.Resources), - `Attributes:` + fmt2.Sprintf("%#v", this.Attributes), - `ExecutorIds:` + fmt2.Sprintf("%#v", this.ExecutorIds), - `XXX_unrecognized:` + fmt2.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s -} -func (this *TaskInfo) GoString() string { - if this == nil { - return "nil" + if r.Intn(10) != 0 { + v158 := uint64(uint64(r.Uint32())) + this.DtlbPrefetchMisses = &v158 } - s := strings1.Join([]string{`&mesosproto.TaskInfo{` + - `Name:` + valueToGoStringMesos(this.Name, "string"), - `TaskId:` + fmt2.Sprintf("%#v", this.TaskId), - `SlaveId:` + fmt2.Sprintf("%#v", this.SlaveId), - `Resources:` + fmt2.Sprintf("%#v", this.Resources), - `Executor:` + fmt2.Sprintf("%#v", this.Executor), - `Command:` + fmt2.Sprintf("%#v", this.Command), - `Container:` + fmt2.Sprintf("%#v", this.Container), - `Data:` + valueToGoStringMesos(this.Data, "byte"), - `HealthCheck:` + fmt2.Sprintf("%#v", this.HealthCheck), - `XXX_unrecognized:` + fmt2.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s -} -func (this *TaskStatus) GoString() string { - if this == nil { - return "nil" + if r.Intn(10) != 0 { + v159 := uint64(uint64(r.Uint32())) + this.ItlbLoads = &v159 } - s := strings1.Join([]string{`&mesosproto.TaskStatus{` + - `TaskId:` + fmt2.Sprintf("%#v", this.TaskId), - `State:` + valueToGoStringMesos(this.State, "mesosproto.TaskState"), - `Message:` + valueToGoStringMesos(this.Message, "string"), - `Source:` + valueToGoStringMesos(this.Source, "mesosproto.TaskStatus_Source"), - `Reason:` + valueToGoStringMesos(this.Reason, "mesosproto.TaskStatus_Reason"), - `Data:` + valueToGoStringMesos(this.Data, "byte"), - `SlaveId:` + fmt2.Sprintf("%#v", this.SlaveId), - `ExecutorId:` + fmt2.Sprintf("%#v", this.ExecutorId), - `Timestamp:` + valueToGoStringMesos(this.Timestamp, "float64"), - `Healthy:` + valueToGoStringMesos(this.Healthy, "bool"), - `XXX_unrecognized:` + fmt2.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s -} -func (this *Filters) GoString() string { - if this == nil { - return "nil" + if r.Intn(10) != 0 { + v160 := uint64(uint64(r.Uint32())) + this.ItlbLoadMisses = &v160 } - s := strings1.Join([]string{`&mesosproto.Filters{` + - `RefuseSeconds:` + valueToGoStringMesos(this.RefuseSeconds, "float64"), - `XXX_unrecognized:` + fmt2.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s -} -func (this *Environment) GoString() string { - if this == nil { - return "nil" + if r.Intn(10) != 0 { + v161 := uint64(uint64(r.Uint32())) + this.BranchLoads = &v161 } - s := strings1.Join([]string{`&mesosproto.Environment{` + - `Variables:` + fmt2.Sprintf("%#v", this.Variables), - `XXX_unrecognized:` + fmt2.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s -} -func (this *Environment_Variable) GoString() string { - if this == nil { - return "nil" + if r.Intn(10) != 0 { + v162 := uint64(uint64(r.Uint32())) + this.BranchLoadMisses = &v162 } - s := strings1.Join([]string{`&mesosproto.Environment_Variable{` + - `Name:` + valueToGoStringMesos(this.Name, "string"), - `Value:` + valueToGoStringMesos(this.Value, "string"), - `XXX_unrecognized:` + fmt2.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s -} -func (this *Parameter) GoString() string { - if this == nil { - return "nil" + if r.Intn(10) != 0 { + v163 := uint64(uint64(r.Uint32())) + this.NodeLoads = &v163 } - s := strings1.Join([]string{`&mesosproto.Parameter{` + - `Key:` + valueToGoStringMesos(this.Key, "string"), - `Value:` + valueToGoStringMesos(this.Value, "string"), - `XXX_unrecognized:` + fmt2.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s -} -func (this *Parameters) GoString() string { - if this == nil { - return "nil" + if r.Intn(10) != 0 { + v164 := uint64(uint64(r.Uint32())) + this.NodeLoadMisses = &v164 } - s := strings1.Join([]string{`&mesosproto.Parameters{` + - `Parameter:` + fmt2.Sprintf("%#v", this.Parameter), - `XXX_unrecognized:` + fmt2.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s -} -func (this *Credential) GoString() string { - if this == nil { - return "nil" + if r.Intn(10) != 0 { + v165 := uint64(uint64(r.Uint32())) + this.NodeStores = &v165 } - s := strings1.Join([]string{`&mesosproto.Credential{` + - `Principal:` + valueToGoStringMesos(this.Principal, "string"), - `Secret:` + valueToGoStringMesos(this.Secret, "byte"), - `XXX_unrecognized:` + fmt2.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s -} -func (this *Credentials) GoString() string { - if this == nil { - return "nil" + if r.Intn(10) != 0 { + v166 := uint64(uint64(r.Uint32())) + this.NodeStoreMisses = &v166 } - s := strings1.Join([]string{`&mesosproto.Credentials{` + - `Credentials:` + fmt2.Sprintf("%#v", this.Credentials), - `XXX_unrecognized:` + fmt2.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s -} -func (this *ACL) GoString() string { - if this == nil { - return "nil" + if r.Intn(10) != 0 { + v167 := uint64(uint64(r.Uint32())) + this.NodePrefetches = &v167 } - s := strings1.Join([]string{`&mesosproto.ACL{` + - `XXX_unrecognized:` + fmt2.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s -} -func (this *ACL_Entity) GoString() string { - if this == nil { - return "nil" + if r.Intn(10) != 0 { + v168 := uint64(uint64(r.Uint32())) + this.NodePrefetchMisses = &v168 } - s := strings1.Join([]string{`&mesosproto.ACL_Entity{` + - `Type:` + valueToGoStringMesos(this.Type, "mesosproto.ACL_Entity_Type"), - `Values:` + fmt2.Sprintf("%#v", this.Values), - `XXX_unrecognized:` + fmt2.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s -} -func (this *ACL_RegisterFramework) GoString() string { - if this == nil { - return "nil" + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 54) } - s := strings1.Join([]string{`&mesosproto.ACL_RegisterFramework{` + - `Principals:` + fmt2.Sprintf("%#v", this.Principals), - `Roles:` + fmt2.Sprintf("%#v", this.Roles), - `XXX_unrecognized:` + fmt2.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s + return this } -func (this *ACL_RunTask) GoString() string { - if this == nil { - return "nil" + +func NewPopulatedRequest(r randyMesos, easy bool) *Request { + this := &Request{} + if r.Intn(10) != 0 { + this.SlaveId = NewPopulatedSlaveID(r, easy) } - s := strings1.Join([]string{`&mesosproto.ACL_RunTask{` + - `Principals:` + fmt2.Sprintf("%#v", this.Principals), - `Users:` + fmt2.Sprintf("%#v", this.Users), - `XXX_unrecognized:` + fmt2.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s -} -func (this *ACL_ShutdownFramework) GoString() string { - if this == nil { - return "nil" + if r.Intn(10) != 0 { + v169 := r.Intn(10) + this.Resources = make([]*Resource, v169) + for i := 0; i < v169; i++ { + this.Resources[i] = NewPopulatedResource(r, easy) + } } - s := strings1.Join([]string{`&mesosproto.ACL_ShutdownFramework{` + - `Principals:` + fmt2.Sprintf("%#v", this.Principals), - `FrameworkPrincipals:` + fmt2.Sprintf("%#v", this.FrameworkPrincipals), - `XXX_unrecognized:` + fmt2.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s -} -func (this *ACLs) GoString() string { - if this == nil { - return "nil" + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 3) } - s := strings1.Join([]string{`&mesosproto.ACLs{` + - `Permissive:` + valueToGoStringMesos(this.Permissive, "bool"), - `RegisterFrameworks:` + fmt2.Sprintf("%#v", this.RegisterFrameworks), - `RunTasks:` + fmt2.Sprintf("%#v", this.RunTasks), - `ShutdownFrameworks:` + fmt2.Sprintf("%#v", this.ShutdownFrameworks), - `XXX_unrecognized:` + fmt2.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s + return this } -func (this *RateLimit) GoString() string { - if this == nil { - return "nil" + +func NewPopulatedOffer(r randyMesos, easy bool) *Offer { + this := &Offer{} + this.Id = NewPopulatedOfferID(r, easy) + this.FrameworkId = NewPopulatedFrameworkID(r, easy) + this.SlaveId = NewPopulatedSlaveID(r, easy) + v170 := randStringMesos(r) + this.Hostname = &v170 + if r.Intn(10) != 0 { + v171 := r.Intn(10) + this.Resources = make([]*Resource, v171) + for i := 0; i < v171; i++ { + this.Resources[i] = NewPopulatedResource(r, easy) + } } - s := strings1.Join([]string{`&mesosproto.RateLimit{` + - `Qps:` + valueToGoStringMesos(this.Qps, "float64"), - `Principal:` + valueToGoStringMesos(this.Principal, "string"), - `Capacity:` + valueToGoStringMesos(this.Capacity, "uint64"), - `XXX_unrecognized:` + fmt2.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s -} -func (this *RateLimits) GoString() string { - if this == nil { - return "nil" + if r.Intn(10) != 0 { + v172 := r.Intn(10) + this.ExecutorIds = make([]*ExecutorID, v172) + for i := 0; i < v172; i++ { + this.ExecutorIds[i] = NewPopulatedExecutorID(r, easy) + } } - s := strings1.Join([]string{`&mesosproto.RateLimits{` + - `Limits:` + fmt2.Sprintf("%#v", this.Limits), - `AggregateDefaultQps:` + valueToGoStringMesos(this.AggregateDefaultQps, "float64"), - `AggregateDefaultCapacity:` + valueToGoStringMesos(this.AggregateDefaultCapacity, "uint64"), - `XXX_unrecognized:` + fmt2.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s -} -func (this *Volume) GoString() string { - if this == nil { - return "nil" + if r.Intn(10) != 0 { + v173 := r.Intn(10) + this.Attributes = make([]*Attribute, v173) + for i := 0; i < v173; i++ { + this.Attributes[i] = NewPopulatedAttribute(r, easy) + } } - s := strings1.Join([]string{`&mesosproto.Volume{` + - `ContainerPath:` + valueToGoStringMesos(this.ContainerPath, "string"), - `HostPath:` + valueToGoStringMesos(this.HostPath, "string"), - `Mode:` + valueToGoStringMesos(this.Mode, "mesosproto.Volume_Mode"), - `XXX_unrecognized:` + fmt2.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s -} -func (this *ContainerInfo) GoString() string { - if this == nil { - return "nil" + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 8) } - s := strings1.Join([]string{`&mesosproto.ContainerInfo{` + - `Type:` + valueToGoStringMesos(this.Type, "mesosproto.ContainerInfo_Type"), - `Volumes:` + fmt2.Sprintf("%#v", this.Volumes), - `Hostname:` + valueToGoStringMesos(this.Hostname, "string"), - `Docker:` + fmt2.Sprintf("%#v", this.Docker), - `XXX_unrecognized:` + fmt2.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s + return this } -func (this *ContainerInfo_DockerInfo) GoString() string { - if this == nil { - return "nil" + +func NewPopulatedOffer_Operation(r randyMesos, easy bool) *Offer_Operation { + this := &Offer_Operation{} + v174 := Offer_Operation_Type([]int32{1, 2, 3, 4, 5}[r.Intn(5)]) + this.Type = &v174 + if r.Intn(10) != 0 { + this.Launch = NewPopulatedOffer_Operation_Launch(r, easy) } - s := strings1.Join([]string{`&mesosproto.ContainerInfo_DockerInfo{` + - `Image:` + valueToGoStringMesos(this.Image, "string"), - `Network:` + valueToGoStringMesos(this.Network, "mesosproto.ContainerInfo_DockerInfo_Network"), - `PortMappings:` + fmt2.Sprintf("%#v", this.PortMappings), - `Privileged:` + valueToGoStringMesos(this.Privileged, "bool"), - `Parameters:` + fmt2.Sprintf("%#v", this.Parameters), - `XXX_unrecognized:` + fmt2.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s -} -func (this *ContainerInfo_DockerInfo_PortMapping) GoString() string { - if this == nil { - return "nil" + if r.Intn(10) != 0 { + this.Reserve = NewPopulatedOffer_Operation_Reserve(r, easy) } - s := strings1.Join([]string{`&mesosproto.ContainerInfo_DockerInfo_PortMapping{` + - `HostPort:` + valueToGoStringMesos(this.HostPort, "uint32"), - `ContainerPort:` + valueToGoStringMesos(this.ContainerPort, "uint32"), - `Protocol:` + valueToGoStringMesos(this.Protocol, "string"), - `XXX_unrecognized:` + fmt2.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s -} -func valueToGoStringMesos(v interface{}, typ string) string { - rv := reflect1.ValueOf(v) - if rv.IsNil() { - return "nil" + if r.Intn(10) != 0 { + this.Unreserve = NewPopulatedOffer_Operation_Unreserve(r, easy) } - pv := reflect1.Indirect(rv).Interface() - return fmt2.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) -} -func extensionToGoStringMesos(e map[int32]github_com_gogo_protobuf_proto1.Extension) string { - if e == nil { - return "nil" + if r.Intn(10) != 0 { + this.Create = NewPopulatedOffer_Operation_Create(r, easy) } - s := "map[int32]proto.Extension{" - keys := make([]int, 0, len(e)) - for k := range e { - keys = append(keys, int(k)) + if r.Intn(10) != 0 { + this.Destroy = NewPopulatedOffer_Operation_Destroy(r, easy) } - sort.Ints(keys) - ss := []string{} - for _, k := range keys { - ss = append(ss, strconv.Itoa(k)+": "+e[int32(k)].GoString()) + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 7) } - s += strings1.Join(ss, ",") + "}" - return s + return this } -func (this *FrameworkID) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that == nil && this != nil") - } - that1, ok := that.(*FrameworkID) - if !ok { - return fmt3.Errorf("that is not of type *FrameworkID") - } - if that1 == nil { - if this == nil { - return nil +func NewPopulatedOffer_Operation_Launch(r randyMesos, easy bool) *Offer_Operation_Launch { + this := &Offer_Operation_Launch{} + if r.Intn(10) != 0 { + v175 := r.Intn(10) + this.TaskInfos = make([]*TaskInfo, v175) + for i := 0; i < v175; i++ { + this.TaskInfos[i] = NewPopulatedTaskInfo(r, easy) } - return fmt3.Errorf("that is type *FrameworkID but is nil && this != nil") - } else if this == nil { - return fmt3.Errorf("that is type *FrameworkIDbut is not nil && this == nil") } - if this.Value != nil && that1.Value != nil { - if *this.Value != *that1.Value { - return fmt3.Errorf("Value this(%v) Not Equal that(%v)", *this.Value, *that1.Value) + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 2) + } + return this +} + +func NewPopulatedOffer_Operation_Reserve(r randyMesos, easy bool) *Offer_Operation_Reserve { + this := &Offer_Operation_Reserve{} + if r.Intn(10) != 0 { + v176 := r.Intn(10) + this.Resources = make([]*Resource, v176) + for i := 0; i < v176; i++ { + this.Resources[i] = NewPopulatedResource(r, easy) } - } else if this.Value != nil { - return fmt3.Errorf("this.Value == nil && that.Value != nil") - } else if that1.Value != nil { - return fmt3.Errorf("Value this(%v) Not Equal that(%v)", this.Value, that1.Value) } - 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) + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 2) } - return nil + return this } -func (this *FrameworkID) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true + +func NewPopulatedOffer_Operation_Unreserve(r randyMesos, easy bool) *Offer_Operation_Unreserve { + this := &Offer_Operation_Unreserve{} + if r.Intn(10) != 0 { + v177 := r.Intn(10) + this.Resources = make([]*Resource, v177) + for i := 0; i < v177; i++ { + this.Resources[i] = NewPopulatedResource(r, easy) } - return false } - - that1, ok := that.(*FrameworkID) - if !ok { - return false + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 2) } - if that1 == nil { - if this == nil { - return true + return this +} + +func NewPopulatedOffer_Operation_Create(r randyMesos, easy bool) *Offer_Operation_Create { + this := &Offer_Operation_Create{} + if r.Intn(10) != 0 { + v178 := r.Intn(10) + this.Volumes = make([]*Resource, v178) + for i := 0; i < v178; i++ { + this.Volumes[i] = NewPopulatedResource(r, easy) } - return false - } else if this == nil { - return false } - if this.Value != nil && that1.Value != nil { - if *this.Value != *that1.Value { - return false + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 2) + } + return this +} + +func NewPopulatedOffer_Operation_Destroy(r randyMesos, easy bool) *Offer_Operation_Destroy { + this := &Offer_Operation_Destroy{} + if r.Intn(10) != 0 { + v179 := r.Intn(10) + this.Volumes = make([]*Resource, v179) + for i := 0; i < v179; i++ { + this.Volumes[i] = NewPopulatedResource(r, easy) } - } else if this.Value != nil { - return false - } else if that1.Value != nil { - return false } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 2) } - return true + return this } -func (this *OfferID) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil + +func NewPopulatedTaskInfo(r randyMesos, easy bool) *TaskInfo { + this := &TaskInfo{} + v180 := randStringMesos(r) + this.Name = &v180 + this.TaskId = NewPopulatedTaskID(r, easy) + this.SlaveId = NewPopulatedSlaveID(r, easy) + if r.Intn(10) != 0 { + v181 := r.Intn(10) + this.Resources = make([]*Resource, v181) + for i := 0; i < v181; i++ { + this.Resources[i] = NewPopulatedResource(r, easy) } - return fmt3.Errorf("that == nil && this != nil") } - - that1, ok := that.(*OfferID) - if !ok { - return fmt3.Errorf("that is not of type *OfferID") + if r.Intn(10) != 0 { + this.Executor = NewPopulatedExecutorInfo(r, easy) } - if that1 == nil { - if this == nil { - return nil + if r.Intn(10) != 0 { + v182 := r.Intn(100) + this.Data = make([]byte, v182) + for i := 0; i < v182; i++ { + this.Data[i] = byte(r.Intn(256)) } - return fmt3.Errorf("that is type *OfferID but is nil && this != nil") - } else if this == nil { - return fmt3.Errorf("that is type *OfferIDbut is not nil && this == nil") } - if this.Value != nil && that1.Value != nil { - if *this.Value != *that1.Value { - return fmt3.Errorf("Value this(%v) Not Equal that(%v)", *this.Value, *that1.Value) - } - } else if this.Value != nil { - return fmt3.Errorf("this.Value == nil && that.Value != nil") - } else if that1.Value != nil { - return fmt3.Errorf("Value this(%v) Not Equal that(%v)", this.Value, that1.Value) + if r.Intn(10) != 0 { + this.Command = NewPopulatedCommandInfo(r, easy) } - 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) + if r.Intn(10) != 0 { + this.HealthCheck = NewPopulatedHealthCheck(r, easy) } - return nil + if r.Intn(10) != 0 { + this.Container = NewPopulatedContainerInfo(r, easy) + } + if r.Intn(10) != 0 { + this.Labels = NewPopulatedLabels(r, easy) + } + if r.Intn(10) != 0 { + this.Discovery = NewPopulatedDiscoveryInfo(r, easy) + } + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 12) + } + return this } -func (this *OfferID) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true + +func NewPopulatedTaskStatus(r randyMesos, easy bool) *TaskStatus { + this := &TaskStatus{} + this.TaskId = NewPopulatedTaskID(r, easy) + v183 := TaskState([]int32{6, 0, 1, 2, 3, 4, 5, 7}[r.Intn(8)]) + this.State = &v183 + if r.Intn(10) != 0 { + v184 := r.Intn(100) + this.Data = make([]byte, v184) + for i := 0; i < v184; i++ { + this.Data[i] = byte(r.Intn(256)) } - return false } - - that1, ok := that.(*OfferID) - if !ok { - return false + if r.Intn(10) != 0 { + v185 := randStringMesos(r) + this.Message = &v185 } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false + if r.Intn(10) != 0 { + this.SlaveId = NewPopulatedSlaveID(r, easy) } - if this.Value != nil && that1.Value != nil { - if *this.Value != *that1.Value { - return false + if r.Intn(10) != 0 { + v186 := float64(r.Float64()) + if r.Intn(2) == 0 { + v186 *= -1 } - } else if this.Value != nil { - return false - } else if that1.Value != nil { - return false + this.Timestamp = &v186 } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false + if r.Intn(10) != 0 { + this.ExecutorId = NewPopulatedExecutorID(r, easy) } - return true -} -func (this *SlaveID) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that == nil && this != nil") + if r.Intn(10) != 0 { + v187 := bool(bool(r.Intn(2) == 0)) + this.Healthy = &v187 } - - that1, ok := that.(*SlaveID) - if !ok { - return fmt3.Errorf("that is not of type *SlaveID") + if r.Intn(10) != 0 { + v188 := TaskStatus_Source([]int32{0, 1, 2}[r.Intn(3)]) + this.Source = &v188 } - if that1 == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that is type *SlaveID but is nil && this != nil") - } else if this == nil { - return fmt3.Errorf("that is type *SlaveIDbut is not nil && this == nil") + if r.Intn(10) != 0 { + v189 := TaskStatus_Reason([]int32{0, 17, 1, 2, 3, 4, 5, 6, 7, 8, 9, 18, 10, 11, 12, 13, 14, 15, 16}[r.Intn(19)]) + this.Reason = &v189 } - if this.Value != nil && that1.Value != nil { - if *this.Value != *that1.Value { - return fmt3.Errorf("Value this(%v) Not Equal that(%v)", *this.Value, *that1.Value) + if r.Intn(10) != 0 { + v190 := r.Intn(100) + this.Uuid = make([]byte, v190) + for i := 0; i < v190; i++ { + this.Uuid[i] = byte(r.Intn(256)) } - } else if this.Value != nil { - return fmt3.Errorf("this.Value == nil && that.Value != nil") - } else if that1.Value != nil { - return fmt3.Errorf("Value this(%v) Not Equal that(%v)", this.Value, that1.Value) } - 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) + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 12) } - return nil + return this } -func (this *SlaveID) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true + +func NewPopulatedFilters(r randyMesos, easy bool) *Filters { + this := &Filters{} + if r.Intn(10) != 0 { + v191 := float64(r.Float64()) + if r.Intn(2) == 0 { + v191 *= -1 } - return false + this.RefuseSeconds = &v191 } - - that1, ok := that.(*SlaveID) - if !ok { - return false + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 2) } - if that1 == nil { - if this == nil { - return true + return this +} + +func NewPopulatedEnvironment(r randyMesos, easy bool) *Environment { + this := &Environment{} + if r.Intn(10) != 0 { + v192 := r.Intn(10) + this.Variables = make([]*Environment_Variable, v192) + for i := 0; i < v192; i++ { + this.Variables[i] = NewPopulatedEnvironment_Variable(r, easy) } - return false - } else if this == nil { - return false } - if this.Value != nil && that1.Value != nil { - if *this.Value != *that1.Value { - return false - } - } else if this.Value != nil { - return false - } else if that1.Value != nil { - return false + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 2) } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false + return this +} + +func NewPopulatedEnvironment_Variable(r randyMesos, easy bool) *Environment_Variable { + this := &Environment_Variable{} + v193 := randStringMesos(r) + this.Name = &v193 + v194 := randStringMesos(r) + this.Value = &v194 + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 3) + } + return this +} + +func NewPopulatedParameter(r randyMesos, easy bool) *Parameter { + this := &Parameter{} + v195 := randStringMesos(r) + this.Key = &v195 + v196 := randStringMesos(r) + this.Value = &v196 + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 3) } - return true + return this } -func (this *TaskID) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil + +func NewPopulatedParameters(r randyMesos, easy bool) *Parameters { + this := &Parameters{} + if r.Intn(10) != 0 { + v197 := r.Intn(10) + this.Parameter = make([]*Parameter, v197) + for i := 0; i < v197; i++ { + this.Parameter[i] = NewPopulatedParameter(r, easy) } - return fmt3.Errorf("that == nil && this != nil") } - - that1, ok := that.(*TaskID) - if !ok { - return fmt3.Errorf("that is not of type *TaskID") + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 2) } - if that1 == nil { - if this == nil { - return nil + return this +} + +func NewPopulatedCredential(r randyMesos, easy bool) *Credential { + this := &Credential{} + v198 := randStringMesos(r) + this.Principal = &v198 + if r.Intn(10) != 0 { + v199 := r.Intn(100) + this.Secret = make([]byte, v199) + for i := 0; i < v199; i++ { + this.Secret[i] = byte(r.Intn(256)) } - return fmt3.Errorf("that is type *TaskID but is nil && this != nil") - } else if this == nil { - return fmt3.Errorf("that is type *TaskIDbut is not nil && this == nil") } - if this.Value != nil && that1.Value != nil { - if *this.Value != *that1.Value { - return fmt3.Errorf("Value this(%v) Not Equal that(%v)", *this.Value, *that1.Value) + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 3) + } + return this +} + +func NewPopulatedCredentials(r randyMesos, easy bool) *Credentials { + this := &Credentials{} + if r.Intn(10) != 0 { + v200 := r.Intn(10) + this.Credentials = make([]*Credential, v200) + for i := 0; i < v200; i++ { + this.Credentials[i] = NewPopulatedCredential(r, easy) } - } else if this.Value != nil { - return fmt3.Errorf("this.Value == nil && that.Value != nil") - } else if that1.Value != nil { - return fmt3.Errorf("Value this(%v) Not Equal that(%v)", this.Value, that1.Value) } - 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) + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 2) } - return nil + return this } -func (this *TaskID) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false + +func NewPopulatedACL(r randyMesos, easy bool) *ACL { + this := &ACL{} + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 1) } + return this +} - that1, ok := that.(*TaskID) - if !ok { - return false +func NewPopulatedACL_Entity(r randyMesos, easy bool) *ACL_Entity { + this := &ACL_Entity{} + if r.Intn(10) != 0 { + v201 := ACL_Entity_Type([]int32{0, 1, 2}[r.Intn(3)]) + this.Type = &v201 } - if that1 == nil { - if this == nil { - return true + if r.Intn(10) != 0 { + v202 := r.Intn(10) + this.Values = make([]string, v202) + for i := 0; i < v202; i++ { + this.Values[i] = randStringMesos(r) } - return false - } else if this == nil { - return false } - if this.Value != nil && that1.Value != nil { - if *this.Value != *that1.Value { - return false - } - } else if this.Value != nil { - return false - } else if that1.Value != nil { - return false + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 3) } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false + return this +} + +func NewPopulatedACL_RegisterFramework(r randyMesos, easy bool) *ACL_RegisterFramework { + this := &ACL_RegisterFramework{} + this.Principals = NewPopulatedACL_Entity(r, easy) + this.Roles = NewPopulatedACL_Entity(r, easy) + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 3) } - return true + return this } -func (this *ExecutorID) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that == nil && this != nil") + +func NewPopulatedACL_RunTask(r randyMesos, easy bool) *ACL_RunTask { + this := &ACL_RunTask{} + this.Principals = NewPopulatedACL_Entity(r, easy) + this.Users = NewPopulatedACL_Entity(r, easy) + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 3) } + return this +} - that1, ok := that.(*ExecutorID) - if !ok { - return fmt3.Errorf("that is not of type *ExecutorID") +func NewPopulatedACL_ShutdownFramework(r randyMesos, easy bool) *ACL_ShutdownFramework { + this := &ACL_ShutdownFramework{} + this.Principals = NewPopulatedACL_Entity(r, easy) + this.FrameworkPrincipals = NewPopulatedACL_Entity(r, easy) + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 3) } - if that1 == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that is type *ExecutorID but is nil && this != nil") - } else if this == nil { - return fmt3.Errorf("that is type *ExecutorIDbut is not nil && this == nil") + return this +} + +func NewPopulatedACLs(r randyMesos, easy bool) *ACLs { + this := &ACLs{} + if r.Intn(10) != 0 { + v203 := bool(bool(r.Intn(2) == 0)) + this.Permissive = &v203 } - if this.Value != nil && that1.Value != nil { - if *this.Value != *that1.Value { - return fmt3.Errorf("Value this(%v) Not Equal that(%v)", *this.Value, *that1.Value) + if r.Intn(10) != 0 { + v204 := r.Intn(10) + this.RegisterFrameworks = make([]*ACL_RegisterFramework, v204) + for i := 0; i < v204; i++ { + this.RegisterFrameworks[i] = NewPopulatedACL_RegisterFramework(r, easy) } - } else if this.Value != nil { - return fmt3.Errorf("this.Value == nil && that.Value != nil") - } else if that1.Value != nil { - return fmt3.Errorf("Value this(%v) Not Equal that(%v)", this.Value, that1.Value) } - 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) + if r.Intn(10) != 0 { + v205 := r.Intn(10) + this.RunTasks = make([]*ACL_RunTask, v205) + for i := 0; i < v205; i++ { + this.RunTasks[i] = NewPopulatedACL_RunTask(r, easy) + } } - return nil -} -func (this *ExecutorID) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true + if r.Intn(10) != 0 { + v206 := r.Intn(10) + this.ShutdownFrameworks = make([]*ACL_ShutdownFramework, v206) + for i := 0; i < v206; i++ { + this.ShutdownFrameworks[i] = NewPopulatedACL_ShutdownFramework(r, easy) } - return false } - - that1, ok := that.(*ExecutorID) - if !ok { - return false + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 5) } - if that1 == nil { - if this == nil { - return true + return this +} + +func NewPopulatedRateLimit(r randyMesos, easy bool) *RateLimit { + this := &RateLimit{} + if r.Intn(10) != 0 { + v207 := float64(r.Float64()) + if r.Intn(2) == 0 { + v207 *= -1 } - return false - } else if this == nil { - return false + this.Qps = &v207 } - if this.Value != nil && that1.Value != nil { - if *this.Value != *that1.Value { - return false - } - } else if this.Value != nil { - return false - } else if that1.Value != nil { - return false + v208 := randStringMesos(r) + this.Principal = &v208 + if r.Intn(10) != 0 { + v209 := uint64(uint64(r.Uint32())) + this.Capacity = &v209 } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 4) } - return true + return this } -func (this *ContainerID) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that == nil && this != nil") - } - that1, ok := that.(*ContainerID) - if !ok { - return fmt3.Errorf("that is not of type *ContainerID") - } - if that1 == nil { - if this == nil { - return nil +func NewPopulatedRateLimits(r randyMesos, easy bool) *RateLimits { + this := &RateLimits{} + if r.Intn(10) != 0 { + v210 := r.Intn(10) + this.Limits = make([]*RateLimit, v210) + for i := 0; i < v210; i++ { + this.Limits[i] = NewPopulatedRateLimit(r, easy) } - return fmt3.Errorf("that is type *ContainerID but is nil && this != nil") - } else if this == nil { - return fmt3.Errorf("that is type *ContainerIDbut is not nil && this == nil") } - if this.Value != nil && that1.Value != nil { - if *this.Value != *that1.Value { - return fmt3.Errorf("Value this(%v) Not Equal that(%v)", *this.Value, *that1.Value) + if r.Intn(10) != 0 { + v211 := float64(r.Float64()) + if r.Intn(2) == 0 { + v211 *= -1 } - } else if this.Value != nil { - return fmt3.Errorf("this.Value == nil && that.Value != nil") - } else if that1.Value != nil { - return fmt3.Errorf("Value this(%v) Not Equal that(%v)", this.Value, that1.Value) + this.AggregateDefaultQps = &v211 } - 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) + if r.Intn(10) != 0 { + v212 := uint64(uint64(r.Uint32())) + this.AggregateDefaultCapacity = &v212 } - return nil -} -func (this *ContainerID) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 4) } + return this +} - that1, ok := that.(*ContainerID) - if !ok { - return false +func NewPopulatedVolume(r randyMesos, easy bool) *Volume { + this := &Volume{} + v213 := randStringMesos(r) + this.ContainerPath = &v213 + if r.Intn(10) != 0 { + v214 := randStringMesos(r) + this.HostPath = &v214 } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false + v215 := Volume_Mode([]int32{1, 2}[r.Intn(2)]) + this.Mode = &v215 + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 4) } - if this.Value != nil && that1.Value != nil { - if *this.Value != *that1.Value { - return false + return this +} + +func NewPopulatedContainerInfo(r randyMesos, easy bool) *ContainerInfo { + this := &ContainerInfo{} + v216 := ContainerInfo_Type([]int32{1, 2}[r.Intn(2)]) + this.Type = &v216 + if r.Intn(10) != 0 { + v217 := r.Intn(10) + this.Volumes = make([]*Volume, v217) + for i := 0; i < v217; i++ { + this.Volumes[i] = NewPopulatedVolume(r, easy) } - } else if this.Value != nil { - return false - } else if that1.Value != nil { - return false } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false + if r.Intn(10) != 0 { + this.Docker = NewPopulatedContainerInfo_DockerInfo(r, easy) + } + if r.Intn(10) != 0 { + v218 := randStringMesos(r) + this.Hostname = &v218 + } + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 5) } - return true + return this } -func (this *FrameworkInfo) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that == nil && this != nil") - } - that1, ok := that.(*FrameworkInfo) - if !ok { - return fmt3.Errorf("that is not of type *FrameworkInfo") +func NewPopulatedContainerInfo_DockerInfo(r randyMesos, easy bool) *ContainerInfo_DockerInfo { + this := &ContainerInfo_DockerInfo{} + v219 := randStringMesos(r) + this.Image = &v219 + if r.Intn(10) != 0 { + v220 := ContainerInfo_DockerInfo_Network([]int32{1, 2, 3}[r.Intn(3)]) + this.Network = &v220 } - if that1 == nil { - if this == nil { - return nil + if r.Intn(10) != 0 { + v221 := r.Intn(10) + this.PortMappings = make([]*ContainerInfo_DockerInfo_PortMapping, v221) + for i := 0; i < v221; i++ { + this.PortMappings[i] = NewPopulatedContainerInfo_DockerInfo_PortMapping(r, easy) } - return fmt3.Errorf("that is type *FrameworkInfo but is nil && this != nil") - } else if this == nil { - return fmt3.Errorf("that is type *FrameworkInfobut is not nil && this == nil") } - if this.User != nil && that1.User != nil { - if *this.User != *that1.User { - return fmt3.Errorf("User this(%v) Not Equal that(%v)", *this.User, *that1.User) - } - } else if this.User != nil { - return fmt3.Errorf("this.User == nil && that.User != nil") - } else if that1.User != nil { - return fmt3.Errorf("User this(%v) Not Equal that(%v)", this.User, that1.User) + if r.Intn(10) != 0 { + v222 := bool(bool(r.Intn(2) == 0)) + this.Privileged = &v222 } - if this.Name != nil && that1.Name != nil { - if *this.Name != *that1.Name { - return fmt3.Errorf("Name this(%v) Not Equal that(%v)", *this.Name, *that1.Name) + if r.Intn(10) != 0 { + v223 := r.Intn(10) + this.Parameters = make([]*Parameter, v223) + for i := 0; i < v223; i++ { + this.Parameters[i] = NewPopulatedParameter(r, easy) } - } else if this.Name != nil { - return fmt3.Errorf("this.Name == nil && that.Name != nil") - } else if that1.Name != nil { - return fmt3.Errorf("Name this(%v) Not Equal that(%v)", this.Name, that1.Name) } - if !this.Id.Equal(that1.Id) { - return fmt3.Errorf("Id this(%v) Not Equal that(%v)", this.Id, that1.Id) + if r.Intn(10) != 0 { + v224 := bool(bool(r.Intn(2) == 0)) + this.ForcePullImage = &v224 } - if this.FailoverTimeout != nil && that1.FailoverTimeout != nil { - if *this.FailoverTimeout != *that1.FailoverTimeout { - return fmt3.Errorf("FailoverTimeout this(%v) Not Equal that(%v)", *this.FailoverTimeout, *that1.FailoverTimeout) - } - } else if this.FailoverTimeout != nil { - return fmt3.Errorf("this.FailoverTimeout == nil && that.FailoverTimeout != nil") - } else if that1.FailoverTimeout != nil { - return fmt3.Errorf("FailoverTimeout this(%v) Not Equal that(%v)", this.FailoverTimeout, that1.FailoverTimeout) + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 7) } - if this.Checkpoint != nil && that1.Checkpoint != nil { - if *this.Checkpoint != *that1.Checkpoint { - return fmt3.Errorf("Checkpoint this(%v) Not Equal that(%v)", *this.Checkpoint, *that1.Checkpoint) - } - } else if this.Checkpoint != nil { - return fmt3.Errorf("this.Checkpoint == nil && that.Checkpoint != nil") - } else if that1.Checkpoint != nil { - return fmt3.Errorf("Checkpoint this(%v) Not Equal that(%v)", this.Checkpoint, that1.Checkpoint) + return this +} + +func NewPopulatedContainerInfo_DockerInfo_PortMapping(r randyMesos, easy bool) *ContainerInfo_DockerInfo_PortMapping { + this := &ContainerInfo_DockerInfo_PortMapping{} + v225 := uint32(r.Uint32()) + this.HostPort = &v225 + v226 := uint32(r.Uint32()) + this.ContainerPort = &v226 + if r.Intn(10) != 0 { + v227 := randStringMesos(r) + this.Protocol = &v227 } - if this.Role != nil && that1.Role != nil { - if *this.Role != *that1.Role { - return fmt3.Errorf("Role this(%v) Not Equal that(%v)", *this.Role, *that1.Role) - } - } else if this.Role != nil { - return fmt3.Errorf("this.Role == nil && that.Role != nil") - } else if that1.Role != nil { - return fmt3.Errorf("Role this(%v) Not Equal that(%v)", this.Role, that1.Role) + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 4) } - if this.Hostname != nil && that1.Hostname != nil { - if *this.Hostname != *that1.Hostname { - return fmt3.Errorf("Hostname this(%v) Not Equal that(%v)", *this.Hostname, *that1.Hostname) + return this +} + +func NewPopulatedLabels(r randyMesos, easy bool) *Labels { + this := &Labels{} + if r.Intn(10) != 0 { + v228 := r.Intn(10) + this.Labels = make([]*Label, v228) + for i := 0; i < v228; i++ { + this.Labels[i] = NewPopulatedLabel(r, easy) } - } else if this.Hostname != nil { - return fmt3.Errorf("this.Hostname == nil && that.Hostname != nil") - } else if that1.Hostname != nil { - return fmt3.Errorf("Hostname this(%v) Not Equal that(%v)", this.Hostname, that1.Hostname) } - if this.Principal != nil && that1.Principal != nil { - if *this.Principal != *that1.Principal { - return fmt3.Errorf("Principal this(%v) Not Equal that(%v)", *this.Principal, *that1.Principal) - } - } else if this.Principal != nil { - return fmt3.Errorf("this.Principal == nil && that.Principal != nil") - } else if that1.Principal != nil { - return fmt3.Errorf("Principal this(%v) Not Equal that(%v)", this.Principal, that1.Principal) + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 2) } - if this.WebuiUrl != nil && that1.WebuiUrl != nil { - if *this.WebuiUrl != *that1.WebuiUrl { - return fmt3.Errorf("WebuiUrl this(%v) Not Equal that(%v)", *this.WebuiUrl, *that1.WebuiUrl) - } - } else if this.WebuiUrl != nil { - return fmt3.Errorf("this.WebuiUrl == nil && that.WebuiUrl != nil") - } else if that1.WebuiUrl != nil { - return fmt3.Errorf("WebuiUrl this(%v) Not Equal that(%v)", this.WebuiUrl, that1.WebuiUrl) + return this +} + +func NewPopulatedLabel(r randyMesos, easy bool) *Label { + this := &Label{} + v229 := randStringMesos(r) + this.Key = &v229 + if r.Intn(10) != 0 { + v230 := randStringMesos(r) + this.Value = &v230 } - 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) + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 3) } - return nil + return this } -func (this *FrameworkInfo) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true + +func NewPopulatedPort(r randyMesos, easy bool) *Port { + this := &Port{} + v231 := uint32(r.Uint32()) + this.Number = &v231 + if r.Intn(10) != 0 { + v232 := randStringMesos(r) + this.Name = &v232 + } + if r.Intn(10) != 0 { + v233 := randStringMesos(r) + this.Protocol = &v233 + } + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 4) + } + return this +} + +func NewPopulatedPorts(r randyMesos, easy bool) *Ports { + this := &Ports{} + if r.Intn(10) != 0 { + v234 := r.Intn(10) + this.Ports = make([]*Port, v234) + for i := 0; i < v234; i++ { + this.Ports[i] = NewPopulatedPort(r, easy) } - return false } + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 2) + } + return this +} - that1, ok := that.(*FrameworkInfo) - if !ok { - return false +func NewPopulatedDiscoveryInfo(r randyMesos, easy bool) *DiscoveryInfo { + this := &DiscoveryInfo{} + v235 := DiscoveryInfo_Visibility([]int32{0, 1, 2}[r.Intn(3)]) + this.Visibility = &v235 + if r.Intn(10) != 0 { + v236 := randStringMesos(r) + this.Name = &v236 } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false + if r.Intn(10) != 0 { + v237 := randStringMesos(r) + this.Environment = &v237 } - if this.User != nil && that1.User != nil { - if *this.User != *that1.User { - return false - } - } else if this.User != nil { - return false - } else if that1.User != nil { - return false + if r.Intn(10) != 0 { + v238 := randStringMesos(r) + this.Location = &v238 } - if this.Name != nil && that1.Name != nil { - if *this.Name != *that1.Name { - return false - } - } else if this.Name != nil { - return false - } else if that1.Name != nil { - return false + if r.Intn(10) != 0 { + v239 := randStringMesos(r) + this.Version = &v239 } - if !this.Id.Equal(that1.Id) { - return false + if r.Intn(10) != 0 { + this.Ports = NewPopulatedPorts(r, easy) } - if this.FailoverTimeout != nil && that1.FailoverTimeout != nil { - if *this.FailoverTimeout != *that1.FailoverTimeout { - return false - } - } else if this.FailoverTimeout != nil { - return false - } else if that1.FailoverTimeout != nil { - return false + if r.Intn(10) != 0 { + this.Labels = NewPopulatedLabels(r, easy) } - if this.Checkpoint != nil && that1.Checkpoint != nil { - if *this.Checkpoint != *that1.Checkpoint { - return false - } - } else if this.Checkpoint != nil { - return false - } else if that1.Checkpoint != nil { - return false + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedMesos(r, 8) } - if this.Role != nil && that1.Role != nil { - if *this.Role != *that1.Role { - return false - } - } else if this.Role != nil { - return false - } else if that1.Role != nil { - return false + return this +} + +type randyMesos interface { + Float32() float32 + Float64() float64 + Int63() int64 + Int31() int32 + Uint32() uint32 + Intn(n int) int +} + +func randUTF8RuneMesos(r randyMesos) rune { + ru := r.Intn(62) + if ru < 10 { + return rune(ru + 48) + } else if ru < 36 { + return rune(ru + 55) } - if this.Hostname != nil && that1.Hostname != nil { - if *this.Hostname != *that1.Hostname { - return false - } - } else if this.Hostname != nil { - return false - } else if that1.Hostname != nil { - return false + return rune(ru + 61) +} +func randStringMesos(r randyMesos) string { + v240 := r.Intn(100) + tmps := make([]rune, v240) + for i := 0; i < v240; i++ { + tmps[i] = randUTF8RuneMesos(r) } - if this.Principal != nil && that1.Principal != nil { - if *this.Principal != *that1.Principal { - return false + return string(tmps) +} +func randUnrecognizedMesos(r randyMesos, maxFieldNumber int) (data []byte) { + l := r.Intn(5) + for i := 0; i < l; i++ { + wire := r.Intn(4) + if wire == 3 { + wire = 5 } - } else if this.Principal != nil { - return false - } else if that1.Principal != nil { - return false + fieldNumber := maxFieldNumber + r.Intn(100) + data = randFieldMesos(data, r, fieldNumber, wire) } - if this.WebuiUrl != nil && that1.WebuiUrl != nil { - if *this.WebuiUrl != *that1.WebuiUrl { - return false + return data +} +func randFieldMesos(data []byte, r randyMesos, fieldNumber int, wire int) []byte { + key := uint32(fieldNumber)<<3 | uint32(wire) + switch wire { + case 0: + data = encodeVarintPopulateMesos(data, uint64(key)) + v241 := r.Int63() + if r.Intn(2) == 0 { + v241 *= -1 } - } else if this.WebuiUrl != nil { - return false - } else if that1.WebuiUrl != nil { - return false + data = encodeVarintPopulateMesos(data, uint64(v241)) + case 1: + data = encodeVarintPopulateMesos(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 = encodeVarintPopulateMesos(data, uint64(key)) + ll := r.Intn(100) + data = encodeVarintPopulateMesos(data, uint64(ll)) + for j := 0; j < ll; j++ { + data = append(data, byte(r.Intn(256))) + } + default: + data = encodeVarintPopulateMesos(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 encodeVarintPopulateMesos(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 *FrameworkID) Size() (n int) { + var l int + _ = l + if m.Value != nil { + l = len(*m.Value) + n += 1 + l + sovMesos(uint64(l)) } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - return true + return n } -func (this *HealthCheck) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that == nil && this != nil") - } - that1, ok := that.(*HealthCheck) - if !ok { - return fmt3.Errorf("that is not of type *HealthCheck") +func (m *OfferID) Size() (n int) { + var l int + _ = l + if m.Value != nil { + l = len(*m.Value) + n += 1 + l + sovMesos(uint64(l)) } - if that1 == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that is type *HealthCheck but is nil && this != nil") - } else if this == nil { - return fmt3.Errorf("that is type *HealthCheckbut is not nil && this == nil") + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - if !this.Http.Equal(that1.Http) { - return fmt3.Errorf("Http this(%v) Not Equal that(%v)", this.Http, that1.Http) + return n +} + +func (m *SlaveID) Size() (n int) { + var l int + _ = l + if m.Value != nil { + l = len(*m.Value) + n += 1 + l + sovMesos(uint64(l)) } - if this.DelaySeconds != nil && that1.DelaySeconds != nil { - if *this.DelaySeconds != *that1.DelaySeconds { - return fmt3.Errorf("DelaySeconds this(%v) Not Equal that(%v)", *this.DelaySeconds, *that1.DelaySeconds) - } - } else if this.DelaySeconds != nil { - return fmt3.Errorf("this.DelaySeconds == nil && that.DelaySeconds != nil") - } else if that1.DelaySeconds != nil { - return fmt3.Errorf("DelaySeconds this(%v) Not Equal that(%v)", this.DelaySeconds, that1.DelaySeconds) + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - if this.IntervalSeconds != nil && that1.IntervalSeconds != nil { - if *this.IntervalSeconds != *that1.IntervalSeconds { - return fmt3.Errorf("IntervalSeconds this(%v) Not Equal that(%v)", *this.IntervalSeconds, *that1.IntervalSeconds) - } - } else if this.IntervalSeconds != nil { - return fmt3.Errorf("this.IntervalSeconds == nil && that.IntervalSeconds != nil") - } else if that1.IntervalSeconds != nil { - return fmt3.Errorf("IntervalSeconds this(%v) Not Equal that(%v)", this.IntervalSeconds, that1.IntervalSeconds) + return n +} + +func (m *TaskID) Size() (n int) { + var l int + _ = l + if m.Value != nil { + l = len(*m.Value) + n += 1 + l + sovMesos(uint64(l)) } - if this.TimeoutSeconds != nil && that1.TimeoutSeconds != nil { - if *this.TimeoutSeconds != *that1.TimeoutSeconds { - return fmt3.Errorf("TimeoutSeconds this(%v) Not Equal that(%v)", *this.TimeoutSeconds, *that1.TimeoutSeconds) - } - } else if this.TimeoutSeconds != nil { - return fmt3.Errorf("this.TimeoutSeconds == nil && that.TimeoutSeconds != nil") - } else if that1.TimeoutSeconds != nil { - return fmt3.Errorf("TimeoutSeconds this(%v) Not Equal that(%v)", this.TimeoutSeconds, that1.TimeoutSeconds) + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - if this.ConsecutiveFailures != nil && that1.ConsecutiveFailures != nil { - if *this.ConsecutiveFailures != *that1.ConsecutiveFailures { - return fmt3.Errorf("ConsecutiveFailures this(%v) Not Equal that(%v)", *this.ConsecutiveFailures, *that1.ConsecutiveFailures) - } - } else if this.ConsecutiveFailures != nil { - return fmt3.Errorf("this.ConsecutiveFailures == nil && that.ConsecutiveFailures != nil") - } else if that1.ConsecutiveFailures != nil { - return fmt3.Errorf("ConsecutiveFailures this(%v) Not Equal that(%v)", this.ConsecutiveFailures, that1.ConsecutiveFailures) + return n +} + +func (m *ExecutorID) Size() (n int) { + var l int + _ = l + if m.Value != nil { + l = len(*m.Value) + n += 1 + l + sovMesos(uint64(l)) } - if this.GracePeriodSeconds != nil && that1.GracePeriodSeconds != nil { - if *this.GracePeriodSeconds != *that1.GracePeriodSeconds { - return fmt3.Errorf("GracePeriodSeconds this(%v) Not Equal that(%v)", *this.GracePeriodSeconds, *that1.GracePeriodSeconds) - } - } else if this.GracePeriodSeconds != nil { - return fmt3.Errorf("this.GracePeriodSeconds == nil && that.GracePeriodSeconds != nil") - } else if that1.GracePeriodSeconds != nil { - return fmt3.Errorf("GracePeriodSeconds this(%v) Not Equal that(%v)", this.GracePeriodSeconds, that1.GracePeriodSeconds) + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - if !this.Command.Equal(that1.Command) { - return fmt3.Errorf("Command this(%v) Not Equal that(%v)", this.Command, that1.Command) + return n +} + +func (m *ContainerID) Size() (n int) { + var l int + _ = l + if m.Value != nil { + l = len(*m.Value) + n += 1 + l + sovMesos(uint64(l)) } - 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) + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - return nil + return n } -func (this *HealthCheck) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - that1, ok := that.(*HealthCheck) - if !ok { - return false +func (m *FrameworkInfo) Size() (n int) { + var l int + _ = l + if m.User != nil { + l = len(*m.User) + n += 1 + l + sovMesos(uint64(l)) } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false + if m.Name != nil { + l = len(*m.Name) + n += 1 + l + sovMesos(uint64(l)) } - if !this.Http.Equal(that1.Http) { - return false + if m.Id != nil { + l = m.Id.Size() + n += 1 + l + sovMesos(uint64(l)) } - if this.DelaySeconds != nil && that1.DelaySeconds != nil { - if *this.DelaySeconds != *that1.DelaySeconds { - return false - } - } else if this.DelaySeconds != nil { - return false - } else if that1.DelaySeconds != nil { - return false + if m.FailoverTimeout != nil { + n += 9 } - if this.IntervalSeconds != nil && that1.IntervalSeconds != nil { - if *this.IntervalSeconds != *that1.IntervalSeconds { - return false - } - } else if this.IntervalSeconds != nil { - return false - } else if that1.IntervalSeconds != nil { - return false + if m.Checkpoint != nil { + n += 2 } - if this.TimeoutSeconds != nil && that1.TimeoutSeconds != nil { - if *this.TimeoutSeconds != *that1.TimeoutSeconds { - return false - } - } else if this.TimeoutSeconds != nil { - return false - } else if that1.TimeoutSeconds != nil { - return false + if m.Role != nil { + l = len(*m.Role) + n += 1 + l + sovMesos(uint64(l)) } - if this.ConsecutiveFailures != nil && that1.ConsecutiveFailures != nil { - if *this.ConsecutiveFailures != *that1.ConsecutiveFailures { - return false - } - } else if this.ConsecutiveFailures != nil { - return false - } else if that1.ConsecutiveFailures != nil { - return false + if m.Hostname != nil { + l = len(*m.Hostname) + n += 1 + l + sovMesos(uint64(l)) } - if this.GracePeriodSeconds != nil && that1.GracePeriodSeconds != nil { - if *this.GracePeriodSeconds != *that1.GracePeriodSeconds { - return false - } - } else if this.GracePeriodSeconds != nil { - return false - } else if that1.GracePeriodSeconds != nil { - return false + if m.Principal != nil { + l = len(*m.Principal) + n += 1 + l + sovMesos(uint64(l)) } - if !this.Command.Equal(that1.Command) { - return false + if m.WebuiUrl != nil { + l = len(*m.WebuiUrl) + n += 1 + l + sovMesos(uint64(l)) } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false + if len(m.Capabilities) > 0 { + for _, e := range m.Capabilities { + l = e.Size() + n += 1 + l + sovMesos(uint64(l)) + } } - return true + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n } -func (this *HealthCheck_HTTP) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that == nil && this != nil") + +func (m *FrameworkInfo_Capability) Size() (n int) { + var l int + _ = l + if m.Type != nil { + n += 1 + sovMesos(uint64(*m.Type)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } + return n +} - that1, ok := that.(*HealthCheck_HTTP) - if !ok { - return fmt3.Errorf("that is not of type *HealthCheck_HTTP") +func (m *HealthCheck) Size() (n int) { + var l int + _ = l + if m.Http != nil { + l = m.Http.Size() + n += 1 + l + sovMesos(uint64(l)) } - if that1 == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that is type *HealthCheck_HTTP but is nil && this != nil") - } else if this == nil { - return fmt3.Errorf("that is type *HealthCheck_HTTPbut is not nil && this == nil") + if m.DelaySeconds != nil { + n += 9 } - if this.Port != nil && that1.Port != nil { - if *this.Port != *that1.Port { - return fmt3.Errorf("Port this(%v) Not Equal that(%v)", *this.Port, *that1.Port) - } - } else if this.Port != nil { - return fmt3.Errorf("this.Port == nil && that.Port != nil") - } else if that1.Port != nil { - return fmt3.Errorf("Port this(%v) Not Equal that(%v)", this.Port, that1.Port) + if m.IntervalSeconds != nil { + n += 9 + } + if m.TimeoutSeconds != nil { + n += 9 + } + if m.ConsecutiveFailures != nil { + n += 1 + sovMesos(uint64(*m.ConsecutiveFailures)) + } + if m.GracePeriodSeconds != nil { + n += 9 + } + if m.Command != nil { + l = m.Command.Size() + n += 1 + l + sovMesos(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - if this.Path != nil && that1.Path != nil { - if *this.Path != *that1.Path { - return fmt3.Errorf("Path this(%v) Not Equal that(%v)", *this.Path, *that1.Path) - } - } else if this.Path != nil { - return fmt3.Errorf("this.Path == nil && that.Path != nil") - } else if that1.Path != nil { - return fmt3.Errorf("Path this(%v) Not Equal that(%v)", this.Path, that1.Path) + return n +} + +func (m *HealthCheck_HTTP) Size() (n int) { + var l int + _ = l + if m.Port != nil { + n += 1 + sovMesos(uint64(*m.Port)) } - if len(this.Statuses) != len(that1.Statuses) { - return fmt3.Errorf("Statuses this(%v) Not Equal that(%v)", len(this.Statuses), len(that1.Statuses)) + if m.Path != nil { + l = len(*m.Path) + n += 1 + l + sovMesos(uint64(l)) } - for i := range this.Statuses { - if this.Statuses[i] != that1.Statuses[i] { - return fmt3.Errorf("Statuses this[%v](%v) Not Equal that[%v](%v)", i, this.Statuses[i], i, that1.Statuses[i]) + if len(m.Statuses) > 0 { + for _, e := range m.Statuses { + n += 1 + sovMesos(uint64(e)) } } - 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) + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - return nil + return n } -func (this *HealthCheck_HTTP) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true + +func (m *CommandInfo) Size() (n int) { + var l int + _ = l + if len(m.Uris) > 0 { + for _, e := range m.Uris { + l = e.Size() + n += 1 + l + sovMesos(uint64(l)) } - return false } - - that1, ok := that.(*HealthCheck_HTTP) - if !ok { - return false + if m.Environment != nil { + l = m.Environment.Size() + n += 1 + l + sovMesos(uint64(l)) } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false + if m.Value != nil { + l = len(*m.Value) + n += 1 + l + sovMesos(uint64(l)) } - if this.Port != nil && that1.Port != nil { - if *this.Port != *that1.Port { - return false - } - } else if this.Port != nil { - return false - } else if that1.Port != nil { - return false + if m.Container != nil { + l = m.Container.Size() + n += 1 + l + sovMesos(uint64(l)) } - if this.Path != nil && that1.Path != nil { - if *this.Path != *that1.Path { - return false - } - } else if this.Path != nil { - return false - } else if that1.Path != nil { - return false + if m.User != nil { + l = len(*m.User) + n += 1 + l + sovMesos(uint64(l)) } - if len(this.Statuses) != len(that1.Statuses) { - return false + if m.Shell != nil { + n += 2 } - for i := range this.Statuses { - if this.Statuses[i] != that1.Statuses[i] { - return false + if len(m.Arguments) > 0 { + for _, s := range m.Arguments { + l = len(s) + n += 1 + l + sovMesos(uint64(l)) } } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - return true + return n } -func (this *CommandInfo) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that == nil && this != nil") - } - that1, ok := that.(*CommandInfo) - if !ok { - return fmt3.Errorf("that is not of type *CommandInfo") +func (m *CommandInfo_URI) Size() (n int) { + var l int + _ = l + if m.Value != nil { + l = len(*m.Value) + n += 1 + l + sovMesos(uint64(l)) } - if that1 == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that is type *CommandInfo but is nil && this != nil") - } else if this == nil { - return fmt3.Errorf("that is type *CommandInfobut is not nil && this == nil") + if m.Executable != nil { + n += 2 } - if !this.Container.Equal(that1.Container) { - return fmt3.Errorf("Container this(%v) Not Equal that(%v)", this.Container, that1.Container) + if m.Extract != nil { + n += 2 } - if len(this.Uris) != len(that1.Uris) { - return fmt3.Errorf("Uris this(%v) Not Equal that(%v)", len(this.Uris), len(that1.Uris)) + if m.Cache != nil { + n += 2 } - for i := range this.Uris { - if !this.Uris[i].Equal(that1.Uris[i]) { - return fmt3.Errorf("Uris this[%v](%v) Not Equal that[%v](%v)", i, this.Uris[i], i, that1.Uris[i]) - } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - if !this.Environment.Equal(that1.Environment) { - return fmt3.Errorf("Environment this(%v) Not Equal that(%v)", this.Environment, that1.Environment) + return n +} + +func (m *CommandInfo_ContainerInfo) Size() (n int) { + var l int + _ = l + if m.Image != nil { + l = len(*m.Image) + n += 1 + l + sovMesos(uint64(l)) } - if this.Shell != nil && that1.Shell != nil { - if *this.Shell != *that1.Shell { - return fmt3.Errorf("Shell this(%v) Not Equal that(%v)", *this.Shell, *that1.Shell) + if len(m.Options) > 0 { + for _, s := range m.Options { + l = len(s) + n += 1 + l + sovMesos(uint64(l)) } - } else if this.Shell != nil { - return fmt3.Errorf("this.Shell == nil && that.Shell != nil") - } else if that1.Shell != nil { - return fmt3.Errorf("Shell this(%v) Not Equal that(%v)", this.Shell, that1.Shell) } - if this.Value != nil && that1.Value != nil { - if *this.Value != *that1.Value { - return fmt3.Errorf("Value this(%v) Not Equal that(%v)", *this.Value, *that1.Value) - } - } else if this.Value != nil { - return fmt3.Errorf("this.Value == nil && that.Value != nil") - } else if that1.Value != nil { - return fmt3.Errorf("Value this(%v) Not Equal that(%v)", this.Value, that1.Value) + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - if len(this.Arguments) != len(that1.Arguments) { - return fmt3.Errorf("Arguments this(%v) Not Equal that(%v)", len(this.Arguments), len(that1.Arguments)) + return n +} + +func (m *ExecutorInfo) Size() (n int) { + var l int + _ = l + if m.ExecutorId != nil { + l = m.ExecutorId.Size() + n += 1 + l + sovMesos(uint64(l)) } - for i := range this.Arguments { - if this.Arguments[i] != that1.Arguments[i] { - return fmt3.Errorf("Arguments this[%v](%v) Not Equal that[%v](%v)", i, this.Arguments[i], i, that1.Arguments[i]) - } + if m.Data != nil { + l = len(m.Data) + n += 1 + l + sovMesos(uint64(l)) } - if this.User != nil && that1.User != nil { - if *this.User != *that1.User { - return fmt3.Errorf("User this(%v) Not Equal that(%v)", *this.User, *that1.User) + if len(m.Resources) > 0 { + for _, e := range m.Resources { + l = e.Size() + n += 1 + l + sovMesos(uint64(l)) } - } else if this.User != nil { - return fmt3.Errorf("this.User == nil && that.User != nil") - } else if that1.User != nil { - return fmt3.Errorf("User this(%v) Not Equal that(%v)", this.User, that1.User) } - 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 *CommandInfo) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false + if m.Command != nil { + l = m.Command.Size() + n += 1 + l + sovMesos(uint64(l)) } - - that1, ok := that.(*CommandInfo) - if !ok { - return false + if m.FrameworkId != nil { + l = m.FrameworkId.Size() + n += 1 + l + sovMesos(uint64(l)) } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false + if m.Name != nil { + l = len(*m.Name) + n += 1 + l + sovMesos(uint64(l)) } - if !this.Container.Equal(that1.Container) { - return false + if m.Source != nil { + l = len(*m.Source) + n += 1 + l + sovMesos(uint64(l)) } - if len(this.Uris) != len(that1.Uris) { - return false + if m.Container != nil { + l = m.Container.Size() + n += 1 + l + sovMesos(uint64(l)) } - for i := range this.Uris { - if !this.Uris[i].Equal(that1.Uris[i]) { - return false - } + if m.Discovery != nil { + l = m.Discovery.Size() + n += 1 + l + sovMesos(uint64(l)) } - if !this.Environment.Equal(that1.Environment) { - return false + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - if this.Shell != nil && that1.Shell != nil { - if *this.Shell != *that1.Shell { - return false - } - } else if this.Shell != nil { - return false - } else if that1.Shell != nil { - return false + return n +} + +func (m *MasterInfo) Size() (n int) { + var l int + _ = l + if m.Id != nil { + l = len(*m.Id) + n += 1 + l + sovMesos(uint64(l)) } - if this.Value != nil && that1.Value != nil { - if *this.Value != *that1.Value { - return false - } - } else if this.Value != nil { - return false - } else if that1.Value != nil { - return false + if m.Ip != nil { + n += 1 + sovMesos(uint64(*m.Ip)) } - if len(this.Arguments) != len(that1.Arguments) { - return false + if m.Port != nil { + n += 1 + sovMesos(uint64(*m.Port)) } - for i := range this.Arguments { - if this.Arguments[i] != that1.Arguments[i] { - return false - } + if m.Pid != nil { + l = len(*m.Pid) + n += 1 + l + sovMesos(uint64(l)) } - if this.User != nil && that1.User != nil { - if *this.User != *that1.User { - return false - } - } else if this.User != nil { - return false - } else if that1.User != nil { - return false + if m.Hostname != nil { + l = len(*m.Hostname) + n += 1 + l + sovMesos(uint64(l)) } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false + if m.Version != nil { + l = len(*m.Version) + n += 1 + l + sovMesos(uint64(l)) } - return true -} -func (this *CommandInfo_URI) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that == nil && this != nil") + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } + return n +} - that1, ok := that.(*CommandInfo_URI) - if !ok { - return fmt3.Errorf("that is not of type *CommandInfo_URI") +func (m *SlaveInfo) Size() (n int) { + var l int + _ = l + if m.Hostname != nil { + l = len(*m.Hostname) + n += 1 + l + sovMesos(uint64(l)) } - if that1 == nil { - if this == nil { - return nil + if len(m.Resources) > 0 { + for _, e := range m.Resources { + l = e.Size() + n += 1 + l + sovMesos(uint64(l)) } - return fmt3.Errorf("that is type *CommandInfo_URI but is nil && this != nil") - } else if this == nil { - return fmt3.Errorf("that is type *CommandInfo_URIbut is not nil && this == nil") } - if this.Value != nil && that1.Value != nil { - if *this.Value != *that1.Value { - return fmt3.Errorf("Value this(%v) Not Equal that(%v)", *this.Value, *that1.Value) + if len(m.Attributes) > 0 { + for _, e := range m.Attributes { + l = e.Size() + n += 1 + l + sovMesos(uint64(l)) } - } else if this.Value != nil { - return fmt3.Errorf("this.Value == nil && that.Value != nil") - } else if that1.Value != nil { - return fmt3.Errorf("Value this(%v) Not Equal that(%v)", this.Value, that1.Value) } - if this.Executable != nil && that1.Executable != nil { - if *this.Executable != *that1.Executable { - return fmt3.Errorf("Executable this(%v) Not Equal that(%v)", *this.Executable, *that1.Executable) - } - } else if this.Executable != nil { - return fmt3.Errorf("this.Executable == nil && that.Executable != nil") - } else if that1.Executable != nil { - return fmt3.Errorf("Executable this(%v) Not Equal that(%v)", this.Executable, that1.Executable) + if m.Id != nil { + l = m.Id.Size() + n += 1 + l + sovMesos(uint64(l)) } - if this.Extract != nil && that1.Extract != nil { - if *this.Extract != *that1.Extract { - return fmt3.Errorf("Extract this(%v) Not Equal that(%v)", *this.Extract, *that1.Extract) - } - } else if this.Extract != nil { - return fmt3.Errorf("this.Extract == nil && that.Extract != nil") - } else if that1.Extract != nil { - return fmt3.Errorf("Extract this(%v) Not Equal that(%v)", this.Extract, that1.Extract) + if m.Checkpoint != nil { + n += 2 } - 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) + if m.Port != nil { + n += 1 + sovMesos(uint64(*m.Port)) } - return nil -} -func (this *CommandInfo_URI) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } + return n +} - that1, ok := that.(*CommandInfo_URI) - if !ok { - return false +func (m *Value) Size() (n int) { + var l int + _ = l + if m.Type != nil { + n += 1 + sovMesos(uint64(*m.Type)) } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false + if m.Scalar != nil { + l = m.Scalar.Size() + n += 1 + l + sovMesos(uint64(l)) } - if this.Value != nil && that1.Value != nil { - if *this.Value != *that1.Value { - return false - } - } else if this.Value != nil { - return false - } else if that1.Value != nil { - return false + if m.Ranges != nil { + l = m.Ranges.Size() + n += 1 + l + sovMesos(uint64(l)) } - if this.Executable != nil && that1.Executable != nil { - if *this.Executable != *that1.Executable { - return false - } - } else if this.Executable != nil { - return false - } else if that1.Executable != nil { - return false + if m.Set != nil { + l = m.Set.Size() + n += 1 + l + sovMesos(uint64(l)) } - if this.Extract != nil && that1.Extract != nil { - if *this.Extract != *that1.Extract { - return false - } - } else if this.Extract != nil { - return false - } else if that1.Extract != nil { - return false + if m.Text != nil { + l = m.Text.Size() + n += 1 + l + sovMesos(uint64(l)) } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - return true + return n } -func (this *CommandInfo_ContainerInfo) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that == nil && this != nil") + +func (m *Value_Scalar) Size() (n int) { + var l int + _ = l + if m.Value != nil { + n += 9 + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } + return n +} - that1, ok := that.(*CommandInfo_ContainerInfo) - if !ok { - return fmt3.Errorf("that is not of type *CommandInfo_ContainerInfo") +func (m *Value_Range) Size() (n int) { + var l int + _ = l + if m.Begin != nil { + n += 1 + sovMesos(uint64(*m.Begin)) } - if that1 == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that is type *CommandInfo_ContainerInfo but is nil && this != nil") - } else if this == nil { - return fmt3.Errorf("that is type *CommandInfo_ContainerInfobut is not nil && this == nil") + if m.End != nil { + n += 1 + sovMesos(uint64(*m.End)) } - if this.Image != nil && that1.Image != nil { - if *this.Image != *that1.Image { - return fmt3.Errorf("Image this(%v) Not Equal that(%v)", *this.Image, *that1.Image) + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *Value_Ranges) Size() (n int) { + var l int + _ = l + if len(m.Range) > 0 { + for _, e := range m.Range { + l = e.Size() + n += 1 + l + sovMesos(uint64(l)) } - } else if this.Image != nil { - return fmt3.Errorf("this.Image == nil && that.Image != nil") - } else if that1.Image != nil { - return fmt3.Errorf("Image this(%v) Not Equal that(%v)", this.Image, that1.Image) } - if len(this.Options) != len(that1.Options) { - return fmt3.Errorf("Options this(%v) Not Equal that(%v)", len(this.Options), len(that1.Options)) + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - for i := range this.Options { - if this.Options[i] != that1.Options[i] { - return fmt3.Errorf("Options this[%v](%v) Not Equal that[%v](%v)", i, this.Options[i], i, that1.Options[i]) + return n +} + +func (m *Value_Set) Size() (n int) { + var l int + _ = l + if len(m.Item) > 0 { + for _, s := range m.Item { + l = len(s) + n += 1 + l + sovMesos(uint64(l)) } } - 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) + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - return nil + return n } -func (this *CommandInfo_ContainerInfo) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false + +func (m *Value_Text) Size() (n int) { + var l int + _ = l + if m.Value != nil { + l = len(*m.Value) + n += 1 + l + sovMesos(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } + return n +} - that1, ok := that.(*CommandInfo_ContainerInfo) - if !ok { - return false +func (m *Attribute) Size() (n int) { + var l int + _ = l + if m.Name != nil { + l = len(*m.Name) + n += 1 + l + sovMesos(uint64(l)) } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false + if m.Type != nil { + n += 1 + sovMesos(uint64(*m.Type)) } - if this.Image != nil && that1.Image != nil { - if *this.Image != *that1.Image { - return false - } - } else if this.Image != nil { - return false - } else if that1.Image != nil { - return false + if m.Scalar != nil { + l = m.Scalar.Size() + n += 1 + l + sovMesos(uint64(l)) } - if len(this.Options) != len(that1.Options) { - return false + if m.Ranges != nil { + l = m.Ranges.Size() + n += 1 + l + sovMesos(uint64(l)) } - for i := range this.Options { - if this.Options[i] != that1.Options[i] { - return false - } + if m.Text != nil { + l = m.Text.Size() + n += 1 + l + sovMesos(uint64(l)) } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false + if m.Set != nil { + l = m.Set.Size() + n += 1 + l + sovMesos(uint64(l)) } - return true -} -func (this *ExecutorInfo) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that == nil && this != nil") + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } + return n +} - that1, ok := that.(*ExecutorInfo) - if !ok { - return fmt3.Errorf("that is not of type *ExecutorInfo") +func (m *Resource) Size() (n int) { + var l int + _ = l + if m.Name != nil { + l = len(*m.Name) + n += 1 + l + sovMesos(uint64(l)) } - if that1 == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that is type *ExecutorInfo but is nil && this != nil") - } else if this == nil { - return fmt3.Errorf("that is type *ExecutorInfobut is not nil && this == nil") + if m.Type != nil { + n += 1 + sovMesos(uint64(*m.Type)) } - if !this.ExecutorId.Equal(that1.ExecutorId) { - return fmt3.Errorf("ExecutorId this(%v) Not Equal that(%v)", this.ExecutorId, that1.ExecutorId) + if m.Scalar != nil { + l = m.Scalar.Size() + n += 1 + l + sovMesos(uint64(l)) } - if !this.FrameworkId.Equal(that1.FrameworkId) { - return fmt3.Errorf("FrameworkId this(%v) Not Equal that(%v)", this.FrameworkId, that1.FrameworkId) + if m.Ranges != nil { + l = m.Ranges.Size() + n += 1 + l + sovMesos(uint64(l)) } - if !this.Command.Equal(that1.Command) { - return fmt3.Errorf("Command this(%v) Not Equal that(%v)", this.Command, that1.Command) + if m.Set != nil { + l = m.Set.Size() + n += 1 + l + sovMesos(uint64(l)) } - if !this.Container.Equal(that1.Container) { - return fmt3.Errorf("Container this(%v) Not Equal that(%v)", this.Container, that1.Container) + if m.Role != nil { + l = len(*m.Role) + n += 1 + l + sovMesos(uint64(l)) } - if len(this.Resources) != len(that1.Resources) { - return fmt3.Errorf("Resources this(%v) Not Equal that(%v)", len(this.Resources), len(that1.Resources)) + if m.Disk != nil { + l = m.Disk.Size() + n += 1 + l + sovMesos(uint64(l)) } - for i := range this.Resources { - if !this.Resources[i].Equal(that1.Resources[i]) { - return fmt3.Errorf("Resources this[%v](%v) Not Equal that[%v](%v)", i, this.Resources[i], i, that1.Resources[i]) - } + if m.Reservation != nil { + l = m.Reservation.Size() + n += 1 + l + sovMesos(uint64(l)) } - if this.Name != nil && that1.Name != nil { - if *this.Name != *that1.Name { - return fmt3.Errorf("Name this(%v) Not Equal that(%v)", *this.Name, *that1.Name) - } - } else if this.Name != nil { - return fmt3.Errorf("this.Name == nil && that.Name != nil") - } else if that1.Name != nil { - return fmt3.Errorf("Name this(%v) Not Equal that(%v)", this.Name, that1.Name) + if m.Revocable != nil { + l = m.Revocable.Size() + n += 1 + l + sovMesos(uint64(l)) } - if this.Source != nil && that1.Source != nil { - if *this.Source != *that1.Source { - return fmt3.Errorf("Source this(%v) Not Equal that(%v)", *this.Source, *that1.Source) - } - } else if this.Source != nil { - return fmt3.Errorf("this.Source == nil && that.Source != nil") - } else if that1.Source != nil { - return fmt3.Errorf("Source this(%v) Not Equal that(%v)", this.Source, that1.Source) + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - if !bytes.Equal(this.Data, that1.Data) { - return fmt3.Errorf("Data this(%v) Not Equal that(%v)", this.Data, that1.Data) + return n +} + +func (m *Resource_ReservationInfo) Size() (n int) { + var l int + _ = l + if m.Principal != nil { + l = len(*m.Principal) + n += 1 + l + sovMesos(uint64(l)) } - 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) + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - return nil + return n } -func (this *ExecutorInfo) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false + +func (m *Resource_DiskInfo) Size() (n int) { + var l int + _ = l + if m.Persistence != nil { + l = m.Persistence.Size() + n += 1 + l + sovMesos(uint64(l)) + } + if m.Volume != nil { + l = m.Volume.Size() + n += 1 + l + sovMesos(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } + return n +} - that1, ok := that.(*ExecutorInfo) - if !ok { - return false +func (m *Resource_DiskInfo_Persistence) Size() (n int) { + var l int + _ = l + if m.Id != nil { + l = len(*m.Id) + n += 1 + l + sovMesos(uint64(l)) } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - if !this.ExecutorId.Equal(that1.ExecutorId) { - return false + return n +} + +func (m *Resource_RevocableInfo) Size() (n int) { + var l int + _ = l + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - if !this.FrameworkId.Equal(that1.FrameworkId) { - return false + return n +} + +func (m *TrafficControlStatistics) Size() (n int) { + var l int + _ = l + if m.Id != nil { + l = len(*m.Id) + n += 1 + l + sovMesos(uint64(l)) } - if !this.Command.Equal(that1.Command) { - return false + if m.Backlog != nil { + n += 1 + sovMesos(uint64(*m.Backlog)) } - if !this.Container.Equal(that1.Container) { - return false + if m.Bytes != nil { + n += 1 + sovMesos(uint64(*m.Bytes)) } - if len(this.Resources) != len(that1.Resources) { - return false + if m.Drops != nil { + n += 1 + sovMesos(uint64(*m.Drops)) } - for i := range this.Resources { - if !this.Resources[i].Equal(that1.Resources[i]) { - return false - } + if m.Overlimits != nil { + n += 1 + sovMesos(uint64(*m.Overlimits)) } - if this.Name != nil && that1.Name != nil { - if *this.Name != *that1.Name { - return false - } - } else if this.Name != nil { - return false - } else if that1.Name != nil { - return false + if m.Packets != nil { + n += 1 + sovMesos(uint64(*m.Packets)) } - if this.Source != nil && that1.Source != nil { - if *this.Source != *that1.Source { - return false - } - } else if this.Source != nil { - return false - } else if that1.Source != nil { - return false + if m.Qlen != nil { + n += 1 + sovMesos(uint64(*m.Qlen)) } - if !bytes.Equal(this.Data, that1.Data) { - return false + if m.Ratebps != nil { + n += 1 + sovMesos(uint64(*m.Ratebps)) } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false + if m.Ratepps != nil { + n += 1 + sovMesos(uint64(*m.Ratepps)) } - return true -} -func (this *MasterInfo) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that == nil && this != nil") + if m.Requeues != nil { + n += 1 + sovMesos(uint64(*m.Requeues)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } + return n +} - that1, ok := that.(*MasterInfo) - if !ok { - return fmt3.Errorf("that is not of type *MasterInfo") +func (m *ResourceStatistics) Size() (n int) { + var l int + _ = l + if m.Timestamp != nil { + n += 9 } - if that1 == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that is type *MasterInfo but is nil && this != nil") - } else if this == nil { - return fmt3.Errorf("that is type *MasterInfobut is not nil && this == nil") + if m.CpusUserTimeSecs != nil { + n += 9 } - if this.Id != nil && that1.Id != nil { - if *this.Id != *that1.Id { - return fmt3.Errorf("Id this(%v) Not Equal that(%v)", *this.Id, *that1.Id) - } - } else if this.Id != nil { - return fmt3.Errorf("this.Id == nil && that.Id != nil") - } else if that1.Id != nil { - return fmt3.Errorf("Id this(%v) Not Equal that(%v)", this.Id, that1.Id) + if m.CpusSystemTimeSecs != nil { + n += 9 } - if this.Ip != nil && that1.Ip != nil { - if *this.Ip != *that1.Ip { - return fmt3.Errorf("Ip this(%v) Not Equal that(%v)", *this.Ip, *that1.Ip) - } - } else if this.Ip != nil { - return fmt3.Errorf("this.Ip == nil && that.Ip != nil") - } else if that1.Ip != nil { - return fmt3.Errorf("Ip this(%v) Not Equal that(%v)", this.Ip, that1.Ip) + if m.CpusLimit != nil { + n += 9 } - if this.Port != nil && that1.Port != nil { - if *this.Port != *that1.Port { - return fmt3.Errorf("Port this(%v) Not Equal that(%v)", *this.Port, *that1.Port) - } - } else if this.Port != nil { - return fmt3.Errorf("this.Port == nil && that.Port != nil") - } else if that1.Port != nil { - return fmt3.Errorf("Port this(%v) Not Equal that(%v)", this.Port, that1.Port) + if m.MemRssBytes != nil { + n += 1 + sovMesos(uint64(*m.MemRssBytes)) } - if this.Pid != nil && that1.Pid != nil { - if *this.Pid != *that1.Pid { - return fmt3.Errorf("Pid this(%v) Not Equal that(%v)", *this.Pid, *that1.Pid) - } - } else if this.Pid != nil { - return fmt3.Errorf("this.Pid == nil && that.Pid != nil") - } else if that1.Pid != nil { - return fmt3.Errorf("Pid this(%v) Not Equal that(%v)", this.Pid, that1.Pid) + if m.MemLimitBytes != nil { + n += 1 + sovMesos(uint64(*m.MemLimitBytes)) } - if this.Hostname != nil && that1.Hostname != nil { - if *this.Hostname != *that1.Hostname { - return fmt3.Errorf("Hostname this(%v) Not Equal that(%v)", *this.Hostname, *that1.Hostname) - } - } else if this.Hostname != nil { - return fmt3.Errorf("this.Hostname == nil && that.Hostname != nil") - } else if that1.Hostname != nil { - return fmt3.Errorf("Hostname this(%v) Not Equal that(%v)", this.Hostname, that1.Hostname) + if m.CpusNrPeriods != nil { + n += 1 + sovMesos(uint64(*m.CpusNrPeriods)) } - 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) + if m.CpusNrThrottled != nil { + n += 1 + sovMesos(uint64(*m.CpusNrThrottled)) } - return nil -} -func (this *MasterInfo) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false + if m.CpusThrottledTimeSecs != nil { + n += 9 + } + if m.MemFileBytes != nil { + n += 1 + sovMesos(uint64(*m.MemFileBytes)) + } + if m.MemAnonBytes != nil { + n += 1 + sovMesos(uint64(*m.MemAnonBytes)) } - - that1, ok := that.(*MasterInfo) - if !ok { - return false + if m.MemMappedFileBytes != nil { + n += 1 + sovMesos(uint64(*m.MemMappedFileBytes)) } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false + if m.Perf != nil { + l = m.Perf.Size() + n += 1 + l + sovMesos(uint64(l)) } - if this.Id != nil && that1.Id != nil { - if *this.Id != *that1.Id { - return false - } - } else if this.Id != nil { - return false - } else if that1.Id != nil { - return false + if m.NetRxPackets != nil { + n += 1 + sovMesos(uint64(*m.NetRxPackets)) } - if this.Ip != nil && that1.Ip != nil { - if *this.Ip != *that1.Ip { - return false - } - } else if this.Ip != nil { - return false - } else if that1.Ip != nil { - return false + if m.NetRxBytes != nil { + n += 1 + sovMesos(uint64(*m.NetRxBytes)) } - if this.Port != nil && that1.Port != nil { - if *this.Port != *that1.Port { - return false - } - } else if this.Port != nil { - return false - } else if that1.Port != nil { - return false + if m.NetRxErrors != nil { + n += 2 + sovMesos(uint64(*m.NetRxErrors)) } - if this.Pid != nil && that1.Pid != nil { - if *this.Pid != *that1.Pid { - return false - } - } else if this.Pid != nil { - return false - } else if that1.Pid != nil { - return false + if m.NetRxDropped != nil { + n += 2 + sovMesos(uint64(*m.NetRxDropped)) } - if this.Hostname != nil && that1.Hostname != nil { - if *this.Hostname != *that1.Hostname { - return false - } - } else if this.Hostname != nil { - return false - } else if that1.Hostname != nil { - return false + if m.NetTxPackets != nil { + n += 2 + sovMesos(uint64(*m.NetTxPackets)) } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false + if m.NetTxBytes != nil { + n += 2 + sovMesos(uint64(*m.NetTxBytes)) } - return true -} -func (this *SlaveInfo) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that == nil && this != nil") + if m.NetTxErrors != nil { + n += 2 + sovMesos(uint64(*m.NetTxErrors)) } - - that1, ok := that.(*SlaveInfo) - if !ok { - return fmt3.Errorf("that is not of type *SlaveInfo") + if m.NetTxDropped != nil { + n += 2 + sovMesos(uint64(*m.NetTxDropped)) } - if that1 == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that is type *SlaveInfo but is nil && this != nil") - } else if this == nil { - return fmt3.Errorf("that is type *SlaveInfobut is not nil && this == nil") + if m.NetTcpRttMicrosecsP50 != nil { + n += 10 } - if this.Hostname != nil && that1.Hostname != nil { - if *this.Hostname != *that1.Hostname { - return fmt3.Errorf("Hostname this(%v) Not Equal that(%v)", *this.Hostname, *that1.Hostname) - } - } else if this.Hostname != nil { - return fmt3.Errorf("this.Hostname == nil && that.Hostname != nil") - } else if that1.Hostname != nil { - return fmt3.Errorf("Hostname this(%v) Not Equal that(%v)", this.Hostname, that1.Hostname) + if m.NetTcpRttMicrosecsP90 != nil { + n += 10 } - if this.Port != nil && that1.Port != nil { - if *this.Port != *that1.Port { - return fmt3.Errorf("Port this(%v) Not Equal that(%v)", *this.Port, *that1.Port) - } - } else if this.Port != nil { - return fmt3.Errorf("this.Port == nil && that.Port != nil") - } else if that1.Port != nil { - return fmt3.Errorf("Port this(%v) Not Equal that(%v)", this.Port, that1.Port) + if m.NetTcpRttMicrosecsP95 != nil { + n += 10 } - if len(this.Resources) != len(that1.Resources) { - return fmt3.Errorf("Resources this(%v) Not Equal that(%v)", len(this.Resources), len(that1.Resources)) + if m.NetTcpRttMicrosecsP99 != nil { + n += 10 } - for i := range this.Resources { - if !this.Resources[i].Equal(that1.Resources[i]) { - return fmt3.Errorf("Resources this[%v](%v) Not Equal that[%v](%v)", i, this.Resources[i], i, that1.Resources[i]) - } + if m.DiskLimitBytes != nil { + n += 2 + sovMesos(uint64(*m.DiskLimitBytes)) } - if len(this.Attributes) != len(that1.Attributes) { - return fmt3.Errorf("Attributes this(%v) Not Equal that(%v)", len(this.Attributes), len(that1.Attributes)) + if m.DiskUsedBytes != nil { + n += 2 + sovMesos(uint64(*m.DiskUsedBytes)) } - for i := range this.Attributes { - if !this.Attributes[i].Equal(that1.Attributes[i]) { - return fmt3.Errorf("Attributes this[%v](%v) Not Equal that[%v](%v)", i, this.Attributes[i], i, that1.Attributes[i]) - } + if m.NetTcpActiveConnections != nil { + n += 10 } - if !this.Id.Equal(that1.Id) { - return fmt3.Errorf("Id this(%v) Not Equal that(%v)", this.Id, that1.Id) + if m.NetTcpTimeWaitConnections != nil { + n += 10 } - if this.Checkpoint != nil && that1.Checkpoint != nil { - if *this.Checkpoint != *that1.Checkpoint { - return fmt3.Errorf("Checkpoint this(%v) Not Equal that(%v)", *this.Checkpoint, *that1.Checkpoint) - } - } else if this.Checkpoint != nil { - return fmt3.Errorf("this.Checkpoint == nil && that.Checkpoint != nil") - } else if that1.Checkpoint != nil { - return fmt3.Errorf("Checkpoint this(%v) Not Equal that(%v)", this.Checkpoint, that1.Checkpoint) + if m.Processes != nil { + n += 2 + sovMesos(uint64(*m.Processes)) } - 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) + if m.Threads != nil { + n += 2 + sovMesos(uint64(*m.Threads)) } - return nil -} -func (this *SlaveInfo) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false + if m.MemLowPressureCounter != nil { + n += 2 + sovMesos(uint64(*m.MemLowPressureCounter)) } - - that1, ok := that.(*SlaveInfo) - if !ok { - return false + if m.MemMediumPressureCounter != nil { + n += 2 + sovMesos(uint64(*m.MemMediumPressureCounter)) } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false + if m.MemCriticalPressureCounter != nil { + n += 2 + sovMesos(uint64(*m.MemCriticalPressureCounter)) } - if this.Hostname != nil && that1.Hostname != nil { - if *this.Hostname != *that1.Hostname { - return false + if len(m.NetTrafficControlStatistics) > 0 { + for _, e := range m.NetTrafficControlStatistics { + l = e.Size() + n += 2 + l + sovMesos(uint64(l)) } - } else if this.Hostname != nil { - return false - } else if that1.Hostname != nil { - return false } - if this.Port != nil && that1.Port != nil { - if *this.Port != *that1.Port { - return false - } - } else if this.Port != nil { - return false - } else if that1.Port != nil { - return false + if m.MemTotalBytes != nil { + n += 2 + sovMesos(uint64(*m.MemTotalBytes)) } - if len(this.Resources) != len(that1.Resources) { - return false + if m.MemTotalMemswBytes != nil { + n += 2 + sovMesos(uint64(*m.MemTotalMemswBytes)) } - for i := range this.Resources { - if !this.Resources[i].Equal(that1.Resources[i]) { - return false - } + if m.MemSoftLimitBytes != nil { + n += 2 + sovMesos(uint64(*m.MemSoftLimitBytes)) } - if len(this.Attributes) != len(that1.Attributes) { - return false + if m.MemCacheBytes != nil { + n += 2 + sovMesos(uint64(*m.MemCacheBytes)) } - for i := range this.Attributes { - if !this.Attributes[i].Equal(that1.Attributes[i]) { - return false - } + if m.MemSwapBytes != nil { + n += 2 + sovMesos(uint64(*m.MemSwapBytes)) } - if !this.Id.Equal(that1.Id) { - return false + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - if this.Checkpoint != nil && that1.Checkpoint != nil { - if *this.Checkpoint != *that1.Checkpoint { - return false + return n +} + +func (m *ResourceUsage) Size() (n int) { + var l int + _ = l + if len(m.Executors) > 0 { + for _, e := range m.Executors { + l = e.Size() + n += 1 + l + sovMesos(uint64(l)) } - } else if this.Checkpoint != nil { - return false - } else if that1.Checkpoint != nil { - return false } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - return true + return n } -func (this *Value) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that == nil && this != nil") - } - that1, ok := that.(*Value) - if !ok { - return fmt3.Errorf("that is not of type *Value") +func (m *ResourceUsage_Executor) Size() (n int) { + var l int + _ = l + if m.ExecutorInfo != nil { + l = m.ExecutorInfo.Size() + n += 1 + l + sovMesos(uint64(l)) } - if that1 == nil { - if this == nil { - return nil + if len(m.Allocated) > 0 { + for _, e := range m.Allocated { + l = e.Size() + n += 1 + l + sovMesos(uint64(l)) } - return fmt3.Errorf("that is type *Value but is nil && this != nil") - } else if this == nil { - return fmt3.Errorf("that is type *Valuebut is not nil && this == nil") } - if this.Type != nil && that1.Type != nil { - if *this.Type != *that1.Type { - return fmt3.Errorf("Type this(%v) Not Equal that(%v)", *this.Type, *that1.Type) - } - } else if this.Type != nil { - return fmt3.Errorf("this.Type == nil && that.Type != nil") - } else if that1.Type != nil { - return fmt3.Errorf("Type this(%v) Not Equal that(%v)", this.Type, that1.Type) + if m.Statistics != nil { + l = m.Statistics.Size() + n += 1 + l + sovMesos(uint64(l)) } - if !this.Scalar.Equal(that1.Scalar) { - return fmt3.Errorf("Scalar this(%v) Not Equal that(%v)", this.Scalar, that1.Scalar) + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - if !this.Ranges.Equal(that1.Ranges) { - return fmt3.Errorf("Ranges this(%v) Not Equal that(%v)", this.Ranges, that1.Ranges) + return n +} + +func (m *PerfStatistics) Size() (n int) { + var l int + _ = l + if m.Timestamp != nil { + n += 9 } - if !this.Set.Equal(that1.Set) { - return fmt3.Errorf("Set this(%v) Not Equal that(%v)", this.Set, that1.Set) + if m.Duration != nil { + n += 9 } - if !this.Text.Equal(that1.Text) { - return fmt3.Errorf("Text this(%v) Not Equal that(%v)", this.Text, that1.Text) + if m.Cycles != nil { + n += 1 + sovMesos(uint64(*m.Cycles)) } - 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) + if m.StalledCyclesFrontend != nil { + n += 1 + sovMesos(uint64(*m.StalledCyclesFrontend)) } - return nil -} -func (this *Value) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false + if m.StalledCyclesBackend != nil { + n += 1 + sovMesos(uint64(*m.StalledCyclesBackend)) } - - that1, ok := that.(*Value) - if !ok { - return false + if m.Instructions != nil { + n += 1 + sovMesos(uint64(*m.Instructions)) } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false + if m.CacheReferences != nil { + n += 1 + sovMesos(uint64(*m.CacheReferences)) } - if this.Type != nil && that1.Type != nil { - if *this.Type != *that1.Type { - return false - } - } else if this.Type != nil { - return false - } else if that1.Type != nil { - return false + if m.CacheMisses != nil { + n += 1 + sovMesos(uint64(*m.CacheMisses)) } - if !this.Scalar.Equal(that1.Scalar) { - return false + if m.Branches != nil { + n += 1 + sovMesos(uint64(*m.Branches)) } - if !this.Ranges.Equal(that1.Ranges) { - return false + if m.BranchMisses != nil { + n += 1 + sovMesos(uint64(*m.BranchMisses)) } - if !this.Set.Equal(that1.Set) { - return false + if m.BusCycles != nil { + n += 1 + sovMesos(uint64(*m.BusCycles)) } - if !this.Text.Equal(that1.Text) { - return false + if m.RefCycles != nil { + n += 1 + sovMesos(uint64(*m.RefCycles)) } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false + if m.CpuClock != nil { + n += 9 } - return true -} -func (this *Value_Scalar) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that == nil && this != nil") + if m.TaskClock != nil { + n += 9 } - - that1, ok := that.(*Value_Scalar) - if !ok { - return fmt3.Errorf("that is not of type *Value_Scalar") + if m.PageFaults != nil { + n += 1 + sovMesos(uint64(*m.PageFaults)) } - if that1 == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that is type *Value_Scalar but is nil && this != nil") - } else if this == nil { - return fmt3.Errorf("that is type *Value_Scalarbut is not nil && this == nil") + if m.MinorFaults != nil { + n += 2 + sovMesos(uint64(*m.MinorFaults)) } - if this.Value != nil && that1.Value != nil { - if *this.Value != *that1.Value { - return fmt3.Errorf("Value this(%v) Not Equal that(%v)", *this.Value, *that1.Value) - } - } else if this.Value != nil { - return fmt3.Errorf("this.Value == nil && that.Value != nil") - } else if that1.Value != nil { - return fmt3.Errorf("Value this(%v) Not Equal that(%v)", this.Value, that1.Value) + if m.MajorFaults != nil { + n += 2 + sovMesos(uint64(*m.MajorFaults)) } - 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) + if m.ContextSwitches != nil { + n += 2 + sovMesos(uint64(*m.ContextSwitches)) } - return nil -} -func (this *Value_Scalar) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false + if m.CpuMigrations != nil { + n += 2 + sovMesos(uint64(*m.CpuMigrations)) } - - that1, ok := that.(*Value_Scalar) - if !ok { - return false + if m.AlignmentFaults != nil { + n += 2 + sovMesos(uint64(*m.AlignmentFaults)) } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false + if m.EmulationFaults != nil { + n += 2 + sovMesos(uint64(*m.EmulationFaults)) } - if this.Value != nil && that1.Value != nil { - if *this.Value != *that1.Value { - return false - } - } else if this.Value != nil { - return false - } else if that1.Value != nil { - return false + if m.L1DcacheLoads != nil { + n += 2 + sovMesos(uint64(*m.L1DcacheLoads)) } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false + if m.L1DcacheLoadMisses != nil { + n += 2 + sovMesos(uint64(*m.L1DcacheLoadMisses)) } - return true -} -func (this *Value_Range) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that == nil && this != nil") + if m.L1DcacheStores != nil { + n += 2 + sovMesos(uint64(*m.L1DcacheStores)) } - - that1, ok := that.(*Value_Range) - if !ok { - return fmt3.Errorf("that is not of type *Value_Range") + if m.L1DcacheStoreMisses != nil { + n += 2 + sovMesos(uint64(*m.L1DcacheStoreMisses)) } - if that1 == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that is type *Value_Range but is nil && this != nil") - } else if this == nil { - return fmt3.Errorf("that is type *Value_Rangebut is not nil && this == nil") + if m.L1DcachePrefetches != nil { + n += 2 + sovMesos(uint64(*m.L1DcachePrefetches)) } - if this.Begin != nil && that1.Begin != nil { - if *this.Begin != *that1.Begin { - return fmt3.Errorf("Begin this(%v) Not Equal that(%v)", *this.Begin, *that1.Begin) - } - } else if this.Begin != nil { - return fmt3.Errorf("this.Begin == nil && that.Begin != nil") - } else if that1.Begin != nil { - return fmt3.Errorf("Begin this(%v) Not Equal that(%v)", this.Begin, that1.Begin) + if m.L1DcachePrefetchMisses != nil { + n += 2 + sovMesos(uint64(*m.L1DcachePrefetchMisses)) } - if this.End != nil && that1.End != nil { - if *this.End != *that1.End { - return fmt3.Errorf("End this(%v) Not Equal that(%v)", *this.End, *that1.End) - } - } else if this.End != nil { - return fmt3.Errorf("this.End == nil && that.End != nil") - } else if that1.End != nil { - return fmt3.Errorf("End this(%v) Not Equal that(%v)", this.End, that1.End) + if m.L1IcacheLoads != nil { + n += 2 + sovMesos(uint64(*m.L1IcacheLoads)) } - 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) + if m.L1IcacheLoadMisses != nil { + n += 2 + sovMesos(uint64(*m.L1IcacheLoadMisses)) } - return nil -} -func (this *Value_Range) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false + if m.L1IcachePrefetches != nil { + n += 2 + sovMesos(uint64(*m.L1IcachePrefetches)) } - - that1, ok := that.(*Value_Range) - if !ok { - return false + if m.L1IcachePrefetchMisses != nil { + n += 2 + sovMesos(uint64(*m.L1IcachePrefetchMisses)) } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false + if m.LlcLoads != nil { + n += 2 + sovMesos(uint64(*m.LlcLoads)) } - if this.Begin != nil && that1.Begin != nil { - if *this.Begin != *that1.Begin { - return false - } - } else if this.Begin != nil { - return false - } else if that1.Begin != nil { - return false + if m.LlcLoadMisses != nil { + n += 2 + sovMesos(uint64(*m.LlcLoadMisses)) } - if this.End != nil && that1.End != nil { - if *this.End != *that1.End { - return false - } - } else if this.End != nil { - return false - } else if that1.End != nil { - return false + if m.LlcStores != nil { + n += 2 + sovMesos(uint64(*m.LlcStores)) } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false + if m.LlcStoreMisses != nil { + n += 2 + sovMesos(uint64(*m.LlcStoreMisses)) } - return true -} -func (this *Value_Ranges) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that == nil && this != nil") + if m.LlcPrefetches != nil { + n += 2 + sovMesos(uint64(*m.LlcPrefetches)) } - - that1, ok := that.(*Value_Ranges) - if !ok { - return fmt3.Errorf("that is not of type *Value_Ranges") + if m.LlcPrefetchMisses != nil { + n += 2 + sovMesos(uint64(*m.LlcPrefetchMisses)) } - if that1 == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that is type *Value_Ranges but is nil && this != nil") - } else if this == nil { - return fmt3.Errorf("that is type *Value_Rangesbut is not nil && this == nil") + if m.DtlbLoads != nil { + n += 2 + sovMesos(uint64(*m.DtlbLoads)) } - if len(this.Range) != len(that1.Range) { - return fmt3.Errorf("Range this(%v) Not Equal that(%v)", len(this.Range), len(that1.Range)) + if m.DtlbLoadMisses != nil { + n += 2 + sovMesos(uint64(*m.DtlbLoadMisses)) } - for i := range this.Range { - if !this.Range[i].Equal(that1.Range[i]) { - return fmt3.Errorf("Range this[%v](%v) Not Equal that[%v](%v)", i, this.Range[i], i, that1.Range[i]) - } + if m.DtlbStores != nil { + n += 2 + sovMesos(uint64(*m.DtlbStores)) } - 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) + if m.DtlbStoreMisses != nil { + n += 2 + sovMesos(uint64(*m.DtlbStoreMisses)) } - return nil -} -func (this *Value_Ranges) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false + if m.DtlbPrefetches != nil { + n += 2 + sovMesos(uint64(*m.DtlbPrefetches)) } - - that1, ok := that.(*Value_Ranges) - if !ok { - return false + if m.DtlbPrefetchMisses != nil { + n += 2 + sovMesos(uint64(*m.DtlbPrefetchMisses)) } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false + if m.ItlbLoads != nil { + n += 2 + sovMesos(uint64(*m.ItlbLoads)) + } + if m.ItlbLoadMisses != nil { + n += 2 + sovMesos(uint64(*m.ItlbLoadMisses)) } - if len(this.Range) != len(that1.Range) { - return false + if m.BranchLoads != nil { + n += 2 + sovMesos(uint64(*m.BranchLoads)) } - for i := range this.Range { - if !this.Range[i].Equal(that1.Range[i]) { - return false - } + if m.BranchLoadMisses != nil { + n += 2 + sovMesos(uint64(*m.BranchLoadMisses)) } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false + if m.NodeLoads != nil { + n += 2 + sovMesos(uint64(*m.NodeLoads)) } - return true -} -func (this *Value_Set) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that == nil && this != nil") + if m.NodeLoadMisses != nil { + n += 2 + sovMesos(uint64(*m.NodeLoadMisses)) } - - that1, ok := that.(*Value_Set) - if !ok { - return fmt3.Errorf("that is not of type *Value_Set") + if m.NodeStores != nil { + n += 2 + sovMesos(uint64(*m.NodeStores)) } - if that1 == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that is type *Value_Set but is nil && this != nil") - } else if this == nil { - return fmt3.Errorf("that is type *Value_Setbut is not nil && this == nil") + if m.NodeStoreMisses != nil { + n += 2 + sovMesos(uint64(*m.NodeStoreMisses)) } - if len(this.Item) != len(that1.Item) { - return fmt3.Errorf("Item this(%v) Not Equal that(%v)", len(this.Item), len(that1.Item)) + if m.NodePrefetches != nil { + n += 2 + sovMesos(uint64(*m.NodePrefetches)) } - for i := range this.Item { - if this.Item[i] != that1.Item[i] { - return fmt3.Errorf("Item this[%v](%v) Not Equal that[%v](%v)", i, this.Item[i], i, that1.Item[i]) - } + if m.NodePrefetchMisses != nil { + n += 2 + sovMesos(uint64(*m.NodePrefetchMisses)) } - 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) + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - return nil + return n } -func (this *Value_Set) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - that1, ok := that.(*Value_Set) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if len(this.Item) != len(that1.Item) { - return false +func (m *Request) Size() (n int) { + var l int + _ = l + if m.SlaveId != nil { + l = m.SlaveId.Size() + n += 1 + l + sovMesos(uint64(l)) } - for i := range this.Item { - if this.Item[i] != that1.Item[i] { - return false + if len(m.Resources) > 0 { + for _, e := range m.Resources { + l = e.Size() + n += 1 + l + sovMesos(uint64(l)) } } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - return true + return n } -func (this *Value_Text) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that == nil && this != nil") - } - that1, ok := that.(*Value_Text) - if !ok { - return fmt3.Errorf("that is not of type *Value_Text") +func (m *Offer) Size() (n int) { + var l int + _ = l + if m.Id != nil { + l = m.Id.Size() + n += 1 + l + sovMesos(uint64(l)) } - if that1 == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that is type *Value_Text but is nil && this != nil") - } else if this == nil { - return fmt3.Errorf("that is type *Value_Textbut is not nil && this == nil") + if m.FrameworkId != nil { + l = m.FrameworkId.Size() + n += 1 + l + sovMesos(uint64(l)) } - if this.Value != nil && that1.Value != nil { - if *this.Value != *that1.Value { - return fmt3.Errorf("Value this(%v) Not Equal that(%v)", *this.Value, *that1.Value) - } - } else if this.Value != nil { - return fmt3.Errorf("this.Value == nil && that.Value != nil") - } else if that1.Value != nil { - return fmt3.Errorf("Value this(%v) Not Equal that(%v)", this.Value, that1.Value) + if m.SlaveId != nil { + l = m.SlaveId.Size() + n += 1 + l + sovMesos(uint64(l)) } - 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) + if m.Hostname != nil { + l = len(*m.Hostname) + n += 1 + l + sovMesos(uint64(l)) } - return nil -} -func (this *Value_Text) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true + if len(m.Resources) > 0 { + for _, e := range m.Resources { + l = e.Size() + n += 1 + l + sovMesos(uint64(l)) } - return false - } - - that1, ok := that.(*Value_Text) - if !ok { - return false } - if that1 == nil { - if this == nil { - return true + if len(m.ExecutorIds) > 0 { + for _, e := range m.ExecutorIds { + l = e.Size() + n += 1 + l + sovMesos(uint64(l)) } - return false - } else if this == nil { - return false } - if this.Value != nil && that1.Value != nil { - if *this.Value != *that1.Value { - return false + if len(m.Attributes) > 0 { + for _, e := range m.Attributes { + l = e.Size() + n += 1 + l + sovMesos(uint64(l)) } - } else if this.Value != nil { - return false - } else if that1.Value != nil { - return false } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - return true + return n } -func (this *Attribute) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that == nil && this != nil") - } - that1, ok := that.(*Attribute) - if !ok { - return fmt3.Errorf("that is not of type *Attribute") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that is type *Attribute but is nil && this != nil") - } else if this == nil { - return fmt3.Errorf("that is type *Attributebut is not nil && this == nil") - } - if this.Name != nil && that1.Name != nil { - if *this.Name != *that1.Name { - return fmt3.Errorf("Name this(%v) Not Equal that(%v)", *this.Name, *that1.Name) - } - } else if this.Name != nil { - return fmt3.Errorf("this.Name == nil && that.Name != nil") - } else if that1.Name != nil { - return fmt3.Errorf("Name this(%v) Not Equal that(%v)", this.Name, that1.Name) +func (m *Offer_Operation) Size() (n int) { + var l int + _ = l + if m.Type != nil { + n += 1 + sovMesos(uint64(*m.Type)) } - if this.Type != nil && that1.Type != nil { - if *this.Type != *that1.Type { - return fmt3.Errorf("Type this(%v) Not Equal that(%v)", *this.Type, *that1.Type) - } - } else if this.Type != nil { - return fmt3.Errorf("this.Type == nil && that.Type != nil") - } else if that1.Type != nil { - return fmt3.Errorf("Type this(%v) Not Equal that(%v)", this.Type, that1.Type) + if m.Launch != nil { + l = m.Launch.Size() + n += 1 + l + sovMesos(uint64(l)) } - if !this.Scalar.Equal(that1.Scalar) { - return fmt3.Errorf("Scalar this(%v) Not Equal that(%v)", this.Scalar, that1.Scalar) + if m.Reserve != nil { + l = m.Reserve.Size() + n += 1 + l + sovMesos(uint64(l)) } - if !this.Ranges.Equal(that1.Ranges) { - return fmt3.Errorf("Ranges this(%v) Not Equal that(%v)", this.Ranges, that1.Ranges) + if m.Unreserve != nil { + l = m.Unreserve.Size() + n += 1 + l + sovMesos(uint64(l)) } - if !this.Set.Equal(that1.Set) { - return fmt3.Errorf("Set this(%v) Not Equal that(%v)", this.Set, that1.Set) + if m.Create != nil { + l = m.Create.Size() + n += 1 + l + sovMesos(uint64(l)) } - if !this.Text.Equal(that1.Text) { - return fmt3.Errorf("Text this(%v) Not Equal that(%v)", this.Text, that1.Text) + if m.Destroy != nil { + l = m.Destroy.Size() + n += 1 + l + sovMesos(uint64(l)) } - 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) + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - return nil + return n } -func (this *Attribute) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - that1, ok := that.(*Attribute) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true +func (m *Offer_Operation_Launch) Size() (n int) { + var l int + _ = l + if len(m.TaskInfos) > 0 { + for _, e := range m.TaskInfos { + l = e.Size() + n += 1 + l + sovMesos(uint64(l)) } - return false - } else if this == nil { - return false } - if this.Name != nil && that1.Name != nil { - if *this.Name != *that1.Name { - return false - } - } else if this.Name != nil { - return false - } else if that1.Name != nil { - return false + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - if this.Type != nil && that1.Type != nil { - if *this.Type != *that1.Type { - return false - } - } else if this.Type != nil { - return false - } else if that1.Type != nil { - return false + return n +} + +func (m *Offer_Operation_Reserve) Size() (n int) { + var l int + _ = l + if len(m.Resources) > 0 { + for _, e := range m.Resources { + l = e.Size() + n += 1 + l + sovMesos(uint64(l)) + } } - if !this.Scalar.Equal(that1.Scalar) { - return false + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - if !this.Ranges.Equal(that1.Ranges) { - return false + return n +} + +func (m *Offer_Operation_Unreserve) Size() (n int) { + var l int + _ = l + if len(m.Resources) > 0 { + for _, e := range m.Resources { + l = e.Size() + n += 1 + l + sovMesos(uint64(l)) + } } - if !this.Set.Equal(that1.Set) { - return false + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - if !this.Text.Equal(that1.Text) { - return false + return n +} + +func (m *Offer_Operation_Create) Size() (n int) { + var l int + _ = l + if len(m.Volumes) > 0 { + for _, e := range m.Volumes { + l = e.Size() + n += 1 + l + sovMesos(uint64(l)) + } } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - return true + return n } -func (this *Resource) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil + +func (m *Offer_Operation_Destroy) Size() (n int) { + var l int + _ = l + if len(m.Volumes) > 0 { + for _, e := range m.Volumes { + l = e.Size() + n += 1 + l + sovMesos(uint64(l)) } - return fmt3.Errorf("that == nil && this != nil") } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} - that1, ok := that.(*Resource) - if !ok { - return fmt3.Errorf("that is not of type *Resource") +func (m *TaskInfo) Size() (n int) { + var l int + _ = l + if m.Name != nil { + l = len(*m.Name) + n += 1 + l + sovMesos(uint64(l)) } - if that1 == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that is type *Resource but is nil && this != nil") - } else if this == nil { - return fmt3.Errorf("that is type *Resourcebut is not nil && this == nil") + if m.TaskId != nil { + l = m.TaskId.Size() + n += 1 + l + sovMesos(uint64(l)) } - if this.Name != nil && that1.Name != nil { - if *this.Name != *that1.Name { - return fmt3.Errorf("Name this(%v) Not Equal that(%v)", *this.Name, *that1.Name) - } - } else if this.Name != nil { - return fmt3.Errorf("this.Name == nil && that.Name != nil") - } else if that1.Name != nil { - return fmt3.Errorf("Name this(%v) Not Equal that(%v)", this.Name, that1.Name) + if m.SlaveId != nil { + l = m.SlaveId.Size() + n += 1 + l + sovMesos(uint64(l)) } - if this.Type != nil && that1.Type != nil { - if *this.Type != *that1.Type { - return fmt3.Errorf("Type this(%v) Not Equal that(%v)", *this.Type, *that1.Type) + if len(m.Resources) > 0 { + for _, e := range m.Resources { + l = e.Size() + n += 1 + l + sovMesos(uint64(l)) } - } else if this.Type != nil { - return fmt3.Errorf("this.Type == nil && that.Type != nil") - } else if that1.Type != nil { - return fmt3.Errorf("Type this(%v) Not Equal that(%v)", this.Type, that1.Type) } - if !this.Scalar.Equal(that1.Scalar) { - return fmt3.Errorf("Scalar this(%v) Not Equal that(%v)", this.Scalar, that1.Scalar) + if m.Executor != nil { + l = m.Executor.Size() + n += 1 + l + sovMesos(uint64(l)) } - if !this.Ranges.Equal(that1.Ranges) { - return fmt3.Errorf("Ranges this(%v) Not Equal that(%v)", this.Ranges, that1.Ranges) + if m.Data != nil { + l = len(m.Data) + n += 1 + l + sovMesos(uint64(l)) } - if !this.Set.Equal(that1.Set) { - return fmt3.Errorf("Set this(%v) Not Equal that(%v)", this.Set, that1.Set) + if m.Command != nil { + l = m.Command.Size() + n += 1 + l + sovMesos(uint64(l)) } - if this.Role != nil && that1.Role != nil { - if *this.Role != *that1.Role { - return fmt3.Errorf("Role this(%v) Not Equal that(%v)", *this.Role, *that1.Role) - } - } else if this.Role != nil { - return fmt3.Errorf("this.Role == nil && that.Role != nil") - } else if that1.Role != nil { - return fmt3.Errorf("Role this(%v) Not Equal that(%v)", this.Role, that1.Role) + if m.HealthCheck != nil { + l = m.HealthCheck.Size() + n += 1 + l + sovMesos(uint64(l)) } - 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) + if m.Container != nil { + l = m.Container.Size() + n += 1 + l + sovMesos(uint64(l)) } - return nil -} -func (this *Resource) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false + if m.Labels != nil { + l = m.Labels.Size() + n += 1 + l + sovMesos(uint64(l)) + } + if m.Discovery != nil { + l = m.Discovery.Size() + n += 1 + l + sovMesos(uint64(l)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} - that1, ok := that.(*Resource) - if !ok { - return false +func (m *TaskStatus) Size() (n int) { + var l int + _ = l + if m.TaskId != nil { + l = m.TaskId.Size() + n += 1 + l + sovMesos(uint64(l)) } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false + if m.State != nil { + n += 1 + sovMesos(uint64(*m.State)) } - if this.Name != nil && that1.Name != nil { - if *this.Name != *that1.Name { - return false - } - } else if this.Name != nil { - return false - } else if that1.Name != nil { - return false + if m.Data != nil { + l = len(m.Data) + n += 1 + l + sovMesos(uint64(l)) } - if this.Type != nil && that1.Type != nil { - if *this.Type != *that1.Type { - return false - } - } else if this.Type != nil { - return false - } else if that1.Type != nil { - return false + if m.Message != nil { + l = len(*m.Message) + n += 1 + l + sovMesos(uint64(l)) } - if !this.Scalar.Equal(that1.Scalar) { - return false + if m.SlaveId != nil { + l = m.SlaveId.Size() + n += 1 + l + sovMesos(uint64(l)) } - if !this.Ranges.Equal(that1.Ranges) { - return false + if m.Timestamp != nil { + n += 9 } - if !this.Set.Equal(that1.Set) { - return false + if m.ExecutorId != nil { + l = m.ExecutorId.Size() + n += 1 + l + sovMesos(uint64(l)) } - if this.Role != nil && that1.Role != nil { - if *this.Role != *that1.Role { - return false - } - } else if this.Role != nil { - return false - } else if that1.Role != nil { - return false + if m.Healthy != nil { + n += 2 } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false + if m.Source != nil { + n += 1 + sovMesos(uint64(*m.Source)) } - return true -} -func (this *ResourceStatistics) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that == nil && this != nil") + if m.Reason != nil { + n += 1 + sovMesos(uint64(*m.Reason)) + } + if m.Uuid != nil { + l = len(m.Uuid) + n += 1 + l + sovMesos(uint64(l)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} - that1, ok := that.(*ResourceStatistics) - if !ok { - return fmt3.Errorf("that is not of type *ResourceStatistics") +func (m *Filters) Size() (n int) { + var l int + _ = l + if m.RefuseSeconds != nil { + n += 9 } - if that1 == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that is type *ResourceStatistics but is nil && this != nil") - } else if this == nil { - return fmt3.Errorf("that is type *ResourceStatisticsbut is not nil && this == nil") + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - if this.Timestamp != nil && that1.Timestamp != nil { - if *this.Timestamp != *that1.Timestamp { - return fmt3.Errorf("Timestamp this(%v) Not Equal that(%v)", *this.Timestamp, *that1.Timestamp) + return n +} + +func (m *Environment) Size() (n int) { + var l int + _ = l + if len(m.Variables) > 0 { + for _, e := range m.Variables { + l = e.Size() + n += 1 + l + sovMesos(uint64(l)) } - } else if this.Timestamp != nil { - return fmt3.Errorf("this.Timestamp == nil && that.Timestamp != nil") - } else if that1.Timestamp != nil { - return fmt3.Errorf("Timestamp this(%v) Not Equal that(%v)", this.Timestamp, that1.Timestamp) } - if this.CpusUserTimeSecs != nil && that1.CpusUserTimeSecs != nil { - if *this.CpusUserTimeSecs != *that1.CpusUserTimeSecs { - return fmt3.Errorf("CpusUserTimeSecs this(%v) Not Equal that(%v)", *this.CpusUserTimeSecs, *that1.CpusUserTimeSecs) - } - } else if this.CpusUserTimeSecs != nil { - return fmt3.Errorf("this.CpusUserTimeSecs == nil && that.CpusUserTimeSecs != nil") - } else if that1.CpusUserTimeSecs != nil { - return fmt3.Errorf("CpusUserTimeSecs this(%v) Not Equal that(%v)", this.CpusUserTimeSecs, that1.CpusUserTimeSecs) + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *Environment_Variable) Size() (n int) { + var l int + _ = l + if m.Name != nil { + l = len(*m.Name) + n += 1 + l + sovMesos(uint64(l)) } - if this.CpusSystemTimeSecs != nil && that1.CpusSystemTimeSecs != nil { - if *this.CpusSystemTimeSecs != *that1.CpusSystemTimeSecs { - return fmt3.Errorf("CpusSystemTimeSecs this(%v) Not Equal that(%v)", *this.CpusSystemTimeSecs, *that1.CpusSystemTimeSecs) - } - } else if this.CpusSystemTimeSecs != nil { - return fmt3.Errorf("this.CpusSystemTimeSecs == nil && that.CpusSystemTimeSecs != nil") - } else if that1.CpusSystemTimeSecs != nil { - return fmt3.Errorf("CpusSystemTimeSecs this(%v) Not Equal that(%v)", this.CpusSystemTimeSecs, that1.CpusSystemTimeSecs) + if m.Value != nil { + l = len(*m.Value) + n += 1 + l + sovMesos(uint64(l)) } - if this.CpusLimit != nil && that1.CpusLimit != nil { - if *this.CpusLimit != *that1.CpusLimit { - return fmt3.Errorf("CpusLimit this(%v) Not Equal that(%v)", *this.CpusLimit, *that1.CpusLimit) - } - } else if this.CpusLimit != nil { - return fmt3.Errorf("this.CpusLimit == nil && that.CpusLimit != nil") - } else if that1.CpusLimit != nil { - return fmt3.Errorf("CpusLimit this(%v) Not Equal that(%v)", this.CpusLimit, that1.CpusLimit) + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - if this.CpusNrPeriods != nil && that1.CpusNrPeriods != nil { - if *this.CpusNrPeriods != *that1.CpusNrPeriods { - return fmt3.Errorf("CpusNrPeriods this(%v) Not Equal that(%v)", *this.CpusNrPeriods, *that1.CpusNrPeriods) - } - } else if this.CpusNrPeriods != nil { - return fmt3.Errorf("this.CpusNrPeriods == nil && that.CpusNrPeriods != nil") - } else if that1.CpusNrPeriods != nil { - return fmt3.Errorf("CpusNrPeriods this(%v) Not Equal that(%v)", this.CpusNrPeriods, that1.CpusNrPeriods) + return n +} + +func (m *Parameter) Size() (n int) { + var l int + _ = l + if m.Key != nil { + l = len(*m.Key) + n += 1 + l + sovMesos(uint64(l)) } - if this.CpusNrThrottled != nil && that1.CpusNrThrottled != nil { - if *this.CpusNrThrottled != *that1.CpusNrThrottled { - return fmt3.Errorf("CpusNrThrottled this(%v) Not Equal that(%v)", *this.CpusNrThrottled, *that1.CpusNrThrottled) - } - } else if this.CpusNrThrottled != nil { - return fmt3.Errorf("this.CpusNrThrottled == nil && that.CpusNrThrottled != nil") - } else if that1.CpusNrThrottled != nil { - return fmt3.Errorf("CpusNrThrottled this(%v) Not Equal that(%v)", this.CpusNrThrottled, that1.CpusNrThrottled) + if m.Value != nil { + l = len(*m.Value) + n += 1 + l + sovMesos(uint64(l)) } - if this.CpusThrottledTimeSecs != nil && that1.CpusThrottledTimeSecs != nil { - if *this.CpusThrottledTimeSecs != *that1.CpusThrottledTimeSecs { - return fmt3.Errorf("CpusThrottledTimeSecs this(%v) Not Equal that(%v)", *this.CpusThrottledTimeSecs, *that1.CpusThrottledTimeSecs) - } - } else if this.CpusThrottledTimeSecs != nil { - return fmt3.Errorf("this.CpusThrottledTimeSecs == nil && that.CpusThrottledTimeSecs != nil") - } else if that1.CpusThrottledTimeSecs != nil { - return fmt3.Errorf("CpusThrottledTimeSecs this(%v) Not Equal that(%v)", this.CpusThrottledTimeSecs, that1.CpusThrottledTimeSecs) + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - if this.MemRssBytes != nil && that1.MemRssBytes != nil { - if *this.MemRssBytes != *that1.MemRssBytes { - return fmt3.Errorf("MemRssBytes this(%v) Not Equal that(%v)", *this.MemRssBytes, *that1.MemRssBytes) + return n +} + +func (m *Parameters) Size() (n int) { + var l int + _ = l + if len(m.Parameter) > 0 { + for _, e := range m.Parameter { + l = e.Size() + n += 1 + l + sovMesos(uint64(l)) } - } else if this.MemRssBytes != nil { - return fmt3.Errorf("this.MemRssBytes == nil && that.MemRssBytes != nil") - } else if that1.MemRssBytes != nil { - return fmt3.Errorf("MemRssBytes this(%v) Not Equal that(%v)", this.MemRssBytes, that1.MemRssBytes) } - if this.MemLimitBytes != nil && that1.MemLimitBytes != nil { - if *this.MemLimitBytes != *that1.MemLimitBytes { - return fmt3.Errorf("MemLimitBytes this(%v) Not Equal that(%v)", *this.MemLimitBytes, *that1.MemLimitBytes) - } - } else if this.MemLimitBytes != nil { - return fmt3.Errorf("this.MemLimitBytes == nil && that.MemLimitBytes != nil") - } else if that1.MemLimitBytes != nil { - return fmt3.Errorf("MemLimitBytes this(%v) Not Equal that(%v)", this.MemLimitBytes, that1.MemLimitBytes) + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - if this.MemFileBytes != nil && that1.MemFileBytes != nil { - if *this.MemFileBytes != *that1.MemFileBytes { - return fmt3.Errorf("MemFileBytes this(%v) Not Equal that(%v)", *this.MemFileBytes, *that1.MemFileBytes) - } - } else if this.MemFileBytes != nil { - return fmt3.Errorf("this.MemFileBytes == nil && that.MemFileBytes != nil") - } else if that1.MemFileBytes != nil { - return fmt3.Errorf("MemFileBytes this(%v) Not Equal that(%v)", this.MemFileBytes, that1.MemFileBytes) + return n +} + +func (m *Credential) Size() (n int) { + var l int + _ = l + if m.Principal != nil { + l = len(*m.Principal) + n += 1 + l + sovMesos(uint64(l)) } - if this.MemAnonBytes != nil && that1.MemAnonBytes != nil { - if *this.MemAnonBytes != *that1.MemAnonBytes { - return fmt3.Errorf("MemAnonBytes this(%v) Not Equal that(%v)", *this.MemAnonBytes, *that1.MemAnonBytes) - } - } else if this.MemAnonBytes != nil { - return fmt3.Errorf("this.MemAnonBytes == nil && that.MemAnonBytes != nil") - } else if that1.MemAnonBytes != nil { - return fmt3.Errorf("MemAnonBytes this(%v) Not Equal that(%v)", this.MemAnonBytes, that1.MemAnonBytes) + if m.Secret != nil { + l = len(m.Secret) + n += 1 + l + sovMesos(uint64(l)) } - if this.MemMappedFileBytes != nil && that1.MemMappedFileBytes != nil { - if *this.MemMappedFileBytes != *that1.MemMappedFileBytes { - return fmt3.Errorf("MemMappedFileBytes this(%v) Not Equal that(%v)", *this.MemMappedFileBytes, *that1.MemMappedFileBytes) + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *Credentials) Size() (n int) { + var l int + _ = l + if len(m.Credentials) > 0 { + for _, e := range m.Credentials { + l = e.Size() + n += 1 + l + sovMesos(uint64(l)) } - } else if this.MemMappedFileBytes != nil { - return fmt3.Errorf("this.MemMappedFileBytes == nil && that.MemMappedFileBytes != nil") - } else if that1.MemMappedFileBytes != nil { - return fmt3.Errorf("MemMappedFileBytes this(%v) Not Equal that(%v)", this.MemMappedFileBytes, that1.MemMappedFileBytes) } - if !this.Perf.Equal(that1.Perf) { - return fmt3.Errorf("Perf this(%v) Not Equal that(%v)", this.Perf, that1.Perf) + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - if this.NetRxPackets != nil && that1.NetRxPackets != nil { - if *this.NetRxPackets != *that1.NetRxPackets { - return fmt3.Errorf("NetRxPackets this(%v) Not Equal that(%v)", *this.NetRxPackets, *that1.NetRxPackets) - } - } else if this.NetRxPackets != nil { - return fmt3.Errorf("this.NetRxPackets == nil && that.NetRxPackets != nil") - } else if that1.NetRxPackets != nil { - return fmt3.Errorf("NetRxPackets this(%v) Not Equal that(%v)", this.NetRxPackets, that1.NetRxPackets) + return n +} + +func (m *ACL) Size() (n int) { + var l int + _ = l + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - if this.NetRxBytes != nil && that1.NetRxBytes != nil { - if *this.NetRxBytes != *that1.NetRxBytes { - return fmt3.Errorf("NetRxBytes this(%v) Not Equal that(%v)", *this.NetRxBytes, *that1.NetRxBytes) - } - } else if this.NetRxBytes != nil { - return fmt3.Errorf("this.NetRxBytes == nil && that.NetRxBytes != nil") - } else if that1.NetRxBytes != nil { - return fmt3.Errorf("NetRxBytes this(%v) Not Equal that(%v)", this.NetRxBytes, that1.NetRxBytes) + return n +} + +func (m *ACL_Entity) Size() (n int) { + var l int + _ = l + if m.Type != nil { + n += 1 + sovMesos(uint64(*m.Type)) } - if this.NetRxErrors != nil && that1.NetRxErrors != nil { - if *this.NetRxErrors != *that1.NetRxErrors { - return fmt3.Errorf("NetRxErrors this(%v) Not Equal that(%v)", *this.NetRxErrors, *that1.NetRxErrors) + if len(m.Values) > 0 { + for _, s := range m.Values { + l = len(s) + n += 1 + l + sovMesos(uint64(l)) } - } else if this.NetRxErrors != nil { - return fmt3.Errorf("this.NetRxErrors == nil && that.NetRxErrors != nil") - } else if that1.NetRxErrors != nil { - return fmt3.Errorf("NetRxErrors this(%v) Not Equal that(%v)", this.NetRxErrors, that1.NetRxErrors) } - if this.NetRxDropped != nil && that1.NetRxDropped != nil { - if *this.NetRxDropped != *that1.NetRxDropped { - return fmt3.Errorf("NetRxDropped this(%v) Not Equal that(%v)", *this.NetRxDropped, *that1.NetRxDropped) - } - } else if this.NetRxDropped != nil { - return fmt3.Errorf("this.NetRxDropped == nil && that.NetRxDropped != nil") - } else if that1.NetRxDropped != nil { - return fmt3.Errorf("NetRxDropped this(%v) Not Equal that(%v)", this.NetRxDropped, that1.NetRxDropped) + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - if this.NetTxPackets != nil && that1.NetTxPackets != nil { - if *this.NetTxPackets != *that1.NetTxPackets { - return fmt3.Errorf("NetTxPackets this(%v) Not Equal that(%v)", *this.NetTxPackets, *that1.NetTxPackets) - } - } else if this.NetTxPackets != nil { - return fmt3.Errorf("this.NetTxPackets == nil && that.NetTxPackets != nil") - } else if that1.NetTxPackets != nil { - return fmt3.Errorf("NetTxPackets this(%v) Not Equal that(%v)", this.NetTxPackets, that1.NetTxPackets) + return n +} + +func (m *ACL_RegisterFramework) Size() (n int) { + var l int + _ = l + if m.Principals != nil { + l = m.Principals.Size() + n += 1 + l + sovMesos(uint64(l)) } - if this.NetTxBytes != nil && that1.NetTxBytes != nil { - if *this.NetTxBytes != *that1.NetTxBytes { - return fmt3.Errorf("NetTxBytes this(%v) Not Equal that(%v)", *this.NetTxBytes, *that1.NetTxBytes) - } - } else if this.NetTxBytes != nil { - return fmt3.Errorf("this.NetTxBytes == nil && that.NetTxBytes != nil") - } else if that1.NetTxBytes != nil { - return fmt3.Errorf("NetTxBytes this(%v) Not Equal that(%v)", this.NetTxBytes, that1.NetTxBytes) + if m.Roles != nil { + l = m.Roles.Size() + n += 1 + l + sovMesos(uint64(l)) } - if this.NetTxErrors != nil && that1.NetTxErrors != nil { - if *this.NetTxErrors != *that1.NetTxErrors { - return fmt3.Errorf("NetTxErrors this(%v) Not Equal that(%v)", *this.NetTxErrors, *that1.NetTxErrors) - } - } else if this.NetTxErrors != nil { - return fmt3.Errorf("this.NetTxErrors == nil && that.NetTxErrors != nil") - } else if that1.NetTxErrors != nil { - return fmt3.Errorf("NetTxErrors this(%v) Not Equal that(%v)", this.NetTxErrors, that1.NetTxErrors) + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - if this.NetTxDropped != nil && that1.NetTxDropped != nil { - if *this.NetTxDropped != *that1.NetTxDropped { - return fmt3.Errorf("NetTxDropped this(%v) Not Equal that(%v)", *this.NetTxDropped, *that1.NetTxDropped) - } - } else if this.NetTxDropped != nil { - return fmt3.Errorf("this.NetTxDropped == nil && that.NetTxDropped != nil") - } else if that1.NetTxDropped != nil { - return fmt3.Errorf("NetTxDropped this(%v) Not Equal that(%v)", this.NetTxDropped, that1.NetTxDropped) + return n +} + +func (m *ACL_RunTask) Size() (n int) { + var l int + _ = l + if m.Principals != nil { + l = m.Principals.Size() + n += 1 + l + sovMesos(uint64(l)) } - if this.NetTcpRttMicrosecsP50 != nil && that1.NetTcpRttMicrosecsP50 != nil { - if *this.NetTcpRttMicrosecsP50 != *that1.NetTcpRttMicrosecsP50 { - return fmt3.Errorf("NetTcpRttMicrosecsP50 this(%v) Not Equal that(%v)", *this.NetTcpRttMicrosecsP50, *that1.NetTcpRttMicrosecsP50) - } - } else if this.NetTcpRttMicrosecsP50 != nil { - return fmt3.Errorf("this.NetTcpRttMicrosecsP50 == nil && that.NetTcpRttMicrosecsP50 != nil") - } else if that1.NetTcpRttMicrosecsP50 != nil { - return fmt3.Errorf("NetTcpRttMicrosecsP50 this(%v) Not Equal that(%v)", this.NetTcpRttMicrosecsP50, that1.NetTcpRttMicrosecsP50) + if m.Users != nil { + l = m.Users.Size() + n += 1 + l + sovMesos(uint64(l)) } - if this.NetTcpRttMicrosecsP90 != nil && that1.NetTcpRttMicrosecsP90 != nil { - if *this.NetTcpRttMicrosecsP90 != *that1.NetTcpRttMicrosecsP90 { - return fmt3.Errorf("NetTcpRttMicrosecsP90 this(%v) Not Equal that(%v)", *this.NetTcpRttMicrosecsP90, *that1.NetTcpRttMicrosecsP90) - } - } else if this.NetTcpRttMicrosecsP90 != nil { - return fmt3.Errorf("this.NetTcpRttMicrosecsP90 == nil && that.NetTcpRttMicrosecsP90 != nil") - } else if that1.NetTcpRttMicrosecsP90 != nil { - return fmt3.Errorf("NetTcpRttMicrosecsP90 this(%v) Not Equal that(%v)", this.NetTcpRttMicrosecsP90, that1.NetTcpRttMicrosecsP90) + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - if this.NetTcpRttMicrosecsP95 != nil && that1.NetTcpRttMicrosecsP95 != nil { - if *this.NetTcpRttMicrosecsP95 != *that1.NetTcpRttMicrosecsP95 { - return fmt3.Errorf("NetTcpRttMicrosecsP95 this(%v) Not Equal that(%v)", *this.NetTcpRttMicrosecsP95, *that1.NetTcpRttMicrosecsP95) - } - } else if this.NetTcpRttMicrosecsP95 != nil { - return fmt3.Errorf("this.NetTcpRttMicrosecsP95 == nil && that.NetTcpRttMicrosecsP95 != nil") - } else if that1.NetTcpRttMicrosecsP95 != nil { - return fmt3.Errorf("NetTcpRttMicrosecsP95 this(%v) Not Equal that(%v)", this.NetTcpRttMicrosecsP95, that1.NetTcpRttMicrosecsP95) + return n +} + +func (m *ACL_ShutdownFramework) Size() (n int) { + var l int + _ = l + if m.Principals != nil { + l = m.Principals.Size() + n += 1 + l + sovMesos(uint64(l)) } - if this.NetTcpRttMicrosecsP99 != nil && that1.NetTcpRttMicrosecsP99 != nil { - if *this.NetTcpRttMicrosecsP99 != *that1.NetTcpRttMicrosecsP99 { - return fmt3.Errorf("NetTcpRttMicrosecsP99 this(%v) Not Equal that(%v)", *this.NetTcpRttMicrosecsP99, *that1.NetTcpRttMicrosecsP99) - } - } else if this.NetTcpRttMicrosecsP99 != nil { - return fmt3.Errorf("this.NetTcpRttMicrosecsP99 == nil && that.NetTcpRttMicrosecsP99 != nil") - } else if that1.NetTcpRttMicrosecsP99 != nil { - return fmt3.Errorf("NetTcpRttMicrosecsP99 this(%v) Not Equal that(%v)", this.NetTcpRttMicrosecsP99, that1.NetTcpRttMicrosecsP99) + if m.FrameworkPrincipals != nil { + l = m.FrameworkPrincipals.Size() + n += 1 + l + sovMesos(uint64(l)) } - 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) + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - return nil + return n } -func (this *ResourceStatistics) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - that1, ok := that.(*ResourceStatistics) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false +func (m *ACLs) Size() (n int) { + var l int + _ = l + if m.Permissive != nil { + n += 2 } - if this.Timestamp != nil && that1.Timestamp != nil { - if *this.Timestamp != *that1.Timestamp { - return false + if len(m.RegisterFrameworks) > 0 { + for _, e := range m.RegisterFrameworks { + l = e.Size() + n += 1 + l + sovMesos(uint64(l)) } - } else if this.Timestamp != nil { - return false - } else if that1.Timestamp != nil { - return false } - if this.CpusUserTimeSecs != nil && that1.CpusUserTimeSecs != nil { - if *this.CpusUserTimeSecs != *that1.CpusUserTimeSecs { - return false + if len(m.RunTasks) > 0 { + for _, e := range m.RunTasks { + l = e.Size() + n += 1 + l + sovMesos(uint64(l)) } - } else if this.CpusUserTimeSecs != nil { - return false - } else if that1.CpusUserTimeSecs != nil { - return false } - if this.CpusSystemTimeSecs != nil && that1.CpusSystemTimeSecs != nil { - if *this.CpusSystemTimeSecs != *that1.CpusSystemTimeSecs { - return false + if len(m.ShutdownFrameworks) > 0 { + for _, e := range m.ShutdownFrameworks { + l = e.Size() + n += 1 + l + sovMesos(uint64(l)) } - } else if this.CpusSystemTimeSecs != nil { - return false - } else if that1.CpusSystemTimeSecs != nil { - return false } - if this.CpusLimit != nil && that1.CpusLimit != nil { - if *this.CpusLimit != *that1.CpusLimit { - return false - } - } else if this.CpusLimit != nil { - return false - } else if that1.CpusLimit != nil { - return false + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - if this.CpusNrPeriods != nil && that1.CpusNrPeriods != nil { - if *this.CpusNrPeriods != *that1.CpusNrPeriods { - return false - } - } else if this.CpusNrPeriods != nil { - return false - } else if that1.CpusNrPeriods != nil { - return false + return n +} + +func (m *RateLimit) Size() (n int) { + var l int + _ = l + if m.Qps != nil { + n += 9 } - if this.CpusNrThrottled != nil && that1.CpusNrThrottled != nil { - if *this.CpusNrThrottled != *that1.CpusNrThrottled { - return false - } - } else if this.CpusNrThrottled != nil { - return false - } else if that1.CpusNrThrottled != nil { - return false + if m.Principal != nil { + l = len(*m.Principal) + n += 1 + l + sovMesos(uint64(l)) } - if this.CpusThrottledTimeSecs != nil && that1.CpusThrottledTimeSecs != nil { - if *this.CpusThrottledTimeSecs != *that1.CpusThrottledTimeSecs { - return false - } - } else if this.CpusThrottledTimeSecs != nil { - return false - } else if that1.CpusThrottledTimeSecs != nil { - return false + if m.Capacity != nil { + n += 1 + sovMesos(uint64(*m.Capacity)) } - if this.MemRssBytes != nil && that1.MemRssBytes != nil { - if *this.MemRssBytes != *that1.MemRssBytes { - return false - } - } else if this.MemRssBytes != nil { - return false - } else if that1.MemRssBytes != nil { - return false + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - if this.MemLimitBytes != nil && that1.MemLimitBytes != nil { - if *this.MemLimitBytes != *that1.MemLimitBytes { - return false + return n +} + +func (m *RateLimits) Size() (n int) { + var l int + _ = l + if len(m.Limits) > 0 { + for _, e := range m.Limits { + l = e.Size() + n += 1 + l + sovMesos(uint64(l)) } - } else if this.MemLimitBytes != nil { - return false - } else if that1.MemLimitBytes != nil { - return false } - if this.MemFileBytes != nil && that1.MemFileBytes != nil { - if *this.MemFileBytes != *that1.MemFileBytes { - return false - } - } else if this.MemFileBytes != nil { - return false - } else if that1.MemFileBytes != nil { - return false + if m.AggregateDefaultQps != nil { + n += 9 } - if this.MemAnonBytes != nil && that1.MemAnonBytes != nil { - if *this.MemAnonBytes != *that1.MemAnonBytes { - return false - } - } else if this.MemAnonBytes != nil { - return false - } else if that1.MemAnonBytes != nil { - return false + if m.AggregateDefaultCapacity != nil { + n += 1 + sovMesos(uint64(*m.AggregateDefaultCapacity)) } - if this.MemMappedFileBytes != nil && that1.MemMappedFileBytes != nil { - if *this.MemMappedFileBytes != *that1.MemMappedFileBytes { - return false - } - } else if this.MemMappedFileBytes != nil { - return false - } else if that1.MemMappedFileBytes != nil { - return false + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - if !this.Perf.Equal(that1.Perf) { - return false + return n +} + +func (m *Volume) Size() (n int) { + var l int + _ = l + if m.ContainerPath != nil { + l = len(*m.ContainerPath) + n += 1 + l + sovMesos(uint64(l)) } - if this.NetRxPackets != nil && that1.NetRxPackets != nil { - if *this.NetRxPackets != *that1.NetRxPackets { - return false - } - } else if this.NetRxPackets != nil { - return false - } else if that1.NetRxPackets != nil { - return false + if m.HostPath != nil { + l = len(*m.HostPath) + n += 1 + l + sovMesos(uint64(l)) } - if this.NetRxBytes != nil && that1.NetRxBytes != nil { - if *this.NetRxBytes != *that1.NetRxBytes { - return false - } - } else if this.NetRxBytes != nil { - return false - } else if that1.NetRxBytes != nil { - return false + if m.Mode != nil { + n += 1 + sovMesos(uint64(*m.Mode)) } - if this.NetRxErrors != nil && that1.NetRxErrors != nil { - if *this.NetRxErrors != *that1.NetRxErrors { - return false - } - } else if this.NetRxErrors != nil { - return false - } else if that1.NetRxErrors != nil { - return false + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - if this.NetRxDropped != nil && that1.NetRxDropped != nil { - if *this.NetRxDropped != *that1.NetRxDropped { - return false - } - } else if this.NetRxDropped != nil { - return false - } else if that1.NetRxDropped != nil { - return false + return n +} + +func (m *ContainerInfo) Size() (n int) { + var l int + _ = l + if m.Type != nil { + n += 1 + sovMesos(uint64(*m.Type)) } - if this.NetTxPackets != nil && that1.NetTxPackets != nil { - if *this.NetTxPackets != *that1.NetTxPackets { - return false + if len(m.Volumes) > 0 { + for _, e := range m.Volumes { + l = e.Size() + n += 1 + l + sovMesos(uint64(l)) } - } else if this.NetTxPackets != nil { - return false - } else if that1.NetTxPackets != nil { - return false } - if this.NetTxBytes != nil && that1.NetTxBytes != nil { - if *this.NetTxBytes != *that1.NetTxBytes { - return false - } - } else if this.NetTxBytes != nil { - return false - } else if that1.NetTxBytes != nil { - return false + if m.Docker != nil { + l = m.Docker.Size() + n += 1 + l + sovMesos(uint64(l)) } - if this.NetTxErrors != nil && that1.NetTxErrors != nil { - if *this.NetTxErrors != *that1.NetTxErrors { - return false - } - } else if this.NetTxErrors != nil { - return false - } else if that1.NetTxErrors != nil { - return false + if m.Hostname != nil { + l = len(*m.Hostname) + n += 1 + l + sovMesos(uint64(l)) } - if this.NetTxDropped != nil && that1.NetTxDropped != nil { - if *this.NetTxDropped != *that1.NetTxDropped { - return false - } - } else if this.NetTxDropped != nil { - return false - } else if that1.NetTxDropped != nil { - return false + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - if this.NetTcpRttMicrosecsP50 != nil && that1.NetTcpRttMicrosecsP50 != nil { - if *this.NetTcpRttMicrosecsP50 != *that1.NetTcpRttMicrosecsP50 { - return false - } - } else if this.NetTcpRttMicrosecsP50 != nil { - return false - } else if that1.NetTcpRttMicrosecsP50 != nil { - return false + return n +} + +func (m *ContainerInfo_DockerInfo) Size() (n int) { + var l int + _ = l + if m.Image != nil { + l = len(*m.Image) + n += 1 + l + sovMesos(uint64(l)) } - if this.NetTcpRttMicrosecsP90 != nil && that1.NetTcpRttMicrosecsP90 != nil { - if *this.NetTcpRttMicrosecsP90 != *that1.NetTcpRttMicrosecsP90 { - return false - } - } else if this.NetTcpRttMicrosecsP90 != nil { - return false - } else if that1.NetTcpRttMicrosecsP90 != nil { - return false + if m.Network != nil { + n += 1 + sovMesos(uint64(*m.Network)) } - if this.NetTcpRttMicrosecsP95 != nil && that1.NetTcpRttMicrosecsP95 != nil { - if *this.NetTcpRttMicrosecsP95 != *that1.NetTcpRttMicrosecsP95 { - return false + if len(m.PortMappings) > 0 { + for _, e := range m.PortMappings { + l = e.Size() + n += 1 + l + sovMesos(uint64(l)) } - } else if this.NetTcpRttMicrosecsP95 != nil { - return false - } else if that1.NetTcpRttMicrosecsP95 != nil { - return false } - if this.NetTcpRttMicrosecsP99 != nil && that1.NetTcpRttMicrosecsP99 != nil { - if *this.NetTcpRttMicrosecsP99 != *that1.NetTcpRttMicrosecsP99 { - return false + if m.Privileged != nil { + n += 2 + } + if len(m.Parameters) > 0 { + for _, e := range m.Parameters { + l = e.Size() + n += 1 + l + sovMesos(uint64(l)) } - } else if this.NetTcpRttMicrosecsP99 != nil { - return false - } else if that1.NetTcpRttMicrosecsP99 != nil { - return false } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false + if m.ForcePullImage != nil { + n += 2 } - return true -} -func (this *ResourceUsage) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that == nil && this != nil") + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } + return n +} - that1, ok := that.(*ResourceUsage) - if !ok { - return fmt3.Errorf("that is not of type *ResourceUsage") +func (m *ContainerInfo_DockerInfo_PortMapping) Size() (n int) { + var l int + _ = l + if m.HostPort != nil { + n += 1 + sovMesos(uint64(*m.HostPort)) } - if that1 == nil { - if this == nil { - return nil + if m.ContainerPort != nil { + n += 1 + sovMesos(uint64(*m.ContainerPort)) + } + if m.Protocol != nil { + l = len(*m.Protocol) + n += 1 + l + sovMesos(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *Labels) Size() (n int) { + var l int + _ = l + if len(m.Labels) > 0 { + for _, e := range m.Labels { + l = e.Size() + n += 1 + l + sovMesos(uint64(l)) } - return fmt3.Errorf("that is type *ResourceUsage but is nil && this != nil") - } else if this == nil { - return fmt3.Errorf("that is type *ResourceUsagebut is not nil && this == nil") } - if !this.SlaveId.Equal(that1.SlaveId) { - return fmt3.Errorf("SlaveId this(%v) Not Equal that(%v)", this.SlaveId, that1.SlaveId) + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - if !this.FrameworkId.Equal(that1.FrameworkId) { - return fmt3.Errorf("FrameworkId this(%v) Not Equal that(%v)", this.FrameworkId, that1.FrameworkId) + return n +} + +func (m *Label) Size() (n int) { + var l int + _ = l + if m.Key != nil { + l = len(*m.Key) + n += 1 + l + sovMesos(uint64(l)) } - if !this.ExecutorId.Equal(that1.ExecutorId) { - return fmt3.Errorf("ExecutorId this(%v) Not Equal that(%v)", this.ExecutorId, that1.ExecutorId) + if m.Value != nil { + l = len(*m.Value) + n += 1 + l + sovMesos(uint64(l)) } - if this.ExecutorName != nil && that1.ExecutorName != nil { - if *this.ExecutorName != *that1.ExecutorName { - return fmt3.Errorf("ExecutorName this(%v) Not Equal that(%v)", *this.ExecutorName, *that1.ExecutorName) - } - } else if this.ExecutorName != nil { - return fmt3.Errorf("this.ExecutorName == nil && that.ExecutorName != nil") - } else if that1.ExecutorName != nil { - return fmt3.Errorf("ExecutorName this(%v) Not Equal that(%v)", this.ExecutorName, that1.ExecutorName) + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - if !this.TaskId.Equal(that1.TaskId) { - return fmt3.Errorf("TaskId this(%v) Not Equal that(%v)", this.TaskId, that1.TaskId) + return n +} + +func (m *Port) Size() (n int) { + var l int + _ = l + if m.Number != nil { + n += 1 + sovMesos(uint64(*m.Number)) } - if !this.Statistics.Equal(that1.Statistics) { - return fmt3.Errorf("Statistics this(%v) Not Equal that(%v)", this.Statistics, that1.Statistics) + if m.Name != nil { + l = len(*m.Name) + n += 1 + l + sovMesos(uint64(l)) } - 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) + if m.Protocol != nil { + l = len(*m.Protocol) + n += 1 + l + sovMesos(uint64(l)) } - return nil + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n } -func (this *ResourceUsage) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true + +func (m *Ports) Size() (n int) { + var l int + _ = l + if len(m.Ports) > 0 { + for _, e := range m.Ports { + l = e.Size() + n += 1 + l + sovMesos(uint64(l)) } - return false } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} - that1, ok := that.(*ResourceUsage) - if !ok { - return false +func (m *DiscoveryInfo) Size() (n int) { + var l int + _ = l + if m.Visibility != nil { + n += 1 + sovMesos(uint64(*m.Visibility)) } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false + if m.Name != nil { + l = len(*m.Name) + n += 1 + l + sovMesos(uint64(l)) } - if !this.SlaveId.Equal(that1.SlaveId) { - return false + if m.Environment != nil { + l = len(*m.Environment) + n += 1 + l + sovMesos(uint64(l)) } - if !this.FrameworkId.Equal(that1.FrameworkId) { - return false + if m.Location != nil { + l = len(*m.Location) + n += 1 + l + sovMesos(uint64(l)) } - if !this.ExecutorId.Equal(that1.ExecutorId) { - return false + if m.Version != nil { + l = len(*m.Version) + n += 1 + l + sovMesos(uint64(l)) } - if this.ExecutorName != nil && that1.ExecutorName != nil { - if *this.ExecutorName != *that1.ExecutorName { - return false + if m.Ports != nil { + l = m.Ports.Size() + n += 1 + l + sovMesos(uint64(l)) + } + if m.Labels != nil { + l = m.Labels.Size() + n += 1 + l + sovMesos(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func sovMesos(x uint64) (n int) { + for { + n++ + x >>= 7 + if x == 0 { + break } - } else if this.ExecutorName != nil { - return false - } else if that1.ExecutorName != nil { - return false } - if !this.TaskId.Equal(that1.TaskId) { - return false + return n +} +func sozMesos(x uint64) (n int) { + return sovMesos(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (this *FrameworkID) String() string { + if this == nil { + return "nil" } - if !this.Statistics.Equal(that1.Statistics) { - return false + s := strings.Join([]string{`&FrameworkID{`, + `Value:` + valueToStringMesos(this.Value) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *OfferID) String() string { + if this == nil { + return "nil" } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false + s := strings.Join([]string{`&OfferID{`, + `Value:` + valueToStringMesos(this.Value) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *SlaveID) String() string { + if this == nil { + return "nil" } - return true + s := strings.Join([]string{`&SlaveID{`, + `Value:` + valueToStringMesos(this.Value) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s } -func (this *PerfStatistics) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that == nil && this != nil") +func (this *TaskID) String() string { + if this == nil { + return "nil" } - - that1, ok := that.(*PerfStatistics) - if !ok { - return fmt3.Errorf("that is not of type *PerfStatistics") + s := strings.Join([]string{`&TaskID{`, + `Value:` + valueToStringMesos(this.Value) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *ExecutorID) String() string { + if this == nil { + return "nil" } - if that1 == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that is type *PerfStatistics but is nil && this != nil") - } else if this == nil { - return fmt3.Errorf("that is type *PerfStatisticsbut is not nil && this == nil") + s := strings.Join([]string{`&ExecutorID{`, + `Value:` + valueToStringMesos(this.Value) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *ContainerID) String() string { + if this == nil { + return "nil" } - if this.Timestamp != nil && that1.Timestamp != nil { - if *this.Timestamp != *that1.Timestamp { - return fmt3.Errorf("Timestamp this(%v) Not Equal that(%v)", *this.Timestamp, *that1.Timestamp) - } - } else if this.Timestamp != nil { - return fmt3.Errorf("this.Timestamp == nil && that.Timestamp != nil") - } else if that1.Timestamp != nil { - return fmt3.Errorf("Timestamp this(%v) Not Equal that(%v)", this.Timestamp, that1.Timestamp) + s := strings.Join([]string{`&ContainerID{`, + `Value:` + valueToStringMesos(this.Value) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *FrameworkInfo) String() string { + if this == nil { + return "nil" } - if this.Duration != nil && that1.Duration != nil { - if *this.Duration != *that1.Duration { - return fmt3.Errorf("Duration this(%v) Not Equal that(%v)", *this.Duration, *that1.Duration) - } - } else if this.Duration != nil { - return fmt3.Errorf("this.Duration == nil && that.Duration != nil") - } else if that1.Duration != nil { - return fmt3.Errorf("Duration this(%v) Not Equal that(%v)", this.Duration, that1.Duration) + s := strings.Join([]string{`&FrameworkInfo{`, + `User:` + valueToStringMesos(this.User) + `,`, + `Name:` + valueToStringMesos(this.Name) + `,`, + `Id:` + strings.Replace(fmt.Sprintf("%v", this.Id), "FrameworkID", "FrameworkID", 1) + `,`, + `FailoverTimeout:` + valueToStringMesos(this.FailoverTimeout) + `,`, + `Checkpoint:` + valueToStringMesos(this.Checkpoint) + `,`, + `Role:` + valueToStringMesos(this.Role) + `,`, + `Hostname:` + valueToStringMesos(this.Hostname) + `,`, + `Principal:` + valueToStringMesos(this.Principal) + `,`, + `WebuiUrl:` + valueToStringMesos(this.WebuiUrl) + `,`, + `Capabilities:` + strings.Replace(fmt.Sprintf("%v", this.Capabilities), "FrameworkInfo_Capability", "FrameworkInfo_Capability", 1) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *FrameworkInfo_Capability) String() string { + if this == nil { + return "nil" } - if this.Cycles != nil && that1.Cycles != nil { - if *this.Cycles != *that1.Cycles { - return fmt3.Errorf("Cycles this(%v) Not Equal that(%v)", *this.Cycles, *that1.Cycles) - } - } else if this.Cycles != nil { - return fmt3.Errorf("this.Cycles == nil && that.Cycles != nil") - } else if that1.Cycles != nil { - return fmt3.Errorf("Cycles this(%v) Not Equal that(%v)", this.Cycles, that1.Cycles) + s := strings.Join([]string{`&FrameworkInfo_Capability{`, + `Type:` + valueToStringMesos(this.Type) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *HealthCheck) String() string { + if this == nil { + return "nil" } - if this.StalledCyclesFrontend != nil && that1.StalledCyclesFrontend != nil { - if *this.StalledCyclesFrontend != *that1.StalledCyclesFrontend { - return fmt3.Errorf("StalledCyclesFrontend this(%v) Not Equal that(%v)", *this.StalledCyclesFrontend, *that1.StalledCyclesFrontend) - } - } else if this.StalledCyclesFrontend != nil { - return fmt3.Errorf("this.StalledCyclesFrontend == nil && that.StalledCyclesFrontend != nil") - } else if that1.StalledCyclesFrontend != nil { - return fmt3.Errorf("StalledCyclesFrontend this(%v) Not Equal that(%v)", this.StalledCyclesFrontend, that1.StalledCyclesFrontend) + s := strings.Join([]string{`&HealthCheck{`, + `Http:` + strings.Replace(fmt.Sprintf("%v", this.Http), "HealthCheck_HTTP", "HealthCheck_HTTP", 1) + `,`, + `DelaySeconds:` + valueToStringMesos(this.DelaySeconds) + `,`, + `IntervalSeconds:` + valueToStringMesos(this.IntervalSeconds) + `,`, + `TimeoutSeconds:` + valueToStringMesos(this.TimeoutSeconds) + `,`, + `ConsecutiveFailures:` + valueToStringMesos(this.ConsecutiveFailures) + `,`, + `GracePeriodSeconds:` + valueToStringMesos(this.GracePeriodSeconds) + `,`, + `Command:` + strings.Replace(fmt.Sprintf("%v", this.Command), "CommandInfo", "CommandInfo", 1) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *HealthCheck_HTTP) String() string { + if this == nil { + return "nil" } - if this.StalledCyclesBackend != nil && that1.StalledCyclesBackend != nil { - if *this.StalledCyclesBackend != *that1.StalledCyclesBackend { - return fmt3.Errorf("StalledCyclesBackend this(%v) Not Equal that(%v)", *this.StalledCyclesBackend, *that1.StalledCyclesBackend) - } - } else if this.StalledCyclesBackend != nil { - return fmt3.Errorf("this.StalledCyclesBackend == nil && that.StalledCyclesBackend != nil") - } else if that1.StalledCyclesBackend != nil { - return fmt3.Errorf("StalledCyclesBackend this(%v) Not Equal that(%v)", this.StalledCyclesBackend, that1.StalledCyclesBackend) + s := strings.Join([]string{`&HealthCheck_HTTP{`, + `Port:` + valueToStringMesos(this.Port) + `,`, + `Path:` + valueToStringMesos(this.Path) + `,`, + `Statuses:` + fmt.Sprintf("%v", this.Statuses) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *CommandInfo) String() string { + if this == nil { + return "nil" } - if this.Instructions != nil && that1.Instructions != nil { - if *this.Instructions != *that1.Instructions { - return fmt3.Errorf("Instructions this(%v) Not Equal that(%v)", *this.Instructions, *that1.Instructions) - } - } else if this.Instructions != nil { - return fmt3.Errorf("this.Instructions == nil && that.Instructions != nil") - } else if that1.Instructions != nil { - return fmt3.Errorf("Instructions this(%v) Not Equal that(%v)", this.Instructions, that1.Instructions) + s := strings.Join([]string{`&CommandInfo{`, + `Uris:` + strings.Replace(fmt.Sprintf("%v", this.Uris), "CommandInfo_URI", "CommandInfo_URI", 1) + `,`, + `Environment:` + strings.Replace(fmt.Sprintf("%v", this.Environment), "Environment", "Environment", 1) + `,`, + `Value:` + valueToStringMesos(this.Value) + `,`, + `Container:` + strings.Replace(fmt.Sprintf("%v", this.Container), "CommandInfo_ContainerInfo", "CommandInfo_ContainerInfo", 1) + `,`, + `User:` + valueToStringMesos(this.User) + `,`, + `Shell:` + valueToStringMesos(this.Shell) + `,`, + `Arguments:` + fmt.Sprintf("%v", this.Arguments) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *CommandInfo_URI) String() string { + if this == nil { + return "nil" } - if this.CacheReferences != nil && that1.CacheReferences != nil { - if *this.CacheReferences != *that1.CacheReferences { - return fmt3.Errorf("CacheReferences this(%v) Not Equal that(%v)", *this.CacheReferences, *that1.CacheReferences) - } - } else if this.CacheReferences != nil { - return fmt3.Errorf("this.CacheReferences == nil && that.CacheReferences != nil") - } else if that1.CacheReferences != nil { - return fmt3.Errorf("CacheReferences this(%v) Not Equal that(%v)", this.CacheReferences, that1.CacheReferences) + s := strings.Join([]string{`&CommandInfo_URI{`, + `Value:` + valueToStringMesos(this.Value) + `,`, + `Executable:` + valueToStringMesos(this.Executable) + `,`, + `Extract:` + valueToStringMesos(this.Extract) + `,`, + `Cache:` + valueToStringMesos(this.Cache) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *CommandInfo_ContainerInfo) String() string { + if this == nil { + return "nil" } - if this.CacheMisses != nil && that1.CacheMisses != nil { - if *this.CacheMisses != *that1.CacheMisses { - return fmt3.Errorf("CacheMisses this(%v) Not Equal that(%v)", *this.CacheMisses, *that1.CacheMisses) - } - } else if this.CacheMisses != nil { - return fmt3.Errorf("this.CacheMisses == nil && that.CacheMisses != nil") - } else if that1.CacheMisses != nil { - return fmt3.Errorf("CacheMisses this(%v) Not Equal that(%v)", this.CacheMisses, that1.CacheMisses) + s := strings.Join([]string{`&CommandInfo_ContainerInfo{`, + `Image:` + valueToStringMesos(this.Image) + `,`, + `Options:` + fmt.Sprintf("%v", this.Options) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *ExecutorInfo) String() string { + if this == nil { + return "nil" } - if this.Branches != nil && that1.Branches != nil { - if *this.Branches != *that1.Branches { - return fmt3.Errorf("Branches this(%v) Not Equal that(%v)", *this.Branches, *that1.Branches) - } - } else if this.Branches != nil { - return fmt3.Errorf("this.Branches == nil && that.Branches != nil") - } else if that1.Branches != nil { - return fmt3.Errorf("Branches this(%v) Not Equal that(%v)", this.Branches, that1.Branches) + s := strings.Join([]string{`&ExecutorInfo{`, + `ExecutorId:` + strings.Replace(fmt.Sprintf("%v", this.ExecutorId), "ExecutorID", "ExecutorID", 1) + `,`, + `Data:` + valueToStringMesos(this.Data) + `,`, + `Resources:` + strings.Replace(fmt.Sprintf("%v", this.Resources), "Resource", "Resource", 1) + `,`, + `Command:` + strings.Replace(fmt.Sprintf("%v", this.Command), "CommandInfo", "CommandInfo", 1) + `,`, + `FrameworkId:` + strings.Replace(fmt.Sprintf("%v", this.FrameworkId), "FrameworkID", "FrameworkID", 1) + `,`, + `Name:` + valueToStringMesos(this.Name) + `,`, + `Source:` + valueToStringMesos(this.Source) + `,`, + `Container:` + strings.Replace(fmt.Sprintf("%v", this.Container), "ContainerInfo", "ContainerInfo", 1) + `,`, + `Discovery:` + strings.Replace(fmt.Sprintf("%v", this.Discovery), "DiscoveryInfo", "DiscoveryInfo", 1) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *MasterInfo) String() string { + if this == nil { + return "nil" } - if this.BranchMisses != nil && that1.BranchMisses != nil { - if *this.BranchMisses != *that1.BranchMisses { - return fmt3.Errorf("BranchMisses this(%v) Not Equal that(%v)", *this.BranchMisses, *that1.BranchMisses) - } - } else if this.BranchMisses != nil { - return fmt3.Errorf("this.BranchMisses == nil && that.BranchMisses != nil") - } else if that1.BranchMisses != nil { - return fmt3.Errorf("BranchMisses this(%v) Not Equal that(%v)", this.BranchMisses, that1.BranchMisses) + s := strings.Join([]string{`&MasterInfo{`, + `Id:` + valueToStringMesos(this.Id) + `,`, + `Ip:` + valueToStringMesos(this.Ip) + `,`, + `Port:` + valueToStringMesos(this.Port) + `,`, + `Pid:` + valueToStringMesos(this.Pid) + `,`, + `Hostname:` + valueToStringMesos(this.Hostname) + `,`, + `Version:` + valueToStringMesos(this.Version) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *SlaveInfo) String() string { + if this == nil { + return "nil" } - if this.BusCycles != nil && that1.BusCycles != nil { - if *this.BusCycles != *that1.BusCycles { - return fmt3.Errorf("BusCycles this(%v) Not Equal that(%v)", *this.BusCycles, *that1.BusCycles) - } - } else if this.BusCycles != nil { - return fmt3.Errorf("this.BusCycles == nil && that.BusCycles != nil") - } else if that1.BusCycles != nil { - return fmt3.Errorf("BusCycles this(%v) Not Equal that(%v)", this.BusCycles, that1.BusCycles) + s := strings.Join([]string{`&SlaveInfo{`, + `Hostname:` + valueToStringMesos(this.Hostname) + `,`, + `Resources:` + strings.Replace(fmt.Sprintf("%v", this.Resources), "Resource", "Resource", 1) + `,`, + `Attributes:` + strings.Replace(fmt.Sprintf("%v", this.Attributes), "Attribute", "Attribute", 1) + `,`, + `Id:` + strings.Replace(fmt.Sprintf("%v", this.Id), "SlaveID", "SlaveID", 1) + `,`, + `Checkpoint:` + valueToStringMesos(this.Checkpoint) + `,`, + `Port:` + valueToStringMesos(this.Port) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *Value) String() string { + if this == nil { + return "nil" } - if this.RefCycles != nil && that1.RefCycles != nil { - if *this.RefCycles != *that1.RefCycles { - return fmt3.Errorf("RefCycles this(%v) Not Equal that(%v)", *this.RefCycles, *that1.RefCycles) - } - } else if this.RefCycles != nil { - return fmt3.Errorf("this.RefCycles == nil && that.RefCycles != nil") - } else if that1.RefCycles != nil { - return fmt3.Errorf("RefCycles this(%v) Not Equal that(%v)", this.RefCycles, that1.RefCycles) + s := strings.Join([]string{`&Value{`, + `Type:` + valueToStringMesos(this.Type) + `,`, + `Scalar:` + strings.Replace(fmt.Sprintf("%v", this.Scalar), "Value_Scalar", "Value_Scalar", 1) + `,`, + `Ranges:` + strings.Replace(fmt.Sprintf("%v", this.Ranges), "Value_Ranges", "Value_Ranges", 1) + `,`, + `Set:` + strings.Replace(fmt.Sprintf("%v", this.Set), "Value_Set", "Value_Set", 1) + `,`, + `Text:` + strings.Replace(fmt.Sprintf("%v", this.Text), "Value_Text", "Value_Text", 1) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *Value_Scalar) String() string { + if this == nil { + return "nil" } - if this.CpuClock != nil && that1.CpuClock != nil { - if *this.CpuClock != *that1.CpuClock { - return fmt3.Errorf("CpuClock this(%v) Not Equal that(%v)", *this.CpuClock, *that1.CpuClock) - } - } else if this.CpuClock != nil { - return fmt3.Errorf("this.CpuClock == nil && that.CpuClock != nil") - } else if that1.CpuClock != nil { - return fmt3.Errorf("CpuClock this(%v) Not Equal that(%v)", this.CpuClock, that1.CpuClock) + s := strings.Join([]string{`&Value_Scalar{`, + `Value:` + valueToStringMesos(this.Value) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *Value_Range) String() string { + if this == nil { + return "nil" } - if this.TaskClock != nil && that1.TaskClock != nil { - if *this.TaskClock != *that1.TaskClock { - return fmt3.Errorf("TaskClock this(%v) Not Equal that(%v)", *this.TaskClock, *that1.TaskClock) - } - } else if this.TaskClock != nil { - return fmt3.Errorf("this.TaskClock == nil && that.TaskClock != nil") - } else if that1.TaskClock != nil { - return fmt3.Errorf("TaskClock this(%v) Not Equal that(%v)", this.TaskClock, that1.TaskClock) + s := strings.Join([]string{`&Value_Range{`, + `Begin:` + valueToStringMesos(this.Begin) + `,`, + `End:` + valueToStringMesos(this.End) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *Value_Ranges) String() string { + if this == nil { + return "nil" } - if this.PageFaults != nil && that1.PageFaults != nil { - if *this.PageFaults != *that1.PageFaults { - return fmt3.Errorf("PageFaults this(%v) Not Equal that(%v)", *this.PageFaults, *that1.PageFaults) - } - } else if this.PageFaults != nil { - return fmt3.Errorf("this.PageFaults == nil && that.PageFaults != nil") - } else if that1.PageFaults != nil { - return fmt3.Errorf("PageFaults this(%v) Not Equal that(%v)", this.PageFaults, that1.PageFaults) + s := strings.Join([]string{`&Value_Ranges{`, + `Range:` + strings.Replace(fmt.Sprintf("%v", this.Range), "Value_Range", "Value_Range", 1) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *Value_Set) String() string { + if this == nil { + return "nil" } - if this.MinorFaults != nil && that1.MinorFaults != nil { - if *this.MinorFaults != *that1.MinorFaults { - return fmt3.Errorf("MinorFaults this(%v) Not Equal that(%v)", *this.MinorFaults, *that1.MinorFaults) - } - } else if this.MinorFaults != nil { - return fmt3.Errorf("this.MinorFaults == nil && that.MinorFaults != nil") - } else if that1.MinorFaults != nil { - return fmt3.Errorf("MinorFaults this(%v) Not Equal that(%v)", this.MinorFaults, that1.MinorFaults) + s := strings.Join([]string{`&Value_Set{`, + `Item:` + fmt.Sprintf("%v", this.Item) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *Value_Text) String() string { + if this == nil { + return "nil" } - if this.MajorFaults != nil && that1.MajorFaults != nil { - if *this.MajorFaults != *that1.MajorFaults { - return fmt3.Errorf("MajorFaults this(%v) Not Equal that(%v)", *this.MajorFaults, *that1.MajorFaults) - } - } else if this.MajorFaults != nil { - return fmt3.Errorf("this.MajorFaults == nil && that.MajorFaults != nil") - } else if that1.MajorFaults != nil { - return fmt3.Errorf("MajorFaults this(%v) Not Equal that(%v)", this.MajorFaults, that1.MajorFaults) + s := strings.Join([]string{`&Value_Text{`, + `Value:` + valueToStringMesos(this.Value) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *Attribute) String() string { + if this == nil { + return "nil" } - if this.ContextSwitches != nil && that1.ContextSwitches != nil { - if *this.ContextSwitches != *that1.ContextSwitches { - return fmt3.Errorf("ContextSwitches this(%v) Not Equal that(%v)", *this.ContextSwitches, *that1.ContextSwitches) - } - } else if this.ContextSwitches != nil { - return fmt3.Errorf("this.ContextSwitches == nil && that.ContextSwitches != nil") - } else if that1.ContextSwitches != nil { - return fmt3.Errorf("ContextSwitches this(%v) Not Equal that(%v)", this.ContextSwitches, that1.ContextSwitches) + s := strings.Join([]string{`&Attribute{`, + `Name:` + valueToStringMesos(this.Name) + `,`, + `Type:` + valueToStringMesos(this.Type) + `,`, + `Scalar:` + strings.Replace(fmt.Sprintf("%v", this.Scalar), "Value_Scalar", "Value_Scalar", 1) + `,`, + `Ranges:` + strings.Replace(fmt.Sprintf("%v", this.Ranges), "Value_Ranges", "Value_Ranges", 1) + `,`, + `Text:` + strings.Replace(fmt.Sprintf("%v", this.Text), "Value_Text", "Value_Text", 1) + `,`, + `Set:` + strings.Replace(fmt.Sprintf("%v", this.Set), "Value_Set", "Value_Set", 1) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *Resource) String() string { + if this == nil { + return "nil" } - if this.CpuMigrations != nil && that1.CpuMigrations != nil { - if *this.CpuMigrations != *that1.CpuMigrations { - return fmt3.Errorf("CpuMigrations this(%v) Not Equal that(%v)", *this.CpuMigrations, *that1.CpuMigrations) - } - } else if this.CpuMigrations != nil { - return fmt3.Errorf("this.CpuMigrations == nil && that.CpuMigrations != nil") - } else if that1.CpuMigrations != nil { - return fmt3.Errorf("CpuMigrations this(%v) Not Equal that(%v)", this.CpuMigrations, that1.CpuMigrations) + s := strings.Join([]string{`&Resource{`, + `Name:` + valueToStringMesos(this.Name) + `,`, + `Type:` + valueToStringMesos(this.Type) + `,`, + `Scalar:` + strings.Replace(fmt.Sprintf("%v", this.Scalar), "Value_Scalar", "Value_Scalar", 1) + `,`, + `Ranges:` + strings.Replace(fmt.Sprintf("%v", this.Ranges), "Value_Ranges", "Value_Ranges", 1) + `,`, + `Set:` + strings.Replace(fmt.Sprintf("%v", this.Set), "Value_Set", "Value_Set", 1) + `,`, + `Role:` + valueToStringMesos(this.Role) + `,`, + `Disk:` + strings.Replace(fmt.Sprintf("%v", this.Disk), "Resource_DiskInfo", "Resource_DiskInfo", 1) + `,`, + `Reservation:` + strings.Replace(fmt.Sprintf("%v", this.Reservation), "Resource_ReservationInfo", "Resource_ReservationInfo", 1) + `,`, + `Revocable:` + strings.Replace(fmt.Sprintf("%v", this.Revocable), "Resource_RevocableInfo", "Resource_RevocableInfo", 1) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *Resource_ReservationInfo) String() string { + if this == nil { + return "nil" } - if this.AlignmentFaults != nil && that1.AlignmentFaults != nil { - if *this.AlignmentFaults != *that1.AlignmentFaults { - return fmt3.Errorf("AlignmentFaults this(%v) Not Equal that(%v)", *this.AlignmentFaults, *that1.AlignmentFaults) - } - } else if this.AlignmentFaults != nil { - return fmt3.Errorf("this.AlignmentFaults == nil && that.AlignmentFaults != nil") - } else if that1.AlignmentFaults != nil { - return fmt3.Errorf("AlignmentFaults this(%v) Not Equal that(%v)", this.AlignmentFaults, that1.AlignmentFaults) + s := strings.Join([]string{`&Resource_ReservationInfo{`, + `Principal:` + valueToStringMesos(this.Principal) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *Resource_DiskInfo) String() string { + if this == nil { + return "nil" } - if this.EmulationFaults != nil && that1.EmulationFaults != nil { - if *this.EmulationFaults != *that1.EmulationFaults { - return fmt3.Errorf("EmulationFaults this(%v) Not Equal that(%v)", *this.EmulationFaults, *that1.EmulationFaults) - } - } else if this.EmulationFaults != nil { - return fmt3.Errorf("this.EmulationFaults == nil && that.EmulationFaults != nil") - } else if that1.EmulationFaults != nil { - return fmt3.Errorf("EmulationFaults this(%v) Not Equal that(%v)", this.EmulationFaults, that1.EmulationFaults) + s := strings.Join([]string{`&Resource_DiskInfo{`, + `Persistence:` + strings.Replace(fmt.Sprintf("%v", this.Persistence), "Resource_DiskInfo_Persistence", "Resource_DiskInfo_Persistence", 1) + `,`, + `Volume:` + strings.Replace(fmt.Sprintf("%v", this.Volume), "Volume", "Volume", 1) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *Resource_DiskInfo_Persistence) String() string { + if this == nil { + return "nil" } - if this.L1DcacheLoads != nil && that1.L1DcacheLoads != nil { - if *this.L1DcacheLoads != *that1.L1DcacheLoads { - return fmt3.Errorf("L1DcacheLoads this(%v) Not Equal that(%v)", *this.L1DcacheLoads, *that1.L1DcacheLoads) - } - } else if this.L1DcacheLoads != nil { - return fmt3.Errorf("this.L1DcacheLoads == nil && that.L1DcacheLoads != nil") - } else if that1.L1DcacheLoads != nil { - return fmt3.Errorf("L1DcacheLoads this(%v) Not Equal that(%v)", this.L1DcacheLoads, that1.L1DcacheLoads) + s := strings.Join([]string{`&Resource_DiskInfo_Persistence{`, + `Id:` + valueToStringMesos(this.Id) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *Resource_RevocableInfo) String() string { + if this == nil { + return "nil" } - if this.L1DcacheLoadMisses != nil && that1.L1DcacheLoadMisses != nil { - if *this.L1DcacheLoadMisses != *that1.L1DcacheLoadMisses { - return fmt3.Errorf("L1DcacheLoadMisses this(%v) Not Equal that(%v)", *this.L1DcacheLoadMisses, *that1.L1DcacheLoadMisses) - } - } else if this.L1DcacheLoadMisses != nil { - return fmt3.Errorf("this.L1DcacheLoadMisses == nil && that.L1DcacheLoadMisses != nil") - } else if that1.L1DcacheLoadMisses != nil { - return fmt3.Errorf("L1DcacheLoadMisses this(%v) Not Equal that(%v)", this.L1DcacheLoadMisses, that1.L1DcacheLoadMisses) + s := strings.Join([]string{`&Resource_RevocableInfo{`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *TrafficControlStatistics) String() string { + if this == nil { + return "nil" } - if this.L1DcacheStores != nil && that1.L1DcacheStores != nil { - if *this.L1DcacheStores != *that1.L1DcacheStores { - return fmt3.Errorf("L1DcacheStores this(%v) Not Equal that(%v)", *this.L1DcacheStores, *that1.L1DcacheStores) - } - } else if this.L1DcacheStores != nil { - return fmt3.Errorf("this.L1DcacheStores == nil && that.L1DcacheStores != nil") - } else if that1.L1DcacheStores != nil { - return fmt3.Errorf("L1DcacheStores this(%v) Not Equal that(%v)", this.L1DcacheStores, that1.L1DcacheStores) + s := strings.Join([]string{`&TrafficControlStatistics{`, + `Id:` + valueToStringMesos(this.Id) + `,`, + `Backlog:` + valueToStringMesos(this.Backlog) + `,`, + `Bytes:` + valueToStringMesos(this.Bytes) + `,`, + `Drops:` + valueToStringMesos(this.Drops) + `,`, + `Overlimits:` + valueToStringMesos(this.Overlimits) + `,`, + `Packets:` + valueToStringMesos(this.Packets) + `,`, + `Qlen:` + valueToStringMesos(this.Qlen) + `,`, + `Ratebps:` + valueToStringMesos(this.Ratebps) + `,`, + `Ratepps:` + valueToStringMesos(this.Ratepps) + `,`, + `Requeues:` + valueToStringMesos(this.Requeues) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *ResourceStatistics) String() string { + if this == nil { + return "nil" } - if this.L1DcacheStoreMisses != nil && that1.L1DcacheStoreMisses != nil { - if *this.L1DcacheStoreMisses != *that1.L1DcacheStoreMisses { - return fmt3.Errorf("L1DcacheStoreMisses this(%v) Not Equal that(%v)", *this.L1DcacheStoreMisses, *that1.L1DcacheStoreMisses) - } - } else if this.L1DcacheStoreMisses != nil { - return fmt3.Errorf("this.L1DcacheStoreMisses == nil && that.L1DcacheStoreMisses != nil") - } else if that1.L1DcacheStoreMisses != nil { - return fmt3.Errorf("L1DcacheStoreMisses this(%v) Not Equal that(%v)", this.L1DcacheStoreMisses, that1.L1DcacheStoreMisses) + s := strings.Join([]string{`&ResourceStatistics{`, + `Timestamp:` + valueToStringMesos(this.Timestamp) + `,`, + `CpusUserTimeSecs:` + valueToStringMesos(this.CpusUserTimeSecs) + `,`, + `CpusSystemTimeSecs:` + valueToStringMesos(this.CpusSystemTimeSecs) + `,`, + `CpusLimit:` + valueToStringMesos(this.CpusLimit) + `,`, + `MemRssBytes:` + valueToStringMesos(this.MemRssBytes) + `,`, + `MemLimitBytes:` + valueToStringMesos(this.MemLimitBytes) + `,`, + `CpusNrPeriods:` + valueToStringMesos(this.CpusNrPeriods) + `,`, + `CpusNrThrottled:` + valueToStringMesos(this.CpusNrThrottled) + `,`, + `CpusThrottledTimeSecs:` + valueToStringMesos(this.CpusThrottledTimeSecs) + `,`, + `MemFileBytes:` + valueToStringMesos(this.MemFileBytes) + `,`, + `MemAnonBytes:` + valueToStringMesos(this.MemAnonBytes) + `,`, + `MemMappedFileBytes:` + valueToStringMesos(this.MemMappedFileBytes) + `,`, + `Perf:` + strings.Replace(fmt.Sprintf("%v", this.Perf), "PerfStatistics", "PerfStatistics", 1) + `,`, + `NetRxPackets:` + valueToStringMesos(this.NetRxPackets) + `,`, + `NetRxBytes:` + valueToStringMesos(this.NetRxBytes) + `,`, + `NetRxErrors:` + valueToStringMesos(this.NetRxErrors) + `,`, + `NetRxDropped:` + valueToStringMesos(this.NetRxDropped) + `,`, + `NetTxPackets:` + valueToStringMesos(this.NetTxPackets) + `,`, + `NetTxBytes:` + valueToStringMesos(this.NetTxBytes) + `,`, + `NetTxErrors:` + valueToStringMesos(this.NetTxErrors) + `,`, + `NetTxDropped:` + valueToStringMesos(this.NetTxDropped) + `,`, + `NetTcpRttMicrosecsP50:` + valueToStringMesos(this.NetTcpRttMicrosecsP50) + `,`, + `NetTcpRttMicrosecsP90:` + valueToStringMesos(this.NetTcpRttMicrosecsP90) + `,`, + `NetTcpRttMicrosecsP95:` + valueToStringMesos(this.NetTcpRttMicrosecsP95) + `,`, + `NetTcpRttMicrosecsP99:` + valueToStringMesos(this.NetTcpRttMicrosecsP99) + `,`, + `DiskLimitBytes:` + valueToStringMesos(this.DiskLimitBytes) + `,`, + `DiskUsedBytes:` + valueToStringMesos(this.DiskUsedBytes) + `,`, + `NetTcpActiveConnections:` + valueToStringMesos(this.NetTcpActiveConnections) + `,`, + `NetTcpTimeWaitConnections:` + valueToStringMesos(this.NetTcpTimeWaitConnections) + `,`, + `Processes:` + valueToStringMesos(this.Processes) + `,`, + `Threads:` + valueToStringMesos(this.Threads) + `,`, + `MemLowPressureCounter:` + valueToStringMesos(this.MemLowPressureCounter) + `,`, + `MemMediumPressureCounter:` + valueToStringMesos(this.MemMediumPressureCounter) + `,`, + `MemCriticalPressureCounter:` + valueToStringMesos(this.MemCriticalPressureCounter) + `,`, + `NetTrafficControlStatistics:` + strings.Replace(fmt.Sprintf("%v", this.NetTrafficControlStatistics), "TrafficControlStatistics", "TrafficControlStatistics", 1) + `,`, + `MemTotalBytes:` + valueToStringMesos(this.MemTotalBytes) + `,`, + `MemTotalMemswBytes:` + valueToStringMesos(this.MemTotalMemswBytes) + `,`, + `MemSoftLimitBytes:` + valueToStringMesos(this.MemSoftLimitBytes) + `,`, + `MemCacheBytes:` + valueToStringMesos(this.MemCacheBytes) + `,`, + `MemSwapBytes:` + valueToStringMesos(this.MemSwapBytes) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *ResourceUsage) String() string { + if this == nil { + return "nil" } - if this.L1DcachePrefetches != nil && that1.L1DcachePrefetches != nil { - if *this.L1DcachePrefetches != *that1.L1DcachePrefetches { - return fmt3.Errorf("L1DcachePrefetches this(%v) Not Equal that(%v)", *this.L1DcachePrefetches, *that1.L1DcachePrefetches) - } - } else if this.L1DcachePrefetches != nil { - return fmt3.Errorf("this.L1DcachePrefetches == nil && that.L1DcachePrefetches != nil") - } else if that1.L1DcachePrefetches != nil { - return fmt3.Errorf("L1DcachePrefetches this(%v) Not Equal that(%v)", this.L1DcachePrefetches, that1.L1DcachePrefetches) + s := strings.Join([]string{`&ResourceUsage{`, + `Executors:` + strings.Replace(fmt.Sprintf("%v", this.Executors), "ResourceUsage_Executor", "ResourceUsage_Executor", 1) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *ResourceUsage_Executor) String() string { + if this == nil { + return "nil" } - if this.L1DcachePrefetchMisses != nil && that1.L1DcachePrefetchMisses != nil { - if *this.L1DcachePrefetchMisses != *that1.L1DcachePrefetchMisses { - return fmt3.Errorf("L1DcachePrefetchMisses this(%v) Not Equal that(%v)", *this.L1DcachePrefetchMisses, *that1.L1DcachePrefetchMisses) - } - } else if this.L1DcachePrefetchMisses != nil { - return fmt3.Errorf("this.L1DcachePrefetchMisses == nil && that.L1DcachePrefetchMisses != nil") - } else if that1.L1DcachePrefetchMisses != nil { - return fmt3.Errorf("L1DcachePrefetchMisses this(%v) Not Equal that(%v)", this.L1DcachePrefetchMisses, that1.L1DcachePrefetchMisses) + s := strings.Join([]string{`&ResourceUsage_Executor{`, + `ExecutorInfo:` + strings.Replace(fmt.Sprintf("%v", this.ExecutorInfo), "ExecutorInfo", "ExecutorInfo", 1) + `,`, + `Allocated:` + strings.Replace(fmt.Sprintf("%v", this.Allocated), "Resource", "Resource", 1) + `,`, + `Statistics:` + strings.Replace(fmt.Sprintf("%v", this.Statistics), "ResourceStatistics", "ResourceStatistics", 1) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *PerfStatistics) String() string { + if this == nil { + return "nil" } - if this.L1IcacheLoads != nil && that1.L1IcacheLoads != nil { - if *this.L1IcacheLoads != *that1.L1IcacheLoads { - return fmt3.Errorf("L1IcacheLoads this(%v) Not Equal that(%v)", *this.L1IcacheLoads, *that1.L1IcacheLoads) - } - } else if this.L1IcacheLoads != nil { - return fmt3.Errorf("this.L1IcacheLoads == nil && that.L1IcacheLoads != nil") - } else if that1.L1IcacheLoads != nil { - return fmt3.Errorf("L1IcacheLoads this(%v) Not Equal that(%v)", this.L1IcacheLoads, that1.L1IcacheLoads) + s := strings.Join([]string{`&PerfStatistics{`, + `Timestamp:` + valueToStringMesos(this.Timestamp) + `,`, + `Duration:` + valueToStringMesos(this.Duration) + `,`, + `Cycles:` + valueToStringMesos(this.Cycles) + `,`, + `StalledCyclesFrontend:` + valueToStringMesos(this.StalledCyclesFrontend) + `,`, + `StalledCyclesBackend:` + valueToStringMesos(this.StalledCyclesBackend) + `,`, + `Instructions:` + valueToStringMesos(this.Instructions) + `,`, + `CacheReferences:` + valueToStringMesos(this.CacheReferences) + `,`, + `CacheMisses:` + valueToStringMesos(this.CacheMisses) + `,`, + `Branches:` + valueToStringMesos(this.Branches) + `,`, + `BranchMisses:` + valueToStringMesos(this.BranchMisses) + `,`, + `BusCycles:` + valueToStringMesos(this.BusCycles) + `,`, + `RefCycles:` + valueToStringMesos(this.RefCycles) + `,`, + `CpuClock:` + valueToStringMesos(this.CpuClock) + `,`, + `TaskClock:` + valueToStringMesos(this.TaskClock) + `,`, + `PageFaults:` + valueToStringMesos(this.PageFaults) + `,`, + `MinorFaults:` + valueToStringMesos(this.MinorFaults) + `,`, + `MajorFaults:` + valueToStringMesos(this.MajorFaults) + `,`, + `ContextSwitches:` + valueToStringMesos(this.ContextSwitches) + `,`, + `CpuMigrations:` + valueToStringMesos(this.CpuMigrations) + `,`, + `AlignmentFaults:` + valueToStringMesos(this.AlignmentFaults) + `,`, + `EmulationFaults:` + valueToStringMesos(this.EmulationFaults) + `,`, + `L1DcacheLoads:` + valueToStringMesos(this.L1DcacheLoads) + `,`, + `L1DcacheLoadMisses:` + valueToStringMesos(this.L1DcacheLoadMisses) + `,`, + `L1DcacheStores:` + valueToStringMesos(this.L1DcacheStores) + `,`, + `L1DcacheStoreMisses:` + valueToStringMesos(this.L1DcacheStoreMisses) + `,`, + `L1DcachePrefetches:` + valueToStringMesos(this.L1DcachePrefetches) + `,`, + `L1DcachePrefetchMisses:` + valueToStringMesos(this.L1DcachePrefetchMisses) + `,`, + `L1IcacheLoads:` + valueToStringMesos(this.L1IcacheLoads) + `,`, + `L1IcacheLoadMisses:` + valueToStringMesos(this.L1IcacheLoadMisses) + `,`, + `L1IcachePrefetches:` + valueToStringMesos(this.L1IcachePrefetches) + `,`, + `L1IcachePrefetchMisses:` + valueToStringMesos(this.L1IcachePrefetchMisses) + `,`, + `LlcLoads:` + valueToStringMesos(this.LlcLoads) + `,`, + `LlcLoadMisses:` + valueToStringMesos(this.LlcLoadMisses) + `,`, + `LlcStores:` + valueToStringMesos(this.LlcStores) + `,`, + `LlcStoreMisses:` + valueToStringMesos(this.LlcStoreMisses) + `,`, + `LlcPrefetches:` + valueToStringMesos(this.LlcPrefetches) + `,`, + `LlcPrefetchMisses:` + valueToStringMesos(this.LlcPrefetchMisses) + `,`, + `DtlbLoads:` + valueToStringMesos(this.DtlbLoads) + `,`, + `DtlbLoadMisses:` + valueToStringMesos(this.DtlbLoadMisses) + `,`, + `DtlbStores:` + valueToStringMesos(this.DtlbStores) + `,`, + `DtlbStoreMisses:` + valueToStringMesos(this.DtlbStoreMisses) + `,`, + `DtlbPrefetches:` + valueToStringMesos(this.DtlbPrefetches) + `,`, + `DtlbPrefetchMisses:` + valueToStringMesos(this.DtlbPrefetchMisses) + `,`, + `ItlbLoads:` + valueToStringMesos(this.ItlbLoads) + `,`, + `ItlbLoadMisses:` + valueToStringMesos(this.ItlbLoadMisses) + `,`, + `BranchLoads:` + valueToStringMesos(this.BranchLoads) + `,`, + `BranchLoadMisses:` + valueToStringMesos(this.BranchLoadMisses) + `,`, + `NodeLoads:` + valueToStringMesos(this.NodeLoads) + `,`, + `NodeLoadMisses:` + valueToStringMesos(this.NodeLoadMisses) + `,`, + `NodeStores:` + valueToStringMesos(this.NodeStores) + `,`, + `NodeStoreMisses:` + valueToStringMesos(this.NodeStoreMisses) + `,`, + `NodePrefetches:` + valueToStringMesos(this.NodePrefetches) + `,`, + `NodePrefetchMisses:` + valueToStringMesos(this.NodePrefetchMisses) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *Request) String() string { + if this == nil { + return "nil" } - if this.L1IcacheLoadMisses != nil && that1.L1IcacheLoadMisses != nil { - if *this.L1IcacheLoadMisses != *that1.L1IcacheLoadMisses { - return fmt3.Errorf("L1IcacheLoadMisses this(%v) Not Equal that(%v)", *this.L1IcacheLoadMisses, *that1.L1IcacheLoadMisses) - } - } else if this.L1IcacheLoadMisses != nil { - return fmt3.Errorf("this.L1IcacheLoadMisses == nil && that.L1IcacheLoadMisses != nil") - } else if that1.L1IcacheLoadMisses != nil { - return fmt3.Errorf("L1IcacheLoadMisses this(%v) Not Equal that(%v)", this.L1IcacheLoadMisses, that1.L1IcacheLoadMisses) + s := strings.Join([]string{`&Request{`, + `SlaveId:` + strings.Replace(fmt.Sprintf("%v", this.SlaveId), "SlaveID", "SlaveID", 1) + `,`, + `Resources:` + strings.Replace(fmt.Sprintf("%v", this.Resources), "Resource", "Resource", 1) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *Offer) String() string { + if this == nil { + return "nil" } - if this.L1IcachePrefetches != nil && that1.L1IcachePrefetches != nil { - if *this.L1IcachePrefetches != *that1.L1IcachePrefetches { - return fmt3.Errorf("L1IcachePrefetches this(%v) Not Equal that(%v)", *this.L1IcachePrefetches, *that1.L1IcachePrefetches) - } - } else if this.L1IcachePrefetches != nil { - return fmt3.Errorf("this.L1IcachePrefetches == nil && that.L1IcachePrefetches != nil") - } else if that1.L1IcachePrefetches != nil { - return fmt3.Errorf("L1IcachePrefetches this(%v) Not Equal that(%v)", this.L1IcachePrefetches, that1.L1IcachePrefetches) + s := strings.Join([]string{`&Offer{`, + `Id:` + strings.Replace(fmt.Sprintf("%v", this.Id), "OfferID", "OfferID", 1) + `,`, + `FrameworkId:` + strings.Replace(fmt.Sprintf("%v", this.FrameworkId), "FrameworkID", "FrameworkID", 1) + `,`, + `SlaveId:` + strings.Replace(fmt.Sprintf("%v", this.SlaveId), "SlaveID", "SlaveID", 1) + `,`, + `Hostname:` + valueToStringMesos(this.Hostname) + `,`, + `Resources:` + strings.Replace(fmt.Sprintf("%v", this.Resources), "Resource", "Resource", 1) + `,`, + `ExecutorIds:` + strings.Replace(fmt.Sprintf("%v", this.ExecutorIds), "ExecutorID", "ExecutorID", 1) + `,`, + `Attributes:` + strings.Replace(fmt.Sprintf("%v", this.Attributes), "Attribute", "Attribute", 1) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *Offer_Operation) String() string { + if this == nil { + return "nil" } - if this.L1IcachePrefetchMisses != nil && that1.L1IcachePrefetchMisses != nil { - if *this.L1IcachePrefetchMisses != *that1.L1IcachePrefetchMisses { - return fmt3.Errorf("L1IcachePrefetchMisses this(%v) Not Equal that(%v)", *this.L1IcachePrefetchMisses, *that1.L1IcachePrefetchMisses) - } - } else if this.L1IcachePrefetchMisses != nil { - return fmt3.Errorf("this.L1IcachePrefetchMisses == nil && that.L1IcachePrefetchMisses != nil") - } else if that1.L1IcachePrefetchMisses != nil { - return fmt3.Errorf("L1IcachePrefetchMisses this(%v) Not Equal that(%v)", this.L1IcachePrefetchMisses, that1.L1IcachePrefetchMisses) + s := strings.Join([]string{`&Offer_Operation{`, + `Type:` + valueToStringMesos(this.Type) + `,`, + `Launch:` + strings.Replace(fmt.Sprintf("%v", this.Launch), "Offer_Operation_Launch", "Offer_Operation_Launch", 1) + `,`, + `Reserve:` + strings.Replace(fmt.Sprintf("%v", this.Reserve), "Offer_Operation_Reserve", "Offer_Operation_Reserve", 1) + `,`, + `Unreserve:` + strings.Replace(fmt.Sprintf("%v", this.Unreserve), "Offer_Operation_Unreserve", "Offer_Operation_Unreserve", 1) + `,`, + `Create:` + strings.Replace(fmt.Sprintf("%v", this.Create), "Offer_Operation_Create", "Offer_Operation_Create", 1) + `,`, + `Destroy:` + strings.Replace(fmt.Sprintf("%v", this.Destroy), "Offer_Operation_Destroy", "Offer_Operation_Destroy", 1) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *Offer_Operation_Launch) String() string { + if this == nil { + return "nil" } - if this.LlcLoads != nil && that1.LlcLoads != nil { - if *this.LlcLoads != *that1.LlcLoads { - return fmt3.Errorf("LlcLoads this(%v) Not Equal that(%v)", *this.LlcLoads, *that1.LlcLoads) - } - } else if this.LlcLoads != nil { - return fmt3.Errorf("this.LlcLoads == nil && that.LlcLoads != nil") - } else if that1.LlcLoads != nil { - return fmt3.Errorf("LlcLoads this(%v) Not Equal that(%v)", this.LlcLoads, that1.LlcLoads) + s := strings.Join([]string{`&Offer_Operation_Launch{`, + `TaskInfos:` + strings.Replace(fmt.Sprintf("%v", this.TaskInfos), "TaskInfo", "TaskInfo", 1) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *Offer_Operation_Reserve) String() string { + if this == nil { + return "nil" } - if this.LlcLoadMisses != nil && that1.LlcLoadMisses != nil { - if *this.LlcLoadMisses != *that1.LlcLoadMisses { - return fmt3.Errorf("LlcLoadMisses this(%v) Not Equal that(%v)", *this.LlcLoadMisses, *that1.LlcLoadMisses) - } - } else if this.LlcLoadMisses != nil { - return fmt3.Errorf("this.LlcLoadMisses == nil && that.LlcLoadMisses != nil") - } else if that1.LlcLoadMisses != nil { - return fmt3.Errorf("LlcLoadMisses this(%v) Not Equal that(%v)", this.LlcLoadMisses, that1.LlcLoadMisses) + s := strings.Join([]string{`&Offer_Operation_Reserve{`, + `Resources:` + strings.Replace(fmt.Sprintf("%v", this.Resources), "Resource", "Resource", 1) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *Offer_Operation_Unreserve) String() string { + if this == nil { + return "nil" } - if this.LlcStores != nil && that1.LlcStores != nil { - if *this.LlcStores != *that1.LlcStores { - return fmt3.Errorf("LlcStores this(%v) Not Equal that(%v)", *this.LlcStores, *that1.LlcStores) - } - } else if this.LlcStores != nil { - return fmt3.Errorf("this.LlcStores == nil && that.LlcStores != nil") - } else if that1.LlcStores != nil { - return fmt3.Errorf("LlcStores this(%v) Not Equal that(%v)", this.LlcStores, that1.LlcStores) + s := strings.Join([]string{`&Offer_Operation_Unreserve{`, + `Resources:` + strings.Replace(fmt.Sprintf("%v", this.Resources), "Resource", "Resource", 1) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *Offer_Operation_Create) String() string { + if this == nil { + return "nil" } - if this.LlcStoreMisses != nil && that1.LlcStoreMisses != nil { - if *this.LlcStoreMisses != *that1.LlcStoreMisses { - return fmt3.Errorf("LlcStoreMisses this(%v) Not Equal that(%v)", *this.LlcStoreMisses, *that1.LlcStoreMisses) - } - } else if this.LlcStoreMisses != nil { - return fmt3.Errorf("this.LlcStoreMisses == nil && that.LlcStoreMisses != nil") - } else if that1.LlcStoreMisses != nil { - return fmt3.Errorf("LlcStoreMisses this(%v) Not Equal that(%v)", this.LlcStoreMisses, that1.LlcStoreMisses) + s := strings.Join([]string{`&Offer_Operation_Create{`, + `Volumes:` + strings.Replace(fmt.Sprintf("%v", this.Volumes), "Resource", "Resource", 1) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *Offer_Operation_Destroy) String() string { + if this == nil { + return "nil" } - if this.LlcPrefetches != nil && that1.LlcPrefetches != nil { - if *this.LlcPrefetches != *that1.LlcPrefetches { - return fmt3.Errorf("LlcPrefetches this(%v) Not Equal that(%v)", *this.LlcPrefetches, *that1.LlcPrefetches) - } - } else if this.LlcPrefetches != nil { - return fmt3.Errorf("this.LlcPrefetches == nil && that.LlcPrefetches != nil") - } else if that1.LlcPrefetches != nil { - return fmt3.Errorf("LlcPrefetches this(%v) Not Equal that(%v)", this.LlcPrefetches, that1.LlcPrefetches) + s := strings.Join([]string{`&Offer_Operation_Destroy{`, + `Volumes:` + strings.Replace(fmt.Sprintf("%v", this.Volumes), "Resource", "Resource", 1) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *TaskInfo) String() string { + if this == nil { + return "nil" } - if this.LlcPrefetchMisses != nil && that1.LlcPrefetchMisses != nil { - if *this.LlcPrefetchMisses != *that1.LlcPrefetchMisses { - return fmt3.Errorf("LlcPrefetchMisses this(%v) Not Equal that(%v)", *this.LlcPrefetchMisses, *that1.LlcPrefetchMisses) - } - } else if this.LlcPrefetchMisses != nil { - return fmt3.Errorf("this.LlcPrefetchMisses == nil && that.LlcPrefetchMisses != nil") - } else if that1.LlcPrefetchMisses != nil { - return fmt3.Errorf("LlcPrefetchMisses this(%v) Not Equal that(%v)", this.LlcPrefetchMisses, that1.LlcPrefetchMisses) + s := strings.Join([]string{`&TaskInfo{`, + `Name:` + valueToStringMesos(this.Name) + `,`, + `TaskId:` + strings.Replace(fmt.Sprintf("%v", this.TaskId), "TaskID", "TaskID", 1) + `,`, + `SlaveId:` + strings.Replace(fmt.Sprintf("%v", this.SlaveId), "SlaveID", "SlaveID", 1) + `,`, + `Resources:` + strings.Replace(fmt.Sprintf("%v", this.Resources), "Resource", "Resource", 1) + `,`, + `Executor:` + strings.Replace(fmt.Sprintf("%v", this.Executor), "ExecutorInfo", "ExecutorInfo", 1) + `,`, + `Data:` + valueToStringMesos(this.Data) + `,`, + `Command:` + strings.Replace(fmt.Sprintf("%v", this.Command), "CommandInfo", "CommandInfo", 1) + `,`, + `HealthCheck:` + strings.Replace(fmt.Sprintf("%v", this.HealthCheck), "HealthCheck", "HealthCheck", 1) + `,`, + `Container:` + strings.Replace(fmt.Sprintf("%v", this.Container), "ContainerInfo", "ContainerInfo", 1) + `,`, + `Labels:` + strings.Replace(fmt.Sprintf("%v", this.Labels), "Labels", "Labels", 1) + `,`, + `Discovery:` + strings.Replace(fmt.Sprintf("%v", this.Discovery), "DiscoveryInfo", "DiscoveryInfo", 1) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *TaskStatus) String() string { + if this == nil { + return "nil" } - if this.DtlbLoads != nil && that1.DtlbLoads != nil { - if *this.DtlbLoads != *that1.DtlbLoads { - return fmt3.Errorf("DtlbLoads this(%v) Not Equal that(%v)", *this.DtlbLoads, *that1.DtlbLoads) - } - } else if this.DtlbLoads != nil { - return fmt3.Errorf("this.DtlbLoads == nil && that.DtlbLoads != nil") - } else if that1.DtlbLoads != nil { - return fmt3.Errorf("DtlbLoads this(%v) Not Equal that(%v)", this.DtlbLoads, that1.DtlbLoads) + s := strings.Join([]string{`&TaskStatus{`, + `TaskId:` + strings.Replace(fmt.Sprintf("%v", this.TaskId), "TaskID", "TaskID", 1) + `,`, + `State:` + valueToStringMesos(this.State) + `,`, + `Data:` + valueToStringMesos(this.Data) + `,`, + `Message:` + valueToStringMesos(this.Message) + `,`, + `SlaveId:` + strings.Replace(fmt.Sprintf("%v", this.SlaveId), "SlaveID", "SlaveID", 1) + `,`, + `Timestamp:` + valueToStringMesos(this.Timestamp) + `,`, + `ExecutorId:` + strings.Replace(fmt.Sprintf("%v", this.ExecutorId), "ExecutorID", "ExecutorID", 1) + `,`, + `Healthy:` + valueToStringMesos(this.Healthy) + `,`, + `Source:` + valueToStringMesos(this.Source) + `,`, + `Reason:` + valueToStringMesos(this.Reason) + `,`, + `Uuid:` + valueToStringMesos(this.Uuid) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *Filters) String() string { + if this == nil { + return "nil" } - if this.DtlbLoadMisses != nil && that1.DtlbLoadMisses != nil { - if *this.DtlbLoadMisses != *that1.DtlbLoadMisses { - return fmt3.Errorf("DtlbLoadMisses this(%v) Not Equal that(%v)", *this.DtlbLoadMisses, *that1.DtlbLoadMisses) - } - } else if this.DtlbLoadMisses != nil { - return fmt3.Errorf("this.DtlbLoadMisses == nil && that.DtlbLoadMisses != nil") - } else if that1.DtlbLoadMisses != nil { - return fmt3.Errorf("DtlbLoadMisses this(%v) Not Equal that(%v)", this.DtlbLoadMisses, that1.DtlbLoadMisses) + s := strings.Join([]string{`&Filters{`, + `RefuseSeconds:` + valueToStringMesos(this.RefuseSeconds) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *Environment) String() string { + if this == nil { + return "nil" } - if this.DtlbStores != nil && that1.DtlbStores != nil { - if *this.DtlbStores != *that1.DtlbStores { - return fmt3.Errorf("DtlbStores this(%v) Not Equal that(%v)", *this.DtlbStores, *that1.DtlbStores) - } - } else if this.DtlbStores != nil { - return fmt3.Errorf("this.DtlbStores == nil && that.DtlbStores != nil") - } else if that1.DtlbStores != nil { - return fmt3.Errorf("DtlbStores this(%v) Not Equal that(%v)", this.DtlbStores, that1.DtlbStores) + s := strings.Join([]string{`&Environment{`, + `Variables:` + strings.Replace(fmt.Sprintf("%v", this.Variables), "Environment_Variable", "Environment_Variable", 1) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *Environment_Variable) String() string { + if this == nil { + return "nil" } - if this.DtlbStoreMisses != nil && that1.DtlbStoreMisses != nil { - if *this.DtlbStoreMisses != *that1.DtlbStoreMisses { - return fmt3.Errorf("DtlbStoreMisses this(%v) Not Equal that(%v)", *this.DtlbStoreMisses, *that1.DtlbStoreMisses) - } - } else if this.DtlbStoreMisses != nil { - return fmt3.Errorf("this.DtlbStoreMisses == nil && that.DtlbStoreMisses != nil") - } else if that1.DtlbStoreMisses != nil { - return fmt3.Errorf("DtlbStoreMisses this(%v) Not Equal that(%v)", this.DtlbStoreMisses, that1.DtlbStoreMisses) + s := strings.Join([]string{`&Environment_Variable{`, + `Name:` + valueToStringMesos(this.Name) + `,`, + `Value:` + valueToStringMesos(this.Value) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *Parameter) String() string { + if this == nil { + return "nil" } - if this.DtlbPrefetches != nil && that1.DtlbPrefetches != nil { - if *this.DtlbPrefetches != *that1.DtlbPrefetches { - return fmt3.Errorf("DtlbPrefetches this(%v) Not Equal that(%v)", *this.DtlbPrefetches, *that1.DtlbPrefetches) - } - } else if this.DtlbPrefetches != nil { - return fmt3.Errorf("this.DtlbPrefetches == nil && that.DtlbPrefetches != nil") - } else if that1.DtlbPrefetches != nil { - return fmt3.Errorf("DtlbPrefetches this(%v) Not Equal that(%v)", this.DtlbPrefetches, that1.DtlbPrefetches) + s := strings.Join([]string{`&Parameter{`, + `Key:` + valueToStringMesos(this.Key) + `,`, + `Value:` + valueToStringMesos(this.Value) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *Parameters) String() string { + if this == nil { + return "nil" } - if this.DtlbPrefetchMisses != nil && that1.DtlbPrefetchMisses != nil { - if *this.DtlbPrefetchMisses != *that1.DtlbPrefetchMisses { - return fmt3.Errorf("DtlbPrefetchMisses this(%v) Not Equal that(%v)", *this.DtlbPrefetchMisses, *that1.DtlbPrefetchMisses) - } - } else if this.DtlbPrefetchMisses != nil { - return fmt3.Errorf("this.DtlbPrefetchMisses == nil && that.DtlbPrefetchMisses != nil") - } else if that1.DtlbPrefetchMisses != nil { - return fmt3.Errorf("DtlbPrefetchMisses this(%v) Not Equal that(%v)", this.DtlbPrefetchMisses, that1.DtlbPrefetchMisses) + s := strings.Join([]string{`&Parameters{`, + `Parameter:` + strings.Replace(fmt.Sprintf("%v", this.Parameter), "Parameter", "Parameter", 1) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *Credential) String() string { + if this == nil { + return "nil" } - if this.ItlbLoads != nil && that1.ItlbLoads != nil { - if *this.ItlbLoads != *that1.ItlbLoads { - return fmt3.Errorf("ItlbLoads this(%v) Not Equal that(%v)", *this.ItlbLoads, *that1.ItlbLoads) - } - } else if this.ItlbLoads != nil { - return fmt3.Errorf("this.ItlbLoads == nil && that.ItlbLoads != nil") - } else if that1.ItlbLoads != nil { - return fmt3.Errorf("ItlbLoads this(%v) Not Equal that(%v)", this.ItlbLoads, that1.ItlbLoads) + s := strings.Join([]string{`&Credential{`, + `Principal:` + valueToStringMesos(this.Principal) + `,`, + `Secret:` + valueToStringMesos(this.Secret) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *Credentials) String() string { + if this == nil { + return "nil" } - if this.ItlbLoadMisses != nil && that1.ItlbLoadMisses != nil { - if *this.ItlbLoadMisses != *that1.ItlbLoadMisses { - return fmt3.Errorf("ItlbLoadMisses this(%v) Not Equal that(%v)", *this.ItlbLoadMisses, *that1.ItlbLoadMisses) - } - } else if this.ItlbLoadMisses != nil { - return fmt3.Errorf("this.ItlbLoadMisses == nil && that.ItlbLoadMisses != nil") - } else if that1.ItlbLoadMisses != nil { - return fmt3.Errorf("ItlbLoadMisses this(%v) Not Equal that(%v)", this.ItlbLoadMisses, that1.ItlbLoadMisses) + s := strings.Join([]string{`&Credentials{`, + `Credentials:` + strings.Replace(fmt.Sprintf("%v", this.Credentials), "Credential", "Credential", 1) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *ACL) String() string { + if this == nil { + return "nil" } - if this.BranchLoads != nil && that1.BranchLoads != nil { - if *this.BranchLoads != *that1.BranchLoads { - return fmt3.Errorf("BranchLoads this(%v) Not Equal that(%v)", *this.BranchLoads, *that1.BranchLoads) - } - } else if this.BranchLoads != nil { - return fmt3.Errorf("this.BranchLoads == nil && that.BranchLoads != nil") - } else if that1.BranchLoads != nil { - return fmt3.Errorf("BranchLoads this(%v) Not Equal that(%v)", this.BranchLoads, that1.BranchLoads) + s := strings.Join([]string{`&ACL{`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *ACL_Entity) String() string { + if this == nil { + return "nil" } - if this.BranchLoadMisses != nil && that1.BranchLoadMisses != nil { - if *this.BranchLoadMisses != *that1.BranchLoadMisses { - return fmt3.Errorf("BranchLoadMisses this(%v) Not Equal that(%v)", *this.BranchLoadMisses, *that1.BranchLoadMisses) - } - } else if this.BranchLoadMisses != nil { - return fmt3.Errorf("this.BranchLoadMisses == nil && that.BranchLoadMisses != nil") - } else if that1.BranchLoadMisses != nil { - return fmt3.Errorf("BranchLoadMisses this(%v) Not Equal that(%v)", this.BranchLoadMisses, that1.BranchLoadMisses) + s := strings.Join([]string{`&ACL_Entity{`, + `Type:` + valueToStringMesos(this.Type) + `,`, + `Values:` + fmt.Sprintf("%v", this.Values) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *ACL_RegisterFramework) String() string { + if this == nil { + return "nil" } - if this.NodeLoads != nil && that1.NodeLoads != nil { - if *this.NodeLoads != *that1.NodeLoads { - return fmt3.Errorf("NodeLoads this(%v) Not Equal that(%v)", *this.NodeLoads, *that1.NodeLoads) - } - } else if this.NodeLoads != nil { - return fmt3.Errorf("this.NodeLoads == nil && that.NodeLoads != nil") - } else if that1.NodeLoads != nil { - return fmt3.Errorf("NodeLoads this(%v) Not Equal that(%v)", this.NodeLoads, that1.NodeLoads) + s := strings.Join([]string{`&ACL_RegisterFramework{`, + `Principals:` + strings.Replace(fmt.Sprintf("%v", this.Principals), "ACL_Entity", "ACL_Entity", 1) + `,`, + `Roles:` + strings.Replace(fmt.Sprintf("%v", this.Roles), "ACL_Entity", "ACL_Entity", 1) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *ACL_RunTask) String() string { + if this == nil { + return "nil" } - if this.NodeLoadMisses != nil && that1.NodeLoadMisses != nil { - if *this.NodeLoadMisses != *that1.NodeLoadMisses { - return fmt3.Errorf("NodeLoadMisses this(%v) Not Equal that(%v)", *this.NodeLoadMisses, *that1.NodeLoadMisses) - } - } else if this.NodeLoadMisses != nil { - return fmt3.Errorf("this.NodeLoadMisses == nil && that.NodeLoadMisses != nil") - } else if that1.NodeLoadMisses != nil { - return fmt3.Errorf("NodeLoadMisses this(%v) Not Equal that(%v)", this.NodeLoadMisses, that1.NodeLoadMisses) + s := strings.Join([]string{`&ACL_RunTask{`, + `Principals:` + strings.Replace(fmt.Sprintf("%v", this.Principals), "ACL_Entity", "ACL_Entity", 1) + `,`, + `Users:` + strings.Replace(fmt.Sprintf("%v", this.Users), "ACL_Entity", "ACL_Entity", 1) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *ACL_ShutdownFramework) String() string { + if this == nil { + return "nil" } - if this.NodeStores != nil && that1.NodeStores != nil { - if *this.NodeStores != *that1.NodeStores { - return fmt3.Errorf("NodeStores this(%v) Not Equal that(%v)", *this.NodeStores, *that1.NodeStores) - } - } else if this.NodeStores != nil { - return fmt3.Errorf("this.NodeStores == nil && that.NodeStores != nil") - } else if that1.NodeStores != nil { - return fmt3.Errorf("NodeStores this(%v) Not Equal that(%v)", this.NodeStores, that1.NodeStores) + s := strings.Join([]string{`&ACL_ShutdownFramework{`, + `Principals:` + strings.Replace(fmt.Sprintf("%v", this.Principals), "ACL_Entity", "ACL_Entity", 1) + `,`, + `FrameworkPrincipals:` + strings.Replace(fmt.Sprintf("%v", this.FrameworkPrincipals), "ACL_Entity", "ACL_Entity", 1) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *ACLs) String() string { + if this == nil { + return "nil" } - if this.NodeStoreMisses != nil && that1.NodeStoreMisses != nil { - if *this.NodeStoreMisses != *that1.NodeStoreMisses { - return fmt3.Errorf("NodeStoreMisses this(%v) Not Equal that(%v)", *this.NodeStoreMisses, *that1.NodeStoreMisses) - } - } else if this.NodeStoreMisses != nil { - return fmt3.Errorf("this.NodeStoreMisses == nil && that.NodeStoreMisses != nil") - } else if that1.NodeStoreMisses != nil { - return fmt3.Errorf("NodeStoreMisses this(%v) Not Equal that(%v)", this.NodeStoreMisses, that1.NodeStoreMisses) + s := strings.Join([]string{`&ACLs{`, + `Permissive:` + valueToStringMesos(this.Permissive) + `,`, + `RegisterFrameworks:` + strings.Replace(fmt.Sprintf("%v", this.RegisterFrameworks), "ACL_RegisterFramework", "ACL_RegisterFramework", 1) + `,`, + `RunTasks:` + strings.Replace(fmt.Sprintf("%v", this.RunTasks), "ACL_RunTask", "ACL_RunTask", 1) + `,`, + `ShutdownFrameworks:` + strings.Replace(fmt.Sprintf("%v", this.ShutdownFrameworks), "ACL_ShutdownFramework", "ACL_ShutdownFramework", 1) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *RateLimit) String() string { + if this == nil { + return "nil" } - if this.NodePrefetches != nil && that1.NodePrefetches != nil { - if *this.NodePrefetches != *that1.NodePrefetches { - return fmt3.Errorf("NodePrefetches this(%v) Not Equal that(%v)", *this.NodePrefetches, *that1.NodePrefetches) - } - } else if this.NodePrefetches != nil { - return fmt3.Errorf("this.NodePrefetches == nil && that.NodePrefetches != nil") - } else if that1.NodePrefetches != nil { - return fmt3.Errorf("NodePrefetches this(%v) Not Equal that(%v)", this.NodePrefetches, that1.NodePrefetches) + s := strings.Join([]string{`&RateLimit{`, + `Qps:` + valueToStringMesos(this.Qps) + `,`, + `Principal:` + valueToStringMesos(this.Principal) + `,`, + `Capacity:` + valueToStringMesos(this.Capacity) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *RateLimits) String() string { + if this == nil { + return "nil" } - if this.NodePrefetchMisses != nil && that1.NodePrefetchMisses != nil { - if *this.NodePrefetchMisses != *that1.NodePrefetchMisses { - return fmt3.Errorf("NodePrefetchMisses this(%v) Not Equal that(%v)", *this.NodePrefetchMisses, *that1.NodePrefetchMisses) - } - } else if this.NodePrefetchMisses != nil { - return fmt3.Errorf("this.NodePrefetchMisses == nil && that.NodePrefetchMisses != nil") - } else if that1.NodePrefetchMisses != nil { - return fmt3.Errorf("NodePrefetchMisses this(%v) Not Equal that(%v)", this.NodePrefetchMisses, that1.NodePrefetchMisses) + s := strings.Join([]string{`&RateLimits{`, + `Limits:` + strings.Replace(fmt.Sprintf("%v", this.Limits), "RateLimit", "RateLimit", 1) + `,`, + `AggregateDefaultQps:` + valueToStringMesos(this.AggregateDefaultQps) + `,`, + `AggregateDefaultCapacity:` + valueToStringMesos(this.AggregateDefaultCapacity) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *Volume) String() string { + if this == nil { + return "nil" } - 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) + s := strings.Join([]string{`&Volume{`, + `ContainerPath:` + valueToStringMesos(this.ContainerPath) + `,`, + `HostPath:` + valueToStringMesos(this.HostPath) + `,`, + `Mode:` + valueToStringMesos(this.Mode) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *ContainerInfo) String() string { + if this == nil { + return "nil" } - return nil + s := strings.Join([]string{`&ContainerInfo{`, + `Type:` + valueToStringMesos(this.Type) + `,`, + `Volumes:` + strings.Replace(fmt.Sprintf("%v", this.Volumes), "Volume", "Volume", 1) + `,`, + `Docker:` + strings.Replace(fmt.Sprintf("%v", this.Docker), "ContainerInfo_DockerInfo", "ContainerInfo_DockerInfo", 1) + `,`, + `Hostname:` + valueToStringMesos(this.Hostname) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s } -func (this *PerfStatistics) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false +func (this *ContainerInfo_DockerInfo) String() string { + if this == nil { + return "nil" } - - that1, ok := that.(*PerfStatistics) - if !ok { - return false + s := strings.Join([]string{`&ContainerInfo_DockerInfo{`, + `Image:` + valueToStringMesos(this.Image) + `,`, + `Network:` + valueToStringMesos(this.Network) + `,`, + `PortMappings:` + strings.Replace(fmt.Sprintf("%v", this.PortMappings), "ContainerInfo_DockerInfo_PortMapping", "ContainerInfo_DockerInfo_PortMapping", 1) + `,`, + `Privileged:` + valueToStringMesos(this.Privileged) + `,`, + `Parameters:` + strings.Replace(fmt.Sprintf("%v", this.Parameters), "Parameter", "Parameter", 1) + `,`, + `ForcePullImage:` + valueToStringMesos(this.ForcePullImage) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *ContainerInfo_DockerInfo_PortMapping) String() string { + if this == nil { + return "nil" } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false + s := strings.Join([]string{`&ContainerInfo_DockerInfo_PortMapping{`, + `HostPort:` + valueToStringMesos(this.HostPort) + `,`, + `ContainerPort:` + valueToStringMesos(this.ContainerPort) + `,`, + `Protocol:` + valueToStringMesos(this.Protocol) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *Labels) String() string { + if this == nil { + return "nil" } - if this.Timestamp != nil && that1.Timestamp != nil { - if *this.Timestamp != *that1.Timestamp { - return false - } - } else if this.Timestamp != nil { - return false - } else if that1.Timestamp != nil { - return false + s := strings.Join([]string{`&Labels{`, + `Labels:` + strings.Replace(fmt.Sprintf("%v", this.Labels), "Label", "Label", 1) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *Label) String() string { + if this == nil { + return "nil" } - if this.Duration != nil && that1.Duration != nil { - if *this.Duration != *that1.Duration { - return false - } - } else if this.Duration != nil { - return false - } else if that1.Duration != nil { - return false + s := strings.Join([]string{`&Label{`, + `Key:` + valueToStringMesos(this.Key) + `,`, + `Value:` + valueToStringMesos(this.Value) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *Port) String() string { + if this == nil { + return "nil" } - if this.Cycles != nil && that1.Cycles != nil { - if *this.Cycles != *that1.Cycles { - return false - } - } else if this.Cycles != nil { - return false - } else if that1.Cycles != nil { - return false + s := strings.Join([]string{`&Port{`, + `Number:` + valueToStringMesos(this.Number) + `,`, + `Name:` + valueToStringMesos(this.Name) + `,`, + `Protocol:` + valueToStringMesos(this.Protocol) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *Ports) String() string { + if this == nil { + return "nil" } - if this.StalledCyclesFrontend != nil && that1.StalledCyclesFrontend != nil { - if *this.StalledCyclesFrontend != *that1.StalledCyclesFrontend { - return false - } - } else if this.StalledCyclesFrontend != nil { - return false - } else if that1.StalledCyclesFrontend != nil { - return false + s := strings.Join([]string{`&Ports{`, + `Ports:` + strings.Replace(fmt.Sprintf("%v", this.Ports), "Port", "Port", 1) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *DiscoveryInfo) String() string { + if this == nil { + return "nil" } - if this.StalledCyclesBackend != nil && that1.StalledCyclesBackend != nil { - if *this.StalledCyclesBackend != *that1.StalledCyclesBackend { - return false - } - } else if this.StalledCyclesBackend != nil { - return false - } else if that1.StalledCyclesBackend != nil { - return false + s := strings.Join([]string{`&DiscoveryInfo{`, + `Visibility:` + valueToStringMesos(this.Visibility) + `,`, + `Name:` + valueToStringMesos(this.Name) + `,`, + `Environment:` + valueToStringMesos(this.Environment) + `,`, + `Location:` + valueToStringMesos(this.Location) + `,`, + `Version:` + valueToStringMesos(this.Version) + `,`, + `Ports:` + strings.Replace(fmt.Sprintf("%v", this.Ports), "Ports", "Ports", 1) + `,`, + `Labels:` + strings.Replace(fmt.Sprintf("%v", this.Labels), "Labels", "Labels", 1) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func valueToStringMesos(v interface{}) string { + rv := reflect.ValueOf(v) + if rv.IsNil() { + return "nil" } - if this.Instructions != nil && that1.Instructions != nil { - if *this.Instructions != *that1.Instructions { - return false + pv := reflect.Indirect(rv).Interface() + return fmt.Sprintf("*%v", pv) +} +func (m *FrameworkID) Unmarshal(data []byte) error { + var hasFields [1]uint64 + 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 + } } - } else if this.Instructions != nil { - return false - } else if that1.Instructions != nil { - return false - } - if this.CacheReferences != nil && that1.CacheReferences != nil { - if *this.CacheReferences != *that1.CacheReferences { - return false + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", 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 + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(data[iNdEx:postIndex]) + m.Value = &s + iNdEx = postIndex + hasFields[0] |= uint64(0x00000001) + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - } else if this.CacheReferences != nil { - return false - } else if that1.CacheReferences != nil { - return false } - if this.CacheMisses != nil && that1.CacheMisses != nil { - if *this.CacheMisses != *that1.CacheMisses { - return false - } - } else if this.CacheMisses != nil { - return false - } else if that1.CacheMisses != nil { - return false + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("value") } - if this.Branches != nil && that1.Branches != nil { - if *this.Branches != *that1.Branches { - return false + + return nil +} +func (m *OfferID) Unmarshal(data []byte) error { + var hasFields [1]uint64 + 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 + } } - } else if this.Branches != nil { - return false - } else if that1.Branches != nil { - return false - } - if this.BranchMisses != nil && that1.BranchMisses != nil { - if *this.BranchMisses != *that1.BranchMisses { - return false + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", 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 + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(data[iNdEx:postIndex]) + m.Value = &s + iNdEx = postIndex + hasFields[0] |= uint64(0x00000001) + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - } else if this.BranchMisses != nil { - return false - } else if that1.BranchMisses != nil { - return false } - if this.BusCycles != nil && that1.BusCycles != nil { - if *this.BusCycles != *that1.BusCycles { - return false - } - } else if this.BusCycles != nil { - return false - } else if that1.BusCycles != nil { - return false + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("value") } - if this.RefCycles != nil && that1.RefCycles != nil { - if *this.RefCycles != *that1.RefCycles { - return false + + return nil +} +func (m *SlaveID) Unmarshal(data []byte) error { + var hasFields [1]uint64 + 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 + } } - } else if this.RefCycles != nil { - return false - } else if that1.RefCycles != nil { - return false - } - if this.CpuClock != nil && that1.CpuClock != nil { - if *this.CpuClock != *that1.CpuClock { - return false + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", 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 + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(data[iNdEx:postIndex]) + m.Value = &s + iNdEx = postIndex + hasFields[0] |= uint64(0x00000001) + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - } else if this.CpuClock != nil { - return false - } else if that1.CpuClock != nil { - return false } - if this.TaskClock != nil && that1.TaskClock != nil { - if *this.TaskClock != *that1.TaskClock { - return false - } - } else if this.TaskClock != nil { - return false - } else if that1.TaskClock != nil { - return false + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("value") } - if this.PageFaults != nil && that1.PageFaults != nil { - if *this.PageFaults != *that1.PageFaults { - return false + + return nil +} +func (m *TaskID) Unmarshal(data []byte) error { + var hasFields [1]uint64 + 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 + } } - } else if this.PageFaults != nil { - return false - } else if that1.PageFaults != nil { - return false - } - if this.MinorFaults != nil && that1.MinorFaults != nil { - if *this.MinorFaults != *that1.MinorFaults { - return false + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", 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 + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(data[iNdEx:postIndex]) + m.Value = &s + iNdEx = postIndex + hasFields[0] |= uint64(0x00000001) + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - } else if this.MinorFaults != nil { - return false - } else if that1.MinorFaults != nil { - return false } - if this.MajorFaults != nil && that1.MajorFaults != nil { - if *this.MajorFaults != *that1.MajorFaults { - return false - } - } else if this.MajorFaults != nil { - return false - } else if that1.MajorFaults != nil { - return false + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("value") } - if this.ContextSwitches != nil && that1.ContextSwitches != nil { - if *this.ContextSwitches != *that1.ContextSwitches { - return false + + return nil +} +func (m *ExecutorID) Unmarshal(data []byte) error { + var hasFields [1]uint64 + 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 + } } - } else if this.ContextSwitches != nil { - return false - } else if that1.ContextSwitches != nil { - return false - } - if this.CpuMigrations != nil && that1.CpuMigrations != nil { - if *this.CpuMigrations != *that1.CpuMigrations { - return false + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", 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 + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(data[iNdEx:postIndex]) + m.Value = &s + iNdEx = postIndex + hasFields[0] |= uint64(0x00000001) + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - } else if this.CpuMigrations != nil { - return false - } else if that1.CpuMigrations != nil { - return false } - if this.AlignmentFaults != nil && that1.AlignmentFaults != nil { - if *this.AlignmentFaults != *that1.AlignmentFaults { - return false - } - } else if this.AlignmentFaults != nil { - return false - } else if that1.AlignmentFaults != nil { - return false + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("value") } - if this.EmulationFaults != nil && that1.EmulationFaults != nil { - if *this.EmulationFaults != *that1.EmulationFaults { - return false + + return nil +} +func (m *ContainerID) Unmarshal(data []byte) error { + var hasFields [1]uint64 + 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 + } } - } else if this.EmulationFaults != nil { - return false - } else if that1.EmulationFaults != nil { - return false - } - if this.L1DcacheLoads != nil && that1.L1DcacheLoads != nil { - if *this.L1DcacheLoads != *that1.L1DcacheLoads { - return false + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", 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 + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(data[iNdEx:postIndex]) + m.Value = &s + iNdEx = postIndex + hasFields[0] |= uint64(0x00000001) + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - } else if this.L1DcacheLoads != nil { - return false - } else if that1.L1DcacheLoads != nil { - return false } - if this.L1DcacheLoadMisses != nil && that1.L1DcacheLoadMisses != nil { - if *this.L1DcacheLoadMisses != *that1.L1DcacheLoadMisses { - return false - } - } else if this.L1DcacheLoadMisses != nil { - return false - } else if that1.L1DcacheLoadMisses != nil { - return false + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("value") } - if this.L1DcacheStores != nil && that1.L1DcacheStores != nil { - if *this.L1DcacheStores != *that1.L1DcacheStores { - return false + + return nil +} +func (m *FrameworkInfo) Unmarshal(data []byte) error { + var hasFields [1]uint64 + 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 + } } - } else if this.L1DcacheStores != nil { - return false - } else if that1.L1DcacheStores != nil { - return false - } - if this.L1DcacheStoreMisses != nil && that1.L1DcacheStoreMisses != nil { - if *this.L1DcacheStoreMisses != *that1.L1DcacheStoreMisses { - return false + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field User", 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 + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(data[iNdEx:postIndex]) + m.User = &s + iNdEx = postIndex + hasFields[0] |= uint64(0x00000001) + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", 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 + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(data[iNdEx:postIndex]) + m.Name = &s + iNdEx = postIndex + hasFields[0] |= uint64(0x00000002) + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Id == nil { + m.Id = &FrameworkID{} + } + if err := m.Id.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field FailoverTimeout", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + iNdEx += 8 + v = uint64(data[iNdEx-8]) + v |= uint64(data[iNdEx-7]) << 8 + v |= uint64(data[iNdEx-6]) << 16 + v |= uint64(data[iNdEx-5]) << 24 + v |= uint64(data[iNdEx-4]) << 32 + v |= uint64(data[iNdEx-3]) << 40 + v |= uint64(data[iNdEx-2]) << 48 + v |= uint64(data[iNdEx-1]) << 56 + v2 := float64(math.Float64frombits(v)) + m.FailoverTimeout = &v2 + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Checkpoint", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + b := bool(v != 0) + m.Checkpoint = &b + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Role", 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 + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(data[iNdEx:postIndex]) + m.Role = &s + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Hostname", 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 + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(data[iNdEx:postIndex]) + m.Hostname = &s + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Principal", 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 + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(data[iNdEx:postIndex]) + m.Principal = &s + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field WebuiUrl", 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 + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(data[iNdEx:postIndex]) + m.WebuiUrl = &s + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Capabilities", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Capabilities = append(m.Capabilities, &FrameworkInfo_Capability{}) + if err := m.Capabilities[len(m.Capabilities)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - } else if this.L1DcacheStoreMisses != nil { - return false - } else if that1.L1DcacheStoreMisses != nil { - return false } - if this.L1DcachePrefetches != nil && that1.L1DcachePrefetches != nil { - if *this.L1DcachePrefetches != *that1.L1DcachePrefetches { - return false - } - } else if this.L1DcachePrefetches != nil { - return false - } else if that1.L1DcachePrefetches != nil { - return false + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("user") } - if this.L1DcachePrefetchMisses != nil && that1.L1DcachePrefetchMisses != nil { - if *this.L1DcachePrefetchMisses != *that1.L1DcachePrefetchMisses { - return false - } - } else if this.L1DcachePrefetchMisses != nil { - return false - } else if that1.L1DcachePrefetchMisses != nil { - return false + if hasFields[0]&uint64(0x00000002) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("name") } - if this.L1IcacheLoads != nil && that1.L1IcacheLoads != nil { - if *this.L1IcacheLoads != *that1.L1IcacheLoads { - return false + + return nil +} +func (m *FrameworkInfo_Capability) Unmarshal(data []byte) error { + var hasFields [1]uint64 + 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 + } } - } else if this.L1IcacheLoads != nil { - return false - } else if that1.L1IcacheLoads != nil { - return false - } - if this.L1IcacheLoadMisses != nil && that1.L1IcacheLoadMisses != nil { - if *this.L1IcacheLoadMisses != *that1.L1IcacheLoadMisses { - return false + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + var v FrameworkInfo_Capability_Type + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (FrameworkInfo_Capability_Type(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Type = &v + hasFields[0] |= uint64(0x00000001) + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - } else if this.L1IcacheLoadMisses != nil { - return false - } else if that1.L1IcacheLoadMisses != nil { - return false } - if this.L1IcachePrefetches != nil && that1.L1IcachePrefetches != nil { - if *this.L1IcachePrefetches != *that1.L1IcachePrefetches { - return false - } - } else if this.L1IcachePrefetches != nil { - return false - } else if that1.L1IcachePrefetches != nil { - return false + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("type") } - if this.L1IcachePrefetchMisses != nil && that1.L1IcachePrefetchMisses != nil { - if *this.L1IcachePrefetchMisses != *that1.L1IcachePrefetchMisses { - return false + + return nil +} +func (m *HealthCheck) 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 + } } - } else if this.L1IcachePrefetchMisses != nil { - return false - } else if that1.L1IcachePrefetchMisses != nil { - return false - } - if this.LlcLoads != nil && that1.LlcLoads != nil { - if *this.LlcLoads != *that1.LlcLoads { - return false + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Http", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Http == nil { + m.Http = &HealthCheck_HTTP{} + } + if err := m.Http.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field DelaySeconds", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + iNdEx += 8 + v = uint64(data[iNdEx-8]) + v |= uint64(data[iNdEx-7]) << 8 + v |= uint64(data[iNdEx-6]) << 16 + v |= uint64(data[iNdEx-5]) << 24 + v |= uint64(data[iNdEx-4]) << 32 + v |= uint64(data[iNdEx-3]) << 40 + v |= uint64(data[iNdEx-2]) << 48 + v |= uint64(data[iNdEx-1]) << 56 + v2 := float64(math.Float64frombits(v)) + m.DelaySeconds = &v2 + case 3: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field IntervalSeconds", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + iNdEx += 8 + v = uint64(data[iNdEx-8]) + v |= uint64(data[iNdEx-7]) << 8 + v |= uint64(data[iNdEx-6]) << 16 + v |= uint64(data[iNdEx-5]) << 24 + v |= uint64(data[iNdEx-4]) << 32 + v |= uint64(data[iNdEx-3]) << 40 + v |= uint64(data[iNdEx-2]) << 48 + v |= uint64(data[iNdEx-1]) << 56 + v2 := float64(math.Float64frombits(v)) + m.IntervalSeconds = &v2 + case 4: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field TimeoutSeconds", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + iNdEx += 8 + v = uint64(data[iNdEx-8]) + v |= uint64(data[iNdEx-7]) << 8 + v |= uint64(data[iNdEx-6]) << 16 + v |= uint64(data[iNdEx-5]) << 24 + v |= uint64(data[iNdEx-4]) << 32 + v |= uint64(data[iNdEx-3]) << 40 + v |= uint64(data[iNdEx-2]) << 48 + v |= uint64(data[iNdEx-1]) << 56 + v2 := float64(math.Float64frombits(v)) + m.TimeoutSeconds = &v2 + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ConsecutiveFailures", wireType) + } + var v uint32 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint32(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.ConsecutiveFailures = &v + case 6: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field GracePeriodSeconds", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + iNdEx += 8 + v = uint64(data[iNdEx-8]) + v |= uint64(data[iNdEx-7]) << 8 + v |= uint64(data[iNdEx-6]) << 16 + v |= uint64(data[iNdEx-5]) << 24 + v |= uint64(data[iNdEx-4]) << 32 + v |= uint64(data[iNdEx-3]) << 40 + v |= uint64(data[iNdEx-2]) << 48 + v |= uint64(data[iNdEx-1]) << 56 + v2 := float64(math.Float64frombits(v)) + m.GracePeriodSeconds = &v2 + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Command", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Command == nil { + m.Command = &CommandInfo{} + } + if err := m.Command.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - } else if this.LlcLoads != nil { - return false - } else if that1.LlcLoads != nil { - return false } - if this.LlcLoadMisses != nil && that1.LlcLoadMisses != nil { - if *this.LlcLoadMisses != *that1.LlcLoadMisses { - return false + + return nil +} +func (m *HealthCheck_HTTP) Unmarshal(data []byte) error { + var hasFields [1]uint64 + 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 + } } - } else if this.LlcLoadMisses != nil { - return false - } else if that1.LlcLoadMisses != nil { - return false - } - if this.LlcStores != nil && that1.LlcStores != nil { - if *this.LlcStores != *that1.LlcStores { - return false + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Port", wireType) + } + var v uint32 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint32(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Port = &v + hasFields[0] |= uint64(0x00000001) + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Path", 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 + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(data[iNdEx:postIndex]) + m.Path = &s + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Statuses", wireType) + } + var v uint32 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint32(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Statuses = append(m.Statuses, v) + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - } else if this.LlcStores != nil { - return false - } else if that1.LlcStores != nil { - return false } - if this.LlcStoreMisses != nil && that1.LlcStoreMisses != nil { - if *this.LlcStoreMisses != *that1.LlcStoreMisses { - return false - } - } else if this.LlcStoreMisses != nil { - return false - } else if that1.LlcStoreMisses != nil { - return false + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("port") } - if this.LlcPrefetches != nil && that1.LlcPrefetches != nil { - if *this.LlcPrefetches != *that1.LlcPrefetches { - return false + + return nil +} +func (m *CommandInfo) 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 + } } - } else if this.LlcPrefetches != nil { - return false - } else if that1.LlcPrefetches != nil { - return false - } - if this.LlcPrefetchMisses != nil && that1.LlcPrefetchMisses != nil { - if *this.LlcPrefetchMisses != *that1.LlcPrefetchMisses { - return false + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Uris", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Uris = append(m.Uris, &CommandInfo_URI{}) + if err := m.Uris[len(m.Uris)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Environment", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Environment == nil { + m.Environment = &Environment{} + } + if err := m.Environment.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", 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 + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(data[iNdEx:postIndex]) + m.Value = &s + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Container", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Container == nil { + m.Container = &CommandInfo_ContainerInfo{} + } + if err := m.Container.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field User", 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 + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(data[iNdEx:postIndex]) + m.User = &s + iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Shell", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + b := bool(v != 0) + m.Shell = &b + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Arguments", 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 + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Arguments = append(m.Arguments, string(data[iNdEx:postIndex])) + iNdEx = postIndex + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - } else if this.LlcPrefetchMisses != nil { - return false - } else if that1.LlcPrefetchMisses != nil { - return false } - if this.DtlbLoads != nil && that1.DtlbLoads != nil { - if *this.DtlbLoads != *that1.DtlbLoads { - return false + + return nil +} +func (m *CommandInfo_URI) Unmarshal(data []byte) error { + var hasFields [1]uint64 + 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 + } } - } else if this.DtlbLoads != nil { - return false - } else if that1.DtlbLoads != nil { - return false - } - if this.DtlbLoadMisses != nil && that1.DtlbLoadMisses != nil { - if *this.DtlbLoadMisses != *that1.DtlbLoadMisses { - return false + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", 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 + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(data[iNdEx:postIndex]) + m.Value = &s + iNdEx = postIndex + hasFields[0] |= uint64(0x00000001) + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Executable", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + b := bool(v != 0) + m.Executable = &b + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Extract", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + b := bool(v != 0) + m.Extract = &b + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Cache", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + b := bool(v != 0) + m.Cache = &b + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - } else if this.DtlbLoadMisses != nil { - return false - } else if that1.DtlbLoadMisses != nil { - return false } - if this.DtlbStores != nil && that1.DtlbStores != nil { - if *this.DtlbStores != *that1.DtlbStores { - return false - } - } else if this.DtlbStores != nil { - return false - } else if that1.DtlbStores != nil { - return false + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("value") } - if this.DtlbStoreMisses != nil && that1.DtlbStoreMisses != nil { - if *this.DtlbStoreMisses != *that1.DtlbStoreMisses { - return false + + return nil +} +func (m *CommandInfo_ContainerInfo) Unmarshal(data []byte) error { + var hasFields [1]uint64 + 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 + } } - } else if this.DtlbStoreMisses != nil { - return false - } else if that1.DtlbStoreMisses != nil { - return false - } - if this.DtlbPrefetches != nil && that1.DtlbPrefetches != nil { - if *this.DtlbPrefetches != *that1.DtlbPrefetches { - return false + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Image", 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 + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(data[iNdEx:postIndex]) + m.Image = &s + iNdEx = postIndex + hasFields[0] |= uint64(0x00000001) + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Options", 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 + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Options = append(m.Options, string(data[iNdEx:postIndex])) + iNdEx = postIndex + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - } else if this.DtlbPrefetches != nil { - return false - } else if that1.DtlbPrefetches != nil { - return false } - if this.DtlbPrefetchMisses != nil && that1.DtlbPrefetchMisses != nil { - if *this.DtlbPrefetchMisses != *that1.DtlbPrefetchMisses { - return false - } - } else if this.DtlbPrefetchMisses != nil { - return false - } else if that1.DtlbPrefetchMisses != nil { - return false + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("image") } - if this.ItlbLoads != nil && that1.ItlbLoads != nil { - if *this.ItlbLoads != *that1.ItlbLoads { - return false + + return nil +} +func (m *ExecutorInfo) Unmarshal(data []byte) error { + var hasFields [1]uint64 + 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 + } } - } else if this.ItlbLoads != nil { - return false - } else if that1.ItlbLoads != nil { - return false - } - if this.ItlbLoadMisses != nil && that1.ItlbLoadMisses != nil { - if *this.ItlbLoadMisses != *that1.ItlbLoadMisses { - return false + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExecutorId", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ExecutorId == nil { + m.ExecutorId = &ExecutorID{} + } + if err := m.ExecutorId.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + hasFields[0] |= uint64(0x00000001) + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + byteLen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + byteLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Data = append([]byte{}, data[iNdEx:postIndex]...) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Resources", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Resources = append(m.Resources, &Resource{}) + if err := m.Resources[len(m.Resources)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Command", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Command == nil { + m.Command = &CommandInfo{} + } + if err := m.Command.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + hasFields[0] |= uint64(0x00000002) + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FrameworkId", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.FrameworkId == nil { + m.FrameworkId = &FrameworkID{} + } + if err := m.FrameworkId.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", 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 + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(data[iNdEx:postIndex]) + m.Name = &s + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Source", 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 + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(data[iNdEx:postIndex]) + m.Source = &s + iNdEx = postIndex + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Container", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Container == nil { + m.Container = &ContainerInfo{} + } + if err := m.Container.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 12: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Discovery", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Discovery == nil { + m.Discovery = &DiscoveryInfo{} + } + if err := m.Discovery.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - } else if this.ItlbLoadMisses != nil { - return false - } else if that1.ItlbLoadMisses != nil { - return false } - if this.BranchLoads != nil && that1.BranchLoads != nil { - if *this.BranchLoads != *that1.BranchLoads { - return false - } - } else if this.BranchLoads != nil { - return false - } else if that1.BranchLoads != nil { - return false + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("executor_id") } - if this.BranchLoadMisses != nil && that1.BranchLoadMisses != nil { - if *this.BranchLoadMisses != *that1.BranchLoadMisses { - return false - } - } else if this.BranchLoadMisses != nil { - return false - } else if that1.BranchLoadMisses != nil { - return false + if hasFields[0]&uint64(0x00000002) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("command") } - if this.NodeLoads != nil && that1.NodeLoads != nil { - if *this.NodeLoads != *that1.NodeLoads { - return false + + return nil +} +func (m *MasterInfo) Unmarshal(data []byte) error { + var hasFields [1]uint64 + 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 Id", 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 + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(data[iNdEx:postIndex]) + m.Id = &s + iNdEx = postIndex + hasFields[0] |= uint64(0x00000001) + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Ip", wireType) + } + var v uint32 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint32(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Ip = &v + hasFields[0] |= uint64(0x00000002) + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Port", wireType) + } + var v uint32 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint32(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Port = &v + hasFields[0] |= uint64(0x00000004) + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pid", 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 + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(data[iNdEx:postIndex]) + m.Pid = &s + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Hostname", 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 + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(data[iNdEx:postIndex]) + m.Hostname = &s + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Version", 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 + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(data[iNdEx:postIndex]) + m.Version = &s + iNdEx = postIndex + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - } else if this.NodeLoads != nil { - return false - } else if that1.NodeLoads != nil { - return false } - if this.NodeLoadMisses != nil && that1.NodeLoadMisses != nil { - if *this.NodeLoadMisses != *that1.NodeLoadMisses { - return false - } - } else if this.NodeLoadMisses != nil { - return false - } else if that1.NodeLoadMisses != nil { - return false + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("id") } - if this.NodeStores != nil && that1.NodeStores != nil { - if *this.NodeStores != *that1.NodeStores { - return false - } - } else if this.NodeStores != nil { - return false - } else if that1.NodeStores != nil { - return false + if hasFields[0]&uint64(0x00000002) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("ip") } - if this.NodeStoreMisses != nil && that1.NodeStoreMisses != nil { - if *this.NodeStoreMisses != *that1.NodeStoreMisses { - return false - } - } else if this.NodeStoreMisses != nil { - return false - } else if that1.NodeStoreMisses != nil { - return false + if hasFields[0]&uint64(0x00000004) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("port") } - if this.NodePrefetches != nil && that1.NodePrefetches != nil { - if *this.NodePrefetches != *that1.NodePrefetches { - return false + + return nil +} +func (m *SlaveInfo) Unmarshal(data []byte) error { + var hasFields [1]uint64 + 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 + } } - } else if this.NodePrefetches != nil { - return false - } else if that1.NodePrefetches != nil { - return false - } - if this.NodePrefetchMisses != nil && that1.NodePrefetchMisses != nil { - if *this.NodePrefetchMisses != *that1.NodePrefetchMisses { - return false + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Hostname", 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 + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(data[iNdEx:postIndex]) + m.Hostname = &s + iNdEx = postIndex + hasFields[0] |= uint64(0x00000001) + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Resources", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Resources = append(m.Resources, &Resource{}) + if err := m.Resources[len(m.Resources)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Attributes", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Attributes = append(m.Attributes, &Attribute{}) + if err := m.Attributes[len(m.Attributes)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Id == nil { + m.Id = &SlaveID{} + } + if err := m.Id.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Checkpoint", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + b := bool(v != 0) + m.Checkpoint = &b + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Port", wireType) + } + var v int32 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (int32(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Port = &v + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - } else if this.NodePrefetchMisses != nil { - return false - } else if that1.NodePrefetchMisses != nil { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false } - return true -} -func (this *Request) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that == nil && this != nil") + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("hostname") } - that1, ok := that.(*Request) - if !ok { - return fmt3.Errorf("that is not of type *Request") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that is type *Request but is nil && this != nil") - } else if this == nil { - return fmt3.Errorf("that is type *Requestbut is not nil && this == nil") - } - if !this.SlaveId.Equal(that1.SlaveId) { - return fmt3.Errorf("SlaveId this(%v) Not Equal that(%v)", this.SlaveId, that1.SlaveId) - } - if len(this.Resources) != len(that1.Resources) { - return fmt3.Errorf("Resources this(%v) Not Equal that(%v)", len(this.Resources), len(that1.Resources)) - } - for i := range this.Resources { - if !this.Resources[i].Equal(that1.Resources[i]) { - return fmt3.Errorf("Resources this[%v](%v) Not Equal that[%v](%v)", i, this.Resources[i], i, that1.Resources[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 *Request) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*Request) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if !this.SlaveId.Equal(that1.SlaveId) { - return false - } - if len(this.Resources) != len(that1.Resources) { - return false - } - for i := range this.Resources { - if !this.Resources[i].Equal(that1.Resources[i]) { - return false - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Offer) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*Offer) - if !ok { - return fmt3.Errorf("that is not of type *Offer") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that is type *Offer but is nil && this != nil") - } else if this == nil { - return fmt3.Errorf("that is type *Offerbut is not nil && this == nil") - } - if !this.Id.Equal(that1.Id) { - return fmt3.Errorf("Id this(%v) Not Equal that(%v)", this.Id, that1.Id) - } - if !this.FrameworkId.Equal(that1.FrameworkId) { - return fmt3.Errorf("FrameworkId this(%v) Not Equal that(%v)", this.FrameworkId, that1.FrameworkId) - } - if !this.SlaveId.Equal(that1.SlaveId) { - return fmt3.Errorf("SlaveId this(%v) Not Equal that(%v)", this.SlaveId, that1.SlaveId) - } - if this.Hostname != nil && that1.Hostname != nil { - if *this.Hostname != *that1.Hostname { - return fmt3.Errorf("Hostname this(%v) Not Equal that(%v)", *this.Hostname, *that1.Hostname) +func (m *Value) Unmarshal(data []byte) error { + var hasFields [1]uint64 + 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 + } } - } else if this.Hostname != nil { - return fmt3.Errorf("this.Hostname == nil && that.Hostname != nil") - } else if that1.Hostname != nil { - return fmt3.Errorf("Hostname this(%v) Not Equal that(%v)", this.Hostname, that1.Hostname) - } - if len(this.Resources) != len(that1.Resources) { - return fmt3.Errorf("Resources this(%v) Not Equal that(%v)", len(this.Resources), len(that1.Resources)) - } - for i := range this.Resources { - if !this.Resources[i].Equal(that1.Resources[i]) { - return fmt3.Errorf("Resources this[%v](%v) Not Equal that[%v](%v)", i, this.Resources[i], i, that1.Resources[i]) + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + var v Value_Type + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (Value_Type(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Type = &v + hasFields[0] |= uint64(0x00000001) + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Scalar", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Scalar == nil { + m.Scalar = &Value_Scalar{} + } + if err := m.Scalar.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Ranges", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Ranges == nil { + m.Ranges = &Value_Ranges{} + } + if err := m.Ranges.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Set", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Set == nil { + m.Set = &Value_Set{} + } + if err := m.Set.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Text", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Text == nil { + m.Text = &Value_Text{} + } + if err := m.Text.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } } - if len(this.Attributes) != len(that1.Attributes) { - return fmt3.Errorf("Attributes this(%v) Not Equal that(%v)", len(this.Attributes), len(that1.Attributes)) + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("type") } - for i := range this.Attributes { - if !this.Attributes[i].Equal(that1.Attributes[i]) { - return fmt3.Errorf("Attributes this[%v](%v) Not Equal that[%v](%v)", i, this.Attributes[i], i, that1.Attributes[i]) + + return nil +} +func (m *Value_Scalar) Unmarshal(data []byte) error { + var hasFields [1]uint64 + 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 + } } - } - if len(this.ExecutorIds) != len(that1.ExecutorIds) { - return fmt3.Errorf("ExecutorIds this(%v) Not Equal that(%v)", len(this.ExecutorIds), len(that1.ExecutorIds)) - } - for i := range this.ExecutorIds { - if !this.ExecutorIds[i].Equal(that1.ExecutorIds[i]) { - return fmt3.Errorf("ExecutorIds this[%v](%v) Not Equal that[%v](%v)", i, this.ExecutorIds[i], i, that1.ExecutorIds[i]) + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + iNdEx += 8 + v = uint64(data[iNdEx-8]) + v |= uint64(data[iNdEx-7]) << 8 + v |= uint64(data[iNdEx-6]) << 16 + v |= uint64(data[iNdEx-5]) << 24 + v |= uint64(data[iNdEx-4]) << 32 + v |= uint64(data[iNdEx-3]) << 40 + v |= uint64(data[iNdEx-2]) << 48 + v |= uint64(data[iNdEx-1]) << 56 + v2 := float64(math.Float64frombits(v)) + m.Value = &v2 + hasFields[0] |= uint64(0x00000001) + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } } - 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) + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("value") } + return nil } -func (this *Offer) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*Offer) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true +func (m *Value_Range) Unmarshal(data []byte) error { + var hasFields [1]uint64 + 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 + } } - return false - } else if this == nil { - return false - } - if !this.Id.Equal(that1.Id) { - return false - } - if !this.FrameworkId.Equal(that1.FrameworkId) { - return false - } - if !this.SlaveId.Equal(that1.SlaveId) { - return false - } - if this.Hostname != nil && that1.Hostname != nil { - if *this.Hostname != *that1.Hostname { - return false + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Begin", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Begin = &v + hasFields[0] |= uint64(0x00000001) + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field End", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.End = &v + hasFields[0] |= uint64(0x00000002) + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - } else if this.Hostname != nil { - return false - } else if that1.Hostname != nil { - return false } - if len(this.Resources) != len(that1.Resources) { - return false - } - for i := range this.Resources { - if !this.Resources[i].Equal(that1.Resources[i]) { - return false - } + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("begin") } - if len(this.Attributes) != len(that1.Attributes) { - return false + if hasFields[0]&uint64(0x00000002) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("end") } - for i := range this.Attributes { - if !this.Attributes[i].Equal(that1.Attributes[i]) { - return false + + return nil +} +func (m *Value_Ranges) 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 + } } - } - if len(this.ExecutorIds) != len(that1.ExecutorIds) { - return false - } - for i := range this.ExecutorIds { - if !this.ExecutorIds[i].Equal(that1.ExecutorIds[i]) { - return false + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Range", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Range = append(m.Range, &Value_Range{}) + if err := m.Range[len(m.Range)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true + + return nil } -func (this *TaskInfo) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil +func (m *Value_Set) 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 Item", 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 + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Item = append(m.Item, string(data[iNdEx:postIndex])) + iNdEx = postIndex + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - return fmt3.Errorf("that == nil && this != nil") } - that1, ok := that.(*TaskInfo) - if !ok { - return fmt3.Errorf("that is not of type *TaskInfo") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that is type *TaskInfo but is nil && this != nil") - } else if this == nil { - return fmt3.Errorf("that is type *TaskInfobut is not nil && this == nil") - } - if this.Name != nil && that1.Name != nil { - if *this.Name != *that1.Name { - return fmt3.Errorf("Name this(%v) Not Equal that(%v)", *this.Name, *that1.Name) + return nil +} +func (m *Value_Text) Unmarshal(data []byte) error { + var hasFields [1]uint64 + 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 + } } - } else if this.Name != nil { - return fmt3.Errorf("this.Name == nil && that.Name != nil") - } else if that1.Name != nil { - return fmt3.Errorf("Name this(%v) Not Equal that(%v)", this.Name, that1.Name) - } - if !this.TaskId.Equal(that1.TaskId) { - return fmt3.Errorf("TaskId this(%v) Not Equal that(%v)", this.TaskId, that1.TaskId) - } - if !this.SlaveId.Equal(that1.SlaveId) { - return fmt3.Errorf("SlaveId this(%v) Not Equal that(%v)", this.SlaveId, that1.SlaveId) - } - if len(this.Resources) != len(that1.Resources) { - return fmt3.Errorf("Resources this(%v) Not Equal that(%v)", len(this.Resources), len(that1.Resources)) - } - for i := range this.Resources { - if !this.Resources[i].Equal(that1.Resources[i]) { - return fmt3.Errorf("Resources this[%v](%v) Not Equal that[%v](%v)", i, this.Resources[i], i, that1.Resources[i]) + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", 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 + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(data[iNdEx:postIndex]) + m.Value = &s + iNdEx = postIndex + hasFields[0] |= uint64(0x00000001) + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } } - if !this.Executor.Equal(that1.Executor) { - return fmt3.Errorf("Executor this(%v) Not Equal that(%v)", this.Executor, that1.Executor) - } - if !this.Command.Equal(that1.Command) { - return fmt3.Errorf("Command this(%v) Not Equal that(%v)", this.Command, that1.Command) - } - if !this.Container.Equal(that1.Container) { - return fmt3.Errorf("Container this(%v) Not Equal that(%v)", this.Container, that1.Container) - } - if !bytes.Equal(this.Data, that1.Data) { - return fmt3.Errorf("Data this(%v) Not Equal that(%v)", this.Data, that1.Data) - } - if !this.HealthCheck.Equal(that1.HealthCheck) { - return fmt3.Errorf("HealthCheck this(%v) Not Equal that(%v)", this.HealthCheck, that1.HealthCheck) - } - 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) + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("value") } + return nil } -func (this *TaskInfo) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*TaskInfo) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if this.Name != nil && that1.Name != nil { - if *this.Name != *that1.Name { - return false +func (m *Attribute) Unmarshal(data []byte) error { + var hasFields [1]uint64 + 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 + } } - } else if this.Name != nil { - return false - } else if that1.Name != nil { - return false - } - if !this.TaskId.Equal(that1.TaskId) { - return false - } - if !this.SlaveId.Equal(that1.SlaveId) { - return false - } - if len(this.Resources) != len(that1.Resources) { - return false - } - for i := range this.Resources { - if !this.Resources[i].Equal(that1.Resources[i]) { - return false + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", 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 + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(data[iNdEx:postIndex]) + m.Name = &s + iNdEx = postIndex + hasFields[0] |= uint64(0x00000001) + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + var v Value_Type + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (Value_Type(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Type = &v + hasFields[0] |= uint64(0x00000002) + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Scalar", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Scalar == nil { + m.Scalar = &Value_Scalar{} + } + if err := m.Scalar.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Ranges", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Ranges == nil { + m.Ranges = &Value_Ranges{} + } + if err := m.Ranges.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Text", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Text == nil { + m.Text = &Value_Text{} + } + if err := m.Text.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Set", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Set == nil { + m.Set = &Value_Set{} + } + if err := m.Set.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } } - if !this.Executor.Equal(that1.Executor) { - return false - } - if !this.Command.Equal(that1.Command) { - return false - } - if !this.Container.Equal(that1.Container) { - return false - } - if !bytes.Equal(this.Data, that1.Data) { - return false - } - if !this.HealthCheck.Equal(that1.HealthCheck) { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("name") } - return true -} -func (this *TaskStatus) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that == nil && this != nil") + if hasFields[0]&uint64(0x00000002) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("type") } - that1, ok := that.(*TaskStatus) - if !ok { - return fmt3.Errorf("that is not of type *TaskStatus") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that is type *TaskStatus but is nil && this != nil") - } else if this == nil { - return fmt3.Errorf("that is type *TaskStatusbut is not nil && this == nil") - } - if !this.TaskId.Equal(that1.TaskId) { - return fmt3.Errorf("TaskId this(%v) Not Equal that(%v)", this.TaskId, that1.TaskId) - } - if this.State != nil && that1.State != nil { - if *this.State != *that1.State { - return fmt3.Errorf("State this(%v) Not Equal that(%v)", *this.State, *that1.State) - } - } else if this.State != nil { - return fmt3.Errorf("this.State == nil && that.State != nil") - } else if that1.State != nil { - return fmt3.Errorf("State this(%v) Not Equal that(%v)", this.State, that1.State) - } - if this.Message != nil && that1.Message != nil { - if *this.Message != *that1.Message { - return fmt3.Errorf("Message this(%v) Not Equal that(%v)", *this.Message, *that1.Message) - } - } else if this.Message != nil { - return fmt3.Errorf("this.Message == nil && that.Message != nil") - } else if that1.Message != nil { - return fmt3.Errorf("Message this(%v) Not Equal that(%v)", this.Message, that1.Message) - } - if this.Source != nil && that1.Source != nil { - if *this.Source != *that1.Source { - return fmt3.Errorf("Source this(%v) Not Equal that(%v)", *this.Source, *that1.Source) - } - } else if this.Source != nil { - return fmt3.Errorf("this.Source == nil && that.Source != nil") - } else if that1.Source != nil { - return fmt3.Errorf("Source this(%v) Not Equal that(%v)", this.Source, that1.Source) - } - if this.Reason != nil && that1.Reason != nil { - if *this.Reason != *that1.Reason { - return fmt3.Errorf("Reason this(%v) Not Equal that(%v)", *this.Reason, *that1.Reason) + return nil +} +func (m *Resource) Unmarshal(data []byte) error { + var hasFields [1]uint64 + 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 + } } - } else if this.Reason != nil { - return fmt3.Errorf("this.Reason == nil && that.Reason != nil") - } else if that1.Reason != nil { - return fmt3.Errorf("Reason this(%v) Not Equal that(%v)", this.Reason, that1.Reason) - } - if !bytes.Equal(this.Data, that1.Data) { - return fmt3.Errorf("Data this(%v) Not Equal that(%v)", this.Data, that1.Data) - } - if !this.SlaveId.Equal(that1.SlaveId) { - return fmt3.Errorf("SlaveId this(%v) Not Equal that(%v)", this.SlaveId, that1.SlaveId) - } - if !this.ExecutorId.Equal(that1.ExecutorId) { - return fmt3.Errorf("ExecutorId this(%v) Not Equal that(%v)", this.ExecutorId, that1.ExecutorId) - } - if this.Timestamp != nil && that1.Timestamp != nil { - if *this.Timestamp != *that1.Timestamp { - return fmt3.Errorf("Timestamp this(%v) Not Equal that(%v)", *this.Timestamp, *that1.Timestamp) + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", 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 + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(data[iNdEx:postIndex]) + m.Name = &s + iNdEx = postIndex + hasFields[0] |= uint64(0x00000001) + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + var v Value_Type + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (Value_Type(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Type = &v + hasFields[0] |= uint64(0x00000002) + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Scalar", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Scalar == nil { + m.Scalar = &Value_Scalar{} + } + if err := m.Scalar.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Ranges", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Ranges == nil { + m.Ranges = &Value_Ranges{} + } + if err := m.Ranges.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Set", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Set == nil { + m.Set = &Value_Set{} + } + if err := m.Set.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Role", 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 + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(data[iNdEx:postIndex]) + m.Role = &s + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Disk", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Disk == nil { + m.Disk = &Resource_DiskInfo{} + } + if err := m.Disk.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Reservation", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Reservation == nil { + m.Reservation = &Resource_ReservationInfo{} + } + if err := m.Reservation.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Revocable", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Revocable == nil { + m.Revocable = &Resource_RevocableInfo{} + } + if err := m.Revocable.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - } else if this.Timestamp != nil { - return fmt3.Errorf("this.Timestamp == nil && that.Timestamp != nil") - } else if that1.Timestamp != nil { - return fmt3.Errorf("Timestamp this(%v) Not Equal that(%v)", this.Timestamp, that1.Timestamp) } - if this.Healthy != nil && that1.Healthy != nil { - if *this.Healthy != *that1.Healthy { - return fmt3.Errorf("Healthy this(%v) Not Equal that(%v)", *this.Healthy, *that1.Healthy) - } - } else if this.Healthy != nil { - return fmt3.Errorf("this.Healthy == nil && that.Healthy != nil") - } else if that1.Healthy != nil { - return fmt3.Errorf("Healthy this(%v) Not Equal that(%v)", this.Healthy, that1.Healthy) + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("name") } - 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) + if hasFields[0]&uint64(0x00000002) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("type") } + return nil } -func (this *TaskStatus) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*TaskStatus) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if !this.TaskId.Equal(that1.TaskId) { - return false - } - if this.State != nil && that1.State != nil { - if *this.State != *that1.State { - return false - } - } else if this.State != nil { - return false - } else if that1.State != nil { - return false - } - if this.Message != nil && that1.Message != nil { - if *this.Message != *that1.Message { - return false - } - } else if this.Message != nil { - return false - } else if that1.Message != nil { - return false - } - if this.Source != nil && that1.Source != nil { - if *this.Source != *that1.Source { - return false - } - } else if this.Source != nil { - return false - } else if that1.Source != nil { - return false - } - if this.Reason != nil && that1.Reason != nil { - if *this.Reason != *that1.Reason { - return false - } - } else if this.Reason != nil { - return false - } else if that1.Reason != nil { - return false - } - if !bytes.Equal(this.Data, that1.Data) { - return false - } - if !this.SlaveId.Equal(that1.SlaveId) { - return false - } - if !this.ExecutorId.Equal(that1.ExecutorId) { - return false - } - if this.Timestamp != nil && that1.Timestamp != nil { - if *this.Timestamp != *that1.Timestamp { - return false +func (m *Resource_ReservationInfo) Unmarshal(data []byte) error { + var hasFields [1]uint64 + 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 + } } - } else if this.Timestamp != nil { - return false - } else if that1.Timestamp != nil { - return false - } - if this.Healthy != nil && that1.Healthy != nil { - if *this.Healthy != *that1.Healthy { - return false + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Principal", 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 + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(data[iNdEx:postIndex]) + m.Principal = &s + iNdEx = postIndex + hasFields[0] |= uint64(0x00000001) + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - } else if this.Healthy != nil { - return false - } else if that1.Healthy != nil { - return false } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("principal") } - return true + + return nil } -func (this *Filters) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil +func (m *Resource_DiskInfo) 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 + } } - return fmt3.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*Filters) - if !ok { - return fmt3.Errorf("that is not of type *Filters") - } - if that1 == nil { - if this == nil { - return nil + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Persistence", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Persistence == nil { + m.Persistence = &Resource_DiskInfo_Persistence{} + } + if err := m.Persistence.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Volume", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Volume == nil { + m.Volume = &Volume{} + } + if err := m.Volume.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - return fmt3.Errorf("that is type *Filters but is nil && this != nil") - } else if this == nil { - return fmt3.Errorf("that is type *Filtersbut is not nil && this == nil") } - if this.RefuseSeconds != nil && that1.RefuseSeconds != nil { - if *this.RefuseSeconds != *that1.RefuseSeconds { - return fmt3.Errorf("RefuseSeconds this(%v) Not Equal that(%v)", *this.RefuseSeconds, *that1.RefuseSeconds) + + return nil +} +func (m *Resource_DiskInfo_Persistence) Unmarshal(data []byte) error { + var hasFields [1]uint64 + 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 Id", 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 + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(data[iNdEx:postIndex]) + m.Id = &s + iNdEx = postIndex + hasFields[0] |= uint64(0x00000001) + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - } else if this.RefuseSeconds != nil { - return fmt3.Errorf("this.RefuseSeconds == nil && that.RefuseSeconds != nil") - } else if that1.RefuseSeconds != nil { - return fmt3.Errorf("RefuseSeconds this(%v) Not Equal that(%v)", this.RefuseSeconds, that1.RefuseSeconds) } - 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) + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("id") } + return nil } -func (this *Filters) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true +func (m *Resource_RevocableInfo) 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) + switch fieldNum { + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - return false } - that1, ok := that.(*Filters) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true + return nil +} +func (m *TrafficControlStatistics) Unmarshal(data []byte) error { + var hasFields [1]uint64 + 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 + } } - return false - } else if this == nil { - return false - } - if this.RefuseSeconds != nil && that1.RefuseSeconds != nil { - if *this.RefuseSeconds != *that1.RefuseSeconds { - return false + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", 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 + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(data[iNdEx:postIndex]) + m.Id = &s + iNdEx = postIndex + hasFields[0] |= uint64(0x00000001) + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Backlog", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Backlog = &v + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Bytes", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Bytes = &v + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Drops", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Drops = &v + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Overlimits", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Overlimits = &v + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Packets", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Packets = &v + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Qlen", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Qlen = &v + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Ratebps", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Ratebps = &v + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Ratepps", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Ratepps = &v + case 10: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Requeues", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Requeues = &v + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - } else if this.RefuseSeconds != nil { - return false - } else if that1.RefuseSeconds != nil { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false } - return true -} -func (this *Environment) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that == nil && this != nil") + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("id") } - that1, ok := that.(*Environment) - if !ok { - return fmt3.Errorf("that is not of type *Environment") - } - if that1 == nil { - if this == nil { - return nil + return nil +} +func (m *ResourceStatistics) Unmarshal(data []byte) error { + var hasFields [1]uint64 + 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 + } } - return fmt3.Errorf("that is type *Environment but is nil && this != nil") - } else if this == nil { - return fmt3.Errorf("that is type *Environmentbut is not nil && this == nil") - } - if len(this.Variables) != len(that1.Variables) { - return fmt3.Errorf("Variables this(%v) Not Equal that(%v)", len(this.Variables), len(that1.Variables)) - } - for i := range this.Variables { - if !this.Variables[i].Equal(that1.Variables[i]) { - return fmt3.Errorf("Variables this[%v](%v) Not Equal that[%v](%v)", i, this.Variables[i], i, that1.Variables[i]) + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + iNdEx += 8 + v = uint64(data[iNdEx-8]) + v |= uint64(data[iNdEx-7]) << 8 + v |= uint64(data[iNdEx-6]) << 16 + v |= uint64(data[iNdEx-5]) << 24 + v |= uint64(data[iNdEx-4]) << 32 + v |= uint64(data[iNdEx-3]) << 40 + v |= uint64(data[iNdEx-2]) << 48 + v |= uint64(data[iNdEx-1]) << 56 + v2 := float64(math.Float64frombits(v)) + m.Timestamp = &v2 + hasFields[0] |= uint64(0x00000001) + case 2: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field CpusUserTimeSecs", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + iNdEx += 8 + v = uint64(data[iNdEx-8]) + v |= uint64(data[iNdEx-7]) << 8 + v |= uint64(data[iNdEx-6]) << 16 + v |= uint64(data[iNdEx-5]) << 24 + v |= uint64(data[iNdEx-4]) << 32 + v |= uint64(data[iNdEx-3]) << 40 + v |= uint64(data[iNdEx-2]) << 48 + v |= uint64(data[iNdEx-1]) << 56 + v2 := float64(math.Float64frombits(v)) + m.CpusUserTimeSecs = &v2 + case 3: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field CpusSystemTimeSecs", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + iNdEx += 8 + v = uint64(data[iNdEx-8]) + v |= uint64(data[iNdEx-7]) << 8 + v |= uint64(data[iNdEx-6]) << 16 + v |= uint64(data[iNdEx-5]) << 24 + v |= uint64(data[iNdEx-4]) << 32 + v |= uint64(data[iNdEx-3]) << 40 + v |= uint64(data[iNdEx-2]) << 48 + v |= uint64(data[iNdEx-1]) << 56 + v2 := float64(math.Float64frombits(v)) + m.CpusSystemTimeSecs = &v2 + case 4: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field CpusLimit", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + iNdEx += 8 + v = uint64(data[iNdEx-8]) + v |= uint64(data[iNdEx-7]) << 8 + v |= uint64(data[iNdEx-6]) << 16 + v |= uint64(data[iNdEx-5]) << 24 + v |= uint64(data[iNdEx-4]) << 32 + v |= uint64(data[iNdEx-3]) << 40 + v |= uint64(data[iNdEx-2]) << 48 + v |= uint64(data[iNdEx-1]) << 56 + v2 := float64(math.Float64frombits(v)) + m.CpusLimit = &v2 + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MemRssBytes", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.MemRssBytes = &v + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MemLimitBytes", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.MemLimitBytes = &v + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CpusNrPeriods", wireType) + } + var v uint32 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint32(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.CpusNrPeriods = &v + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CpusNrThrottled", wireType) + } + var v uint32 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint32(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.CpusNrThrottled = &v + case 9: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field CpusThrottledTimeSecs", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + iNdEx += 8 + v = uint64(data[iNdEx-8]) + v |= uint64(data[iNdEx-7]) << 8 + v |= uint64(data[iNdEx-6]) << 16 + v |= uint64(data[iNdEx-5]) << 24 + v |= uint64(data[iNdEx-4]) << 32 + v |= uint64(data[iNdEx-3]) << 40 + v |= uint64(data[iNdEx-2]) << 48 + v |= uint64(data[iNdEx-1]) << 56 + v2 := float64(math.Float64frombits(v)) + m.CpusThrottledTimeSecs = &v2 + case 10: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MemFileBytes", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.MemFileBytes = &v + case 11: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MemAnonBytes", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.MemAnonBytes = &v + case 12: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MemMappedFileBytes", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.MemMappedFileBytes = &v + case 13: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Perf", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Perf == nil { + m.Perf = &PerfStatistics{} + } + if err := m.Perf.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 14: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NetRxPackets", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.NetRxPackets = &v + case 15: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NetRxBytes", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.NetRxBytes = &v + case 16: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NetRxErrors", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.NetRxErrors = &v + case 17: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NetRxDropped", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.NetRxDropped = &v + case 18: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NetTxPackets", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.NetTxPackets = &v + case 19: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NetTxBytes", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.NetTxBytes = &v + case 20: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NetTxErrors", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.NetTxErrors = &v + case 21: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NetTxDropped", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.NetTxDropped = &v + case 22: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field NetTcpRttMicrosecsP50", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + iNdEx += 8 + v = uint64(data[iNdEx-8]) + v |= uint64(data[iNdEx-7]) << 8 + v |= uint64(data[iNdEx-6]) << 16 + v |= uint64(data[iNdEx-5]) << 24 + v |= uint64(data[iNdEx-4]) << 32 + v |= uint64(data[iNdEx-3]) << 40 + v |= uint64(data[iNdEx-2]) << 48 + v |= uint64(data[iNdEx-1]) << 56 + v2 := float64(math.Float64frombits(v)) + m.NetTcpRttMicrosecsP50 = &v2 + case 23: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field NetTcpRttMicrosecsP90", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + iNdEx += 8 + v = uint64(data[iNdEx-8]) + v |= uint64(data[iNdEx-7]) << 8 + v |= uint64(data[iNdEx-6]) << 16 + v |= uint64(data[iNdEx-5]) << 24 + v |= uint64(data[iNdEx-4]) << 32 + v |= uint64(data[iNdEx-3]) << 40 + v |= uint64(data[iNdEx-2]) << 48 + v |= uint64(data[iNdEx-1]) << 56 + v2 := float64(math.Float64frombits(v)) + m.NetTcpRttMicrosecsP90 = &v2 + case 24: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field NetTcpRttMicrosecsP95", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + iNdEx += 8 + v = uint64(data[iNdEx-8]) + v |= uint64(data[iNdEx-7]) << 8 + v |= uint64(data[iNdEx-6]) << 16 + v |= uint64(data[iNdEx-5]) << 24 + v |= uint64(data[iNdEx-4]) << 32 + v |= uint64(data[iNdEx-3]) << 40 + v |= uint64(data[iNdEx-2]) << 48 + v |= uint64(data[iNdEx-1]) << 56 + v2 := float64(math.Float64frombits(v)) + m.NetTcpRttMicrosecsP95 = &v2 + case 25: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field NetTcpRttMicrosecsP99", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + iNdEx += 8 + v = uint64(data[iNdEx-8]) + v |= uint64(data[iNdEx-7]) << 8 + v |= uint64(data[iNdEx-6]) << 16 + v |= uint64(data[iNdEx-5]) << 24 + v |= uint64(data[iNdEx-4]) << 32 + v |= uint64(data[iNdEx-3]) << 40 + v |= uint64(data[iNdEx-2]) << 48 + v |= uint64(data[iNdEx-1]) << 56 + v2 := float64(math.Float64frombits(v)) + m.NetTcpRttMicrosecsP99 = &v2 + case 26: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DiskLimitBytes", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.DiskLimitBytes = &v + case 27: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DiskUsedBytes", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.DiskUsedBytes = &v + case 28: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field NetTcpActiveConnections", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + iNdEx += 8 + v = uint64(data[iNdEx-8]) + v |= uint64(data[iNdEx-7]) << 8 + v |= uint64(data[iNdEx-6]) << 16 + v |= uint64(data[iNdEx-5]) << 24 + v |= uint64(data[iNdEx-4]) << 32 + v |= uint64(data[iNdEx-3]) << 40 + v |= uint64(data[iNdEx-2]) << 48 + v |= uint64(data[iNdEx-1]) << 56 + v2 := float64(math.Float64frombits(v)) + m.NetTcpActiveConnections = &v2 + case 29: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field NetTcpTimeWaitConnections", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + iNdEx += 8 + v = uint64(data[iNdEx-8]) + v |= uint64(data[iNdEx-7]) << 8 + v |= uint64(data[iNdEx-6]) << 16 + v |= uint64(data[iNdEx-5]) << 24 + v |= uint64(data[iNdEx-4]) << 32 + v |= uint64(data[iNdEx-3]) << 40 + v |= uint64(data[iNdEx-2]) << 48 + v |= uint64(data[iNdEx-1]) << 56 + v2 := float64(math.Float64frombits(v)) + m.NetTcpTimeWaitConnections = &v2 + case 30: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Processes", wireType) + } + var v uint32 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint32(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Processes = &v + case 31: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Threads", wireType) + } + var v uint32 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint32(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Threads = &v + case 32: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MemLowPressureCounter", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.MemLowPressureCounter = &v + case 33: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MemMediumPressureCounter", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.MemMediumPressureCounter = &v + case 34: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MemCriticalPressureCounter", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.MemCriticalPressureCounter = &v + case 35: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NetTrafficControlStatistics", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.NetTrafficControlStatistics = append(m.NetTrafficControlStatistics, &TrafficControlStatistics{}) + if err := m.NetTrafficControlStatistics[len(m.NetTrafficControlStatistics)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 36: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MemTotalBytes", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.MemTotalBytes = &v + case 37: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MemTotalMemswBytes", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.MemTotalMemswBytes = &v + case 38: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MemSoftLimitBytes", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.MemSoftLimitBytes = &v + case 39: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MemCacheBytes", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.MemCacheBytes = &v + case 40: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MemSwapBytes", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.MemSwapBytes = &v + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } } - 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) + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("timestamp") } + return nil } -func (this *Environment) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*Environment) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if len(this.Variables) != len(that1.Variables) { - return false - } - for i := range this.Variables { - if !this.Variables[i].Equal(that1.Variables[i]) { - return false +func (m *ResourceUsage) 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 + } } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Environment_Variable) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Executors", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Executors = append(m.Executors, &ResourceUsage_Executor{}) + if err := m.Executors[len(m.Executors)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - return fmt3.Errorf("that == nil && this != nil") } - that1, ok := that.(*Environment_Variable) - if !ok { - return fmt3.Errorf("that is not of type *Environment_Variable") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that is type *Environment_Variable but is nil && this != nil") - } else if this == nil { - return fmt3.Errorf("that is type *Environment_Variablebut is not nil && this == nil") - } - if this.Name != nil && that1.Name != nil { - if *this.Name != *that1.Name { - return fmt3.Errorf("Name this(%v) Not Equal that(%v)", *this.Name, *that1.Name) - } - } else if this.Name != nil { - return fmt3.Errorf("this.Name == nil && that.Name != nil") - } else if that1.Name != nil { - return fmt3.Errorf("Name this(%v) Not Equal that(%v)", this.Name, that1.Name) - } - if this.Value != nil && that1.Value != nil { - if *this.Value != *that1.Value { - return fmt3.Errorf("Value this(%v) Not Equal that(%v)", *this.Value, *that1.Value) - } - } else if this.Value != nil { - return fmt3.Errorf("this.Value == nil && that.Value != nil") - } else if that1.Value != nil { - return fmt3.Errorf("Value this(%v) Not Equal that(%v)", this.Value, that1.Value) - } - 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 *Environment_Variable) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*Environment_Variable) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if this.Name != nil && that1.Name != nil { - if *this.Name != *that1.Name { - return false - } - } else if this.Name != nil { - return false - } else if that1.Name != nil { - return false - } - if this.Value != nil && that1.Value != nil { - if *this.Value != *that1.Value { - return false +func (m *ResourceUsage_Executor) Unmarshal(data []byte) error { + var hasFields [1]uint64 + 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 + } } - } else if this.Value != nil { - return false - } else if that1.Value != nil { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Parameter) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExecutorInfo", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ExecutorInfo == nil { + m.ExecutorInfo = &ExecutorInfo{} + } + if err := m.ExecutorInfo.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + hasFields[0] |= uint64(0x00000001) + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Allocated", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Allocated = append(m.Allocated, &Resource{}) + if err := m.Allocated[len(m.Allocated)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Statistics", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Statistics == nil { + m.Statistics = &ResourceStatistics{} + } + if err := m.Statistics.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - return fmt3.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*Parameter) - if !ok { - return fmt3.Errorf("that is not of type *Parameter") } - if that1 == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that is type *Parameter but is nil && this != nil") - } else if this == nil { - return fmt3.Errorf("that is type *Parameterbut is not nil && this == nil") + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("executor_info") } - if this.Key != nil && that1.Key != nil { - if *this.Key != *that1.Key { - return fmt3.Errorf("Key this(%v) Not Equal that(%v)", *this.Key, *that1.Key) + + return nil +} +func (m *PerfStatistics) Unmarshal(data []byte) error { + var hasFields [1]uint64 + 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 + } } - } else if this.Key != nil { - return fmt3.Errorf("this.Key == nil && that.Key != nil") - } else if that1.Key != nil { - return fmt3.Errorf("Key this(%v) Not Equal that(%v)", this.Key, that1.Key) - } - if this.Value != nil && that1.Value != nil { - if *this.Value != *that1.Value { - return fmt3.Errorf("Value this(%v) Not Equal that(%v)", *this.Value, *that1.Value) + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + iNdEx += 8 + v = uint64(data[iNdEx-8]) + v |= uint64(data[iNdEx-7]) << 8 + v |= uint64(data[iNdEx-6]) << 16 + v |= uint64(data[iNdEx-5]) << 24 + v |= uint64(data[iNdEx-4]) << 32 + v |= uint64(data[iNdEx-3]) << 40 + v |= uint64(data[iNdEx-2]) << 48 + v |= uint64(data[iNdEx-1]) << 56 + v2 := float64(math.Float64frombits(v)) + m.Timestamp = &v2 + hasFields[0] |= uint64(0x00000001) + case 2: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field Duration", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + iNdEx += 8 + v = uint64(data[iNdEx-8]) + v |= uint64(data[iNdEx-7]) << 8 + v |= uint64(data[iNdEx-6]) << 16 + v |= uint64(data[iNdEx-5]) << 24 + v |= uint64(data[iNdEx-4]) << 32 + v |= uint64(data[iNdEx-3]) << 40 + v |= uint64(data[iNdEx-2]) << 48 + v |= uint64(data[iNdEx-1]) << 56 + v2 := float64(math.Float64frombits(v)) + m.Duration = &v2 + hasFields[0] |= uint64(0x00000002) + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Cycles", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Cycles = &v + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field StalledCyclesFrontend", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.StalledCyclesFrontend = &v + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field StalledCyclesBackend", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.StalledCyclesBackend = &v + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Instructions", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Instructions = &v + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CacheReferences", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.CacheReferences = &v + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CacheMisses", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.CacheMisses = &v + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Branches", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Branches = &v + case 10: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field BranchMisses", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.BranchMisses = &v + case 11: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field BusCycles", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.BusCycles = &v + case 12: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field RefCycles", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.RefCycles = &v + case 13: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field CpuClock", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + iNdEx += 8 + v = uint64(data[iNdEx-8]) + v |= uint64(data[iNdEx-7]) << 8 + v |= uint64(data[iNdEx-6]) << 16 + v |= uint64(data[iNdEx-5]) << 24 + v |= uint64(data[iNdEx-4]) << 32 + v |= uint64(data[iNdEx-3]) << 40 + v |= uint64(data[iNdEx-2]) << 48 + v |= uint64(data[iNdEx-1]) << 56 + v2 := float64(math.Float64frombits(v)) + m.CpuClock = &v2 + case 14: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field TaskClock", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + iNdEx += 8 + v = uint64(data[iNdEx-8]) + v |= uint64(data[iNdEx-7]) << 8 + v |= uint64(data[iNdEx-6]) << 16 + v |= uint64(data[iNdEx-5]) << 24 + v |= uint64(data[iNdEx-4]) << 32 + v |= uint64(data[iNdEx-3]) << 40 + v |= uint64(data[iNdEx-2]) << 48 + v |= uint64(data[iNdEx-1]) << 56 + v2 := float64(math.Float64frombits(v)) + m.TaskClock = &v2 + case 15: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field PageFaults", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.PageFaults = &v + case 16: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MinorFaults", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.MinorFaults = &v + case 17: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MajorFaults", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.MajorFaults = &v + case 18: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ContextSwitches", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.ContextSwitches = &v + case 19: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CpuMigrations", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.CpuMigrations = &v + case 20: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AlignmentFaults", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.AlignmentFaults = &v + case 21: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field EmulationFaults", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.EmulationFaults = &v + case 22: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field L1DcacheLoads", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.L1DcacheLoads = &v + case 23: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field L1DcacheLoadMisses", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.L1DcacheLoadMisses = &v + case 24: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field L1DcacheStores", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.L1DcacheStores = &v + case 25: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field L1DcacheStoreMisses", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.L1DcacheStoreMisses = &v + case 26: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field L1DcachePrefetches", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.L1DcachePrefetches = &v + case 27: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field L1DcachePrefetchMisses", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.L1DcachePrefetchMisses = &v + case 28: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field L1IcacheLoads", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.L1IcacheLoads = &v + case 29: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field L1IcacheLoadMisses", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.L1IcacheLoadMisses = &v + case 30: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field L1IcachePrefetches", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.L1IcachePrefetches = &v + case 31: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field L1IcachePrefetchMisses", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.L1IcachePrefetchMisses = &v + case 32: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field LlcLoads", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.LlcLoads = &v + case 33: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field LlcLoadMisses", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.LlcLoadMisses = &v + case 34: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field LlcStores", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.LlcStores = &v + case 35: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field LlcStoreMisses", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.LlcStoreMisses = &v + case 36: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field LlcPrefetches", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.LlcPrefetches = &v + case 37: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field LlcPrefetchMisses", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.LlcPrefetchMisses = &v + case 38: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DtlbLoads", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.DtlbLoads = &v + case 39: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DtlbLoadMisses", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.DtlbLoadMisses = &v + case 40: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DtlbStores", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.DtlbStores = &v + case 41: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DtlbStoreMisses", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.DtlbStoreMisses = &v + case 42: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DtlbPrefetches", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.DtlbPrefetches = &v + case 43: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DtlbPrefetchMisses", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.DtlbPrefetchMisses = &v + case 44: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ItlbLoads", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.ItlbLoads = &v + case 45: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ItlbLoadMisses", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.ItlbLoadMisses = &v + case 46: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field BranchLoads", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.BranchLoads = &v + case 47: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field BranchLoadMisses", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.BranchLoadMisses = &v + case 48: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NodeLoads", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.NodeLoads = &v + case 49: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NodeLoadMisses", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.NodeLoadMisses = &v + case 50: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NodeStores", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.NodeStores = &v + case 51: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NodeStoreMisses", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.NodeStoreMisses = &v + case 52: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NodePrefetches", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.NodePrefetches = &v + case 53: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NodePrefetchMisses", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.NodePrefetchMisses = &v + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - } else if this.Value != nil { - return fmt3.Errorf("this.Value == nil && that.Value != nil") - } else if that1.Value != nil { - return fmt3.Errorf("Value this(%v) Not Equal that(%v)", this.Value, that1.Value) } - 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) + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("timestamp") } + if hasFields[0]&uint64(0x00000002) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("duration") + } + return nil } -func (this *Parameter) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true +func (m *Request) 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 SlaveId", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SlaveId == nil { + m.SlaveId = &SlaveID{} + } + if err := m.SlaveId.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Resources", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Resources = append(m.Resources, &Resource{}) + if err := m.Resources[len(m.Resources)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - return false } - that1, ok := that.(*Parameter) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true + return nil +} +func (m *Offer) Unmarshal(data []byte) error { + var hasFields [1]uint64 + 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 Id", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Id == nil { + m.Id = &OfferID{} + } + if err := m.Id.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + hasFields[0] |= uint64(0x00000001) + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FrameworkId", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.FrameworkId == nil { + m.FrameworkId = &FrameworkID{} + } + if err := m.FrameworkId.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + hasFields[0] |= uint64(0x00000002) + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SlaveId", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SlaveId == nil { + m.SlaveId = &SlaveID{} + } + if err := m.SlaveId.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + hasFields[0] |= uint64(0x00000004) + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Hostname", 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 + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(data[iNdEx:postIndex]) + m.Hostname = &s + iNdEx = postIndex + hasFields[0] |= uint64(0x00000008) + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Resources", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Resources = append(m.Resources, &Resource{}) + if err := m.Resources[len(m.Resources)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExecutorIds", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ExecutorIds = append(m.ExecutorIds, &ExecutorID{}) + if err := m.ExecutorIds[len(m.ExecutorIds)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Attributes", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Attributes = append(m.Attributes, &Attribute{}) + if err := m.Attributes[len(m.Attributes)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - return false - } else if this == nil { - return false } - if this.Key != nil && that1.Key != nil { - if *this.Key != *that1.Key { - return false - } - } else if this.Key != nil { - return false - } else if that1.Key != nil { - return false + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("id") } - if this.Value != nil && that1.Value != nil { - if *this.Value != *that1.Value { - return false - } - } else if this.Value != nil { - return false - } else if that1.Value != nil { - return false + if hasFields[0]&uint64(0x00000002) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("framework_id") } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false + if hasFields[0]&uint64(0x00000004) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("slave_id") } - return true -} -func (this *Parameters) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that == nil && this != nil") + if hasFields[0]&uint64(0x00000008) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("hostname") } - that1, ok := that.(*Parameters) - if !ok { - return fmt3.Errorf("that is not of type *Parameters") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that is type *Parameters but is nil && this != nil") - } else if this == nil { - return fmt3.Errorf("that is type *Parametersbut is not nil && this == nil") - } - if len(this.Parameter) != len(that1.Parameter) { - return fmt3.Errorf("Parameter this(%v) Not Equal that(%v)", len(this.Parameter), len(that1.Parameter)) - } - for i := range this.Parameter { - if !this.Parameter[i].Equal(that1.Parameter[i]) { - return fmt3.Errorf("Parameter this[%v](%v) Not Equal that[%v](%v)", i, this.Parameter[i], i, that1.Parameter[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 *Parameters) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*Parameters) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true +func (m *Offer_Operation) Unmarshal(data []byte) error { + var hasFields [1]uint64 + 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 + } } - return false - } else if this == nil { - return false - } - if len(this.Parameter) != len(that1.Parameter) { - return false - } - for i := range this.Parameter { - if !this.Parameter[i].Equal(that1.Parameter[i]) { - return false + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + var v Offer_Operation_Type + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (Offer_Operation_Type(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Type = &v + hasFields[0] |= uint64(0x00000001) + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Launch", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Launch == nil { + m.Launch = &Offer_Operation_Launch{} + } + if err := m.Launch.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Reserve", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Reserve == nil { + m.Reserve = &Offer_Operation_Reserve{} + } + if err := m.Reserve.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Unreserve", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Unreserve == nil { + m.Unreserve = &Offer_Operation_Unreserve{} + } + if err := m.Unreserve.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Create", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Create == nil { + m.Create = &Offer_Operation_Create{} + } + if err := m.Create.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Destroy", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Destroy == nil { + m.Destroy = &Offer_Operation_Destroy{} + } + if err := m.Destroy.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("type") } - return true + + return nil } -func (this *Credential) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil +func (m *Offer_Operation_Launch) 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 TaskInfos", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.TaskInfos = append(m.TaskInfos, &TaskInfo{}) + if err := m.TaskInfos[len(m.TaskInfos)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - return fmt3.Errorf("that == nil && this != nil") } - that1, ok := that.(*Credential) - if !ok { - return fmt3.Errorf("that is not of type *Credential") - } - if that1 == nil { - if this == nil { - return nil + return nil +} +func (m *Offer_Operation_Reserve) 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 + } } - return fmt3.Errorf("that is type *Credential but is nil && this != nil") - } else if this == nil { - return fmt3.Errorf("that is type *Credentialbut is not nil && this == nil") - } - if this.Principal != nil && that1.Principal != nil { - if *this.Principal != *that1.Principal { - return fmt3.Errorf("Principal this(%v) Not Equal that(%v)", *this.Principal, *that1.Principal) + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Resources", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Resources = append(m.Resources, &Resource{}) + if err := m.Resources[len(m.Resources)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - } else if this.Principal != nil { - return fmt3.Errorf("this.Principal == nil && that.Principal != nil") - } else if that1.Principal != nil { - return fmt3.Errorf("Principal this(%v) Not Equal that(%v)", this.Principal, that1.Principal) - } - if !bytes.Equal(this.Secret, that1.Secret) { - return fmt3.Errorf("Secret this(%v) Not Equal that(%v)", this.Secret, that1.Secret) - } - 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 *Credential) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true +func (m *Offer_Operation_Unreserve) 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 Resources", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Resources = append(m.Resources, &Resource{}) + if err := m.Resources[len(m.Resources)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - return false } - that1, ok := that.(*Credential) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true + return nil +} +func (m *Offer_Operation_Create) 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 + } } - return false - } else if this == nil { - return false - } - if this.Principal != nil && that1.Principal != nil { - if *this.Principal != *that1.Principal { - return false + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Volumes", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Volumes = append(m.Volumes, &Resource{}) + if err := m.Volumes[len(m.Volumes)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - } else if this.Principal != nil { - return false - } else if that1.Principal != nil { - return false - } - if !bytes.Equal(this.Secret, that1.Secret) { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false } - return true + + return nil } -func (this *Credentials) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil +func (m *Offer_Operation_Destroy) 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 Volumes", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Volumes = append(m.Volumes, &Resource{}) + if err := m.Volumes[len(m.Volumes)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - return fmt3.Errorf("that == nil && this != nil") } - that1, ok := that.(*Credentials) - if !ok { - return fmt3.Errorf("that is not of type *Credentials") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that is type *Credentials but is nil && this != nil") - } else if this == nil { - return fmt3.Errorf("that is type *Credentialsbut is not nil && this == nil") - } - if len(this.Credentials) != len(that1.Credentials) { - return fmt3.Errorf("Credentials this(%v) Not Equal that(%v)", len(this.Credentials), len(that1.Credentials)) - } - for i := range this.Credentials { - if !this.Credentials[i].Equal(that1.Credentials[i]) { - return fmt3.Errorf("Credentials this[%v](%v) Not Equal that[%v](%v)", i, this.Credentials[i], i, that1.Credentials[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 *Credentials) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true +func (m *TaskInfo) Unmarshal(data []byte) error { + var hasFields [1]uint64 + 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 + } } - return false - } - - that1, ok := that.(*Credentials) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", 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 + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(data[iNdEx:postIndex]) + m.Name = &s + iNdEx = postIndex + hasFields[0] |= uint64(0x00000001) + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TaskId", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.TaskId == nil { + m.TaskId = &TaskID{} + } + if err := m.TaskId.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + hasFields[0] |= uint64(0x00000002) + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SlaveId", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SlaveId == nil { + m.SlaveId = &SlaveID{} + } + if err := m.SlaveId.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + hasFields[0] |= uint64(0x00000004) + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Resources", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Resources = append(m.Resources, &Resource{}) + if err := m.Resources[len(m.Resources)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Executor", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Executor == nil { + m.Executor = &ExecutorInfo{} + } + if err := m.Executor.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + byteLen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + byteLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Data = append([]byte{}, data[iNdEx:postIndex]...) + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Command", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Command == nil { + m.Command = &CommandInfo{} + } + if err := m.Command.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field HealthCheck", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.HealthCheck == nil { + m.HealthCheck = &HealthCheck{} + } + if err := m.HealthCheck.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Container", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Container == nil { + m.Container = &ContainerInfo{} + } + if err := m.Container.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Labels == nil { + m.Labels = &Labels{} + } + if err := m.Labels.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Discovery", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Discovery == nil { + m.Discovery = &DiscoveryInfo{} + } + if err := m.Discovery.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - return false - } else if this == nil { - return false - } - if len(this.Credentials) != len(that1.Credentials) { - return false } - for i := range this.Credentials { - if !this.Credentials[i].Equal(that1.Credentials[i]) { - return false - } + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("name") } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false + if hasFields[0]&uint64(0x00000002) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("task_id") } - return true -} -func (this *ACL) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that == nil && this != nil") + if hasFields[0]&uint64(0x00000004) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("slave_id") } - that1, ok := that.(*ACL) - if !ok { - return fmt3.Errorf("that is not of type *ACL") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that is type *ACL but is nil && this != nil") - } else if this == nil { - return fmt3.Errorf("that is type *ACLbut is not nil && this == nil") - } - 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 *ACL) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true +func (m *TaskStatus) Unmarshal(data []byte) error { + var hasFields [1]uint64 + 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 + } } - return false - } - - that1, ok := that.(*ACL) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TaskId", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.TaskId == nil { + m.TaskId = &TaskID{} + } + if err := m.TaskId.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + hasFields[0] |= uint64(0x00000001) + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field State", wireType) + } + var v TaskState + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (TaskState(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.State = &v + hasFields[0] |= uint64(0x00000002) + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + byteLen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + byteLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Data = append([]byte{}, data[iNdEx:postIndex]...) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Message", 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 + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(data[iNdEx:postIndex]) + m.Message = &s + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SlaveId", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SlaveId == nil { + m.SlaveId = &SlaveID{} + } + if err := m.SlaveId.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + iNdEx += 8 + v = uint64(data[iNdEx-8]) + v |= uint64(data[iNdEx-7]) << 8 + v |= uint64(data[iNdEx-6]) << 16 + v |= uint64(data[iNdEx-5]) << 24 + v |= uint64(data[iNdEx-4]) << 32 + v |= uint64(data[iNdEx-3]) << 40 + v |= uint64(data[iNdEx-2]) << 48 + v |= uint64(data[iNdEx-1]) << 56 + v2 := float64(math.Float64frombits(v)) + m.Timestamp = &v2 + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExecutorId", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ExecutorId == nil { + m.ExecutorId = &ExecutorID{} + } + if err := m.ExecutorId.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Healthy", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + b := bool(v != 0) + m.Healthy = &b + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Source", wireType) + } + var v TaskStatus_Source + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (TaskStatus_Source(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Source = &v + case 10: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Reason", wireType) + } + var v TaskStatus_Reason + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (TaskStatus_Reason(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Reason = &v + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Uuid", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + byteLen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + byteLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Uuid = append([]byte{}, data[iNdEx:postIndex]...) + iNdEx = postIndex + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - return false - } else if this == nil { - return false } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("task_id") } - return true -} -func (this *ACL_Entity) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that == nil && this != nil") + if hasFields[0]&uint64(0x00000002) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("state") } - that1, ok := that.(*ACL_Entity) - if !ok { - return fmt3.Errorf("that is not of type *ACL_Entity") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that is type *ACL_Entity but is nil && this != nil") - } else if this == nil { - return fmt3.Errorf("that is type *ACL_Entitybut is not nil && this == nil") - } - if this.Type != nil && that1.Type != nil { - if *this.Type != *that1.Type { - return fmt3.Errorf("Type this(%v) Not Equal that(%v)", *this.Type, *that1.Type) - } - } else if this.Type != nil { - return fmt3.Errorf("this.Type == nil && that.Type != nil") - } else if that1.Type != nil { - return fmt3.Errorf("Type this(%v) Not Equal that(%v)", this.Type, that1.Type) - } - 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 *ACL_Entity) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*ACL_Entity) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if this.Type != nil && that1.Type != nil { - if *this.Type != *that1.Type { - return false - } - } else if this.Type != nil { - return false - } else if that1.Type != 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 +func (m *Filters) 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 + } } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *ACL_RegisterFramework) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field RefuseSeconds", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + iNdEx += 8 + v = uint64(data[iNdEx-8]) + v |= uint64(data[iNdEx-7]) << 8 + v |= uint64(data[iNdEx-6]) << 16 + v |= uint64(data[iNdEx-5]) << 24 + v |= uint64(data[iNdEx-4]) << 32 + v |= uint64(data[iNdEx-3]) << 40 + v |= uint64(data[iNdEx-2]) << 48 + v |= uint64(data[iNdEx-1]) << 56 + v2 := float64(math.Float64frombits(v)) + m.RefuseSeconds = &v2 + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - return fmt3.Errorf("that == nil && this != nil") } - that1, ok := that.(*ACL_RegisterFramework) - if !ok { - return fmt3.Errorf("that is not of type *ACL_RegisterFramework") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that is type *ACL_RegisterFramework but is nil && this != nil") - } else if this == nil { - return fmt3.Errorf("that is type *ACL_RegisterFrameworkbut is not nil && this == nil") - } - if !this.Principals.Equal(that1.Principals) { - return fmt3.Errorf("Principals this(%v) Not Equal that(%v)", this.Principals, that1.Principals) - } - if !this.Roles.Equal(that1.Roles) { - return fmt3.Errorf("Roles this(%v) Not Equal that(%v)", this.Roles, that1.Roles) - } - 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 *ACL_RegisterFramework) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*ACL_RegisterFramework) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if !this.Principals.Equal(that1.Principals) { - return false - } - if !this.Roles.Equal(that1.Roles) { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *ACL_RunTask) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*ACL_RunTask) - if !ok { - return fmt3.Errorf("that is not of type *ACL_RunTask") - } - if that1 == nil { - if this == nil { - return nil +func (m *Environment) 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 + } } - return fmt3.Errorf("that is type *ACL_RunTask but is nil && this != nil") - } else if this == nil { - return fmt3.Errorf("that is type *ACL_RunTaskbut is not nil && this == nil") - } - if !this.Principals.Equal(that1.Principals) { - return fmt3.Errorf("Principals this(%v) Not Equal that(%v)", this.Principals, that1.Principals) - } - if !this.Users.Equal(that1.Users) { - return fmt3.Errorf("Users this(%v) Not Equal that(%v)", this.Users, that1.Users) - } - 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 *ACL_RunTask) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Variables", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Variables = append(m.Variables, &Environment_Variable{}) + if err := m.Variables[len(m.Variables)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - return false } - that1, ok := that.(*ACL_RunTask) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if !this.Principals.Equal(that1.Principals) { - return false - } - if !this.Users.Equal(that1.Users) { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true + return nil } -func (this *ACL_ShutdownFramework) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil +func (m *Environment_Variable) Unmarshal(data []byte) error { + var hasFields [1]uint64 + 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 + } } - return fmt3.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*ACL_ShutdownFramework) - if !ok { - return fmt3.Errorf("that is not of type *ACL_ShutdownFramework") - } - if that1 == nil { - if this == nil { - return nil + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", 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 + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(data[iNdEx:postIndex]) + m.Name = &s + iNdEx = postIndex + hasFields[0] |= uint64(0x00000001) + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", 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 + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(data[iNdEx:postIndex]) + m.Value = &s + iNdEx = postIndex + hasFields[0] |= uint64(0x00000002) + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - return fmt3.Errorf("that is type *ACL_ShutdownFramework but is nil && this != nil") - } else if this == nil { - return fmt3.Errorf("that is type *ACL_ShutdownFrameworkbut is not nil && this == nil") - } - if !this.Principals.Equal(that1.Principals) { - return fmt3.Errorf("Principals this(%v) Not Equal that(%v)", this.Principals, that1.Principals) } - if !this.FrameworkPrincipals.Equal(that1.FrameworkPrincipals) { - return fmt3.Errorf("FrameworkPrincipals this(%v) Not Equal that(%v)", this.FrameworkPrincipals, that1.FrameworkPrincipals) + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("name") } - 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) + if hasFields[0]&uint64(0x00000002) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("value") } + return nil } -func (this *ACL_ShutdownFramework) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true +func (m *Parameter) Unmarshal(data []byte) error { + var hasFields [1]uint64 + 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 + } } - return false - } - - that1, ok := that.(*ACL_ShutdownFramework) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Key", 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 + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(data[iNdEx:postIndex]) + m.Key = &s + iNdEx = postIndex + hasFields[0] |= uint64(0x00000001) + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", 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 + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(data[iNdEx:postIndex]) + m.Value = &s + iNdEx = postIndex + hasFields[0] |= uint64(0x00000002) + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - return false - } else if this == nil { - return false } - if !this.Principals.Equal(that1.Principals) { - return false - } - if !this.FrameworkPrincipals.Equal(that1.FrameworkPrincipals) { - return false + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("key") } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false + if hasFields[0]&uint64(0x00000002) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("value") } - return true + + return nil } -func (this *ACLs) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil +func (m *Parameters) 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 Parameter", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Parameter = append(m.Parameter, &Parameter{}) + if err := m.Parameter[len(m.Parameter)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - return fmt3.Errorf("that == nil && this != nil") } - that1, ok := that.(*ACLs) - if !ok { - return fmt3.Errorf("that is not of type *ACLs") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that is type *ACLs but is nil && this != nil") - } else if this == nil { - return fmt3.Errorf("that is type *ACLsbut is not nil && this == nil") - } - if this.Permissive != nil && that1.Permissive != nil { - if *this.Permissive != *that1.Permissive { - return fmt3.Errorf("Permissive this(%v) Not Equal that(%v)", *this.Permissive, *that1.Permissive) + return nil +} +func (m *Credential) Unmarshal(data []byte) error { + var hasFields [1]uint64 + 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 + } } - } else if this.Permissive != nil { - return fmt3.Errorf("this.Permissive == nil && that.Permissive != nil") - } else if that1.Permissive != nil { - return fmt3.Errorf("Permissive this(%v) Not Equal that(%v)", this.Permissive, that1.Permissive) - } - if len(this.RegisterFrameworks) != len(that1.RegisterFrameworks) { - return fmt3.Errorf("RegisterFrameworks this(%v) Not Equal that(%v)", len(this.RegisterFrameworks), len(that1.RegisterFrameworks)) - } - for i := range this.RegisterFrameworks { - if !this.RegisterFrameworks[i].Equal(that1.RegisterFrameworks[i]) { - return fmt3.Errorf("RegisterFrameworks this[%v](%v) Not Equal that[%v](%v)", i, this.RegisterFrameworks[i], i, that1.RegisterFrameworks[i]) + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Principal", 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 + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(data[iNdEx:postIndex]) + m.Principal = &s + iNdEx = postIndex + hasFields[0] |= uint64(0x00000001) + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Secret", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + byteLen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + byteLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Secret = append([]byte{}, data[iNdEx:postIndex]...) + iNdEx = postIndex + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } } - if len(this.RunTasks) != len(that1.RunTasks) { - return fmt3.Errorf("RunTasks this(%v) Not Equal that(%v)", len(this.RunTasks), len(that1.RunTasks)) + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("principal") } - for i := range this.RunTasks { - if !this.RunTasks[i].Equal(that1.RunTasks[i]) { - return fmt3.Errorf("RunTasks this[%v](%v) Not Equal that[%v](%v)", i, this.RunTasks[i], i, that1.RunTasks[i]) + + return nil +} +func (m *Credentials) 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 + } } - } - if len(this.ShutdownFrameworks) != len(that1.ShutdownFrameworks) { - return fmt3.Errorf("ShutdownFrameworks this(%v) Not Equal that(%v)", len(this.ShutdownFrameworks), len(that1.ShutdownFrameworks)) - } - for i := range this.ShutdownFrameworks { - if !this.ShutdownFrameworks[i].Equal(that1.ShutdownFrameworks[i]) { - return fmt3.Errorf("ShutdownFrameworks this[%v](%v) Not Equal that[%v](%v)", i, this.ShutdownFrameworks[i], i, that1.ShutdownFrameworks[i]) + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Credentials", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Credentials = append(m.Credentials, &Credential{}) + if err := m.Credentials[len(m.Credentials)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } } - 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 *ACLs) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true +func (m *ACL) 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) + switch fieldNum { + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - return false } - that1, ok := that.(*ACLs) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true + return nil +} +func (m *ACL_Entity) 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 + } } - return false - } else if this == nil { - return false - } - if this.Permissive != nil && that1.Permissive != nil { - if *this.Permissive != *that1.Permissive { - return false + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + var v ACL_Entity_Type + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (ACL_Entity_Type(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Type = &v + case 2: + 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 + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + 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 := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - } else if this.Permissive != nil { - return false - } else if that1.Permissive != nil { - return false } - if len(this.RegisterFrameworks) != len(that1.RegisterFrameworks) { - return false - } - for i := range this.RegisterFrameworks { - if !this.RegisterFrameworks[i].Equal(that1.RegisterFrameworks[i]) { - return false + + return nil +} +func (m *ACL_RegisterFramework) Unmarshal(data []byte) error { + var hasFields [1]uint64 + 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 + } } - } - if len(this.RunTasks) != len(that1.RunTasks) { - return false - } - for i := range this.RunTasks { - if !this.RunTasks[i].Equal(that1.RunTasks[i]) { - return false + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Principals", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Principals == nil { + m.Principals = &ACL_Entity{} + } + if err := m.Principals.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + hasFields[0] |= uint64(0x00000001) + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Roles", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Roles == nil { + m.Roles = &ACL_Entity{} + } + if err := m.Roles.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + hasFields[0] |= uint64(0x00000002) + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } } - if len(this.ShutdownFrameworks) != len(that1.ShutdownFrameworks) { - return false - } - for i := range this.ShutdownFrameworks { - if !this.ShutdownFrameworks[i].Equal(that1.ShutdownFrameworks[i]) { - return false - } + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("principals") } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false + if hasFields[0]&uint64(0x00000002) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("roles") } - return true + + return nil } -func (this *RateLimit) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil +func (m *ACL_RunTask) Unmarshal(data []byte) error { + var hasFields [1]uint64 + 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 Principals", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Principals == nil { + m.Principals = &ACL_Entity{} + } + if err := m.Principals.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + hasFields[0] |= uint64(0x00000001) + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Users", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Users == nil { + m.Users = &ACL_Entity{} + } + if err := m.Users.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + hasFields[0] |= uint64(0x00000002) + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - return fmt3.Errorf("that == nil && this != nil") } - - that1, ok := that.(*RateLimit) - if !ok { - return fmt3.Errorf("that is not of type *RateLimit") + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("principals") } - if that1 == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that is type *RateLimit but is nil && this != nil") - } else if this == nil { - return fmt3.Errorf("that is type *RateLimitbut is not nil && this == nil") + if hasFields[0]&uint64(0x00000002) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("users") } - if this.Qps != nil && that1.Qps != nil { - if *this.Qps != *that1.Qps { - return fmt3.Errorf("Qps this(%v) Not Equal that(%v)", *this.Qps, *that1.Qps) + + return nil +} +func (m *ACL_ShutdownFramework) Unmarshal(data []byte) error { + var hasFields [1]uint64 + 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 + } } - } else if this.Qps != nil { - return fmt3.Errorf("this.Qps == nil && that.Qps != nil") - } else if that1.Qps != nil { - return fmt3.Errorf("Qps this(%v) Not Equal that(%v)", this.Qps, that1.Qps) - } - if this.Principal != nil && that1.Principal != nil { - if *this.Principal != *that1.Principal { - return fmt3.Errorf("Principal this(%v) Not Equal that(%v)", *this.Principal, *that1.Principal) + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Principals", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Principals == nil { + m.Principals = &ACL_Entity{} + } + if err := m.Principals.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + hasFields[0] |= uint64(0x00000001) + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FrameworkPrincipals", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.FrameworkPrincipals == nil { + m.FrameworkPrincipals = &ACL_Entity{} + } + if err := m.FrameworkPrincipals.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + hasFields[0] |= uint64(0x00000002) + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - } else if this.Principal != nil { - return fmt3.Errorf("this.Principal == nil && that.Principal != nil") - } else if that1.Principal != nil { - return fmt3.Errorf("Principal this(%v) Not Equal that(%v)", this.Principal, that1.Principal) } - if this.Capacity != nil && that1.Capacity != nil { - if *this.Capacity != *that1.Capacity { - return fmt3.Errorf("Capacity this(%v) Not Equal that(%v)", *this.Capacity, *that1.Capacity) - } - } else if this.Capacity != nil { - return fmt3.Errorf("this.Capacity == nil && that.Capacity != nil") - } else if that1.Capacity != nil { - return fmt3.Errorf("Capacity this(%v) Not Equal that(%v)", this.Capacity, that1.Capacity) + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("principals") } - 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) + if hasFields[0]&uint64(0x00000002) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("framework_principals") } + return nil } -func (this *RateLimit) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*RateLimit) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if this.Qps != nil && that1.Qps != nil { - if *this.Qps != *that1.Qps { - return false - } - } else if this.Qps != nil { - return false - } else if that1.Qps != nil { - return false - } - if this.Principal != nil && that1.Principal != nil { - if *this.Principal != *that1.Principal { - return false +func (m *ACLs) 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 + } } - } else if this.Principal != nil { - return false - } else if that1.Principal != nil { - return false - } - if this.Capacity != nil && that1.Capacity != nil { - if *this.Capacity != *that1.Capacity { - return false + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Permissive", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + b := bool(v != 0) + m.Permissive = &b + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RegisterFrameworks", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RegisterFrameworks = append(m.RegisterFrameworks, &ACL_RegisterFramework{}) + if err := m.RegisterFrameworks[len(m.RegisterFrameworks)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RunTasks", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RunTasks = append(m.RunTasks, &ACL_RunTask{}) + if err := m.RunTasks[len(m.RunTasks)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ShutdownFrameworks", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ShutdownFrameworks = append(m.ShutdownFrameworks, &ACL_ShutdownFramework{}) + if err := m.ShutdownFrameworks[len(m.ShutdownFrameworks)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - } else if this.Capacity != nil { - return false - } else if that1.Capacity != nil { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false } - return true + + return nil } -func (this *RateLimits) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil +func (m *RateLimit) Unmarshal(data []byte) error { + var hasFields [1]uint64 + 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 + } } - return fmt3.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*RateLimits) - if !ok { - return fmt3.Errorf("that is not of type *RateLimits") - } - if that1 == nil { - if this == nil { - return nil + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field Qps", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + iNdEx += 8 + v = uint64(data[iNdEx-8]) + v |= uint64(data[iNdEx-7]) << 8 + v |= uint64(data[iNdEx-6]) << 16 + v |= uint64(data[iNdEx-5]) << 24 + v |= uint64(data[iNdEx-4]) << 32 + v |= uint64(data[iNdEx-3]) << 40 + v |= uint64(data[iNdEx-2]) << 48 + v |= uint64(data[iNdEx-1]) << 56 + v2 := float64(math.Float64frombits(v)) + m.Qps = &v2 + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Principal", 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 + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(data[iNdEx:postIndex]) + m.Principal = &s + iNdEx = postIndex + hasFields[0] |= uint64(0x00000001) + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Capacity", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Capacity = &v + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - return fmt3.Errorf("that is type *RateLimits but is nil && this != nil") - } else if this == nil { - return fmt3.Errorf("that is type *RateLimitsbut is not nil && this == nil") - } - if len(this.Limits) != len(that1.Limits) { - return fmt3.Errorf("Limits this(%v) Not Equal that(%v)", len(this.Limits), len(that1.Limits)) } - for i := range this.Limits { - if !this.Limits[i].Equal(that1.Limits[i]) { - return fmt3.Errorf("Limits this[%v](%v) Not Equal that[%v](%v)", i, this.Limits[i], i, that1.Limits[i]) - } + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("principal") } - if this.AggregateDefaultQps != nil && that1.AggregateDefaultQps != nil { - if *this.AggregateDefaultQps != *that1.AggregateDefaultQps { - return fmt3.Errorf("AggregateDefaultQps this(%v) Not Equal that(%v)", *this.AggregateDefaultQps, *that1.AggregateDefaultQps) + + return nil +} +func (m *RateLimits) 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 + } } - } else if this.AggregateDefaultQps != nil { - return fmt3.Errorf("this.AggregateDefaultQps == nil && that.AggregateDefaultQps != nil") - } else if that1.AggregateDefaultQps != nil { - return fmt3.Errorf("AggregateDefaultQps this(%v) Not Equal that(%v)", this.AggregateDefaultQps, that1.AggregateDefaultQps) - } - if this.AggregateDefaultCapacity != nil && that1.AggregateDefaultCapacity != nil { - if *this.AggregateDefaultCapacity != *that1.AggregateDefaultCapacity { - return fmt3.Errorf("AggregateDefaultCapacity this(%v) Not Equal that(%v)", *this.AggregateDefaultCapacity, *that1.AggregateDefaultCapacity) + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Limits", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Limits = append(m.Limits, &RateLimit{}) + if err := m.Limits[len(m.Limits)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field AggregateDefaultQps", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + iNdEx += 8 + v = uint64(data[iNdEx-8]) + v |= uint64(data[iNdEx-7]) << 8 + v |= uint64(data[iNdEx-6]) << 16 + v |= uint64(data[iNdEx-5]) << 24 + v |= uint64(data[iNdEx-4]) << 32 + v |= uint64(data[iNdEx-3]) << 40 + v |= uint64(data[iNdEx-2]) << 48 + v |= uint64(data[iNdEx-1]) << 56 + v2 := float64(math.Float64frombits(v)) + m.AggregateDefaultQps = &v2 + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AggregateDefaultCapacity", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.AggregateDefaultCapacity = &v + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - } else if this.AggregateDefaultCapacity != nil { - return fmt3.Errorf("this.AggregateDefaultCapacity == nil && that.AggregateDefaultCapacity != nil") - } else if that1.AggregateDefaultCapacity != nil { - return fmt3.Errorf("AggregateDefaultCapacity this(%v) Not Equal that(%v)", this.AggregateDefaultCapacity, that1.AggregateDefaultCapacity) - } - 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 *RateLimits) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true +func (m *Volume) Unmarshal(data []byte) error { + var hasFields [1]uint64 + 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 + } } - return false - } - - that1, ok := that.(*RateLimits) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ContainerPath", 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 + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(data[iNdEx:postIndex]) + m.ContainerPath = &s + iNdEx = postIndex + hasFields[0] |= uint64(0x00000001) + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field HostPath", 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 + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(data[iNdEx:postIndex]) + m.HostPath = &s + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Mode", wireType) + } + var v Volume_Mode + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (Volume_Mode(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Mode = &v + hasFields[0] |= uint64(0x00000002) + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - return false - } else if this == nil { - return false } - if len(this.Limits) != len(that1.Limits) { - return false + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("container_path") } - for i := range this.Limits { - if !this.Limits[i].Equal(that1.Limits[i]) { - return false - } + if hasFields[0]&uint64(0x00000002) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("mode") } - if this.AggregateDefaultQps != nil && that1.AggregateDefaultQps != nil { - if *this.AggregateDefaultQps != *that1.AggregateDefaultQps { - return false + + return nil +} +func (m *ContainerInfo) Unmarshal(data []byte) error { + var hasFields [1]uint64 + 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 + } } - } else if this.AggregateDefaultQps != nil { - return false - } else if that1.AggregateDefaultQps != nil { - return false - } - if this.AggregateDefaultCapacity != nil && that1.AggregateDefaultCapacity != nil { - if *this.AggregateDefaultCapacity != *that1.AggregateDefaultCapacity { - return false + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + var v ContainerInfo_Type + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (ContainerInfo_Type(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Type = &v + hasFields[0] |= uint64(0x00000001) + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Volumes", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Volumes = append(m.Volumes, &Volume{}) + if err := m.Volumes[len(m.Volumes)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Docker", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Docker == nil { + m.Docker = &ContainerInfo_DockerInfo{} + } + if err := m.Docker.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Hostname", 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 + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(data[iNdEx:postIndex]) + m.Hostname = &s + iNdEx = postIndex + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - } else if this.AggregateDefaultCapacity != nil { - return false - } else if that1.AggregateDefaultCapacity != nil { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false } - return true -} -func (this *Volume) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that == nil && this != nil") + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("type") } - that1, ok := that.(*Volume) - if !ok { - return fmt3.Errorf("that is not of type *Volume") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that is type *Volume but is nil && this != nil") - } else if this == nil { - return fmt3.Errorf("that is type *Volumebut is not nil && this == nil") - } - if this.ContainerPath != nil && that1.ContainerPath != nil { - if *this.ContainerPath != *that1.ContainerPath { - return fmt3.Errorf("ContainerPath this(%v) Not Equal that(%v)", *this.ContainerPath, *that1.ContainerPath) - } - } else if this.ContainerPath != nil { - return fmt3.Errorf("this.ContainerPath == nil && that.ContainerPath != nil") - } else if that1.ContainerPath != nil { - return fmt3.Errorf("ContainerPath this(%v) Not Equal that(%v)", this.ContainerPath, that1.ContainerPath) - } - if this.HostPath != nil && that1.HostPath != nil { - if *this.HostPath != *that1.HostPath { - return fmt3.Errorf("HostPath this(%v) Not Equal that(%v)", *this.HostPath, *that1.HostPath) - } - } else if this.HostPath != nil { - return fmt3.Errorf("this.HostPath == nil && that.HostPath != nil") - } else if that1.HostPath != nil { - return fmt3.Errorf("HostPath this(%v) Not Equal that(%v)", this.HostPath, that1.HostPath) - } - if this.Mode != nil && that1.Mode != nil { - if *this.Mode != *that1.Mode { - return fmt3.Errorf("Mode this(%v) Not Equal that(%v)", *this.Mode, *that1.Mode) - } - } else if this.Mode != nil { - return fmt3.Errorf("this.Mode == nil && that.Mode != nil") - } else if that1.Mode != nil { - return fmt3.Errorf("Mode this(%v) Not Equal that(%v)", this.Mode, that1.Mode) - } - 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 *Volume) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*Volume) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if this.ContainerPath != nil && that1.ContainerPath != nil { - if *this.ContainerPath != *that1.ContainerPath { - return false - } - } else if this.ContainerPath != nil { - return false - } else if that1.ContainerPath != nil { - return false - } - if this.HostPath != nil && that1.HostPath != nil { - if *this.HostPath != *that1.HostPath { - return false +func (m *ContainerInfo_DockerInfo) Unmarshal(data []byte) error { + var hasFields [1]uint64 + 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 + } } - } else if this.HostPath != nil { - return false - } else if that1.HostPath != nil { - return false - } - if this.Mode != nil && that1.Mode != nil { - if *this.Mode != *that1.Mode { - return false + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Image", 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 + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(data[iNdEx:postIndex]) + m.Image = &s + iNdEx = postIndex + hasFields[0] |= uint64(0x00000001) + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Network", wireType) + } + var v ContainerInfo_DockerInfo_Network + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (ContainerInfo_DockerInfo_Network(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Network = &v + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PortMappings", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PortMappings = append(m.PortMappings, &ContainerInfo_DockerInfo_PortMapping{}) + if err := m.PortMappings[len(m.PortMappings)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Privileged", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + b := bool(v != 0) + m.Privileged = &b + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Parameters", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Parameters = append(m.Parameters, &Parameter{}) + if err := m.Parameters[len(m.Parameters)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ForcePullImage", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + b := bool(v != 0) + m.ForcePullImage = &b + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - } else if this.Mode != nil { - return false - } else if that1.Mode != nil { - return false } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *ContainerInfo) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that == nil && this != nil") + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("image") } - that1, ok := that.(*ContainerInfo) - if !ok { - return fmt3.Errorf("that is not of type *ContainerInfo") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that is type *ContainerInfo but is nil && this != nil") - } else if this == nil { - return fmt3.Errorf("that is type *ContainerInfobut is not nil && this == nil") - } - if this.Type != nil && that1.Type != nil { - if *this.Type != *that1.Type { - return fmt3.Errorf("Type this(%v) Not Equal that(%v)", *this.Type, *that1.Type) - } - } else if this.Type != nil { - return fmt3.Errorf("this.Type == nil && that.Type != nil") - } else if that1.Type != nil { - return fmt3.Errorf("Type this(%v) Not Equal that(%v)", this.Type, that1.Type) - } - if len(this.Volumes) != len(that1.Volumes) { - return fmt3.Errorf("Volumes this(%v) Not Equal that(%v)", len(this.Volumes), len(that1.Volumes)) - } - for i := range this.Volumes { - if !this.Volumes[i].Equal(that1.Volumes[i]) { - return fmt3.Errorf("Volumes this[%v](%v) Not Equal that[%v](%v)", i, this.Volumes[i], i, that1.Volumes[i]) - } - } - if this.Hostname != nil && that1.Hostname != nil { - if *this.Hostname != *that1.Hostname { - return fmt3.Errorf("Hostname this(%v) Not Equal that(%v)", *this.Hostname, *that1.Hostname) - } - } else if this.Hostname != nil { - return fmt3.Errorf("this.Hostname == nil && that.Hostname != nil") - } else if that1.Hostname != nil { - return fmt3.Errorf("Hostname this(%v) Not Equal that(%v)", this.Hostname, that1.Hostname) - } - if !this.Docker.Equal(that1.Docker) { - return fmt3.Errorf("Docker this(%v) Not Equal that(%v)", this.Docker, that1.Docker) - } - 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 *ContainerInfo) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*ContainerInfo) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if this.Type != nil && that1.Type != nil { - if *this.Type != *that1.Type { - return false - } - } else if this.Type != nil { - return false - } else if that1.Type != nil { - return false - } - if len(this.Volumes) != len(that1.Volumes) { - return false - } - for i := range this.Volumes { - if !this.Volumes[i].Equal(that1.Volumes[i]) { - return false +func (m *ContainerInfo_DockerInfo_PortMapping) Unmarshal(data []byte) error { + var hasFields [1]uint64 + 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 + } } - } - if this.Hostname != nil && that1.Hostname != nil { - if *this.Hostname != *that1.Hostname { - return false + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field HostPort", wireType) + } + var v uint32 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint32(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.HostPort = &v + hasFields[0] |= uint64(0x00000001) + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ContainerPort", wireType) + } + var v uint32 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint32(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.ContainerPort = &v + hasFields[0] |= uint64(0x00000002) + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Protocol", 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 + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(data[iNdEx:postIndex]) + m.Protocol = &s + iNdEx = postIndex + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - } else if this.Hostname != nil { - return false - } else if that1.Hostname != nil { - return false - } - if !this.Docker.Equal(that1.Docker) { - return false } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("host_port") } - return true -} -func (this *ContainerInfo_DockerInfo) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that == nil && this != nil") + if hasFields[0]&uint64(0x00000002) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("container_port") } - that1, ok := that.(*ContainerInfo_DockerInfo) - if !ok { - return fmt3.Errorf("that is not of type *ContainerInfo_DockerInfo") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that is type *ContainerInfo_DockerInfo but is nil && this != nil") - } else if this == nil { - return fmt3.Errorf("that is type *ContainerInfo_DockerInfobut is not nil && this == nil") - } - if this.Image != nil && that1.Image != nil { - if *this.Image != *that1.Image { - return fmt3.Errorf("Image this(%v) Not Equal that(%v)", *this.Image, *that1.Image) - } - } else if this.Image != nil { - return fmt3.Errorf("this.Image == nil && that.Image != nil") - } else if that1.Image != nil { - return fmt3.Errorf("Image this(%v) Not Equal that(%v)", this.Image, that1.Image) - } - if this.Network != nil && that1.Network != nil { - if *this.Network != *that1.Network { - return fmt3.Errorf("Network this(%v) Not Equal that(%v)", *this.Network, *that1.Network) - } - } else if this.Network != nil { - return fmt3.Errorf("this.Network == nil && that.Network != nil") - } else if that1.Network != nil { - return fmt3.Errorf("Network this(%v) Not Equal that(%v)", this.Network, that1.Network) - } - if len(this.PortMappings) != len(that1.PortMappings) { - return fmt3.Errorf("PortMappings this(%v) Not Equal that(%v)", len(this.PortMappings), len(that1.PortMappings)) - } - for i := range this.PortMappings { - if !this.PortMappings[i].Equal(that1.PortMappings[i]) { - return fmt3.Errorf("PortMappings this[%v](%v) Not Equal that[%v](%v)", i, this.PortMappings[i], i, that1.PortMappings[i]) - } - } - if this.Privileged != nil && that1.Privileged != nil { - if *this.Privileged != *that1.Privileged { - return fmt3.Errorf("Privileged this(%v) Not Equal that(%v)", *this.Privileged, *that1.Privileged) + return nil +} +func (m *Labels) 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 + } } - } else if this.Privileged != nil { - return fmt3.Errorf("this.Privileged == nil && that.Privileged != nil") - } else if that1.Privileged != nil { - return fmt3.Errorf("Privileged this(%v) Not Equal that(%v)", this.Privileged, that1.Privileged) - } - if len(this.Parameters) != len(that1.Parameters) { - return fmt3.Errorf("Parameters this(%v) Not Equal that(%v)", len(this.Parameters), len(that1.Parameters)) - } - for i := range this.Parameters { - if !this.Parameters[i].Equal(that1.Parameters[i]) { - return fmt3.Errorf("Parameters this[%v](%v) Not Equal that[%v](%v)", i, this.Parameters[i], i, that1.Parameters[i]) + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Labels = append(m.Labels, &Label{}) + if err := m.Labels[len(m.Labels)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } } - 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 *ContainerInfo_DockerInfo) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*ContainerInfo_DockerInfo) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if this.Image != nil && that1.Image != nil { - if *this.Image != *that1.Image { - return false +func (m *Label) Unmarshal(data []byte) error { + var hasFields [1]uint64 + 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 + } } - } else if this.Image != nil { - return false - } else if that1.Image != nil { - return false - } - if this.Network != nil && that1.Network != nil { - if *this.Network != *that1.Network { - return false + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Key", 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 + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(data[iNdEx:postIndex]) + m.Key = &s + iNdEx = postIndex + hasFields[0] |= uint64(0x00000001) + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", 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 + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(data[iNdEx:postIndex]) + m.Value = &s + iNdEx = postIndex + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - } else if this.Network != nil { - return false - } else if that1.Network != nil { - return false - } - if len(this.PortMappings) != len(that1.PortMappings) { - return false } - for i := range this.PortMappings { - if !this.PortMappings[i].Equal(that1.PortMappings[i]) { - return false - } + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("key") } - if this.Privileged != nil && that1.Privileged != nil { - if *this.Privileged != *that1.Privileged { - return false + + return nil +} +func (m *Port) Unmarshal(data []byte) error { + var hasFields [1]uint64 + 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 + } } - } else if this.Privileged != nil { - return false - } else if that1.Privileged != nil { - return false - } - if len(this.Parameters) != len(that1.Parameters) { - return false - } - for i := range this.Parameters { - if !this.Parameters[i].Equal(that1.Parameters[i]) { - return false + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Number", wireType) + } + var v uint32 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (uint32(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Number = &v + hasFields[0] |= uint64(0x00000001) + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", 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 + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(data[iNdEx:postIndex]) + m.Name = &s + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Protocol", 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 + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(data[iNdEx:postIndex]) + m.Protocol = &s + iNdEx = postIndex + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("number") } - return true + + return nil } -func (this *ContainerInfo_DockerInfo_PortMapping) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil +func (m *Ports) 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 Ports", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Ports = append(m.Ports, &Port{}) + if err := m.Ports[len(m.Ports)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - return fmt3.Errorf("that == nil && this != nil") } - that1, ok := that.(*ContainerInfo_DockerInfo_PortMapping) - if !ok { - return fmt3.Errorf("that is not of type *ContainerInfo_DockerInfo_PortMapping") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that is type *ContainerInfo_DockerInfo_PortMapping but is nil && this != nil") - } else if this == nil { - return fmt3.Errorf("that is type *ContainerInfo_DockerInfo_PortMappingbut is not nil && this == nil") - } - if this.HostPort != nil && that1.HostPort != nil { - if *this.HostPort != *that1.HostPort { - return fmt3.Errorf("HostPort this(%v) Not Equal that(%v)", *this.HostPort, *that1.HostPort) - } - } else if this.HostPort != nil { - return fmt3.Errorf("this.HostPort == nil && that.HostPort != nil") - } else if that1.HostPort != nil { - return fmt3.Errorf("HostPort this(%v) Not Equal that(%v)", this.HostPort, that1.HostPort) - } - if this.ContainerPort != nil && that1.ContainerPort != nil { - if *this.ContainerPort != *that1.ContainerPort { - return fmt3.Errorf("ContainerPort this(%v) Not Equal that(%v)", *this.ContainerPort, *that1.ContainerPort) - } - } else if this.ContainerPort != nil { - return fmt3.Errorf("this.ContainerPort == nil && that.ContainerPort != nil") - } else if that1.ContainerPort != nil { - return fmt3.Errorf("ContainerPort this(%v) Not Equal that(%v)", this.ContainerPort, that1.ContainerPort) - } - if this.Protocol != nil && that1.Protocol != nil { - if *this.Protocol != *that1.Protocol { - return fmt3.Errorf("Protocol this(%v) Not Equal that(%v)", *this.Protocol, *that1.Protocol) - } - } else if this.Protocol != nil { - return fmt3.Errorf("this.Protocol == nil && that.Protocol != nil") - } else if that1.Protocol != nil { - return fmt3.Errorf("Protocol this(%v) Not Equal that(%v)", this.Protocol, that1.Protocol) - } - 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 *ContainerInfo_DockerInfo_PortMapping) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true +func (m *DiscoveryInfo) Unmarshal(data []byte) error { + var hasFields [1]uint64 + 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 + } } - return false - } - - that1, ok := that.(*ContainerInfo_DockerInfo_PortMapping) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Visibility", wireType) + } + var v DiscoveryInfo_Visibility + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (DiscoveryInfo_Visibility(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Visibility = &v + hasFields[0] |= uint64(0x00000001) + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", 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 + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(data[iNdEx:postIndex]) + m.Name = &s + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Environment", 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 + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(data[iNdEx:postIndex]) + m.Environment = &s + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Location", 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 + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(data[iNdEx:postIndex]) + m.Location = &s + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Version", 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 + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(data[iNdEx:postIndex]) + m.Version = &s + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Ports", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Ports == nil { + m.Ports = &Ports{} + } + if err := m.Ports.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMesos + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Labels == nil { + m.Labels = &Labels{} + } + if err := m.Labels.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipMesos(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMesos + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - return false - } else if this == nil { - return false } - if this.HostPort != nil && that1.HostPort != nil { - if *this.HostPort != *that1.HostPort { - return false - } - } else if this.HostPort != nil { - return false - } else if that1.HostPort != nil { - return false + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("visibility") } - if this.ContainerPort != nil && that1.ContainerPort != nil { - if *this.ContainerPort != *that1.ContainerPort { - return false + + return nil +} +func skipMesos(data []byte) (n int, err error) { + l := len(data) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } } - } else if this.ContainerPort != nil { - return false - } else if that1.ContainerPort != nil { - return false - } - if this.Protocol != nil && that1.Protocol != nil { - if *this.Protocol != *that1.Protocol { - return false + wireType := int(wire & 0x7) + switch wireType { + case 0: + for { + 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 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, ErrInvalidLengthMesos + } + return iNdEx, nil + case 3: + for { + var innerWire uint64 + var start int = iNdEx + for shift := uint(0); ; shift += 7 { + 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 := skipMesos(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) } - } else if this.Protocol != nil { - return false - } else if that1.Protocol != nil { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false } - return true + panic("unreachable") } + +var ( + ErrInvalidLengthMesos = fmt.Errorf("proto: negative length found during unmarshaling") +) diff --git a/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/mesos.proto b/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/mesos.proto index 545879ede879..2d00b43fdec2 100644 --- a/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/mesos.proto +++ b/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/mesos.proto @@ -105,52 +105,83 @@ message ContainerID { /** - * Describes a framework. The user field is used to determine the - * Unix user that an executor/task should be launched as. If the user - * field is set to an empty string Mesos will automagically set it - * to the current user. Note that the ID is only available after a - * framework has registered, however, it is included here in order to - * facilitate scheduler failover (i.e., if it is set then the - * MesosSchedulerDriver expects the scheduler is performing failover). - * The amount of time that the master will wait for the scheduler to - * failover before removing the framework is specified by - * failover_timeout. If checkpoint is set, framework pid, executor - * pids and status updates are checkpointed to disk by the slaves. - * Checkpointing allows a restarted slave to reconnect with old - * executors and recover status updates, at the cost of disk I/O. - * The role field is used to group frameworks for allocation - * decisions, depending on the allocation policy being used. - * If the hostname field is set to an empty string Mesos will - * automagically set it to the current hostname. - * The principal field should match the credential the framework uses - * in authentication. This field is used for framework API rate - * exporting and limiting and should be set even if authentication is - * not enabled if these features are desired. - * The webui_url field allows a framework to advertise its web UI, so - * that the Mesos web UI can link to it. It is expected to be a full - * URL, for example http://my-scheduler.example.com:8080/. + * Describes a framework. */ message FrameworkInfo { + // Used to determine the Unix user that an executor or task should + // be launched as. If the user field is set to an empty string Mesos + // will automagically set it to the current user. required string user = 1; + + // Name of the framework that shows up in the Mesos Web UI. required string name = 2; + + // Note that 'id' is only available after a framework has + // registered, however, it is included here in order to facilitate + // scheduler failover (i.e., if it is set then the + // MesosSchedulerDriver expects the scheduler is performing + // failover). optional FrameworkID id = 3; + + // The amount of time that the master will wait for the scheduler to + // failover before it tears down the framework by killing all its + // tasks/executors. This should be non-zero if a framework expects + // to reconnect after a failover and not lose its tasks/executors. optional double failover_timeout = 4 [default = 0.0]; + + // If set, framework pid, executor pids and status updates are + // checkpointed to disk by the slaves. Checkpointing allows a + // restarted slave to reconnect with old executors and recover + // status updates, at the cost of disk I/O. optional bool checkpoint = 5 [default = false]; + + // Used to group frameworks for allocation decisions, depending on + // the allocation policy being used. optional string role = 6 [default = "*"]; + + // Used to indicate the current host from which the scheduler is + // registered in the Mesos Web UI. If set to an empty string Mesos + // will automagically set it to the current hostname. optional string hostname = 7; + + // This field should match the credential's principal the framework + // uses for authentication. This field is used for framework API + // rate limiting and dynamic reservations. It should be set even + // if authentication is not enabled if these features are desired. optional string principal = 8; + + // This field allows a framework to advertise its web UI, so that + // the Mesos web UI can link to it. It is expected to be a full URL, + // for example http://my-scheduler.example.com:8080/. optional string webui_url = 9; + + message Capability { + enum Type { + // Receive offers with revocable resources. See 'Resource' + // message for details. + // TODO(vinod): This is currently a no-op. + REVOCABLE_RESOURCES = 1; + } + + required Type type = 1; + } + + // This field allows a framework to advertise its set of + // capabilities (e.g., ability to receive offers for revocable + // resources). + repeated Capability capabilities = 10; } /** * Describes a health check for a task or executor (or any arbitrary * process/command). A "strategy" is picked by specifying one of the - * optional fields, currently only 'http' and 'command' are - * supported. Specifying more than one strategy is an error. + * optional fields; currently only 'command' is supported. + * Specifying more than one strategy is an error. */ message HealthCheck { - // Describes an HTTP health check. + // Describes an HTTP health check. This is not fully implemented and not + // recommended for use - see MESOS-2533. message HTTP { // Port to send the HTTP request. required uint32 port = 1; @@ -170,6 +201,7 @@ message HealthCheck { // for specific data in the response. } + // HTTP health check - not yet recommended for use, see MESOS-2533. optional HTTP http = 1; // TODO(benh): Consider adding a URL health check strategy which @@ -177,12 +209,7 @@ message HealthCheck { // encapsulates all the details in a single string field. // TODO(benh): Other possible health check strategies could include - // one for TCP/UDP or a "command". A "command" could be running a - // (shell) command to check the healthiness. We'd need to determine - // what arguments (or environment variables) we'd want to set so - // that the command could do it's job (i.e., do we want to expose - // the stdout/stderr and/or the pid to make checking for healthiness - // easier). + // one for TCP/UDP. // Amount of time to wait until starting the health checks. optional double delay_seconds = 2 [default = 15.0]; @@ -218,7 +245,24 @@ message CommandInfo { message URI { required string value = 1; optional bool executable = 2; + + // In case the fetched file is recognized as an archive, extract + // its contents into the sandbox. Note that a cached archive is + // not copied from the cache to the sandbox in case extraction + // originates from an archive in the cache. optional bool extract = 3 [default = true]; + + // If this field is "true", the fetcher cache will be used. If not, + // fetching bypasses the cache and downloads directly into the + // sandbox directory, no matter whether a suitable cache file is + // available or not. The former directs the fetcher to download to + // the file cache, then copy from there to the sandbox. Subsequent + // fetch attempts with the same URI will omit downloading and copy + // from the cache as long as the file is resident there. Cache files + // may get evicted at any time, which then leads to renewed + // downloading. See also "docs/fetcher.md" and + // "docs/fetcher-cache-internals.md". + optional bool cache = 4; } // Describes a container. @@ -293,6 +337,12 @@ message ExecutorInfo { // usage information into a time series database for monitoring. optional string source = 10; optional bytes data = 4; + + // Service discovery information for the executor. It is not + // interpreted or acted upon by Mesos. It is up to a service + // discovery system to use this information as needed and to handle + // executors without service discovery information. + optional DiscoveryInfo discovery = 12; } @@ -307,6 +357,7 @@ message MasterInfo { required uint32 port = 3 [default = 5050]; optional string pid = 4; optional string hostname = 5; + optional string version = 6; } @@ -323,6 +374,8 @@ message SlaveInfo { repeated Resource resources = 3; repeated Attribute attributes = 5; optional SlaveID id = 6; + // TODO(joerg84): Remove checkpoint field as with 0.22.0 + // slave checkpointing is enabled for all slaves (MESOS-2317). optional bool checkpoint = 7 [default = false]; } @@ -399,15 +452,122 @@ message Resource { optional Value.Ranges ranges = 4; optional Value.Set set = 5; optional string role = 6 [default = "*"]; + + message ReservationInfo { + // Describes a dynamic reservation. A dynamic reservation is + // acquired by an operator via the '/reserve' HTTP endpoint or by + // a framework via the offer cycle by sending back an + // 'Offer::Operation::Reserve' message. + // NOTE: We currently do not allow frameworks with role "*" to + // make dynamic reservations. + + // This field indicates the principal of the operator or framework + // that reserved this resource. It is used in conjunction with the + // "unreserve" ACL to determine whether the entity attempting to + // unreserve this resource is permitted to do so. + // NOTE: This field should match the FrameworkInfo.principal of + // the framework that reserved this resource. + required string principal = 1; + } + + // If this is set, this resource was dynamically reserved by an + // operator or a framework. Otherwise, this resource is either unreserved + // or statically reserved by an operator via the --resources flag. + optional ReservationInfo reservation = 8; + + message DiskInfo { + // Describes a persistent disk volume. + // A persistent disk volume will not be automatically garbage + // collected if the task/executor/slave terminates, but is + // re-offered to the framework(s) belonging to the 'role'. + // A framework can set the ID (if it is not set yet) to express + // the intention to create a new persistent disk volume from a + // regular disk resource. To reuse a previously created volume, a + // framework can launch a task/executor when it receives an offer + // with a persistent volume, i.e., ID is set. + // NOTE: Currently, we do not allow a persistent disk volume + // without a reservation (i.e., 'role' should not be '*'). + message Persistence { + // A unique ID for the persistent disk volume. + // NOTE: The ID needs to be unique per role on each slave. + required string id = 1; + } + + optional Persistence persistence = 1; + + // Describes how this disk resource will be mounted in the + // container. If not set, the disk resource will be used as the + // sandbox. Otherwise, it will be mounted according to the + // 'container_path' inside 'volume'. The 'host_path' inside + // 'volume' is ignored. + // NOTE: If 'volume' is set but 'persistence' is not set, the + // volume will be automatically garbage collected after + // task/executor terminates. Currently, if 'persistence' is set, + // 'volume' must be set. + optional Volume volume = 2; + } + + optional DiskInfo disk = 7; + + message RevocableInfo {} + + // If this is set, the resources are revocable, i.e., any tasks or + // executors launched using these resources could get preempted or + // throttled at any time. This could be used by frameworks to run + // best effort tasks that do not need strict uptime or performance + // guarantees. Note that if this is set, 'disk' or 'reservation' + // cannot be set. + optional RevocableInfo revocable = 9; +} + +/** + * When the network bandwidth caps are enabled and the container + * is over its limit, outbound packets may be either delayed or + * dropped completely either because it exceeds the maximum bandwidth + * allocation for a single container (the cap) or because the combined + * network traffic of multiple containers on the host exceeds the + * transmit capacity of the host (the share). We can report the + * following statistics for each of these conditions exported directly + * from the Linux Traffic Control Queueing Discipline. + * + * id : name of the limiter, e.g. 'tx_bw_cap' + * backlog : number of packets currently delayed + * bytes : total bytes seen + * drops : number of packets dropped in total + * overlimits : number of packets which exceeded allocation + * packets : total packets seen + * qlen : number of packets currently queued + * rate_bps : throughput in bytes/sec + * rate_pps : throughput in packets/sec + * requeues : number of times a packet has been delayed due to + * locking or device contention issues + * + * More information on the operation of Linux Traffic Control can be + * found at http://www.lartc.org/lartc.html. + */ +message TrafficControlStatistics { + required string id = 1; + optional uint64 backlog = 2; + optional uint64 bytes = 3; + optional uint64 drops = 4; + optional uint64 overlimits = 5; + optional uint64 packets = 6; + optional uint64 qlen = 7; + optional uint64 ratebps = 8; + optional uint64 ratepps = 9; + optional uint64 requeues = 10; } -/* +/** * A snapshot of resource usage statistics. */ message ResourceStatistics { required double timestamp = 1; // Snapshot time, in seconds since the Epoch. + optional uint32 processes = 30; + optional uint32 threads = 31; + // CPU Usage Information: // Total CPU time spent in user mode, and kernel mode. optional double cpus_user_time_secs = 2; @@ -422,17 +582,55 @@ message ResourceStatistics { optional double cpus_throttled_time_secs = 9; // Memory Usage Information: - optional uint64 mem_rss_bytes = 5; // Resident Set Size. - // Amount of memory resources allocated. + // mem_total_bytes was added in 0.23.0 to represent the total memory + // of a process in RAM (as opposed to in Swap). This was previously + // reported as mem_rss_bytes, which was also changed in 0.23.0 to + // represent only the anonymous memory usage, to keep in sync with + // Linux kernel's (arguably erroneous) use of terminology. + optional uint64 mem_total_bytes = 36; + + // Total memory + swap usage. This is set if swap is enabled. + optional uint64 mem_total_memsw_bytes = 37; + + // Hard memory limit for a container. optional uint64 mem_limit_bytes = 6; - // Broken out memory usage information (files, anonymous, and mmaped files) + // Soft memory limit for a container. + optional uint64 mem_soft_limit_bytes = 38; + + // Broken out memory usage information: pagecache, rss (anonymous), + // mmaped files and swap. + + // TODO(chzhcn) mem_file_bytes and mem_anon_bytes are deprecated in + // 0.23.0 and will be removed in 0.24.0. optional uint64 mem_file_bytes = 10; optional uint64 mem_anon_bytes = 11; - optional uint64 mem_mapped_file_bytes = 12; - // TODO(bmahler): Add disk usage. + // mem_cache_bytes is added in 0.23.0 to represent page cache usage. + optional uint64 mem_cache_bytes = 39; + + // Since 0.23.0, mem_rss_bytes is changed to represent only + // anonymous memory usage. Note that neither its requiredness, type, + // name nor numeric tag has been changed. + optional uint64 mem_rss_bytes = 5; + + optional uint64 mem_mapped_file_bytes = 12; + // This is only set if swap is enabled. + optional uint64 mem_swap_bytes = 40; + + // Number of occurrences of different levels of memory pressure + // events reported by memory cgroup. Pressure listening (re)starts + // with these values set to 0 when slave (re)starts. See + // https://www.kernel.org/doc/Documentation/cgroups/memory.txt for + // more details. + optional uint64 mem_low_pressure_counter = 32; + optional uint64 mem_medium_pressure_counter = 33; + optional uint64 mem_critical_pressure_counter = 34; + + // Disk Usage Information for executor working directory. + optional uint64 disk_limit_bytes = 26; + optional uint64 disk_used_bytes = 27; // Perf statistics. optional PerfStatistics perf = 13; @@ -453,34 +651,36 @@ message ResourceStatistics { optional double net_tcp_rtt_microsecs_p90 = 23; optional double net_tcp_rtt_microsecs_p95 = 24; optional double net_tcp_rtt_microsecs_p99 = 25; + + optional double net_tcp_active_connections = 28; + optional double net_tcp_time_wait_connections = 29; + + // Network traffic flowing into or out of a container can be delayed + // or dropped due to congestion or policy inside and outside the + // container. + repeated TrafficControlStatistics net_traffic_control_statistics = 35; } /** - * Describes a snapshot of the resource usage for an executor. - * - * TODO(bmahler): Note that we want to be sending this information - * to the master, and subsequently to the relevant scheduler. So - * this proto is designed to be easy for the scheduler to use, this - * is why we provide the slave id, executor info / task info. + * Describes a snapshot of the resource usage for executors. */ message ResourceUsage { - required SlaveID slave_id = 1; - required FrameworkID framework_id = 2; + message Executor { + required ExecutorInfo executor_info = 1; - // Resource usage is for an executor. For tasks launched with - // an explicit executor, the executor id is provided. For tasks - // launched without an executor, our internal executor will be - // used. In this case, we provide the task id here instead, in - // order to make this message easier for schedulers to work with. + // This includes resources used by the executor itself + // as well as its active tasks. + repeated Resource allocated = 2; - optional ExecutorID executor_id = 3; // If present, this executor was - optional string executor_name = 4; // explicitly specified. + // Current resource usage. If absent, the containerizer + // cannot provide resource usage. + optional ResourceStatistics statistics = 3; + } - optional TaskID task_id = 5; // If present, the task did not have an executor. + repeated Executor executors = 1; - // If missing, the isolation module cannot provide resource usage. - optional ResourceStatistics statistics = 6; + // TODO(jieyu): Include slave's total resources here. } @@ -564,6 +764,8 @@ message PerfStatistics { * to proactively influence the allocator. If 'slave_id' is provided * then this request is assumed to only apply to resources on that * slave. + * + * TODO(vinod): Remove this once the old driver is removed. */ message Request { optional SlaveID slave_id = 1; @@ -583,6 +785,44 @@ message Offer { repeated Resource resources = 5; repeated Attribute attributes = 7; repeated ExecutorID executor_ids = 6; + + // Defines an operation that can be performed against offers. + message Operation { + enum Type { + LAUNCH = 1; + RESERVE = 2; + UNRESERVE = 3; + CREATE = 4; + DESTROY = 5; + } + + message Launch { + repeated TaskInfo task_infos = 1; + } + + message Reserve { + repeated Resource resources = 1; + } + + message Unreserve { + repeated Resource resources = 1; + } + + message Create { + repeated Resource volumes = 1; + } + + message Destroy { + repeated Resource volumes = 1; + } + + required Type type = 1; + optional Launch launch = 2; + optional Reserve reserve = 3; + optional Unreserve unreserve = 4; + optional Create create = 5; + optional Destroy destroy = 6; + } } @@ -607,6 +847,19 @@ message TaskInfo { // A health check for the task (currently in *alpha* and initial // support will only be for TaskInfo's that have a CommandInfo). optional HealthCheck health_check = 8; + + // Labels are free-form key value pairs which are exposed through + // master and slave endpoints. Labels will not be interpreted or + // acted upon by Mesos itself. As opposed to the data field, labels + // will be kept in memory on master and slave processes. Therefore, + // labels should be used to tag tasks with light-weight meta-data. + optional Labels labels = 10; + + // Service discovery information for the task. It is not interpreted + // or acted upon by Mesos. It is up to a service discovery system + // to use this information as needed and to handle tasks without + // service discovery information. + optional DiscoveryInfo discovery = 11; } @@ -625,8 +878,6 @@ enum TaskState { TASK_FAILED = 3; // TERMINAL. The task failed to finish successfully. TASK_KILLED = 4; // TERMINAL. The task was killed by the executor. TASK_LOST = 5; // TERMINAL. The task failed but can be rescheduled. - // TASK_ERROR is currently unused but will be introduced in 0.22.0. - // TODO(dhamon): Start using TASK_ERROR. TASK_ERROR = 7; // TERMINAL. The task description contains an error. } @@ -635,16 +886,20 @@ enum TaskState { * Describes the current status of a task. */ message TaskStatus { - /** Describes the source of the task status update. */ + // Describes the source of the task status update. enum Source { SOURCE_MASTER = 0; SOURCE_SLAVE = 1; SOURCE_EXECUTOR = 2; } - /** Detailed reason for the task status update. */ + // Detailed reason for the task status update. + // + // TODO(bmahler): Differentiate between slave removal reasons + // (e.g. unhealthy vs. unregistered for maintenance). enum Reason { REASON_COMMAND_EXECUTOR_FAILED = 0; + REASON_EXECUTOR_PREEMPTED = 17; REASON_EXECUTOR_TERMINATED = 1; REASON_EXECUTOR_UNREGISTERED = 2; REASON_FRAMEWORK_REMOVED = 3; @@ -654,6 +909,7 @@ message TaskStatus { REASON_MASTER_DISCONNECTED = 7; REASON_MEMORY_LIMIT = 8; REASON_RECONCILIATION = 9; + REASON_RESOURCES_UNKNOWN = 18; REASON_SLAVE_DISCONNECTED = 10; REASON_SLAVE_REMOVED = 11; REASON_SLAVE_RESTARTED = 12; @@ -673,6 +929,17 @@ message TaskStatus { optional ExecutorID executor_id = 7; // TODO(benh): Use in master/slave. optional double timestamp = 6; + // Statuses that are delivered reliably to the scheduler will + // include a 'uuid'. The status is considered delivered once + // it is acknowledged by the scheduler. Schedulers can choose + // to either explicitly acknowledge statuses or let the scheduler + // driver implicitly acknowledge (default). + // + // TODO(bmahler): This is currently overwritten in the scheduler + // driver and executor driver, but executors will need to set this + // to a valid RFC-4122 UUID if using the HTTP API. + optional bytes uuid = 11; + // Describes whether the task has been determined to be healthy // (true) or unhealthy (false) according to the HealthCheck field in // the command info. @@ -928,10 +1195,15 @@ message ContainerInfo { optional bool privileged = 4 [default = false]; // Allowing arbitrary parameters to be passed to docker CLI. - // Note that anything passed to this field is not guranteed + // Note that anything passed to this field is not guaranteed // to be supported moving forward, as we might move away from // the docker CLI. repeated Parameter parameters = 5; + + // With this flag set to true, the docker containerizer will + // pull the docker image from the registry even if the image + // is already downloaded on the slave. + optional bool force_pull_image = 6; } required Type type = 1; @@ -940,3 +1212,68 @@ message ContainerInfo { optional DockerInfo docker = 3; } + + +/** + * Collection of labels. + */ +message Labels { + repeated Label labels = 1; +} + + +/** + * Key, value pair used to store free form user-data. + */ +message Label { + required string key = 1; + optional string value = 2; +} + + +/** + * Named port used for service discovery. + */ +message Port { + required uint32 number = 1; + optional string name = 2; + optional string protocol = 3; +} + + +/** + * Collection of ports. + */ +message Ports { + repeated Port ports = 1; +} + + +/** +* Service discovery information. +* The visibility field restricts discovery within a framework +* (FRAMEWORK), within a Mesos cluster (CLUSTER), or places no +* restrictions (EXTERNAL). +* The environment, location, and version fields provide first class +* support for common attributes used to differentiate between +* similar services. The environment may receive values such as +* PROD/QA/DEV, the location field may receive values like +* EAST-US/WEST-US/EUROPE/AMEA, and the version field may receive +* values like v2.0/v0.9. The exact use of these fields is up to each +* service discovery system. +*/ +message DiscoveryInfo { + enum Visibility { + FRAMEWORK = 0; + CLUSTER = 1; + EXTERNAL = 2; + } + + required Visibility visibility = 1; + optional string name = 2; + optional string environment = 3; + optional string location = 4; + optional string version = 5; + optional Ports ports = 6; + optional Labels labels = 7; +} diff --git a/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/mesospb_test.go b/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/mesospb_test.go index da57cf921fcb..aef9eac80105 100644 --- a/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/mesospb_test.go +++ b/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/mesospb_test.go @@ -8,56 +8,56 @@ import testing "testing" import math_rand "math/rand" import time "time" import github_com_gogo_protobuf_proto "github.com/gogo/protobuf/proto" -import testing1 "testing" -import math_rand1 "math/rand" -import time1 "time" -import encoding_json "encoding/json" -import testing2 "testing" -import math_rand2 "math/rand" -import time2 "time" -import github_com_gogo_protobuf_proto1 "github.com/gogo/protobuf/proto" -import math_rand3 "math/rand" -import time3 "time" -import testing3 "testing" +import github_com_gogo_protobuf_jsonpb "github.com/gogo/protobuf/jsonpb" import fmt "fmt" -import math_rand4 "math/rand" -import time4 "time" -import testing4 "testing" -import github_com_gogo_protobuf_proto2 "github.com/gogo/protobuf/proto" -import math_rand5 "math/rand" -import time5 "time" -import testing5 "testing" -import fmt1 "fmt" import go_parser "go/parser" -import math_rand6 "math/rand" -import time6 "time" -import testing6 "testing" -import github_com_gogo_protobuf_proto3 "github.com/gogo/protobuf/proto" +import proto "github.com/gogo/protobuf/proto" +import math "math" + +// discarding unused import gogoproto "github.com/gogo/protobuf/gogoproto" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf func TestFrameworkIDProto(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedFrameworkID(popr, false) data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &FrameworkID{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } func TestFrameworkIDMarshalTo(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedFrameworkID(popr, false) size := p.Size() data := make([]byte, size) @@ -66,20 +66,20 @@ func TestFrameworkIDMarshalTo(t *testing.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &FrameworkID{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } @@ -124,29 +124,42 @@ func BenchmarkFrameworkIDProtoUnmarshal(b *testing.B) { } func TestOfferIDProto(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedOfferID(popr, false) data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &OfferID{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } func TestOfferIDMarshalTo(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedOfferID(popr, false) size := p.Size() data := make([]byte, size) @@ -155,20 +168,20 @@ func TestOfferIDMarshalTo(t *testing.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &OfferID{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } @@ -213,29 +226,42 @@ func BenchmarkOfferIDProtoUnmarshal(b *testing.B) { } func TestSlaveIDProto(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedSlaveID(popr, false) data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &SlaveID{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } func TestSlaveIDMarshalTo(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedSlaveID(popr, false) size := p.Size() data := make([]byte, size) @@ -244,20 +270,20 @@ func TestSlaveIDMarshalTo(t *testing.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &SlaveID{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } @@ -302,29 +328,42 @@ func BenchmarkSlaveIDProtoUnmarshal(b *testing.B) { } func TestTaskIDProto(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedTaskID(popr, false) data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &TaskID{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } func TestTaskIDMarshalTo(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedTaskID(popr, false) size := p.Size() data := make([]byte, size) @@ -333,20 +372,20 @@ func TestTaskIDMarshalTo(t *testing.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &TaskID{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } @@ -391,29 +430,42 @@ func BenchmarkTaskIDProtoUnmarshal(b *testing.B) { } func TestExecutorIDProto(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedExecutorID(popr, false) data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &ExecutorID{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } func TestExecutorIDMarshalTo(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedExecutorID(popr, false) size := p.Size() data := make([]byte, size) @@ -422,20 +474,20 @@ func TestExecutorIDMarshalTo(t *testing.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &ExecutorID{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } @@ -480,29 +532,42 @@ func BenchmarkExecutorIDProtoUnmarshal(b *testing.B) { } func TestContainerIDProto(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedContainerID(popr, false) data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &ContainerID{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } func TestContainerIDMarshalTo(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedContainerID(popr, false) size := p.Size() data := make([]byte, size) @@ -511,20 +576,20 @@ func TestContainerIDMarshalTo(t *testing.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &ContainerID{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } @@ -569,29 +634,42 @@ func BenchmarkContainerIDProtoUnmarshal(b *testing.B) { } func TestFrameworkInfoProto(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedFrameworkInfo(popr, false) data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &FrameworkInfo{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } func TestFrameworkInfoMarshalTo(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedFrameworkInfo(popr, false) size := p.Size() data := make([]byte, size) @@ -600,20 +678,20 @@ func TestFrameworkInfoMarshalTo(t *testing.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &FrameworkInfo{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } @@ -657,30 +735,145 @@ func BenchmarkFrameworkInfoProtoUnmarshal(b *testing.B) { b.SetBytes(int64(total / b.N)) } +func TestFrameworkInfo_CapabilityProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedFrameworkInfo_Capability(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &FrameworkInfo_Capability{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) + for i := range data { + data[i] = byte(popr.Intn(256)) + } + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) + } +} + +func TestFrameworkInfo_CapabilityMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedFrameworkInfo_Capability(popr, false) + size := p.Size() + data := make([]byte, size) + for i := range data { + data[i] = byte(popr.Intn(256)) + } + _, err := p.MarshalTo(data) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &FrameworkInfo_Capability{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + for i := range data { + data[i] = byte(popr.Intn(256)) + } + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } +} + +func BenchmarkFrameworkInfo_CapabilityProtoMarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*FrameworkInfo_Capability, 10000) + for i := 0; i < 10000; i++ { + pops[i] = NewPopulatedFrameworkInfo_Capability(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + data, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) + if err != nil { + panic(err) + } + total += len(data) + } + b.SetBytes(int64(total / b.N)) +} + +func BenchmarkFrameworkInfo_CapabilityProtoUnmarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + datas := make([][]byte, 10000) + for i := 0; i < 10000; i++ { + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedFrameworkInfo_Capability(popr, false)) + if err != nil { + panic(err) + } + datas[i] = data + } + msg := &FrameworkInfo_Capability{} + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += len(datas[i%10000]) + if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { + panic(err) + } + } + b.SetBytes(int64(total / b.N)) +} + func TestHealthCheckProto(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedHealthCheck(popr, false) data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &HealthCheck{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } func TestHealthCheckMarshalTo(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedHealthCheck(popr, false) size := p.Size() data := make([]byte, size) @@ -689,20 +882,20 @@ func TestHealthCheckMarshalTo(t *testing.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &HealthCheck{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } @@ -747,29 +940,42 @@ func BenchmarkHealthCheckProtoUnmarshal(b *testing.B) { } func TestHealthCheck_HTTPProto(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedHealthCheck_HTTP(popr, false) data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &HealthCheck_HTTP{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } func TestHealthCheck_HTTPMarshalTo(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedHealthCheck_HTTP(popr, false) size := p.Size() data := make([]byte, size) @@ -778,20 +984,20 @@ func TestHealthCheck_HTTPMarshalTo(t *testing.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &HealthCheck_HTTP{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } @@ -836,29 +1042,42 @@ func BenchmarkHealthCheck_HTTPProtoUnmarshal(b *testing.B) { } func TestCommandInfoProto(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedCommandInfo(popr, false) data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &CommandInfo{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } func TestCommandInfoMarshalTo(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedCommandInfo(popr, false) size := p.Size() data := make([]byte, size) @@ -867,20 +1086,20 @@ func TestCommandInfoMarshalTo(t *testing.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &CommandInfo{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } @@ -925,29 +1144,42 @@ func BenchmarkCommandInfoProtoUnmarshal(b *testing.B) { } func TestCommandInfo_URIProto(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedCommandInfo_URI(popr, false) data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &CommandInfo_URI{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } func TestCommandInfo_URIMarshalTo(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedCommandInfo_URI(popr, false) size := p.Size() data := make([]byte, size) @@ -956,20 +1188,20 @@ func TestCommandInfo_URIMarshalTo(t *testing.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &CommandInfo_URI{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } @@ -1014,29 +1246,42 @@ func BenchmarkCommandInfo_URIProtoUnmarshal(b *testing.B) { } func TestCommandInfo_ContainerInfoProto(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedCommandInfo_ContainerInfo(popr, false) data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &CommandInfo_ContainerInfo{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } func TestCommandInfo_ContainerInfoMarshalTo(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedCommandInfo_ContainerInfo(popr, false) size := p.Size() data := make([]byte, size) @@ -1045,20 +1290,20 @@ func TestCommandInfo_ContainerInfoMarshalTo(t *testing.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &CommandInfo_ContainerInfo{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } @@ -1103,29 +1348,42 @@ func BenchmarkCommandInfo_ContainerInfoProtoUnmarshal(b *testing.B) { } func TestExecutorInfoProto(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedExecutorInfo(popr, false) data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &ExecutorInfo{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } func TestExecutorInfoMarshalTo(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedExecutorInfo(popr, false) size := p.Size() data := make([]byte, size) @@ -1134,20 +1392,20 @@ func TestExecutorInfoMarshalTo(t *testing.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &ExecutorInfo{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } @@ -1192,29 +1450,42 @@ func BenchmarkExecutorInfoProtoUnmarshal(b *testing.B) { } func TestMasterInfoProto(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedMasterInfo(popr, false) data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &MasterInfo{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } func TestMasterInfoMarshalTo(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedMasterInfo(popr, false) size := p.Size() data := make([]byte, size) @@ -1223,20 +1494,20 @@ func TestMasterInfoMarshalTo(t *testing.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &MasterInfo{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } @@ -1281,29 +1552,42 @@ func BenchmarkMasterInfoProtoUnmarshal(b *testing.B) { } func TestSlaveInfoProto(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedSlaveInfo(popr, false) data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &SlaveInfo{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } func TestSlaveInfoMarshalTo(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedSlaveInfo(popr, false) size := p.Size() data := make([]byte, size) @@ -1312,20 +1596,20 @@ func TestSlaveInfoMarshalTo(t *testing.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &SlaveInfo{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } @@ -1370,29 +1654,42 @@ func BenchmarkSlaveInfoProtoUnmarshal(b *testing.B) { } func TestValueProto(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedValue(popr, false) data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Value{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } func TestValueMarshalTo(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedValue(popr, false) size := p.Size() data := make([]byte, size) @@ -1401,20 +1698,20 @@ func TestValueMarshalTo(t *testing.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Value{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } @@ -1459,29 +1756,42 @@ func BenchmarkValueProtoUnmarshal(b *testing.B) { } func TestValue_ScalarProto(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedValue_Scalar(popr, false) data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Value_Scalar{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } func TestValue_ScalarMarshalTo(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedValue_Scalar(popr, false) size := p.Size() data := make([]byte, size) @@ -1490,20 +1800,20 @@ func TestValue_ScalarMarshalTo(t *testing.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Value_Scalar{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } @@ -1548,29 +1858,42 @@ func BenchmarkValue_ScalarProtoUnmarshal(b *testing.B) { } func TestValue_RangeProto(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedValue_Range(popr, false) data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Value_Range{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } func TestValue_RangeMarshalTo(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedValue_Range(popr, false) size := p.Size() data := make([]byte, size) @@ -1579,20 +1902,20 @@ func TestValue_RangeMarshalTo(t *testing.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Value_Range{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } @@ -1637,29 +1960,42 @@ func BenchmarkValue_RangeProtoUnmarshal(b *testing.B) { } func TestValue_RangesProto(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedValue_Ranges(popr, false) data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Value_Ranges{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } func TestValue_RangesMarshalTo(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedValue_Ranges(popr, false) size := p.Size() data := make([]byte, size) @@ -1668,20 +2004,20 @@ func TestValue_RangesMarshalTo(t *testing.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Value_Ranges{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } @@ -1726,29 +2062,42 @@ func BenchmarkValue_RangesProtoUnmarshal(b *testing.B) { } func TestValue_SetProto(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedValue_Set(popr, false) data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Value_Set{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } func TestValue_SetMarshalTo(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedValue_Set(popr, false) size := p.Size() data := make([]byte, size) @@ -1757,20 +2106,20 @@ func TestValue_SetMarshalTo(t *testing.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Value_Set{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } @@ -1815,29 +2164,42 @@ func BenchmarkValue_SetProtoUnmarshal(b *testing.B) { } func TestValue_TextProto(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedValue_Text(popr, false) data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Value_Text{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } func TestValue_TextMarshalTo(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedValue_Text(popr, false) size := p.Size() data := make([]byte, size) @@ -1846,20 +2208,20 @@ func TestValue_TextMarshalTo(t *testing.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Value_Text{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } @@ -1904,29 +2266,42 @@ func BenchmarkValue_TextProtoUnmarshal(b *testing.B) { } func TestAttributeProto(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedAttribute(popr, false) data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Attribute{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } func TestAttributeMarshalTo(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedAttribute(popr, false) size := p.Size() data := make([]byte, size) @@ -1935,20 +2310,20 @@ func TestAttributeMarshalTo(t *testing.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Attribute{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } @@ -1993,29 +2368,42 @@ func BenchmarkAttributeProtoUnmarshal(b *testing.B) { } func TestResourceProto(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedResource(popr, false) data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Resource{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } func TestResourceMarshalTo(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedResource(popr, false) size := p.Size() data := make([]byte, size) @@ -2024,20 +2412,20 @@ func TestResourceMarshalTo(t *testing.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Resource{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } @@ -2081,31 +2469,44 @@ func BenchmarkResourceProtoUnmarshal(b *testing.B) { b.SetBytes(int64(total / b.N)) } -func TestResourceStatisticsProto(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedResourceStatistics(popr, false) +func TestResource_ReservationInfoProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedResource_ReservationInfo(popr, false) data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &ResourceStatistics{} + msg := &Resource_ReservationInfo{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestResourceStatisticsMarshalTo(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedResourceStatistics(popr, false) +func TestResource_ReservationInfoMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedResource_ReservationInfo(popr, false) size := p.Size() data := make([]byte, size) for i := range data { @@ -2113,29 +2514,29 @@ func TestResourceStatisticsMarshalTo(t *testing.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &ResourceStatistics{} + msg := &Resource_ReservationInfo{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkResourceStatisticsProtoMarshal(b *testing.B) { +func BenchmarkResource_ReservationInfoProtoMarshal(b *testing.B) { popr := math_rand.New(math_rand.NewSource(616)) total := 0 - pops := make([]*ResourceStatistics, 10000) + pops := make([]*Resource_ReservationInfo, 10000) for i := 0; i < 10000; i++ { - pops[i] = NewPopulatedResourceStatistics(popr, false) + pops[i] = NewPopulatedResource_ReservationInfo(popr, false) } b.ResetTimer() for i := 0; i < b.N; i++ { @@ -2148,18 +2549,18 @@ func BenchmarkResourceStatisticsProtoMarshal(b *testing.B) { b.SetBytes(int64(total / b.N)) } -func BenchmarkResourceStatisticsProtoUnmarshal(b *testing.B) { +func BenchmarkResource_ReservationInfoProtoUnmarshal(b *testing.B) { popr := math_rand.New(math_rand.NewSource(616)) total := 0 datas := make([][]byte, 10000) for i := 0; i < 10000; i++ { - data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedResourceStatistics(popr, false)) + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedResource_ReservationInfo(popr, false)) if err != nil { panic(err) } datas[i] = data } - msg := &ResourceStatistics{} + msg := &Resource_ReservationInfo{} b.ResetTimer() for i := 0; i < b.N; i++ { total += len(datas[i%10000]) @@ -2170,31 +2571,44 @@ func BenchmarkResourceStatisticsProtoUnmarshal(b *testing.B) { b.SetBytes(int64(total / b.N)) } -func TestResourceUsageProto(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedResourceUsage(popr, false) +func TestResource_DiskInfoProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedResource_DiskInfo(popr, false) data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &ResourceUsage{} + msg := &Resource_DiskInfo{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestResourceUsageMarshalTo(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedResourceUsage(popr, false) +func TestResource_DiskInfoMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedResource_DiskInfo(popr, false) size := p.Size() data := make([]byte, size) for i := range data { @@ -2202,29 +2616,29 @@ func TestResourceUsageMarshalTo(t *testing.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &ResourceUsage{} + msg := &Resource_DiskInfo{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkResourceUsageProtoMarshal(b *testing.B) { +func BenchmarkResource_DiskInfoProtoMarshal(b *testing.B) { popr := math_rand.New(math_rand.NewSource(616)) total := 0 - pops := make([]*ResourceUsage, 10000) + pops := make([]*Resource_DiskInfo, 10000) for i := 0; i < 10000; i++ { - pops[i] = NewPopulatedResourceUsage(popr, false) + pops[i] = NewPopulatedResource_DiskInfo(popr, false) } b.ResetTimer() for i := 0; i < b.N; i++ { @@ -2237,18 +2651,18 @@ func BenchmarkResourceUsageProtoMarshal(b *testing.B) { b.SetBytes(int64(total / b.N)) } -func BenchmarkResourceUsageProtoUnmarshal(b *testing.B) { +func BenchmarkResource_DiskInfoProtoUnmarshal(b *testing.B) { popr := math_rand.New(math_rand.NewSource(616)) total := 0 datas := make([][]byte, 10000) for i := 0; i < 10000; i++ { - data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedResourceUsage(popr, false)) + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedResource_DiskInfo(popr, false)) if err != nil { panic(err) } datas[i] = data } - msg := &ResourceUsage{} + msg := &Resource_DiskInfo{} b.ResetTimer() for i := 0; i < b.N; i++ { total += len(datas[i%10000]) @@ -2259,31 +2673,44 @@ func BenchmarkResourceUsageProtoUnmarshal(b *testing.B) { b.SetBytes(int64(total / b.N)) } -func TestPerfStatisticsProto(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedPerfStatistics(popr, false) +func TestResource_DiskInfo_PersistenceProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedResource_DiskInfo_Persistence(popr, false) data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &PerfStatistics{} + msg := &Resource_DiskInfo_Persistence{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestPerfStatisticsMarshalTo(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedPerfStatistics(popr, false) +func TestResource_DiskInfo_PersistenceMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedResource_DiskInfo_Persistence(popr, false) size := p.Size() data := make([]byte, size) for i := range data { @@ -2291,29 +2718,29 @@ func TestPerfStatisticsMarshalTo(t *testing.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &PerfStatistics{} + msg := &Resource_DiskInfo_Persistence{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkPerfStatisticsProtoMarshal(b *testing.B) { +func BenchmarkResource_DiskInfo_PersistenceProtoMarshal(b *testing.B) { popr := math_rand.New(math_rand.NewSource(616)) total := 0 - pops := make([]*PerfStatistics, 10000) + pops := make([]*Resource_DiskInfo_Persistence, 10000) for i := 0; i < 10000; i++ { - pops[i] = NewPopulatedPerfStatistics(popr, false) + pops[i] = NewPopulatedResource_DiskInfo_Persistence(popr, false) } b.ResetTimer() for i := 0; i < b.N; i++ { @@ -2326,18 +2753,18 @@ func BenchmarkPerfStatisticsProtoMarshal(b *testing.B) { b.SetBytes(int64(total / b.N)) } -func BenchmarkPerfStatisticsProtoUnmarshal(b *testing.B) { +func BenchmarkResource_DiskInfo_PersistenceProtoUnmarshal(b *testing.B) { popr := math_rand.New(math_rand.NewSource(616)) total := 0 datas := make([][]byte, 10000) for i := 0; i < 10000; i++ { - data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedPerfStatistics(popr, false)) + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedResource_DiskInfo_Persistence(popr, false)) if err != nil { panic(err) } datas[i] = data } - msg := &PerfStatistics{} + msg := &Resource_DiskInfo_Persistence{} b.ResetTimer() for i := 0; i < b.N; i++ { total += len(datas[i%10000]) @@ -2348,31 +2775,44 @@ func BenchmarkPerfStatisticsProtoUnmarshal(b *testing.B) { b.SetBytes(int64(total / b.N)) } -func TestRequestProto(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedRequest(popr, false) +func TestResource_RevocableInfoProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedResource_RevocableInfo(popr, false) data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &Request{} + msg := &Resource_RevocableInfo{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestRequestMarshalTo(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedRequest(popr, false) +func TestResource_RevocableInfoMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedResource_RevocableInfo(popr, false) size := p.Size() data := make([]byte, size) for i := range data { @@ -2380,29 +2820,29 @@ func TestRequestMarshalTo(t *testing.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &Request{} + msg := &Resource_RevocableInfo{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkRequestProtoMarshal(b *testing.B) { +func BenchmarkResource_RevocableInfoProtoMarshal(b *testing.B) { popr := math_rand.New(math_rand.NewSource(616)) total := 0 - pops := make([]*Request, 10000) + pops := make([]*Resource_RevocableInfo, 10000) for i := 0; i < 10000; i++ { - pops[i] = NewPopulatedRequest(popr, false) + pops[i] = NewPopulatedResource_RevocableInfo(popr, false) } b.ResetTimer() for i := 0; i < b.N; i++ { @@ -2415,18 +2855,18 @@ func BenchmarkRequestProtoMarshal(b *testing.B) { b.SetBytes(int64(total / b.N)) } -func BenchmarkRequestProtoUnmarshal(b *testing.B) { +func BenchmarkResource_RevocableInfoProtoUnmarshal(b *testing.B) { popr := math_rand.New(math_rand.NewSource(616)) total := 0 datas := make([][]byte, 10000) for i := 0; i < 10000; i++ { - data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedRequest(popr, false)) + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedResource_RevocableInfo(popr, false)) if err != nil { panic(err) } datas[i] = data } - msg := &Request{} + msg := &Resource_RevocableInfo{} b.ResetTimer() for i := 0; i < b.N; i++ { total += len(datas[i%10000]) @@ -2437,31 +2877,44 @@ func BenchmarkRequestProtoUnmarshal(b *testing.B) { b.SetBytes(int64(total / b.N)) } -func TestOfferProto(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedOffer(popr, false) +func TestTrafficControlStatisticsProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedTrafficControlStatistics(popr, false) data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &Offer{} + msg := &TrafficControlStatistics{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestOfferMarshalTo(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedOffer(popr, false) +func TestTrafficControlStatisticsMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedTrafficControlStatistics(popr, false) size := p.Size() data := make([]byte, size) for i := range data { @@ -2469,29 +2922,29 @@ func TestOfferMarshalTo(t *testing.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &Offer{} + msg := &TrafficControlStatistics{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkOfferProtoMarshal(b *testing.B) { +func BenchmarkTrafficControlStatisticsProtoMarshal(b *testing.B) { popr := math_rand.New(math_rand.NewSource(616)) total := 0 - pops := make([]*Offer, 10000) + pops := make([]*TrafficControlStatistics, 10000) for i := 0; i < 10000; i++ { - pops[i] = NewPopulatedOffer(popr, false) + pops[i] = NewPopulatedTrafficControlStatistics(popr, false) } b.ResetTimer() for i := 0; i < b.N; i++ { @@ -2504,18 +2957,18 @@ func BenchmarkOfferProtoMarshal(b *testing.B) { b.SetBytes(int64(total / b.N)) } -func BenchmarkOfferProtoUnmarshal(b *testing.B) { +func BenchmarkTrafficControlStatisticsProtoUnmarshal(b *testing.B) { popr := math_rand.New(math_rand.NewSource(616)) total := 0 datas := make([][]byte, 10000) for i := 0; i < 10000; i++ { - data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedOffer(popr, false)) + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedTrafficControlStatistics(popr, false)) if err != nil { panic(err) } datas[i] = data } - msg := &Offer{} + msg := &TrafficControlStatistics{} b.ResetTimer() for i := 0; i < b.N; i++ { total += len(datas[i%10000]) @@ -2526,31 +2979,44 @@ func BenchmarkOfferProtoUnmarshal(b *testing.B) { b.SetBytes(int64(total / b.N)) } -func TestTaskInfoProto(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedTaskInfo(popr, false) +func TestResourceStatisticsProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedResourceStatistics(popr, false) data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &TaskInfo{} + msg := &ResourceStatistics{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestTaskInfoMarshalTo(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedTaskInfo(popr, false) +func TestResourceStatisticsMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedResourceStatistics(popr, false) size := p.Size() data := make([]byte, size) for i := range data { @@ -2558,29 +3024,29 @@ func TestTaskInfoMarshalTo(t *testing.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &TaskInfo{} + msg := &ResourceStatistics{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkTaskInfoProtoMarshal(b *testing.B) { +func BenchmarkResourceStatisticsProtoMarshal(b *testing.B) { popr := math_rand.New(math_rand.NewSource(616)) total := 0 - pops := make([]*TaskInfo, 10000) + pops := make([]*ResourceStatistics, 10000) for i := 0; i < 10000; i++ { - pops[i] = NewPopulatedTaskInfo(popr, false) + pops[i] = NewPopulatedResourceStatistics(popr, false) } b.ResetTimer() for i := 0; i < b.N; i++ { @@ -2593,18 +3059,18 @@ func BenchmarkTaskInfoProtoMarshal(b *testing.B) { b.SetBytes(int64(total / b.N)) } -func BenchmarkTaskInfoProtoUnmarshal(b *testing.B) { +func BenchmarkResourceStatisticsProtoUnmarshal(b *testing.B) { popr := math_rand.New(math_rand.NewSource(616)) total := 0 datas := make([][]byte, 10000) for i := 0; i < 10000; i++ { - data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedTaskInfo(popr, false)) + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedResourceStatistics(popr, false)) if err != nil { panic(err) } datas[i] = data } - msg := &TaskInfo{} + msg := &ResourceStatistics{} b.ResetTimer() for i := 0; i < b.N; i++ { total += len(datas[i%10000]) @@ -2615,31 +3081,44 @@ func BenchmarkTaskInfoProtoUnmarshal(b *testing.B) { b.SetBytes(int64(total / b.N)) } -func TestTaskStatusProto(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedTaskStatus(popr, false) +func TestResourceUsageProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedResourceUsage(popr, false) data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &TaskStatus{} + msg := &ResourceUsage{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestTaskStatusMarshalTo(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedTaskStatus(popr, false) +func TestResourceUsageMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedResourceUsage(popr, false) size := p.Size() data := make([]byte, size) for i := range data { @@ -2647,29 +3126,29 @@ func TestTaskStatusMarshalTo(t *testing.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &TaskStatus{} + msg := &ResourceUsage{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkTaskStatusProtoMarshal(b *testing.B) { +func BenchmarkResourceUsageProtoMarshal(b *testing.B) { popr := math_rand.New(math_rand.NewSource(616)) total := 0 - pops := make([]*TaskStatus, 10000) + pops := make([]*ResourceUsage, 10000) for i := 0; i < 10000; i++ { - pops[i] = NewPopulatedTaskStatus(popr, false) + pops[i] = NewPopulatedResourceUsage(popr, false) } b.ResetTimer() for i := 0; i < b.N; i++ { @@ -2682,18 +3161,18 @@ func BenchmarkTaskStatusProtoMarshal(b *testing.B) { b.SetBytes(int64(total / b.N)) } -func BenchmarkTaskStatusProtoUnmarshal(b *testing.B) { +func BenchmarkResourceUsageProtoUnmarshal(b *testing.B) { popr := math_rand.New(math_rand.NewSource(616)) total := 0 datas := make([][]byte, 10000) for i := 0; i < 10000; i++ { - data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedTaskStatus(popr, false)) + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedResourceUsage(popr, false)) if err != nil { panic(err) } datas[i] = data } - msg := &TaskStatus{} + msg := &ResourceUsage{} b.ResetTimer() for i := 0; i < b.N; i++ { total += len(datas[i%10000]) @@ -2704,31 +3183,44 @@ func BenchmarkTaskStatusProtoUnmarshal(b *testing.B) { b.SetBytes(int64(total / b.N)) } -func TestFiltersProto(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedFilters(popr, false) +func TestResourceUsage_ExecutorProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedResourceUsage_Executor(popr, false) data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &Filters{} + msg := &ResourceUsage_Executor{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestFiltersMarshalTo(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedFilters(popr, false) +func TestResourceUsage_ExecutorMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedResourceUsage_Executor(popr, false) size := p.Size() data := make([]byte, size) for i := range data { @@ -2736,29 +3228,29 @@ func TestFiltersMarshalTo(t *testing.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &Filters{} + msg := &ResourceUsage_Executor{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkFiltersProtoMarshal(b *testing.B) { +func BenchmarkResourceUsage_ExecutorProtoMarshal(b *testing.B) { popr := math_rand.New(math_rand.NewSource(616)) total := 0 - pops := make([]*Filters, 10000) + pops := make([]*ResourceUsage_Executor, 10000) for i := 0; i < 10000; i++ { - pops[i] = NewPopulatedFilters(popr, false) + pops[i] = NewPopulatedResourceUsage_Executor(popr, false) } b.ResetTimer() for i := 0; i < b.N; i++ { @@ -2771,18 +3263,18 @@ func BenchmarkFiltersProtoMarshal(b *testing.B) { b.SetBytes(int64(total / b.N)) } -func BenchmarkFiltersProtoUnmarshal(b *testing.B) { +func BenchmarkResourceUsage_ExecutorProtoUnmarshal(b *testing.B) { popr := math_rand.New(math_rand.NewSource(616)) total := 0 datas := make([][]byte, 10000) for i := 0; i < 10000; i++ { - data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedFilters(popr, false)) + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedResourceUsage_Executor(popr, false)) if err != nil { panic(err) } datas[i] = data } - msg := &Filters{} + msg := &ResourceUsage_Executor{} b.ResetTimer() for i := 0; i < b.N; i++ { total += len(datas[i%10000]) @@ -2793,31 +3285,44 @@ func BenchmarkFiltersProtoUnmarshal(b *testing.B) { b.SetBytes(int64(total / b.N)) } -func TestEnvironmentProto(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedEnvironment(popr, false) +func TestPerfStatisticsProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedPerfStatistics(popr, false) data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &Environment{} + msg := &PerfStatistics{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestEnvironmentMarshalTo(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedEnvironment(popr, false) +func TestPerfStatisticsMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedPerfStatistics(popr, false) size := p.Size() data := make([]byte, size) for i := range data { @@ -2825,29 +3330,29 @@ func TestEnvironmentMarshalTo(t *testing.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &Environment{} + msg := &PerfStatistics{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkEnvironmentProtoMarshal(b *testing.B) { +func BenchmarkPerfStatisticsProtoMarshal(b *testing.B) { popr := math_rand.New(math_rand.NewSource(616)) total := 0 - pops := make([]*Environment, 10000) + pops := make([]*PerfStatistics, 10000) for i := 0; i < 10000; i++ { - pops[i] = NewPopulatedEnvironment(popr, false) + pops[i] = NewPopulatedPerfStatistics(popr, false) } b.ResetTimer() for i := 0; i < b.N; i++ { @@ -2860,18 +3365,18 @@ func BenchmarkEnvironmentProtoMarshal(b *testing.B) { b.SetBytes(int64(total / b.N)) } -func BenchmarkEnvironmentProtoUnmarshal(b *testing.B) { +func BenchmarkPerfStatisticsProtoUnmarshal(b *testing.B) { popr := math_rand.New(math_rand.NewSource(616)) total := 0 datas := make([][]byte, 10000) for i := 0; i < 10000; i++ { - data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedEnvironment(popr, false)) + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedPerfStatistics(popr, false)) if err != nil { panic(err) } datas[i] = data } - msg := &Environment{} + msg := &PerfStatistics{} b.ResetTimer() for i := 0; i < b.N; i++ { total += len(datas[i%10000]) @@ -2882,31 +3387,44 @@ func BenchmarkEnvironmentProtoUnmarshal(b *testing.B) { b.SetBytes(int64(total / b.N)) } -func TestEnvironment_VariableProto(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedEnvironment_Variable(popr, false) +func TestRequestProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedRequest(popr, false) data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &Environment_Variable{} + msg := &Request{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestEnvironment_VariableMarshalTo(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedEnvironment_Variable(popr, false) +func TestRequestMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedRequest(popr, false) size := p.Size() data := make([]byte, size) for i := range data { @@ -2914,29 +3432,29 @@ func TestEnvironment_VariableMarshalTo(t *testing.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &Environment_Variable{} + msg := &Request{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkEnvironment_VariableProtoMarshal(b *testing.B) { +func BenchmarkRequestProtoMarshal(b *testing.B) { popr := math_rand.New(math_rand.NewSource(616)) total := 0 - pops := make([]*Environment_Variable, 10000) + pops := make([]*Request, 10000) for i := 0; i < 10000; i++ { - pops[i] = NewPopulatedEnvironment_Variable(popr, false) + pops[i] = NewPopulatedRequest(popr, false) } b.ResetTimer() for i := 0; i < b.N; i++ { @@ -2949,18 +3467,18 @@ func BenchmarkEnvironment_VariableProtoMarshal(b *testing.B) { b.SetBytes(int64(total / b.N)) } -func BenchmarkEnvironment_VariableProtoUnmarshal(b *testing.B) { +func BenchmarkRequestProtoUnmarshal(b *testing.B) { popr := math_rand.New(math_rand.NewSource(616)) total := 0 datas := make([][]byte, 10000) for i := 0; i < 10000; i++ { - data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedEnvironment_Variable(popr, false)) + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedRequest(popr, false)) if err != nil { panic(err) } datas[i] = data } - msg := &Environment_Variable{} + msg := &Request{} b.ResetTimer() for i := 0; i < b.N; i++ { total += len(datas[i%10000]) @@ -2971,31 +3489,44 @@ func BenchmarkEnvironment_VariableProtoUnmarshal(b *testing.B) { b.SetBytes(int64(total / b.N)) } -func TestParameterProto(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedParameter(popr, false) +func TestOfferProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedOffer(popr, false) data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &Parameter{} + msg := &Offer{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestParameterMarshalTo(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedParameter(popr, false) +func TestOfferMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedOffer(popr, false) size := p.Size() data := make([]byte, size) for i := range data { @@ -3003,29 +3534,29 @@ func TestParameterMarshalTo(t *testing.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &Parameter{} + msg := &Offer{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkParameterProtoMarshal(b *testing.B) { +func BenchmarkOfferProtoMarshal(b *testing.B) { popr := math_rand.New(math_rand.NewSource(616)) total := 0 - pops := make([]*Parameter, 10000) + pops := make([]*Offer, 10000) for i := 0; i < 10000; i++ { - pops[i] = NewPopulatedParameter(popr, false) + pops[i] = NewPopulatedOffer(popr, false) } b.ResetTimer() for i := 0; i < b.N; i++ { @@ -3038,18 +3569,18 @@ func BenchmarkParameterProtoMarshal(b *testing.B) { b.SetBytes(int64(total / b.N)) } -func BenchmarkParameterProtoUnmarshal(b *testing.B) { +func BenchmarkOfferProtoUnmarshal(b *testing.B) { popr := math_rand.New(math_rand.NewSource(616)) total := 0 datas := make([][]byte, 10000) for i := 0; i < 10000; i++ { - data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedParameter(popr, false)) + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedOffer(popr, false)) if err != nil { panic(err) } datas[i] = data } - msg := &Parameter{} + msg := &Offer{} b.ResetTimer() for i := 0; i < b.N; i++ { total += len(datas[i%10000]) @@ -3060,31 +3591,44 @@ func BenchmarkParameterProtoUnmarshal(b *testing.B) { b.SetBytes(int64(total / b.N)) } -func TestParametersProto(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedParameters(popr, false) +func TestOffer_OperationProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedOffer_Operation(popr, false) data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &Parameters{} + msg := &Offer_Operation{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestParametersMarshalTo(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedParameters(popr, false) +func TestOffer_OperationMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedOffer_Operation(popr, false) size := p.Size() data := make([]byte, size) for i := range data { @@ -3092,29 +3636,29 @@ func TestParametersMarshalTo(t *testing.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &Parameters{} + msg := &Offer_Operation{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkParametersProtoMarshal(b *testing.B) { +func BenchmarkOffer_OperationProtoMarshal(b *testing.B) { popr := math_rand.New(math_rand.NewSource(616)) total := 0 - pops := make([]*Parameters, 10000) + pops := make([]*Offer_Operation, 10000) for i := 0; i < 10000; i++ { - pops[i] = NewPopulatedParameters(popr, false) + pops[i] = NewPopulatedOffer_Operation(popr, false) } b.ResetTimer() for i := 0; i < b.N; i++ { @@ -3127,18 +3671,18 @@ func BenchmarkParametersProtoMarshal(b *testing.B) { b.SetBytes(int64(total / b.N)) } -func BenchmarkParametersProtoUnmarshal(b *testing.B) { +func BenchmarkOffer_OperationProtoUnmarshal(b *testing.B) { popr := math_rand.New(math_rand.NewSource(616)) total := 0 datas := make([][]byte, 10000) for i := 0; i < 10000; i++ { - data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedParameters(popr, false)) + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedOffer_Operation(popr, false)) if err != nil { panic(err) } datas[i] = data } - msg := &Parameters{} + msg := &Offer_Operation{} b.ResetTimer() for i := 0; i < b.N; i++ { total += len(datas[i%10000]) @@ -3149,31 +3693,44 @@ func BenchmarkParametersProtoUnmarshal(b *testing.B) { b.SetBytes(int64(total / b.N)) } -func TestCredentialProto(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedCredential(popr, false) +func TestOffer_Operation_LaunchProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedOffer_Operation_Launch(popr, false) data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &Credential{} + msg := &Offer_Operation_Launch{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestCredentialMarshalTo(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedCredential(popr, false) +func TestOffer_Operation_LaunchMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedOffer_Operation_Launch(popr, false) size := p.Size() data := make([]byte, size) for i := range data { @@ -3181,29 +3738,29 @@ func TestCredentialMarshalTo(t *testing.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &Credential{} + msg := &Offer_Operation_Launch{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkCredentialProtoMarshal(b *testing.B) { +func BenchmarkOffer_Operation_LaunchProtoMarshal(b *testing.B) { popr := math_rand.New(math_rand.NewSource(616)) total := 0 - pops := make([]*Credential, 10000) + pops := make([]*Offer_Operation_Launch, 10000) for i := 0; i < 10000; i++ { - pops[i] = NewPopulatedCredential(popr, false) + pops[i] = NewPopulatedOffer_Operation_Launch(popr, false) } b.ResetTimer() for i := 0; i < b.N; i++ { @@ -3216,18 +3773,18 @@ func BenchmarkCredentialProtoMarshal(b *testing.B) { b.SetBytes(int64(total / b.N)) } -func BenchmarkCredentialProtoUnmarshal(b *testing.B) { +func BenchmarkOffer_Operation_LaunchProtoUnmarshal(b *testing.B) { popr := math_rand.New(math_rand.NewSource(616)) total := 0 datas := make([][]byte, 10000) for i := 0; i < 10000; i++ { - data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedCredential(popr, false)) + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedOffer_Operation_Launch(popr, false)) if err != nil { panic(err) } datas[i] = data } - msg := &Credential{} + msg := &Offer_Operation_Launch{} b.ResetTimer() for i := 0; i < b.N; i++ { total += len(datas[i%10000]) @@ -3238,31 +3795,44 @@ func BenchmarkCredentialProtoUnmarshal(b *testing.B) { b.SetBytes(int64(total / b.N)) } -func TestCredentialsProto(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedCredentials(popr, false) +func TestOffer_Operation_ReserveProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedOffer_Operation_Reserve(popr, false) data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &Credentials{} + msg := &Offer_Operation_Reserve{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestCredentialsMarshalTo(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedCredentials(popr, false) +func TestOffer_Operation_ReserveMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedOffer_Operation_Reserve(popr, false) size := p.Size() data := make([]byte, size) for i := range data { @@ -3270,29 +3840,29 @@ func TestCredentialsMarshalTo(t *testing.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &Credentials{} + msg := &Offer_Operation_Reserve{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkCredentialsProtoMarshal(b *testing.B) { +func BenchmarkOffer_Operation_ReserveProtoMarshal(b *testing.B) { popr := math_rand.New(math_rand.NewSource(616)) total := 0 - pops := make([]*Credentials, 10000) + pops := make([]*Offer_Operation_Reserve, 10000) for i := 0; i < 10000; i++ { - pops[i] = NewPopulatedCredentials(popr, false) + pops[i] = NewPopulatedOffer_Operation_Reserve(popr, false) } b.ResetTimer() for i := 0; i < b.N; i++ { @@ -3305,18 +3875,18 @@ func BenchmarkCredentialsProtoMarshal(b *testing.B) { b.SetBytes(int64(total / b.N)) } -func BenchmarkCredentialsProtoUnmarshal(b *testing.B) { +func BenchmarkOffer_Operation_ReserveProtoUnmarshal(b *testing.B) { popr := math_rand.New(math_rand.NewSource(616)) total := 0 datas := make([][]byte, 10000) for i := 0; i < 10000; i++ { - data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedCredentials(popr, false)) + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedOffer_Operation_Reserve(popr, false)) if err != nil { panic(err) } datas[i] = data } - msg := &Credentials{} + msg := &Offer_Operation_Reserve{} b.ResetTimer() for i := 0; i < b.N; i++ { total += len(datas[i%10000]) @@ -3327,31 +3897,44 @@ func BenchmarkCredentialsProtoUnmarshal(b *testing.B) { b.SetBytes(int64(total / b.N)) } -func TestACLProto(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedACL(popr, false) +func TestOffer_Operation_UnreserveProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedOffer_Operation_Unreserve(popr, false) data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &ACL{} + msg := &Offer_Operation_Unreserve{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestACLMarshalTo(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedACL(popr, false) +func TestOffer_Operation_UnreserveMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedOffer_Operation_Unreserve(popr, false) size := p.Size() data := make([]byte, size) for i := range data { @@ -3359,29 +3942,29 @@ func TestACLMarshalTo(t *testing.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &ACL{} + msg := &Offer_Operation_Unreserve{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkACLProtoMarshal(b *testing.B) { +func BenchmarkOffer_Operation_UnreserveProtoMarshal(b *testing.B) { popr := math_rand.New(math_rand.NewSource(616)) total := 0 - pops := make([]*ACL, 10000) + pops := make([]*Offer_Operation_Unreserve, 10000) for i := 0; i < 10000; i++ { - pops[i] = NewPopulatedACL(popr, false) + pops[i] = NewPopulatedOffer_Operation_Unreserve(popr, false) } b.ResetTimer() for i := 0; i < b.N; i++ { @@ -3394,18 +3977,18 @@ func BenchmarkACLProtoMarshal(b *testing.B) { b.SetBytes(int64(total / b.N)) } -func BenchmarkACLProtoUnmarshal(b *testing.B) { +func BenchmarkOffer_Operation_UnreserveProtoUnmarshal(b *testing.B) { popr := math_rand.New(math_rand.NewSource(616)) total := 0 datas := make([][]byte, 10000) for i := 0; i < 10000; i++ { - data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedACL(popr, false)) + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedOffer_Operation_Unreserve(popr, false)) if err != nil { panic(err) } datas[i] = data } - msg := &ACL{} + msg := &Offer_Operation_Unreserve{} b.ResetTimer() for i := 0; i < b.N; i++ { total += len(datas[i%10000]) @@ -3416,31 +3999,44 @@ func BenchmarkACLProtoUnmarshal(b *testing.B) { b.SetBytes(int64(total / b.N)) } -func TestACL_EntityProto(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedACL_Entity(popr, false) +func TestOffer_Operation_CreateProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedOffer_Operation_Create(popr, false) data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &ACL_Entity{} + msg := &Offer_Operation_Create{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestACL_EntityMarshalTo(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedACL_Entity(popr, false) +func TestOffer_Operation_CreateMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedOffer_Operation_Create(popr, false) size := p.Size() data := make([]byte, size) for i := range data { @@ -3448,29 +4044,29 @@ func TestACL_EntityMarshalTo(t *testing.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &ACL_Entity{} + msg := &Offer_Operation_Create{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkACL_EntityProtoMarshal(b *testing.B) { +func BenchmarkOffer_Operation_CreateProtoMarshal(b *testing.B) { popr := math_rand.New(math_rand.NewSource(616)) total := 0 - pops := make([]*ACL_Entity, 10000) + pops := make([]*Offer_Operation_Create, 10000) for i := 0; i < 10000; i++ { - pops[i] = NewPopulatedACL_Entity(popr, false) + pops[i] = NewPopulatedOffer_Operation_Create(popr, false) } b.ResetTimer() for i := 0; i < b.N; i++ { @@ -3483,18 +4079,18 @@ func BenchmarkACL_EntityProtoMarshal(b *testing.B) { b.SetBytes(int64(total / b.N)) } -func BenchmarkACL_EntityProtoUnmarshal(b *testing.B) { +func BenchmarkOffer_Operation_CreateProtoUnmarshal(b *testing.B) { popr := math_rand.New(math_rand.NewSource(616)) total := 0 datas := make([][]byte, 10000) for i := 0; i < 10000; i++ { - data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedACL_Entity(popr, false)) + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedOffer_Operation_Create(popr, false)) if err != nil { panic(err) } datas[i] = data } - msg := &ACL_Entity{} + msg := &Offer_Operation_Create{} b.ResetTimer() for i := 0; i < b.N; i++ { total += len(datas[i%10000]) @@ -3505,31 +4101,44 @@ func BenchmarkACL_EntityProtoUnmarshal(b *testing.B) { b.SetBytes(int64(total / b.N)) } -func TestACL_RegisterFrameworkProto(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedACL_RegisterFramework(popr, false) +func TestOffer_Operation_DestroyProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedOffer_Operation_Destroy(popr, false) data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &ACL_RegisterFramework{} + msg := &Offer_Operation_Destroy{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestACL_RegisterFrameworkMarshalTo(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedACL_RegisterFramework(popr, false) +func TestOffer_Operation_DestroyMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedOffer_Operation_Destroy(popr, false) size := p.Size() data := make([]byte, size) for i := range data { @@ -3537,29 +4146,29 @@ func TestACL_RegisterFrameworkMarshalTo(t *testing.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &ACL_RegisterFramework{} + msg := &Offer_Operation_Destroy{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkACL_RegisterFrameworkProtoMarshal(b *testing.B) { +func BenchmarkOffer_Operation_DestroyProtoMarshal(b *testing.B) { popr := math_rand.New(math_rand.NewSource(616)) total := 0 - pops := make([]*ACL_RegisterFramework, 10000) + pops := make([]*Offer_Operation_Destroy, 10000) for i := 0; i < 10000; i++ { - pops[i] = NewPopulatedACL_RegisterFramework(popr, false) + pops[i] = NewPopulatedOffer_Operation_Destroy(popr, false) } b.ResetTimer() for i := 0; i < b.N; i++ { @@ -3572,18 +4181,18 @@ func BenchmarkACL_RegisterFrameworkProtoMarshal(b *testing.B) { b.SetBytes(int64(total / b.N)) } -func BenchmarkACL_RegisterFrameworkProtoUnmarshal(b *testing.B) { +func BenchmarkOffer_Operation_DestroyProtoUnmarshal(b *testing.B) { popr := math_rand.New(math_rand.NewSource(616)) total := 0 datas := make([][]byte, 10000) for i := 0; i < 10000; i++ { - data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedACL_RegisterFramework(popr, false)) + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedOffer_Operation_Destroy(popr, false)) if err != nil { panic(err) } datas[i] = data } - msg := &ACL_RegisterFramework{} + msg := &Offer_Operation_Destroy{} b.ResetTimer() for i := 0; i < b.N; i++ { total += len(datas[i%10000]) @@ -3594,31 +4203,44 @@ func BenchmarkACL_RegisterFrameworkProtoUnmarshal(b *testing.B) { b.SetBytes(int64(total / b.N)) } -func TestACL_RunTaskProto(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedACL_RunTask(popr, false) +func TestTaskInfoProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedTaskInfo(popr, false) data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &ACL_RunTask{} + msg := &TaskInfo{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestACL_RunTaskMarshalTo(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedACL_RunTask(popr, false) +func TestTaskInfoMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedTaskInfo(popr, false) size := p.Size() data := make([]byte, size) for i := range data { @@ -3626,29 +4248,29 @@ func TestACL_RunTaskMarshalTo(t *testing.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &ACL_RunTask{} + msg := &TaskInfo{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkACL_RunTaskProtoMarshal(b *testing.B) { +func BenchmarkTaskInfoProtoMarshal(b *testing.B) { popr := math_rand.New(math_rand.NewSource(616)) total := 0 - pops := make([]*ACL_RunTask, 10000) + pops := make([]*TaskInfo, 10000) for i := 0; i < 10000; i++ { - pops[i] = NewPopulatedACL_RunTask(popr, false) + pops[i] = NewPopulatedTaskInfo(popr, false) } b.ResetTimer() for i := 0; i < b.N; i++ { @@ -3661,18 +4283,18 @@ func BenchmarkACL_RunTaskProtoMarshal(b *testing.B) { b.SetBytes(int64(total / b.N)) } -func BenchmarkACL_RunTaskProtoUnmarshal(b *testing.B) { +func BenchmarkTaskInfoProtoUnmarshal(b *testing.B) { popr := math_rand.New(math_rand.NewSource(616)) total := 0 datas := make([][]byte, 10000) for i := 0; i < 10000; i++ { - data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedACL_RunTask(popr, false)) + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedTaskInfo(popr, false)) if err != nil { panic(err) } datas[i] = data } - msg := &ACL_RunTask{} + msg := &TaskInfo{} b.ResetTimer() for i := 0; i < b.N; i++ { total += len(datas[i%10000]) @@ -3683,31 +4305,44 @@ func BenchmarkACL_RunTaskProtoUnmarshal(b *testing.B) { b.SetBytes(int64(total / b.N)) } -func TestACL_ShutdownFrameworkProto(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedACL_ShutdownFramework(popr, false) +func TestTaskStatusProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedTaskStatus(popr, false) data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &ACL_ShutdownFramework{} + msg := &TaskStatus{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestACL_ShutdownFrameworkMarshalTo(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedACL_ShutdownFramework(popr, false) +func TestTaskStatusMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedTaskStatus(popr, false) size := p.Size() data := make([]byte, size) for i := range data { @@ -3715,29 +4350,29 @@ func TestACL_ShutdownFrameworkMarshalTo(t *testing.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &ACL_ShutdownFramework{} + msg := &TaskStatus{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkACL_ShutdownFrameworkProtoMarshal(b *testing.B) { +func BenchmarkTaskStatusProtoMarshal(b *testing.B) { popr := math_rand.New(math_rand.NewSource(616)) total := 0 - pops := make([]*ACL_ShutdownFramework, 10000) + pops := make([]*TaskStatus, 10000) for i := 0; i < 10000; i++ { - pops[i] = NewPopulatedACL_ShutdownFramework(popr, false) + pops[i] = NewPopulatedTaskStatus(popr, false) } b.ResetTimer() for i := 0; i < b.N; i++ { @@ -3750,18 +4385,18 @@ func BenchmarkACL_ShutdownFrameworkProtoMarshal(b *testing.B) { b.SetBytes(int64(total / b.N)) } -func BenchmarkACL_ShutdownFrameworkProtoUnmarshal(b *testing.B) { +func BenchmarkTaskStatusProtoUnmarshal(b *testing.B) { popr := math_rand.New(math_rand.NewSource(616)) total := 0 datas := make([][]byte, 10000) for i := 0; i < 10000; i++ { - data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedACL_ShutdownFramework(popr, false)) + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedTaskStatus(popr, false)) if err != nil { panic(err) } datas[i] = data } - msg := &ACL_ShutdownFramework{} + msg := &TaskStatus{} b.ResetTimer() for i := 0; i < b.N; i++ { total += len(datas[i%10000]) @@ -3772,31 +4407,44 @@ func BenchmarkACL_ShutdownFrameworkProtoUnmarshal(b *testing.B) { b.SetBytes(int64(total / b.N)) } -func TestACLsProto(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedACLs(popr, false) +func TestFiltersProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedFilters(popr, false) data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &ACLs{} + msg := &Filters{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestACLsMarshalTo(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedACLs(popr, false) +func TestFiltersMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedFilters(popr, false) size := p.Size() data := make([]byte, size) for i := range data { @@ -3804,29 +4452,29 @@ func TestACLsMarshalTo(t *testing.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &ACLs{} + msg := &Filters{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkACLsProtoMarshal(b *testing.B) { +func BenchmarkFiltersProtoMarshal(b *testing.B) { popr := math_rand.New(math_rand.NewSource(616)) total := 0 - pops := make([]*ACLs, 10000) + pops := make([]*Filters, 10000) for i := 0; i < 10000; i++ { - pops[i] = NewPopulatedACLs(popr, false) + pops[i] = NewPopulatedFilters(popr, false) } b.ResetTimer() for i := 0; i < b.N; i++ { @@ -3839,18 +4487,18 @@ func BenchmarkACLsProtoMarshal(b *testing.B) { b.SetBytes(int64(total / b.N)) } -func BenchmarkACLsProtoUnmarshal(b *testing.B) { +func BenchmarkFiltersProtoUnmarshal(b *testing.B) { popr := math_rand.New(math_rand.NewSource(616)) total := 0 datas := make([][]byte, 10000) for i := 0; i < 10000; i++ { - data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedACLs(popr, false)) + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedFilters(popr, false)) if err != nil { panic(err) } datas[i] = data } - msg := &ACLs{} + msg := &Filters{} b.ResetTimer() for i := 0; i < b.N; i++ { total += len(datas[i%10000]) @@ -3861,31 +4509,44 @@ func BenchmarkACLsProtoUnmarshal(b *testing.B) { b.SetBytes(int64(total / b.N)) } -func TestRateLimitProto(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedRateLimit(popr, false) +func TestEnvironmentProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedEnvironment(popr, false) data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &RateLimit{} + msg := &Environment{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestRateLimitMarshalTo(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedRateLimit(popr, false) +func TestEnvironmentMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedEnvironment(popr, false) size := p.Size() data := make([]byte, size) for i := range data { @@ -3893,29 +4554,29 @@ func TestRateLimitMarshalTo(t *testing.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &RateLimit{} + msg := &Environment{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkRateLimitProtoMarshal(b *testing.B) { +func BenchmarkEnvironmentProtoMarshal(b *testing.B) { popr := math_rand.New(math_rand.NewSource(616)) total := 0 - pops := make([]*RateLimit, 10000) + pops := make([]*Environment, 10000) for i := 0; i < 10000; i++ { - pops[i] = NewPopulatedRateLimit(popr, false) + pops[i] = NewPopulatedEnvironment(popr, false) } b.ResetTimer() for i := 0; i < b.N; i++ { @@ -3928,18 +4589,18 @@ func BenchmarkRateLimitProtoMarshal(b *testing.B) { b.SetBytes(int64(total / b.N)) } -func BenchmarkRateLimitProtoUnmarshal(b *testing.B) { +func BenchmarkEnvironmentProtoUnmarshal(b *testing.B) { popr := math_rand.New(math_rand.NewSource(616)) total := 0 datas := make([][]byte, 10000) for i := 0; i < 10000; i++ { - data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedRateLimit(popr, false)) + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedEnvironment(popr, false)) if err != nil { panic(err) } datas[i] = data } - msg := &RateLimit{} + msg := &Environment{} b.ResetTimer() for i := 0; i < b.N; i++ { total += len(datas[i%10000]) @@ -3950,31 +4611,44 @@ func BenchmarkRateLimitProtoUnmarshal(b *testing.B) { b.SetBytes(int64(total / b.N)) } -func TestRateLimitsProto(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedRateLimits(popr, false) +func TestEnvironment_VariableProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedEnvironment_Variable(popr, false) data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &RateLimits{} + msg := &Environment_Variable{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestRateLimitsMarshalTo(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedRateLimits(popr, false) +func TestEnvironment_VariableMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedEnvironment_Variable(popr, false) size := p.Size() data := make([]byte, size) for i := range data { @@ -3982,29 +4656,29 @@ func TestRateLimitsMarshalTo(t *testing.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &RateLimits{} + msg := &Environment_Variable{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkRateLimitsProtoMarshal(b *testing.B) { +func BenchmarkEnvironment_VariableProtoMarshal(b *testing.B) { popr := math_rand.New(math_rand.NewSource(616)) total := 0 - pops := make([]*RateLimits, 10000) + pops := make([]*Environment_Variable, 10000) for i := 0; i < 10000; i++ { - pops[i] = NewPopulatedRateLimits(popr, false) + pops[i] = NewPopulatedEnvironment_Variable(popr, false) } b.ResetTimer() for i := 0; i < b.N; i++ { @@ -4017,18 +4691,18 @@ func BenchmarkRateLimitsProtoMarshal(b *testing.B) { b.SetBytes(int64(total / b.N)) } -func BenchmarkRateLimitsProtoUnmarshal(b *testing.B) { +func BenchmarkEnvironment_VariableProtoUnmarshal(b *testing.B) { popr := math_rand.New(math_rand.NewSource(616)) total := 0 datas := make([][]byte, 10000) for i := 0; i < 10000; i++ { - data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedRateLimits(popr, false)) + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedEnvironment_Variable(popr, false)) if err != nil { panic(err) } datas[i] = data } - msg := &RateLimits{} + msg := &Environment_Variable{} b.ResetTimer() for i := 0; i < b.N; i++ { total += len(datas[i%10000]) @@ -4039,31 +4713,44 @@ func BenchmarkRateLimitsProtoUnmarshal(b *testing.B) { b.SetBytes(int64(total / b.N)) } -func TestVolumeProto(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedVolume(popr, false) +func TestParameterProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedParameter(popr, false) data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &Volume{} + msg := &Parameter{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestVolumeMarshalTo(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedVolume(popr, false) +func TestParameterMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedParameter(popr, false) size := p.Size() data := make([]byte, size) for i := range data { @@ -4071,29 +4758,29 @@ func TestVolumeMarshalTo(t *testing.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &Volume{} + msg := &Parameter{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkVolumeProtoMarshal(b *testing.B) { +func BenchmarkParameterProtoMarshal(b *testing.B) { popr := math_rand.New(math_rand.NewSource(616)) total := 0 - pops := make([]*Volume, 10000) + pops := make([]*Parameter, 10000) for i := 0; i < 10000; i++ { - pops[i] = NewPopulatedVolume(popr, false) + pops[i] = NewPopulatedParameter(popr, false) } b.ResetTimer() for i := 0; i < b.N; i++ { @@ -4106,18 +4793,18 @@ func BenchmarkVolumeProtoMarshal(b *testing.B) { b.SetBytes(int64(total / b.N)) } -func BenchmarkVolumeProtoUnmarshal(b *testing.B) { +func BenchmarkParameterProtoUnmarshal(b *testing.B) { popr := math_rand.New(math_rand.NewSource(616)) total := 0 datas := make([][]byte, 10000) for i := 0; i < 10000; i++ { - data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedVolume(popr, false)) + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedParameter(popr, false)) if err != nil { panic(err) } datas[i] = data } - msg := &Volume{} + msg := &Parameter{} b.ResetTimer() for i := 0; i < b.N; i++ { total += len(datas[i%10000]) @@ -4128,31 +4815,44 @@ func BenchmarkVolumeProtoUnmarshal(b *testing.B) { b.SetBytes(int64(total / b.N)) } -func TestContainerInfoProto(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedContainerInfo(popr, false) +func TestParametersProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedParameters(popr, false) data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &ContainerInfo{} + msg := &Parameters{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestContainerInfoMarshalTo(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedContainerInfo(popr, false) +func TestParametersMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedParameters(popr, false) size := p.Size() data := make([]byte, size) for i := range data { @@ -4160,29 +4860,29 @@ func TestContainerInfoMarshalTo(t *testing.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &ContainerInfo{} + msg := &Parameters{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkContainerInfoProtoMarshal(b *testing.B) { +func BenchmarkParametersProtoMarshal(b *testing.B) { popr := math_rand.New(math_rand.NewSource(616)) total := 0 - pops := make([]*ContainerInfo, 10000) + pops := make([]*Parameters, 10000) for i := 0; i < 10000; i++ { - pops[i] = NewPopulatedContainerInfo(popr, false) + pops[i] = NewPopulatedParameters(popr, false) } b.ResetTimer() for i := 0; i < b.N; i++ { @@ -4195,18 +4895,18 @@ func BenchmarkContainerInfoProtoMarshal(b *testing.B) { b.SetBytes(int64(total / b.N)) } -func BenchmarkContainerInfoProtoUnmarshal(b *testing.B) { +func BenchmarkParametersProtoUnmarshal(b *testing.B) { popr := math_rand.New(math_rand.NewSource(616)) total := 0 datas := make([][]byte, 10000) for i := 0; i < 10000; i++ { - data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedContainerInfo(popr, false)) + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedParameters(popr, false)) if err != nil { panic(err) } datas[i] = data } - msg := &ContainerInfo{} + msg := &Parameters{} b.ResetTimer() for i := 0; i < b.N; i++ { total += len(datas[i%10000]) @@ -4217,31 +4917,44 @@ func BenchmarkContainerInfoProtoUnmarshal(b *testing.B) { b.SetBytes(int64(total / b.N)) } -func TestContainerInfo_DockerInfoProto(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedContainerInfo_DockerInfo(popr, false) +func TestCredentialProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedCredential(popr, false) data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &ContainerInfo_DockerInfo{} + msg := &Credential{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestContainerInfo_DockerInfoMarshalTo(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedContainerInfo_DockerInfo(popr, false) +func TestCredentialMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedCredential(popr, false) size := p.Size() data := make([]byte, size) for i := range data { @@ -4249,29 +4962,29 @@ func TestContainerInfo_DockerInfoMarshalTo(t *testing.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &ContainerInfo_DockerInfo{} + msg := &Credential{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkContainerInfo_DockerInfoProtoMarshal(b *testing.B) { +func BenchmarkCredentialProtoMarshal(b *testing.B) { popr := math_rand.New(math_rand.NewSource(616)) total := 0 - pops := make([]*ContainerInfo_DockerInfo, 10000) + pops := make([]*Credential, 10000) for i := 0; i < 10000; i++ { - pops[i] = NewPopulatedContainerInfo_DockerInfo(popr, false) + pops[i] = NewPopulatedCredential(popr, false) } b.ResetTimer() for i := 0; i < b.N; i++ { @@ -4284,18 +4997,18 @@ func BenchmarkContainerInfo_DockerInfoProtoMarshal(b *testing.B) { b.SetBytes(int64(total / b.N)) } -func BenchmarkContainerInfo_DockerInfoProtoUnmarshal(b *testing.B) { +func BenchmarkCredentialProtoUnmarshal(b *testing.B) { popr := math_rand.New(math_rand.NewSource(616)) total := 0 datas := make([][]byte, 10000) for i := 0; i < 10000; i++ { - data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedContainerInfo_DockerInfo(popr, false)) + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedCredential(popr, false)) if err != nil { panic(err) } datas[i] = data } - msg := &ContainerInfo_DockerInfo{} + msg := &Credential{} b.ResetTimer() for i := 0; i < b.N; i++ { total += len(datas[i%10000]) @@ -4306,31 +5019,44 @@ func BenchmarkContainerInfo_DockerInfoProtoUnmarshal(b *testing.B) { b.SetBytes(int64(total / b.N)) } -func TestContainerInfo_DockerInfo_PortMappingProto(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedContainerInfo_DockerInfo_PortMapping(popr, false) +func TestCredentialsProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedCredentials(popr, false) data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &ContainerInfo_DockerInfo_PortMapping{} + msg := &Credentials{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestContainerInfo_DockerInfo_PortMappingMarshalTo(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedContainerInfo_DockerInfo_PortMapping(popr, false) +func TestCredentialsMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedCredentials(popr, false) size := p.Size() data := make([]byte, size) for i := range data { @@ -4338,29 +5064,29 @@ func TestContainerInfo_DockerInfo_PortMappingMarshalTo(t *testing.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &ContainerInfo_DockerInfo_PortMapping{} + msg := &Credentials{} if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkContainerInfo_DockerInfo_PortMappingProtoMarshal(b *testing.B) { +func BenchmarkCredentialsProtoMarshal(b *testing.B) { popr := math_rand.New(math_rand.NewSource(616)) total := 0 - pops := make([]*ContainerInfo_DockerInfo_PortMapping, 10000) + pops := make([]*Credentials, 10000) for i := 0; i < 10000; i++ { - pops[i] = NewPopulatedContainerInfo_DockerInfo_PortMapping(popr, false) + pops[i] = NewPopulatedCredentials(popr, false) } b.ResetTimer() for i := 0; i < b.N; i++ { @@ -4373,18 +5099,18 @@ func BenchmarkContainerInfo_DockerInfo_PortMappingProtoMarshal(b *testing.B) { b.SetBytes(int64(total / b.N)) } -func BenchmarkContainerInfo_DockerInfo_PortMappingProtoUnmarshal(b *testing.B) { +func BenchmarkCredentialsProtoUnmarshal(b *testing.B) { popr := math_rand.New(math_rand.NewSource(616)) total := 0 datas := make([][]byte, 10000) for i := 0; i < 10000; i++ { - data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedContainerInfo_DockerInfo_PortMapping(popr, false)) + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedCredentials(popr, false)) if err != nil { panic(err) } datas[i] = data } - msg := &ContainerInfo_DockerInfo_PortMapping{} + msg := &Credentials{} b.ResetTimer() for i := 0; i < b.N; i++ { total += len(datas[i%10000]) @@ -4395,6031 +5121,10314 @@ func BenchmarkContainerInfo_DockerInfo_PortMappingProtoUnmarshal(b *testing.B) { b.SetBytes(int64(total / b.N)) } -func TestFrameworkIDJSON(t *testing1.T) { - popr := math_rand1.New(math_rand1.NewSource(time1.Now().UnixNano())) - p := NewPopulatedFrameworkID(popr, true) - jsondata, err := encoding_json.Marshal(p) - if err != nil { - panic(err) - } - msg := &FrameworkID{} - err = encoding_json.Unmarshal(jsondata, msg) +func TestACLProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedACL(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) - } - if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) - } -} -func TestOfferIDJSON(t *testing1.T) { - popr := math_rand1.New(math_rand1.NewSource(time1.Now().UnixNano())) - p := NewPopulatedOfferID(popr, true) - jsondata, err := encoding_json.Marshal(p) - if err != nil { - panic(err) + msg := &ACL{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &OfferID{} - err = encoding_json.Unmarshal(jsondata, msg) - if err != nil { - panic(err) + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) + for i := range data { + data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestSlaveIDJSON(t *testing1.T) { - popr := math_rand1.New(math_rand1.NewSource(time1.Now().UnixNano())) - p := NewPopulatedSlaveID(popr, true) - jsondata, err := encoding_json.Marshal(p) - if err != nil { - panic(err) + +func TestACLMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedACL(popr, false) + size := p.Size() + data := make([]byte, size) + for i := range data { + data[i] = byte(popr.Intn(256)) } - msg := &SlaveID{} - err = encoding_json.Unmarshal(jsondata, msg) + _, err := p.MarshalTo(data) if err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, err = %v", seed, err) } - if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) - } -} -func TestTaskIDJSON(t *testing1.T) { - popr := math_rand1.New(math_rand1.NewSource(time1.Now().UnixNano())) - p := NewPopulatedTaskID(popr, true) - jsondata, err := encoding_json.Marshal(p) - if err != nil { - panic(err) + msg := &ACL{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &TaskID{} - err = encoding_json.Unmarshal(jsondata, msg) - if err != nil { - panic(err) + for i := range data { + data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestExecutorIDJSON(t *testing1.T) { - popr := math_rand1.New(math_rand1.NewSource(time1.Now().UnixNano())) - p := NewPopulatedExecutorID(popr, true) - jsondata, err := encoding_json.Marshal(p) - if err != nil { - panic(err) - } - msg := &ExecutorID{} - err = encoding_json.Unmarshal(jsondata, msg) - if err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + +func BenchmarkACLProtoMarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*ACL, 10000) + for i := 0; i < 10000; i++ { + pops[i] = NewPopulatedACL(popr, false) } - if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + b.ResetTimer() + for i := 0; i < b.N; i++ { + data, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) + if err != nil { + panic(err) + } + total += len(data) } + b.SetBytes(int64(total / b.N)) } -func TestContainerIDJSON(t *testing1.T) { - popr := math_rand1.New(math_rand1.NewSource(time1.Now().UnixNano())) - p := NewPopulatedContainerID(popr, true) - jsondata, err := encoding_json.Marshal(p) - if err != nil { - panic(err) - } - msg := &ContainerID{} - err = encoding_json.Unmarshal(jsondata, msg) - if err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + +func BenchmarkACLProtoUnmarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + datas := make([][]byte, 10000) + for i := 0; i < 10000; i++ { + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedACL(popr, false)) + if err != nil { + panic(err) + } + datas[i] = data } - if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + msg := &ACL{} + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += len(datas[i%10000]) + if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { + panic(err) + } } + b.SetBytes(int64(total / b.N)) } -func TestFrameworkInfoJSON(t *testing1.T) { - popr := math_rand1.New(math_rand1.NewSource(time1.Now().UnixNano())) - p := NewPopulatedFrameworkInfo(popr, true) - jsondata, err := encoding_json.Marshal(p) - if err != nil { - panic(err) - } - msg := &FrameworkInfo{} - err = encoding_json.Unmarshal(jsondata, msg) + +func TestACL_EntityProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedACL_Entity(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) - } - if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + t.Fatalf("seed = %d, err = %v", seed, err) } -} -func TestHealthCheckJSON(t *testing1.T) { - popr := math_rand1.New(math_rand1.NewSource(time1.Now().UnixNano())) - p := NewPopulatedHealthCheck(popr, true) - jsondata, err := encoding_json.Marshal(p) - if err != nil { - panic(err) + msg := &ACL_Entity{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &HealthCheck{} - err = encoding_json.Unmarshal(jsondata, msg) - if err != nil { - panic(err) + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) + for i := range data { + data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestHealthCheck_HTTPJSON(t *testing1.T) { - popr := math_rand1.New(math_rand1.NewSource(time1.Now().UnixNano())) - p := NewPopulatedHealthCheck_HTTP(popr, true) - jsondata, err := encoding_json.Marshal(p) - if err != nil { - panic(err) + +func TestACL_EntityMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedACL_Entity(popr, false) + size := p.Size() + data := make([]byte, size) + for i := range data { + data[i] = byte(popr.Intn(256)) } - msg := &HealthCheck_HTTP{} - err = encoding_json.Unmarshal(jsondata, msg) + _, err := p.MarshalTo(data) if err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) - } - if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + t.Fatalf("seed = %d, err = %v", seed, err) } -} -func TestCommandInfoJSON(t *testing1.T) { - popr := math_rand1.New(math_rand1.NewSource(time1.Now().UnixNano())) - p := NewPopulatedCommandInfo(popr, true) - jsondata, err := encoding_json.Marshal(p) - if err != nil { - panic(err) + msg := &ACL_Entity{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &CommandInfo{} - err = encoding_json.Unmarshal(jsondata, msg) - if err != nil { - panic(err) + for i := range data { + data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestCommandInfo_URIJSON(t *testing1.T) { - popr := math_rand1.New(math_rand1.NewSource(time1.Now().UnixNano())) - p := NewPopulatedCommandInfo_URI(popr, true) - jsondata, err := encoding_json.Marshal(p) - if err != nil { - panic(err) + +func BenchmarkACL_EntityProtoMarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*ACL_Entity, 10000) + for i := 0; i < 10000; i++ { + pops[i] = NewPopulatedACL_Entity(popr, false) } - msg := &CommandInfo_URI{} - err = encoding_json.Unmarshal(jsondata, msg) - if err != nil { - panic(err) + b.ResetTimer() + for i := 0; i < b.N; i++ { + data, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) + if err != nil { + panic(err) + } + total += len(data) } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + b.SetBytes(int64(total / b.N)) +} + +func BenchmarkACL_EntityProtoUnmarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + datas := make([][]byte, 10000) + for i := 0; i < 10000; i++ { + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedACL_Entity(popr, false)) + if err != nil { + panic(err) + } + datas[i] = data } - if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + msg := &ACL_Entity{} + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += len(datas[i%10000]) + if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { + panic(err) + } } + b.SetBytes(int64(total / b.N)) } -func TestCommandInfo_ContainerInfoJSON(t *testing1.T) { - popr := math_rand1.New(math_rand1.NewSource(time1.Now().UnixNano())) - p := NewPopulatedCommandInfo_ContainerInfo(popr, true) - jsondata, err := encoding_json.Marshal(p) + +func TestACL_RegisterFrameworkProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedACL_RegisterFramework(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &CommandInfo_ContainerInfo{} - err = encoding_json.Unmarshal(jsondata, msg) - if err != nil { - panic(err) + msg := &ACL_RegisterFramework{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) + for i := range data { + data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestExecutorInfoJSON(t *testing1.T) { - popr := math_rand1.New(math_rand1.NewSource(time1.Now().UnixNano())) - p := NewPopulatedExecutorInfo(popr, true) - jsondata, err := encoding_json.Marshal(p) - if err != nil { - panic(err) + +func TestACL_RegisterFrameworkMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedACL_RegisterFramework(popr, false) + size := p.Size() + data := make([]byte, size) + for i := range data { + data[i] = byte(popr.Intn(256)) } - msg := &ExecutorInfo{} - err = encoding_json.Unmarshal(jsondata, msg) + _, err := p.MarshalTo(data) if err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, err = %v", seed, err) } - if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) - } -} -func TestMasterInfoJSON(t *testing1.T) { - popr := math_rand1.New(math_rand1.NewSource(time1.Now().UnixNano())) - p := NewPopulatedMasterInfo(popr, true) - jsondata, err := encoding_json.Marshal(p) - if err != nil { - panic(err) + msg := &ACL_RegisterFramework{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &MasterInfo{} - err = encoding_json.Unmarshal(jsondata, msg) - if err != nil { - panic(err) + for i := range data { + data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestSlaveInfoJSON(t *testing1.T) { - popr := math_rand1.New(math_rand1.NewSource(time1.Now().UnixNano())) - p := NewPopulatedSlaveInfo(popr, true) - jsondata, err := encoding_json.Marshal(p) - if err != nil { - panic(err) + +func BenchmarkACL_RegisterFrameworkProtoMarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*ACL_RegisterFramework, 10000) + for i := 0; i < 10000; i++ { + pops[i] = NewPopulatedACL_RegisterFramework(popr, false) } - msg := &SlaveInfo{} - err = encoding_json.Unmarshal(jsondata, msg) - if err != nil { - panic(err) + b.ResetTimer() + for i := 0; i < b.N; i++ { + data, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) + if err != nil { + panic(err) + } + total += len(data) } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + b.SetBytes(int64(total / b.N)) +} + +func BenchmarkACL_RegisterFrameworkProtoUnmarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + datas := make([][]byte, 10000) + for i := 0; i < 10000; i++ { + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedACL_RegisterFramework(popr, false)) + if err != nil { + panic(err) + } + datas[i] = data } - if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + msg := &ACL_RegisterFramework{} + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += len(datas[i%10000]) + if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { + panic(err) + } } + b.SetBytes(int64(total / b.N)) } -func TestValueJSON(t *testing1.T) { - popr := math_rand1.New(math_rand1.NewSource(time1.Now().UnixNano())) - p := NewPopulatedValue(popr, true) - jsondata, err := encoding_json.Marshal(p) + +func TestACL_RunTaskProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedACL_RunTask(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &Value{} - err = encoding_json.Unmarshal(jsondata, msg) - if err != nil { - panic(err) + msg := &ACL_RunTask{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) + for i := range data { + data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestValue_ScalarJSON(t *testing1.T) { - popr := math_rand1.New(math_rand1.NewSource(time1.Now().UnixNano())) - p := NewPopulatedValue_Scalar(popr, true) - jsondata, err := encoding_json.Marshal(p) - if err != nil { - panic(err) + +func TestACL_RunTaskMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedACL_RunTask(popr, false) + size := p.Size() + data := make([]byte, size) + for i := range data { + data[i] = byte(popr.Intn(256)) } - msg := &Value_Scalar{} - err = encoding_json.Unmarshal(jsondata, msg) + _, err := p.MarshalTo(data) if err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) - } - if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + t.Fatalf("seed = %d, err = %v", seed, err) } -} -func TestValue_RangeJSON(t *testing1.T) { - popr := math_rand1.New(math_rand1.NewSource(time1.Now().UnixNano())) - p := NewPopulatedValue_Range(popr, true) - jsondata, err := encoding_json.Marshal(p) - if err != nil { - panic(err) + msg := &ACL_RunTask{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &Value_Range{} - err = encoding_json.Unmarshal(jsondata, msg) - if err != nil { - panic(err) + for i := range data { + data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestValue_RangesJSON(t *testing1.T) { - popr := math_rand1.New(math_rand1.NewSource(time1.Now().UnixNano())) - p := NewPopulatedValue_Ranges(popr, true) - jsondata, err := encoding_json.Marshal(p) - if err != nil { - panic(err) + +func BenchmarkACL_RunTaskProtoMarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*ACL_RunTask, 10000) + for i := 0; i < 10000; i++ { + pops[i] = NewPopulatedACL_RunTask(popr, false) } - msg := &Value_Ranges{} - err = encoding_json.Unmarshal(jsondata, msg) - if err != nil { - panic(err) + b.ResetTimer() + for i := 0; i < b.N; i++ { + data, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) + if err != nil { + panic(err) + } + total += len(data) } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + b.SetBytes(int64(total / b.N)) +} + +func BenchmarkACL_RunTaskProtoUnmarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + datas := make([][]byte, 10000) + for i := 0; i < 10000; i++ { + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedACL_RunTask(popr, false)) + if err != nil { + panic(err) + } + datas[i] = data } - if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + msg := &ACL_RunTask{} + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += len(datas[i%10000]) + if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { + panic(err) + } } + b.SetBytes(int64(total / b.N)) } -func TestValue_SetJSON(t *testing1.T) { - popr := math_rand1.New(math_rand1.NewSource(time1.Now().UnixNano())) - p := NewPopulatedValue_Set(popr, true) - jsondata, err := encoding_json.Marshal(p) + +func TestACL_ShutdownFrameworkProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedACL_ShutdownFramework(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &Value_Set{} - err = encoding_json.Unmarshal(jsondata, msg) - if err != nil { - panic(err) + msg := &ACL_ShutdownFramework{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) + for i := range data { + data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestValue_TextJSON(t *testing1.T) { - popr := math_rand1.New(math_rand1.NewSource(time1.Now().UnixNano())) - p := NewPopulatedValue_Text(popr, true) - jsondata, err := encoding_json.Marshal(p) - if err != nil { - panic(err) + +func TestACL_ShutdownFrameworkMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedACL_ShutdownFramework(popr, false) + size := p.Size() + data := make([]byte, size) + for i := range data { + data[i] = byte(popr.Intn(256)) } - msg := &Value_Text{} - err = encoding_json.Unmarshal(jsondata, msg) + _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) - } - if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) - } -} -func TestAttributeJSON(t *testing1.T) { - popr := math_rand1.New(math_rand1.NewSource(time1.Now().UnixNano())) - p := NewPopulatedAttribute(popr, true) - jsondata, err := encoding_json.Marshal(p) - if err != nil { - panic(err) + msg := &ACL_ShutdownFramework{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &Attribute{} - err = encoding_json.Unmarshal(jsondata, msg) - if err != nil { - panic(err) + for i := range data { + data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestResourceJSON(t *testing1.T) { - popr := math_rand1.New(math_rand1.NewSource(time1.Now().UnixNano())) - p := NewPopulatedResource(popr, true) - jsondata, err := encoding_json.Marshal(p) - if err != nil { - panic(err) + +func BenchmarkACL_ShutdownFrameworkProtoMarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*ACL_ShutdownFramework, 10000) + for i := 0; i < 10000; i++ { + pops[i] = NewPopulatedACL_ShutdownFramework(popr, false) } - msg := &Resource{} - err = encoding_json.Unmarshal(jsondata, msg) - if err != nil { - panic(err) + b.ResetTimer() + for i := 0; i < b.N; i++ { + data, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) + if err != nil { + panic(err) + } + total += len(data) } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + b.SetBytes(int64(total / b.N)) +} + +func BenchmarkACL_ShutdownFrameworkProtoUnmarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + datas := make([][]byte, 10000) + for i := 0; i < 10000; i++ { + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedACL_ShutdownFramework(popr, false)) + if err != nil { + panic(err) + } + datas[i] = data } - if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + msg := &ACL_ShutdownFramework{} + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += len(datas[i%10000]) + if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { + panic(err) + } } + b.SetBytes(int64(total / b.N)) } -func TestResourceStatisticsJSON(t *testing1.T) { - popr := math_rand1.New(math_rand1.NewSource(time1.Now().UnixNano())) - p := NewPopulatedResourceStatistics(popr, true) - jsondata, err := encoding_json.Marshal(p) + +func TestACLsProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedACLs(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &ResourceStatistics{} - err = encoding_json.Unmarshal(jsondata, msg) - if err != nil { - panic(err) + msg := &ACLs{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) + for i := range data { + data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestResourceUsageJSON(t *testing1.T) { - popr := math_rand1.New(math_rand1.NewSource(time1.Now().UnixNano())) - p := NewPopulatedResourceUsage(popr, true) - jsondata, err := encoding_json.Marshal(p) - if err != nil { - panic(err) + +func TestACLsMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedACLs(popr, false) + size := p.Size() + data := make([]byte, size) + for i := range data { + data[i] = byte(popr.Intn(256)) } - msg := &ResourceUsage{} - err = encoding_json.Unmarshal(jsondata, msg) + _, err := p.MarshalTo(data) if err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) - } - if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + t.Fatalf("seed = %d, err = %v", seed, err) } -} -func TestPerfStatisticsJSON(t *testing1.T) { - popr := math_rand1.New(math_rand1.NewSource(time1.Now().UnixNano())) - p := NewPopulatedPerfStatistics(popr, true) - jsondata, err := encoding_json.Marshal(p) - if err != nil { - panic(err) + msg := &ACLs{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &PerfStatistics{} - err = encoding_json.Unmarshal(jsondata, msg) - if err != nil { - panic(err) + for i := range data { + data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestRequestJSON(t *testing1.T) { - popr := math_rand1.New(math_rand1.NewSource(time1.Now().UnixNano())) - p := NewPopulatedRequest(popr, true) - jsondata, err := encoding_json.Marshal(p) - if err != nil { - panic(err) + +func BenchmarkACLsProtoMarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*ACLs, 10000) + for i := 0; i < 10000; i++ { + pops[i] = NewPopulatedACLs(popr, false) } - msg := &Request{} - err = encoding_json.Unmarshal(jsondata, msg) - if err != nil { - panic(err) + b.ResetTimer() + for i := 0; i < b.N; i++ { + data, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) + if err != nil { + panic(err) + } + total += len(data) } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + b.SetBytes(int64(total / b.N)) +} + +func BenchmarkACLsProtoUnmarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + datas := make([][]byte, 10000) + for i := 0; i < 10000; i++ { + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedACLs(popr, false)) + if err != nil { + panic(err) + } + datas[i] = data } - if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + msg := &ACLs{} + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += len(datas[i%10000]) + if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { + panic(err) + } } + b.SetBytes(int64(total / b.N)) } -func TestOfferJSON(t *testing1.T) { - popr := math_rand1.New(math_rand1.NewSource(time1.Now().UnixNano())) - p := NewPopulatedOffer(popr, true) - jsondata, err := encoding_json.Marshal(p) + +func TestRateLimitProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedRateLimit(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &Offer{} - err = encoding_json.Unmarshal(jsondata, msg) - if err != nil { - panic(err) + msg := &RateLimit{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) + for i := range data { + data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestTaskInfoJSON(t *testing1.T) { - popr := math_rand1.New(math_rand1.NewSource(time1.Now().UnixNano())) - p := NewPopulatedTaskInfo(popr, true) - jsondata, err := encoding_json.Marshal(p) - if err != nil { - panic(err) + +func TestRateLimitMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedRateLimit(popr, false) + size := p.Size() + data := make([]byte, size) + for i := range data { + data[i] = byte(popr.Intn(256)) } - msg := &TaskInfo{} - err = encoding_json.Unmarshal(jsondata, msg) + _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &RateLimit{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + for i := range data { + data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestTaskStatusJSON(t *testing1.T) { - popr := math_rand1.New(math_rand1.NewSource(time1.Now().UnixNano())) - p := NewPopulatedTaskStatus(popr, true) - jsondata, err := encoding_json.Marshal(p) - if err != nil { - panic(err) - } - msg := &TaskStatus{} - err = encoding_json.Unmarshal(jsondata, msg) - if err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + +func BenchmarkRateLimitProtoMarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*RateLimit, 10000) + for i := 0; i < 10000; i++ { + pops[i] = NewPopulatedRateLimit(popr, false) } - if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + b.ResetTimer() + for i := 0; i < b.N; i++ { + data, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) + if err != nil { + panic(err) + } + total += len(data) } + b.SetBytes(int64(total / b.N)) } -func TestFiltersJSON(t *testing1.T) { - popr := math_rand1.New(math_rand1.NewSource(time1.Now().UnixNano())) - p := NewPopulatedFilters(popr, true) - jsondata, err := encoding_json.Marshal(p) - if err != nil { - panic(err) - } - msg := &Filters{} - err = encoding_json.Unmarshal(jsondata, msg) - if err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + +func BenchmarkRateLimitProtoUnmarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + datas := make([][]byte, 10000) + for i := 0; i < 10000; i++ { + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedRateLimit(popr, false)) + if err != nil { + panic(err) + } + datas[i] = data } - if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + msg := &RateLimit{} + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += len(datas[i%10000]) + if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { + panic(err) + } } + b.SetBytes(int64(total / b.N)) } -func TestEnvironmentJSON(t *testing1.T) { - popr := math_rand1.New(math_rand1.NewSource(time1.Now().UnixNano())) - p := NewPopulatedEnvironment(popr, true) - jsondata, err := encoding_json.Marshal(p) + +func TestRateLimitsProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedRateLimits(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &Environment{} - err = encoding_json.Unmarshal(jsondata, msg) - if err != nil { - panic(err) + msg := &RateLimits{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) + for i := range data { + data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestEnvironment_VariableJSON(t *testing1.T) { - popr := math_rand1.New(math_rand1.NewSource(time1.Now().UnixNano())) - p := NewPopulatedEnvironment_Variable(popr, true) - jsondata, err := encoding_json.Marshal(p) - if err != nil { - panic(err) + +func TestRateLimitsMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedRateLimits(popr, false) + size := p.Size() + data := make([]byte, size) + for i := range data { + data[i] = byte(popr.Intn(256)) } - msg := &Environment_Variable{} - err = encoding_json.Unmarshal(jsondata, msg) + _, err := p.MarshalTo(data) if err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) - } - if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + t.Fatalf("seed = %d, err = %v", seed, err) } -} -func TestParameterJSON(t *testing1.T) { - popr := math_rand1.New(math_rand1.NewSource(time1.Now().UnixNano())) - p := NewPopulatedParameter(popr, true) - jsondata, err := encoding_json.Marshal(p) - if err != nil { - panic(err) + msg := &RateLimits{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &Parameter{} - err = encoding_json.Unmarshal(jsondata, msg) - if err != nil { - panic(err) + for i := range data { + data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestParametersJSON(t *testing1.T) { - popr := math_rand1.New(math_rand1.NewSource(time1.Now().UnixNano())) - p := NewPopulatedParameters(popr, true) - jsondata, err := encoding_json.Marshal(p) - if err != nil { - panic(err) + +func BenchmarkRateLimitsProtoMarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*RateLimits, 10000) + for i := 0; i < 10000; i++ { + pops[i] = NewPopulatedRateLimits(popr, false) } - msg := &Parameters{} - err = encoding_json.Unmarshal(jsondata, msg) - if err != nil { - panic(err) + b.ResetTimer() + for i := 0; i < b.N; i++ { + data, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) + if err != nil { + panic(err) + } + total += len(data) } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + b.SetBytes(int64(total / b.N)) +} + +func BenchmarkRateLimitsProtoUnmarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + datas := make([][]byte, 10000) + for i := 0; i < 10000; i++ { + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedRateLimits(popr, false)) + if err != nil { + panic(err) + } + datas[i] = data } - if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + msg := &RateLimits{} + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += len(datas[i%10000]) + if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { + panic(err) + } } + b.SetBytes(int64(total / b.N)) } -func TestCredentialJSON(t *testing1.T) { - popr := math_rand1.New(math_rand1.NewSource(time1.Now().UnixNano())) - p := NewPopulatedCredential(popr, true) - jsondata, err := encoding_json.Marshal(p) + +func TestVolumeProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedVolume(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &Credential{} - err = encoding_json.Unmarshal(jsondata, msg) - if err != nil { - panic(err) + msg := &Volume{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) + for i := range data { + data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestCredentialsJSON(t *testing1.T) { - popr := math_rand1.New(math_rand1.NewSource(time1.Now().UnixNano())) - p := NewPopulatedCredentials(popr, true) - jsondata, err := encoding_json.Marshal(p) - if err != nil { - panic(err) + +func TestVolumeMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedVolume(popr, false) + size := p.Size() + data := make([]byte, size) + for i := range data { + data[i] = byte(popr.Intn(256)) } - msg := &Credentials{} - err = encoding_json.Unmarshal(jsondata, msg) + _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &Volume{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + for i := range data { + data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestACLJSON(t *testing1.T) { - popr := math_rand1.New(math_rand1.NewSource(time1.Now().UnixNano())) - p := NewPopulatedACL(popr, true) - jsondata, err := encoding_json.Marshal(p) - if err != nil { - panic(err) + +func BenchmarkVolumeProtoMarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*Volume, 10000) + for i := 0; i < 10000; i++ { + pops[i] = NewPopulatedVolume(popr, false) } - msg := &ACL{} - err = encoding_json.Unmarshal(jsondata, msg) - if err != nil { - panic(err) + b.ResetTimer() + for i := 0; i < b.N; i++ { + data, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) + if err != nil { + panic(err) + } + total += len(data) } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + b.SetBytes(int64(total / b.N)) +} + +func BenchmarkVolumeProtoUnmarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + datas := make([][]byte, 10000) + for i := 0; i < 10000; i++ { + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedVolume(popr, false)) + if err != nil { + panic(err) + } + datas[i] = data } - if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + msg := &Volume{} + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += len(datas[i%10000]) + if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { + panic(err) + } } + b.SetBytes(int64(total / b.N)) } -func TestACL_EntityJSON(t *testing1.T) { - popr := math_rand1.New(math_rand1.NewSource(time1.Now().UnixNano())) - p := NewPopulatedACL_Entity(popr, true) - jsondata, err := encoding_json.Marshal(p) + +func TestContainerInfoProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedContainerInfo(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &ACL_Entity{} - err = encoding_json.Unmarshal(jsondata, msg) - if err != nil { - panic(err) + msg := &ContainerInfo{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) + for i := range data { + data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestACL_RegisterFrameworkJSON(t *testing1.T) { - popr := math_rand1.New(math_rand1.NewSource(time1.Now().UnixNano())) - p := NewPopulatedACL_RegisterFramework(popr, true) - jsondata, err := encoding_json.Marshal(p) - if err != nil { - panic(err) + +func TestContainerInfoMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedContainerInfo(popr, false) + size := p.Size() + data := make([]byte, size) + for i := range data { + data[i] = byte(popr.Intn(256)) } - msg := &ACL_RegisterFramework{} - err = encoding_json.Unmarshal(jsondata, msg) + _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &ContainerInfo{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + for i := range data { + data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestACL_RunTaskJSON(t *testing1.T) { - popr := math_rand1.New(math_rand1.NewSource(time1.Now().UnixNano())) - p := NewPopulatedACL_RunTask(popr, true) - jsondata, err := encoding_json.Marshal(p) - if err != nil { - panic(err) - } - msg := &ACL_RunTask{} - err = encoding_json.Unmarshal(jsondata, msg) - if err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + +func BenchmarkContainerInfoProtoMarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*ContainerInfo, 10000) + for i := 0; i < 10000; i++ { + pops[i] = NewPopulatedContainerInfo(popr, false) } - if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + b.ResetTimer() + for i := 0; i < b.N; i++ { + data, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) + if err != nil { + panic(err) + } + total += len(data) } + b.SetBytes(int64(total / b.N)) } -func TestACL_ShutdownFrameworkJSON(t *testing1.T) { - popr := math_rand1.New(math_rand1.NewSource(time1.Now().UnixNano())) - p := NewPopulatedACL_ShutdownFramework(popr, true) - jsondata, err := encoding_json.Marshal(p) - if err != nil { - panic(err) - } - msg := &ACL_ShutdownFramework{} - err = encoding_json.Unmarshal(jsondata, msg) - if err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + +func BenchmarkContainerInfoProtoUnmarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + datas := make([][]byte, 10000) + for i := 0; i < 10000; i++ { + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedContainerInfo(popr, false)) + if err != nil { + panic(err) + } + datas[i] = data } - if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + msg := &ContainerInfo{} + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += len(datas[i%10000]) + if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { + panic(err) + } } + b.SetBytes(int64(total / b.N)) } -func TestACLsJSON(t *testing1.T) { - popr := math_rand1.New(math_rand1.NewSource(time1.Now().UnixNano())) - p := NewPopulatedACLs(popr, true) - jsondata, err := encoding_json.Marshal(p) - if err != nil { - panic(err) - } - msg := &ACLs{} - err = encoding_json.Unmarshal(jsondata, msg) + +func TestContainerInfo_DockerInfoProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedContainerInfo_DockerInfo(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, err = %v", seed, err) } - if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) - } -} -func TestRateLimitJSON(t *testing1.T) { - popr := math_rand1.New(math_rand1.NewSource(time1.Now().UnixNano())) - p := NewPopulatedRateLimit(popr, true) - jsondata, err := encoding_json.Marshal(p) - if err != nil { - panic(err) + msg := &ContainerInfo_DockerInfo{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &RateLimit{} - err = encoding_json.Unmarshal(jsondata, msg) - if err != nil { - panic(err) + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) + for i := range data { + data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestRateLimitsJSON(t *testing1.T) { - popr := math_rand1.New(math_rand1.NewSource(time1.Now().UnixNano())) - p := NewPopulatedRateLimits(popr, true) - jsondata, err := encoding_json.Marshal(p) - if err != nil { - panic(err) + +func TestContainerInfo_DockerInfoMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedContainerInfo_DockerInfo(popr, false) + size := p.Size() + data := make([]byte, size) + for i := range data { + data[i] = byte(popr.Intn(256)) } - msg := &RateLimits{} - err = encoding_json.Unmarshal(jsondata, msg) + _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) - } - if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) - } -} -func TestVolumeJSON(t *testing1.T) { - popr := math_rand1.New(math_rand1.NewSource(time1.Now().UnixNano())) - p := NewPopulatedVolume(popr, true) - jsondata, err := encoding_json.Marshal(p) - if err != nil { - panic(err) + msg := &ContainerInfo_DockerInfo{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &Volume{} - err = encoding_json.Unmarshal(jsondata, msg) - if err != nil { - panic(err) + for i := range data { + data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestContainerInfoJSON(t *testing1.T) { - popr := math_rand1.New(math_rand1.NewSource(time1.Now().UnixNano())) - p := NewPopulatedContainerInfo(popr, true) - jsondata, err := encoding_json.Marshal(p) - if err != nil { - panic(err) + +func BenchmarkContainerInfo_DockerInfoProtoMarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*ContainerInfo_DockerInfo, 10000) + for i := 0; i < 10000; i++ { + pops[i] = NewPopulatedContainerInfo_DockerInfo(popr, false) } - msg := &ContainerInfo{} - err = encoding_json.Unmarshal(jsondata, msg) - if err != nil { - panic(err) + b.ResetTimer() + for i := 0; i < b.N; i++ { + data, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) + if err != nil { + panic(err) + } + total += len(data) } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + b.SetBytes(int64(total / b.N)) +} + +func BenchmarkContainerInfo_DockerInfoProtoUnmarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + datas := make([][]byte, 10000) + for i := 0; i < 10000; i++ { + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedContainerInfo_DockerInfo(popr, false)) + if err != nil { + panic(err) + } + datas[i] = data } - if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + msg := &ContainerInfo_DockerInfo{} + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += len(datas[i%10000]) + if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { + panic(err) + } } + b.SetBytes(int64(total / b.N)) } -func TestContainerInfo_DockerInfoJSON(t *testing1.T) { - popr := math_rand1.New(math_rand1.NewSource(time1.Now().UnixNano())) - p := NewPopulatedContainerInfo_DockerInfo(popr, true) - jsondata, err := encoding_json.Marshal(p) + +func TestContainerInfo_DockerInfo_PortMappingProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedContainerInfo_DockerInfo_PortMapping(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &ContainerInfo_DockerInfo{} - err = encoding_json.Unmarshal(jsondata, msg) - if err != nil { - panic(err) + msg := &ContainerInfo_DockerInfo_PortMapping{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) + for i := range data { + data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestContainerInfo_DockerInfo_PortMappingJSON(t *testing1.T) { - popr := math_rand1.New(math_rand1.NewSource(time1.Now().UnixNano())) - p := NewPopulatedContainerInfo_DockerInfo_PortMapping(popr, true) - jsondata, err := encoding_json.Marshal(p) + +func TestContainerInfo_DockerInfo_PortMappingMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedContainerInfo_DockerInfo_PortMapping(popr, false) + size := p.Size() + data := make([]byte, size) + for i := range data { + data[i] = byte(popr.Intn(256)) + } + _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &ContainerInfo_DockerInfo_PortMapping{} - err = encoding_json.Unmarshal(jsondata, msg) - if err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + for i := range data { + data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestFrameworkIDProtoText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedFrameworkID(popr, true) - data := github_com_gogo_protobuf_proto1.MarshalTextString(p) - msg := &FrameworkID{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + +func BenchmarkContainerInfo_DockerInfo_PortMappingProtoMarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*ContainerInfo_DockerInfo_PortMapping, 10000) + for i := 0; i < 10000; i++ { + pops[i] = NewPopulatedContainerInfo_DockerInfo_PortMapping(popr, false) } - if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + b.ResetTimer() + for i := 0; i < b.N; i++ { + data, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) + if err != nil { + panic(err) + } + total += len(data) } + b.SetBytes(int64(total / b.N)) } -func TestFrameworkIDProtoCompactText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedFrameworkID(popr, true) - data := github_com_gogo_protobuf_proto1.CompactTextString(p) - msg := &FrameworkID{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) +func BenchmarkContainerInfo_DockerInfo_PortMappingProtoUnmarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + datas := make([][]byte, 10000) + for i := 0; i < 10000; i++ { + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedContainerInfo_DockerInfo_PortMapping(popr, false)) + if err != nil { + panic(err) + } + datas[i] = data } - if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + msg := &ContainerInfo_DockerInfo_PortMapping{} + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += len(datas[i%10000]) + if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { + panic(err) + } } + b.SetBytes(int64(total / b.N)) } -func TestOfferIDProtoText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedOfferID(popr, true) - data := github_com_gogo_protobuf_proto1.MarshalTextString(p) - msg := &OfferID{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestLabelsProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedLabels(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &Labels{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) + for i := range data { + data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestOfferIDProtoCompactText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedOfferID(popr, true) - data := github_com_gogo_protobuf_proto1.CompactTextString(p) - msg := &OfferID{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestLabelsMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedLabels(popr, false) + size := p.Size() + data := make([]byte, size) + for i := range data { + data[i] = byte(popr.Intn(256)) } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + _, err := p.MarshalTo(data) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + msg := &Labels{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } -} - -func TestSlaveIDProtoText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedSlaveID(popr, true) - data := github_com_gogo_protobuf_proto1.MarshalTextString(p) - msg := &SlaveID{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) + for i := range data { + data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestSlaveIDProtoCompactText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedSlaveID(popr, true) - data := github_com_gogo_protobuf_proto1.CompactTextString(p) - msg := &SlaveID{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) +func BenchmarkLabelsProtoMarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*Labels, 10000) + for i := 0; i < 10000; i++ { + pops[i] = NewPopulatedLabels(popr, false) } - if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + b.ResetTimer() + for i := 0; i < b.N; i++ { + data, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) + if err != nil { + panic(err) + } + total += len(data) } + b.SetBytes(int64(total / b.N)) } -func TestTaskIDProtoText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedTaskID(popr, true) - data := github_com_gogo_protobuf_proto1.MarshalTextString(p) - msg := &TaskID{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) +func BenchmarkLabelsProtoUnmarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + datas := make([][]byte, 10000) + for i := 0; i < 10000; i++ { + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedLabels(popr, false)) + if err != nil { + panic(err) + } + datas[i] = data } - if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + msg := &Labels{} + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += len(datas[i%10000]) + if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { + panic(err) + } } + b.SetBytes(int64(total / b.N)) } -func TestTaskIDProtoCompactText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedTaskID(popr, true) - data := github_com_gogo_protobuf_proto1.CompactTextString(p) - msg := &TaskID{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestLabelProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedLabel(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &Label{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) + for i := range data { + data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestExecutorIDProtoText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedExecutorID(popr, true) - data := github_com_gogo_protobuf_proto1.MarshalTextString(p) - msg := &ExecutorID{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestLabelMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedLabel(popr, false) + size := p.Size() + data := make([]byte, size) + for i := range data { + data[i] = byte(popr.Intn(256)) } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + _, err := p.MarshalTo(data) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + msg := &Label{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } -} - -func TestExecutorIDProtoCompactText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedExecutorID(popr, true) - data := github_com_gogo_protobuf_proto1.CompactTextString(p) - msg := &ExecutorID{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) + for i := range data { + data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestContainerIDProtoText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedContainerID(popr, true) - data := github_com_gogo_protobuf_proto1.MarshalTextString(p) - msg := &ContainerID{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) +func BenchmarkLabelProtoMarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*Label, 10000) + for i := 0; i < 10000; i++ { + pops[i] = NewPopulatedLabel(popr, false) } - if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + b.ResetTimer() + for i := 0; i < b.N; i++ { + data, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) + if err != nil { + panic(err) + } + total += len(data) } + b.SetBytes(int64(total / b.N)) } -func TestContainerIDProtoCompactText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedContainerID(popr, true) - data := github_com_gogo_protobuf_proto1.CompactTextString(p) - msg := &ContainerID{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) +func BenchmarkLabelProtoUnmarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + datas := make([][]byte, 10000) + for i := 0; i < 10000; i++ { + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedLabel(popr, false)) + if err != nil { + panic(err) + } + datas[i] = data } - if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + msg := &Label{} + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += len(datas[i%10000]) + if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { + panic(err) + } } + b.SetBytes(int64(total / b.N)) } -func TestFrameworkInfoProtoText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedFrameworkInfo(popr, true) - data := github_com_gogo_protobuf_proto1.MarshalTextString(p) - msg := &FrameworkInfo{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestPortProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedPort(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &Port{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) + for i := range data { + data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestFrameworkInfoProtoCompactText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedFrameworkInfo(popr, true) - data := github_com_gogo_protobuf_proto1.CompactTextString(p) - msg := &FrameworkInfo{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestPortMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedPort(popr, false) + size := p.Size() + data := make([]byte, size) + for i := range data { + data[i] = byte(popr.Intn(256)) } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + _, err := p.MarshalTo(data) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + msg := &Port{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } -} - -func TestHealthCheckProtoText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedHealthCheck(popr, true) - data := github_com_gogo_protobuf_proto1.MarshalTextString(p) - msg := &HealthCheck{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) + for i := range data { + data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestHealthCheckProtoCompactText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedHealthCheck(popr, true) - data := github_com_gogo_protobuf_proto1.CompactTextString(p) - msg := &HealthCheck{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) +func BenchmarkPortProtoMarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*Port, 10000) + for i := 0; i < 10000; i++ { + pops[i] = NewPopulatedPort(popr, false) } - if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + b.ResetTimer() + for i := 0; i < b.N; i++ { + data, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) + if err != nil { + panic(err) + } + total += len(data) } + b.SetBytes(int64(total / b.N)) } -func TestHealthCheck_HTTPProtoText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedHealthCheck_HTTP(popr, true) - data := github_com_gogo_protobuf_proto1.MarshalTextString(p) - msg := &HealthCheck_HTTP{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) +func BenchmarkPortProtoUnmarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + datas := make([][]byte, 10000) + for i := 0; i < 10000; i++ { + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedPort(popr, false)) + if err != nil { + panic(err) + } + datas[i] = data } - if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + msg := &Port{} + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += len(datas[i%10000]) + if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { + panic(err) + } } + b.SetBytes(int64(total / b.N)) } -func TestHealthCheck_HTTPProtoCompactText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedHealthCheck_HTTP(popr, true) - data := github_com_gogo_protobuf_proto1.CompactTextString(p) - msg := &HealthCheck_HTTP{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestPortsProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedPorts(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &Ports{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) + for i := range data { + data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestCommandInfoProtoText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedCommandInfo(popr, true) - data := github_com_gogo_protobuf_proto1.MarshalTextString(p) - msg := &CommandInfo{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestPortsMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedPorts(popr, false) + size := p.Size() + data := make([]byte, size) + for i := range data { + data[i] = byte(popr.Intn(256)) } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + _, err := p.MarshalTo(data) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + msg := &Ports{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } -} - -func TestCommandInfoProtoCompactText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedCommandInfo(popr, true) - data := github_com_gogo_protobuf_proto1.CompactTextString(p) - msg := &CommandInfo{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) + for i := range data { + data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestCommandInfo_URIProtoText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedCommandInfo_URI(popr, true) - data := github_com_gogo_protobuf_proto1.MarshalTextString(p) - msg := &CommandInfo_URI{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) +func BenchmarkPortsProtoMarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*Ports, 10000) + for i := 0; i < 10000; i++ { + pops[i] = NewPopulatedPorts(popr, false) } - if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + b.ResetTimer() + for i := 0; i < b.N; i++ { + data, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) + if err != nil { + panic(err) + } + total += len(data) } + b.SetBytes(int64(total / b.N)) } -func TestCommandInfo_URIProtoCompactText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedCommandInfo_URI(popr, true) - data := github_com_gogo_protobuf_proto1.CompactTextString(p) - msg := &CommandInfo_URI{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) +func BenchmarkPortsProtoUnmarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + datas := make([][]byte, 10000) + for i := 0; i < 10000; i++ { + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedPorts(popr, false)) + if err != nil { + panic(err) + } + datas[i] = data } - if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + msg := &Ports{} + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += len(datas[i%10000]) + if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { + panic(err) + } } + b.SetBytes(int64(total / b.N)) } -func TestCommandInfo_ContainerInfoProtoText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedCommandInfo_ContainerInfo(popr, true) - data := github_com_gogo_protobuf_proto1.MarshalTextString(p) - msg := &CommandInfo_ContainerInfo{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestDiscoveryInfoProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedDiscoveryInfo(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &DiscoveryInfo{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) + for i := range data { + data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestCommandInfo_ContainerInfoProtoCompactText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedCommandInfo_ContainerInfo(popr, true) - data := github_com_gogo_protobuf_proto1.CompactTextString(p) - msg := &CommandInfo_ContainerInfo{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestDiscoveryInfoMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedDiscoveryInfo(popr, false) + size := p.Size() + data := make([]byte, size) + for i := range data { + data[i] = byte(popr.Intn(256)) } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + _, err := p.MarshalTo(data) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + msg := &DiscoveryInfo{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } -} - -func TestExecutorInfoProtoText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedExecutorInfo(popr, true) - data := github_com_gogo_protobuf_proto1.MarshalTextString(p) - msg := &ExecutorInfo{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) + for i := range data { + data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestExecutorInfoProtoCompactText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedExecutorInfo(popr, true) - data := github_com_gogo_protobuf_proto1.CompactTextString(p) - msg := &ExecutorInfo{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) +func BenchmarkDiscoveryInfoProtoMarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*DiscoveryInfo, 10000) + for i := 0; i < 10000; i++ { + pops[i] = NewPopulatedDiscoveryInfo(popr, false) } - if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + b.ResetTimer() + for i := 0; i < b.N; i++ { + data, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) + if err != nil { + panic(err) + } + total += len(data) } + b.SetBytes(int64(total / b.N)) } -func TestMasterInfoProtoText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedMasterInfo(popr, true) - data := github_com_gogo_protobuf_proto1.MarshalTextString(p) - msg := &MasterInfo{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) +func BenchmarkDiscoveryInfoProtoUnmarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + datas := make([][]byte, 10000) + for i := 0; i < 10000; i++ { + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedDiscoveryInfo(popr, false)) + if err != nil { + panic(err) + } + datas[i] = data } - if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + msg := &DiscoveryInfo{} + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += len(datas[i%10000]) + if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { + panic(err) + } } + b.SetBytes(int64(total / b.N)) } -func TestMasterInfoProtoCompactText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedMasterInfo(popr, true) - data := github_com_gogo_protobuf_proto1.CompactTextString(p) - msg := &MasterInfo{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestFrameworkIDJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedFrameworkID(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &FrameworkID{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestSlaveInfoProtoText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedSlaveInfo(popr, true) - data := github_com_gogo_protobuf_proto1.MarshalTextString(p) - msg := &SlaveInfo{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestOfferIDJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedOfferID(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &OfferID{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestSlaveInfoProtoCompactText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedSlaveInfo(popr, true) - data := github_com_gogo_protobuf_proto1.CompactTextString(p) - msg := &SlaveInfo{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestSlaveIDJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedSlaveID(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &SlaveID{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestValueProtoText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedValue(popr, true) - data := github_com_gogo_protobuf_proto1.MarshalTextString(p) - msg := &Value{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestTaskIDJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedTaskID(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &TaskID{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestValueProtoCompactText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedValue(popr, true) - data := github_com_gogo_protobuf_proto1.CompactTextString(p) - msg := &Value{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestExecutorIDJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedExecutorID(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &ExecutorID{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestValue_ScalarProtoText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedValue_Scalar(popr, true) - data := github_com_gogo_protobuf_proto1.MarshalTextString(p) - msg := &Value_Scalar{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestContainerIDJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedContainerID(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &ContainerID{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestValue_ScalarProtoCompactText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedValue_Scalar(popr, true) - data := github_com_gogo_protobuf_proto1.CompactTextString(p) - msg := &Value_Scalar{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestFrameworkInfoJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedFrameworkInfo(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &FrameworkInfo{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestValue_RangeProtoText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedValue_Range(popr, true) - data := github_com_gogo_protobuf_proto1.MarshalTextString(p) - msg := &Value_Range{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestFrameworkInfo_CapabilityJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedFrameworkInfo_Capability(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &FrameworkInfo_Capability{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestValue_RangeProtoCompactText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedValue_Range(popr, true) - data := github_com_gogo_protobuf_proto1.CompactTextString(p) - msg := &Value_Range{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestHealthCheckJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedHealthCheck(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &HealthCheck{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestValue_RangesProtoText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedValue_Ranges(popr, true) - data := github_com_gogo_protobuf_proto1.MarshalTextString(p) - msg := &Value_Ranges{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestHealthCheck_HTTPJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedHealthCheck_HTTP(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &HealthCheck_HTTP{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestValue_RangesProtoCompactText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedValue_Ranges(popr, true) - data := github_com_gogo_protobuf_proto1.CompactTextString(p) - msg := &Value_Ranges{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestCommandInfoJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedCommandInfo(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &CommandInfo{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestValue_SetProtoText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedValue_Set(popr, true) - data := github_com_gogo_protobuf_proto1.MarshalTextString(p) - msg := &Value_Set{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestCommandInfo_URIJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedCommandInfo_URI(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &CommandInfo_URI{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestValue_SetProtoCompactText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedValue_Set(popr, true) - data := github_com_gogo_protobuf_proto1.CompactTextString(p) - msg := &Value_Set{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestCommandInfo_ContainerInfoJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedCommandInfo_ContainerInfo(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &CommandInfo_ContainerInfo{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestValue_TextProtoText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedValue_Text(popr, true) - data := github_com_gogo_protobuf_proto1.MarshalTextString(p) - msg := &Value_Text{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestExecutorInfoJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedExecutorInfo(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &ExecutorInfo{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestValue_TextProtoCompactText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedValue_Text(popr, true) - data := github_com_gogo_protobuf_proto1.CompactTextString(p) - msg := &Value_Text{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestMasterInfoJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedMasterInfo(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &MasterInfo{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestAttributeProtoText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedAttribute(popr, true) - data := github_com_gogo_protobuf_proto1.MarshalTextString(p) - msg := &Attribute{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestSlaveInfoJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedSlaveInfo(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &SlaveInfo{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestAttributeProtoCompactText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedAttribute(popr, true) - data := github_com_gogo_protobuf_proto1.CompactTextString(p) - msg := &Attribute{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestValueJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedValue(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &Value{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestResourceProtoText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedResource(popr, true) - data := github_com_gogo_protobuf_proto1.MarshalTextString(p) - msg := &Resource{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestValue_ScalarJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedValue_Scalar(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &Value_Scalar{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestResourceProtoCompactText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedResource(popr, true) - data := github_com_gogo_protobuf_proto1.CompactTextString(p) - msg := &Resource{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestValue_RangeJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedValue_Range(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &Value_Range{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestResourceStatisticsProtoText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedResourceStatistics(popr, true) - data := github_com_gogo_protobuf_proto1.MarshalTextString(p) - msg := &ResourceStatistics{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestValue_RangesJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedValue_Ranges(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &Value_Ranges{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestResourceStatisticsProtoCompactText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedResourceStatistics(popr, true) - data := github_com_gogo_protobuf_proto1.CompactTextString(p) - msg := &ResourceStatistics{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestValue_SetJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedValue_Set(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &Value_Set{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestResourceUsageProtoText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedResourceUsage(popr, true) - data := github_com_gogo_protobuf_proto1.MarshalTextString(p) - msg := &ResourceUsage{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestValue_TextJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedValue_Text(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &Value_Text{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestResourceUsageProtoCompactText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedResourceUsage(popr, true) - data := github_com_gogo_protobuf_proto1.CompactTextString(p) - msg := &ResourceUsage{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestAttributeJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedAttribute(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &Attribute{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestPerfStatisticsProtoText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedPerfStatistics(popr, true) - data := github_com_gogo_protobuf_proto1.MarshalTextString(p) - msg := &PerfStatistics{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestResourceJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedResource(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &Resource{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestPerfStatisticsProtoCompactText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedPerfStatistics(popr, true) - data := github_com_gogo_protobuf_proto1.CompactTextString(p) - msg := &PerfStatistics{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestResource_ReservationInfoJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedResource_ReservationInfo(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &Resource_ReservationInfo{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestRequestProtoText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedRequest(popr, true) - data := github_com_gogo_protobuf_proto1.MarshalTextString(p) - msg := &Request{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestResource_DiskInfoJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedResource_DiskInfo(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &Resource_DiskInfo{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestRequestProtoCompactText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedRequest(popr, true) - data := github_com_gogo_protobuf_proto1.CompactTextString(p) - msg := &Request{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestResource_DiskInfo_PersistenceJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedResource_DiskInfo_Persistence(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &Resource_DiskInfo_Persistence{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestOfferProtoText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedOffer(popr, true) - data := github_com_gogo_protobuf_proto1.MarshalTextString(p) - msg := &Offer{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestResource_RevocableInfoJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedResource_RevocableInfo(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &Resource_RevocableInfo{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestOfferProtoCompactText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedOffer(popr, true) - data := github_com_gogo_protobuf_proto1.CompactTextString(p) - msg := &Offer{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestTrafficControlStatisticsJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedTrafficControlStatistics(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &TrafficControlStatistics{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestTaskInfoProtoText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedTaskInfo(popr, true) - data := github_com_gogo_protobuf_proto1.MarshalTextString(p) - msg := &TaskInfo{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestResourceStatisticsJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedResourceStatistics(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &ResourceStatistics{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestTaskInfoProtoCompactText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedTaskInfo(popr, true) - data := github_com_gogo_protobuf_proto1.CompactTextString(p) - msg := &TaskInfo{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestResourceUsageJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedResourceUsage(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &ResourceUsage{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestTaskStatusProtoText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedTaskStatus(popr, true) - data := github_com_gogo_protobuf_proto1.MarshalTextString(p) - msg := &TaskStatus{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestResourceUsage_ExecutorJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedResourceUsage_Executor(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &ResourceUsage_Executor{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestTaskStatusProtoCompactText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedTaskStatus(popr, true) - data := github_com_gogo_protobuf_proto1.CompactTextString(p) - msg := &TaskStatus{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestPerfStatisticsJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedPerfStatistics(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &PerfStatistics{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestFiltersProtoText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedFilters(popr, true) - data := github_com_gogo_protobuf_proto1.MarshalTextString(p) - msg := &Filters{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestRequestJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedRequest(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &Request{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestFiltersProtoCompactText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedFilters(popr, true) - data := github_com_gogo_protobuf_proto1.CompactTextString(p) - msg := &Filters{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestOfferJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedOffer(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &Offer{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestEnvironmentProtoText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedEnvironment(popr, true) - data := github_com_gogo_protobuf_proto1.MarshalTextString(p) - msg := &Environment{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestOffer_OperationJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedOffer_Operation(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &Offer_Operation{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestEnvironmentProtoCompactText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedEnvironment(popr, true) - data := github_com_gogo_protobuf_proto1.CompactTextString(p) - msg := &Environment{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestOffer_Operation_LaunchJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedOffer_Operation_Launch(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &Offer_Operation_Launch{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestEnvironment_VariableProtoText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedEnvironment_Variable(popr, true) - data := github_com_gogo_protobuf_proto1.MarshalTextString(p) - msg := &Environment_Variable{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestOffer_Operation_ReserveJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedOffer_Operation_Reserve(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &Offer_Operation_Reserve{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestEnvironment_VariableProtoCompactText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedEnvironment_Variable(popr, true) - data := github_com_gogo_protobuf_proto1.CompactTextString(p) - msg := &Environment_Variable{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestOffer_Operation_UnreserveJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedOffer_Operation_Unreserve(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &Offer_Operation_Unreserve{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestParameterProtoText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedParameter(popr, true) - data := github_com_gogo_protobuf_proto1.MarshalTextString(p) - msg := &Parameter{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestOffer_Operation_CreateJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedOffer_Operation_Create(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &Offer_Operation_Create{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestParameterProtoCompactText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedParameter(popr, true) - data := github_com_gogo_protobuf_proto1.CompactTextString(p) - msg := &Parameter{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestOffer_Operation_DestroyJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedOffer_Operation_Destroy(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &Offer_Operation_Destroy{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestParametersProtoText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedParameters(popr, true) - data := github_com_gogo_protobuf_proto1.MarshalTextString(p) - msg := &Parameters{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestTaskInfoJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedTaskInfo(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &TaskInfo{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestParametersProtoCompactText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedParameters(popr, true) - data := github_com_gogo_protobuf_proto1.CompactTextString(p) - msg := &Parameters{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestTaskStatusJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedTaskStatus(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &TaskStatus{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestCredentialProtoText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedCredential(popr, true) - data := github_com_gogo_protobuf_proto1.MarshalTextString(p) - msg := &Credential{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestFiltersJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedFilters(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &Filters{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestCredentialProtoCompactText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedCredential(popr, true) - data := github_com_gogo_protobuf_proto1.CompactTextString(p) - msg := &Credential{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestEnvironmentJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedEnvironment(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &Environment{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestCredentialsProtoText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedCredentials(popr, true) - data := github_com_gogo_protobuf_proto1.MarshalTextString(p) - msg := &Credentials{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestEnvironment_VariableJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedEnvironment_Variable(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &Environment_Variable{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestCredentialsProtoCompactText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedCredentials(popr, true) - data := github_com_gogo_protobuf_proto1.CompactTextString(p) - msg := &Credentials{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestParameterJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedParameter(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &Parameter{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestACLProtoText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedACL(popr, true) - data := github_com_gogo_protobuf_proto1.MarshalTextString(p) - msg := &ACL{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestParametersJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedParameters(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &Parameters{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestACLProtoCompactText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedACL(popr, true) - data := github_com_gogo_protobuf_proto1.CompactTextString(p) - msg := &ACL{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestCredentialJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedCredential(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &Credential{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestACL_EntityProtoText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedACL_Entity(popr, true) - data := github_com_gogo_protobuf_proto1.MarshalTextString(p) - msg := &ACL_Entity{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestCredentialsJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedCredentials(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &Credentials{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestACL_EntityProtoCompactText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedACL_Entity(popr, true) - data := github_com_gogo_protobuf_proto1.CompactTextString(p) - msg := &ACL_Entity{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestACLJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedACL(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &ACL{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestACL_RegisterFrameworkProtoText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedACL_RegisterFramework(popr, true) - data := github_com_gogo_protobuf_proto1.MarshalTextString(p) - msg := &ACL_RegisterFramework{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestACL_EntityJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedACL_Entity(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &ACL_Entity{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestACL_RegisterFrameworkProtoCompactText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) +func TestACL_RegisterFrameworkJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedACL_RegisterFramework(popr, true) - data := github_com_gogo_protobuf_proto1.CompactTextString(p) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } msg := &ACL_RegisterFramework{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestACL_RunTaskProtoText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) +func TestACL_RunTaskJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedACL_RunTask(popr, true) - data := github_com_gogo_protobuf_proto1.MarshalTextString(p) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } msg := &ACL_RunTask{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestACL_RunTaskProtoCompactText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedACL_RunTask(popr, true) - data := github_com_gogo_protobuf_proto1.CompactTextString(p) - msg := &ACL_RunTask{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestACL_ShutdownFrameworkJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedACL_ShutdownFramework(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &ACL_ShutdownFramework{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestACL_ShutdownFrameworkProtoText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedACL_ShutdownFramework(popr, true) - data := github_com_gogo_protobuf_proto1.MarshalTextString(p) - msg := &ACL_ShutdownFramework{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestACLsJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedACLs(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &ACLs{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestACL_ShutdownFrameworkProtoCompactText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedACL_ShutdownFramework(popr, true) - data := github_com_gogo_protobuf_proto1.CompactTextString(p) - msg := &ACL_ShutdownFramework{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestRateLimitJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedRateLimit(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &RateLimit{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestACLsProtoText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedACLs(popr, true) - data := github_com_gogo_protobuf_proto1.MarshalTextString(p) - msg := &ACLs{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestRateLimitsJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedRateLimits(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &RateLimits{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestACLsProtoCompactText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedACLs(popr, true) - data := github_com_gogo_protobuf_proto1.CompactTextString(p) - msg := &ACLs{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestVolumeJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedVolume(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &Volume{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestRateLimitProtoText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedRateLimit(popr, true) - data := github_com_gogo_protobuf_proto1.MarshalTextString(p) - msg := &RateLimit{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestContainerInfoJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedContainerInfo(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &ContainerInfo{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestRateLimitProtoCompactText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedRateLimit(popr, true) - data := github_com_gogo_protobuf_proto1.CompactTextString(p) - msg := &RateLimit{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestContainerInfo_DockerInfoJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedContainerInfo_DockerInfo(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &ContainerInfo_DockerInfo{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestRateLimitsProtoText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedRateLimits(popr, true) - data := github_com_gogo_protobuf_proto1.MarshalTextString(p) - msg := &RateLimits{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestContainerInfo_DockerInfo_PortMappingJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedContainerInfo_DockerInfo_PortMapping(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &ContainerInfo_DockerInfo_PortMapping{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestRateLimitsProtoCompactText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedRateLimits(popr, true) - data := github_com_gogo_protobuf_proto1.CompactTextString(p) - msg := &RateLimits{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestLabelsJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedLabels(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &Labels{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestVolumeProtoText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedVolume(popr, true) - data := github_com_gogo_protobuf_proto1.MarshalTextString(p) - msg := &Volume{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestLabelJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedLabel(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &Label{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestVolumeProtoCompactText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedVolume(popr, true) - data := github_com_gogo_protobuf_proto1.CompactTextString(p) - msg := &Volume{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestPortJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedPort(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &Port{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestContainerInfoProtoText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedContainerInfo(popr, true) - data := github_com_gogo_protobuf_proto1.MarshalTextString(p) - msg := &ContainerInfo{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestPortsJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedPorts(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &Ports{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestContainerInfoProtoCompactText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedContainerInfo(popr, true) - data := github_com_gogo_protobuf_proto1.CompactTextString(p) - msg := &ContainerInfo{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestDiscoveryInfoJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedDiscoveryInfo(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &DiscoveryInfo{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } - -func TestContainerInfo_DockerInfoProtoText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedContainerInfo_DockerInfo(popr, true) - data := github_com_gogo_protobuf_proto1.MarshalTextString(p) - msg := &ContainerInfo_DockerInfo{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestFrameworkIDProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedFrameworkID(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &FrameworkID{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestContainerInfo_DockerInfoProtoCompactText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedContainerInfo_DockerInfo(popr, true) - data := github_com_gogo_protobuf_proto1.CompactTextString(p) - msg := &ContainerInfo_DockerInfo{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestFrameworkIDProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedFrameworkID(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &FrameworkID{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestContainerInfo_DockerInfo_PortMappingProtoText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedContainerInfo_DockerInfo_PortMapping(popr, true) - data := github_com_gogo_protobuf_proto1.MarshalTextString(p) - msg := &ContainerInfo_DockerInfo_PortMapping{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestOfferIDProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedOfferID(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &OfferID{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestContainerInfo_DockerInfo_PortMappingProtoCompactText(t *testing2.T) { - popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano())) - p := NewPopulatedContainerInfo_DockerInfo_PortMapping(popr, true) - data := github_com_gogo_protobuf_proto1.CompactTextString(p) - msg := &ContainerInfo_DockerInfo_PortMapping{} - if err := github_com_gogo_protobuf_proto1.UnmarshalText(data, msg); err != nil { - panic(err) +func TestOfferIDProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedOfferID(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &OfferID{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestFrameworkIDStringer(t *testing3.T) { - popr := math_rand3.New(math_rand3.NewSource(time3.Now().UnixNano())) - p := NewPopulatedFrameworkID(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) +func TestSlaveIDProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedSlaveID(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &SlaveID{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } -} -func TestOfferIDStringer(t *testing3.T) { - popr := math_rand3.New(math_rand3.NewSource(time3.Now().UnixNano())) - p := NewPopulatedOfferID(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } -} -func TestSlaveIDStringer(t *testing3.T) { - popr := math_rand3.New(math_rand3.NewSource(time3.Now().UnixNano())) - p := NewPopulatedSlaveID(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestTaskIDStringer(t *testing3.T) { - popr := math_rand3.New(math_rand3.NewSource(time3.Now().UnixNano())) - p := NewPopulatedTaskID(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + +func TestSlaveIDProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedSlaveID(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &SlaveID{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } -} -func TestExecutorIDStringer(t *testing3.T) { - popr := math_rand3.New(math_rand3.NewSource(time3.Now().UnixNano())) - p := NewPopulatedExecutorID(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } -} -func TestContainerIDStringer(t *testing3.T) { - popr := math_rand3.New(math_rand3.NewSource(time3.Now().UnixNano())) - p := NewPopulatedContainerID(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestFrameworkInfoStringer(t *testing3.T) { - popr := math_rand3.New(math_rand3.NewSource(time3.Now().UnixNano())) - p := NewPopulatedFrameworkInfo(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + +func TestTaskIDProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedTaskID(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &TaskID{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } -} -func TestHealthCheckStringer(t *testing3.T) { - popr := math_rand3.New(math_rand3.NewSource(time3.Now().UnixNano())) - p := NewPopulatedHealthCheck(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } -} -func TestHealthCheck_HTTPStringer(t *testing3.T) { - popr := math_rand3.New(math_rand3.NewSource(time3.Now().UnixNano())) - p := NewPopulatedHealthCheck_HTTP(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestCommandInfoStringer(t *testing3.T) { - popr := math_rand3.New(math_rand3.NewSource(time3.Now().UnixNano())) - p := NewPopulatedCommandInfo(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + +func TestTaskIDProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedTaskID(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &TaskID{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } -} -func TestCommandInfo_URIStringer(t *testing3.T) { - popr := math_rand3.New(math_rand3.NewSource(time3.Now().UnixNano())) - p := NewPopulatedCommandInfo_URI(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } -} -func TestCommandInfo_ContainerInfoStringer(t *testing3.T) { - popr := math_rand3.New(math_rand3.NewSource(time3.Now().UnixNano())) - p := NewPopulatedCommandInfo_ContainerInfo(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestExecutorInfoStringer(t *testing3.T) { - popr := math_rand3.New(math_rand3.NewSource(time3.Now().UnixNano())) - p := NewPopulatedExecutorInfo(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + +func TestExecutorIDProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedExecutorID(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &ExecutorID{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } -} -func TestMasterInfoStringer(t *testing3.T) { - popr := math_rand3.New(math_rand3.NewSource(time3.Now().UnixNano())) - p := NewPopulatedMasterInfo(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } -} -func TestSlaveInfoStringer(t *testing3.T) { - popr := math_rand3.New(math_rand3.NewSource(time3.Now().UnixNano())) - p := NewPopulatedSlaveInfo(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestValueStringer(t *testing3.T) { - popr := math_rand3.New(math_rand3.NewSource(time3.Now().UnixNano())) - p := NewPopulatedValue(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + +func TestExecutorIDProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedExecutorID(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &ExecutorID{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } -} -func TestValue_ScalarStringer(t *testing3.T) { - popr := math_rand3.New(math_rand3.NewSource(time3.Now().UnixNano())) - p := NewPopulatedValue_Scalar(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } -} -func TestValue_RangeStringer(t *testing3.T) { - popr := math_rand3.New(math_rand3.NewSource(time3.Now().UnixNano())) - p := NewPopulatedValue_Range(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestValue_RangesStringer(t *testing3.T) { - popr := math_rand3.New(math_rand3.NewSource(time3.Now().UnixNano())) - p := NewPopulatedValue_Ranges(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) - } -} -func TestValue_SetStringer(t *testing3.T) { - popr := math_rand3.New(math_rand3.NewSource(time3.Now().UnixNano())) - p := NewPopulatedValue_Set(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + +func TestContainerIDProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedContainerID(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &ContainerID{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } -} -func TestValue_TextStringer(t *testing3.T) { - popr := math_rand3.New(math_rand3.NewSource(time3.Now().UnixNano())) - p := NewPopulatedValue_Text(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } -} -func TestAttributeStringer(t *testing3.T) { - popr := math_rand3.New(math_rand3.NewSource(time3.Now().UnixNano())) - p := NewPopulatedAttribute(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestResourceStringer(t *testing3.T) { - popr := math_rand3.New(math_rand3.NewSource(time3.Now().UnixNano())) - p := NewPopulatedResource(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + +func TestContainerIDProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedContainerID(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &ContainerID{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } -} -func TestResourceStatisticsStringer(t *testing3.T) { - popr := math_rand3.New(math_rand3.NewSource(time3.Now().UnixNano())) - p := NewPopulatedResourceStatistics(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } -} -func TestResourceUsageStringer(t *testing3.T) { - popr := math_rand3.New(math_rand3.NewSource(time3.Now().UnixNano())) - p := NewPopulatedResourceUsage(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestPerfStatisticsStringer(t *testing3.T) { - popr := math_rand3.New(math_rand3.NewSource(time3.Now().UnixNano())) - p := NewPopulatedPerfStatistics(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + +func TestFrameworkInfoProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedFrameworkInfo(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &FrameworkInfo{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } -} -func TestRequestStringer(t *testing3.T) { - popr := math_rand3.New(math_rand3.NewSource(time3.Now().UnixNano())) - p := NewPopulatedRequest(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } -} -func TestOfferStringer(t *testing3.T) { - popr := math_rand3.New(math_rand3.NewSource(time3.Now().UnixNano())) - p := NewPopulatedOffer(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestTaskInfoStringer(t *testing3.T) { - popr := math_rand3.New(math_rand3.NewSource(time3.Now().UnixNano())) - p := NewPopulatedTaskInfo(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + +func TestFrameworkInfoProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedFrameworkInfo(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &FrameworkInfo{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } -} -func TestTaskStatusStringer(t *testing3.T) { - popr := math_rand3.New(math_rand3.NewSource(time3.Now().UnixNano())) - p := NewPopulatedTaskStatus(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } -} -func TestFiltersStringer(t *testing3.T) { - popr := math_rand3.New(math_rand3.NewSource(time3.Now().UnixNano())) - p := NewPopulatedFilters(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestEnvironmentStringer(t *testing3.T) { - popr := math_rand3.New(math_rand3.NewSource(time3.Now().UnixNano())) - p := NewPopulatedEnvironment(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + +func TestFrameworkInfo_CapabilityProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedFrameworkInfo_Capability(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &FrameworkInfo_Capability{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } -} -func TestEnvironment_VariableStringer(t *testing3.T) { - popr := math_rand3.New(math_rand3.NewSource(time3.Now().UnixNano())) - p := NewPopulatedEnvironment_Variable(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } -} -func TestParameterStringer(t *testing3.T) { - popr := math_rand3.New(math_rand3.NewSource(time3.Now().UnixNano())) - p := NewPopulatedParameter(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestParametersStringer(t *testing3.T) { - popr := math_rand3.New(math_rand3.NewSource(time3.Now().UnixNano())) - p := NewPopulatedParameters(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + +func TestFrameworkInfo_CapabilityProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedFrameworkInfo_Capability(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &FrameworkInfo_Capability{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } -} -func TestCredentialStringer(t *testing3.T) { - popr := math_rand3.New(math_rand3.NewSource(time3.Now().UnixNano())) - p := NewPopulatedCredential(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } -} -func TestCredentialsStringer(t *testing3.T) { - popr := math_rand3.New(math_rand3.NewSource(time3.Now().UnixNano())) - p := NewPopulatedCredentials(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestACLStringer(t *testing3.T) { - popr := math_rand3.New(math_rand3.NewSource(time3.Now().UnixNano())) - p := NewPopulatedACL(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + +func TestHealthCheckProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedHealthCheck(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &HealthCheck{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } -} -func TestACL_EntityStringer(t *testing3.T) { - popr := math_rand3.New(math_rand3.NewSource(time3.Now().UnixNano())) - p := NewPopulatedACL_Entity(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } -} -func TestACL_RegisterFrameworkStringer(t *testing3.T) { - popr := math_rand3.New(math_rand3.NewSource(time3.Now().UnixNano())) - p := NewPopulatedACL_RegisterFramework(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestACL_RunTaskStringer(t *testing3.T) { - popr := math_rand3.New(math_rand3.NewSource(time3.Now().UnixNano())) - p := NewPopulatedACL_RunTask(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + +func TestHealthCheckProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedHealthCheck(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &HealthCheck{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } -} -func TestACL_ShutdownFrameworkStringer(t *testing3.T) { - popr := math_rand3.New(math_rand3.NewSource(time3.Now().UnixNano())) - p := NewPopulatedACL_ShutdownFramework(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } -} -func TestACLsStringer(t *testing3.T) { - popr := math_rand3.New(math_rand3.NewSource(time3.Now().UnixNano())) - p := NewPopulatedACLs(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestRateLimitStringer(t *testing3.T) { - popr := math_rand3.New(math_rand3.NewSource(time3.Now().UnixNano())) - p := NewPopulatedRateLimit(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + +func TestHealthCheck_HTTPProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedHealthCheck_HTTP(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &HealthCheck_HTTP{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } -} -func TestRateLimitsStringer(t *testing3.T) { - popr := math_rand3.New(math_rand3.NewSource(time3.Now().UnixNano())) - p := NewPopulatedRateLimits(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } -} -func TestVolumeStringer(t *testing3.T) { - popr := math_rand3.New(math_rand3.NewSource(time3.Now().UnixNano())) - p := NewPopulatedVolume(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestContainerInfoStringer(t *testing3.T) { - popr := math_rand3.New(math_rand3.NewSource(time3.Now().UnixNano())) - p := NewPopulatedContainerInfo(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + +func TestHealthCheck_HTTPProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedHealthCheck_HTTP(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &HealthCheck_HTTP{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } -} -func TestContainerInfo_DockerInfoStringer(t *testing3.T) { - popr := math_rand3.New(math_rand3.NewSource(time3.Now().UnixNano())) - p := NewPopulatedContainerInfo_DockerInfo(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } -} -func TestContainerInfo_DockerInfo_PortMappingStringer(t *testing3.T) { - popr := math_rand3.New(math_rand3.NewSource(time3.Now().UnixNano())) - p := NewPopulatedContainerInfo_DockerInfo_PortMapping(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestFrameworkIDSize(t *testing4.T) { - popr := math_rand4.New(math_rand4.NewSource(time4.Now().UnixNano())) - p := NewPopulatedFrameworkID(popr, true) - size2 := github_com_gogo_protobuf_proto2.Size(p) - data, err := github_com_gogo_protobuf_proto2.Marshal(p) - if err != nil { - panic(err) - } - size := p.Size() - if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) + +func TestCommandInfoProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedCommandInfo(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &CommandInfo{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } - size3 := github_com_gogo_protobuf_proto2.Size(p) - if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkFrameworkIDSize(b *testing4.B) { - popr := math_rand4.New(math_rand4.NewSource(616)) - total := 0 - pops := make([]*FrameworkID, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedFrameworkID(popr, false) +func TestCommandInfoProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedCommandInfo(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &CommandInfo{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } - b.SetBytes(int64(total / b.N)) } -func TestOfferIDSize(t *testing4.T) { - popr := math_rand4.New(math_rand4.NewSource(time4.Now().UnixNano())) - p := NewPopulatedOfferID(popr, true) - size2 := github_com_gogo_protobuf_proto2.Size(p) - data, err := github_com_gogo_protobuf_proto2.Marshal(p) - if err != nil { - panic(err) +func TestCommandInfo_URIProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedCommandInfo_URI(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &CommandInfo_URI{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - size := p.Size() - if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } - if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) - } - size3 := github_com_gogo_protobuf_proto2.Size(p) - if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkOfferIDSize(b *testing4.B) { - popr := math_rand4.New(math_rand4.NewSource(616)) - total := 0 - pops := make([]*OfferID, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedOfferID(popr, false) +func TestCommandInfo_URIProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedCommandInfo_URI(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &CommandInfo_URI{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } - b.SetBytes(int64(total / b.N)) } -func TestSlaveIDSize(t *testing4.T) { - popr := math_rand4.New(math_rand4.NewSource(time4.Now().UnixNano())) - p := NewPopulatedSlaveID(popr, true) - size2 := github_com_gogo_protobuf_proto2.Size(p) - data, err := github_com_gogo_protobuf_proto2.Marshal(p) - if err != nil { - panic(err) - } - size := p.Size() - if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) +func TestCommandInfo_ContainerInfoProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedCommandInfo_ContainerInfo(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &CommandInfo_ContainerInfo{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } - size3 := github_com_gogo_protobuf_proto2.Size(p) - if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkSlaveIDSize(b *testing4.B) { - popr := math_rand4.New(math_rand4.NewSource(616)) - total := 0 - pops := make([]*SlaveID, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedSlaveID(popr, false) +func TestCommandInfo_ContainerInfoProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedCommandInfo_ContainerInfo(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &CommandInfo_ContainerInfo{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } - b.SetBytes(int64(total / b.N)) } -func TestTaskIDSize(t *testing4.T) { - popr := math_rand4.New(math_rand4.NewSource(time4.Now().UnixNano())) - p := NewPopulatedTaskID(popr, true) - size2 := github_com_gogo_protobuf_proto2.Size(p) - data, err := github_com_gogo_protobuf_proto2.Marshal(p) - if err != nil { - panic(err) - } - size := p.Size() - if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) +func TestExecutorInfoProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedExecutorInfo(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &ExecutorInfo{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } - size3 := github_com_gogo_protobuf_proto2.Size(p) - if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkTaskIDSize(b *testing4.B) { - popr := math_rand4.New(math_rand4.NewSource(616)) - total := 0 - pops := make([]*TaskID, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedTaskID(popr, false) +func TestExecutorInfoProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedExecutorInfo(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &ExecutorInfo{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } - b.SetBytes(int64(total / b.N)) } -func TestExecutorIDSize(t *testing4.T) { - popr := math_rand4.New(math_rand4.NewSource(time4.Now().UnixNano())) - p := NewPopulatedExecutorID(popr, true) - size2 := github_com_gogo_protobuf_proto2.Size(p) - data, err := github_com_gogo_protobuf_proto2.Marshal(p) - if err != nil { - panic(err) - } - size := p.Size() - if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) +func TestMasterInfoProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedMasterInfo(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &MasterInfo{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } - size3 := github_com_gogo_protobuf_proto2.Size(p) - if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkExecutorIDSize(b *testing4.B) { - popr := math_rand4.New(math_rand4.NewSource(616)) - total := 0 - pops := make([]*ExecutorID, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedExecutorID(popr, false) +func TestMasterInfoProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedMasterInfo(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &MasterInfo{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } - b.SetBytes(int64(total / b.N)) } -func TestContainerIDSize(t *testing4.T) { - popr := math_rand4.New(math_rand4.NewSource(time4.Now().UnixNano())) - p := NewPopulatedContainerID(popr, true) - size2 := github_com_gogo_protobuf_proto2.Size(p) - data, err := github_com_gogo_protobuf_proto2.Marshal(p) - if err != nil { - panic(err) - } - size := p.Size() - if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) +func TestSlaveInfoProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedSlaveInfo(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &SlaveInfo{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } - size3 := github_com_gogo_protobuf_proto2.Size(p) - if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkContainerIDSize(b *testing4.B) { - popr := math_rand4.New(math_rand4.NewSource(616)) - total := 0 - pops := make([]*ContainerID, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedContainerID(popr, false) +func TestSlaveInfoProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedSlaveInfo(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &SlaveInfo{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } - b.SetBytes(int64(total / b.N)) } -func TestFrameworkInfoSize(t *testing4.T) { - popr := math_rand4.New(math_rand4.NewSource(time4.Now().UnixNano())) - p := NewPopulatedFrameworkInfo(popr, true) - size2 := github_com_gogo_protobuf_proto2.Size(p) - data, err := github_com_gogo_protobuf_proto2.Marshal(p) - if err != nil { - panic(err) - } - size := p.Size() - if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) +func TestValueProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedValue(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &Value{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } - size3 := github_com_gogo_protobuf_proto2.Size(p) - if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkFrameworkInfoSize(b *testing4.B) { - popr := math_rand4.New(math_rand4.NewSource(616)) - total := 0 - pops := make([]*FrameworkInfo, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedFrameworkInfo(popr, false) +func TestValueProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedValue(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &Value{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } - b.SetBytes(int64(total / b.N)) } -func TestHealthCheckSize(t *testing4.T) { - popr := math_rand4.New(math_rand4.NewSource(time4.Now().UnixNano())) - p := NewPopulatedHealthCheck(popr, true) - size2 := github_com_gogo_protobuf_proto2.Size(p) - data, err := github_com_gogo_protobuf_proto2.Marshal(p) - if err != nil { - panic(err) - } - size := p.Size() - if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) +func TestValue_ScalarProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedValue_Scalar(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &Value_Scalar{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } - size3 := github_com_gogo_protobuf_proto2.Size(p) - if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkHealthCheckSize(b *testing4.B) { - popr := math_rand4.New(math_rand4.NewSource(616)) - total := 0 - pops := make([]*HealthCheck, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedHealthCheck(popr, false) +func TestValue_ScalarProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedValue_Scalar(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &Value_Scalar{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } - b.SetBytes(int64(total / b.N)) } -func TestHealthCheck_HTTPSize(t *testing4.T) { - popr := math_rand4.New(math_rand4.NewSource(time4.Now().UnixNano())) - p := NewPopulatedHealthCheck_HTTP(popr, true) - size2 := github_com_gogo_protobuf_proto2.Size(p) - data, err := github_com_gogo_protobuf_proto2.Marshal(p) - if err != nil { - panic(err) - } - size := p.Size() - if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) +func TestValue_RangeProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedValue_Range(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &Value_Range{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } - size3 := github_com_gogo_protobuf_proto2.Size(p) - if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkHealthCheck_HTTPSize(b *testing4.B) { - popr := math_rand4.New(math_rand4.NewSource(616)) - total := 0 - pops := make([]*HealthCheck_HTTP, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedHealthCheck_HTTP(popr, false) +func TestValue_RangeProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedValue_Range(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &Value_Range{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } - b.SetBytes(int64(total / b.N)) } -func TestCommandInfoSize(t *testing4.T) { - popr := math_rand4.New(math_rand4.NewSource(time4.Now().UnixNano())) - p := NewPopulatedCommandInfo(popr, true) - size2 := github_com_gogo_protobuf_proto2.Size(p) - data, err := github_com_gogo_protobuf_proto2.Marshal(p) - if err != nil { - panic(err) - } - size := p.Size() - if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) +func TestValue_RangesProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedValue_Ranges(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &Value_Ranges{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } - size3 := github_com_gogo_protobuf_proto2.Size(p) - if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkCommandInfoSize(b *testing4.B) { - popr := math_rand4.New(math_rand4.NewSource(616)) - total := 0 - pops := make([]*CommandInfo, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedCommandInfo(popr, false) +func TestValue_RangesProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedValue_Ranges(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &Value_Ranges{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } - b.SetBytes(int64(total / b.N)) } -func TestCommandInfo_URISize(t *testing4.T) { - popr := math_rand4.New(math_rand4.NewSource(time4.Now().UnixNano())) - p := NewPopulatedCommandInfo_URI(popr, true) - size2 := github_com_gogo_protobuf_proto2.Size(p) - data, err := github_com_gogo_protobuf_proto2.Marshal(p) - if err != nil { - panic(err) - } - size := p.Size() - if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) +func TestValue_SetProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedValue_Set(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &Value_Set{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } - size3 := github_com_gogo_protobuf_proto2.Size(p) - if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkCommandInfo_URISize(b *testing4.B) { - popr := math_rand4.New(math_rand4.NewSource(616)) - total := 0 - pops := make([]*CommandInfo_URI, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedCommandInfo_URI(popr, false) +func TestValue_SetProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedValue_Set(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &Value_Set{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } - b.SetBytes(int64(total / b.N)) } -func TestCommandInfo_ContainerInfoSize(t *testing4.T) { - popr := math_rand4.New(math_rand4.NewSource(time4.Now().UnixNano())) - p := NewPopulatedCommandInfo_ContainerInfo(popr, true) - size2 := github_com_gogo_protobuf_proto2.Size(p) - data, err := github_com_gogo_protobuf_proto2.Marshal(p) - if err != nil { - panic(err) - } - size := p.Size() - if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) +func TestValue_TextProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedValue_Text(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &Value_Text{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } - size3 := github_com_gogo_protobuf_proto2.Size(p) - if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkCommandInfo_ContainerInfoSize(b *testing4.B) { - popr := math_rand4.New(math_rand4.NewSource(616)) - total := 0 - pops := make([]*CommandInfo_ContainerInfo, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedCommandInfo_ContainerInfo(popr, false) +func TestValue_TextProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedValue_Text(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &Value_Text{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } - b.SetBytes(int64(total / b.N)) } -func TestExecutorInfoSize(t *testing4.T) { - popr := math_rand4.New(math_rand4.NewSource(time4.Now().UnixNano())) - p := NewPopulatedExecutorInfo(popr, true) - size2 := github_com_gogo_protobuf_proto2.Size(p) - data, err := github_com_gogo_protobuf_proto2.Marshal(p) - if err != nil { - panic(err) - } - size := p.Size() - if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) +func TestAttributeProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedAttribute(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &Attribute{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } - size3 := github_com_gogo_protobuf_proto2.Size(p) - if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkExecutorInfoSize(b *testing4.B) { - popr := math_rand4.New(math_rand4.NewSource(616)) - total := 0 - pops := make([]*ExecutorInfo, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedExecutorInfo(popr, false) +func TestAttributeProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedAttribute(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &Attribute{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } - b.SetBytes(int64(total / b.N)) } -func TestMasterInfoSize(t *testing4.T) { - popr := math_rand4.New(math_rand4.NewSource(time4.Now().UnixNano())) - p := NewPopulatedMasterInfo(popr, true) - size2 := github_com_gogo_protobuf_proto2.Size(p) - data, err := github_com_gogo_protobuf_proto2.Marshal(p) - if err != nil { - panic(err) - } - size := p.Size() - if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) +func TestResourceProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedResource(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &Resource{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } - size3 := github_com_gogo_protobuf_proto2.Size(p) - if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkMasterInfoSize(b *testing4.B) { - popr := math_rand4.New(math_rand4.NewSource(616)) - total := 0 - pops := make([]*MasterInfo, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedMasterInfo(popr, false) +func TestResourceProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedResource(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &Resource{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } - b.SetBytes(int64(total / b.N)) } -func TestSlaveInfoSize(t *testing4.T) { - popr := math_rand4.New(math_rand4.NewSource(time4.Now().UnixNano())) - p := NewPopulatedSlaveInfo(popr, true) - size2 := github_com_gogo_protobuf_proto2.Size(p) - data, err := github_com_gogo_protobuf_proto2.Marshal(p) - if err != nil { - panic(err) +func TestResource_ReservationInfoProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedResource_ReservationInfo(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &Resource_ReservationInfo{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - size := p.Size() - if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) - } - if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } - size3 := github_com_gogo_protobuf_proto2.Size(p) - if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkSlaveInfoSize(b *testing4.B) { - popr := math_rand4.New(math_rand4.NewSource(616)) - total := 0 - pops := make([]*SlaveInfo, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedSlaveInfo(popr, false) +func TestResource_ReservationInfoProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedResource_ReservationInfo(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &Resource_ReservationInfo{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } - b.SetBytes(int64(total / b.N)) } -func TestValueSize(t *testing4.T) { - popr := math_rand4.New(math_rand4.NewSource(time4.Now().UnixNano())) - p := NewPopulatedValue(popr, true) - size2 := github_com_gogo_protobuf_proto2.Size(p) - data, err := github_com_gogo_protobuf_proto2.Marshal(p) - if err != nil { - panic(err) - } - size := p.Size() - if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) +func TestResource_DiskInfoProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedResource_DiskInfo(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &Resource_DiskInfo{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } - size3 := github_com_gogo_protobuf_proto2.Size(p) - if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkValueSize(b *testing4.B) { - popr := math_rand4.New(math_rand4.NewSource(616)) - total := 0 - pops := make([]*Value, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedValue(popr, false) +func TestResource_DiskInfoProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedResource_DiskInfo(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &Resource_DiskInfo{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } - b.SetBytes(int64(total / b.N)) } -func TestValue_ScalarSize(t *testing4.T) { - popr := math_rand4.New(math_rand4.NewSource(time4.Now().UnixNano())) - p := NewPopulatedValue_Scalar(popr, true) - size2 := github_com_gogo_protobuf_proto2.Size(p) - data, err := github_com_gogo_protobuf_proto2.Marshal(p) - if err != nil { - panic(err) - } - size := p.Size() - if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) +func TestResource_DiskInfo_PersistenceProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedResource_DiskInfo_Persistence(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &Resource_DiskInfo_Persistence{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } - size3 := github_com_gogo_protobuf_proto2.Size(p) - if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkValue_ScalarSize(b *testing4.B) { - popr := math_rand4.New(math_rand4.NewSource(616)) - total := 0 - pops := make([]*Value_Scalar, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedValue_Scalar(popr, false) +func TestResource_DiskInfo_PersistenceProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedResource_DiskInfo_Persistence(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &Resource_DiskInfo_Persistence{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } - b.SetBytes(int64(total / b.N)) } -func TestValue_RangeSize(t *testing4.T) { - popr := math_rand4.New(math_rand4.NewSource(time4.Now().UnixNano())) - p := NewPopulatedValue_Range(popr, true) - size2 := github_com_gogo_protobuf_proto2.Size(p) - data, err := github_com_gogo_protobuf_proto2.Marshal(p) - if err != nil { - panic(err) - } - size := p.Size() - if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) +func TestResource_RevocableInfoProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedResource_RevocableInfo(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &Resource_RevocableInfo{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } - size3 := github_com_gogo_protobuf_proto2.Size(p) - if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkValue_RangeSize(b *testing4.B) { - popr := math_rand4.New(math_rand4.NewSource(616)) - total := 0 - pops := make([]*Value_Range, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedValue_Range(popr, false) +func TestResource_RevocableInfoProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedResource_RevocableInfo(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &Resource_RevocableInfo{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } - b.SetBytes(int64(total / b.N)) } -func TestValue_RangesSize(t *testing4.T) { - popr := math_rand4.New(math_rand4.NewSource(time4.Now().UnixNano())) - p := NewPopulatedValue_Ranges(popr, true) - size2 := github_com_gogo_protobuf_proto2.Size(p) - data, err := github_com_gogo_protobuf_proto2.Marshal(p) - if err != nil { - panic(err) +func TestTrafficControlStatisticsProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedTrafficControlStatistics(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &TrafficControlStatistics{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - size := p.Size() - if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) - } - if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } - size3 := github_com_gogo_protobuf_proto2.Size(p) - if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkValue_RangesSize(b *testing4.B) { - popr := math_rand4.New(math_rand4.NewSource(616)) - total := 0 - pops := make([]*Value_Ranges, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedValue_Ranges(popr, false) +func TestTrafficControlStatisticsProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedTrafficControlStatistics(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &TrafficControlStatistics{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } - b.SetBytes(int64(total / b.N)) } -func TestValue_SetSize(t *testing4.T) { - popr := math_rand4.New(math_rand4.NewSource(time4.Now().UnixNano())) - p := NewPopulatedValue_Set(popr, true) - size2 := github_com_gogo_protobuf_proto2.Size(p) - data, err := github_com_gogo_protobuf_proto2.Marshal(p) - if err != nil { - panic(err) - } - size := p.Size() - if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) +func TestResourceStatisticsProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedResourceStatistics(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &ResourceStatistics{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } - size3 := github_com_gogo_protobuf_proto2.Size(p) - if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkValue_SetSize(b *testing4.B) { - popr := math_rand4.New(math_rand4.NewSource(616)) - total := 0 - pops := make([]*Value_Set, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedValue_Set(popr, false) +func TestResourceStatisticsProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedResourceStatistics(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &ResourceStatistics{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } - b.SetBytes(int64(total / b.N)) } -func TestValue_TextSize(t *testing4.T) { - popr := math_rand4.New(math_rand4.NewSource(time4.Now().UnixNano())) - p := NewPopulatedValue_Text(popr, true) - size2 := github_com_gogo_protobuf_proto2.Size(p) - data, err := github_com_gogo_protobuf_proto2.Marshal(p) - if err != nil { - panic(err) - } - size := p.Size() - if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) +func TestResourceUsageProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedResourceUsage(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &ResourceUsage{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } - size3 := github_com_gogo_protobuf_proto2.Size(p) - if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkValue_TextSize(b *testing4.B) { - popr := math_rand4.New(math_rand4.NewSource(616)) - total := 0 - pops := make([]*Value_Text, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedValue_Text(popr, false) +func TestResourceUsageProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedResourceUsage(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &ResourceUsage{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } - b.SetBytes(int64(total / b.N)) } -func TestAttributeSize(t *testing4.T) { - popr := math_rand4.New(math_rand4.NewSource(time4.Now().UnixNano())) - p := NewPopulatedAttribute(popr, true) - size2 := github_com_gogo_protobuf_proto2.Size(p) - data, err := github_com_gogo_protobuf_proto2.Marshal(p) - if err != nil { - panic(err) - } - size := p.Size() - if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) +func TestResourceUsage_ExecutorProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedResourceUsage_Executor(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &ResourceUsage_Executor{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } - size3 := github_com_gogo_protobuf_proto2.Size(p) - if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkAttributeSize(b *testing4.B) { - popr := math_rand4.New(math_rand4.NewSource(616)) - total := 0 - pops := make([]*Attribute, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedAttribute(popr, false) +func TestResourceUsage_ExecutorProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedResourceUsage_Executor(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &ResourceUsage_Executor{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } - b.SetBytes(int64(total / b.N)) } -func TestResourceSize(t *testing4.T) { - popr := math_rand4.New(math_rand4.NewSource(time4.Now().UnixNano())) - p := NewPopulatedResource(popr, true) - size2 := github_com_gogo_protobuf_proto2.Size(p) - data, err := github_com_gogo_protobuf_proto2.Marshal(p) - if err != nil { - panic(err) - } - size := p.Size() - if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) +func TestPerfStatisticsProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedPerfStatistics(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &PerfStatistics{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } - size3 := github_com_gogo_protobuf_proto2.Size(p) - if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkResourceSize(b *testing4.B) { - popr := math_rand4.New(math_rand4.NewSource(616)) - total := 0 - pops := make([]*Resource, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedResource(popr, false) +func TestPerfStatisticsProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedPerfStatistics(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &PerfStatistics{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } - b.SetBytes(int64(total / b.N)) } -func TestResourceStatisticsSize(t *testing4.T) { - popr := math_rand4.New(math_rand4.NewSource(time4.Now().UnixNano())) - p := NewPopulatedResourceStatistics(popr, true) - size2 := github_com_gogo_protobuf_proto2.Size(p) - data, err := github_com_gogo_protobuf_proto2.Marshal(p) - if err != nil { - panic(err) - } - size := p.Size() - if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) +func TestRequestProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedRequest(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &Request{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } - size3 := github_com_gogo_protobuf_proto2.Size(p) - if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkResourceStatisticsSize(b *testing4.B) { - popr := math_rand4.New(math_rand4.NewSource(616)) - total := 0 - pops := make([]*ResourceStatistics, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedResourceStatistics(popr, false) +func TestRequestProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedRequest(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &Request{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } - b.SetBytes(int64(total / b.N)) } -func TestResourceUsageSize(t *testing4.T) { - popr := math_rand4.New(math_rand4.NewSource(time4.Now().UnixNano())) - p := NewPopulatedResourceUsage(popr, true) - size2 := github_com_gogo_protobuf_proto2.Size(p) - data, err := github_com_gogo_protobuf_proto2.Marshal(p) - if err != nil { - panic(err) - } - size := p.Size() - if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) +func TestOfferProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedOffer(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &Offer{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } - size3 := github_com_gogo_protobuf_proto2.Size(p) - if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkResourceUsageSize(b *testing4.B) { - popr := math_rand4.New(math_rand4.NewSource(616)) - total := 0 - pops := make([]*ResourceUsage, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedResourceUsage(popr, false) +func TestOfferProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedOffer(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &Offer{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } - b.SetBytes(int64(total / b.N)) } -func TestPerfStatisticsSize(t *testing4.T) { - popr := math_rand4.New(math_rand4.NewSource(time4.Now().UnixNano())) - p := NewPopulatedPerfStatistics(popr, true) - size2 := github_com_gogo_protobuf_proto2.Size(p) - data, err := github_com_gogo_protobuf_proto2.Marshal(p) - if err != nil { - panic(err) - } - size := p.Size() - if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) +func TestOffer_OperationProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedOffer_Operation(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &Offer_Operation{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } - size3 := github_com_gogo_protobuf_proto2.Size(p) - if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkPerfStatisticsSize(b *testing4.B) { - popr := math_rand4.New(math_rand4.NewSource(616)) - total := 0 - pops := make([]*PerfStatistics, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedPerfStatistics(popr, false) +func TestOffer_OperationProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedOffer_Operation(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &Offer_Operation{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } - b.SetBytes(int64(total / b.N)) } -func TestRequestSize(t *testing4.T) { - popr := math_rand4.New(math_rand4.NewSource(time4.Now().UnixNano())) - p := NewPopulatedRequest(popr, true) - size2 := github_com_gogo_protobuf_proto2.Size(p) - data, err := github_com_gogo_protobuf_proto2.Marshal(p) - if err != nil { - panic(err) +func TestOffer_Operation_LaunchProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedOffer_Operation_Launch(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &Offer_Operation_Launch{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - size := p.Size() - if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) - } - if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } - size3 := github_com_gogo_protobuf_proto2.Size(p) - if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkRequestSize(b *testing4.B) { - popr := math_rand4.New(math_rand4.NewSource(616)) - total := 0 - pops := make([]*Request, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedRequest(popr, false) +func TestOffer_Operation_LaunchProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedOffer_Operation_Launch(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &Offer_Operation_Launch{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } - b.SetBytes(int64(total / b.N)) } -func TestOfferSize(t *testing4.T) { - popr := math_rand4.New(math_rand4.NewSource(time4.Now().UnixNano())) - p := NewPopulatedOffer(popr, true) - size2 := github_com_gogo_protobuf_proto2.Size(p) - data, err := github_com_gogo_protobuf_proto2.Marshal(p) - if err != nil { - panic(err) - } - size := p.Size() - if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) +func TestOffer_Operation_ReserveProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedOffer_Operation_Reserve(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &Offer_Operation_Reserve{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } - size3 := github_com_gogo_protobuf_proto2.Size(p) - if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkOfferSize(b *testing4.B) { - popr := math_rand4.New(math_rand4.NewSource(616)) - total := 0 - pops := make([]*Offer, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedOffer(popr, false) +func TestOffer_Operation_ReserveProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedOffer_Operation_Reserve(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &Offer_Operation_Reserve{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } - b.SetBytes(int64(total / b.N)) } -func TestTaskInfoSize(t *testing4.T) { - popr := math_rand4.New(math_rand4.NewSource(time4.Now().UnixNano())) - p := NewPopulatedTaskInfo(popr, true) - size2 := github_com_gogo_protobuf_proto2.Size(p) - data, err := github_com_gogo_protobuf_proto2.Marshal(p) - if err != nil { - panic(err) - } - size := p.Size() - if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) +func TestOffer_Operation_UnreserveProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedOffer_Operation_Unreserve(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &Offer_Operation_Unreserve{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } - size3 := github_com_gogo_protobuf_proto2.Size(p) - if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkTaskInfoSize(b *testing4.B) { - popr := math_rand4.New(math_rand4.NewSource(616)) - total := 0 - pops := make([]*TaskInfo, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedTaskInfo(popr, false) +func TestOffer_Operation_UnreserveProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedOffer_Operation_Unreserve(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &Offer_Operation_Unreserve{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } - b.SetBytes(int64(total / b.N)) } -func TestTaskStatusSize(t *testing4.T) { - popr := math_rand4.New(math_rand4.NewSource(time4.Now().UnixNano())) - p := NewPopulatedTaskStatus(popr, true) - size2 := github_com_gogo_protobuf_proto2.Size(p) - data, err := github_com_gogo_protobuf_proto2.Marshal(p) - if err != nil { - panic(err) - } - size := p.Size() - if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) +func TestOffer_Operation_CreateProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedOffer_Operation_Create(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &Offer_Operation_Create{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } - size3 := github_com_gogo_protobuf_proto2.Size(p) - if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkTaskStatusSize(b *testing4.B) { - popr := math_rand4.New(math_rand4.NewSource(616)) - total := 0 - pops := make([]*TaskStatus, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedTaskStatus(popr, false) +func TestOffer_Operation_CreateProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedOffer_Operation_Create(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &Offer_Operation_Create{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } - b.SetBytes(int64(total / b.N)) } -func TestFiltersSize(t *testing4.T) { - popr := math_rand4.New(math_rand4.NewSource(time4.Now().UnixNano())) - p := NewPopulatedFilters(popr, true) - size2 := github_com_gogo_protobuf_proto2.Size(p) - data, err := github_com_gogo_protobuf_proto2.Marshal(p) - if err != nil { - panic(err) +func TestOffer_Operation_DestroyProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedOffer_Operation_Destroy(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &Offer_Operation_Destroy{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - size := p.Size() - if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) - } - if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } - size3 := github_com_gogo_protobuf_proto2.Size(p) - if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkFiltersSize(b *testing4.B) { - popr := math_rand4.New(math_rand4.NewSource(616)) - total := 0 - pops := make([]*Filters, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedFilters(popr, false) +func TestOffer_Operation_DestroyProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedOffer_Operation_Destroy(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &Offer_Operation_Destroy{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } - b.SetBytes(int64(total / b.N)) } -func TestEnvironmentSize(t *testing4.T) { - popr := math_rand4.New(math_rand4.NewSource(time4.Now().UnixNano())) - p := NewPopulatedEnvironment(popr, true) - size2 := github_com_gogo_protobuf_proto2.Size(p) - data, err := github_com_gogo_protobuf_proto2.Marshal(p) - if err != nil { - panic(err) - } - size := p.Size() - if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) +func TestTaskInfoProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedTaskInfo(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &TaskInfo{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } - size3 := github_com_gogo_protobuf_proto2.Size(p) - if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkEnvironmentSize(b *testing4.B) { - popr := math_rand4.New(math_rand4.NewSource(616)) - total := 0 - pops := make([]*Environment, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedEnvironment(popr, false) +func TestTaskInfoProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedTaskInfo(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &TaskInfo{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } - b.SetBytes(int64(total / b.N)) } -func TestEnvironment_VariableSize(t *testing4.T) { - popr := math_rand4.New(math_rand4.NewSource(time4.Now().UnixNano())) - p := NewPopulatedEnvironment_Variable(popr, true) - size2 := github_com_gogo_protobuf_proto2.Size(p) - data, err := github_com_gogo_protobuf_proto2.Marshal(p) - if err != nil { - panic(err) - } - size := p.Size() - if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) +func TestTaskStatusProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedTaskStatus(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &TaskStatus{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } - size3 := github_com_gogo_protobuf_proto2.Size(p) - if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkEnvironment_VariableSize(b *testing4.B) { - popr := math_rand4.New(math_rand4.NewSource(616)) - total := 0 - pops := make([]*Environment_Variable, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedEnvironment_Variable(popr, false) +func TestTaskStatusProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedTaskStatus(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &TaskStatus{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } - b.SetBytes(int64(total / b.N)) } -func TestParameterSize(t *testing4.T) { - popr := math_rand4.New(math_rand4.NewSource(time4.Now().UnixNano())) - p := NewPopulatedParameter(popr, true) - size2 := github_com_gogo_protobuf_proto2.Size(p) - data, err := github_com_gogo_protobuf_proto2.Marshal(p) - if err != nil { - panic(err) - } - size := p.Size() - if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) +func TestFiltersProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedFilters(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &Filters{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } - size3 := github_com_gogo_protobuf_proto2.Size(p) - if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkParameterSize(b *testing4.B) { - popr := math_rand4.New(math_rand4.NewSource(616)) - total := 0 - pops := make([]*Parameter, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedParameter(popr, false) +func TestFiltersProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedFilters(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &Filters{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } - b.SetBytes(int64(total / b.N)) -} - -func TestParametersSize(t *testing4.T) { - popr := math_rand4.New(math_rand4.NewSource(time4.Now().UnixNano())) - p := NewPopulatedParameters(popr, true) - size2 := github_com_gogo_protobuf_proto2.Size(p) - data, err := github_com_gogo_protobuf_proto2.Marshal(p) - if err != nil { - panic(err) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } - size := p.Size() - if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) +} + +func TestEnvironmentProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedEnvironment(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &Environment{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } - size3 := github_com_gogo_protobuf_proto2.Size(p) - if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkParametersSize(b *testing4.B) { - popr := math_rand4.New(math_rand4.NewSource(616)) - total := 0 - pops := make([]*Parameters, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedParameters(popr, false) +func TestEnvironmentProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedEnvironment(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &Environment{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } - b.SetBytes(int64(total / b.N)) } -func TestCredentialSize(t *testing4.T) { - popr := math_rand4.New(math_rand4.NewSource(time4.Now().UnixNano())) - p := NewPopulatedCredential(popr, true) - size2 := github_com_gogo_protobuf_proto2.Size(p) - data, err := github_com_gogo_protobuf_proto2.Marshal(p) - if err != nil { - panic(err) - } - size := p.Size() - if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) +func TestEnvironment_VariableProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedEnvironment_Variable(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &Environment_Variable{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } - size3 := github_com_gogo_protobuf_proto2.Size(p) - if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkCredentialSize(b *testing4.B) { - popr := math_rand4.New(math_rand4.NewSource(616)) - total := 0 - pops := make([]*Credential, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedCredential(popr, false) +func TestEnvironment_VariableProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedEnvironment_Variable(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &Environment_Variable{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } - b.SetBytes(int64(total / b.N)) } -func TestCredentialsSize(t *testing4.T) { - popr := math_rand4.New(math_rand4.NewSource(time4.Now().UnixNano())) - p := NewPopulatedCredentials(popr, true) - size2 := github_com_gogo_protobuf_proto2.Size(p) - data, err := github_com_gogo_protobuf_proto2.Marshal(p) - if err != nil { - panic(err) - } - size := p.Size() - if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) +func TestParameterProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedParameter(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &Parameter{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } - size3 := github_com_gogo_protobuf_proto2.Size(p) - if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkCredentialsSize(b *testing4.B) { - popr := math_rand4.New(math_rand4.NewSource(616)) - total := 0 - pops := make([]*Credentials, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedCredentials(popr, false) +func TestParameterProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedParameter(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &Parameter{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } - b.SetBytes(int64(total / b.N)) } -func TestACLSize(t *testing4.T) { - popr := math_rand4.New(math_rand4.NewSource(time4.Now().UnixNano())) - p := NewPopulatedACL(popr, true) - size2 := github_com_gogo_protobuf_proto2.Size(p) - data, err := github_com_gogo_protobuf_proto2.Marshal(p) - if err != nil { - panic(err) - } - size := p.Size() - if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) +func TestParametersProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedParameters(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &Parameters{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } - size3 := github_com_gogo_protobuf_proto2.Size(p) - if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkACLSize(b *testing4.B) { - popr := math_rand4.New(math_rand4.NewSource(616)) - total := 0 - pops := make([]*ACL, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedACL(popr, false) +func TestParametersProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedParameters(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &Parameters{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } - b.SetBytes(int64(total / b.N)) } -func TestACL_EntitySize(t *testing4.T) { - popr := math_rand4.New(math_rand4.NewSource(time4.Now().UnixNano())) - p := NewPopulatedACL_Entity(popr, true) - size2 := github_com_gogo_protobuf_proto2.Size(p) - data, err := github_com_gogo_protobuf_proto2.Marshal(p) - if err != nil { - panic(err) - } - size := p.Size() - if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) +func TestCredentialProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedCredential(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &Credential{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } - size3 := github_com_gogo_protobuf_proto2.Size(p) - if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkACL_EntitySize(b *testing4.B) { - popr := math_rand4.New(math_rand4.NewSource(616)) - total := 0 - pops := make([]*ACL_Entity, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedACL_Entity(popr, false) +func TestCredentialProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedCredential(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &Credential{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } - b.SetBytes(int64(total / b.N)) } -func TestACL_RegisterFrameworkSize(t *testing4.T) { - popr := math_rand4.New(math_rand4.NewSource(time4.Now().UnixNano())) - p := NewPopulatedACL_RegisterFramework(popr, true) - size2 := github_com_gogo_protobuf_proto2.Size(p) - data, err := github_com_gogo_protobuf_proto2.Marshal(p) - if err != nil { - panic(err) - } - size := p.Size() - if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) +func TestCredentialsProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedCredentials(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &Credentials{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } - size3 := github_com_gogo_protobuf_proto2.Size(p) - if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkACL_RegisterFrameworkSize(b *testing4.B) { - popr := math_rand4.New(math_rand4.NewSource(616)) - total := 0 - pops := make([]*ACL_RegisterFramework, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedACL_RegisterFramework(popr, false) +func TestCredentialsProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedCredentials(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &Credentials{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } - b.SetBytes(int64(total / b.N)) } -func TestACL_RunTaskSize(t *testing4.T) { - popr := math_rand4.New(math_rand4.NewSource(time4.Now().UnixNano())) - p := NewPopulatedACL_RunTask(popr, true) - size2 := github_com_gogo_protobuf_proto2.Size(p) - data, err := github_com_gogo_protobuf_proto2.Marshal(p) - if err != nil { - panic(err) - } - size := p.Size() - if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) +func TestACLProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedACL(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &ACL{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } - size3 := github_com_gogo_protobuf_proto2.Size(p) - if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkACL_RunTaskSize(b *testing4.B) { - popr := math_rand4.New(math_rand4.NewSource(616)) - total := 0 - pops := make([]*ACL_RunTask, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedACL_RunTask(popr, false) +func TestACLProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedACL(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &ACL{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } - b.SetBytes(int64(total / b.N)) } -func TestACL_ShutdownFrameworkSize(t *testing4.T) { - popr := math_rand4.New(math_rand4.NewSource(time4.Now().UnixNano())) - p := NewPopulatedACL_ShutdownFramework(popr, true) - size2 := github_com_gogo_protobuf_proto2.Size(p) - data, err := github_com_gogo_protobuf_proto2.Marshal(p) - if err != nil { - panic(err) - } - size := p.Size() - if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) +func TestACL_EntityProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedACL_Entity(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &ACL_Entity{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } - size3 := github_com_gogo_protobuf_proto2.Size(p) - if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkACL_ShutdownFrameworkSize(b *testing4.B) { - popr := math_rand4.New(math_rand4.NewSource(616)) - total := 0 - pops := make([]*ACL_ShutdownFramework, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedACL_ShutdownFramework(popr, false) +func TestACL_EntityProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedACL_Entity(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &ACL_Entity{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } - b.SetBytes(int64(total / b.N)) } -func TestACLsSize(t *testing4.T) { - popr := math_rand4.New(math_rand4.NewSource(time4.Now().UnixNano())) - p := NewPopulatedACLs(popr, true) - size2 := github_com_gogo_protobuf_proto2.Size(p) - data, err := github_com_gogo_protobuf_proto2.Marshal(p) - if err != nil { - panic(err) - } - size := p.Size() - if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) +func TestACL_RegisterFrameworkProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedACL_RegisterFramework(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &ACL_RegisterFramework{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } - size3 := github_com_gogo_protobuf_proto2.Size(p) - if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkACLsSize(b *testing4.B) { - popr := math_rand4.New(math_rand4.NewSource(616)) - total := 0 - pops := make([]*ACLs, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedACLs(popr, false) +func TestACL_RegisterFrameworkProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedACL_RegisterFramework(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &ACL_RegisterFramework{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } - b.SetBytes(int64(total / b.N)) } -func TestRateLimitSize(t *testing4.T) { - popr := math_rand4.New(math_rand4.NewSource(time4.Now().UnixNano())) - p := NewPopulatedRateLimit(popr, true) - size2 := github_com_gogo_protobuf_proto2.Size(p) - data, err := github_com_gogo_protobuf_proto2.Marshal(p) - if err != nil { - panic(err) - } - size := p.Size() - if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) +func TestACL_RunTaskProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedACL_RunTask(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &ACL_RunTask{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } - size3 := github_com_gogo_protobuf_proto2.Size(p) - if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkRateLimitSize(b *testing4.B) { - popr := math_rand4.New(math_rand4.NewSource(616)) - total := 0 - pops := make([]*RateLimit, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedRateLimit(popr, false) +func TestACL_RunTaskProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedACL_RunTask(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &ACL_RunTask{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } - b.SetBytes(int64(total / b.N)) } -func TestRateLimitsSize(t *testing4.T) { - popr := math_rand4.New(math_rand4.NewSource(time4.Now().UnixNano())) - p := NewPopulatedRateLimits(popr, true) - size2 := github_com_gogo_protobuf_proto2.Size(p) - data, err := github_com_gogo_protobuf_proto2.Marshal(p) - if err != nil { - panic(err) - } - size := p.Size() - if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) +func TestACL_ShutdownFrameworkProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedACL_ShutdownFramework(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &ACL_ShutdownFramework{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } - size3 := github_com_gogo_protobuf_proto2.Size(p) - if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkRateLimitsSize(b *testing4.B) { - popr := math_rand4.New(math_rand4.NewSource(616)) - total := 0 - pops := make([]*RateLimits, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedRateLimits(popr, false) +func TestACL_ShutdownFrameworkProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedACL_ShutdownFramework(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &ACL_ShutdownFramework{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } - b.SetBytes(int64(total / b.N)) } -func TestVolumeSize(t *testing4.T) { - popr := math_rand4.New(math_rand4.NewSource(time4.Now().UnixNano())) - p := NewPopulatedVolume(popr, true) - size2 := github_com_gogo_protobuf_proto2.Size(p) - data, err := github_com_gogo_protobuf_proto2.Marshal(p) - if err != nil { - panic(err) - } - size := p.Size() - if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) +func TestACLsProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedACLs(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &ACLs{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } - size3 := github_com_gogo_protobuf_proto2.Size(p) - if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkVolumeSize(b *testing4.B) { - popr := math_rand4.New(math_rand4.NewSource(616)) - total := 0 - pops := make([]*Volume, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedVolume(popr, false) +func TestACLsProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedACLs(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &ACLs{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } - b.SetBytes(int64(total / b.N)) } -func TestContainerInfoSize(t *testing4.T) { - popr := math_rand4.New(math_rand4.NewSource(time4.Now().UnixNano())) - p := NewPopulatedContainerInfo(popr, true) - size2 := github_com_gogo_protobuf_proto2.Size(p) - data, err := github_com_gogo_protobuf_proto2.Marshal(p) - if err != nil { - panic(err) - } - size := p.Size() - if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) +func TestRateLimitProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedRateLimit(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &RateLimit{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } - size3 := github_com_gogo_protobuf_proto2.Size(p) - if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkContainerInfoSize(b *testing4.B) { - popr := math_rand4.New(math_rand4.NewSource(616)) - total := 0 - pops := make([]*ContainerInfo, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedContainerInfo(popr, false) +func TestRateLimitProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedRateLimit(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &RateLimit{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } - b.SetBytes(int64(total / b.N)) } -func TestContainerInfo_DockerInfoSize(t *testing4.T) { - popr := math_rand4.New(math_rand4.NewSource(time4.Now().UnixNano())) - p := NewPopulatedContainerInfo_DockerInfo(popr, true) - size2 := github_com_gogo_protobuf_proto2.Size(p) - data, err := github_com_gogo_protobuf_proto2.Marshal(p) - if err != nil { - panic(err) - } - size := p.Size() - if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) +func TestRateLimitsProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedRateLimits(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &RateLimits{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } - size3 := github_com_gogo_protobuf_proto2.Size(p) - if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkContainerInfo_DockerInfoSize(b *testing4.B) { - popr := math_rand4.New(math_rand4.NewSource(616)) - total := 0 - pops := make([]*ContainerInfo_DockerInfo, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedContainerInfo_DockerInfo(popr, false) +func TestRateLimitsProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedRateLimits(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &RateLimits{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } - b.SetBytes(int64(total / b.N)) } -func TestContainerInfo_DockerInfo_PortMappingSize(t *testing4.T) { - popr := math_rand4.New(math_rand4.NewSource(time4.Now().UnixNano())) - p := NewPopulatedContainerInfo_DockerInfo_PortMapping(popr, true) - size2 := github_com_gogo_protobuf_proto2.Size(p) - data, err := github_com_gogo_protobuf_proto2.Marshal(p) - if err != nil { - panic(err) - } - size := p.Size() - if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) +func TestVolumeProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedVolume(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &Volume{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } - size3 := github_com_gogo_protobuf_proto2.Size(p) - if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkContainerInfo_DockerInfo_PortMappingSize(b *testing4.B) { - popr := math_rand4.New(math_rand4.NewSource(616)) - total := 0 - pops := make([]*ContainerInfo_DockerInfo_PortMapping, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedContainerInfo_DockerInfo_PortMapping(popr, false) +func TestVolumeProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedVolume(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &Volume{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } - b.SetBytes(int64(total / b.N)) } -func TestFrameworkIDGoString(t *testing5.T) { - popr := math_rand5.New(math_rand5.NewSource(time5.Now().UnixNano())) - p := NewPopulatedFrameworkID(popr, false) - s1 := p.GoString() - s2 := fmt1.Sprintf("%#v", p) - if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) +func TestContainerInfoProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedContainerInfo(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &ContainerInfo{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - _, err := go_parser.ParseExpr(s1) - if err != nil { - panic(err) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestOfferIDGoString(t *testing5.T) { - popr := math_rand5.New(math_rand5.NewSource(time5.Now().UnixNano())) - p := NewPopulatedOfferID(popr, false) - s1 := p.GoString() - s2 := fmt1.Sprintf("%#v", p) - if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) + +func TestContainerInfoProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedContainerInfo(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &ContainerInfo{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - _, err := go_parser.ParseExpr(s1) - if err != nil { - panic(err) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestSlaveIDGoString(t *testing5.T) { - popr := math_rand5.New(math_rand5.NewSource(time5.Now().UnixNano())) - p := NewPopulatedSlaveID(popr, false) - s1 := p.GoString() - s2 := fmt1.Sprintf("%#v", p) - if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) + +func TestContainerInfo_DockerInfoProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedContainerInfo_DockerInfo(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &ContainerInfo_DockerInfo{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - _, err := go_parser.ParseExpr(s1) - if err != nil { - panic(err) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestTaskIDGoString(t *testing5.T) { - popr := math_rand5.New(math_rand5.NewSource(time5.Now().UnixNano())) - p := NewPopulatedTaskID(popr, false) - s1 := p.GoString() - s2 := fmt1.Sprintf("%#v", p) - if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) + +func TestContainerInfo_DockerInfoProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedContainerInfo_DockerInfo(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &ContainerInfo_DockerInfo{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - _, err := go_parser.ParseExpr(s1) - if err != nil { - panic(err) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestExecutorIDGoString(t *testing5.T) { - popr := math_rand5.New(math_rand5.NewSource(time5.Now().UnixNano())) - p := NewPopulatedExecutorID(popr, false) - s1 := p.GoString() - s2 := fmt1.Sprintf("%#v", p) - if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) + +func TestContainerInfo_DockerInfo_PortMappingProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedContainerInfo_DockerInfo_PortMapping(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &ContainerInfo_DockerInfo_PortMapping{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - _, err := go_parser.ParseExpr(s1) - if err != nil { - panic(err) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestContainerIDGoString(t *testing5.T) { - popr := math_rand5.New(math_rand5.NewSource(time5.Now().UnixNano())) - p := NewPopulatedContainerID(popr, false) - s1 := p.GoString() - s2 := fmt1.Sprintf("%#v", p) - if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) + +func TestContainerInfo_DockerInfo_PortMappingProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedContainerInfo_DockerInfo_PortMapping(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &ContainerInfo_DockerInfo_PortMapping{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - _, err := go_parser.ParseExpr(s1) - if err != nil { - panic(err) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestFrameworkInfoGoString(t *testing5.T) { - popr := math_rand5.New(math_rand5.NewSource(time5.Now().UnixNano())) - p := NewPopulatedFrameworkInfo(popr, false) - s1 := p.GoString() - s2 := fmt1.Sprintf("%#v", p) - if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) + +func TestLabelsProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedLabels(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &Labels{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - _, err := go_parser.ParseExpr(s1) - if err != nil { - panic(err) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestHealthCheckGoString(t *testing5.T) { - popr := math_rand5.New(math_rand5.NewSource(time5.Now().UnixNano())) - p := NewPopulatedHealthCheck(popr, false) - s1 := p.GoString() - s2 := fmt1.Sprintf("%#v", p) - if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) + +func TestLabelsProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedLabels(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &Labels{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - _, err := go_parser.ParseExpr(s1) - if err != nil { - panic(err) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestHealthCheck_HTTPGoString(t *testing5.T) { - popr := math_rand5.New(math_rand5.NewSource(time5.Now().UnixNano())) - p := NewPopulatedHealthCheck_HTTP(popr, false) - s1 := p.GoString() - s2 := fmt1.Sprintf("%#v", p) - if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) + +func TestLabelProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedLabel(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &Label{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - _, err := go_parser.ParseExpr(s1) - if err != nil { - panic(err) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestCommandInfoGoString(t *testing5.T) { - popr := math_rand5.New(math_rand5.NewSource(time5.Now().UnixNano())) - p := NewPopulatedCommandInfo(popr, false) - s1 := p.GoString() - s2 := fmt1.Sprintf("%#v", p) - if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) + +func TestLabelProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedLabel(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &Label{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - _, err := go_parser.ParseExpr(s1) - if err != nil { - panic(err) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestCommandInfo_URIGoString(t *testing5.T) { - popr := math_rand5.New(math_rand5.NewSource(time5.Now().UnixNano())) - p := NewPopulatedCommandInfo_URI(popr, false) - s1 := p.GoString() - s2 := fmt1.Sprintf("%#v", p) - if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) + +func TestPortProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedPort(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &Port{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - _, err := go_parser.ParseExpr(s1) - if err != nil { - panic(err) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestCommandInfo_ContainerInfoGoString(t *testing5.T) { - popr := math_rand5.New(math_rand5.NewSource(time5.Now().UnixNano())) - p := NewPopulatedCommandInfo_ContainerInfo(popr, false) - s1 := p.GoString() - s2 := fmt1.Sprintf("%#v", p) - if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) + +func TestPortProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedPort(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &Port{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - _, err := go_parser.ParseExpr(s1) - if err != nil { - panic(err) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestExecutorInfoGoString(t *testing5.T) { - popr := math_rand5.New(math_rand5.NewSource(time5.Now().UnixNano())) - p := NewPopulatedExecutorInfo(popr, false) - s1 := p.GoString() - s2 := fmt1.Sprintf("%#v", p) - if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) + +func TestPortsProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedPorts(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &Ports{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - _, err := go_parser.ParseExpr(s1) - if err != nil { - panic(err) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestMasterInfoGoString(t *testing5.T) { - popr := math_rand5.New(math_rand5.NewSource(time5.Now().UnixNano())) - p := NewPopulatedMasterInfo(popr, false) - s1 := p.GoString() - s2 := fmt1.Sprintf("%#v", p) - if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) + +func TestPortsProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedPorts(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &Ports{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - _, err := go_parser.ParseExpr(s1) - if err != nil { - panic(err) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestSlaveInfoGoString(t *testing5.T) { - popr := math_rand5.New(math_rand5.NewSource(time5.Now().UnixNano())) - p := NewPopulatedSlaveInfo(popr, false) - s1 := p.GoString() - s2 := fmt1.Sprintf("%#v", p) - if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) + +func TestDiscoveryInfoProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedDiscoveryInfo(popr, true) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &DiscoveryInfo{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - _, err := go_parser.ParseExpr(s1) - if err != nil { - panic(err) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestValueGoString(t *testing5.T) { - popr := math_rand5.New(math_rand5.NewSource(time5.Now().UnixNano())) - p := NewPopulatedValue(popr, false) - s1 := p.GoString() - s2 := fmt1.Sprintf("%#v", p) - if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) + +func TestDiscoveryInfoProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedDiscoveryInfo(popr, true) + data := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &DiscoveryInfo{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } - _, err := go_parser.ParseExpr(s1) - if err != nil { - panic(err) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } -} -func TestValue_ScalarGoString(t *testing5.T) { - popr := math_rand5.New(math_rand5.NewSource(time5.Now().UnixNano())) - p := NewPopulatedValue_Scalar(popr, false) - s1 := p.GoString() - s2 := fmt1.Sprintf("%#v", p) - if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } - _, err := go_parser.ParseExpr(s1) +} + +func TestFrameworkIDVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedFrameworkID(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { panic(err) } -} -func TestValue_RangeGoString(t *testing5.T) { - popr := math_rand5.New(math_rand5.NewSource(time5.Now().UnixNano())) - p := NewPopulatedValue_Range(popr, false) - s1 := p.GoString() - s2 := fmt1.Sprintf("%#v", p) - if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) - } - _, err := go_parser.ParseExpr(s1) - if err != nil { + msg := &FrameworkID{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { panic(err) } -} -func TestValue_RangesGoString(t *testing5.T) { - popr := math_rand5.New(math_rand5.NewSource(time5.Now().UnixNano())) - p := NewPopulatedValue_Ranges(popr, false) - s1 := p.GoString() - s2 := fmt1.Sprintf("%#v", p) - if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) } - _, err := go_parser.ParseExpr(s1) +} +func TestOfferIDVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedOfferID(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { panic(err) } -} -func TestValue_SetGoString(t *testing5.T) { - popr := math_rand5.New(math_rand5.NewSource(time5.Now().UnixNano())) - p := NewPopulatedValue_Set(popr, false) - s1 := p.GoString() - s2 := fmt1.Sprintf("%#v", p) - if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) - } - _, err := go_parser.ParseExpr(s1) - if err != nil { + msg := &OfferID{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { panic(err) } -} -func TestValue_TextGoString(t *testing5.T) { - popr := math_rand5.New(math_rand5.NewSource(time5.Now().UnixNano())) - p := NewPopulatedValue_Text(popr, false) - s1 := p.GoString() - s2 := fmt1.Sprintf("%#v", p) - if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) } - _, err := go_parser.ParseExpr(s1) +} +func TestSlaveIDVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedSlaveID(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { panic(err) } -} -func TestAttributeGoString(t *testing5.T) { - popr := math_rand5.New(math_rand5.NewSource(time5.Now().UnixNano())) - p := NewPopulatedAttribute(popr, false) - s1 := p.GoString() - s2 := fmt1.Sprintf("%#v", p) - if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) - } - _, err := go_parser.ParseExpr(s1) - if err != nil { + msg := &SlaveID{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { panic(err) } -} -func TestResourceGoString(t *testing5.T) { - popr := math_rand5.New(math_rand5.NewSource(time5.Now().UnixNano())) - p := NewPopulatedResource(popr, false) - s1 := p.GoString() - s2 := fmt1.Sprintf("%#v", p) - if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) } - _, err := go_parser.ParseExpr(s1) +} +func TestTaskIDVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedTaskID(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { panic(err) } -} -func TestResourceStatisticsGoString(t *testing5.T) { - popr := math_rand5.New(math_rand5.NewSource(time5.Now().UnixNano())) - p := NewPopulatedResourceStatistics(popr, false) - s1 := p.GoString() - s2 := fmt1.Sprintf("%#v", p) - if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) - } - _, err := go_parser.ParseExpr(s1) - if err != nil { + msg := &TaskID{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { panic(err) } -} -func TestResourceUsageGoString(t *testing5.T) { - popr := math_rand5.New(math_rand5.NewSource(time5.Now().UnixNano())) - p := NewPopulatedResourceUsage(popr, false) - s1 := p.GoString() - s2 := fmt1.Sprintf("%#v", p) - if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) } - _, err := go_parser.ParseExpr(s1) +} +func TestExecutorIDVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedExecutorID(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { panic(err) } -} -func TestPerfStatisticsGoString(t *testing5.T) { - popr := math_rand5.New(math_rand5.NewSource(time5.Now().UnixNano())) - p := NewPopulatedPerfStatistics(popr, false) - s1 := p.GoString() - s2 := fmt1.Sprintf("%#v", p) - if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) - } - _, err := go_parser.ParseExpr(s1) - if err != nil { + msg := &ExecutorID{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { panic(err) } -} -func TestRequestGoString(t *testing5.T) { - popr := math_rand5.New(math_rand5.NewSource(time5.Now().UnixNano())) - p := NewPopulatedRequest(popr, false) - s1 := p.GoString() - s2 := fmt1.Sprintf("%#v", p) - if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) } - _, err := go_parser.ParseExpr(s1) +} +func TestContainerIDVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedContainerID(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { panic(err) } -} -func TestOfferGoString(t *testing5.T) { - popr := math_rand5.New(math_rand5.NewSource(time5.Now().UnixNano())) - p := NewPopulatedOffer(popr, false) - s1 := p.GoString() - s2 := fmt1.Sprintf("%#v", p) - if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) - } - _, err := go_parser.ParseExpr(s1) - if err != nil { + msg := &ContainerID{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { panic(err) } -} -func TestTaskInfoGoString(t *testing5.T) { - popr := math_rand5.New(math_rand5.NewSource(time5.Now().UnixNano())) - p := NewPopulatedTaskInfo(popr, false) - s1 := p.GoString() - s2 := fmt1.Sprintf("%#v", p) - if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) } - _, err := go_parser.ParseExpr(s1) +} +func TestFrameworkInfoVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedFrameworkInfo(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { panic(err) } -} -func TestTaskStatusGoString(t *testing5.T) { - popr := math_rand5.New(math_rand5.NewSource(time5.Now().UnixNano())) - p := NewPopulatedTaskStatus(popr, false) - s1 := p.GoString() - s2 := fmt1.Sprintf("%#v", p) - if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) - } - _, err := go_parser.ParseExpr(s1) - if err != nil { + msg := &FrameworkInfo{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { panic(err) } -} -func TestFiltersGoString(t *testing5.T) { - popr := math_rand5.New(math_rand5.NewSource(time5.Now().UnixNano())) - p := NewPopulatedFilters(popr, false) - s1 := p.GoString() - s2 := fmt1.Sprintf("%#v", p) - if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) } - _, err := go_parser.ParseExpr(s1) +} +func TestFrameworkInfo_CapabilityVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedFrameworkInfo_Capability(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { panic(err) } -} -func TestEnvironmentGoString(t *testing5.T) { - popr := math_rand5.New(math_rand5.NewSource(time5.Now().UnixNano())) - p := NewPopulatedEnvironment(popr, false) - s1 := p.GoString() - s2 := fmt1.Sprintf("%#v", p) - if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) - } - _, err := go_parser.ParseExpr(s1) - if err != nil { + msg := &FrameworkInfo_Capability{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { panic(err) } -} -func TestEnvironment_VariableGoString(t *testing5.T) { - popr := math_rand5.New(math_rand5.NewSource(time5.Now().UnixNano())) - p := NewPopulatedEnvironment_Variable(popr, false) - s1 := p.GoString() - s2 := fmt1.Sprintf("%#v", p) - if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) } - _, err := go_parser.ParseExpr(s1) +} +func TestHealthCheckVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedHealthCheck(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { panic(err) } -} -func TestParameterGoString(t *testing5.T) { - popr := math_rand5.New(math_rand5.NewSource(time5.Now().UnixNano())) - p := NewPopulatedParameter(popr, false) - s1 := p.GoString() - s2 := fmt1.Sprintf("%#v", p) - if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) + msg := &HealthCheck{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + panic(err) } - _, err := go_parser.ParseExpr(s1) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) + } +} +func TestHealthCheck_HTTPVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedHealthCheck_HTTP(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { panic(err) } -} -func TestParametersGoString(t *testing5.T) { - popr := math_rand5.New(math_rand5.NewSource(time5.Now().UnixNano())) - p := NewPopulatedParameters(popr, false) - s1 := p.GoString() - s2 := fmt1.Sprintf("%#v", p) - if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) - } - _, err := go_parser.ParseExpr(s1) - if err != nil { + msg := &HealthCheck_HTTP{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { panic(err) } -} -func TestCredentialGoString(t *testing5.T) { - popr := math_rand5.New(math_rand5.NewSource(time5.Now().UnixNano())) - p := NewPopulatedCredential(popr, false) - s1 := p.GoString() - s2 := fmt1.Sprintf("%#v", p) - if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) - } - _, err := go_parser.ParseExpr(s1) - if err != nil { - panic(err) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) } } -func TestCredentialsGoString(t *testing5.T) { - popr := math_rand5.New(math_rand5.NewSource(time5.Now().UnixNano())) - p := NewPopulatedCredentials(popr, false) - s1 := p.GoString() - s2 := fmt1.Sprintf("%#v", p) - if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) - } - _, err := go_parser.ParseExpr(s1) +func TestCommandInfoVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedCommandInfo(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { panic(err) } -} -func TestACLGoString(t *testing5.T) { - popr := math_rand5.New(math_rand5.NewSource(time5.Now().UnixNano())) - p := NewPopulatedACL(popr, false) - s1 := p.GoString() - s2 := fmt1.Sprintf("%#v", p) - if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) - } - _, err := go_parser.ParseExpr(s1) - if err != nil { + msg := &CommandInfo{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { panic(err) } -} -func TestACL_EntityGoString(t *testing5.T) { - popr := math_rand5.New(math_rand5.NewSource(time5.Now().UnixNano())) - p := NewPopulatedACL_Entity(popr, false) - s1 := p.GoString() - s2 := fmt1.Sprintf("%#v", p) - if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) - } - _, err := go_parser.ParseExpr(s1) - if err != nil { - panic(err) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) } } -func TestACL_RegisterFrameworkGoString(t *testing5.T) { - popr := math_rand5.New(math_rand5.NewSource(time5.Now().UnixNano())) - p := NewPopulatedACL_RegisterFramework(popr, false) - s1 := p.GoString() - s2 := fmt1.Sprintf("%#v", p) - if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) - } - _, err := go_parser.ParseExpr(s1) +func TestCommandInfo_URIVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedCommandInfo_URI(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { panic(err) } -} -func TestACL_RunTaskGoString(t *testing5.T) { - popr := math_rand5.New(math_rand5.NewSource(time5.Now().UnixNano())) - p := NewPopulatedACL_RunTask(popr, false) - s1 := p.GoString() - s2 := fmt1.Sprintf("%#v", p) - if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) - } - _, err := go_parser.ParseExpr(s1) - if err != nil { + msg := &CommandInfo_URI{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { panic(err) } -} -func TestACL_ShutdownFrameworkGoString(t *testing5.T) { - popr := math_rand5.New(math_rand5.NewSource(time5.Now().UnixNano())) - p := NewPopulatedACL_ShutdownFramework(popr, false) - s1 := p.GoString() - s2 := fmt1.Sprintf("%#v", p) - if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) - } - _, err := go_parser.ParseExpr(s1) - if err != nil { - panic(err) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) } } -func TestACLsGoString(t *testing5.T) { - popr := math_rand5.New(math_rand5.NewSource(time5.Now().UnixNano())) - p := NewPopulatedACLs(popr, false) - s1 := p.GoString() - s2 := fmt1.Sprintf("%#v", p) - if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) - } - _, err := go_parser.ParseExpr(s1) +func TestCommandInfo_ContainerInfoVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedCommandInfo_ContainerInfo(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { panic(err) } -} -func TestRateLimitGoString(t *testing5.T) { - popr := math_rand5.New(math_rand5.NewSource(time5.Now().UnixNano())) - p := NewPopulatedRateLimit(popr, false) - s1 := p.GoString() - s2 := fmt1.Sprintf("%#v", p) - if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) - } - _, err := go_parser.ParseExpr(s1) - if err != nil { + msg := &CommandInfo_ContainerInfo{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { panic(err) } -} -func TestRateLimitsGoString(t *testing5.T) { - popr := math_rand5.New(math_rand5.NewSource(time5.Now().UnixNano())) - p := NewPopulatedRateLimits(popr, false) - s1 := p.GoString() - s2 := fmt1.Sprintf("%#v", p) - if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) - } - _, err := go_parser.ParseExpr(s1) - if err != nil { - panic(err) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) } } -func TestVolumeGoString(t *testing5.T) { - popr := math_rand5.New(math_rand5.NewSource(time5.Now().UnixNano())) - p := NewPopulatedVolume(popr, false) - s1 := p.GoString() - s2 := fmt1.Sprintf("%#v", p) - if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) - } - _, err := go_parser.ParseExpr(s1) +func TestExecutorInfoVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedExecutorInfo(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { panic(err) } -} -func TestContainerInfoGoString(t *testing5.T) { - popr := math_rand5.New(math_rand5.NewSource(time5.Now().UnixNano())) - p := NewPopulatedContainerInfo(popr, false) - s1 := p.GoString() - s2 := fmt1.Sprintf("%#v", p) - if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) - } - _, err := go_parser.ParseExpr(s1) - if err != nil { + msg := &ExecutorInfo{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { panic(err) } -} -func TestContainerInfo_DockerInfoGoString(t *testing5.T) { - popr := math_rand5.New(math_rand5.NewSource(time5.Now().UnixNano())) - p := NewPopulatedContainerInfo_DockerInfo(popr, false) - s1 := p.GoString() - s2 := fmt1.Sprintf("%#v", p) - if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) } - _, err := go_parser.ParseExpr(s1) +} +func TestMasterInfoVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedMasterInfo(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { panic(err) } -} -func TestContainerInfo_DockerInfo_PortMappingGoString(t *testing5.T) { - popr := math_rand5.New(math_rand5.NewSource(time5.Now().UnixNano())) - p := NewPopulatedContainerInfo_DockerInfo_PortMapping(popr, false) - s1 := p.GoString() - s2 := fmt1.Sprintf("%#v", p) - if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) - } - _, err := go_parser.ParseExpr(s1) - if err != nil { + msg := &MasterInfo{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { panic(err) } + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) + } } -func TestFrameworkIDVerboseEqual(t *testing6.T) { - popr := math_rand6.New(math_rand6.NewSource(time6.Now().UnixNano())) - p := NewPopulatedFrameworkID(popr, false) - data, err := github_com_gogo_protobuf_proto3.Marshal(p) +func TestSlaveInfoVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedSlaveInfo(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { panic(err) } - msg := &FrameworkID{} - if err := github_com_gogo_protobuf_proto3.Unmarshal(data, msg); err != nil { + msg := &SlaveInfo{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { panic(err) } if err := p.VerboseEqual(msg); err != nil { t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) } } -func TestOfferIDVerboseEqual(t *testing6.T) { - popr := math_rand6.New(math_rand6.NewSource(time6.Now().UnixNano())) - p := NewPopulatedOfferID(popr, false) - data, err := github_com_gogo_protobuf_proto3.Marshal(p) +func TestValueVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedValue(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { panic(err) } - msg := &OfferID{} - if err := github_com_gogo_protobuf_proto3.Unmarshal(data, msg); err != nil { + msg := &Value{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { panic(err) } if err := p.VerboseEqual(msg); err != nil { t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) } } -func TestSlaveIDVerboseEqual(t *testing6.T) { - popr := math_rand6.New(math_rand6.NewSource(time6.Now().UnixNano())) - p := NewPopulatedSlaveID(popr, false) - data, err := github_com_gogo_protobuf_proto3.Marshal(p) +func TestValue_ScalarVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedValue_Scalar(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { panic(err) } - msg := &SlaveID{} - if err := github_com_gogo_protobuf_proto3.Unmarshal(data, msg); err != nil { + msg := &Value_Scalar{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { panic(err) } if err := p.VerboseEqual(msg); err != nil { t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) } } -func TestTaskIDVerboseEqual(t *testing6.T) { - popr := math_rand6.New(math_rand6.NewSource(time6.Now().UnixNano())) - p := NewPopulatedTaskID(popr, false) - data, err := github_com_gogo_protobuf_proto3.Marshal(p) +func TestValue_RangeVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedValue_Range(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { panic(err) } - msg := &TaskID{} - if err := github_com_gogo_protobuf_proto3.Unmarshal(data, msg); err != nil { + msg := &Value_Range{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { panic(err) } if err := p.VerboseEqual(msg); err != nil { t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) } } -func TestExecutorIDVerboseEqual(t *testing6.T) { - popr := math_rand6.New(math_rand6.NewSource(time6.Now().UnixNano())) - p := NewPopulatedExecutorID(popr, false) - data, err := github_com_gogo_protobuf_proto3.Marshal(p) +func TestValue_RangesVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedValue_Ranges(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { panic(err) } - msg := &ExecutorID{} - if err := github_com_gogo_protobuf_proto3.Unmarshal(data, msg); err != nil { + msg := &Value_Ranges{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { panic(err) } if err := p.VerboseEqual(msg); err != nil { t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) } } -func TestContainerIDVerboseEqual(t *testing6.T) { - popr := math_rand6.New(math_rand6.NewSource(time6.Now().UnixNano())) - p := NewPopulatedContainerID(popr, false) - data, err := github_com_gogo_protobuf_proto3.Marshal(p) +func TestValue_SetVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedValue_Set(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { panic(err) } - msg := &ContainerID{} - if err := github_com_gogo_protobuf_proto3.Unmarshal(data, msg); err != nil { + msg := &Value_Set{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { panic(err) } if err := p.VerboseEqual(msg); err != nil { t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) } } -func TestFrameworkInfoVerboseEqual(t *testing6.T) { - popr := math_rand6.New(math_rand6.NewSource(time6.Now().UnixNano())) - p := NewPopulatedFrameworkInfo(popr, false) - data, err := github_com_gogo_protobuf_proto3.Marshal(p) +func TestValue_TextVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedValue_Text(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { panic(err) } - msg := &FrameworkInfo{} - if err := github_com_gogo_protobuf_proto3.Unmarshal(data, msg); err != nil { + msg := &Value_Text{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { panic(err) } if err := p.VerboseEqual(msg); err != nil { t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) } } -func TestHealthCheckVerboseEqual(t *testing6.T) { - popr := math_rand6.New(math_rand6.NewSource(time6.Now().UnixNano())) - p := NewPopulatedHealthCheck(popr, false) - data, err := github_com_gogo_protobuf_proto3.Marshal(p) +func TestAttributeVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedAttribute(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { panic(err) } - msg := &HealthCheck{} - if err := github_com_gogo_protobuf_proto3.Unmarshal(data, msg); err != nil { + msg := &Attribute{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { panic(err) } if err := p.VerboseEqual(msg); err != nil { t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) } } -func TestHealthCheck_HTTPVerboseEqual(t *testing6.T) { - popr := math_rand6.New(math_rand6.NewSource(time6.Now().UnixNano())) - p := NewPopulatedHealthCheck_HTTP(popr, false) - data, err := github_com_gogo_protobuf_proto3.Marshal(p) +func TestResourceVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedResource(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { panic(err) } - msg := &HealthCheck_HTTP{} - if err := github_com_gogo_protobuf_proto3.Unmarshal(data, msg); err != nil { + msg := &Resource{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { panic(err) } if err := p.VerboseEqual(msg); err != nil { t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) } } -func TestCommandInfoVerboseEqual(t *testing6.T) { - popr := math_rand6.New(math_rand6.NewSource(time6.Now().UnixNano())) - p := NewPopulatedCommandInfo(popr, false) - data, err := github_com_gogo_protobuf_proto3.Marshal(p) +func TestResource_ReservationInfoVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedResource_ReservationInfo(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { panic(err) } - msg := &CommandInfo{} - if err := github_com_gogo_protobuf_proto3.Unmarshal(data, msg); err != nil { + msg := &Resource_ReservationInfo{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { panic(err) } if err := p.VerboseEqual(msg); err != nil { t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) } } -func TestCommandInfo_URIVerboseEqual(t *testing6.T) { - popr := math_rand6.New(math_rand6.NewSource(time6.Now().UnixNano())) - p := NewPopulatedCommandInfo_URI(popr, false) - data, err := github_com_gogo_protobuf_proto3.Marshal(p) +func TestResource_DiskInfoVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedResource_DiskInfo(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { panic(err) } - msg := &CommandInfo_URI{} - if err := github_com_gogo_protobuf_proto3.Unmarshal(data, msg); err != nil { + msg := &Resource_DiskInfo{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { panic(err) } if err := p.VerboseEqual(msg); err != nil { t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) } } -func TestCommandInfo_ContainerInfoVerboseEqual(t *testing6.T) { - popr := math_rand6.New(math_rand6.NewSource(time6.Now().UnixNano())) - p := NewPopulatedCommandInfo_ContainerInfo(popr, false) - data, err := github_com_gogo_protobuf_proto3.Marshal(p) +func TestResource_DiskInfo_PersistenceVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedResource_DiskInfo_Persistence(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { panic(err) } - msg := &CommandInfo_ContainerInfo{} - if err := github_com_gogo_protobuf_proto3.Unmarshal(data, msg); err != nil { + msg := &Resource_DiskInfo_Persistence{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { panic(err) } if err := p.VerboseEqual(msg); err != nil { t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) } } -func TestExecutorInfoVerboseEqual(t *testing6.T) { - popr := math_rand6.New(math_rand6.NewSource(time6.Now().UnixNano())) - p := NewPopulatedExecutorInfo(popr, false) - data, err := github_com_gogo_protobuf_proto3.Marshal(p) +func TestResource_RevocableInfoVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedResource_RevocableInfo(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { panic(err) } - msg := &ExecutorInfo{} - if err := github_com_gogo_protobuf_proto3.Unmarshal(data, msg); err != nil { + msg := &Resource_RevocableInfo{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { panic(err) } if err := p.VerboseEqual(msg); err != nil { t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) } } -func TestMasterInfoVerboseEqual(t *testing6.T) { - popr := math_rand6.New(math_rand6.NewSource(time6.Now().UnixNano())) - p := NewPopulatedMasterInfo(popr, false) - data, err := github_com_gogo_protobuf_proto3.Marshal(p) +func TestTrafficControlStatisticsVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedTrafficControlStatistics(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { panic(err) } - msg := &MasterInfo{} - if err := github_com_gogo_protobuf_proto3.Unmarshal(data, msg); err != nil { + msg := &TrafficControlStatistics{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { panic(err) } if err := p.VerboseEqual(msg); err != nil { t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) } } -func TestSlaveInfoVerboseEqual(t *testing6.T) { - popr := math_rand6.New(math_rand6.NewSource(time6.Now().UnixNano())) - p := NewPopulatedSlaveInfo(popr, false) - data, err := github_com_gogo_protobuf_proto3.Marshal(p) +func TestResourceStatisticsVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedResourceStatistics(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { panic(err) } - msg := &SlaveInfo{} - if err := github_com_gogo_protobuf_proto3.Unmarshal(data, msg); err != nil { + msg := &ResourceStatistics{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { panic(err) } if err := p.VerboseEqual(msg); err != nil { t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) } } -func TestValueVerboseEqual(t *testing6.T) { - popr := math_rand6.New(math_rand6.NewSource(time6.Now().UnixNano())) - p := NewPopulatedValue(popr, false) - data, err := github_com_gogo_protobuf_proto3.Marshal(p) +func TestResourceUsageVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedResourceUsage(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { panic(err) } - msg := &Value{} - if err := github_com_gogo_protobuf_proto3.Unmarshal(data, msg); err != nil { + msg := &ResourceUsage{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { panic(err) } if err := p.VerboseEqual(msg); err != nil { t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) } } -func TestValue_ScalarVerboseEqual(t *testing6.T) { - popr := math_rand6.New(math_rand6.NewSource(time6.Now().UnixNano())) - p := NewPopulatedValue_Scalar(popr, false) - data, err := github_com_gogo_protobuf_proto3.Marshal(p) - if err != nil { +func TestResourceUsage_ExecutorVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedResourceUsage_Executor(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { panic(err) } - msg := &Value_Scalar{} - if err := github_com_gogo_protobuf_proto3.Unmarshal(data, msg); err != nil { + msg := &ResourceUsage_Executor{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { panic(err) } if err := p.VerboseEqual(msg); err != nil { t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) } } -func TestValue_RangeVerboseEqual(t *testing6.T) { - popr := math_rand6.New(math_rand6.NewSource(time6.Now().UnixNano())) - p := NewPopulatedValue_Range(popr, false) - data, err := github_com_gogo_protobuf_proto3.Marshal(p) +func TestPerfStatisticsVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedPerfStatistics(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { panic(err) } - msg := &Value_Range{} - if err := github_com_gogo_protobuf_proto3.Unmarshal(data, msg); err != nil { + msg := &PerfStatistics{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { panic(err) } if err := p.VerboseEqual(msg); err != nil { t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) } } -func TestValue_RangesVerboseEqual(t *testing6.T) { - popr := math_rand6.New(math_rand6.NewSource(time6.Now().UnixNano())) - p := NewPopulatedValue_Ranges(popr, false) - data, err := github_com_gogo_protobuf_proto3.Marshal(p) +func TestRequestVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedRequest(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { panic(err) } - msg := &Value_Ranges{} - if err := github_com_gogo_protobuf_proto3.Unmarshal(data, msg); err != nil { + msg := &Request{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { panic(err) } if err := p.VerboseEqual(msg); err != nil { t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) } } -func TestValue_SetVerboseEqual(t *testing6.T) { - popr := math_rand6.New(math_rand6.NewSource(time6.Now().UnixNano())) - p := NewPopulatedValue_Set(popr, false) - data, err := github_com_gogo_protobuf_proto3.Marshal(p) +func TestOfferVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedOffer(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { panic(err) } - msg := &Value_Set{} - if err := github_com_gogo_protobuf_proto3.Unmarshal(data, msg); err != nil { + msg := &Offer{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { panic(err) } if err := p.VerboseEqual(msg); err != nil { t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) } } -func TestValue_TextVerboseEqual(t *testing6.T) { - popr := math_rand6.New(math_rand6.NewSource(time6.Now().UnixNano())) - p := NewPopulatedValue_Text(popr, false) - data, err := github_com_gogo_protobuf_proto3.Marshal(p) +func TestOffer_OperationVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedOffer_Operation(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { panic(err) } - msg := &Value_Text{} - if err := github_com_gogo_protobuf_proto3.Unmarshal(data, msg); err != nil { + msg := &Offer_Operation{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { panic(err) } if err := p.VerboseEqual(msg); err != nil { t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) } } -func TestAttributeVerboseEqual(t *testing6.T) { - popr := math_rand6.New(math_rand6.NewSource(time6.Now().UnixNano())) - p := NewPopulatedAttribute(popr, false) - data, err := github_com_gogo_protobuf_proto3.Marshal(p) +func TestOffer_Operation_LaunchVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedOffer_Operation_Launch(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { panic(err) } - msg := &Attribute{} - if err := github_com_gogo_protobuf_proto3.Unmarshal(data, msg); err != nil { + msg := &Offer_Operation_Launch{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { panic(err) } if err := p.VerboseEqual(msg); err != nil { t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) } } -func TestResourceVerboseEqual(t *testing6.T) { - popr := math_rand6.New(math_rand6.NewSource(time6.Now().UnixNano())) - p := NewPopulatedResource(popr, false) - data, err := github_com_gogo_protobuf_proto3.Marshal(p) +func TestOffer_Operation_ReserveVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedOffer_Operation_Reserve(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { panic(err) } - msg := &Resource{} - if err := github_com_gogo_protobuf_proto3.Unmarshal(data, msg); err != nil { + msg := &Offer_Operation_Reserve{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { panic(err) } if err := p.VerboseEqual(msg); err != nil { t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) } } -func TestResourceStatisticsVerboseEqual(t *testing6.T) { - popr := math_rand6.New(math_rand6.NewSource(time6.Now().UnixNano())) - p := NewPopulatedResourceStatistics(popr, false) - data, err := github_com_gogo_protobuf_proto3.Marshal(p) +func TestOffer_Operation_UnreserveVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedOffer_Operation_Unreserve(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { panic(err) } - msg := &ResourceStatistics{} - if err := github_com_gogo_protobuf_proto3.Unmarshal(data, msg); err != nil { + msg := &Offer_Operation_Unreserve{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { panic(err) } if err := p.VerboseEqual(msg); err != nil { t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) } } -func TestResourceUsageVerboseEqual(t *testing6.T) { - popr := math_rand6.New(math_rand6.NewSource(time6.Now().UnixNano())) - p := NewPopulatedResourceUsage(popr, false) - data, err := github_com_gogo_protobuf_proto3.Marshal(p) +func TestOffer_Operation_CreateVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedOffer_Operation_Create(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { panic(err) } - msg := &ResourceUsage{} - if err := github_com_gogo_protobuf_proto3.Unmarshal(data, msg); err != nil { + msg := &Offer_Operation_Create{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { panic(err) } if err := p.VerboseEqual(msg); err != nil { t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) } } -func TestPerfStatisticsVerboseEqual(t *testing6.T) { - popr := math_rand6.New(math_rand6.NewSource(time6.Now().UnixNano())) - p := NewPopulatedPerfStatistics(popr, false) - data, err := github_com_gogo_protobuf_proto3.Marshal(p) +func TestOffer_Operation_DestroyVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedOffer_Operation_Destroy(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { panic(err) } - msg := &PerfStatistics{} - if err := github_com_gogo_protobuf_proto3.Unmarshal(data, msg); err != nil { + msg := &Offer_Operation_Destroy{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { panic(err) } if err := p.VerboseEqual(msg); err != nil { t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) } } -func TestRequestVerboseEqual(t *testing6.T) { - popr := math_rand6.New(math_rand6.NewSource(time6.Now().UnixNano())) - p := NewPopulatedRequest(popr, false) - data, err := github_com_gogo_protobuf_proto3.Marshal(p) +func TestTaskInfoVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedTaskInfo(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { panic(err) } - msg := &Request{} - if err := github_com_gogo_protobuf_proto3.Unmarshal(data, msg); err != nil { + msg := &TaskInfo{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { panic(err) } if err := p.VerboseEqual(msg); err != nil { t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) } } -func TestOfferVerboseEqual(t *testing6.T) { - popr := math_rand6.New(math_rand6.NewSource(time6.Now().UnixNano())) - p := NewPopulatedOffer(popr, false) - data, err := github_com_gogo_protobuf_proto3.Marshal(p) +func TestTaskStatusVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedTaskStatus(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { panic(err) } - msg := &Offer{} - if err := github_com_gogo_protobuf_proto3.Unmarshal(data, msg); err != nil { + msg := &TaskStatus{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { panic(err) } if err := p.VerboseEqual(msg); err != nil { t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) } } -func TestTaskInfoVerboseEqual(t *testing6.T) { - popr := math_rand6.New(math_rand6.NewSource(time6.Now().UnixNano())) - p := NewPopulatedTaskInfo(popr, false) - data, err := github_com_gogo_protobuf_proto3.Marshal(p) +func TestFiltersVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedFilters(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { panic(err) } - msg := &TaskInfo{} - if err := github_com_gogo_protobuf_proto3.Unmarshal(data, msg); err != nil { + msg := &Filters{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { panic(err) } if err := p.VerboseEqual(msg); err != nil { t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) } } -func TestTaskStatusVerboseEqual(t *testing6.T) { - popr := math_rand6.New(math_rand6.NewSource(time6.Now().UnixNano())) - p := NewPopulatedTaskStatus(popr, false) - data, err := github_com_gogo_protobuf_proto3.Marshal(p) +func TestEnvironmentVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedEnvironment(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { panic(err) } - msg := &TaskStatus{} - if err := github_com_gogo_protobuf_proto3.Unmarshal(data, msg); err != nil { + msg := &Environment{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { panic(err) } if err := p.VerboseEqual(msg); err != nil { t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) } } -func TestFiltersVerboseEqual(t *testing6.T) { - popr := math_rand6.New(math_rand6.NewSource(time6.Now().UnixNano())) - p := NewPopulatedFilters(popr, false) - data, err := github_com_gogo_protobuf_proto3.Marshal(p) +func TestEnvironment_VariableVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedEnvironment_Variable(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { panic(err) } - msg := &Filters{} - if err := github_com_gogo_protobuf_proto3.Unmarshal(data, msg); err != nil { + msg := &Environment_Variable{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { panic(err) } if err := p.VerboseEqual(msg); err != nil { t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) } } -func TestEnvironmentVerboseEqual(t *testing6.T) { - popr := math_rand6.New(math_rand6.NewSource(time6.Now().UnixNano())) - p := NewPopulatedEnvironment(popr, false) - data, err := github_com_gogo_protobuf_proto3.Marshal(p) +func TestParameterVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedParameter(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { panic(err) } - msg := &Environment{} - if err := github_com_gogo_protobuf_proto3.Unmarshal(data, msg); err != nil { + msg := &Parameter{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + panic(err) + } + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) + } +} +func TestParametersVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedParameters(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + panic(err) + } + msg := &Parameters{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + panic(err) + } + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) + } +} +func TestCredentialVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedCredential(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + panic(err) + } + msg := &Credential{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + panic(err) + } + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) + } +} +func TestCredentialsVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedCredentials(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + panic(err) + } + msg := &Credentials{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + panic(err) + } + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) + } +} +func TestACLVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedACL(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + panic(err) + } + msg := &ACL{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + panic(err) + } + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) + } +} +func TestACL_EntityVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedACL_Entity(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + panic(err) + } + msg := &ACL_Entity{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + panic(err) + } + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) + } +} +func TestACL_RegisterFrameworkVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedACL_RegisterFramework(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + panic(err) + } + msg := &ACL_RegisterFramework{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + panic(err) + } + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) + } +} +func TestACL_RunTaskVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedACL_RunTask(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + panic(err) + } + msg := &ACL_RunTask{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + panic(err) + } + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) + } +} +func TestACL_ShutdownFrameworkVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedACL_ShutdownFramework(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + panic(err) + } + msg := &ACL_ShutdownFramework{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + panic(err) + } + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) + } +} +func TestACLsVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedACLs(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + panic(err) + } + msg := &ACLs{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { panic(err) } if err := p.VerboseEqual(msg); err != nil { t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) } } -func TestEnvironment_VariableVerboseEqual(t *testing6.T) { - popr := math_rand6.New(math_rand6.NewSource(time6.Now().UnixNano())) +func TestRateLimitVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedRateLimit(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + panic(err) + } + msg := &RateLimit{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + panic(err) + } + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) + } +} +func TestRateLimitsVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedRateLimits(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + panic(err) + } + msg := &RateLimits{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + panic(err) + } + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) + } +} +func TestVolumeVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedVolume(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + panic(err) + } + msg := &Volume{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + panic(err) + } + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) + } +} +func TestContainerInfoVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedContainerInfo(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + panic(err) + } + msg := &ContainerInfo{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + panic(err) + } + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) + } +} +func TestContainerInfo_DockerInfoVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedContainerInfo_DockerInfo(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + panic(err) + } + msg := &ContainerInfo_DockerInfo{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + panic(err) + } + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) + } +} +func TestContainerInfo_DockerInfo_PortMappingVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedContainerInfo_DockerInfo_PortMapping(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + panic(err) + } + msg := &ContainerInfo_DockerInfo_PortMapping{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + panic(err) + } + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) + } +} +func TestLabelsVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedLabels(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + panic(err) + } + msg := &Labels{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + panic(err) + } + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) + } +} +func TestLabelVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedLabel(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + panic(err) + } + msg := &Label{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + panic(err) + } + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) + } +} +func TestPortVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedPort(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + panic(err) + } + msg := &Port{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + panic(err) + } + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) + } +} +func TestPortsVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedPorts(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + panic(err) + } + msg := &Ports{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + panic(err) + } + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) + } +} +func TestDiscoveryInfoVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedDiscoveryInfo(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + panic(err) + } + msg := &DiscoveryInfo{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + panic(err) + } + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) + } +} +func TestFrameworkIDGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedFrameworkID(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestOfferIDGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedOfferID(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestSlaveIDGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedSlaveID(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestTaskIDGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedTaskID(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestExecutorIDGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedExecutorID(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestContainerIDGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedContainerID(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestFrameworkInfoGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedFrameworkInfo(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestFrameworkInfo_CapabilityGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedFrameworkInfo_Capability(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestHealthCheckGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedHealthCheck(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestHealthCheck_HTTPGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedHealthCheck_HTTP(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestCommandInfoGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedCommandInfo(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestCommandInfo_URIGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedCommandInfo_URI(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestCommandInfo_ContainerInfoGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedCommandInfo_ContainerInfo(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestExecutorInfoGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedExecutorInfo(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestMasterInfoGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedMasterInfo(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestSlaveInfoGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedSlaveInfo(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestValueGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedValue(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestValue_ScalarGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedValue_Scalar(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestValue_RangeGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedValue_Range(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestValue_RangesGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedValue_Ranges(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestValue_SetGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedValue_Set(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestValue_TextGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedValue_Text(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestAttributeGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedAttribute(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestResourceGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedResource(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestResource_ReservationInfoGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedResource_ReservationInfo(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestResource_DiskInfoGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedResource_DiskInfo(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestResource_DiskInfo_PersistenceGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedResource_DiskInfo_Persistence(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestResource_RevocableInfoGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedResource_RevocableInfo(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestTrafficControlStatisticsGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedTrafficControlStatistics(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestResourceStatisticsGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedResourceStatistics(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestResourceUsageGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedResourceUsage(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestResourceUsage_ExecutorGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedResourceUsage_Executor(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestPerfStatisticsGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedPerfStatistics(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestRequestGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedRequest(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestOfferGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedOffer(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestOffer_OperationGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedOffer_Operation(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestOffer_Operation_LaunchGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedOffer_Operation_Launch(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestOffer_Operation_ReserveGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedOffer_Operation_Reserve(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestOffer_Operation_UnreserveGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedOffer_Operation_Unreserve(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestOffer_Operation_CreateGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedOffer_Operation_Create(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestOffer_Operation_DestroyGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedOffer_Operation_Destroy(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestTaskInfoGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedTaskInfo(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestTaskStatusGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedTaskStatus(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestFiltersGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedFilters(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestEnvironmentGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedEnvironment(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestEnvironment_VariableGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedEnvironment_Variable(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestParameterGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedParameter(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestParametersGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedParameters(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestCredentialGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedCredential(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestCredentialsGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedCredentials(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestACLGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedACL(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestACL_EntityGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedACL_Entity(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestACL_RegisterFrameworkGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedACL_RegisterFramework(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestACL_RunTaskGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedACL_RunTask(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestACL_ShutdownFrameworkGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedACL_ShutdownFramework(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestACLsGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedACLs(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestRateLimitGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedRateLimit(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestRateLimitsGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedRateLimits(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestVolumeGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedVolume(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestContainerInfoGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedContainerInfo(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestContainerInfo_DockerInfoGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedContainerInfo_DockerInfo(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestContainerInfo_DockerInfo_PortMappingGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedContainerInfo_DockerInfo_PortMapping(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestLabelsGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedLabels(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestLabelGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedLabel(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestPortGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedPort(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestPortsGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedPorts(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestDiscoveryInfoGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedDiscoveryInfo(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) + if s1 != s2 { + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) + } +} +func TestFrameworkIDSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedFrameworkID(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkFrameworkIDSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*FrameworkID, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedFrameworkID(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestOfferIDSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedOfferID(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkOfferIDSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*OfferID, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedOfferID(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestSlaveIDSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedSlaveID(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkSlaveIDSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*SlaveID, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedSlaveID(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestTaskIDSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedTaskID(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkTaskIDSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*TaskID, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedTaskID(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestExecutorIDSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedExecutorID(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkExecutorIDSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*ExecutorID, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedExecutorID(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestContainerIDSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedContainerID(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkContainerIDSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*ContainerID, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedContainerID(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestFrameworkInfoSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedFrameworkInfo(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkFrameworkInfoSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*FrameworkInfo, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedFrameworkInfo(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestFrameworkInfo_CapabilitySize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedFrameworkInfo_Capability(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkFrameworkInfo_CapabilitySize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*FrameworkInfo_Capability, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedFrameworkInfo_Capability(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestHealthCheckSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedHealthCheck(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkHealthCheckSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*HealthCheck, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedHealthCheck(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestHealthCheck_HTTPSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedHealthCheck_HTTP(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkHealthCheck_HTTPSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*HealthCheck_HTTP, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedHealthCheck_HTTP(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestCommandInfoSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedCommandInfo(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkCommandInfoSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*CommandInfo, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedCommandInfo(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestCommandInfo_URISize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedCommandInfo_URI(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkCommandInfo_URISize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*CommandInfo_URI, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedCommandInfo_URI(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestCommandInfo_ContainerInfoSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedCommandInfo_ContainerInfo(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkCommandInfo_ContainerInfoSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*CommandInfo_ContainerInfo, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedCommandInfo_ContainerInfo(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestExecutorInfoSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedExecutorInfo(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkExecutorInfoSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*ExecutorInfo, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedExecutorInfo(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestMasterInfoSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedMasterInfo(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkMasterInfoSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*MasterInfo, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedMasterInfo(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestSlaveInfoSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedSlaveInfo(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkSlaveInfoSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*SlaveInfo, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedSlaveInfo(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestValueSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedValue(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkValueSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*Value, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedValue(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestValue_ScalarSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedValue_Scalar(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkValue_ScalarSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*Value_Scalar, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedValue_Scalar(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestValue_RangeSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedValue_Range(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkValue_RangeSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*Value_Range, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedValue_Range(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestValue_RangesSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedValue_Ranges(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkValue_RangesSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*Value_Ranges, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedValue_Ranges(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestValue_SetSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedValue_Set(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkValue_SetSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*Value_Set, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedValue_Set(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestValue_TextSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedValue_Text(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkValue_TextSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*Value_Text, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedValue_Text(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestAttributeSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedAttribute(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkAttributeSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*Attribute, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedAttribute(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestResourceSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedResource(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkResourceSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*Resource, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedResource(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestResource_ReservationInfoSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedResource_ReservationInfo(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkResource_ReservationInfoSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*Resource_ReservationInfo, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedResource_ReservationInfo(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestResource_DiskInfoSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedResource_DiskInfo(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkResource_DiskInfoSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*Resource_DiskInfo, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedResource_DiskInfo(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestResource_DiskInfo_PersistenceSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedResource_DiskInfo_Persistence(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkResource_DiskInfo_PersistenceSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*Resource_DiskInfo_Persistence, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedResource_DiskInfo_Persistence(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestResource_RevocableInfoSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedResource_RevocableInfo(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkResource_RevocableInfoSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*Resource_RevocableInfo, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedResource_RevocableInfo(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestTrafficControlStatisticsSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedTrafficControlStatistics(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkTrafficControlStatisticsSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*TrafficControlStatistics, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedTrafficControlStatistics(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestResourceStatisticsSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedResourceStatistics(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkResourceStatisticsSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*ResourceStatistics, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedResourceStatistics(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestResourceUsageSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedResourceUsage(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkResourceUsageSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*ResourceUsage, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedResourceUsage(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestResourceUsage_ExecutorSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedResourceUsage_Executor(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkResourceUsage_ExecutorSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*ResourceUsage_Executor, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedResourceUsage_Executor(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestPerfStatisticsSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedPerfStatistics(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkPerfStatisticsSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*PerfStatistics, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedPerfStatistics(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestRequestSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedRequest(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkRequestSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*Request, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedRequest(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestOfferSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedOffer(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkOfferSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*Offer, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedOffer(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestOffer_OperationSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedOffer_Operation(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkOffer_OperationSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*Offer_Operation, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedOffer_Operation(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestOffer_Operation_LaunchSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedOffer_Operation_Launch(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkOffer_Operation_LaunchSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*Offer_Operation_Launch, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedOffer_Operation_Launch(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestOffer_Operation_ReserveSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedOffer_Operation_Reserve(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkOffer_Operation_ReserveSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*Offer_Operation_Reserve, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedOffer_Operation_Reserve(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestOffer_Operation_UnreserveSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedOffer_Operation_Unreserve(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkOffer_Operation_UnreserveSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*Offer_Operation_Unreserve, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedOffer_Operation_Unreserve(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestOffer_Operation_CreateSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedOffer_Operation_Create(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkOffer_Operation_CreateSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*Offer_Operation_Create, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedOffer_Operation_Create(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestOffer_Operation_DestroySize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedOffer_Operation_Destroy(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkOffer_Operation_DestroySize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*Offer_Operation_Destroy, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedOffer_Operation_Destroy(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestTaskInfoSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedTaskInfo(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkTaskInfoSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*TaskInfo, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedTaskInfo(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestTaskStatusSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedTaskStatus(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkTaskStatusSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*TaskStatus, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedTaskStatus(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestFiltersSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedFilters(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkFiltersSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*Filters, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedFilters(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestEnvironmentSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedEnvironment(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkEnvironmentSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*Environment, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedEnvironment(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestEnvironment_VariableSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedEnvironment_Variable(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkEnvironment_VariableSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*Environment_Variable, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedEnvironment_Variable(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestParameterSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedParameter(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkParameterSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*Parameter, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedParameter(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestParametersSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedParameters(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkParametersSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*Parameters, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedParameters(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestCredentialSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedCredential(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkCredentialSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*Credential, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedCredential(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestCredentialsSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedCredentials(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkCredentialsSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*Credentials, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedCredentials(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestACLSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedACL(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkACLSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*ACL, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedACL(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestACL_EntitySize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedACL_Entity(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkACL_EntitySize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*ACL_Entity, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedACL_Entity(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestACL_RegisterFrameworkSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedACL_RegisterFramework(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkACL_RegisterFrameworkSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*ACL_RegisterFramework, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedACL_RegisterFramework(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestACL_RunTaskSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedACL_RunTask(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkACL_RunTaskSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*ACL_RunTask, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedACL_RunTask(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestACL_ShutdownFrameworkSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedACL_ShutdownFramework(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkACL_ShutdownFrameworkSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*ACL_ShutdownFramework, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedACL_ShutdownFramework(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestACLsSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedACLs(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkACLsSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*ACLs, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedACLs(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestRateLimitSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedRateLimit(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkRateLimitSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*RateLimit, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedRateLimit(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestRateLimitsSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedRateLimits(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkRateLimitsSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*RateLimits, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedRateLimits(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestVolumeSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedVolume(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkVolumeSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*Volume, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedVolume(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestContainerInfoSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedContainerInfo(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkContainerInfoSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*ContainerInfo, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedContainerInfo(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestContainerInfo_DockerInfoSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedContainerInfo_DockerInfo(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkContainerInfo_DockerInfoSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*ContainerInfo_DockerInfo, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedContainerInfo_DockerInfo(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestContainerInfo_DockerInfo_PortMappingSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedContainerInfo_DockerInfo_PortMapping(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkContainerInfo_DockerInfo_PortMappingSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*ContainerInfo_DockerInfo_PortMapping, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedContainerInfo_DockerInfo_PortMapping(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestLabelsSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedLabels(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkLabelsSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*Labels, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedLabels(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestLabelSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedLabel(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkLabelSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*Label, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedLabel(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestPortSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedPort(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkPortSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*Port, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedPort(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestPortsSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedPorts(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkPortsSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*Ports, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedPorts(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestDiscoveryInfoSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedDiscoveryInfo(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(data) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func BenchmarkDiscoveryInfoSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) + total := 0 + pops := make([]*DiscoveryInfo, 1000) + for i := 0; i < 1000; i++ { + pops[i] = NewPopulatedDiscoveryInfo(popr, false) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + total += pops[i%1000].Size() + } + b.SetBytes(int64(total / b.N)) +} + +func TestFrameworkIDStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedFrameworkID(popr, false) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) + } +} +func TestOfferIDStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedOfferID(popr, false) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) + } +} +func TestSlaveIDStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedSlaveID(popr, false) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) + } +} +func TestTaskIDStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedTaskID(popr, false) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) + } +} +func TestExecutorIDStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedExecutorID(popr, false) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) + } +} +func TestContainerIDStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedContainerID(popr, false) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) + } +} +func TestFrameworkInfoStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedFrameworkInfo(popr, false) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) + } +} +func TestFrameworkInfo_CapabilityStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedFrameworkInfo_Capability(popr, false) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) + } +} +func TestHealthCheckStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedHealthCheck(popr, false) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) + } +} +func TestHealthCheck_HTTPStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedHealthCheck_HTTP(popr, false) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) + } +} +func TestCommandInfoStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedCommandInfo(popr, false) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) + } +} +func TestCommandInfo_URIStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedCommandInfo_URI(popr, false) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) + } +} +func TestCommandInfo_ContainerInfoStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedCommandInfo_ContainerInfo(popr, false) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) + } +} +func TestExecutorInfoStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedExecutorInfo(popr, false) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) + } +} +func TestMasterInfoStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedMasterInfo(popr, false) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) + } +} +func TestSlaveInfoStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedSlaveInfo(popr, false) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) + } +} +func TestValueStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedValue(popr, false) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) + } +} +func TestValue_ScalarStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedValue_Scalar(popr, false) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) + } +} +func TestValue_RangeStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedValue_Range(popr, false) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) + } +} +func TestValue_RangesStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedValue_Ranges(popr, false) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) + } +} +func TestValue_SetStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedValue_Set(popr, false) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) + } +} +func TestValue_TextStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedValue_Text(popr, false) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) + } +} +func TestAttributeStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedAttribute(popr, false) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) + } +} +func TestResourceStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedResource(popr, false) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) + } +} +func TestResource_ReservationInfoStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedResource_ReservationInfo(popr, false) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) + } +} +func TestResource_DiskInfoStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedResource_DiskInfo(popr, false) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) + } +} +func TestResource_DiskInfo_PersistenceStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedResource_DiskInfo_Persistence(popr, false) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) + } +} +func TestResource_RevocableInfoStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedResource_RevocableInfo(popr, false) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) + } +} +func TestTrafficControlStatisticsStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedTrafficControlStatistics(popr, false) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) + } +} +func TestResourceStatisticsStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedResourceStatistics(popr, false) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) + } +} +func TestResourceUsageStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedResourceUsage(popr, false) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) + } +} +func TestResourceUsage_ExecutorStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedResourceUsage_Executor(popr, false) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) + } +} +func TestPerfStatisticsStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedPerfStatistics(popr, false) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) + } +} +func TestRequestStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedRequest(popr, false) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) + } +} +func TestOfferStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedOffer(popr, false) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) + } +} +func TestOffer_OperationStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedOffer_Operation(popr, false) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) + } +} +func TestOffer_Operation_LaunchStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedOffer_Operation_Launch(popr, false) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) + } +} +func TestOffer_Operation_ReserveStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedOffer_Operation_Reserve(popr, false) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) + } +} +func TestOffer_Operation_UnreserveStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedOffer_Operation_Unreserve(popr, false) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) + } +} +func TestOffer_Operation_CreateStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedOffer_Operation_Create(popr, false) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) + } +} +func TestOffer_Operation_DestroyStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedOffer_Operation_Destroy(popr, false) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) + } +} +func TestTaskInfoStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedTaskInfo(popr, false) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) + } +} +func TestTaskStatusStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedTaskStatus(popr, false) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) + } +} +func TestFiltersStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedFilters(popr, false) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) + } +} +func TestEnvironmentStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedEnvironment(popr, false) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) + } +} +func TestEnvironment_VariableStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedEnvironment_Variable(popr, false) - data, err := github_com_gogo_protobuf_proto3.Marshal(p) - if err != nil { - panic(err) - } - msg := &Environment_Variable{} - if err := github_com_gogo_protobuf_proto3.Unmarshal(data, msg); err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) } } -func TestParameterVerboseEqual(t *testing6.T) { - popr := math_rand6.New(math_rand6.NewSource(time6.Now().UnixNano())) +func TestParameterStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedParameter(popr, false) - data, err := github_com_gogo_protobuf_proto3.Marshal(p) - if err != nil { - panic(err) - } - msg := &Parameter{} - if err := github_com_gogo_protobuf_proto3.Unmarshal(data, msg); err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) } } -func TestParametersVerboseEqual(t *testing6.T) { - popr := math_rand6.New(math_rand6.NewSource(time6.Now().UnixNano())) +func TestParametersStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedParameters(popr, false) - data, err := github_com_gogo_protobuf_proto3.Marshal(p) - if err != nil { - panic(err) - } - msg := &Parameters{} - if err := github_com_gogo_protobuf_proto3.Unmarshal(data, msg); err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) } } -func TestCredentialVerboseEqual(t *testing6.T) { - popr := math_rand6.New(math_rand6.NewSource(time6.Now().UnixNano())) +func TestCredentialStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedCredential(popr, false) - data, err := github_com_gogo_protobuf_proto3.Marshal(p) - if err != nil { - panic(err) - } - msg := &Credential{} - if err := github_com_gogo_protobuf_proto3.Unmarshal(data, msg); err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) } } -func TestCredentialsVerboseEqual(t *testing6.T) { - popr := math_rand6.New(math_rand6.NewSource(time6.Now().UnixNano())) +func TestCredentialsStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedCredentials(popr, false) - data, err := github_com_gogo_protobuf_proto3.Marshal(p) - if err != nil { - panic(err) - } - msg := &Credentials{} - if err := github_com_gogo_protobuf_proto3.Unmarshal(data, msg); err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) } } -func TestACLVerboseEqual(t *testing6.T) { - popr := math_rand6.New(math_rand6.NewSource(time6.Now().UnixNano())) +func TestACLStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedACL(popr, false) - data, err := github_com_gogo_protobuf_proto3.Marshal(p) - if err != nil { - panic(err) - } - msg := &ACL{} - if err := github_com_gogo_protobuf_proto3.Unmarshal(data, msg); err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) } } -func TestACL_EntityVerboseEqual(t *testing6.T) { - popr := math_rand6.New(math_rand6.NewSource(time6.Now().UnixNano())) +func TestACL_EntityStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedACL_Entity(popr, false) - data, err := github_com_gogo_protobuf_proto3.Marshal(p) - if err != nil { - panic(err) - } - msg := &ACL_Entity{} - if err := github_com_gogo_protobuf_proto3.Unmarshal(data, msg); err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) } } -func TestACL_RegisterFrameworkVerboseEqual(t *testing6.T) { - popr := math_rand6.New(math_rand6.NewSource(time6.Now().UnixNano())) +func TestACL_RegisterFrameworkStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedACL_RegisterFramework(popr, false) - data, err := github_com_gogo_protobuf_proto3.Marshal(p) - if err != nil { - panic(err) - } - msg := &ACL_RegisterFramework{} - if err := github_com_gogo_protobuf_proto3.Unmarshal(data, msg); err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) } } -func TestACL_RunTaskVerboseEqual(t *testing6.T) { - popr := math_rand6.New(math_rand6.NewSource(time6.Now().UnixNano())) +func TestACL_RunTaskStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedACL_RunTask(popr, false) - data, err := github_com_gogo_protobuf_proto3.Marshal(p) - if err != nil { - panic(err) - } - msg := &ACL_RunTask{} - if err := github_com_gogo_protobuf_proto3.Unmarshal(data, msg); err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) } } -func TestACL_ShutdownFrameworkVerboseEqual(t *testing6.T) { - popr := math_rand6.New(math_rand6.NewSource(time6.Now().UnixNano())) +func TestACL_ShutdownFrameworkStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedACL_ShutdownFramework(popr, false) - data, err := github_com_gogo_protobuf_proto3.Marshal(p) - if err != nil { - panic(err) - } - msg := &ACL_ShutdownFramework{} - if err := github_com_gogo_protobuf_proto3.Unmarshal(data, msg); err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) } } -func TestACLsVerboseEqual(t *testing6.T) { - popr := math_rand6.New(math_rand6.NewSource(time6.Now().UnixNano())) +func TestACLsStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedACLs(popr, false) - data, err := github_com_gogo_protobuf_proto3.Marshal(p) - if err != nil { - panic(err) - } - msg := &ACLs{} - if err := github_com_gogo_protobuf_proto3.Unmarshal(data, msg); err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) } } -func TestRateLimitVerboseEqual(t *testing6.T) { - popr := math_rand6.New(math_rand6.NewSource(time6.Now().UnixNano())) +func TestRateLimitStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedRateLimit(popr, false) - data, err := github_com_gogo_protobuf_proto3.Marshal(p) - if err != nil { - panic(err) - } - msg := &RateLimit{} - if err := github_com_gogo_protobuf_proto3.Unmarshal(data, msg); err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) } } -func TestRateLimitsVerboseEqual(t *testing6.T) { - popr := math_rand6.New(math_rand6.NewSource(time6.Now().UnixNano())) +func TestRateLimitsStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedRateLimits(popr, false) - data, err := github_com_gogo_protobuf_proto3.Marshal(p) - if err != nil { - panic(err) - } - msg := &RateLimits{} - if err := github_com_gogo_protobuf_proto3.Unmarshal(data, msg); err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) } } -func TestVolumeVerboseEqual(t *testing6.T) { - popr := math_rand6.New(math_rand6.NewSource(time6.Now().UnixNano())) +func TestVolumeStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedVolume(popr, false) - data, err := github_com_gogo_protobuf_proto3.Marshal(p) - if err != nil { - panic(err) - } - msg := &Volume{} - if err := github_com_gogo_protobuf_proto3.Unmarshal(data, msg); err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) } } -func TestContainerInfoVerboseEqual(t *testing6.T) { - popr := math_rand6.New(math_rand6.NewSource(time6.Now().UnixNano())) +func TestContainerInfoStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedContainerInfo(popr, false) - data, err := github_com_gogo_protobuf_proto3.Marshal(p) - if err != nil { - panic(err) - } - msg := &ContainerInfo{} - if err := github_com_gogo_protobuf_proto3.Unmarshal(data, msg); err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) } } -func TestContainerInfo_DockerInfoVerboseEqual(t *testing6.T) { - popr := math_rand6.New(math_rand6.NewSource(time6.Now().UnixNano())) +func TestContainerInfo_DockerInfoStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedContainerInfo_DockerInfo(popr, false) - data, err := github_com_gogo_protobuf_proto3.Marshal(p) - if err != nil { - panic(err) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) } - msg := &ContainerInfo_DockerInfo{} - if err := github_com_gogo_protobuf_proto3.Unmarshal(data, msg); err != nil { - panic(err) +} +func TestContainerInfo_DockerInfo_PortMappingStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedContainerInfo_DockerInfo_PortMapping(popr, false) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) +} +func TestLabelsStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedLabels(popr, false) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) } } -func TestContainerInfo_DockerInfo_PortMappingVerboseEqual(t *testing6.T) { - popr := math_rand6.New(math_rand6.NewSource(time6.Now().UnixNano())) - p := NewPopulatedContainerInfo_DockerInfo_PortMapping(popr, false) - data, err := github_com_gogo_protobuf_proto3.Marshal(p) - if err != nil { - panic(err) +func TestLabelStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedLabel(popr, false) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) } - msg := &ContainerInfo_DockerInfo_PortMapping{} - if err := github_com_gogo_protobuf_proto3.Unmarshal(data, msg); err != nil { - panic(err) +} +func TestPortStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedPort(popr, false) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) +} +func TestPortsStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedPorts(popr, false) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) + } +} +func TestDiscoveryInfoStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedDiscoveryInfo(popr, false) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) + if s1 != s2 { + t.Fatalf("String want %v got %v", s1, s2) } } diff --git a/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/messages.pb.go b/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/messages.pb.go index 72d1ef70f2a0..7b62a9524f11 100644 --- a/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/messages.pb.go +++ b/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/messages.pb.go @@ -5,12 +5,14 @@ package mesosproto import proto "github.com/gogo/protobuf/proto" +import fmt "fmt" import math "math" -// discarding unused import gogoproto "github.com/gogo/protobuf/gogoproto/gogo.pb" +// discarding unused import gogoproto "github.com/gogo/protobuf/gogoproto" // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal +var _ = fmt.Errorf var _ = math.Inf type StatusUpdateRecord_Type int32 @@ -71,7 +73,13 @@ type Task struct { // NOTE: Either both the fields must be set or both must be unset. StatusUpdateState *TaskState `protobuf:"varint,9,opt,name=status_update_state,enum=mesosproto.TaskState" json:"status_update_state,omitempty"` StatusUpdateUuid []byte `protobuf:"bytes,10,opt,name=status_update_uuid" json:"status_update_uuid,omitempty"` - XXX_unrecognized []byte `json:"-"` + Labels *Labels `protobuf:"bytes,11,opt,name=labels" json:"labels,omitempty"` + // Service discovery information for the task. It is not interpreted + // or acted upon by Mesos. It is up to a service discovery system + // to use this information as needed and to handle tasks without + // service discovery information. + Discovery *DiscoveryInfo `protobuf:"bytes,12,opt,name=discovery" json:"discovery,omitempty"` + XXX_unrecognized []byte `json:"-"` } func (m *Task) Reset() { *m = Task{} } @@ -148,33 +156,18 @@ func (m *Task) GetStatusUpdateUuid() []byte { return nil } -// Describes a role, which are used to group frameworks for allocation -// decisions, depending on the allocation policy being used. -// The weight field can be used to indicate forms of priority. -type RoleInfo struct { - Name *string `protobuf:"bytes,1,req,name=name" json:"name,omitempty"` - Weight *float64 `protobuf:"fixed64,2,opt,name=weight,def=1" json:"weight,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *RoleInfo) Reset() { *m = RoleInfo{} } -func (m *RoleInfo) String() string { return proto.CompactTextString(m) } -func (*RoleInfo) ProtoMessage() {} - -const Default_RoleInfo_Weight float64 = 1 - -func (m *RoleInfo) GetName() string { - if m != nil && m.Name != nil { - return *m.Name +func (m *Task) GetLabels() *Labels { + if m != nil { + return m.Labels } - return "" + return nil } -func (m *RoleInfo) GetWeight() float64 { - if m != nil && m.Weight != nil { - return *m.Weight +func (m *Task) GetDiscovery() *DiscoveryInfo { + if m != nil { + return m.Discovery } - return Default_RoleInfo_Weight + return nil } // TODO(vinod): Create a new UUID message type. @@ -184,7 +177,10 @@ type StatusUpdate struct { SlaveId *SlaveID `protobuf:"bytes,3,opt,name=slave_id" json:"slave_id,omitempty"` Status *TaskStatus `protobuf:"bytes,4,req,name=status" json:"status,omitempty"` Timestamp *float64 `protobuf:"fixed64,5,req,name=timestamp" json:"timestamp,omitempty"` - Uuid []byte `protobuf:"bytes,6,req,name=uuid" json:"uuid,omitempty"` + // This is being deprecated in favor of TaskStatus.uuid. In 0.23.0, + // we set the TaskStatus 'uuid' in the executor driver for all + // retryable status updates. + Uuid []byte `protobuf:"bytes,6,opt,name=uuid" json:"uuid,omitempty"` // This corresponds to the latest state of the task according to the // slave. Note that this state might be different than the state in // 'status' because status update manager queues updates. In other @@ -635,7 +631,8 @@ func (m *ReviveOffersMessage) GetFrameworkId() *FrameworkID { } type RunTaskMessage struct { - FrameworkId *FrameworkID `protobuf:"bytes,1,req,name=framework_id" json:"framework_id,omitempty"` + // TODO(karya): Remove framework_id after MESOS-2559 has shipped. + FrameworkId *FrameworkID `protobuf:"bytes,1,opt,name=framework_id" json:"framework_id,omitempty"` Framework *FrameworkInfo `protobuf:"bytes,2,req,name=framework" json:"framework,omitempty"` Pid *string `protobuf:"bytes,3,req,name=pid" json:"pid,omitempty"` Task *TaskInfo `protobuf:"bytes,4,req,name=task" json:"task,omitempty"` @@ -830,6 +827,10 @@ func (m *FrameworkErrorMessage) GetMessage() string { type RegisterSlaveMessage struct { Slave *SlaveInfo `protobuf:"bytes,1,req,name=slave" json:"slave,omitempty"` + // Resources that are checkpointed by the slave (e.g., persistent + // volume or dynamic reservation). Frameworks need to release + // checkpointed resources explicitly. + CheckpointedResources []*Resource `protobuf:"bytes,3,rep,name=checkpointed_resources" json:"checkpointed_resources,omitempty"` // NOTE: This is a hack for the master to detect the slave's // version. If unset the slave is < 0.21.0. // TODO(bmahler): Do proper versioning: MESOS-986. @@ -848,6 +849,13 @@ func (m *RegisterSlaveMessage) GetSlave() *SlaveInfo { return nil } +func (m *RegisterSlaveMessage) GetCheckpointedResources() []*Resource { + if m != nil { + return m.CheckpointedResources + } + return nil +} + func (m *RegisterSlaveMessage) GetVersion() string { if m != nil && m.Version != nil { return *m.Version @@ -856,14 +864,14 @@ func (m *RegisterSlaveMessage) GetVersion() string { } type ReregisterSlaveMessage struct { - // TODO(bmahler): slave_id is deprecated. - // 0.21.0: Now an optional field. Always written, never read. - // 0.22.0: Remove this field. - SlaveId *SlaveID `protobuf:"bytes,1,opt,name=slave_id" json:"slave_id,omitempty"` - Slave *SlaveInfo `protobuf:"bytes,2,req,name=slave" json:"slave,omitempty"` - ExecutorInfos []*ExecutorInfo `protobuf:"bytes,4,rep,name=executor_infos" json:"executor_infos,omitempty"` - Tasks []*Task `protobuf:"bytes,3,rep,name=tasks" json:"tasks,omitempty"` - CompletedFrameworks []*Archive_Framework `protobuf:"bytes,5,rep,name=completed_frameworks" json:"completed_frameworks,omitempty"` + Slave *SlaveInfo `protobuf:"bytes,2,req,name=slave" json:"slave,omitempty"` + // Resources that are checkpointed by the slave (e.g., persistent + // volume or dynamic reservation). Frameworks need to release + // checkpointed resources explicitly. + CheckpointedResources []*Resource `protobuf:"bytes,7,rep,name=checkpointed_resources" json:"checkpointed_resources,omitempty"` + ExecutorInfos []*ExecutorInfo `protobuf:"bytes,4,rep,name=executor_infos" json:"executor_infos,omitempty"` + Tasks []*Task `protobuf:"bytes,3,rep,name=tasks" json:"tasks,omitempty"` + CompletedFrameworks []*Archive_Framework `protobuf:"bytes,5,rep,name=completed_frameworks" json:"completed_frameworks,omitempty"` // NOTE: This is a hack for the master to detect the slave's // version. If unset the slave is < 0.21.0. // TODO(bmahler): Do proper versioning: MESOS-986. @@ -875,16 +883,16 @@ func (m *ReregisterSlaveMessage) Reset() { *m = ReregisterSlaveMessage{} func (m *ReregisterSlaveMessage) String() string { return proto.CompactTextString(m) } func (*ReregisterSlaveMessage) ProtoMessage() {} -func (m *ReregisterSlaveMessage) GetSlaveId() *SlaveID { +func (m *ReregisterSlaveMessage) GetSlave() *SlaveInfo { if m != nil { - return m.SlaveId + return m.Slave } return nil } -func (m *ReregisterSlaveMessage) GetSlave() *SlaveInfo { +func (m *ReregisterSlaveMessage) GetCheckpointedResources() []*Resource { if m != nil { - return m.Slave + return m.CheckpointedResources } return nil } @@ -918,8 +926,9 @@ func (m *ReregisterSlaveMessage) GetVersion() string { } type SlaveRegisteredMessage struct { - SlaveId *SlaveID `protobuf:"bytes,1,req,name=slave_id" json:"slave_id,omitempty"` - XXX_unrecognized []byte `json:"-"` + SlaveId *SlaveID `protobuf:"bytes,1,req,name=slave_id" json:"slave_id,omitempty"` + Connection *MasterSlaveConnection `protobuf:"bytes,2,opt,name=connection" json:"connection,omitempty"` + XXX_unrecognized []byte `json:"-"` } func (m *SlaveRegisteredMessage) Reset() { *m = SlaveRegisteredMessage{} } @@ -933,9 +942,17 @@ func (m *SlaveRegisteredMessage) GetSlaveId() *SlaveID { return nil } +func (m *SlaveRegisteredMessage) GetConnection() *MasterSlaveConnection { + if m != nil { + return m.Connection + } + return nil +} + type SlaveReregisteredMessage struct { SlaveId *SlaveID `protobuf:"bytes,1,req,name=slave_id" json:"slave_id,omitempty"` Reconciliations []*ReconcileTasksMessage `protobuf:"bytes,2,rep,name=reconciliations" json:"reconciliations,omitempty"` + Connection *MasterSlaveConnection `protobuf:"bytes,3,opt,name=connection" json:"connection,omitempty"` XXX_unrecognized []byte `json:"-"` } @@ -957,6 +974,13 @@ func (m *SlaveReregisteredMessage) GetReconciliations() []*ReconcileTasksMessage return nil } +func (m *SlaveReregisteredMessage) GetConnection() *MasterSlaveConnection { + if m != nil { + return m.Connection + } + return nil +} + type UnregisterSlaveMessage struct { SlaveId *SlaveID `protobuf:"bytes,1,req,name=slave_id" json:"slave_id,omitempty"` XXX_unrecognized []byte `json:"-"` @@ -973,6 +997,25 @@ func (m *UnregisterSlaveMessage) GetSlaveId() *SlaveID { return nil } +type MasterSlaveConnection struct { + // Product of max_slave_ping_timeouts * slave_ping_timeout. + // If no pings are received within the total timeout, + // the master will remove the slave. + TotalPingTimeoutSeconds *float64 `protobuf:"fixed64,1,opt,name=total_ping_timeout_seconds" json:"total_ping_timeout_seconds,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *MasterSlaveConnection) Reset() { *m = MasterSlaveConnection{} } +func (m *MasterSlaveConnection) String() string { return proto.CompactTextString(m) } +func (*MasterSlaveConnection) ProtoMessage() {} + +func (m *MasterSlaveConnection) GetTotalPingTimeoutSeconds() float64 { + if m != nil && m.TotalPingTimeoutSeconds != nil { + return *m.TotalPingTimeoutSeconds + } + return 0 +} + // This message is periodically sent by the master to the slave. // If the slave is connected to the master, "connected" is true. type PingSlaveMessage struct { @@ -1018,16 +1061,34 @@ func (m *ShutdownFrameworkMessage) GetFrameworkId() *FrameworkID { return nil } -// Tells the executor to initiate a shut down by invoking -// Executor::shutdown. +// Tells a slave (and consequently executor) to shutdown an executor. type ShutdownExecutorMessage struct { - XXX_unrecognized []byte `json:"-"` + // TODO(vinod): Make these fields required. These are made optional + // for backwards compatibility between 0.23.0 slave and pre 0.23.0 + // executor driver. + ExecutorId *ExecutorID `protobuf:"bytes,1,opt,name=executor_id" json:"executor_id,omitempty"` + FrameworkId *FrameworkID `protobuf:"bytes,2,opt,name=framework_id" json:"framework_id,omitempty"` + XXX_unrecognized []byte `json:"-"` } func (m *ShutdownExecutorMessage) Reset() { *m = ShutdownExecutorMessage{} } func (m *ShutdownExecutorMessage) String() string { return proto.CompactTextString(m) } func (*ShutdownExecutorMessage) ProtoMessage() {} +func (m *ShutdownExecutorMessage) GetExecutorId() *ExecutorID { + if m != nil { + return m.ExecutorId + } + return nil +} + +func (m *ShutdownExecutorMessage) GetFrameworkId() *FrameworkID { + if m != nil { + return m.FrameworkId + } + return nil +} + type UpdateFrameworkMessage struct { FrameworkId *FrameworkID `protobuf:"bytes,1,req,name=framework_id" json:"framework_id,omitempty"` Pid *string `protobuf:"bytes,2,req,name=pid" json:"pid,omitempty"` @@ -1052,6 +1113,52 @@ func (m *UpdateFrameworkMessage) GetPid() string { return "" } +// This message is sent to the slave whenever there is an update of +// the resources that need to be checkpointed (e.g., persistent volume +// or dynamic reservation). +type CheckpointResourcesMessage struct { + Resources []*Resource `protobuf:"bytes,1,rep,name=resources" json:"resources,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *CheckpointResourcesMessage) Reset() { *m = CheckpointResourcesMessage{} } +func (m *CheckpointResourcesMessage) String() string { return proto.CompactTextString(m) } +func (*CheckpointResourcesMessage) ProtoMessage() {} + +func (m *CheckpointResourcesMessage) GetResources() []*Resource { + if m != nil { + return m.Resources + } + return nil +} + +// This message is sent by the slave to the master to inform the +// master about the total amount of oversubscribed (allocated and +// allocatable) resources. +type UpdateSlaveMessage struct { + SlaveId *SlaveID `protobuf:"bytes,1,req,name=slave_id" json:"slave_id,omitempty"` + OversubscribedResources []*Resource `protobuf:"bytes,2,rep,name=oversubscribed_resources" json:"oversubscribed_resources,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *UpdateSlaveMessage) Reset() { *m = UpdateSlaveMessage{} } +func (m *UpdateSlaveMessage) String() string { return proto.CompactTextString(m) } +func (*UpdateSlaveMessage) ProtoMessage() {} + +func (m *UpdateSlaveMessage) GetSlaveId() *SlaveID { + if m != nil { + return m.SlaveId + } + return nil +} + +func (m *UpdateSlaveMessage) GetOversubscribedResources() []*Resource { + if m != nil { + return m.OversubscribedResources + } + return nil +} + type RegisterExecutorMessage struct { FrameworkId *FrameworkID `protobuf:"bytes,1,req,name=framework_id" json:"framework_id,omitempty"` ExecutorId *ExecutorID `protobuf:"bytes,2,req,name=executor_id" json:"executor_id,omitempty"` @@ -1260,110 +1367,6 @@ func (m *ShutdownMessage) GetMessage() string { return "" } -type AuthenticateMessage struct { - Pid *string `protobuf:"bytes,1,req,name=pid" json:"pid,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *AuthenticateMessage) Reset() { *m = AuthenticateMessage{} } -func (m *AuthenticateMessage) String() string { return proto.CompactTextString(m) } -func (*AuthenticateMessage) ProtoMessage() {} - -func (m *AuthenticateMessage) GetPid() string { - if m != nil && m.Pid != nil { - return *m.Pid - } - return "" -} - -type AuthenticationMechanismsMessage struct { - Mechanisms []string `protobuf:"bytes,1,rep,name=mechanisms" json:"mechanisms,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *AuthenticationMechanismsMessage) Reset() { *m = AuthenticationMechanismsMessage{} } -func (m *AuthenticationMechanismsMessage) String() string { return proto.CompactTextString(m) } -func (*AuthenticationMechanismsMessage) ProtoMessage() {} - -func (m *AuthenticationMechanismsMessage) GetMechanisms() []string { - if m != nil { - return m.Mechanisms - } - return nil -} - -type AuthenticationStartMessage struct { - Mechanism *string `protobuf:"bytes,1,req,name=mechanism" json:"mechanism,omitempty"` - Data *string `protobuf:"bytes,2,opt,name=data" json:"data,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *AuthenticationStartMessage) Reset() { *m = AuthenticationStartMessage{} } -func (m *AuthenticationStartMessage) String() string { return proto.CompactTextString(m) } -func (*AuthenticationStartMessage) ProtoMessage() {} - -func (m *AuthenticationStartMessage) GetMechanism() string { - if m != nil && m.Mechanism != nil { - return *m.Mechanism - } - return "" -} - -func (m *AuthenticationStartMessage) GetData() string { - if m != nil && m.Data != nil { - return *m.Data - } - return "" -} - -type AuthenticationStepMessage struct { - Data []byte `protobuf:"bytes,1,req,name=data" json:"data,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *AuthenticationStepMessage) Reset() { *m = AuthenticationStepMessage{} } -func (m *AuthenticationStepMessage) String() string { return proto.CompactTextString(m) } -func (*AuthenticationStepMessage) ProtoMessage() {} - -func (m *AuthenticationStepMessage) GetData() []byte { - if m != nil { - return m.Data - } - return nil -} - -type AuthenticationCompletedMessage struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *AuthenticationCompletedMessage) Reset() { *m = AuthenticationCompletedMessage{} } -func (m *AuthenticationCompletedMessage) String() string { return proto.CompactTextString(m) } -func (*AuthenticationCompletedMessage) ProtoMessage() {} - -type AuthenticationFailedMessage struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *AuthenticationFailedMessage) Reset() { *m = AuthenticationFailedMessage{} } -func (m *AuthenticationFailedMessage) String() string { return proto.CompactTextString(m) } -func (*AuthenticationFailedMessage) ProtoMessage() {} - -type AuthenticationErrorMessage struct { - Error *string `protobuf:"bytes,1,opt,name=error" json:"error,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *AuthenticationErrorMessage) Reset() { *m = AuthenticationErrorMessage{} } -func (m *AuthenticationErrorMessage) String() string { return proto.CompactTextString(m) } -func (*AuthenticationErrorMessage) ProtoMessage() {} - -func (m *AuthenticationErrorMessage) GetError() string { - if m != nil && m.Error != nil { - return *m.Error - } - return "" -} - // * // Describes Completed Frameworks, etc. for archival. type Archive struct { @@ -1465,86 +1468,24 @@ func (m *TaskHealthStatus) GetConsecutiveFailures() int32 { return 0 } -// Collection of Modules. -type Modules struct { - Libraries []*Modules_Library `protobuf:"bytes,1,rep,name=libraries" json:"libraries,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Modules) Reset() { *m = Modules{} } -func (m *Modules) String() string { return proto.CompactTextString(m) } -func (*Modules) ProtoMessage() {} - -func (m *Modules) GetLibraries() []*Modules_Library { - if m != nil { - return m.Libraries - } - return nil -} - -type Modules_Library struct { - // If "file" contains a slash ("/"), then it is interpreted as a - // (relative or absolute) pathname. Otherwise a standard library - // search is performed. - File *string `protobuf:"bytes,1,opt,name=file" json:"file,omitempty"` - // We will add the proper prefix ("lib") and suffix (".so" for - // Linux and ".dylib" for OS X) to the "name". - Name *string `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"` - Modules []*Modules_Library_Module `protobuf:"bytes,3,rep,name=modules" json:"modules,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Modules_Library) Reset() { *m = Modules_Library{} } -func (m *Modules_Library) String() string { return proto.CompactTextString(m) } -func (*Modules_Library) ProtoMessage() {} - -func (m *Modules_Library) GetFile() string { - if m != nil && m.File != nil { - return *m.File - } - return "" -} - -func (m *Modules_Library) GetName() string { - if m != nil && m.Name != nil { - return *m.Name - } - return "" -} - -func (m *Modules_Library) GetModules() []*Modules_Library_Module { - if m != nil { - return m.Modules - } - return nil -} - -type Modules_Library_Module struct { - // Module name. - Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` - // Module-specific parameters. - Parameters []*Parameter `protobuf:"bytes,2,rep,name=parameters" json:"parameters,omitempty"` - XXX_unrecognized []byte `json:"-"` +// * +// Message to signal completion of an event within a module. +type HookExecuted struct { + Module *string `protobuf:"bytes,1,opt,name=module" json:"module,omitempty"` + XXX_unrecognized []byte `json:"-"` } -func (m *Modules_Library_Module) Reset() { *m = Modules_Library_Module{} } -func (m *Modules_Library_Module) String() string { return proto.CompactTextString(m) } -func (*Modules_Library_Module) ProtoMessage() {} +func (m *HookExecuted) Reset() { *m = HookExecuted{} } +func (m *HookExecuted) String() string { return proto.CompactTextString(m) } +func (*HookExecuted) ProtoMessage() {} -func (m *Modules_Library_Module) GetName() string { - if m != nil && m.Name != nil { - return *m.Name +func (m *HookExecuted) GetModule() string { + if m != nil && m.Module != nil { + return *m.Module } return "" } -func (m *Modules_Library_Module) GetParameters() []*Parameter { - if m != nil { - return m.Parameters - } - return nil -} - func init() { proto.RegisterEnum("mesosproto.StatusUpdateRecord_Type", StatusUpdateRecord_Type_name, StatusUpdateRecord_Type_value) } diff --git a/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/messages.proto b/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/messages.proto index 0182f419e88c..d58c99e9da16 100644 --- a/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/messages.proto +++ b/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/messages.proto @@ -54,15 +54,14 @@ message Task { // NOTE: Either both the fields must be set or both must be unset. optional TaskState status_update_state = 9; optional bytes status_update_uuid = 10; -} + optional Labels labels = 11; -// Describes a role, which are used to group frameworks for allocation -// decisions, depending on the allocation policy being used. -// The weight field can be used to indicate forms of priority. -message RoleInfo { - required string name = 1; - optional double weight = 2 [default = 1]; + // Service discovery information for the task. It is not interpreted + // or acted upon by Mesos. It is up to a service discovery system + // to use this information as needed and to handle tasks without + // service discovery information. + optional DiscoveryInfo discovery = 12; } @@ -73,7 +72,11 @@ message StatusUpdate { optional SlaveID slave_id = 3; required TaskStatus status = 4; required double timestamp = 5; - required bytes uuid = 6; + + // This is being deprecated in favor of TaskStatus.uuid. In 0.23.0, + // we set the TaskStatus 'uuid' in the executor driver for all + // retryable status updates. + optional bytes uuid = 6; // This corresponds to the latest state of the task according to the // slave. Note that this state might be different than the state in @@ -188,7 +191,8 @@ message ReviveOffersMessage { message RunTaskMessage { - required FrameworkID framework_id = 1; + // TODO(karya): Remove framework_id after MESOS-2559 has shipped. + optional FrameworkID framework_id = 1 [deprecated = true]; required FrameworkInfo framework = 2; required string pid = 3; required TaskInfo task = 4; @@ -244,6 +248,11 @@ message FrameworkErrorMessage { message RegisterSlaveMessage { required SlaveInfo slave = 1; + // Resources that are checkpointed by the slave (e.g., persistent + // volume or dynamic reservation). Frameworks need to release + // checkpointed resources explicitly. + repeated Resource checkpointed_resources = 3; + // NOTE: This is a hack for the master to detect the slave's // version. If unset the slave is < 0.21.0. // TODO(bmahler): Do proper versioning: MESOS-986. @@ -252,11 +261,13 @@ message RegisterSlaveMessage { message ReregisterSlaveMessage { - // TODO(bmahler): slave_id is deprecated. - // 0.21.0: Now an optional field. Always written, never read. - // 0.22.0: Remove this field. - optional SlaveID slave_id = 1; required SlaveInfo slave = 2; + + // Resources that are checkpointed by the slave (e.g., persistent + // volume or dynamic reservation). Frameworks need to release + // checkpointed resources explicitly. + repeated Resource checkpointed_resources = 7; + repeated ExecutorInfo executor_infos = 4; repeated Task tasks = 3; repeated Archive.Framework completed_frameworks = 5; @@ -270,6 +281,7 @@ message ReregisterSlaveMessage { message SlaveRegisteredMessage { required SlaveID slave_id = 1; + optional MasterSlaveConnection connection = 2; } @@ -277,6 +289,7 @@ message SlaveReregisteredMessage { required SlaveID slave_id = 1; repeated ReconcileTasksMessage reconciliations = 2; + optional MasterSlaveConnection connection = 3; } @@ -285,6 +298,14 @@ message UnregisterSlaveMessage { } +message MasterSlaveConnection { + // Product of max_slave_ping_timeouts * slave_ping_timeout. + // If no pings are received within the total timeout, + // the master will remove the slave. + optional double total_ping_timeout_seconds = 1; +} + + // This message is periodically sent by the master to the slave. // If the slave is connected to the master, "connected" is true. message PingSlaveMessage { @@ -303,9 +324,14 @@ message ShutdownFrameworkMessage { } -// Tells the executor to initiate a shut down by invoking -// Executor::shutdown. -message ShutdownExecutorMessage {} +// Tells a slave (and consequently executor) to shutdown an executor. +message ShutdownExecutorMessage { + // TODO(vinod): Make these fields required. These are made optional + // for backwards compatibility between 0.23.0 slave and pre 0.23.0 + // executor driver. + optional ExecutorID executor_id = 1; + optional FrameworkID framework_id = 2; +} message UpdateFrameworkMessage { @@ -314,6 +340,23 @@ message UpdateFrameworkMessage { } +// This message is sent to the slave whenever there is an update of +// the resources that need to be checkpointed (e.g., persistent volume +// or dynamic reservation). +message CheckpointResourcesMessage { + repeated Resource resources = 1; +} + + +// This message is sent by the slave to the master to inform the +// master about the total amount of oversubscribed (allocated and +// allocatable) resources. +message UpdateSlaveMessage { + required SlaveID slave_id = 1; + repeated Resource oversubscribed_resources = 2; +} + + message RegisterExecutorMessage { required FrameworkID framework_id = 1; required ExecutorID executor_id = 2; @@ -361,38 +404,6 @@ message ShutdownMessage { } -message AuthenticateMessage { - required string pid = 1; // PID that needs to be authenticated. -} - - -message AuthenticationMechanismsMessage { - repeated string mechanisms = 1; // List of available SASL mechanisms. -} - - -message AuthenticationStartMessage { - required string mechanism = 1; - optional string data = 2; -} - - -message AuthenticationStepMessage { - required bytes data = 1; -} - - -message AuthenticationCompletedMessage {} - - -message AuthenticationFailedMessage {} - - -message AuthenticationErrorMessage { - optional string error = 1; -} - - // TODO(adam-mesos): Move this to an 'archive' package. /** * Describes Completed Frameworks, etc. for archival. @@ -426,28 +437,9 @@ message TaskHealthStatus { } -// Collection of Modules. -message Modules { - message Library { - // If "file" contains a slash ("/"), then it is interpreted as a - // (relative or absolute) pathname. Otherwise a standard library - // search is performed. - optional string file = 1; - - // We will add the proper prefix ("lib") and suffix (".so" for - // Linux and ".dylib" for OS X) to the "name". - optional string name = 2; - - message Module { - // Module name. - optional string name = 1; - - // Module-specific parameters. - repeated Parameter parameters = 2; - } - - repeated Module modules = 3; - } - - repeated Library libraries = 1; +/** + * Message to signal completion of an event within a module. + */ +message HookExecuted { + optional string module = 1; } diff --git a/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/registry.pb.go b/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/registry.pb.go index 77e782234698..0157ec37670c 100644 --- a/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/registry.pb.go +++ b/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/registry.pb.go @@ -5,12 +5,14 @@ package mesosproto import proto "github.com/gogo/protobuf/proto" +import fmt "fmt" import math "math" -// discarding unused import gogoproto "github.com/gogo/protobuf/gogoproto/gogo.pb" +// discarding unused import gogoproto "github.com/gogo/protobuf/gogoproto" // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal +var _ = fmt.Errorf var _ = math.Inf type Registry struct { @@ -86,6 +88,3 @@ func (m *Registry_Slaves) GetSlaves() []*Registry_Slave { } return nil } - -func init() { -} diff --git a/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/scheduler.pb.go b/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/scheduler.pb.go index f90c727ae0bf..29a56ce181ae 100644 --- a/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/scheduler.pb.go +++ b/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/scheduler.pb.go @@ -5,12 +5,14 @@ package mesosproto import proto "github.com/gogo/protobuf/proto" +import fmt "fmt" import math "math" -// discarding unused import gogoproto "github.com/gogo/protobuf/gogoproto/gogo.pb" +// discarding unused import gogoproto "github.com/gogo/protobuf/gogoproto" // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal +var _ = fmt.Errorf var _ = math.Inf // Possible event types, followed by message definitions if @@ -18,35 +20,32 @@ var _ = math.Inf type Event_Type int32 const ( - Event_REGISTERED Event_Type = 1 - Event_REREGISTERED Event_Type = 2 - Event_OFFERS Event_Type = 3 - Event_RESCIND Event_Type = 4 - Event_UPDATE Event_Type = 5 - Event_MESSAGE Event_Type = 6 - Event_FAILURE Event_Type = 7 - Event_ERROR Event_Type = 8 + Event_SUBSCRIBED Event_Type = 1 + Event_OFFERS Event_Type = 2 + Event_RESCIND Event_Type = 3 + Event_UPDATE Event_Type = 4 + Event_MESSAGE Event_Type = 5 + Event_FAILURE Event_Type = 6 + Event_ERROR Event_Type = 7 ) var Event_Type_name = map[int32]string{ - 1: "REGISTERED", - 2: "REREGISTERED", - 3: "OFFERS", - 4: "RESCIND", - 5: "UPDATE", - 6: "MESSAGE", - 7: "FAILURE", - 8: "ERROR", + 1: "SUBSCRIBED", + 2: "OFFERS", + 3: "RESCIND", + 4: "UPDATE", + 5: "MESSAGE", + 6: "FAILURE", + 7: "ERROR", } var Event_Type_value = map[string]int32{ - "REGISTERED": 1, - "REREGISTERED": 2, - "OFFERS": 3, - "RESCIND": 4, - "UPDATE": 5, - "MESSAGE": 6, - "FAILURE": 7, - "ERROR": 8, + "SUBSCRIBED": 1, + "OFFERS": 2, + "RESCIND": 3, + "UPDATE": 4, + "MESSAGE": 5, + "FAILURE": 6, + "ERROR": 7, } func (x Event_Type) Enum() *Event_Type { @@ -71,44 +70,41 @@ func (x *Event_Type) UnmarshalJSON(data []byte) error { type Call_Type int32 const ( - Call_REGISTER Call_Type = 1 - Call_REREGISTER Call_Type = 2 - Call_UNREGISTER Call_Type = 3 - Call_REQUEST Call_Type = 4 - Call_DECLINE Call_Type = 5 - Call_REVIVE Call_Type = 6 - Call_LAUNCH Call_Type = 7 - Call_KILL Call_Type = 8 - Call_ACKNOWLEDGE Call_Type = 9 - Call_RECONCILE Call_Type = 10 - Call_MESSAGE Call_Type = 11 + Call_SUBSCRIBE Call_Type = 1 + Call_TEARDOWN Call_Type = 2 + Call_ACCEPT Call_Type = 3 + Call_DECLINE Call_Type = 4 + Call_REVIVE Call_Type = 5 + Call_KILL Call_Type = 6 + Call_SHUTDOWN Call_Type = 7 + Call_ACKNOWLEDGE Call_Type = 8 + Call_RECONCILE Call_Type = 9 + Call_MESSAGE Call_Type = 10 ) var Call_Type_name = map[int32]string{ - 1: "REGISTER", - 2: "REREGISTER", - 3: "UNREGISTER", - 4: "REQUEST", - 5: "DECLINE", - 6: "REVIVE", - 7: "LAUNCH", - 8: "KILL", - 9: "ACKNOWLEDGE", - 10: "RECONCILE", - 11: "MESSAGE", + 1: "SUBSCRIBE", + 2: "TEARDOWN", + 3: "ACCEPT", + 4: "DECLINE", + 5: "REVIVE", + 6: "KILL", + 7: "SHUTDOWN", + 8: "ACKNOWLEDGE", + 9: "RECONCILE", + 10: "MESSAGE", } var Call_Type_value = map[string]int32{ - "REGISTER": 1, - "REREGISTER": 2, - "UNREGISTER": 3, - "REQUEST": 4, - "DECLINE": 5, - "REVIVE": 6, - "LAUNCH": 7, - "KILL": 8, - "ACKNOWLEDGE": 9, - "RECONCILE": 10, - "MESSAGE": 11, + "SUBSCRIBE": 1, + "TEARDOWN": 2, + "ACCEPT": 3, + "DECLINE": 4, + "REVIVE": 5, + "KILL": 6, + "SHUTDOWN": 7, + "ACKNOWLEDGE": 8, + "RECONCILE": 9, + "MESSAGE": 10, } func (x Call_Type) Enum() *Call_Type { @@ -129,23 +125,23 @@ func (x *Call_Type) UnmarshalJSON(data []byte) error { } // * -// Low-level scheduler event API. +// Scheduler event API. // // An event is described using the standard protocol buffer "union" -// trick, see https://developers.google.com/protocol-buffers/docs/techniques#union. +// trick, see: +// https://developers.google.com/protocol-buffers/docs/techniques#union. type Event struct { // Type of the event, indicates which optional field below should be // present if that type has a nested message definition. - Type *Event_Type `protobuf:"varint,1,req,name=type,enum=mesosproto.Event_Type" json:"type,omitempty"` - Registered *Event_Registered `protobuf:"bytes,2,opt,name=registered" json:"registered,omitempty"` - Reregistered *Event_Reregistered `protobuf:"bytes,3,opt,name=reregistered" json:"reregistered,omitempty"` - Offers *Event_Offers `protobuf:"bytes,4,opt,name=offers" json:"offers,omitempty"` - Rescind *Event_Rescind `protobuf:"bytes,5,opt,name=rescind" json:"rescind,omitempty"` - Update *Event_Update `protobuf:"bytes,6,opt,name=update" json:"update,omitempty"` - Message *Event_Message `protobuf:"bytes,7,opt,name=message" json:"message,omitempty"` - Failure *Event_Failure `protobuf:"bytes,8,opt,name=failure" json:"failure,omitempty"` - Error *Event_Error `protobuf:"bytes,9,opt,name=error" json:"error,omitempty"` - XXX_unrecognized []byte `json:"-"` + Type *Event_Type `protobuf:"varint,1,req,name=type,enum=mesosproto.Event_Type" json:"type,omitempty"` + Subscribed *Event_Subscribed `protobuf:"bytes,2,opt,name=subscribed" json:"subscribed,omitempty"` + Offers *Event_Offers `protobuf:"bytes,3,opt,name=offers" json:"offers,omitempty"` + Rescind *Event_Rescind `protobuf:"bytes,4,opt,name=rescind" json:"rescind,omitempty"` + Update *Event_Update `protobuf:"bytes,5,opt,name=update" json:"update,omitempty"` + Message *Event_Message `protobuf:"bytes,6,opt,name=message" json:"message,omitempty"` + Failure *Event_Failure `protobuf:"bytes,7,opt,name=failure" json:"failure,omitempty"` + Error *Event_Error `protobuf:"bytes,8,opt,name=error" json:"error,omitempty"` + XXX_unrecognized []byte `json:"-"` } func (m *Event) Reset() { *m = Event{} } @@ -156,19 +152,12 @@ func (m *Event) GetType() Event_Type { if m != nil && m.Type != nil { return *m.Type } - return Event_REGISTERED -} - -func (m *Event) GetRegistered() *Event_Registered { - if m != nil { - return m.Registered - } - return nil + return Event_SUBSCRIBED } -func (m *Event) GetReregistered() *Event_Reregistered { +func (m *Event) GetSubscribed() *Event_Subscribed { if m != nil { - return m.Reregistered + return m.Subscribed } return nil } @@ -215,54 +204,27 @@ func (m *Event) GetError() *Event_Error { return nil } -type Event_Registered struct { +// First event received when the scheduler subscribes. +type Event_Subscribed struct { FrameworkId *FrameworkID `protobuf:"bytes,1,req,name=framework_id" json:"framework_id,omitempty"` - MasterInfo *MasterInfo `protobuf:"bytes,2,req,name=master_info" json:"master_info,omitempty"` XXX_unrecognized []byte `json:"-"` } -func (m *Event_Registered) Reset() { *m = Event_Registered{} } -func (m *Event_Registered) String() string { return proto.CompactTextString(m) } -func (*Event_Registered) ProtoMessage() {} +func (m *Event_Subscribed) Reset() { *m = Event_Subscribed{} } +func (m *Event_Subscribed) String() string { return proto.CompactTextString(m) } +func (*Event_Subscribed) ProtoMessage() {} -func (m *Event_Registered) GetFrameworkId() *FrameworkID { +func (m *Event_Subscribed) GetFrameworkId() *FrameworkID { if m != nil { return m.FrameworkId } return nil } -func (m *Event_Registered) GetMasterInfo() *MasterInfo { - if m != nil { - return m.MasterInfo - } - return nil -} - -type Event_Reregistered struct { - FrameworkId *FrameworkID `protobuf:"bytes,1,req,name=framework_id" json:"framework_id,omitempty"` - MasterInfo *MasterInfo `protobuf:"bytes,2,req,name=master_info" json:"master_info,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Event_Reregistered) Reset() { *m = Event_Reregistered{} } -func (m *Event_Reregistered) String() string { return proto.CompactTextString(m) } -func (*Event_Reregistered) ProtoMessage() {} - -func (m *Event_Reregistered) GetFrameworkId() *FrameworkID { - if m != nil { - return m.FrameworkId - } - return nil -} - -func (m *Event_Reregistered) GetMasterInfo() *MasterInfo { - if m != nil { - return m.MasterInfo - } - return nil -} - +// Received whenever there are new resources that are offered to the +// scheduler. Each offer corresponds to a set of resources on a +// slave. Until the scheduler accepts or declines an offer the +// resources are considered allocated to the scheduler. type Event_Offers struct { Offers []*Offer `protobuf:"bytes,1,rep,name=offers" json:"offers,omitempty"` XXX_unrecognized []byte `json:"-"` @@ -279,6 +241,10 @@ func (m *Event_Offers) GetOffers() []*Offer { return nil } +// Received when a particular offer is no longer valid (e.g., the +// slave corresponding to the offer has been removed) and hence +// needs to be rescinded. Any future calls ('Accept' / 'Decline') made +// by the scheduler regarding this offer will be invalid. type Event_Rescind struct { OfferId *OfferID `protobuf:"bytes,1,req,name=offer_id" json:"offer_id,omitempty"` XXX_unrecognized []byte `json:"-"` @@ -295,9 +261,17 @@ func (m *Event_Rescind) GetOfferId() *OfferID { return nil } +// Received whenever there is a status update that is generated by +// the executor or slave or master. Status updates should be used by +// executors to reliably communicate the status of the tasks that +// they manage. It is crucial that a terminal update (see TaskState +// in mesos.proto) is sent by the executor as soon as the task +// terminates, in order for Mesos to release the resources allocated +// to the task. It is also the responsibility of the scheduler to +// explicitly acknowledge the receipt of a status update. See +// 'Acknowledge' in the 'Call' section below for the semantics. type Event_Update struct { - Uuid []byte `protobuf:"bytes,1,req,name=uuid" json:"uuid,omitempty"` - Status *TaskStatus `protobuf:"bytes,2,req,name=status" json:"status,omitempty"` + Status *TaskStatus `protobuf:"bytes,1,req,name=status" json:"status,omitempty"` XXX_unrecognized []byte `json:"-"` } @@ -305,13 +279,6 @@ func (m *Event_Update) Reset() { *m = Event_Update{} } func (m *Event_Update) String() string { return proto.CompactTextString(m) } func (*Event_Update) ProtoMessage() {} -func (m *Event_Update) GetUuid() []byte { - if m != nil { - return m.Uuid - } - return nil -} - func (m *Event_Update) GetStatus() *TaskStatus { if m != nil { return m.Status @@ -319,6 +286,11 @@ func (m *Event_Update) GetStatus() *TaskStatus { return nil } +// Received when a custom message generated by the executor is +// forwarded by the master. Note that this message is not +// interpreted by Mesos and is only forwarded (without reliability +// guarantees) to the scheduler. It is up to the executor to retry +// if the message is dropped for any reason. type Event_Message struct { SlaveId *SlaveID `protobuf:"bytes,1,req,name=slave_id" json:"slave_id,omitempty"` ExecutorId *ExecutorID `protobuf:"bytes,2,req,name=executor_id" json:"executor_id,omitempty"` @@ -351,6 +323,16 @@ func (m *Event_Message) GetData() []byte { return nil } +// Received when a slave is removed from the cluster (e.g., failed +// health checks) or when an executor is terminated. Note that, this +// event coincides with receipt of terminal UPDATE events for any +// active tasks belonging to the slave or executor and receipt of +// 'Rescind' events for any outstanding offers belonging to the +// slave. Note that there is no guaranteed order between the +// 'Failure', 'Update' and 'Rescind' events when a slave or executor +// is removed. +// TODO(vinod): Consider splitting the lost slave and terminated +// executor into separate events and ensure it's reliably generated. type Event_Failure struct { SlaveId *SlaveID `protobuf:"bytes,1,opt,name=slave_id" json:"slave_id,omitempty"` // If this was just a failure of an executor on a slave then @@ -386,6 +368,13 @@ func (m *Event_Failure) GetStatus() int32 { return 0 } +// Received when an invalid framework (e.g., unauthenticated, +// unauthorized) attempts to subscribe with the master. Error can +// also be received if scheduler sends invalid Calls (e.g., not +// properly initialized). +// TODO(vinod): Remove this once the old scheduler driver is no +// longer supported. With HTTP API all errors will be signaled via +// HTTP response codes. type Event_Error struct { Message *string `protobuf:"bytes,1,req,name=message" json:"message,omitempty"` XXX_unrecognized []byte `json:"-"` @@ -403,25 +392,29 @@ func (m *Event_Error) GetMessage() string { } // * -// Low-level scheduler call API. +// Scheduler call API. // // Like Event, a Call is described using the standard protocol buffer // "union" trick (see above). type Call struct { - // Identifies who generated this call. Always necessary, but the - // only thing that needs to be set for certain calls, e.g., - // REGISTER, REREGISTER, and UNREGISTER. - FrameworkInfo *FrameworkInfo `protobuf:"bytes,1,req,name=framework_info" json:"framework_info,omitempty"` + // Identifies who generated this call. Master assigns a framework id + // when a new scheduler subscribes for the first time. Once assigned, + // the scheduler must set the 'framework_id' here and within its + // FrameworkInfo (in any further 'Subscribe' calls). This allows the + // master to identify a scheduler correctly across disconnections, + // failovers, etc. + FrameworkId *FrameworkID `protobuf:"bytes,1,opt,name=framework_id" json:"framework_id,omitempty"` // Type of the call, indicates which optional field below should be // present if that type has a nested message definition. Type *Call_Type `protobuf:"varint,2,req,name=type,enum=mesosproto.Call_Type" json:"type,omitempty"` - Request *Call_Request `protobuf:"bytes,3,opt,name=request" json:"request,omitempty"` - Decline *Call_Decline `protobuf:"bytes,4,opt,name=decline" json:"decline,omitempty"` - Launch *Call_Launch `protobuf:"bytes,5,opt,name=launch" json:"launch,omitempty"` + Subscribe *Call_Subscribe `protobuf:"bytes,3,opt,name=subscribe" json:"subscribe,omitempty"` + Accept *Call_Accept `protobuf:"bytes,4,opt,name=accept" json:"accept,omitempty"` + Decline *Call_Decline `protobuf:"bytes,5,opt,name=decline" json:"decline,omitempty"` Kill *Call_Kill `protobuf:"bytes,6,opt,name=kill" json:"kill,omitempty"` - Acknowledge *Call_Acknowledge `protobuf:"bytes,7,opt,name=acknowledge" json:"acknowledge,omitempty"` - Reconcile *Call_Reconcile `protobuf:"bytes,8,opt,name=reconcile" json:"reconcile,omitempty"` - Message *Call_Message `protobuf:"bytes,9,opt,name=message" json:"message,omitempty"` + Shutdown *Call_Shutdown `protobuf:"bytes,7,opt,name=shutdown" json:"shutdown,omitempty"` + Acknowledge *Call_Acknowledge `protobuf:"bytes,8,opt,name=acknowledge" json:"acknowledge,omitempty"` + Reconcile *Call_Reconcile `protobuf:"bytes,9,opt,name=reconcile" json:"reconcile,omitempty"` + Message *Call_Message `protobuf:"bytes,10,opt,name=message" json:"message,omitempty"` XXX_unrecognized []byte `json:"-"` } @@ -429,9 +422,9 @@ func (m *Call) Reset() { *m = Call{} } func (m *Call) String() string { return proto.CompactTextString(m) } func (*Call) ProtoMessage() {} -func (m *Call) GetFrameworkInfo() *FrameworkInfo { +func (m *Call) GetFrameworkId() *FrameworkID { if m != nil { - return m.FrameworkInfo + return m.FrameworkId } return nil } @@ -440,26 +433,26 @@ func (m *Call) GetType() Call_Type { if m != nil && m.Type != nil { return *m.Type } - return Call_REGISTER + return Call_SUBSCRIBE } -func (m *Call) GetRequest() *Call_Request { +func (m *Call) GetSubscribe() *Call_Subscribe { if m != nil { - return m.Request + return m.Subscribe } return nil } -func (m *Call) GetDecline() *Call_Decline { +func (m *Call) GetAccept() *Call_Accept { if m != nil { - return m.Decline + return m.Accept } return nil } -func (m *Call) GetLaunch() *Call_Launch { +func (m *Call) GetDecline() *Call_Decline { if m != nil { - return m.Launch + return m.Decline } return nil } @@ -471,6 +464,13 @@ func (m *Call) GetKill() *Call_Kill { return nil } +func (m *Call) GetShutdown() *Call_Shutdown { + if m != nil { + return m.Shutdown + } + return nil +} + func (m *Call) GetAcknowledge() *Call_Acknowledge { if m != nil { return m.Acknowledge @@ -492,22 +492,105 @@ func (m *Call) GetMessage() *Call_Message { return nil } -type Call_Request struct { - Requests []*Request `protobuf:"bytes,1,rep,name=requests" json:"requests,omitempty"` - XXX_unrecognized []byte `json:"-"` +// Subscribes the scheduler with the master to receive events. A +// scheduler must send other calls only after it has received the +// SUBCRIBED event. +type Call_Subscribe struct { + // See the comments below on 'framework_id' on the semantics for + // 'framework_info.id'. + FrameworkInfo *FrameworkInfo `protobuf:"bytes,1,req,name=framework_info" json:"framework_info,omitempty"` + // 'force' field is only relevant when 'framework_info.id' is set. + // It tells the master what to do in case an instance of the + // scheduler attempts to subscribe when another instance of it is + // already connected (e.g., split brain due to network partition). + // If 'force' is true, this scheduler instance is allowed and the + // old connected scheduler instance is disconnected. If false, + // this scheduler instance is disallowed subscription in favor of + // the already connected scheduler instance. + // + // It is recommended to set this to true only when a newly elected + // scheduler instance is attempting to subscribe but not when a + // scheduler is retrying subscription (e.g., disconnection or + // master failover; see sched/sched.cpp for an example). + Force *bool `protobuf:"varint,2,opt,name=force" json:"force,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *Call_Subscribe) Reset() { *m = Call_Subscribe{} } +func (m *Call_Subscribe) String() string { return proto.CompactTextString(m) } +func (*Call_Subscribe) ProtoMessage() {} + +func (m *Call_Subscribe) GetFrameworkInfo() *FrameworkInfo { + if m != nil { + return m.FrameworkInfo + } + return nil +} + +func (m *Call_Subscribe) GetForce() bool { + if m != nil && m.Force != nil { + return *m.Force + } + return false +} + +// Accepts an offer, performing the specified operations +// in a sequential manner. +// +// E.g. Launch a task with a newly reserved persistent volume: +// +// Accept { +// offer_ids: [ ... ] +// operations: [ +// { type: RESERVE, +// reserve: { resources: [ disk(role):2 ] } } +// { type: CREATE, +// create: { volumes: [ disk(role):1+persistence ] } } +// { type: LAUNCH, +// launch: { task_infos ... disk(role):1;disk(role):1+persistence } } +// ] +// } +// +// Note that any of the offer’s resources not used in the 'Accept' +// call (e.g., to launch a task) are considered unused and might be +// reoffered to other frameworks. In other words, the same OfferID +// cannot be used in more than one 'Accept' call. +type Call_Accept struct { + OfferIds []*OfferID `protobuf:"bytes,1,rep,name=offer_ids" json:"offer_ids,omitempty"` + Operations []*Offer_Operation `protobuf:"bytes,2,rep,name=operations" json:"operations,omitempty"` + Filters *Filters `protobuf:"bytes,3,opt,name=filters" json:"filters,omitempty"` + XXX_unrecognized []byte `json:"-"` } -func (m *Call_Request) Reset() { *m = Call_Request{} } -func (m *Call_Request) String() string { return proto.CompactTextString(m) } -func (*Call_Request) ProtoMessage() {} +func (m *Call_Accept) Reset() { *m = Call_Accept{} } +func (m *Call_Accept) String() string { return proto.CompactTextString(m) } +func (*Call_Accept) ProtoMessage() {} + +func (m *Call_Accept) GetOfferIds() []*OfferID { + if m != nil { + return m.OfferIds + } + return nil +} -func (m *Call_Request) GetRequests() []*Request { +func (m *Call_Accept) GetOperations() []*Offer_Operation { if m != nil { - return m.Requests + return m.Operations } return nil } +func (m *Call_Accept) GetFilters() *Filters { + if m != nil { + return m.Filters + } + return nil +} + +// Declines an offer, signaling the master to potentially reoffer +// the resources to a different framework. Note that this is same +// as sending an Accept call with no operations. See comments on +// top of 'Accept' for semantics. type Call_Decline struct { OfferIds []*OfferID `protobuf:"bytes,1,rep,name=offer_ids" json:"offer_ids,omitempty"` Filters *Filters `protobuf:"bytes,2,opt,name=filters" json:"filters,omitempty"` @@ -532,54 +615,73 @@ func (m *Call_Decline) GetFilters() *Filters { return nil } -type Call_Launch struct { - TaskInfos []*TaskInfo `protobuf:"bytes,1,rep,name=task_infos" json:"task_infos,omitempty"` - OfferIds []*OfferID `protobuf:"bytes,2,rep,name=offer_ids" json:"offer_ids,omitempty"` - Filters *Filters `protobuf:"bytes,3,opt,name=filters" json:"filters,omitempty"` - XXX_unrecognized []byte `json:"-"` +// Kills a specific task. If the scheduler has a custom executor, +// the kill is forwarded to the executor and it is up to the +// executor to kill the task and send a TASK_KILLED (or TASK_FAILED) +// update. Note that Mesos releases the resources for a task once it +// receives a terminal update (See TaskState in mesos.proto) for it. +// If the task is unknown to the master, a TASK_LOST update is +// generated. +type Call_Kill struct { + TaskId *TaskID `protobuf:"bytes,1,req,name=task_id" json:"task_id,omitempty"` + SlaveId *SlaveID `protobuf:"bytes,2,opt,name=slave_id" json:"slave_id,omitempty"` + XXX_unrecognized []byte `json:"-"` } -func (m *Call_Launch) Reset() { *m = Call_Launch{} } -func (m *Call_Launch) String() string { return proto.CompactTextString(m) } -func (*Call_Launch) ProtoMessage() {} +func (m *Call_Kill) Reset() { *m = Call_Kill{} } +func (m *Call_Kill) String() string { return proto.CompactTextString(m) } +func (*Call_Kill) ProtoMessage() {} -func (m *Call_Launch) GetTaskInfos() []*TaskInfo { +func (m *Call_Kill) GetTaskId() *TaskID { if m != nil { - return m.TaskInfos + return m.TaskId } return nil } -func (m *Call_Launch) GetOfferIds() []*OfferID { +func (m *Call_Kill) GetSlaveId() *SlaveID { if m != nil { - return m.OfferIds + return m.SlaveId } return nil } -func (m *Call_Launch) GetFilters() *Filters { +// Shuts down a custom executor. When the executor gets a shutdown +// event, it is expected to kill all its tasks (and send TASK_KILLED +// updates) and terminate. If the executor doesn’t terminate within +// a certain timeout (configurable via +// '--executor_shutdown_grace_period' slave flag), the slave will +// forcefully destroy the container (executor and its tasks) and +// transition its active tasks to TASK_LOST. +type Call_Shutdown struct { + ExecutorId *ExecutorID `protobuf:"bytes,1,req,name=executor_id" json:"executor_id,omitempty"` + SlaveId *SlaveID `protobuf:"bytes,2,req,name=slave_id" json:"slave_id,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *Call_Shutdown) Reset() { *m = Call_Shutdown{} } +func (m *Call_Shutdown) String() string { return proto.CompactTextString(m) } +func (*Call_Shutdown) ProtoMessage() {} + +func (m *Call_Shutdown) GetExecutorId() *ExecutorID { if m != nil { - return m.Filters + return m.ExecutorId } return nil } -type Call_Kill struct { - TaskId *TaskID `protobuf:"bytes,1,req,name=task_id" json:"task_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Call_Kill) Reset() { *m = Call_Kill{} } -func (m *Call_Kill) String() string { return proto.CompactTextString(m) } -func (*Call_Kill) ProtoMessage() {} - -func (m *Call_Kill) GetTaskId() *TaskID { +func (m *Call_Shutdown) GetSlaveId() *SlaveID { if m != nil { - return m.TaskId + return m.SlaveId } return nil } +// Acknowledges the receipt of status update. Schedulers are +// responsible for explicitly acknowledging the receipt of status +// updates that have 'Update.status().uuid()' field set. Such status +// updates are retried by the slave until they are acknowledged by +// the scheduler. type Call_Acknowledge struct { SlaveId *SlaveID `protobuf:"bytes,1,req,name=slave_id" json:"slave_id,omitempty"` TaskId *TaskID `protobuf:"bytes,2,req,name=task_id" json:"task_id,omitempty"` @@ -612,30 +714,56 @@ func (m *Call_Acknowledge) GetUuid() []byte { return nil } -// Allows the framework to query the status for non-terminal tasks. +// Allows the scheduler to query the status for non-terminal tasks. // This causes the master to send back the latest task status for -// each task in 'statuses', if possible. Tasks that are no longer -// known will result in a TASK_LOST update. If statuses is empty, -// then the master will send the latest status for each task -// currently known. -// TODO(bmahler): Add a guiding document for reconciliation or -// document reconciliation in-depth here. +// each task in 'tasks', if possible. Tasks that are no longer known +// will result in a TASK_LOST update. If 'statuses' is empty, then +// the master will send the latest status for each task currently +// known. type Call_Reconcile struct { - Statuses []*TaskStatus `protobuf:"bytes,1,rep,name=statuses" json:"statuses,omitempty"` - XXX_unrecognized []byte `json:"-"` + Tasks []*Call_Reconcile_Task `protobuf:"bytes,1,rep,name=tasks" json:"tasks,omitempty"` + XXX_unrecognized []byte `json:"-"` } func (m *Call_Reconcile) Reset() { *m = Call_Reconcile{} } func (m *Call_Reconcile) String() string { return proto.CompactTextString(m) } func (*Call_Reconcile) ProtoMessage() {} -func (m *Call_Reconcile) GetStatuses() []*TaskStatus { +func (m *Call_Reconcile) GetTasks() []*Call_Reconcile_Task { + if m != nil { + return m.Tasks + } + return nil +} + +// TODO(vinod): Support arbitrary queries than just state of tasks. +type Call_Reconcile_Task struct { + TaskId *TaskID `protobuf:"bytes,1,req,name=task_id" json:"task_id,omitempty"` + SlaveId *SlaveID `protobuf:"bytes,2,opt,name=slave_id" json:"slave_id,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *Call_Reconcile_Task) Reset() { *m = Call_Reconcile_Task{} } +func (m *Call_Reconcile_Task) String() string { return proto.CompactTextString(m) } +func (*Call_Reconcile_Task) ProtoMessage() {} + +func (m *Call_Reconcile_Task) GetTaskId() *TaskID { if m != nil { - return m.Statuses + return m.TaskId + } + return nil +} + +func (m *Call_Reconcile_Task) GetSlaveId() *SlaveID { + if m != nil { + return m.SlaveId } return nil } +// Sends arbitrary binary data to the executor. Note that Mesos +// neither interprets this data nor makes any guarantees about the +// delivery of this message to the executor. type Call_Message struct { SlaveId *SlaveID `protobuf:"bytes,1,req,name=slave_id" json:"slave_id,omitempty"` ExecutorId *ExecutorID `protobuf:"bytes,2,req,name=executor_id" json:"executor_id,omitempty"` diff --git a/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/scheduler.proto b/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/scheduler.proto index 6117bb1211f4..dfa20500f976 100644 --- a/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/scheduler.proto +++ b/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/scheduler.proto @@ -23,54 +23,80 @@ import "github.com/gogo/protobuf/gogoproto/gogo.proto"; /** - * Low-level scheduler event API. + * Scheduler event API. * * An event is described using the standard protocol buffer "union" - * trick, see https://developers.google.com/protocol-buffers/docs/techniques#union. + * trick, see: + * https://developers.google.com/protocol-buffers/docs/techniques#union. */ message Event { // Possible event types, followed by message definitions if // applicable. enum Type { - REGISTERED = 1; - REREGISTERED = 2; - OFFERS = 3; - RESCIND = 4; - UPDATE = 5; - MESSAGE = 6; - FAILURE = 7; - ERROR = 8; + SUBSCRIBED = 1; // See 'Subscribed' below. + OFFERS = 2; // See 'Offers' below. + RESCIND = 3; // See 'Rescind' below. + UPDATE = 4; // See 'Update' below. + MESSAGE = 5; // See 'Message' below. + FAILURE = 6; // See 'Failure' below. + ERROR = 7; // See 'Error' below. } - message Registered { + // First event received when the scheduler subscribes. + message Subscribed { required FrameworkID framework_id = 1; - required MasterInfo master_info = 2; - } - - message Reregistered { - required FrameworkID framework_id = 1; - required MasterInfo master_info = 2; } + // Received whenever there are new resources that are offered to the + // scheduler. Each offer corresponds to a set of resources on a + // slave. Until the scheduler accepts or declines an offer the + // resources are considered allocated to the scheduler. message Offers { repeated Offer offers = 1; } + // Received when a particular offer is no longer valid (e.g., the + // slave corresponding to the offer has been removed) and hence + // needs to be rescinded. Any future calls ('Accept' / 'Decline') made + // by the scheduler regarding this offer will be invalid. message Rescind { required OfferID offer_id = 1; } + // Received whenever there is a status update that is generated by + // the executor or slave or master. Status updates should be used by + // executors to reliably communicate the status of the tasks that + // they manage. It is crucial that a terminal update (see TaskState + // in mesos.proto) is sent by the executor as soon as the task + // terminates, in order for Mesos to release the resources allocated + // to the task. It is also the responsibility of the scheduler to + // explicitly acknowledge the receipt of a status update. See + // 'Acknowledge' in the 'Call' section below for the semantics. message Update { - required bytes uuid = 1; // TODO(benh): Replace with UpdateID. - required TaskStatus status = 2; + required TaskStatus status = 1; } + // Received when a custom message generated by the executor is + // forwarded by the master. Note that this message is not + // interpreted by Mesos and is only forwarded (without reliability + // guarantees) to the scheduler. It is up to the executor to retry + // if the message is dropped for any reason. message Message { required SlaveID slave_id = 1; required ExecutorID executor_id = 2; required bytes data = 3; } + // Received when a slave is removed from the cluster (e.g., failed + // health checks) or when an executor is terminated. Note that, this + // event coincides with receipt of terminal UPDATE events for any + // active tasks belonging to the slave or executor and receipt of + // 'Rescind' events for any outstanding offers belonging to the + // slave. Note that there is no guaranteed order between the + // 'Failure', 'Update' and 'Rescind' events when a slave or executor + // is removed. + // TODO(vinod): Consider splitting the lost slave and terminated + // executor into separate events and ensure it's reliably generated. message Failure { optional SlaveID slave_id = 1; @@ -81,29 +107,33 @@ message Event { optional int32 status = 3; } + // Received when an invalid framework (e.g., unauthenticated, + // unauthorized) attempts to subscribe with the master. Error can + // also be received if scheduler sends invalid Calls (e.g., not + // properly initialized). + // TODO(vinod): Remove this once the old scheduler driver is no + // longer supported. With HTTP API all errors will be signaled via + // HTTP response codes. message Error { required string message = 1; } - // TODO(benh): Add a 'from' or 'sender'. - // Type of the event, indicates which optional field below should be // present if that type has a nested message definition. required Type type = 1; - optional Registered registered = 2; - optional Reregistered reregistered = 3; - optional Offers offers = 4; - optional Rescind rescind = 5; - optional Update update = 6; - optional Message message = 7; - optional Failure failure = 8; - optional Error error = 9; + optional Subscribed subscribed = 2; + optional Offers offers = 3; + optional Rescind rescind = 4; + optional Update update = 5; + optional Message message = 6; + optional Failure failure = 7; + optional Error error = 8; } /** - * Low-level scheduler call API. + * Scheduler call API. * * Like Event, a Call is described using the standard protocol buffer * "union" trick (see above). @@ -112,20 +142,19 @@ message Call { // Possible call types, followed by message definitions if // applicable. enum Type { - REGISTER = 1; - REREGISTER = 2; - UNREGISTER = 3; - REQUEST = 4; - DECLINE = 5; - REVIVE = 6; - LAUNCH = 7; - KILL = 8; - ACKNOWLEDGE = 9; - RECONCILE = 10; - MESSAGE = 11; + SUBSCRIBE = 1; // See 'Subscribe' below. + TEARDOWN = 2; // Shuts down all tasks/executors and removes framework. + ACCEPT = 3; // See 'Accept' below. + DECLINE = 4; // See 'Decline' below. + REVIVE = 5; // Removes any previous filters set via ACCEPT or DECLINE. + KILL = 6; // See 'Kill' below. + SHUTDOWN = 7; // See 'Shutdown' below. + ACKNOWLEDGE = 8; // See 'Acknowledge' below. + RECONCILE = 9; // See 'Reconcile' below. + MESSAGE = 10; // See 'Message' below. // TODO(benh): Consider adding an 'ACTIVATE' and 'DEACTIVATE' for - // already registered frameworks as a way of stopping offers from + // already subscribed frameworks as a way of stopping offers from // being generated and other events from being sent by the master. // Note that this functionality existed originally to support // SchedulerDriver::abort which was only necessary to handle @@ -133,63 +162,144 @@ message Call { // something that is not an issue with the Event/Call API. } - message Request { - repeated mesosproto.Request requests = 1; + // Subscribes the scheduler with the master to receive events. A + // scheduler must send other calls only after it has received the + // SUBCRIBED event. + message Subscribe { + // See the comments below on 'framework_id' on the semantics for + // 'framework_info.id'. + required FrameworkInfo framework_info = 1; + + // 'force' field is only relevant when 'framework_info.id' is set. + // It tells the master what to do in case an instance of the + // scheduler attempts to subscribe when another instance of it is + // already connected (e.g., split brain due to network partition). + // If 'force' is true, this scheduler instance is allowed and the + // old connected scheduler instance is disconnected. If false, + // this scheduler instance is disallowed subscription in favor of + // the already connected scheduler instance. + // + // It is recommended to set this to true only when a newly elected + // scheduler instance is attempting to subscribe but not when a + // scheduler is retrying subscription (e.g., disconnection or + // master failover; see sched/sched.cpp for an example). + optional bool force = 2; } - message Decline { + // Accepts an offer, performing the specified operations + // in a sequential manner. + // + // E.g. Launch a task with a newly reserved persistent volume: + // + // Accept { + // offer_ids: [ ... ] + // operations: [ + // { type: RESERVE, + // reserve: { resources: [ disk(role):2 ] } } + // { type: CREATE, + // create: { volumes: [ disk(role):1+persistence ] } } + // { type: LAUNCH, + // launch: { task_infos ... disk(role):1;disk(role):1+persistence } } + // ] + // } + // + // Note that any of the offer’s resources not used in the 'Accept' + // call (e.g., to launch a task) are considered unused and might be + // reoffered to other frameworks. In other words, the same OfferID + // cannot be used in more than one 'Accept' call. + message Accept { repeated OfferID offer_ids = 1; - optional Filters filters = 2; + repeated Offer.Operation operations = 2; + optional Filters filters = 3; } - message Launch { - repeated TaskInfo task_infos = 1; - repeated OfferID offer_ids = 2; - optional Filters filters = 3; + // Declines an offer, signaling the master to potentially reoffer + // the resources to a different framework. Note that this is same + // as sending an Accept call with no operations. See comments on + // top of 'Accept' for semantics. + message Decline { + repeated OfferID offer_ids = 1; + optional Filters filters = 2; } + // Kills a specific task. If the scheduler has a custom executor, + // the kill is forwarded to the executor and it is up to the + // executor to kill the task and send a TASK_KILLED (or TASK_FAILED) + // update. Note that Mesos releases the resources for a task once it + // receives a terminal update (See TaskState in mesos.proto) for it. + // If the task is unknown to the master, a TASK_LOST update is + // generated. message Kill { required TaskID task_id = 1; + optional SlaveID slave_id = 2; } + // Shuts down a custom executor. When the executor gets a shutdown + // event, it is expected to kill all its tasks (and send TASK_KILLED + // updates) and terminate. If the executor doesn’t terminate within + // a certain timeout (configurable via + // '--executor_shutdown_grace_period' slave flag), the slave will + // forcefully destroy the container (executor and its tasks) and + // transition its active tasks to TASK_LOST. + message Shutdown { + required ExecutorID executor_id = 1; + required SlaveID slave_id = 2; + } + + // Acknowledges the receipt of status update. Schedulers are + // responsible for explicitly acknowledging the receipt of status + // updates that have 'Update.status().uuid()' field set. Such status + // updates are retried by the slave until they are acknowledged by + // the scheduler. message Acknowledge { required SlaveID slave_id = 1; required TaskID task_id = 2; required bytes uuid = 3; } - // Allows the framework to query the status for non-terminal tasks. + // Allows the scheduler to query the status for non-terminal tasks. // This causes the master to send back the latest task status for - // each task in 'statuses', if possible. Tasks that are no longer - // known will result in a TASK_LOST update. If statuses is empty, - // then the master will send the latest status for each task - // currently known. - // TODO(bmahler): Add a guiding document for reconciliation or - // document reconciliation in-depth here. + // each task in 'tasks', if possible. Tasks that are no longer known + // will result in a TASK_LOST update. If 'statuses' is empty, then + // the master will send the latest status for each task currently + // known. message Reconcile { - repeated TaskStatus statuses = 1; // Should be non-terminal only. + // TODO(vinod): Support arbitrary queries than just state of tasks. + message Task { + required TaskID task_id = 1; + optional SlaveID slave_id = 2; + } + + repeated Task tasks = 1; } + // Sends arbitrary binary data to the executor. Note that Mesos + // neither interprets this data nor makes any guarantees about the + // delivery of this message to the executor. message Message { required SlaveID slave_id = 1; required ExecutorID executor_id = 2; required bytes data = 3; } - // Identifies who generated this call. Always necessary, but the - // only thing that needs to be set for certain calls, e.g., - // REGISTER, REREGISTER, and UNREGISTER. - required FrameworkInfo framework_info = 1; + // Identifies who generated this call. Master assigns a framework id + // when a new scheduler subscribes for the first time. Once assigned, + // the scheduler must set the 'framework_id' here and within its + // FrameworkInfo (in any further 'Subscribe' calls). This allows the + // master to identify a scheduler correctly across disconnections, + // failovers, etc. + optional FrameworkID framework_id = 1; // Type of the call, indicates which optional field below should be // present if that type has a nested message definition. required Type type = 2; - optional Request request = 3; - optional Decline decline = 4; - optional Launch launch = 5; + optional Subscribe subscribe = 3; + optional Accept accept = 4; + optional Decline decline = 5; optional Kill kill = 6; - optional Acknowledge acknowledge = 7; - optional Reconcile reconcile = 8; - optional Message message = 9; + optional Shutdown shutdown = 7; + optional Acknowledge acknowledge = 8; + optional Reconcile reconcile = 9; + optional Message message = 10; } diff --git a/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/state.pb.go b/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/state.pb.go index b584062be002..db42a71b36fe 100644 --- a/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/state.pb.go +++ b/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/state.pb.go @@ -5,30 +5,24 @@ package mesosproto import proto "github.com/gogo/protobuf/proto" +import fmt "fmt" import math "math" -// discarding unused import gogoproto "github.com/gogo/protobuf/gogoproto/gogo.pb" +// discarding unused import gogoproto "github.com/gogo/protobuf/gogoproto" -import io2 "io" -import fmt8 "fmt" -import github_com_gogo_protobuf_proto4 "github.com/gogo/protobuf/proto" +import bytes "bytes" -import fmt9 "fmt" -import strings4 "strings" -import reflect4 "reflect" +import strings "strings" +import github_com_gogo_protobuf_proto "github.com/gogo/protobuf/proto" +import sort "sort" +import strconv "strconv" +import reflect "reflect" -import fmt10 "fmt" -import strings5 "strings" -import github_com_gogo_protobuf_proto5 "github.com/gogo/protobuf/proto" -import sort2 "sort" -import strconv2 "strconv" -import reflect5 "reflect" - -import fmt11 "fmt" -import bytes2 "bytes" +import io "io" // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal +var _ = fmt.Errorf var _ = math.Inf type Operation_Type int32 @@ -192,795 +186,508 @@ func (m *Operation_Expunge) GetName() string { func init() { proto.RegisterEnum("mesosproto.Operation_Type", Operation_Type_name, Operation_Type_value) } -func (m *Entry) 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 io2.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 fmt8.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io2.ErrUnexpectedEOF - } - b := data[index] - index++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + int(stringLen) - if postIndex > l { - return io2.ErrUnexpectedEOF - } - s := string(data[index:postIndex]) - m.Name = &s - index = postIndex - case 2: - if wireType != 2 { - return fmt8.Errorf("proto: wrong wireType = %d for field Uuid", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io2.ErrUnexpectedEOF - } - b := data[index] - index++ - byteLen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + byteLen - if postIndex > l { - return io2.ErrUnexpectedEOF - } - m.Uuid = append([]byte{}, data[index:postIndex]...) - index = postIndex - case 3: - if wireType != 2 { - return fmt8.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io2.ErrUnexpectedEOF - } - b := data[index] - index++ - byteLen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + byteLen - if postIndex > l { - return io2.ErrUnexpectedEOF - } - m.Value = append([]byte{}, 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_proto4.Skip(data[index:]) - if err != nil { - return err - } - if (index + skippy) > l { - return io2.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[index:index+skippy]...) - index += skippy +func (this *Entry) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil } + return fmt.Errorf("that == nil && this != nil") } - return nil -} -func (m *Operation) 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 io2.ErrUnexpectedEOF - } - b := data[index] - index++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } + + that1, ok := that.(*Entry) + if !ok { + return fmt.Errorf("that is not of type *Entry") + } + if that1 == nil { + if this == nil { + return nil } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 0 { - return fmt8.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - var v Operation_Type - for shift := uint(0); ; shift += 7 { - if index >= l { - return io2.ErrUnexpectedEOF - } - b := data[index] - index++ - v |= (Operation_Type(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Type = &v - case 2: - if wireType != 2 { - return fmt8.Errorf("proto: wrong wireType = %d for field Snapshot", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io2.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io2.ErrUnexpectedEOF - } - if m.Snapshot == nil { - m.Snapshot = &Operation_Snapshot{} - } - if err := m.Snapshot.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - case 4: - if wireType != 2 { - return fmt8.Errorf("proto: wrong wireType = %d for field Diff", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io2.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io2.ErrUnexpectedEOF - } - if m.Diff == nil { - m.Diff = &Operation_Diff{} - } - if err := m.Diff.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - case 3: - if wireType != 2 { - return fmt8.Errorf("proto: wrong wireType = %d for field Expunge", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io2.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io2.ErrUnexpectedEOF - } - if m.Expunge == nil { - m.Expunge = &Operation_Expunge{} - } - if err := m.Expunge.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - index -= sizeOfWire - skippy, err := github_com_gogo_protobuf_proto4.Skip(data[index:]) - if err != nil { - return err - } - if (index + skippy) > l { - return io2.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[index:index+skippy]...) - index += skippy + return fmt.Errorf("that is type *Entry but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *Entrybut is not nil && this == nil") + } + if this.Name != nil && that1.Name != nil { + if *this.Name != *that1.Name { + return fmt.Errorf("Name this(%v) Not Equal that(%v)", *this.Name, *that1.Name) } + } else if this.Name != nil { + return fmt.Errorf("this.Name == nil && that.Name != nil") + } else if that1.Name != nil { + return fmt.Errorf("Name this(%v) Not Equal that(%v)", this.Name, that1.Name) + } + if !bytes.Equal(this.Uuid, that1.Uuid) { + return fmt.Errorf("Uuid this(%v) Not Equal that(%v)", this.Uuid, that1.Uuid) + } + if !bytes.Equal(this.Value, that1.Value) { + return fmt.Errorf("Value this(%v) Not Equal that(%v)", this.Value, that1.Value) + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) } return nil } -func (m *Operation_Snapshot) 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 io2.ErrUnexpectedEOF - } - b := data[index] - index++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } +func (this *Entry) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt8.Errorf("proto: wrong wireType = %d for field Entry", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io2.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io2.ErrUnexpectedEOF - } - if m.Entry == nil { - m.Entry = &Entry{} - } - if err := m.Entry.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - index -= sizeOfWire - skippy, err := github_com_gogo_protobuf_proto4.Skip(data[index:]) - if err != nil { - return err - } - if (index + skippy) > l { - return io2.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[index:index+skippy]...) - index += skippy + return false + } + + that1, ok := that.(*Entry) + if !ok { + return false + } + if that1 == nil { + if this == nil { + return true } + return false + } else if this == nil { + return false } - return nil -} -func (m *Operation_Diff) 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 io2.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 fmt8.Errorf("proto: wrong wireType = %d for field Entry", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if index >= l { - return io2.ErrUnexpectedEOF - } - b := data[index] - index++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + msglen - if postIndex > l { - return io2.ErrUnexpectedEOF - } - if m.Entry == nil { - m.Entry = &Entry{} - } - if err := m.Entry.Unmarshal(data[index:postIndex]); err != nil { - return err - } - index = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - index -= sizeOfWire - skippy, err := github_com_gogo_protobuf_proto4.Skip(data[index:]) - if err != nil { - return err - } - if (index + skippy) > l { - return io2.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[index:index+skippy]...) - index += skippy + if this.Name != nil && that1.Name != nil { + if *this.Name != *that1.Name { + return false } + } else if this.Name != nil { + return false + } else if that1.Name != nil { + return false } - return nil -} -func (m *Operation_Expunge) 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 io2.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 fmt8.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io2.ErrUnexpectedEOF - } - b := data[index] - index++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + int(stringLen) - if postIndex > l { - return io2.ErrUnexpectedEOF - } - s := string(data[index:postIndex]) - m.Name = &s - index = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - index -= sizeOfWire - skippy, err := github_com_gogo_protobuf_proto4.Skip(data[index:]) - if err != nil { - return err - } - if (index + skippy) > l { - return io2.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[index:index+skippy]...) - index += skippy - } + if !bytes.Equal(this.Uuid, that1.Uuid) { + return false } - return nil -} -func (this *Entry) String() string { - if this == nil { - return "nil" + if !bytes.Equal(this.Value, that1.Value) { + return false } - s := strings4.Join([]string{`&Entry{`, - `Name:` + valueToStringState(this.Name) + `,`, - `Uuid:` + valueToStringState(this.Uuid) + `,`, - `Value:` + valueToStringState(this.Value) + `,`, - `XXX_unrecognized:` + fmt9.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *Operation) String() string { - if this == nil { - return "nil" + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false } - s := strings4.Join([]string{`&Operation{`, - `Type:` + valueToStringState(this.Type) + `,`, - `Snapshot:` + strings4.Replace(fmt9.Sprintf("%v", this.Snapshot), "Operation_Snapshot", "Operation_Snapshot", 1) + `,`, - `Diff:` + strings4.Replace(fmt9.Sprintf("%v", this.Diff), "Operation_Diff", "Operation_Diff", 1) + `,`, - `Expunge:` + strings4.Replace(fmt9.Sprintf("%v", this.Expunge), "Operation_Expunge", "Operation_Expunge", 1) + `,`, - `XXX_unrecognized:` + fmt9.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s + return true } -func (this *Operation_Snapshot) String() string { - if this == nil { - return "nil" +func (this *Operation) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") } - s := strings4.Join([]string{`&Operation_Snapshot{`, - `Entry:` + strings4.Replace(fmt9.Sprintf("%v", this.Entry), "Entry", "Entry", 1) + `,`, - `XXX_unrecognized:` + fmt9.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *Operation_Diff) String() string { - if this == nil { - return "nil" + + that1, ok := that.(*Operation) + if !ok { + return fmt.Errorf("that is not of type *Operation") } - s := strings4.Join([]string{`&Operation_Diff{`, - `Entry:` + strings4.Replace(fmt9.Sprintf("%v", this.Entry), "Entry", "Entry", 1) + `,`, - `XXX_unrecognized:` + fmt9.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *Operation_Expunge) String() string { - if this == nil { - return "nil" + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *Operation but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *Operationbut is not nil && this == nil") } - s := strings4.Join([]string{`&Operation_Expunge{`, - `Name:` + valueToStringState(this.Name) + `,`, - `XXX_unrecognized:` + fmt9.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func valueToStringState(v interface{}) string { - rv := reflect4.ValueOf(v) - if rv.IsNil() { - return "nil" + if this.Type != nil && that1.Type != nil { + if *this.Type != *that1.Type { + return fmt.Errorf("Type this(%v) Not Equal that(%v)", *this.Type, *that1.Type) + } + } else if this.Type != nil { + return fmt.Errorf("this.Type == nil && that.Type != nil") + } else if that1.Type != nil { + return fmt.Errorf("Type this(%v) Not Equal that(%v)", this.Type, that1.Type) } - pv := reflect4.Indirect(rv).Interface() - return fmt9.Sprintf("*%v", pv) -} -func (m *Entry) Size() (n int) { - var l int - _ = l - if m.Name != nil { - l = len(*m.Name) - n += 1 + l + sovState(uint64(l)) + if !this.Snapshot.Equal(that1.Snapshot) { + return fmt.Errorf("Snapshot this(%v) Not Equal that(%v)", this.Snapshot, that1.Snapshot) } - if m.Uuid != nil { - l = len(m.Uuid) - n += 1 + l + sovState(uint64(l)) + if !this.Diff.Equal(that1.Diff) { + return fmt.Errorf("Diff this(%v) Not Equal that(%v)", this.Diff, that1.Diff) } - if m.Value != nil { - l = len(m.Value) - n += 1 + l + sovState(uint64(l)) + if !this.Expunge.Equal(that1.Expunge) { + return fmt.Errorf("Expunge this(%v) Not Equal that(%v)", this.Expunge, that1.Expunge) } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) } - return n + return nil } +func (this *Operation) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } -func (m *Operation) Size() (n int) { - var l int - _ = l - if m.Type != nil { - n += 1 + sovState(uint64(*m.Type)) + that1, ok := that.(*Operation) + if !ok { + return false } - if m.Snapshot != nil { - l = m.Snapshot.Size() - n += 1 + l + sovState(uint64(l)) + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false } - if m.Diff != nil { - l = m.Diff.Size() - n += 1 + l + sovState(uint64(l)) + if this.Type != nil && that1.Type != nil { + if *this.Type != *that1.Type { + return false + } + } else if this.Type != nil { + return false + } else if that1.Type != nil { + return false } - if m.Expunge != nil { - l = m.Expunge.Size() - n += 1 + l + sovState(uint64(l)) + if !this.Snapshot.Equal(that1.Snapshot) { + return false } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + if !this.Diff.Equal(that1.Diff) { + return false } - return n -} - -func (m *Operation_Snapshot) Size() (n int) { - var l int - _ = l - if m.Entry != nil { - l = m.Entry.Size() - n += 1 + l + sovState(uint64(l)) + if !this.Expunge.Equal(that1.Expunge) { + return false } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false } - return n + return true } +func (this *Operation_Snapshot) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } -func (m *Operation_Diff) Size() (n int) { - var l int - _ = l - if m.Entry != nil { - l = m.Entry.Size() - n += 1 + l + sovState(uint64(l)) + that1, ok := that.(*Operation_Snapshot) + if !ok { + return fmt.Errorf("that is not of type *Operation_Snapshot") } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *Operation_Snapshot but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *Operation_Snapshotbut is not nil && this == nil") } - return n + if !this.Entry.Equal(that1.Entry) { + return fmt.Errorf("Entry this(%v) Not Equal that(%v)", this.Entry, that1.Entry) + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + } + return nil } - -func (m *Operation_Expunge) Size() (n int) { - var l int - _ = l - if m.Name != nil { - l = len(*m.Name) - n += 1 + l + sovState(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) +func (this *Operation_Snapshot) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false } - return n -} -func sovState(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } + that1, ok := that.(*Operation_Snapshot) + if !ok { + return false } - return n -} -func sozState(x uint64) (n int) { - return sovState(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func NewPopulatedEntry(r randyState, easy bool) *Entry { - this := &Entry{} - v1 := randStringState(r) - this.Name = &v1 - v2 := r.Intn(100) - this.Uuid = make([]byte, v2) - for i := 0; i < v2; i++ { - this.Uuid[i] = byte(r.Intn(256)) + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false } - v3 := r.Intn(100) - this.Value = make([]byte, v3) - for i := 0; i < v3; i++ { - this.Value[i] = byte(r.Intn(256)) + if !this.Entry.Equal(that1.Entry) { + return false } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedState(r, 4) + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false } - return this + return true } +func (this *Operation_Diff) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil + } + return fmt.Errorf("that == nil && this != nil") + } -func NewPopulatedOperation(r randyState, easy bool) *Operation { - this := &Operation{} - v4 := Operation_Type([]int32{1, 3, 2}[r.Intn(3)]) - this.Type = &v4 - if r.Intn(10) != 0 { - this.Snapshot = NewPopulatedOperation_Snapshot(r, easy) + that1, ok := that.(*Operation_Diff) + if !ok { + return fmt.Errorf("that is not of type *Operation_Diff") } - if r.Intn(10) != 0 { - this.Diff = NewPopulatedOperation_Diff(r, easy) + if that1 == nil { + if this == nil { + return nil + } + return fmt.Errorf("that is type *Operation_Diff but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *Operation_Diffbut is not nil && this == nil") } - if r.Intn(10) != 0 { - this.Expunge = NewPopulatedOperation_Expunge(r, easy) + if !this.Entry.Equal(that1.Entry) { + return fmt.Errorf("Entry this(%v) Not Equal that(%v)", this.Entry, that1.Entry) } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedState(r, 5) + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) } - return this + return nil } - -func NewPopulatedOperation_Snapshot(r randyState, easy bool) *Operation_Snapshot { - this := &Operation_Snapshot{} - this.Entry = NewPopulatedEntry(r, easy) - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedState(r, 2) +func (this *Operation_Diff) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false } - return this -} -func NewPopulatedOperation_Diff(r randyState, easy bool) *Operation_Diff { - this := &Operation_Diff{} - this.Entry = NewPopulatedEntry(r, easy) - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedState(r, 2) + that1, ok := that.(*Operation_Diff) + if !ok { + return false } - return this -} - -func NewPopulatedOperation_Expunge(r randyState, easy bool) *Operation_Expunge { - this := &Operation_Expunge{} - v5 := randStringState(r) - this.Name = &v5 - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedState(r, 2) + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false } - return this -} - -type randyState interface { - Float32() float32 - Float64() float64 - Int63() int64 - Int31() int32 - Uint32() uint32 - Intn(n int) int -} - -func randUTF8RuneState(r randyState) rune { - res := rune(r.Uint32() % 1112064) - if 55296 <= res { - res += 2047 + if !this.Entry.Equal(that1.Entry) { + return false } - return res -} -func randStringState(r randyState) string { - v6 := r.Intn(100) - tmps := make([]rune, v6) - for i := 0; i < v6; i++ { - tmps[i] = randUTF8RuneState(r) + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false } - return string(tmps) + return true } -func randUnrecognizedState(r randyState, maxFieldNumber int) (data []byte) { - l := r.Intn(5) - for i := 0; i < l; i++ { - wire := r.Intn(4) - if wire == 3 { - wire = 5 +func (this *Operation_Expunge) VerboseEqual(that interface{}) error { + if that == nil { + if this == nil { + return nil } - fieldNumber := maxFieldNumber + r.Intn(100) - data = randFieldState(data, r, fieldNumber, wire) + return fmt.Errorf("that == nil && this != nil") } - return data -} -func randFieldState(data []byte, r randyState, fieldNumber int, wire int) []byte { - key := uint32(fieldNumber)<<3 | uint32(wire) - switch wire { - case 0: - data = encodeVarintPopulateState(data, uint64(key)) - v7 := r.Int63() - if r.Intn(2) == 0 { - v7 *= -1 + + that1, ok := that.(*Operation_Expunge) + if !ok { + return fmt.Errorf("that is not of type *Operation_Expunge") + } + if that1 == nil { + if this == nil { + return nil } - data = encodeVarintPopulateState(data, uint64(v7)) - case 1: - data = encodeVarintPopulateState(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 = encodeVarintPopulateState(data, uint64(key)) - ll := r.Intn(100) - data = encodeVarintPopulateState(data, uint64(ll)) - for j := 0; j < ll; j++ { - data = append(data, byte(r.Intn(256))) + return fmt.Errorf("that is type *Operation_Expunge but is nil && this != nil") + } else if this == nil { + return fmt.Errorf("that is type *Operation_Expungebut is not nil && this == nil") + } + if this.Name != nil && that1.Name != nil { + if *this.Name != *that1.Name { + return fmt.Errorf("Name this(%v) Not Equal that(%v)", *this.Name, *that1.Name) } - default: - data = encodeVarintPopulateState(data, uint64(key)) - data = append(data, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) + } else if this.Name != nil { + return fmt.Errorf("this.Name == nil && that.Name != nil") + } else if that1.Name != nil { + return fmt.Errorf("Name this(%v) Not Equal that(%v)", this.Name, that1.Name) } - return data -} -func encodeVarintPopulateState(data []byte, v uint64) []byte { - for v >= 1<<7 { - data = append(data, uint8(uint64(v)&0x7f|0x80)) - v >>= 7 + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) } - data = append(data, uint8(v)) - return data + return nil } -func (m *Entry) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err +func (this *Operation_Expunge) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false } - return data[:n], nil -} -func (m *Entry) MarshalTo(data []byte) (n int, err error) { - var i int - _ = i - var l int - _ = l - if m.Name != nil { - data[i] = 0xa - i++ - i = encodeVarintState(data, i, uint64(len(*m.Name))) - i += copy(data[i:], *m.Name) + that1, ok := that.(*Operation_Expunge) + if !ok { + return false } - if m.Uuid != nil { - data[i] = 0x12 - i++ - i = encodeVarintState(data, i, uint64(len(m.Uuid))) - i += copy(data[i:], m.Uuid) + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false } - if m.Value != nil { - data[i] = 0x1a - i++ - i = encodeVarintState(data, i, uint64(len(m.Value))) - i += copy(data[i:], m.Value) + if this.Name != nil && that1.Name != nil { + if *this.Name != *that1.Name { + return false + } + } else if this.Name != nil { + return false + } else if that1.Name != nil { + return false } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *Entry) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 7) + s = append(s, "&mesosproto.Entry{") + if this.Name != nil { + s = append(s, "Name: "+valueToGoStringState(this.Name, "string")+",\n") + } + if this.Uuid != nil { + s = append(s, "Uuid: "+valueToGoStringState(this.Uuid, "byte")+",\n") + } + if this.Value != nil { + s = append(s, "Value: "+valueToGoStringState(this.Value, "byte")+",\n") + } + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") +} +func (this *Operation) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 8) + s = append(s, "&mesosproto.Operation{") + if this.Type != nil { + s = append(s, "Type: "+valueToGoStringState(this.Type, "mesosproto.Operation_Type")+",\n") + } + if this.Snapshot != nil { + s = append(s, "Snapshot: "+fmt.Sprintf("%#v", this.Snapshot)+",\n") + } + if this.Diff != nil { + s = append(s, "Diff: "+fmt.Sprintf("%#v", this.Diff)+",\n") + } + if this.Expunge != nil { + s = append(s, "Expunge: "+fmt.Sprintf("%#v", this.Expunge)+",\n") + } + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") +} +func (this *Operation_Snapshot) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 5) + s = append(s, "&mesosproto.Operation_Snapshot{") + if this.Entry != nil { + s = append(s, "Entry: "+fmt.Sprintf("%#v", this.Entry)+",\n") + } + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") +} +func (this *Operation_Diff) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 5) + s = append(s, "&mesosproto.Operation_Diff{") + if this.Entry != nil { + s = append(s, "Entry: "+fmt.Sprintf("%#v", this.Entry)+",\n") + } + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") +} +func (this *Operation_Expunge) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 5) + s = append(s, "&mesosproto.Operation_Expunge{") + if this.Name != nil { + s = append(s, "Name: "+valueToGoStringState(this.Name, "string")+",\n") + } + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") +} +func valueToGoStringState(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 extensionToGoStringState(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 *Entry) 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 *Entry) MarshalTo(data []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.Name == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("name") + } else { + data[i] = 0xa + i++ + i = encodeVarintState(data, i, uint64(len(*m.Name))) + i += copy(data[i:], *m.Name) + } + if m.Uuid == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("uuid") + } else { + data[i] = 0x12 + i++ + i = encodeVarintState(data, i, uint64(len(m.Uuid))) + i += copy(data[i:], m.Uuid) + } + if m.Value == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("value") + } else { + data[i] = 0x1a + i++ + i = encodeVarintState(data, i, uint64(len(m.Value))) + i += copy(data[i:], m.Value) + } + if m.XXX_unrecognized != nil { + i += copy(data[i:], m.XXX_unrecognized) } return i, nil } @@ -995,12 +702,14 @@ func (m *Operation) Marshal() (data []byte, err error) { return data[:n], nil } -func (m *Operation) MarshalTo(data []byte) (n int, err error) { +func (m *Operation) MarshalTo(data []byte) (int, error) { var i int _ = i var l int _ = l - if m.Type != nil { + if m.Type == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("type") + } else { data[i] = 0x8 i++ i = encodeVarintState(data, i, uint64(*m.Type)) @@ -1015,21 +724,21 @@ func (m *Operation) MarshalTo(data []byte) (n int, err error) { } i += n1 } - if m.Diff != nil { - data[i] = 0x22 + if m.Expunge != nil { + data[i] = 0x1a i++ - i = encodeVarintState(data, i, uint64(m.Diff.Size())) - n2, err := m.Diff.MarshalTo(data[i:]) + i = encodeVarintState(data, i, uint64(m.Expunge.Size())) + n2, err := m.Expunge.MarshalTo(data[i:]) if err != nil { return 0, err } i += n2 } - if m.Expunge != nil { - data[i] = 0x1a + if m.Diff != nil { + data[i] = 0x22 i++ - i = encodeVarintState(data, i, uint64(m.Expunge.Size())) - n3, err := m.Expunge.MarshalTo(data[i:]) + i = encodeVarintState(data, i, uint64(m.Diff.Size())) + n3, err := m.Diff.MarshalTo(data[i:]) if err != nil { return 0, err } @@ -1051,12 +760,14 @@ func (m *Operation_Snapshot) Marshal() (data []byte, err error) { return data[:n], nil } -func (m *Operation_Snapshot) MarshalTo(data []byte) (n int, err error) { +func (m *Operation_Snapshot) MarshalTo(data []byte) (int, error) { var i int _ = i var l int _ = l - if m.Entry != nil { + if m.Entry == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("entry") + } else { data[i] = 0xa i++ i = encodeVarintState(data, i, uint64(m.Entry.Size())) @@ -1082,12 +793,14 @@ func (m *Operation_Diff) Marshal() (data []byte, err error) { return data[:n], nil } -func (m *Operation_Diff) MarshalTo(data []byte) (n int, err error) { +func (m *Operation_Diff) MarshalTo(data []byte) (int, error) { var i int _ = i var l int _ = l - if m.Entry != nil { + if m.Entry == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("entry") + } else { data[i] = 0xa i++ i = encodeVarintState(data, i, uint64(m.Entry.Size())) @@ -1113,12 +826,14 @@ func (m *Operation_Expunge) Marshal() (data []byte, err error) { return data[:n], nil } -func (m *Operation_Expunge) MarshalTo(data []byte) (n int, err error) { +func (m *Operation_Expunge) MarshalTo(data []byte) (int, error) { var i int _ = i var l int _ = l - if m.Name != nil { + if m.Name == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("name") + } else { data[i] = 0xa i++ i = encodeVarintState(data, i, uint64(len(*m.Name))) @@ -1157,424 +872,932 @@ func encodeVarintState(data []byte, offset int, v uint64) int { data[offset] = uint8(v) return offset + 1 } -func (this *Entry) GoString() string { - if this == nil { - return "nil" - } - s := strings5.Join([]string{`&mesosproto.Entry{` + - `Name:` + valueToGoStringState(this.Name, "string"), - `Uuid:` + valueToGoStringState(this.Uuid, "byte"), - `Value:` + valueToGoStringState(this.Value, "byte"), - `XXX_unrecognized:` + fmt10.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s -} -func (this *Operation) GoString() string { - if this == nil { - return "nil" - } - s := strings5.Join([]string{`&mesosproto.Operation{` + - `Type:` + valueToGoStringState(this.Type, "mesosproto.Operation_Type"), - `Snapshot:` + fmt10.Sprintf("%#v", this.Snapshot), - `Diff:` + fmt10.Sprintf("%#v", this.Diff), - `Expunge:` + fmt10.Sprintf("%#v", this.Expunge), - `XXX_unrecognized:` + fmt10.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s -} -func (this *Operation_Snapshot) GoString() string { - if this == nil { - return "nil" +func NewPopulatedEntry(r randyState, easy bool) *Entry { + this := &Entry{} + v1 := randStringState(r) + this.Name = &v1 + v2 := r.Intn(100) + this.Uuid = make([]byte, v2) + for i := 0; i < v2; i++ { + this.Uuid[i] = byte(r.Intn(256)) } - s := strings5.Join([]string{`&mesosproto.Operation_Snapshot{` + - `Entry:` + fmt10.Sprintf("%#v", this.Entry), - `XXX_unrecognized:` + fmt10.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s -} -func (this *Operation_Diff) GoString() string { - if this == nil { - return "nil" + v3 := r.Intn(100) + this.Value = make([]byte, v3) + for i := 0; i < v3; i++ { + this.Value[i] = byte(r.Intn(256)) } - s := strings5.Join([]string{`&mesosproto.Operation_Diff{` + - `Entry:` + fmt10.Sprintf("%#v", this.Entry), - `XXX_unrecognized:` + fmt10.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s -} -func (this *Operation_Expunge) GoString() string { - if this == nil { - return "nil" + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedState(r, 4) } - s := strings5.Join([]string{`&mesosproto.Operation_Expunge{` + - `Name:` + valueToGoStringState(this.Name, "string"), - `XXX_unrecognized:` + fmt10.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s + return this } -func valueToGoStringState(v interface{}, typ string) string { - rv := reflect5.ValueOf(v) - if rv.IsNil() { - return "nil" + +func NewPopulatedOperation(r randyState, easy bool) *Operation { + this := &Operation{} + v4 := Operation_Type([]int32{1, 3, 2}[r.Intn(3)]) + this.Type = &v4 + if r.Intn(10) != 0 { + this.Snapshot = NewPopulatedOperation_Snapshot(r, easy) } - pv := reflect5.Indirect(rv).Interface() - return fmt10.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) -} -func extensionToGoStringState(e map[int32]github_com_gogo_protobuf_proto5.Extension) string { - if e == nil { - return "nil" + if r.Intn(10) != 0 { + this.Expunge = NewPopulatedOperation_Expunge(r, easy) } - s := "map[int32]proto.Extension{" - keys := make([]int, 0, len(e)) - for k := range e { - keys = append(keys, int(k)) + if r.Intn(10) != 0 { + this.Diff = NewPopulatedOperation_Diff(r, easy) } - sort2.Ints(keys) - ss := []string{} - for _, k := range keys { - ss = append(ss, strconv2.Itoa(k)+": "+e[int32(k)].GoString()) + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedState(r, 5) } - s += strings5.Join(ss, ",") + "}" - return s + return this } -func (this *Entry) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt11.Errorf("that == nil && this != nil") - } - that1, ok := that.(*Entry) - if !ok { - return fmt11.Errorf("that is not of type *Entry") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt11.Errorf("that is type *Entry but is nil && this != nil") - } else if this == nil { - return fmt11.Errorf("that is type *Entrybut is not nil && this == nil") +func NewPopulatedOperation_Snapshot(r randyState, easy bool) *Operation_Snapshot { + this := &Operation_Snapshot{} + this.Entry = NewPopulatedEntry(r, easy) + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedState(r, 2) } - if this.Name != nil && that1.Name != nil { - if *this.Name != *that1.Name { - return fmt11.Errorf("Name this(%v) Not Equal that(%v)", *this.Name, *that1.Name) - } - } else if this.Name != nil { - return fmt11.Errorf("this.Name == nil && that.Name != nil") - } else if that1.Name != nil { - return fmt11.Errorf("Name this(%v) Not Equal that(%v)", this.Name, that1.Name) + return this +} + +func NewPopulatedOperation_Diff(r randyState, easy bool) *Operation_Diff { + this := &Operation_Diff{} + this.Entry = NewPopulatedEntry(r, easy) + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedState(r, 2) } - if !bytes2.Equal(this.Uuid, that1.Uuid) { - return fmt11.Errorf("Uuid this(%v) Not Equal that(%v)", this.Uuid, that1.Uuid) + return this +} + +func NewPopulatedOperation_Expunge(r randyState, easy bool) *Operation_Expunge { + this := &Operation_Expunge{} + v5 := randStringState(r) + this.Name = &v5 + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedState(r, 2) } - if !bytes2.Equal(this.Value, that1.Value) { - return fmt11.Errorf("Value this(%v) Not Equal that(%v)", this.Value, that1.Value) + return this +} + +type randyState interface { + Float32() float32 + Float64() float64 + Int63() int64 + Int31() int32 + Uint32() uint32 + Intn(n int) int +} + +func randUTF8RuneState(r randyState) rune { + ru := r.Intn(62) + if ru < 10 { + return rune(ru + 48) + } else if ru < 36 { + return rune(ru + 55) } - if !bytes2.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt11.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + return rune(ru + 61) +} +func randStringState(r randyState) string { + v6 := r.Intn(100) + tmps := make([]rune, v6) + for i := 0; i < v6; i++ { + tmps[i] = randUTF8RuneState(r) } - return nil + return string(tmps) } -func (this *Entry) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true +func randUnrecognizedState(r randyState, maxFieldNumber int) (data []byte) { + l := r.Intn(5) + for i := 0; i < l; i++ { + wire := r.Intn(4) + if wire == 3 { + wire = 5 } - return false + fieldNumber := maxFieldNumber + r.Intn(100) + data = randFieldState(data, r, fieldNumber, wire) } - - that1, ok := that.(*Entry) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if this.Name != nil && that1.Name != nil { - if *this.Name != *that1.Name { - return false - } - } else if this.Name != nil { - return false - } else if that1.Name != nil { - return false - } - if !bytes2.Equal(this.Uuid, that1.Uuid) { - return false - } - if !bytes2.Equal(this.Value, that1.Value) { - return false - } - if !bytes2.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true + return data } -func (this *Operation) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil +func randFieldState(data []byte, r randyState, fieldNumber int, wire int) []byte { + key := uint32(fieldNumber)<<3 | uint32(wire) + switch wire { + case 0: + data = encodeVarintPopulateState(data, uint64(key)) + v7 := r.Int63() + if r.Intn(2) == 0 { + v7 *= -1 } - return fmt11.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*Operation) - if !ok { - return fmt11.Errorf("that is not of type *Operation") - } - if that1 == nil { - if this == nil { - return nil + data = encodeVarintPopulateState(data, uint64(v7)) + case 1: + data = encodeVarintPopulateState(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 = encodeVarintPopulateState(data, uint64(key)) + ll := r.Intn(100) + data = encodeVarintPopulateState(data, uint64(ll)) + for j := 0; j < ll; j++ { + data = append(data, byte(r.Intn(256))) } - return fmt11.Errorf("that is type *Operation but is nil && this != nil") - } else if this == nil { - return fmt11.Errorf("that is type *Operationbut is not nil && this == nil") + default: + data = encodeVarintPopulateState(data, uint64(key)) + data = append(data, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) } - if this.Type != nil && that1.Type != nil { - if *this.Type != *that1.Type { - return fmt11.Errorf("Type this(%v) Not Equal that(%v)", *this.Type, *that1.Type) - } - } else if this.Type != nil { - return fmt11.Errorf("this.Type == nil && that.Type != nil") - } else if that1.Type != nil { - return fmt11.Errorf("Type this(%v) Not Equal that(%v)", this.Type, that1.Type) + return data +} +func encodeVarintPopulateState(data []byte, v uint64) []byte { + for v >= 1<<7 { + data = append(data, uint8(uint64(v)&0x7f|0x80)) + v >>= 7 } - if !this.Snapshot.Equal(that1.Snapshot) { - return fmt11.Errorf("Snapshot this(%v) Not Equal that(%v)", this.Snapshot, that1.Snapshot) + data = append(data, uint8(v)) + return data +} +func (m *Entry) Size() (n int) { + var l int + _ = l + if m.Name != nil { + l = len(*m.Name) + n += 1 + l + sovState(uint64(l)) } - if !this.Diff.Equal(that1.Diff) { - return fmt11.Errorf("Diff this(%v) Not Equal that(%v)", this.Diff, that1.Diff) + if m.Uuid != nil { + l = len(m.Uuid) + n += 1 + l + sovState(uint64(l)) } - if !this.Expunge.Equal(that1.Expunge) { - return fmt11.Errorf("Expunge this(%v) Not Equal that(%v)", this.Expunge, that1.Expunge) + if m.Value != nil { + l = len(m.Value) + n += 1 + l + sovState(uint64(l)) } - if !bytes2.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt11.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - return nil + return n } -func (this *Operation) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - that1, ok := that.(*Operation) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if this.Type != nil && that1.Type != nil { - if *this.Type != *that1.Type { - return false - } - } else if this.Type != nil { - return false - } else if that1.Type != nil { - return false +func (m *Operation) Size() (n int) { + var l int + _ = l + if m.Type != nil { + n += 1 + sovState(uint64(*m.Type)) } - if !this.Snapshot.Equal(that1.Snapshot) { - return false + if m.Snapshot != nil { + l = m.Snapshot.Size() + n += 1 + l + sovState(uint64(l)) } - if !this.Diff.Equal(that1.Diff) { - return false + if m.Expunge != nil { + l = m.Expunge.Size() + n += 1 + l + sovState(uint64(l)) } - if !this.Expunge.Equal(that1.Expunge) { - return false + if m.Diff != nil { + l = m.Diff.Size() + n += 1 + l + sovState(uint64(l)) } - if !bytes2.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - return true + return n } -func (this *Operation_Snapshot) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt11.Errorf("that == nil && this != nil") - } - that1, ok := that.(*Operation_Snapshot) - if !ok { - return fmt11.Errorf("that is not of type *Operation_Snapshot") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt11.Errorf("that is type *Operation_Snapshot but is nil && this != nil") - } else if this == nil { - return fmt11.Errorf("that is type *Operation_Snapshotbut is not nil && this == nil") - } - if !this.Entry.Equal(that1.Entry) { - return fmt11.Errorf("Entry this(%v) Not Equal that(%v)", this.Entry, that1.Entry) +func (m *Operation_Snapshot) Size() (n int) { + var l int + _ = l + if m.Entry != nil { + l = m.Entry.Size() + n += 1 + l + sovState(uint64(l)) } - if !bytes2.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt11.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - return nil + return n } -func (this *Operation_Snapshot) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - that1, ok := that.(*Operation_Snapshot) - if !ok { - return false +func (m *Operation_Diff) Size() (n int) { + var l int + _ = l + if m.Entry != nil { + l = m.Entry.Size() + n += 1 + l + sovState(uint64(l)) } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - if !this.Entry.Equal(that1.Entry) { - return false + return n +} + +func (m *Operation_Expunge) Size() (n int) { + var l int + _ = l + if m.Name != nil { + l = len(*m.Name) + n += 1 + l + sovState(uint64(l)) } - if !bytes2.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } - return true + return n } -func (this *Operation_Diff) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt11.Errorf("that == nil && this != nil") - } - that1, ok := that.(*Operation_Diff) - if !ok { - return fmt11.Errorf("that is not of type *Operation_Diff") - } - if that1 == nil { - if this == nil { - return nil +func sovState(x uint64) (n int) { + for { + n++ + x >>= 7 + if x == 0 { + break } - return fmt11.Errorf("that is type *Operation_Diff but is nil && this != nil") - } else if this == nil { - return fmt11.Errorf("that is type *Operation_Diffbut is not nil && this == nil") } - if !this.Entry.Equal(that1.Entry) { - return fmt11.Errorf("Entry this(%v) Not Equal that(%v)", this.Entry, that1.Entry) + return n +} +func sozState(x uint64) (n int) { + return sovState(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (this *Entry) String() string { + if this == nil { + return "nil" } - if !bytes2.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt11.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + s := strings.Join([]string{`&Entry{`, + `Name:` + valueToStringState(this.Name) + `,`, + `Uuid:` + valueToStringState(this.Uuid) + `,`, + `Value:` + valueToStringState(this.Value) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *Operation) String() string { + if this == nil { + return "nil" } - return nil + s := strings.Join([]string{`&Operation{`, + `Type:` + valueToStringState(this.Type) + `,`, + `Snapshot:` + strings.Replace(fmt.Sprintf("%v", this.Snapshot), "Operation_Snapshot", "Operation_Snapshot", 1) + `,`, + `Expunge:` + strings.Replace(fmt.Sprintf("%v", this.Expunge), "Operation_Expunge", "Operation_Expunge", 1) + `,`, + `Diff:` + strings.Replace(fmt.Sprintf("%v", this.Diff), "Operation_Diff", "Operation_Diff", 1) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s } -func (this *Operation_Diff) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false +func (this *Operation_Snapshot) String() string { + if this == nil { + return "nil" } - - that1, ok := that.(*Operation_Diff) - if !ok { - return false + s := strings.Join([]string{`&Operation_Snapshot{`, + `Entry:` + strings.Replace(fmt.Sprintf("%v", this.Entry), "Entry", "Entry", 1) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *Operation_Diff) String() string { + if this == nil { + return "nil" } - if that1 == nil { - if this == nil { - return true + s := strings.Join([]string{`&Operation_Diff{`, + `Entry:` + strings.Replace(fmt.Sprintf("%v", this.Entry), "Entry", "Entry", 1) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *Operation_Expunge) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&Operation_Expunge{`, + `Name:` + valueToStringState(this.Name) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func valueToStringState(v interface{}) string { + rv := reflect.ValueOf(v) + if rv.IsNil() { + return "nil" + } + pv := reflect.Indirect(rv).Interface() + return fmt.Sprintf("*%v", pv) +} +func (m *Entry) Unmarshal(data []byte) error { + var hasFields [1]uint64 + 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 Name", 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 + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthState + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(data[iNdEx:postIndex]) + m.Name = &s + iNdEx = postIndex + hasFields[0] |= uint64(0x00000001) + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Uuid", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + byteLen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthState + } + postIndex := iNdEx + byteLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Uuid = append([]byte{}, data[iNdEx:postIndex]...) + iNdEx = postIndex + hasFields[0] |= uint64(0x00000002) + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + byteLen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthState + } + postIndex := iNdEx + byteLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Value = append([]byte{}, data[iNdEx:postIndex]...) + iNdEx = postIndex + hasFields[0] |= uint64(0x00000004) + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipState(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthState + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - return false - } else if this == nil { - return false } - if !this.Entry.Equal(that1.Entry) { - return false + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("name") } - if !bytes2.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false + if hasFields[0]&uint64(0x00000002) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("uuid") } - return true + if hasFields[0]&uint64(0x00000004) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("value") + } + + return nil } -func (this *Operation_Expunge) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil +func (m *Operation) Unmarshal(data []byte) error { + var hasFields [1]uint64 + 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 != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + var v Operation_Type + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (Operation_Type(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Type = &v + hasFields[0] |= uint64(0x00000001) + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Snapshot", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthState + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Snapshot == nil { + m.Snapshot = &Operation_Snapshot{} + } + if err := m.Snapshot.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Expunge", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthState + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Expunge == nil { + m.Expunge = &Operation_Expunge{} + } + if err := m.Expunge.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Diff", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthState + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Diff == nil { + m.Diff = &Operation_Diff{} + } + if err := m.Diff.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipState(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthState + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - return fmt11.Errorf("that == nil && this != nil") } - - that1, ok := that.(*Operation_Expunge) - if !ok { - return fmt11.Errorf("that is not of type *Operation_Expunge") + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("type") } - if that1 == nil { - if this == nil { - return nil + + return nil +} +func (m *Operation_Snapshot) Unmarshal(data []byte) error { + var hasFields [1]uint64 + 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 + } } - return fmt11.Errorf("that is type *Operation_Expunge but is nil && this != nil") - } else if this == nil { - return fmt11.Errorf("that is type *Operation_Expungebut is not nil && this == nil") - } - if this.Name != nil && that1.Name != nil { - if *this.Name != *that1.Name { - return fmt11.Errorf("Name this(%v) Not Equal that(%v)", *this.Name, *that1.Name) + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Entry", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthState + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Entry == nil { + m.Entry = &Entry{} + } + if err := m.Entry.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + hasFields[0] |= uint64(0x00000001) + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipState(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthState + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - } else if this.Name != nil { - return fmt11.Errorf("this.Name == nil && that.Name != nil") - } else if that1.Name != nil { - return fmt11.Errorf("Name this(%v) Not Equal that(%v)", this.Name, that1.Name) } - if !bytes2.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt11.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("entry") } + return nil } -func (this *Operation_Expunge) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true +func (m *Operation_Diff) Unmarshal(data []byte) error { + var hasFields [1]uint64 + 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 Entry", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthState + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Entry == nil { + m.Entry = &Entry{} + } + if err := m.Entry.Unmarshal(data[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + hasFields[0] |= uint64(0x00000001) + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipState(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthState + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - return false } - - that1, ok := that.(*Operation_Expunge) - if !ok { - return false + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("entry") } - if that1 == nil { - if this == nil { - return true + + return nil +} +func (m *Operation_Expunge) Unmarshal(data []byte) error { + var hasFields [1]uint64 + 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 + } } - return false - } else if this == nil { - return false - } - if this.Name != nil && that1.Name != nil { - if *this.Name != *that1.Name { - return false + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", 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 + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthState + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(data[iNdEx:postIndex]) + m.Name = &s + iNdEx = postIndex + hasFields[0] |= uint64(0x00000001) + default: + var sizeOfWire int + for { + sizeOfWire++ + wire >>= 7 + if wire == 0 { + break + } + } + iNdEx -= sizeOfWire + skippy, err := skipState(data[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthState + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) + iNdEx += skippy } - } else if this.Name != nil { - return false - } else if that1.Name != nil { - return false } - if !bytes2.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("name") } - return true + + return nil +} +func skipState(data []byte) (n int, err error) { + l := len(data) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + 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 { + 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 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, ErrInvalidLengthState + } + return iNdEx, nil + case 3: + for { + var innerWire uint64 + var start int = iNdEx + for shift := uint(0); ; shift += 7 { + 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 := skipState(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 ( + ErrInvalidLengthState = fmt.Errorf("proto: negative length found during unmarshaling") +) diff --git a/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/statepb_test.go b/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/statepb_test.go index 56d626beaa51..89870c024c44 100644 --- a/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/statepb_test.go +++ b/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosproto/statepb_test.go @@ -4,60 +4,60 @@ package mesosproto -import testing14 "testing" -import math_rand14 "math/rand" -import time14 "time" -import github_com_gogo_protobuf_proto8 "github.com/gogo/protobuf/proto" -import testing15 "testing" -import math_rand15 "math/rand" -import time15 "time" -import encoding_json2 "encoding/json" -import testing16 "testing" -import math_rand16 "math/rand" -import time16 "time" -import github_com_gogo_protobuf_proto9 "github.com/gogo/protobuf/proto" -import math_rand17 "math/rand" -import time17 "time" -import testing17 "testing" -import fmt4 "fmt" -import math_rand18 "math/rand" -import time18 "time" -import testing18 "testing" -import github_com_gogo_protobuf_proto10 "github.com/gogo/protobuf/proto" -import math_rand19 "math/rand" -import time19 "time" -import testing19 "testing" -import fmt5 "fmt" -import go_parser2 "go/parser" -import math_rand20 "math/rand" -import time20 "time" -import testing20 "testing" -import github_com_gogo_protobuf_proto11 "github.com/gogo/protobuf/proto" +import testing "testing" +import math_rand "math/rand" +import time "time" +import github_com_gogo_protobuf_proto "github.com/gogo/protobuf/proto" +import github_com_gogo_protobuf_jsonpb "github.com/gogo/protobuf/jsonpb" +import fmt "fmt" +import go_parser "go/parser" +import proto "github.com/gogo/protobuf/proto" +import math "math" -func TestEntryProto(t *testing14.T) { - popr := math_rand14.New(math_rand14.NewSource(time14.Now().UnixNano())) +// discarding unused import gogoproto "github.com/gogo/protobuf/gogoproto" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +func TestEntryProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedEntry(popr, false) - data, err := github_com_gogo_protobuf_proto8.Marshal(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Entry{} - if err := github_com_gogo_protobuf_proto8.Unmarshal(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestEntryMarshalTo(t *testing14.T) { - popr := math_rand14.New(math_rand14.NewSource(time14.Now().UnixNano())) +func TestEntryMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedEntry(popr, false) size := p.Size() data := make([]byte, size) @@ -66,25 +66,25 @@ func TestEntryMarshalTo(t *testing14.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Entry{} - if err := github_com_gogo_protobuf_proto8.Unmarshal(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkEntryProtoMarshal(b *testing14.B) { - popr := math_rand14.New(math_rand14.NewSource(616)) +func BenchmarkEntryProtoMarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 pops := make([]*Entry, 10000) for i := 0; i < 10000; i++ { @@ -92,7 +92,7 @@ func BenchmarkEntryProtoMarshal(b *testing14.B) { } b.ResetTimer() for i := 0; i < b.N; i++ { - data, err := github_com_gogo_protobuf_proto8.Marshal(pops[i%10000]) + data, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) if err != nil { panic(err) } @@ -101,12 +101,12 @@ func BenchmarkEntryProtoMarshal(b *testing14.B) { b.SetBytes(int64(total / b.N)) } -func BenchmarkEntryProtoUnmarshal(b *testing14.B) { - popr := math_rand14.New(math_rand14.NewSource(616)) +func BenchmarkEntryProtoUnmarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 datas := make([][]byte, 10000) for i := 0; i < 10000; i++ { - data, err := github_com_gogo_protobuf_proto8.Marshal(NewPopulatedEntry(popr, false)) + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedEntry(popr, false)) if err != nil { panic(err) } @@ -116,37 +116,50 @@ func BenchmarkEntryProtoUnmarshal(b *testing14.B) { b.ResetTimer() for i := 0; i < b.N; i++ { total += len(datas[i%10000]) - if err := github_com_gogo_protobuf_proto8.Unmarshal(datas[i%10000], msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { panic(err) } } b.SetBytes(int64(total / b.N)) } -func TestOperationProto(t *testing14.T) { - popr := math_rand14.New(math_rand14.NewSource(time14.Now().UnixNano())) +func TestOperationProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedOperation(popr, false) - data, err := github_com_gogo_protobuf_proto8.Marshal(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Operation{} - if err := github_com_gogo_protobuf_proto8.Unmarshal(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestOperationMarshalTo(t *testing14.T) { - popr := math_rand14.New(math_rand14.NewSource(time14.Now().UnixNano())) +func TestOperationMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedOperation(popr, false) size := p.Size() data := make([]byte, size) @@ -155,25 +168,25 @@ func TestOperationMarshalTo(t *testing14.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Operation{} - if err := github_com_gogo_protobuf_proto8.Unmarshal(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkOperationProtoMarshal(b *testing14.B) { - popr := math_rand14.New(math_rand14.NewSource(616)) +func BenchmarkOperationProtoMarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 pops := make([]*Operation, 10000) for i := 0; i < 10000; i++ { @@ -181,7 +194,7 @@ func BenchmarkOperationProtoMarshal(b *testing14.B) { } b.ResetTimer() for i := 0; i < b.N; i++ { - data, err := github_com_gogo_protobuf_proto8.Marshal(pops[i%10000]) + data, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) if err != nil { panic(err) } @@ -190,12 +203,12 @@ func BenchmarkOperationProtoMarshal(b *testing14.B) { b.SetBytes(int64(total / b.N)) } -func BenchmarkOperationProtoUnmarshal(b *testing14.B) { - popr := math_rand14.New(math_rand14.NewSource(616)) +func BenchmarkOperationProtoUnmarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 datas := make([][]byte, 10000) for i := 0; i < 10000; i++ { - data, err := github_com_gogo_protobuf_proto8.Marshal(NewPopulatedOperation(popr, false)) + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedOperation(popr, false)) if err != nil { panic(err) } @@ -205,37 +218,50 @@ func BenchmarkOperationProtoUnmarshal(b *testing14.B) { b.ResetTimer() for i := 0; i < b.N; i++ { total += len(datas[i%10000]) - if err := github_com_gogo_protobuf_proto8.Unmarshal(datas[i%10000], msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { panic(err) } } b.SetBytes(int64(total / b.N)) } -func TestOperation_SnapshotProto(t *testing14.T) { - popr := math_rand14.New(math_rand14.NewSource(time14.Now().UnixNano())) +func TestOperation_SnapshotProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedOperation_Snapshot(popr, false) - data, err := github_com_gogo_protobuf_proto8.Marshal(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Operation_Snapshot{} - if err := github_com_gogo_protobuf_proto8.Unmarshal(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestOperation_SnapshotMarshalTo(t *testing14.T) { - popr := math_rand14.New(math_rand14.NewSource(time14.Now().UnixNano())) +func TestOperation_SnapshotMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedOperation_Snapshot(popr, false) size := p.Size() data := make([]byte, size) @@ -244,25 +270,25 @@ func TestOperation_SnapshotMarshalTo(t *testing14.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Operation_Snapshot{} - if err := github_com_gogo_protobuf_proto8.Unmarshal(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkOperation_SnapshotProtoMarshal(b *testing14.B) { - popr := math_rand14.New(math_rand14.NewSource(616)) +func BenchmarkOperation_SnapshotProtoMarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 pops := make([]*Operation_Snapshot, 10000) for i := 0; i < 10000; i++ { @@ -270,7 +296,7 @@ func BenchmarkOperation_SnapshotProtoMarshal(b *testing14.B) { } b.ResetTimer() for i := 0; i < b.N; i++ { - data, err := github_com_gogo_protobuf_proto8.Marshal(pops[i%10000]) + data, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) if err != nil { panic(err) } @@ -279,12 +305,12 @@ func BenchmarkOperation_SnapshotProtoMarshal(b *testing14.B) { b.SetBytes(int64(total / b.N)) } -func BenchmarkOperation_SnapshotProtoUnmarshal(b *testing14.B) { - popr := math_rand14.New(math_rand14.NewSource(616)) +func BenchmarkOperation_SnapshotProtoUnmarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 datas := make([][]byte, 10000) for i := 0; i < 10000; i++ { - data, err := github_com_gogo_protobuf_proto8.Marshal(NewPopulatedOperation_Snapshot(popr, false)) + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedOperation_Snapshot(popr, false)) if err != nil { panic(err) } @@ -294,37 +320,50 @@ func BenchmarkOperation_SnapshotProtoUnmarshal(b *testing14.B) { b.ResetTimer() for i := 0; i < b.N; i++ { total += len(datas[i%10000]) - if err := github_com_gogo_protobuf_proto8.Unmarshal(datas[i%10000], msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { panic(err) } } b.SetBytes(int64(total / b.N)) } -func TestOperation_DiffProto(t *testing14.T) { - popr := math_rand14.New(math_rand14.NewSource(time14.Now().UnixNano())) +func TestOperation_DiffProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedOperation_Diff(popr, false) - data, err := github_com_gogo_protobuf_proto8.Marshal(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Operation_Diff{} - if err := github_com_gogo_protobuf_proto8.Unmarshal(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestOperation_DiffMarshalTo(t *testing14.T) { - popr := math_rand14.New(math_rand14.NewSource(time14.Now().UnixNano())) +func TestOperation_DiffMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedOperation_Diff(popr, false) size := p.Size() data := make([]byte, size) @@ -333,25 +372,25 @@ func TestOperation_DiffMarshalTo(t *testing14.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Operation_Diff{} - if err := github_com_gogo_protobuf_proto8.Unmarshal(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkOperation_DiffProtoMarshal(b *testing14.B) { - popr := math_rand14.New(math_rand14.NewSource(616)) +func BenchmarkOperation_DiffProtoMarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 pops := make([]*Operation_Diff, 10000) for i := 0; i < 10000; i++ { @@ -359,7 +398,7 @@ func BenchmarkOperation_DiffProtoMarshal(b *testing14.B) { } b.ResetTimer() for i := 0; i < b.N; i++ { - data, err := github_com_gogo_protobuf_proto8.Marshal(pops[i%10000]) + data, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) if err != nil { panic(err) } @@ -368,12 +407,12 @@ func BenchmarkOperation_DiffProtoMarshal(b *testing14.B) { b.SetBytes(int64(total / b.N)) } -func BenchmarkOperation_DiffProtoUnmarshal(b *testing14.B) { - popr := math_rand14.New(math_rand14.NewSource(616)) +func BenchmarkOperation_DiffProtoUnmarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 datas := make([][]byte, 10000) for i := 0; i < 10000; i++ { - data, err := github_com_gogo_protobuf_proto8.Marshal(NewPopulatedOperation_Diff(popr, false)) + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedOperation_Diff(popr, false)) if err != nil { panic(err) } @@ -383,37 +422,50 @@ func BenchmarkOperation_DiffProtoUnmarshal(b *testing14.B) { b.ResetTimer() for i := 0; i < b.N; i++ { total += len(datas[i%10000]) - if err := github_com_gogo_protobuf_proto8.Unmarshal(datas[i%10000], msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { panic(err) } } b.SetBytes(int64(total / b.N)) } -func TestOperation_ExpungeProto(t *testing14.T) { - popr := math_rand14.New(math_rand14.NewSource(time14.Now().UnixNano())) +func TestOperation_ExpungeProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedOperation_Expunge(popr, false) - data, err := github_com_gogo_protobuf_proto8.Marshal(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Operation_Expunge{} - if err := github_com_gogo_protobuf_proto8.Unmarshal(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } + littlefuzz := make([]byte, len(data)) + copy(littlefuzz, data) for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } -func TestOperation_ExpungeMarshalTo(t *testing14.T) { - popr := math_rand14.New(math_rand14.NewSource(time14.Now().UnixNano())) +func TestOperation_ExpungeMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedOperation_Expunge(popr, false) size := p.Size() data := make([]byte, size) @@ -422,25 +474,25 @@ func TestOperation_ExpungeMarshalTo(t *testing14.T) { } _, err := p.MarshalTo(data) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Operation_Expunge{} - if err := github_com_gogo_protobuf_proto8.Unmarshal(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } for i := range data { data[i] = byte(popr.Intn(256)) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func BenchmarkOperation_ExpungeProtoMarshal(b *testing14.B) { - popr := math_rand14.New(math_rand14.NewSource(616)) +func BenchmarkOperation_ExpungeProtoMarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 pops := make([]*Operation_Expunge, 10000) for i := 0; i < 10000; i++ { @@ -448,7 +500,7 @@ func BenchmarkOperation_ExpungeProtoMarshal(b *testing14.B) { } b.ResetTimer() for i := 0; i < b.N; i++ { - data, err := github_com_gogo_protobuf_proto8.Marshal(pops[i%10000]) + data, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) if err != nil { panic(err) } @@ -457,12 +509,12 @@ func BenchmarkOperation_ExpungeProtoMarshal(b *testing14.B) { b.SetBytes(int64(total / b.N)) } -func BenchmarkOperation_ExpungeProtoUnmarshal(b *testing14.B) { - popr := math_rand14.New(math_rand14.NewSource(616)) +func BenchmarkOperation_ExpungeProtoUnmarshal(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 datas := make([][]byte, 10000) for i := 0; i < 10000; i++ { - data, err := github_com_gogo_protobuf_proto8.Marshal(NewPopulatedOperation_Expunge(popr, false)) + data, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedOperation_Expunge(popr, false)) if err != nil { panic(err) } @@ -472,336 +524,452 @@ func BenchmarkOperation_ExpungeProtoUnmarshal(b *testing14.B) { b.ResetTimer() for i := 0; i < b.N; i++ { total += len(datas[i%10000]) - if err := github_com_gogo_protobuf_proto8.Unmarshal(datas[i%10000], msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { panic(err) } } b.SetBytes(int64(total / b.N)) } -func TestEntryJSON(t *testing15.T) { - popr := math_rand15.New(math_rand15.NewSource(time15.Now().UnixNano())) +func TestEntryJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedEntry(popr, true) - jsondata, err := encoding_json2.Marshal(p) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Entry{} - err = encoding_json2.Unmarshal(jsondata, msg) + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } -func TestOperationJSON(t *testing15.T) { - popr := math_rand15.New(math_rand15.NewSource(time15.Now().UnixNano())) +func TestOperationJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedOperation(popr, true) - jsondata, err := encoding_json2.Marshal(p) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Operation{} - err = encoding_json2.Unmarshal(jsondata, msg) + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } -func TestOperation_SnapshotJSON(t *testing15.T) { - popr := math_rand15.New(math_rand15.NewSource(time15.Now().UnixNano())) +func TestOperation_SnapshotJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedOperation_Snapshot(popr, true) - jsondata, err := encoding_json2.Marshal(p) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Operation_Snapshot{} - err = encoding_json2.Unmarshal(jsondata, msg) + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } -func TestOperation_DiffJSON(t *testing15.T) { - popr := math_rand15.New(math_rand15.NewSource(time15.Now().UnixNano())) +func TestOperation_DiffJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedOperation_Diff(popr, true) - jsondata, err := encoding_json2.Marshal(p) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Operation_Diff{} - err = encoding_json2.Unmarshal(jsondata, msg) + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } -func TestOperation_ExpungeJSON(t *testing15.T) { - popr := math_rand15.New(math_rand15.NewSource(time15.Now().UnixNano())) +func TestOperation_ExpungeJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedOperation_Expunge(popr, true) - jsondata, err := encoding_json2.Marshal(p) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Operation_Expunge{} - err = encoding_json2.Unmarshal(jsondata, msg) + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Json Equal %#v", msg, p) + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } -func TestEntryProtoText(t *testing16.T) { - popr := math_rand16.New(math_rand16.NewSource(time16.Now().UnixNano())) +func TestEntryProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedEntry(popr, true) - data := github_com_gogo_protobuf_proto9.MarshalTextString(p) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) msg := &Entry{} - if err := github_com_gogo_protobuf_proto9.UnmarshalText(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestEntryProtoCompactText(t *testing16.T) { - popr := math_rand16.New(math_rand16.NewSource(time16.Now().UnixNano())) +func TestEntryProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedEntry(popr, true) - data := github_com_gogo_protobuf_proto9.CompactTextString(p) + data := github_com_gogo_protobuf_proto.CompactTextString(p) msg := &Entry{} - if err := github_com_gogo_protobuf_proto9.UnmarshalText(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestOperationProtoText(t *testing16.T) { - popr := math_rand16.New(math_rand16.NewSource(time16.Now().UnixNano())) +func TestOperationProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedOperation(popr, true) - data := github_com_gogo_protobuf_proto9.MarshalTextString(p) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) msg := &Operation{} - if err := github_com_gogo_protobuf_proto9.UnmarshalText(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestOperationProtoCompactText(t *testing16.T) { - popr := math_rand16.New(math_rand16.NewSource(time16.Now().UnixNano())) +func TestOperationProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedOperation(popr, true) - data := github_com_gogo_protobuf_proto9.CompactTextString(p) + data := github_com_gogo_protobuf_proto.CompactTextString(p) msg := &Operation{} - if err := github_com_gogo_protobuf_proto9.UnmarshalText(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestOperation_SnapshotProtoText(t *testing16.T) { - popr := math_rand16.New(math_rand16.NewSource(time16.Now().UnixNano())) +func TestOperation_SnapshotProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedOperation_Snapshot(popr, true) - data := github_com_gogo_protobuf_proto9.MarshalTextString(p) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) msg := &Operation_Snapshot{} - if err := github_com_gogo_protobuf_proto9.UnmarshalText(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestOperation_SnapshotProtoCompactText(t *testing16.T) { - popr := math_rand16.New(math_rand16.NewSource(time16.Now().UnixNano())) +func TestOperation_SnapshotProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedOperation_Snapshot(popr, true) - data := github_com_gogo_protobuf_proto9.CompactTextString(p) + data := github_com_gogo_protobuf_proto.CompactTextString(p) msg := &Operation_Snapshot{} - if err := github_com_gogo_protobuf_proto9.UnmarshalText(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestOperation_DiffProtoText(t *testing16.T) { - popr := math_rand16.New(math_rand16.NewSource(time16.Now().UnixNano())) +func TestOperation_DiffProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedOperation_Diff(popr, true) - data := github_com_gogo_protobuf_proto9.MarshalTextString(p) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) msg := &Operation_Diff{} - if err := github_com_gogo_protobuf_proto9.UnmarshalText(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestOperation_DiffProtoCompactText(t *testing16.T) { - popr := math_rand16.New(math_rand16.NewSource(time16.Now().UnixNano())) +func TestOperation_DiffProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedOperation_Diff(popr, true) - data := github_com_gogo_protobuf_proto9.CompactTextString(p) + data := github_com_gogo_protobuf_proto.CompactTextString(p) msg := &Operation_Diff{} - if err := github_com_gogo_protobuf_proto9.UnmarshalText(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestOperation_ExpungeProtoText(t *testing16.T) { - popr := math_rand16.New(math_rand16.NewSource(time16.Now().UnixNano())) +func TestOperation_ExpungeProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedOperation_Expunge(popr, true) - data := github_com_gogo_protobuf_proto9.MarshalTextString(p) + data := github_com_gogo_protobuf_proto.MarshalTextString(p) msg := &Operation_Expunge{} - if err := github_com_gogo_protobuf_proto9.UnmarshalText(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestOperation_ExpungeProtoCompactText(t *testing16.T) { - popr := math_rand16.New(math_rand16.NewSource(time16.Now().UnixNano())) +func TestOperation_ExpungeProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedOperation_Expunge(popr, true) - data := github_com_gogo_protobuf_proto9.CompactTextString(p) + data := github_com_gogo_protobuf_proto.CompactTextString(p) msg := &Operation_Expunge{} - if err := github_com_gogo_protobuf_proto9.UnmarshalText(data, msg); err != nil { - panic(err) + if err := github_com_gogo_protobuf_proto.UnmarshalText(data, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) } if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err) + t.Fatalf("seed = %d, %#v !VerboseProto %#v, since %v", seed, msg, p, err) } if !p.Equal(msg) { - t.Fatalf("%#v !Proto %#v", msg, p) + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) } } -func TestEntryStringer(t *testing17.T) { - popr := math_rand17.New(math_rand17.NewSource(time17.Now().UnixNano())) +func TestEntryVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedEntry(popr, false) - s1 := p.String() - s2 := fmt4.Sprintf("%v", p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + panic(err) + } + msg := &Entry{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + panic(err) + } + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) + } +} +func TestOperationVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedOperation(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + panic(err) + } + msg := &Operation{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + panic(err) + } + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) + } +} +func TestOperation_SnapshotVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedOperation_Snapshot(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + panic(err) + } + msg := &Operation_Snapshot{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + panic(err) + } + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) + } +} +func TestOperation_DiffVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedOperation_Diff(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + panic(err) + } + msg := &Operation_Diff{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + panic(err) + } + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) + } +} +func TestOperation_ExpungeVerboseEqual(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedOperation_Expunge(popr, false) + data, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + panic(err) + } + msg := &Operation_Expunge{} + if err := github_com_gogo_protobuf_proto.Unmarshal(data, msg); err != nil { + panic(err) + } + if err := p.VerboseEqual(msg); err != nil { + t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) + } +} +func TestEntryGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) + p := NewPopulatedEntry(popr, false) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) } } -func TestOperationStringer(t *testing17.T) { - popr := math_rand17.New(math_rand17.NewSource(time17.Now().UnixNano())) +func TestOperationGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedOperation(popr, false) - s1 := p.String() - s2 := fmt4.Sprintf("%v", p) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) } } -func TestOperation_SnapshotStringer(t *testing17.T) { - popr := math_rand17.New(math_rand17.NewSource(time17.Now().UnixNano())) +func TestOperation_SnapshotGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedOperation_Snapshot(popr, false) - s1 := p.String() - s2 := fmt4.Sprintf("%v", p) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) } } -func TestOperation_DiffStringer(t *testing17.T) { - popr := math_rand17.New(math_rand17.NewSource(time17.Now().UnixNano())) +func TestOperation_DiffGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedOperation_Diff(popr, false) - s1 := p.String() - s2 := fmt4.Sprintf("%v", p) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) } } -func TestOperation_ExpungeStringer(t *testing17.T) { - popr := math_rand17.New(math_rand17.NewSource(time17.Now().UnixNano())) +func TestOperation_ExpungeGoString(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedOperation_Expunge(popr, false) - s1 := p.String() - s2 := fmt4.Sprintf("%v", p) + s1 := p.GoString() + s2 := fmt.Sprintf("%#v", p) if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) + t.Fatalf("GoString want %v got %v", s1, s2) + } + _, err := go_parser.ParseExpr(s1) + if err != nil { + panic(err) } } -func TestEntrySize(t *testing18.T) { - popr := math_rand18.New(math_rand18.NewSource(time18.Now().UnixNano())) +func TestEntrySize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedEntry(popr, true) - size2 := github_com_gogo_protobuf_proto10.Size(p) - data, err := github_com_gogo_protobuf_proto10.Marshal(p) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } size := p.Size() if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) } if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := github_com_gogo_protobuf_proto10.Size(p) + size3 := github_com_gogo_protobuf_proto.Size(p) if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } } -func BenchmarkEntrySize(b *testing18.B) { - popr := math_rand18.New(math_rand18.NewSource(616)) +func BenchmarkEntrySize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 pops := make([]*Entry, 1000) for i := 0; i < 1000; i++ { @@ -814,29 +982,30 @@ func BenchmarkEntrySize(b *testing18.B) { b.SetBytes(int64(total / b.N)) } -func TestOperationSize(t *testing18.T) { - popr := math_rand18.New(math_rand18.NewSource(time18.Now().UnixNano())) +func TestOperationSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedOperation(popr, true) - size2 := github_com_gogo_protobuf_proto10.Size(p) - data, err := github_com_gogo_protobuf_proto10.Marshal(p) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } size := p.Size() if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) } if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := github_com_gogo_protobuf_proto10.Size(p) + size3 := github_com_gogo_protobuf_proto.Size(p) if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } } -func BenchmarkOperationSize(b *testing18.B) { - popr := math_rand18.New(math_rand18.NewSource(616)) +func BenchmarkOperationSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 pops := make([]*Operation, 1000) for i := 0; i < 1000; i++ { @@ -849,29 +1018,30 @@ func BenchmarkOperationSize(b *testing18.B) { b.SetBytes(int64(total / b.N)) } -func TestOperation_SnapshotSize(t *testing18.T) { - popr := math_rand18.New(math_rand18.NewSource(time18.Now().UnixNano())) +func TestOperation_SnapshotSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedOperation_Snapshot(popr, true) - size2 := github_com_gogo_protobuf_proto10.Size(p) - data, err := github_com_gogo_protobuf_proto10.Marshal(p) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } size := p.Size() if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) } if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := github_com_gogo_protobuf_proto10.Size(p) + size3 := github_com_gogo_protobuf_proto.Size(p) if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } } -func BenchmarkOperation_SnapshotSize(b *testing18.B) { - popr := math_rand18.New(math_rand18.NewSource(616)) +func BenchmarkOperation_SnapshotSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 pops := make([]*Operation_Snapshot, 1000) for i := 0; i < 1000; i++ { @@ -884,29 +1054,30 @@ func BenchmarkOperation_SnapshotSize(b *testing18.B) { b.SetBytes(int64(total / b.N)) } -func TestOperation_DiffSize(t *testing18.T) { - popr := math_rand18.New(math_rand18.NewSource(time18.Now().UnixNano())) +func TestOperation_DiffSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedOperation_Diff(popr, true) - size2 := github_com_gogo_protobuf_proto10.Size(p) - data, err := github_com_gogo_protobuf_proto10.Marshal(p) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } size := p.Size() if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) } if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := github_com_gogo_protobuf_proto10.Size(p) + size3 := github_com_gogo_protobuf_proto.Size(p) if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } } -func BenchmarkOperation_DiffSize(b *testing18.B) { - popr := math_rand18.New(math_rand18.NewSource(616)) +func BenchmarkOperation_DiffSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 pops := make([]*Operation_Diff, 1000) for i := 0; i < 1000; i++ { @@ -919,29 +1090,30 @@ func BenchmarkOperation_DiffSize(b *testing18.B) { b.SetBytes(int64(total / b.N)) } -func TestOperation_ExpungeSize(t *testing18.T) { - popr := math_rand18.New(math_rand18.NewSource(time18.Now().UnixNano())) +func TestOperation_ExpungeSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedOperation_Expunge(popr, true) - size2 := github_com_gogo_protobuf_proto10.Size(p) - data, err := github_com_gogo_protobuf_proto10.Marshal(p) + size2 := github_com_gogo_protobuf_proto.Size(p) + data, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { - panic(err) + t.Fatalf("seed = %d, err = %v", seed, err) } size := p.Size() if len(data) != size { - t.Fatalf("size %v != marshalled size %v", size, len(data)) + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(data)) } if size2 != size { - t.Fatalf("size %v != before marshal proto.Size %v", size, size2) + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := github_com_gogo_protobuf_proto10.Size(p) + size3 := github_com_gogo_protobuf_proto.Size(p) if size3 != size { - t.Fatalf("size %v != after marshal proto.Size %v", size, size3) + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } } -func BenchmarkOperation_ExpungeSize(b *testing18.B) { - popr := math_rand18.New(math_rand18.NewSource(616)) +func BenchmarkOperation_ExpungeSize(b *testing.B) { + popr := math_rand.New(math_rand.NewSource(616)) total := 0 pops := make([]*Operation_Expunge, 1000) for i := 0; i < 1000; i++ { @@ -954,144 +1126,49 @@ func BenchmarkOperation_ExpungeSize(b *testing18.B) { b.SetBytes(int64(total / b.N)) } -func TestEntryGoString(t *testing19.T) { - popr := math_rand19.New(math_rand19.NewSource(time19.Now().UnixNano())) +func TestEntryStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedEntry(popr, false) - s1 := p.GoString() - s2 := fmt5.Sprintf("%#v", p) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) - } - _, err := go_parser2.ParseExpr(s1) - if err != nil { - panic(err) + t.Fatalf("String want %v got %v", s1, s2) } } -func TestOperationGoString(t *testing19.T) { - popr := math_rand19.New(math_rand19.NewSource(time19.Now().UnixNano())) +func TestOperationStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedOperation(popr, false) - s1 := p.GoString() - s2 := fmt5.Sprintf("%#v", p) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) - } - _, err := go_parser2.ParseExpr(s1) - if err != nil { - panic(err) + t.Fatalf("String want %v got %v", s1, s2) } } -func TestOperation_SnapshotGoString(t *testing19.T) { - popr := math_rand19.New(math_rand19.NewSource(time19.Now().UnixNano())) +func TestOperation_SnapshotStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedOperation_Snapshot(popr, false) - s1 := p.GoString() - s2 := fmt5.Sprintf("%#v", p) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) - } - _, err := go_parser2.ParseExpr(s1) - if err != nil { - panic(err) + t.Fatalf("String want %v got %v", s1, s2) } } -func TestOperation_DiffGoString(t *testing19.T) { - popr := math_rand19.New(math_rand19.NewSource(time19.Now().UnixNano())) +func TestOperation_DiffStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedOperation_Diff(popr, false) - s1 := p.GoString() - s2 := fmt5.Sprintf("%#v", p) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) - } - _, err := go_parser2.ParseExpr(s1) - if err != nil { - panic(err) + t.Fatalf("String want %v got %v", s1, s2) } } -func TestOperation_ExpungeGoString(t *testing19.T) { - popr := math_rand19.New(math_rand19.NewSource(time19.Now().UnixNano())) +func TestOperation_ExpungeStringer(t *testing.T) { + popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) p := NewPopulatedOperation_Expunge(popr, false) - s1 := p.GoString() - s2 := fmt5.Sprintf("%#v", p) + s1 := p.String() + s2 := fmt.Sprintf("%v", p) if s1 != s2 { - t.Fatalf("GoString want %v got %v", s1, s2) - } - _, err := go_parser2.ParseExpr(s1) - if err != nil { - panic(err) - } -} -func TestEntryVerboseEqual(t *testing20.T) { - popr := math_rand20.New(math_rand20.NewSource(time20.Now().UnixNano())) - p := NewPopulatedEntry(popr, false) - data, err := github_com_gogo_protobuf_proto11.Marshal(p) - if err != nil { - panic(err) - } - msg := &Entry{} - if err := github_com_gogo_protobuf_proto11.Unmarshal(data, msg); err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) - } -} -func TestOperationVerboseEqual(t *testing20.T) { - popr := math_rand20.New(math_rand20.NewSource(time20.Now().UnixNano())) - p := NewPopulatedOperation(popr, false) - data, err := github_com_gogo_protobuf_proto11.Marshal(p) - if err != nil { - panic(err) - } - msg := &Operation{} - if err := github_com_gogo_protobuf_proto11.Unmarshal(data, msg); err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) - } -} -func TestOperation_SnapshotVerboseEqual(t *testing20.T) { - popr := math_rand20.New(math_rand20.NewSource(time20.Now().UnixNano())) - p := NewPopulatedOperation_Snapshot(popr, false) - data, err := github_com_gogo_protobuf_proto11.Marshal(p) - if err != nil { - panic(err) - } - msg := &Operation_Snapshot{} - if err := github_com_gogo_protobuf_proto11.Unmarshal(data, msg); err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) - } -} -func TestOperation_DiffVerboseEqual(t *testing20.T) { - popr := math_rand20.New(math_rand20.NewSource(time20.Now().UnixNano())) - p := NewPopulatedOperation_Diff(popr, false) - data, err := github_com_gogo_protobuf_proto11.Marshal(p) - if err != nil { - panic(err) - } - msg := &Operation_Diff{} - if err := github_com_gogo_protobuf_proto11.Unmarshal(data, msg); err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) - } -} -func TestOperation_ExpungeVerboseEqual(t *testing20.T) { - popr := math_rand20.New(math_rand20.NewSource(time20.Now().UnixNano())) - p := NewPopulatedOperation_Expunge(popr, false) - data, err := github_com_gogo_protobuf_proto11.Marshal(p) - if err != nil { - panic(err) - } - msg := &Operation_Expunge{} - if err := github_com_gogo_protobuf_proto11.Unmarshal(data, msg); err != nil { - panic(err) - } - if err := p.VerboseEqual(msg); err != nil { - t.Fatalf("%#v !VerboseEqual %#v, since %v", msg, p, err) + t.Fatalf("String want %v got %v", s1, s2) } } diff --git a/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosutil/constants.go b/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosutil/constants.go index 849c26baa00e..a1a3085f8e31 100644 --- a/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosutil/constants.go +++ b/Godeps/_workspace/src/github.com/mesos/mesos-go/mesosutil/constants.go @@ -2,5 +2,5 @@ package mesosutil const ( // MesosVersion indicates the supported mesos version. - MesosVersion = "0.20.0" + MesosVersion = "0.24.0" ) diff --git a/Godeps/_workspace/src/github.com/mesos/mesos-go/upid/upid.go b/Godeps/_workspace/src/github.com/mesos/mesos-go/upid/upid.go index ca69106ef189..74f9ebbd8065 100644 --- a/Godeps/_workspace/src/github.com/mesos/mesos-go/upid/upid.go +++ b/Godeps/_workspace/src/github.com/mesos/mesos-go/upid/upid.go @@ -49,10 +49,7 @@ func Parse(input string) (*UPID, error) { } // String returns the string representation. -func (u *UPID) String() string { - if u == nil { - return "" - } +func (u UPID) String() string { return fmt.Sprintf("%s@%s:%s", u.ID, u.Host, u.Port) } diff --git a/Godeps/_workspace/src/github.com/openshift/openshift-sdn/pkg/cmd/admin/network/project_options.go b/Godeps/_workspace/src/github.com/openshift/openshift-sdn/pkg/cmd/admin/network/project_options.go index e7a98628c30f..a84a1f14c486 100644 --- a/Godeps/_workspace/src/github.com/openshift/openshift-sdn/pkg/cmd/admin/network/project_options.go +++ b/Godeps/_workspace/src/github.com/openshift/openshift-sdn/pkg/cmd/admin/network/project_options.go @@ -11,6 +11,7 @@ import ( kapi "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/meta" + "k8s.io/kubernetes/pkg/api/unversioned" kclient "k8s.io/kubernetes/pkg/client/unversioned" "k8s.io/kubernetes/pkg/kubectl/resource" "k8s.io/kubernetes/pkg/labels" @@ -178,7 +179,7 @@ func (p *ProjectOptions) CreateOrUpdateNetNamespace(name string, id uint) error func newNetNamespace(name string, id uint) *sdnapi.NetNamespace { return &sdnapi.NetNamespace{ - TypeMeta: kapi.TypeMeta{Kind: "NetNamespace"}, + TypeMeta: unversioned.TypeMeta{Kind: "NetNamespace"}, ObjectMeta: kapi.ObjectMeta{Name: name}, NetName: name, NetID: id, diff --git a/Godeps/_workspace/src/github.com/openshift/openshift-sdn/pkg/ovssubnet/common.go b/Godeps/_workspace/src/github.com/openshift/openshift-sdn/pkg/ovssubnet/common.go index 9c6e00697ca2..a01b7d89f7c7 100644 --- a/Godeps/_workspace/src/github.com/openshift/openshift-sdn/pkg/ovssubnet/common.go +++ b/Godeps/_workspace/src/github.com/openshift/openshift-sdn/pkg/ovssubnet/common.go @@ -14,6 +14,7 @@ import ( "github.com/openshift/openshift-sdn/pkg/ovssubnet/controller/kube" "github.com/openshift/openshift-sdn/pkg/ovssubnet/controller/multitenant" + utildbus "k8s.io/kubernetes/pkg/util/dbus" kexec "k8s.io/kubernetes/pkg/util/exec" "k8s.io/kubernetes/pkg/util/iptables" ) @@ -702,7 +703,8 @@ func SetupIptables(fw *firewalld.Interface, clusterNetworkCIDR string) error { } } } else { - ipt := iptables.New(kexec.New(), iptables.ProtocolIpv4) + dbus := utildbus.New() + ipt := iptables.New(kexec.New(), dbus, iptables.ProtocolIpv4) _, err := ipt.EnsureRule(iptables.Append, iptables.TableNAT, iptables.ChainPostrouting, "-s", clusterNetworkCIDR, "!", "-d", clusterNetworkCIDR, "-j", "MASQUERADE") if err != nil { diff --git a/Godeps/_workspace/src/github.com/openshift/openshift-sdn/plugins/osdn/osdn.go b/Godeps/_workspace/src/github.com/openshift/openshift-sdn/plugins/osdn/osdn.go index 68cefc73ffe0..5941a2d1f6a4 100644 --- a/Godeps/_workspace/src/github.com/openshift/openshift-sdn/plugins/osdn/osdn.go +++ b/Godeps/_workspace/src/github.com/openshift/openshift-sdn/plugins/osdn/osdn.go @@ -12,6 +12,7 @@ import ( kapi "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/meta" + "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/client/cache" kclient "k8s.io/kubernetes/pkg/client/unversioned" "k8s.io/kubernetes/pkg/fields" @@ -84,7 +85,7 @@ func (oi *OsdnRegistryInterface) DeleteSubnet(nodeName string) error { func (oi *OsdnRegistryInterface) CreateSubnet(nodeName string, sub *osdnapi.Subnet) error { hs := &api.HostSubnet{ - TypeMeta: kapi.TypeMeta{Kind: "HostSubnet"}, + TypeMeta: unversioned.TypeMeta{Kind: "HostSubnet"}, ObjectMeta: kapi.ObjectMeta{Name: nodeName}, Host: nodeName, HostIP: sub.NodeIP, @@ -277,7 +278,7 @@ func (oi *OsdnRegistryInterface) WriteNetworkConfig(network string, subnetLength } } cn = &api.ClusterNetwork{ - TypeMeta: kapi.TypeMeta{Kind: "ClusterNetwork"}, + TypeMeta: unversioned.TypeMeta{Kind: "ClusterNetwork"}, ObjectMeta: kapi.ObjectMeta{Name: "default"}, Network: network, HostSubnetLength: int(subnetLength), @@ -374,7 +375,7 @@ func (oi *OsdnRegistryInterface) GetNetNamespace(name string) (osdnapi.NetNamesp func (oi *OsdnRegistryInterface) WriteNetNamespace(name string, id uint) error { netns := &api.NetNamespace{ - TypeMeta: kapi.TypeMeta{Kind: "NetNamespace"}, + TypeMeta: unversioned.TypeMeta{Kind: "NetNamespace"}, ObjectMeta: kapi.ObjectMeta{Name: name}, NetName: name, NetID: id, @@ -397,7 +398,7 @@ func (oi *OsdnRegistryInterface) GetServices() ([]osdnapi.Service, string, error } func (oi *OsdnRegistryInterface) getServices(namespace string) ([]osdnapi.Service, string, error) { - kServList, err := oi.kClient.Services(namespace).List(labels.Everything()) + kServList, err := oi.kClient.Services(namespace).List(labels.Everything(), fields.Everything()) if err != nil { return nil, "", err } @@ -498,7 +499,7 @@ func (oi *OsdnRegistryInterface) runEventQueue(resourceName string) (*oscache.Ev case "service": expectedType = &kapi.Service{} lw.ListFunc = func() (runtime.Object, error) { - return oi.kClient.Services(kapi.NamespaceAll).List(labels.Everything()) + return oi.kClient.Services(kapi.NamespaceAll).List(labels.Everything(), fields.Everything()) } lw.WatchFunc = func(resourceVersion string) (watch.Interface, error) { return oi.kClient.Services(kapi.NamespaceAll).Watch(labels.Everything(), fields.Everything(), resourceVersion) diff --git a/Godeps/_workspace/src/github.com/prometheus/client_golang/extraction/discriminator.go b/Godeps/_workspace/src/github.com/prometheus/client_golang/extraction/discriminator.go deleted file mode 100644 index a353c6378ce8..000000000000 --- a/Godeps/_workspace/src/github.com/prometheus/client_golang/extraction/discriminator.go +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright 2013 The Prometheus 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 extraction - -import ( - "errors" - "fmt" - "mime" - "net/http" -) - -// ProcessorForRequestHeader interprets a HTTP request header to determine -// what Processor should be used for the given input. If no acceptable -// Processor can be found, an error is returned. -func ProcessorForRequestHeader(header http.Header) (Processor, error) { - if header == nil { - return nil, errors.New("received illegal and nil header") - } - - mediatype, params, err := mime.ParseMediaType(header.Get("Content-Type")) - if err != nil { - return nil, fmt.Errorf("invalid Content-Type header %q: %s", header.Get("Content-Type"), err) - } - switch mediatype { - case "application/vnd.google.protobuf": - if params["proto"] != "io.prometheus.client.MetricFamily" { - return nil, fmt.Errorf("unrecognized protocol message %s", params["proto"]) - } - if params["encoding"] != "delimited" { - return nil, fmt.Errorf("unsupported encoding %s", params["encoding"]) - } - return MetricFamilyProcessor, nil - case "text/plain": - switch params["version"] { - case "0.0.4": - return Processor004, nil - case "": - // Fallback: most recent version. - return Processor004, nil - default: - return nil, fmt.Errorf("unrecognized API version %s", params["version"]) - } - case "application/json": - var prometheusAPIVersion string - - if params["schema"] == "prometheus/telemetry" && params["version"] != "" { - prometheusAPIVersion = params["version"] - } else { - prometheusAPIVersion = header.Get("X-Prometheus-API-Version") - } - - switch prometheusAPIVersion { - case "0.0.2": - return Processor002, nil - case "0.0.1": - return Processor001, nil - default: - return nil, fmt.Errorf("unrecognized API version %s", prometheusAPIVersion) - } - default: - return nil, fmt.Errorf("unsupported media type %q, expected %q", mediatype, "application/json") - } -} diff --git a/Godeps/_workspace/src/github.com/prometheus/client_golang/extraction/discriminator_test.go b/Godeps/_workspace/src/github.com/prometheus/client_golang/extraction/discriminator_test.go deleted file mode 100644 index 4f08248d643e..000000000000 --- a/Godeps/_workspace/src/github.com/prometheus/client_golang/extraction/discriminator_test.go +++ /dev/null @@ -1,126 +0,0 @@ -// Copyright 2013 The Prometheus 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 extraction - -import ( - "errors" - "net/http" - "testing" -) - -func testDiscriminatorHTTPHeader(t testing.TB) { - var scenarios = []struct { - input map[string]string - output Processor - err error - }{ - { - output: nil, - err: errors.New("received illegal and nil header"), - }, - { - input: map[string]string{"Content-Type": "application/json", "X-Prometheus-API-Version": "0.0.0"}, - output: nil, - err: errors.New("unrecognized API version 0.0.0"), - }, - { - input: map[string]string{"Content-Type": "application/json", "X-Prometheus-API-Version": "0.0.1"}, - output: Processor001, - err: nil, - }, - { - input: map[string]string{"Content-Type": `application/json; schema="prometheus/telemetry"; version=0.0.0`}, - output: nil, - err: errors.New("unrecognized API version 0.0.0"), - }, - { - input: map[string]string{"Content-Type": `application/json; schema="prometheus/telemetry"; version=0.0.1`}, - output: Processor001, - err: nil, - }, - { - input: map[string]string{"Content-Type": `application/json; schema="prometheus/telemetry"; version=0.0.2`}, - output: Processor002, - err: nil, - }, - { - input: map[string]string{"Content-Type": `application/vnd.google.protobuf; proto="io.prometheus.client.MetricFamily"; encoding="delimited"`}, - output: MetricFamilyProcessor, - err: nil, - }, - { - input: map[string]string{"Content-Type": `application/vnd.google.protobuf; proto="illegal"; encoding="delimited"`}, - output: nil, - err: errors.New("unrecognized protocol message illegal"), - }, - { - input: map[string]string{"Content-Type": `application/vnd.google.protobuf; proto="io.prometheus.client.MetricFamily"; encoding="illegal"`}, - output: nil, - err: errors.New("unsupported encoding illegal"), - }, - { - input: map[string]string{"Content-Type": `text/plain; version=0.0.4`}, - output: Processor004, - err: nil, - }, - { - input: map[string]string{"Content-Type": `text/plain`}, - output: Processor004, - err: nil, - }, - { - input: map[string]string{"Content-Type": `text/plain; version=0.0.3`}, - output: nil, - err: errors.New("unrecognized API version 0.0.3"), - }, - } - - for i, scenario := range scenarios { - var header http.Header - - if len(scenario.input) > 0 { - header = http.Header{} - } - - for key, value := range scenario.input { - header.Add(key, value) - } - - actual, err := ProcessorForRequestHeader(header) - - if scenario.err != err { - if scenario.err != nil && err != nil { - if scenario.err.Error() != err.Error() { - t.Errorf("%d. expected %s, got %s", i, scenario.err, err) - } - } else if scenario.err != nil || err != nil { - t.Errorf("%d. expected %s, got %s", i, scenario.err, err) - } - } - - if scenario.output != actual { - t.Errorf("%d. expected %s, got %s", i, scenario.output, actual) - } - } -} - -func TestDiscriminatorHTTPHeader(t *testing.T) { - testDiscriminatorHTTPHeader(t) -} - -func BenchmarkDiscriminatorHTTPHeader(b *testing.B) { - for i := 0; i < b.N; i++ { - testDiscriminatorHTTPHeader(b) - } -} diff --git a/Godeps/_workspace/src/github.com/prometheus/client_golang/extraction/extraction.go b/Godeps/_workspace/src/github.com/prometheus/client_golang/extraction/extraction.go deleted file mode 100644 index 31cdafad4bc9..000000000000 --- a/Godeps/_workspace/src/github.com/prometheus/client_golang/extraction/extraction.go +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2013 The Prometheus 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 extraction decodes Prometheus clients' data streams for consumers. -package extraction diff --git a/Godeps/_workspace/src/github.com/prometheus/client_golang/extraction/fixtures/empty.json b/Godeps/_workspace/src/github.com/prometheus/client_golang/extraction/fixtures/empty.json deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/Godeps/_workspace/src/github.com/prometheus/client_golang/extraction/fixtures/test0_0_1-0_0_2-large.json b/Godeps/_workspace/src/github.com/prometheus/client_golang/extraction/fixtures/test0_0_1-0_0_2-large.json deleted file mode 100644 index 7168338c8b0e..000000000000 --- a/Godeps/_workspace/src/github.com/prometheus/client_golang/extraction/fixtures/test0_0_1-0_0_2-large.json +++ /dev/null @@ -1,1032 +0,0 @@ -[ - { - "baseLabels": { - "__name__": "rpc_calls_total_0", - "job": "batch_job" - }, - "docstring": "Total count of RPC calls.", - "metric": { - "type": "counter", - "value": [ - { - "labels": { - "foo": "bar", - "service": "zed" - }, - "value": 25 - }, - { - "labels": { - "foo": "baz", - "service": "bar" - }, - "value": 25 - }, - { - "labels": { - "foo": "bar", - "service": "foo" - }, - "value": 25 - }, - { - "labels": { - "foo": "baz", - "service": "foo" - }, - "value": 25 - } - ] - } - }, - { - "baseLabels": { - "__name__": "rpc_latency_microseconds_0" - }, - "docstring": "RPC latency summary.", - "metric": { - "type": "histogram", - "value": [ - { - "labels": { - "foo": "bar", - "service": "foo" - }, - "value": { - "0.010000": 15.890724674774395, - "0.050000": 15.890724674774395, - "0.500000": 84.63044031436561, - "0.900000": 160.21100853053224, - "0.990000": 172.49828748957728 - } - }, - { - "labels": { - "foo": "bar", - "service": "zed" - }, - "value": { - "0.010000": 0.0459814091918713, - "0.050000": 0.0459814091918713, - "0.500000": 0.6120456642749681, - "0.900000": 1.355915069887731, - "0.990000": 1.772733213161236 - } - }, - { - "labels": { - "foo": "bar", - "service": "bar" - }, - "value": { - "0.010000": 78.48563317257356, - "0.050000": 78.48563317257356, - "0.500000": 97.31798360385088, - "0.900000": 109.89202084295582, - "0.990000": 109.99626121011262 - } - }, - { - "labels": { - "foo": "baz", - "service": "bar" - }, - "value": { - "0.010000": 78.48563317257356, - "0.050000": 78.48563317257356, - "0.500000": 97.31798360385088, - "0.900000": 109.89202084295582, - "0.990000": 109.99626121011262 - } - } - ] - } - }, - { - "baseLabels": { - "__name__": "rpc_calls_total_1", - "job": "batch_job" - }, - "docstring": "Total count of RPC calls.", - "metric": { - "type": "counter", - "value": [ - { - "labels": { - "foo": "bar", - "service": "zed" - }, - "value": 25 - }, - { - "labels": { - "foo": "baz", - "service": "bar" - }, - "value": 25 - }, - { - "labels": { - "foo": "bar", - "service": "foo" - }, - "value": 25 - }, - { - "labels": { - "foo": "baz", - "service": "foo" - }, - "value": 25 - } - ] - } - }, - { - "baseLabels": { - "__name__": "rpc_latency_microseconds_1" - }, - "docstring": "RPC latency summary.", - "metric": { - "type": "histogram", - "value": [ - { - "labels": { - "foo": "bar", - "service": "foo" - }, - "value": { - "0.010000": 15.890724674774395, - "0.050000": 15.890724674774395, - "0.500000": 84.63044031436561, - "0.900000": 160.21100853053224, - "0.990000": 172.49828748957728 - } - }, - { - "labels": { - "foo": "bar", - "service": "zed" - }, - "value": { - "0.010000": 0.0459814091918713, - "0.050000": 0.0459814091918713, - "0.500000": 0.6120456642749681, - "0.900000": 1.355915069887731, - "0.990000": 1.772733213161236 - } - }, - { - "labels": { - "foo": "bar", - "service": "bar" - }, - "value": { - "0.010000": 78.48563317257356, - "0.050000": 78.48563317257356, - "0.500000": 97.31798360385088, - "0.900000": 109.89202084295582, - "0.990000": 109.99626121011262 - } - }, - { - "labels": { - "foo": "baz", - "service": "bar" - }, - "value": { - "0.010000": 78.48563317257356, - "0.050000": 78.48563317257356, - "0.500000": 97.31798360385088, - "0.900000": 109.89202084295582, - "0.990000": 109.99626121011262 - } - } - ] - } - }, - { - "baseLabels": { - "__name__": "rpc_calls_total_2", - "job": "batch_job" - }, - "docstring": "Total count of RPC calls.", - "metric": { - "type": "counter", - "value": [ - { - "labels": { - "foo": "bar", - "service": "zed" - }, - "value": 25 - }, - { - "labels": { - "foo": "baz", - "service": "bar" - }, - "value": 25 - }, - { - "labels": { - "foo": "bar", - "service": "foo" - }, - "value": 25 - }, - { - "labels": { - "foo": "baz", - "service": "foo" - }, - "value": 25 - } - ] - } - }, - { - "baseLabels": { - "__name__": "rpc_latency_microseconds_2" - }, - "docstring": "RPC latency summary.", - "metric": { - "type": "histogram", - "value": [ - { - "labels": { - "foo": "bar", - "service": "foo" - }, - "value": { - "0.010000": 15.890724674774395, - "0.050000": 15.890724674774395, - "0.500000": 84.63044031436561, - "0.900000": 160.21100853053224, - "0.990000": 172.49828748957728 - } - }, - { - "labels": { - "foo": "bar", - "service": "zed" - }, - "value": { - "0.010000": 0.0459814091918713, - "0.050000": 0.0459814091918713, - "0.500000": 0.6120456642749681, - "0.900000": 1.355915069887731, - "0.990000": 1.772733213161236 - } - }, - { - "labels": { - "foo": "bar", - "service": "bar" - }, - "value": { - "0.010000": 78.48563317257356, - "0.050000": 78.48563317257356, - "0.500000": 97.31798360385088, - "0.900000": 109.89202084295582, - "0.990000": 109.99626121011262 - } - }, - { - "labels": { - "foo": "baz", - "service": "bar" - }, - "value": { - "0.010000": 78.48563317257356, - "0.050000": 78.48563317257356, - "0.500000": 97.31798360385088, - "0.900000": 109.89202084295582, - "0.990000": 109.99626121011262 - } - } - ] - } - }, - { - "baseLabels": { - "__name__": "rpc_calls_total_3", - "job": "batch_job" - }, - "docstring": "Total count of RPC calls.", - "metric": { - "type": "counter", - "value": [ - { - "labels": { - "foo": "bar", - "service": "zed" - }, - "value": 25 - }, - { - "labels": { - "foo": "baz", - "service": "bar" - }, - "value": 25 - }, - { - "labels": { - "foo": "bar", - "service": "foo" - }, - "value": 25 - }, - { - "labels": { - "foo": "baz", - "service": "foo" - }, - "value": 25 - } - ] - } - }, - { - "baseLabels": { - "__name__": "rpc_latency_microseconds_3" - }, - "docstring": "RPC latency summary.", - "metric": { - "type": "histogram", - "value": [ - { - "labels": { - "foo": "bar", - "service": "foo" - }, - "value": { - "0.010000": 15.890724674774395, - "0.050000": 15.890724674774395, - "0.500000": 84.63044031436561, - "0.900000": 160.21100853053224, - "0.990000": 172.49828748957728 - } - }, - { - "labels": { - "foo": "bar", - "service": "zed" - }, - "value": { - "0.010000": 0.0459814091918713, - "0.050000": 0.0459814091918713, - "0.500000": 0.6120456642749681, - "0.900000": 1.355915069887731, - "0.990000": 1.772733213161236 - } - }, - { - "labels": { - "foo": "bar", - "service": "bar" - }, - "value": { - "0.010000": 78.48563317257356, - "0.050000": 78.48563317257356, - "0.500000": 97.31798360385088, - "0.900000": 109.89202084295582, - "0.990000": 109.99626121011262 - } - }, - { - "labels": { - "foo": "baz", - "service": "bar" - }, - "value": { - "0.010000": 78.48563317257356, - "0.050000": 78.48563317257356, - "0.500000": 97.31798360385088, - "0.900000": 109.89202084295582, - "0.990000": 109.99626121011262 - } - } - ] - } - }, - { - "baseLabels": { - "__name__": "rpc_calls_total_4", - "job": "batch_job" - }, - "docstring": "Total count of RPC calls.", - "metric": { - "type": "counter", - "value": [ - { - "labels": { - "foo": "bar", - "service": "zed" - }, - "value": 25 - }, - { - "labels": { - "foo": "baz", - "service": "bar" - }, - "value": 25 - }, - { - "labels": { - "foo": "bar", - "service": "foo" - }, - "value": 25 - }, - { - "labels": { - "foo": "baz", - "service": "foo" - }, - "value": 25 - } - ] - } - }, - { - "baseLabels": { - "__name__": "rpc_latency_microseconds_4" - }, - "docstring": "RPC latency summary.", - "metric": { - "type": "histogram", - "value": [ - { - "labels": { - "foo": "bar", - "service": "foo" - }, - "value": { - "0.010000": 15.890724674774395, - "0.050000": 15.890724674774395, - "0.500000": 84.63044031436561, - "0.900000": 160.21100853053224, - "0.990000": 172.49828748957728 - } - }, - { - "labels": { - "foo": "bar", - "service": "zed" - }, - "value": { - "0.010000": 0.0459814091918713, - "0.050000": 0.0459814091918713, - "0.500000": 0.6120456642749681, - "0.900000": 1.355915069887731, - "0.990000": 1.772733213161236 - } - }, - { - "labels": { - "foo": "bar", - "service": "bar" - }, - "value": { - "0.010000": 78.48563317257356, - "0.050000": 78.48563317257356, - "0.500000": 97.31798360385088, - "0.900000": 109.89202084295582, - "0.990000": 109.99626121011262 - } - }, - { - "labels": { - "foo": "baz", - "service": "bar" - }, - "value": { - "0.010000": 78.48563317257356, - "0.050000": 78.48563317257356, - "0.500000": 97.31798360385088, - "0.900000": 109.89202084295582, - "0.990000": 109.99626121011262 - } - } - ] - } - }, - { - "baseLabels": { - "__name__": "rpc_calls_total_5", - "job": "batch_job" - }, - "docstring": "Total count of RPC calls.", - "metric": { - "type": "counter", - "value": [ - { - "labels": { - "foo": "bar", - "service": "zed" - }, - "value": 25 - }, - { - "labels": { - "foo": "baz", - "service": "bar" - }, - "value": 25 - }, - { - "labels": { - "foo": "bar", - "service": "foo" - }, - "value": 25 - }, - { - "labels": { - "foo": "baz", - "service": "foo" - }, - "value": 25 - } - ] - } - }, - { - "baseLabels": { - "__name__": "rpc_latency_microseconds_5" - }, - "docstring": "RPC latency summary.", - "metric": { - "type": "histogram", - "value": [ - { - "labels": { - "foo": "bar", - "service": "foo" - }, - "value": { - "0.010000": 15.890724674774395, - "0.050000": 15.890724674774395, - "0.500000": 84.63044031436561, - "0.900000": 160.21100853053224, - "0.990000": 172.49828748957728 - } - }, - { - "labels": { - "foo": "bar", - "service": "zed" - }, - "value": { - "0.010000": 0.0459814091918713, - "0.050000": 0.0459814091918713, - "0.500000": 0.6120456642749681, - "0.900000": 1.355915069887731, - "0.990000": 1.772733213161236 - } - }, - { - "labels": { - "foo": "bar", - "service": "bar" - }, - "value": { - "0.010000": 78.48563317257356, - "0.050000": 78.48563317257356, - "0.500000": 97.31798360385088, - "0.900000": 109.89202084295582, - "0.990000": 109.99626121011262 - } - }, - { - "labels": { - "foo": "baz", - "service": "bar" - }, - "value": { - "0.010000": 78.48563317257356, - "0.050000": 78.48563317257356, - "0.500000": 97.31798360385088, - "0.900000": 109.89202084295582, - "0.990000": 109.99626121011262 - } - } - ] - } - }, - { - "baseLabels": { - "__name__": "rpc_calls_total_6", - "job": "batch_job" - }, - "docstring": "Total count of RPC calls.", - "metric": { - "type": "counter", - "value": [ - { - "labels": { - "foo": "bar", - "service": "zed" - }, - "value": 25 - }, - { - "labels": { - "foo": "baz", - "service": "bar" - }, - "value": 25 - }, - { - "labels": { - "foo": "bar", - "service": "foo" - }, - "value": 25 - }, - { - "labels": { - "foo": "baz", - "service": "foo" - }, - "value": 25 - } - ] - } - }, - { - "baseLabels": { - "__name__": "rpc_latency_microseconds_6" - }, - "docstring": "RPC latency summary.", - "metric": { - "type": "histogram", - "value": [ - { - "labels": { - "foo": "bar", - "service": "foo" - }, - "value": { - "0.010000": 15.890724674774395, - "0.050000": 15.890724674774395, - "0.500000": 84.63044031436561, - "0.900000": 160.21100853053224, - "0.990000": 172.49828748957728 - } - }, - { - "labels": { - "foo": "bar", - "service": "zed" - }, - "value": { - "0.010000": 0.0459814091918713, - "0.050000": 0.0459814091918713, - "0.500000": 0.6120456642749681, - "0.900000": 1.355915069887731, - "0.990000": 1.772733213161236 - } - }, - { - "labels": { - "foo": "bar", - "service": "bar" - }, - "value": { - "0.010000": 78.48563317257356, - "0.050000": 78.48563317257356, - "0.500000": 97.31798360385088, - "0.900000": 109.89202084295582, - "0.990000": 109.99626121011262 - } - }, - { - "labels": { - "foo": "baz", - "service": "bar" - }, - "value": { - "0.010000": 78.48563317257356, - "0.050000": 78.48563317257356, - "0.500000": 97.31798360385088, - "0.900000": 109.89202084295582, - "0.990000": 109.99626121011262 - } - } - ] - } - }, - { - "baseLabels": { - "__name__": "rpc_calls_total_7", - "job": "batch_job" - }, - "docstring": "Total count of RPC calls.", - "metric": { - "type": "counter", - "value": [ - { - "labels": { - "foo": "bar", - "service": "zed" - }, - "value": 25 - }, - { - "labels": { - "foo": "baz", - "service": "bar" - }, - "value": 25 - }, - { - "labels": { - "foo": "bar", - "service": "foo" - }, - "value": 25 - }, - { - "labels": { - "foo": "baz", - "service": "foo" - }, - "value": 25 - } - ] - } - }, - { - "baseLabels": { - "__name__": "rpc_latency_microseconds_7" - }, - "docstring": "RPC latency summary.", - "metric": { - "type": "histogram", - "value": [ - { - "labels": { - "foo": "bar", - "service": "foo" - }, - "value": { - "0.010000": 15.890724674774395, - "0.050000": 15.890724674774395, - "0.500000": 84.63044031436561, - "0.900000": 160.21100853053224, - "0.990000": 172.49828748957728 - } - }, - { - "labels": { - "foo": "bar", - "service": "zed" - }, - "value": { - "0.010000": 0.0459814091918713, - "0.050000": 0.0459814091918713, - "0.500000": 0.6120456642749681, - "0.900000": 1.355915069887731, - "0.990000": 1.772733213161236 - } - }, - { - "labels": { - "foo": "bar", - "service": "bar" - }, - "value": { - "0.010000": 78.48563317257356, - "0.050000": 78.48563317257356, - "0.500000": 97.31798360385088, - "0.900000": 109.89202084295582, - "0.990000": 109.99626121011262 - } - }, - { - "labels": { - "foo": "baz", - "service": "bar" - }, - "value": { - "0.010000": 78.48563317257356, - "0.050000": 78.48563317257356, - "0.500000": 97.31798360385088, - "0.900000": 109.89202084295582, - "0.990000": 109.99626121011262 - } - } - ] - } - }, - { - "baseLabels": { - "__name__": "rpc_calls_total_8", - "job": "batch_job" - }, - "docstring": "Total count of RPC calls.", - "metric": { - "type": "counter", - "value": [ - { - "labels": { - "foo": "bar", - "service": "zed" - }, - "value": 25 - }, - { - "labels": { - "foo": "baz", - "service": "bar" - }, - "value": 25 - }, - { - "labels": { - "foo": "bar", - "service": "foo" - }, - "value": 25 - }, - { - "labels": { - "foo": "baz", - "service": "foo" - }, - "value": 25 - } - ] - } - }, - { - "baseLabels": { - "__name__": "rpc_latency_microseconds_8" - }, - "docstring": "RPC latency summary.", - "metric": { - "type": "histogram", - "value": [ - { - "labels": { - "foo": "bar", - "service": "foo" - }, - "value": { - "0.010000": 15.890724674774395, - "0.050000": 15.890724674774395, - "0.500000": 84.63044031436561, - "0.900000": 160.21100853053224, - "0.990000": 172.49828748957728 - } - }, - { - "labels": { - "foo": "bar", - "service": "zed" - }, - "value": { - "0.010000": 0.0459814091918713, - "0.050000": 0.0459814091918713, - "0.500000": 0.6120456642749681, - "0.900000": 1.355915069887731, - "0.990000": 1.772733213161236 - } - }, - { - "labels": { - "foo": "bar", - "service": "bar" - }, - "value": { - "0.010000": 78.48563317257356, - "0.050000": 78.48563317257356, - "0.500000": 97.31798360385088, - "0.900000": 109.89202084295582, - "0.990000": 109.99626121011262 - } - }, - { - "labels": { - "foo": "baz", - "service": "bar" - }, - "value": { - "0.010000": 78.48563317257356, - "0.050000": 78.48563317257356, - "0.500000": 97.31798360385088, - "0.900000": 109.89202084295582, - "0.990000": 109.99626121011262 - } - } - ] - } - }, - { - "baseLabels": { - "__name__": "rpc_calls_total_9", - "job": "batch_job" - }, - "docstring": "Total count of RPC calls.", - "metric": { - "type": "counter", - "value": [ - { - "labels": { - "foo": "bar", - "service": "zed" - }, - "value": 25 - }, - { - "labels": { - "foo": "baz", - "service": "bar" - }, - "value": 25 - }, - { - "labels": { - "foo": "bar", - "service": "foo" - }, - "value": 25 - }, - { - "labels": { - "foo": "baz", - "service": "foo" - }, - "value": 25 - } - ] - } - }, - { - "baseLabels": { - "__name__": "rpc_latency_microseconds_9" - }, - "docstring": "RPC latency summary.", - "metric": { - "type": "histogram", - "value": [ - { - "labels": { - "foo": "bar", - "service": "foo" - }, - "value": { - "0.010000": 15.890724674774395, - "0.050000": 15.890724674774395, - "0.500000": 84.63044031436561, - "0.900000": 160.21100853053224, - "0.990000": 172.49828748957728 - } - }, - { - "labels": { - "foo": "bar", - "service": "zed" - }, - "value": { - "0.010000": 0.0459814091918713, - "0.050000": 0.0459814091918713, - "0.500000": 0.6120456642749681, - "0.900000": 1.355915069887731, - "0.990000": 1.772733213161236 - } - }, - { - "labels": { - "foo": "bar", - "service": "bar" - }, - "value": { - "0.010000": 78.48563317257356, - "0.050000": 78.48563317257356, - "0.500000": 97.31798360385088, - "0.900000": 109.89202084295582, - "0.990000": 109.99626121011262 - } - }, - { - "labels": { - "foo": "baz", - "service": "bar" - }, - "value": { - "0.010000": 78.48563317257356, - "0.050000": 78.48563317257356, - "0.500000": 97.31798360385088, - "0.900000": 109.89202084295582, - "0.990000": 109.99626121011262 - } - } - ] - } - } -] diff --git a/Godeps/_workspace/src/github.com/prometheus/client_golang/extraction/fixtures/test0_0_1-0_0_2.json b/Godeps/_workspace/src/github.com/prometheus/client_golang/extraction/fixtures/test0_0_1-0_0_2.json deleted file mode 100644 index 1ac5be7d7efe..000000000000 --- a/Godeps/_workspace/src/github.com/prometheus/client_golang/extraction/fixtures/test0_0_1-0_0_2.json +++ /dev/null @@ -1,79 +0,0 @@ -[ - { - "baseLabels": { - "__name__": "rpc_calls_total", - "job": "batch_job" - }, - "docstring": "RPC calls.", - "metric": { - "type": "counter", - "value": [ - { - "labels": { - "service": "zed" - }, - "value": 25 - }, - { - "labels": { - "service": "bar" - }, - "value": 25 - }, - { - "labels": { - "service": "foo" - }, - "value": 25 - } - ] - } - }, - { - "baseLabels": { - "__name__": "rpc_latency_microseconds" - }, - "docstring": "RPC latency.", - "metric": { - "type": "histogram", - "value": [ - { - "labels": { - "service": "foo" - }, - "value": { - "0.010000": 15.890724674774395, - "0.050000": 15.890724674774395, - "0.500000": 84.63044031436561, - "0.900000": 160.21100853053224, - "0.990000": 172.49828748957728 - } - }, - { - "labels": { - "service": "zed" - }, - "value": { - "0.010000": 0.0459814091918713, - "0.050000": 0.0459814091918713, - "0.500000": 0.6120456642749681, - "0.900000": 1.355915069887731, - "0.990000": 1.772733213161236 - } - }, - { - "labels": { - "service": "bar" - }, - "value": { - "0.010000": 78.48563317257356, - "0.050000": 78.48563317257356, - "0.500000": 97.31798360385088, - "0.900000": 109.89202084295582, - "0.990000": 109.99626121011262 - } - } - ] - } - } -] diff --git a/Godeps/_workspace/src/github.com/prometheus/client_golang/extraction/metricfamilyprocessor.go b/Godeps/_workspace/src/github.com/prometheus/client_golang/extraction/metricfamilyprocessor.go deleted file mode 100644 index 5a8f40bbf3c7..000000000000 --- a/Godeps/_workspace/src/github.com/prometheus/client_golang/extraction/metricfamilyprocessor.go +++ /dev/null @@ -1,318 +0,0 @@ -// Copyright 2013 The Prometheus 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 extraction - -import ( - "fmt" - "io" - "math" - - dto "github.com/prometheus/client_model/go" - - "github.com/matttproud/golang_protobuf_extensions/pbutil" - - "github.com/prometheus/client_golang/model" -) - -type metricFamilyProcessor struct{} - -// MetricFamilyProcessor decodes varint encoded record length-delimited streams -// of io.prometheus.client.MetricFamily. -// -// See http://godoc.org/github.com/matttproud/golang_protobuf_extensions/ext for -// more details. -var MetricFamilyProcessor = &metricFamilyProcessor{} - -func (m *metricFamilyProcessor) ProcessSingle(i io.Reader, out Ingester, o *ProcessOptions) error { - family := &dto.MetricFamily{} - - for { - family.Reset() - - if _, err := pbutil.ReadDelimited(i, family); err != nil { - if err == io.EOF { - return nil - } - return err - } - if err := extractMetricFamily(out, o, family); err != nil { - return err - } - } -} - -func extractMetricFamily(out Ingester, o *ProcessOptions, family *dto.MetricFamily) error { - switch family.GetType() { - case dto.MetricType_COUNTER: - if err := extractCounter(out, o, family); err != nil { - return err - } - case dto.MetricType_GAUGE: - if err := extractGauge(out, o, family); err != nil { - return err - } - case dto.MetricType_SUMMARY: - if err := extractSummary(out, o, family); err != nil { - return err - } - case dto.MetricType_UNTYPED: - if err := extractUntyped(out, o, family); err != nil { - return err - } - case dto.MetricType_HISTOGRAM: - if err := extractHistogram(out, o, family); err != nil { - return err - } - } - return nil -} - -func extractCounter(out Ingester, o *ProcessOptions, f *dto.MetricFamily) error { - samples := make(model.Samples, 0, len(f.Metric)) - - for _, m := range f.Metric { - if m.Counter == nil { - continue - } - - sample := &model.Sample{ - Metric: model.Metric{}, - Value: model.SampleValue(m.Counter.GetValue()), - } - samples = append(samples, sample) - - if m.TimestampMs != nil { - sample.Timestamp = model.TimestampFromUnixNano(*m.TimestampMs * 1000000) - } else { - sample.Timestamp = o.Timestamp - } - - metric := sample.Metric - for _, p := range m.Label { - metric[model.LabelName(p.GetName())] = model.LabelValue(p.GetValue()) - } - metric[model.MetricNameLabel] = model.LabelValue(f.GetName()) - } - - return out.Ingest(samples) -} - -func extractGauge(out Ingester, o *ProcessOptions, f *dto.MetricFamily) error { - samples := make(model.Samples, 0, len(f.Metric)) - - for _, m := range f.Metric { - if m.Gauge == nil { - continue - } - - sample := &model.Sample{ - Metric: model.Metric{}, - Value: model.SampleValue(m.Gauge.GetValue()), - } - samples = append(samples, sample) - - if m.TimestampMs != nil { - sample.Timestamp = model.TimestampFromUnixNano(*m.TimestampMs * 1000000) - } else { - sample.Timestamp = o.Timestamp - } - - metric := sample.Metric - for _, p := range m.Label { - metric[model.LabelName(p.GetName())] = model.LabelValue(p.GetValue()) - } - metric[model.MetricNameLabel] = model.LabelValue(f.GetName()) - } - - return out.Ingest(samples) -} - -func extractSummary(out Ingester, o *ProcessOptions, f *dto.MetricFamily) error { - samples := make(model.Samples, 0, len(f.Metric)) - - for _, m := range f.Metric { - if m.Summary == nil { - continue - } - - timestamp := o.Timestamp - if m.TimestampMs != nil { - timestamp = model.TimestampFromUnixNano(*m.TimestampMs * 1000000) - } - - for _, q := range m.Summary.Quantile { - sample := &model.Sample{ - Metric: model.Metric{}, - Value: model.SampleValue(q.GetValue()), - Timestamp: timestamp, - } - samples = append(samples, sample) - - metric := sample.Metric - for _, p := range m.Label { - metric[model.LabelName(p.GetName())] = model.LabelValue(p.GetValue()) - } - // BUG(matt): Update other names to "quantile". - metric[model.LabelName(model.QuantileLabel)] = model.LabelValue(fmt.Sprint(q.GetQuantile())) - metric[model.MetricNameLabel] = model.LabelValue(f.GetName()) - } - - if m.Summary.SampleSum != nil { - sum := &model.Sample{ - Metric: model.Metric{}, - Value: model.SampleValue(m.Summary.GetSampleSum()), - Timestamp: timestamp, - } - samples = append(samples, sum) - - metric := sum.Metric - for _, p := range m.Label { - metric[model.LabelName(p.GetName())] = model.LabelValue(p.GetValue()) - } - metric[model.MetricNameLabel] = model.LabelValue(f.GetName() + "_sum") - } - - if m.Summary.SampleCount != nil { - count := &model.Sample{ - Metric: model.Metric{}, - Value: model.SampleValue(m.Summary.GetSampleCount()), - Timestamp: timestamp, - } - samples = append(samples, count) - - metric := count.Metric - for _, p := range m.Label { - metric[model.LabelName(p.GetName())] = model.LabelValue(p.GetValue()) - } - metric[model.MetricNameLabel] = model.LabelValue(f.GetName() + "_count") - } - } - - return out.Ingest(samples) -} - -func extractUntyped(out Ingester, o *ProcessOptions, f *dto.MetricFamily) error { - samples := make(model.Samples, 0, len(f.Metric)) - - for _, m := range f.Metric { - if m.Untyped == nil { - continue - } - - sample := &model.Sample{ - Metric: model.Metric{}, - Value: model.SampleValue(m.Untyped.GetValue()), - } - samples = append(samples, sample) - - if m.TimestampMs != nil { - sample.Timestamp = model.TimestampFromUnixNano(*m.TimestampMs * 1000000) - } else { - sample.Timestamp = o.Timestamp - } - - metric := sample.Metric - for _, p := range m.Label { - metric[model.LabelName(p.GetName())] = model.LabelValue(p.GetValue()) - } - metric[model.MetricNameLabel] = model.LabelValue(f.GetName()) - } - - return out.Ingest(samples) -} - -func extractHistogram(out Ingester, o *ProcessOptions, f *dto.MetricFamily) error { - samples := make(model.Samples, 0, len(f.Metric)) - - for _, m := range f.Metric { - if m.Histogram == nil { - continue - } - - timestamp := o.Timestamp - if m.TimestampMs != nil { - timestamp = model.TimestampFromUnixNano(*m.TimestampMs * 1000000) - } - - infSeen := false - - for _, q := range m.Histogram.Bucket { - sample := &model.Sample{ - Metric: model.Metric{}, - Value: model.SampleValue(q.GetCumulativeCount()), - Timestamp: timestamp, - } - samples = append(samples, sample) - - metric := sample.Metric - for _, p := range m.Label { - metric[model.LabelName(p.GetName())] = model.LabelValue(p.GetValue()) - } - metric[model.LabelName(model.BucketLabel)] = model.LabelValue(fmt.Sprint(q.GetUpperBound())) - metric[model.MetricNameLabel] = model.LabelValue(f.GetName() + "_bucket") - - if math.IsInf(q.GetUpperBound(), +1) { - infSeen = true - } - } - - if m.Histogram.SampleSum != nil { - sum := &model.Sample{ - Metric: model.Metric{}, - Value: model.SampleValue(m.Histogram.GetSampleSum()), - Timestamp: timestamp, - } - samples = append(samples, sum) - - metric := sum.Metric - for _, p := range m.Label { - metric[model.LabelName(p.GetName())] = model.LabelValue(p.GetValue()) - } - metric[model.MetricNameLabel] = model.LabelValue(f.GetName() + "_sum") - } - - if m.Histogram.SampleCount != nil { - count := &model.Sample{ - Metric: model.Metric{}, - Value: model.SampleValue(m.Histogram.GetSampleCount()), - Timestamp: timestamp, - } - samples = append(samples, count) - - metric := count.Metric - for _, p := range m.Label { - metric[model.LabelName(p.GetName())] = model.LabelValue(p.GetValue()) - } - metric[model.MetricNameLabel] = model.LabelValue(f.GetName() + "_count") - - if !infSeen { - infBucket := &model.Sample{ - Metric: model.Metric{}, - Value: count.Value, - Timestamp: timestamp, - } - samples = append(samples, infBucket) - - metric := infBucket.Metric - for _, p := range m.Label { - metric[model.LabelName(p.GetName())] = model.LabelValue(p.GetValue()) - } - metric[model.LabelName(model.BucketLabel)] = model.LabelValue("+Inf") - metric[model.MetricNameLabel] = model.LabelValue(f.GetName() + "_bucket") - } - } - } - - return out.Ingest(samples) -} diff --git a/Godeps/_workspace/src/github.com/prometheus/client_golang/extraction/metricfamilyprocessor_test.go b/Godeps/_workspace/src/github.com/prometheus/client_golang/extraction/metricfamilyprocessor_test.go deleted file mode 100644 index 9ba0fdbce38f..000000000000 --- a/Godeps/_workspace/src/github.com/prometheus/client_golang/extraction/metricfamilyprocessor_test.go +++ /dev/null @@ -1,153 +0,0 @@ -// Copyright 2013 The Prometheus 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 extraction - -import ( - "sort" - "strings" - "testing" - - "github.com/prometheus/client_golang/model" -) - -var testTime = model.Now() - -type metricFamilyProcessorScenario struct { - in string - expected, actual []model.Samples -} - -func (s *metricFamilyProcessorScenario) Ingest(samples model.Samples) error { - s.actual = append(s.actual, samples) - return nil -} - -func (s *metricFamilyProcessorScenario) test(t *testing.T, set int) { - i := strings.NewReader(s.in) - - o := &ProcessOptions{ - Timestamp: testTime, - } - - err := MetricFamilyProcessor.ProcessSingle(i, s, o) - if err != nil { - t.Fatalf("%d. got error: %s", set, err) - } - - if len(s.expected) != len(s.actual) { - t.Fatalf("%d. expected length %d, got %d", set, len(s.expected), len(s.actual)) - } - - for i, expected := range s.expected { - sort.Sort(s.actual[i]) - sort.Sort(expected) - - if !expected.Equal(s.actual[i]) { - t.Errorf("%d.%d. expected %s, got %s", set, i, expected, s.actual[i]) - } - } -} - -func TestMetricFamilyProcessor(t *testing.T) { - scenarios := []metricFamilyProcessorScenario{ - { - in: "", - }, - { - in: "\x8f\x01\n\rrequest_count\x12\x12Number of requests\x18\x00\"0\n#\n\x0fsome_label_name\x12\x10some_label_value\x1a\t\t\x00\x00\x00\x00\x00\x00E\xc0\"6\n)\n\x12another_label_name\x12\x13another_label_value\x1a\t\t\x00\x00\x00\x00\x00\x00U@", - expected: []model.Samples{ - model.Samples{ - &model.Sample{ - Metric: model.Metric{model.MetricNameLabel: "request_count", "some_label_name": "some_label_value"}, - Value: -42, - Timestamp: testTime, - }, - &model.Sample{ - Metric: model.Metric{model.MetricNameLabel: "request_count", "another_label_name": "another_label_value"}, - Value: 84, - Timestamp: testTime, - }, - }, - }, - }, - { - in: "\xb9\x01\n\rrequest_count\x12\x12Number of requests\x18\x02\"O\n#\n\x0fsome_label_name\x12\x10some_label_value\"(\x1a\x12\t\xaeG\xe1z\x14\xae\xef?\x11\x00\x00\x00\x00\x00\x00E\xc0\x1a\x12\t+\x87\x16\xd9\xce\xf7\xef?\x11\x00\x00\x00\x00\x00\x00U\xc0\"A\n)\n\x12another_label_name\x12\x13another_label_value\"\x14\x1a\x12\t\x00\x00\x00\x00\x00\x00\xe0?\x11\x00\x00\x00\x00\x00\x00$@", - expected: []model.Samples{ - model.Samples{ - &model.Sample{ - Metric: model.Metric{model.MetricNameLabel: "request_count", "some_label_name": "some_label_value", "quantile": "0.99"}, - Value: -42, - Timestamp: testTime, - }, - &model.Sample{ - Metric: model.Metric{model.MetricNameLabel: "request_count", "some_label_name": "some_label_value", "quantile": "0.999"}, - Value: -84, - Timestamp: testTime, - }, - &model.Sample{ - Metric: model.Metric{model.MetricNameLabel: "request_count", "another_label_name": "another_label_value", "quantile": "0.5"}, - Value: 10, - Timestamp: testTime, - }, - }, - }, - }, - { - in: "\x8d\x01\n\x1drequest_duration_microseconds\x12\x15The response latency.\x18\x04\"S:Q\b\x85\x15\x11\xcd\xcc\xccL\x8f\xcb:A\x1a\v\b{\x11\x00\x00\x00\x00\x00\x00Y@\x1a\f\b\x9c\x03\x11\x00\x00\x00\x00\x00\x00^@\x1a\f\b\xd0\x04\x11\x00\x00\x00\x00\x00\x00b@\x1a\f\b\xf4\v\x11\x9a\x99\x99\x99\x99\x99e@\x1a\f\b\x85\x15\x11\x00\x00\x00\x00\x00\x00\xf0\u007f", - expected: []model.Samples{ - model.Samples{ - &model.Sample{ - Metric: model.Metric{model.MetricNameLabel: "request_duration_microseconds_bucket", "le": "100"}, - Value: 123, - Timestamp: testTime, - }, - &model.Sample{ - Metric: model.Metric{model.MetricNameLabel: "request_duration_microseconds_bucket", "le": "120"}, - Value: 412, - Timestamp: testTime, - }, - &model.Sample{ - Metric: model.Metric{model.MetricNameLabel: "request_duration_microseconds_bucket", "le": "144"}, - Value: 592, - Timestamp: testTime, - }, - &model.Sample{ - Metric: model.Metric{model.MetricNameLabel: "request_duration_microseconds_bucket", "le": "172.8"}, - Value: 1524, - Timestamp: testTime, - }, - &model.Sample{ - Metric: model.Metric{model.MetricNameLabel: "request_duration_microseconds_bucket", "le": "+Inf"}, - Value: 2693, - Timestamp: testTime, - }, - &model.Sample{ - Metric: model.Metric{model.MetricNameLabel: "request_duration_microseconds_sum"}, - Value: 1756047.3, - Timestamp: testTime, - }, - &model.Sample{ - Metric: model.Metric{model.MetricNameLabel: "request_duration_microseconds_count"}, - Value: 2693, - Timestamp: testTime, - }, - }, - }, - }, - } - - for i, scenario := range scenarios { - scenario.test(t, i) - } -} diff --git a/Godeps/_workspace/src/github.com/prometheus/client_golang/extraction/processor.go b/Godeps/_workspace/src/github.com/prometheus/client_golang/extraction/processor.go deleted file mode 100644 index 50c93c9e689a..000000000000 --- a/Godeps/_workspace/src/github.com/prometheus/client_golang/extraction/processor.go +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright 2013 The Prometheus 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 extraction - -import ( - "io" - "time" - - "github.com/prometheus/client_golang/model" -) - -// ProcessOptions dictates how the interpreted stream should be rendered for -// consumption. -type ProcessOptions struct { - // Timestamp is added to each value from the stream that has no explicit - // timestamp set. - Timestamp model.Timestamp -} - -// Ingester consumes result streams in whatever way is desired by the user. -type Ingester interface { - Ingest(model.Samples) error -} - -// Processor is responsible for decoding the actual message responses from -// stream into a format that can be consumed with the end result written -// to the results channel. -type Processor interface { - // ProcessSingle treats the input as a single self-contained message body and - // transforms it accordingly. It has no support for streaming. - ProcessSingle(in io.Reader, out Ingester, o *ProcessOptions) error -} - -// Helper function to convert map[string]string into LabelSet. -// -// NOTE: This should be deleted when support for go 1.0.3 is removed; 1.1 is -// smart enough to unmarshal JSON objects into LabelSet directly. -func labelSet(labels map[string]string) model.LabelSet { - labelset := make(model.LabelSet, len(labels)) - - for k, v := range labels { - labelset[model.LabelName(k)] = model.LabelValue(v) - } - - return labelset -} - -// A basic interface only useful in testing contexts for dispensing the time -// in a controlled manner. -type instantProvider interface { - // The current instant. - Now() time.Time -} - -// Clock is a simple means for fluently wrapping around standard Go timekeeping -// mechanisms to enhance testability without compromising code readability. -// -// It is sufficient for use on bare initialization. A provider should be -// set only for test contexts. When not provided, it emits the current -// system time. -type clock struct { - // The underlying means through which time is provided, if supplied. - Provider instantProvider -} - -// Emit the current instant. -func (t *clock) Now() time.Time { - if t.Provider == nil { - return time.Now() - } - - return t.Provider.Now() -} diff --git a/Godeps/_workspace/src/github.com/prometheus/client_golang/extraction/processor0_0_1.go b/Godeps/_workspace/src/github.com/prometheus/client_golang/extraction/processor0_0_1.go deleted file mode 100644 index 7a728efb0e20..000000000000 --- a/Godeps/_workspace/src/github.com/prometheus/client_golang/extraction/processor0_0_1.go +++ /dev/null @@ -1,127 +0,0 @@ -// Copyright 2013 The Prometheus 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 extraction - -import ( - "encoding/json" - "fmt" - "io" - "io/ioutil" - - "github.com/prometheus/client_golang/model" -) - -const ( - baseLabels001 = "baseLabels" - counter001 = "counter" - docstring001 = "docstring" - gauge001 = "gauge" - histogram001 = "histogram" - labels001 = "labels" - metric001 = "metric" - type001 = "type" - value001 = "value" - percentile001 = "percentile" -) - -// Processor001 is responsible for decoding payloads from protocol version -// 0.0.1. -var Processor001 = &processor001{} - -// processor001 is responsible for handling API version 0.0.1. -type processor001 struct{} - -// entity001 represents a the JSON structure that 0.0.1 uses. -type entity001 []struct { - BaseLabels map[string]string `json:"baseLabels"` - Docstring string `json:"docstring"` - Metric struct { - MetricType string `json:"type"` - Value []struct { - Labels map[string]string `json:"labels"` - Value interface{} `json:"value"` - } `json:"value"` - } `json:"metric"` -} - -func (p *processor001) ProcessSingle(in io.Reader, out Ingester, o *ProcessOptions) error { - // TODO(matt): Replace with plain-jane JSON unmarshalling. - buffer, err := ioutil.ReadAll(in) - if err != nil { - return err - } - - entities := entity001{} - if err = json.Unmarshal(buffer, &entities); err != nil { - return err - } - - // TODO(matt): This outer loop is a great basis for parallelization. - pendingSamples := model.Samples{} - for _, entity := range entities { - for _, value := range entity.Metric.Value { - labels := labelSet(entity.BaseLabels).Merge(labelSet(value.Labels)) - - switch entity.Metric.MetricType { - case gauge001, counter001: - sampleValue, ok := value.Value.(float64) - if !ok { - return fmt.Errorf("could not convert value from %s %s to float64", entity, value) - } - - pendingSamples = append(pendingSamples, &model.Sample{ - Metric: model.Metric(labels), - Timestamp: o.Timestamp, - Value: model.SampleValue(sampleValue), - }) - - break - - case histogram001: - sampleValue, ok := value.Value.(map[string]interface{}) - if !ok { - return fmt.Errorf("could not convert value from %q to a map[string]interface{}", value.Value) - } - - for percentile, percentileValue := range sampleValue { - individualValue, ok := percentileValue.(float64) - if !ok { - return fmt.Errorf("could not convert value from %q to a float64", percentileValue) - } - - childMetric := make(map[model.LabelName]model.LabelValue, len(labels)+1) - - for k, v := range labels { - childMetric[k] = v - } - - childMetric[model.LabelName(percentile001)] = model.LabelValue(percentile) - - pendingSamples = append(pendingSamples, &model.Sample{ - Metric: model.Metric(childMetric), - Timestamp: o.Timestamp, - Value: model.SampleValue(individualValue), - }) - } - - break - } - } - } - if len(pendingSamples) > 0 { - return out.Ingest(pendingSamples) - } - - return nil -} diff --git a/Godeps/_workspace/src/github.com/prometheus/client_golang/extraction/processor0_0_1_test.go b/Godeps/_workspace/src/github.com/prometheus/client_golang/extraction/processor0_0_1_test.go deleted file mode 100644 index b970b03e97f2..000000000000 --- a/Godeps/_workspace/src/github.com/prometheus/client_golang/extraction/processor0_0_1_test.go +++ /dev/null @@ -1,185 +0,0 @@ -// Copyright 2013 The Prometheus 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 extraction - -import ( - "errors" - "os" - "path" - "sort" - "testing" - - "github.com/prometheus/client_golang/model" -) - -var test001Time = model.Now() - -type testProcessor001ProcessScenario struct { - in string - expected, actual []model.Samples - err error -} - -func (s *testProcessor001ProcessScenario) Ingest(samples model.Samples) error { - s.actual = append(s.actual, samples) - return nil -} - -func (s *testProcessor001ProcessScenario) test(t testing.TB, set int) { - reader, err := os.Open(path.Join("fixtures", s.in)) - if err != nil { - t.Fatalf("%d. couldn't open scenario input file %s: %s", set, s.in, err) - } - - options := &ProcessOptions{ - Timestamp: test001Time, - } - err = Processor001.ProcessSingle(reader, s, options) - if s.err != err && (s.err == nil || err == nil || err.Error() != s.err.Error()) { - t.Fatalf("%d. expected err of %s, got %s", set, s.err, err) - } - - if len(s.actual) != len(s.expected) { - t.Fatalf("%d. expected output length of %d, got %d", set, len(s.expected), len(s.actual)) - } - - for i, expected := range s.expected { - sort.Sort(s.actual[i]) - sort.Sort(expected) - - if !expected.Equal(s.actual[i]) { - t.Errorf("%d.%d. expected %s, got %s", set, i, expected, s.actual[i]) - } - } -} - -func testProcessor001Process(t testing.TB) { - var scenarios = []testProcessor001ProcessScenario{ - { - in: "empty.json", - err: errors.New("unexpected end of JSON input"), - }, - { - in: "test0_0_1-0_0_2.json", - expected: []model.Samples{ - model.Samples{ - &model.Sample{ - Metric: model.Metric{"service": "zed", model.MetricNameLabel: "rpc_calls_total", "job": "batch_job"}, - Value: 25, - Timestamp: test001Time, - }, - &model.Sample{ - Metric: model.Metric{"service": "bar", model.MetricNameLabel: "rpc_calls_total", "job": "batch_job"}, - Value: 25, - Timestamp: test001Time, - }, - &model.Sample{ - Metric: model.Metric{"service": "foo", model.MetricNameLabel: "rpc_calls_total", "job": "batch_job"}, - Value: 25, - Timestamp: test001Time, - }, - &model.Sample{ - Metric: model.Metric{"percentile": "0.010000", model.MetricNameLabel: "rpc_latency_microseconds", "service": "zed"}, - Value: 0.0459814091918713, - Timestamp: test001Time, - }, - &model.Sample{ - Metric: model.Metric{"percentile": "0.010000", model.MetricNameLabel: "rpc_latency_microseconds", "service": "bar"}, - Value: 78.48563317257356, - Timestamp: test001Time, - }, - &model.Sample{ - Metric: model.Metric{"percentile": "0.010000", model.MetricNameLabel: "rpc_latency_microseconds", "service": "foo"}, - Value: 15.890724674774395, - Timestamp: test001Time, - }, - &model.Sample{ - Metric: model.Metric{"percentile": "0.050000", model.MetricNameLabel: "rpc_latency_microseconds", "service": "zed"}, - Value: 0.0459814091918713, - Timestamp: test001Time, - }, - &model.Sample{ - Metric: model.Metric{"percentile": "0.050000", model.MetricNameLabel: "rpc_latency_microseconds", "service": "bar"}, - Value: 78.48563317257356, - Timestamp: test001Time, - }, - &model.Sample{ - Metric: model.Metric{"percentile": "0.050000", model.MetricNameLabel: "rpc_latency_microseconds", "service": "foo"}, - Value: 15.890724674774395, - Timestamp: test001Time, - }, - &model.Sample{ - Metric: model.Metric{"percentile": "0.500000", model.MetricNameLabel: "rpc_latency_microseconds", "service": "zed"}, - Value: 0.6120456642749681, - Timestamp: test001Time, - }, - &model.Sample{ - Metric: model.Metric{"percentile": "0.500000", model.MetricNameLabel: "rpc_latency_microseconds", "service": "bar"}, - Value: 97.31798360385088, - Timestamp: test001Time, - }, - &model.Sample{ - Metric: model.Metric{"percentile": "0.500000", model.MetricNameLabel: "rpc_latency_microseconds", "service": "foo"}, - Value: 84.63044031436561, - Timestamp: test001Time, - }, - &model.Sample{ - Metric: model.Metric{"percentile": "0.900000", model.MetricNameLabel: "rpc_latency_microseconds", "service": "zed"}, - Value: 1.355915069887731, - Timestamp: test001Time, - }, - &model.Sample{ - Metric: model.Metric{"percentile": "0.900000", model.MetricNameLabel: "rpc_latency_microseconds", "service": "bar"}, - Value: 109.89202084295582, - Timestamp: test001Time, - }, - &model.Sample{ - Metric: model.Metric{"percentile": "0.900000", model.MetricNameLabel: "rpc_latency_microseconds", "service": "foo"}, - Value: 160.21100853053224, - Timestamp: test001Time, - }, - &model.Sample{ - Metric: model.Metric{"percentile": "0.990000", model.MetricNameLabel: "rpc_latency_microseconds", "service": "zed"}, - Value: 1.772733213161236, - Timestamp: test001Time, - }, - &model.Sample{ - Metric: model.Metric{"percentile": "0.990000", model.MetricNameLabel: "rpc_latency_microseconds", "service": "bar"}, - Value: 109.99626121011262, - Timestamp: test001Time, - }, - &model.Sample{ - Metric: model.Metric{"percentile": "0.990000", model.MetricNameLabel: "rpc_latency_microseconds", "service": "foo"}, - Value: 172.49828748957728, - Timestamp: test001Time, - }, - }, - }, - }, - } - - for i, scenario := range scenarios { - scenario.test(t, i) - } -} - -func TestProcessor001Process(t *testing.T) { - testProcessor001Process(t) -} - -func BenchmarkProcessor001Process(b *testing.B) { - for i := 0; i < b.N; i++ { - testProcessor001Process(b) - } -} diff --git a/Godeps/_workspace/src/github.com/prometheus/client_golang/extraction/processor0_0_2.go b/Godeps/_workspace/src/github.com/prometheus/client_golang/extraction/processor0_0_2.go deleted file mode 100644 index 24c7e81554c6..000000000000 --- a/Godeps/_workspace/src/github.com/prometheus/client_golang/extraction/processor0_0_2.go +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright 2013 The Prometheus 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 extraction - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/prometheus/client_golang/model" -) - -// Processor002 is responsible for decoding payloads from protocol version -// 0.0.2. -var Processor002 = &processor002{} - -type histogram002 struct { - Labels map[string]string `json:"labels"` - Values map[string]model.SampleValue `json:"value"` -} - -type counter002 struct { - Labels map[string]string `json:"labels"` - Value model.SampleValue `json:"value"` -} - -type processor002 struct{} - -func (p *processor002) ProcessSingle(in io.Reader, out Ingester, o *ProcessOptions) error { - // Processor for telemetry schema version 0.0.2. - // container for telemetry data - var entities []struct { - BaseLabels map[string]string `json:"baseLabels"` - Docstring string `json:"docstring"` - Metric struct { - Type string `json:"type"` - Values json.RawMessage `json:"value"` - } `json:"metric"` - } - - if err := json.NewDecoder(in).Decode(&entities); err != nil { - return err - } - - pendingSamples := model.Samples{} - for _, entity := range entities { - switch entity.Metric.Type { - case "counter", "gauge": - var values []counter002 - - if err := json.Unmarshal(entity.Metric.Values, &values); err != nil { - return fmt.Errorf("could not extract %s value: %s", entity.Metric.Type, err) - } - - for _, counter := range values { - labels := labelSet(entity.BaseLabels).Merge(labelSet(counter.Labels)) - - pendingSamples = append(pendingSamples, &model.Sample{ - Metric: model.Metric(labels), - Timestamp: o.Timestamp, - Value: counter.Value, - }) - } - - case "histogram": - var values []histogram002 - - if err := json.Unmarshal(entity.Metric.Values, &values); err != nil { - return fmt.Errorf("could not extract %s value: %s", entity.Metric.Type, err) - } - - for _, histogram := range values { - for percentile, value := range histogram.Values { - labels := labelSet(entity.BaseLabels).Merge(labelSet(histogram.Labels)) - labels[model.LabelName("percentile")] = model.LabelValue(percentile) - - pendingSamples = append(pendingSamples, &model.Sample{ - Metric: model.Metric(labels), - Timestamp: o.Timestamp, - Value: value, - }) - } - } - - default: - return fmt.Errorf("unknown metric type %q", entity.Metric.Type) - } - } - - if len(pendingSamples) > 0 { - return out.Ingest(pendingSamples) - } - - return nil -} diff --git a/Godeps/_workspace/src/github.com/prometheus/client_golang/extraction/processor0_0_2_test.go b/Godeps/_workspace/src/github.com/prometheus/client_golang/extraction/processor0_0_2_test.go deleted file mode 100644 index b2b758702083..000000000000 --- a/Godeps/_workspace/src/github.com/prometheus/client_golang/extraction/processor0_0_2_test.go +++ /dev/null @@ -1,225 +0,0 @@ -// Copyright 2013 The Prometheus 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 extraction - -import ( - "bytes" - "errors" - "io/ioutil" - "os" - "path" - "runtime" - "sort" - "testing" - - "github.com/prometheus/client_golang/model" -) - -var test002Time = model.Now() - -type testProcessor002ProcessScenario struct { - in string - expected, actual []model.Samples - err error -} - -func (s *testProcessor002ProcessScenario) Ingest(samples model.Samples) error { - s.actual = append(s.actual, samples) - return nil -} - -func (s *testProcessor002ProcessScenario) test(t testing.TB, set int) { - reader, err := os.Open(path.Join("fixtures", s.in)) - if err != nil { - t.Fatalf("%d. couldn't open scenario input file %s: %s", set, s.in, err) - } - - options := &ProcessOptions{ - Timestamp: test002Time, - } - err = Processor002.ProcessSingle(reader, s, options) - if s.err != err && (s.err == nil || err == nil || err.Error() != s.err.Error()) { - t.Fatalf("%d. expected err of %s, got %s", set, s.err, err) - } - - if len(s.actual) != len(s.expected) { - t.Fatalf("%d. expected output length of %d, got %d", set, len(s.expected), len(s.actual)) - } - - for i, expected := range s.expected { - sort.Sort(s.actual[i]) - sort.Sort(expected) - - if !expected.Equal(s.actual[i]) { - t.Fatalf("%d.%d. expected %s, got %s", set, i, expected, s.actual[i]) - } - } -} - -func testProcessor002Process(t testing.TB) { - var scenarios = []testProcessor002ProcessScenario{ - { - in: "empty.json", - err: errors.New("EOF"), - }, - { - in: "test0_0_1-0_0_2.json", - expected: []model.Samples{ - model.Samples{ - &model.Sample{ - Metric: model.Metric{"service": "zed", model.MetricNameLabel: "rpc_calls_total", "job": "batch_job"}, - Value: 25, - Timestamp: test002Time, - }, - &model.Sample{ - Metric: model.Metric{"service": "bar", model.MetricNameLabel: "rpc_calls_total", "job": "batch_job"}, - Value: 25, - Timestamp: test002Time, - }, - &model.Sample{ - Metric: model.Metric{"service": "foo", model.MetricNameLabel: "rpc_calls_total", "job": "batch_job"}, - Value: 25, - Timestamp: test002Time, - }, - &model.Sample{ - Metric: model.Metric{"percentile": "0.010000", model.MetricNameLabel: "rpc_latency_microseconds", "service": "zed"}, - Value: 0.0459814091918713, - Timestamp: test002Time, - }, - &model.Sample{ - Metric: model.Metric{"percentile": "0.010000", model.MetricNameLabel: "rpc_latency_microseconds", "service": "bar"}, - Value: 78.48563317257356, - Timestamp: test002Time, - }, - &model.Sample{ - Metric: model.Metric{"percentile": "0.010000", model.MetricNameLabel: "rpc_latency_microseconds", "service": "foo"}, - Value: 15.890724674774395, - Timestamp: test002Time, - }, - &model.Sample{ - - Metric: model.Metric{"percentile": "0.050000", model.MetricNameLabel: "rpc_latency_microseconds", "service": "zed"}, - Value: 0.0459814091918713, - Timestamp: test002Time, - }, - &model.Sample{ - Metric: model.Metric{"percentile": "0.050000", model.MetricNameLabel: "rpc_latency_microseconds", "service": "bar"}, - Value: 78.48563317257356, - Timestamp: test002Time, - }, - &model.Sample{ - Metric: model.Metric{"percentile": "0.050000", model.MetricNameLabel: "rpc_latency_microseconds", "service": "foo"}, - Value: 15.890724674774395, - Timestamp: test002Time, - }, - &model.Sample{ - Metric: model.Metric{"percentile": "0.500000", model.MetricNameLabel: "rpc_latency_microseconds", "service": "zed"}, - Value: 0.6120456642749681, - Timestamp: test002Time, - }, - &model.Sample{ - Metric: model.Metric{"percentile": "0.500000", model.MetricNameLabel: "rpc_latency_microseconds", "service": "bar"}, - Value: 97.31798360385088, - Timestamp: test002Time, - }, - &model.Sample{ - Metric: model.Metric{"percentile": "0.500000", model.MetricNameLabel: "rpc_latency_microseconds", "service": "foo"}, - Value: 84.63044031436561, - Timestamp: test002Time, - }, - &model.Sample{ - Metric: model.Metric{"percentile": "0.900000", model.MetricNameLabel: "rpc_latency_microseconds", "service": "zed"}, - Value: 1.355915069887731, - Timestamp: test002Time, - }, - &model.Sample{ - Metric: model.Metric{"percentile": "0.900000", model.MetricNameLabel: "rpc_latency_microseconds", "service": "bar"}, - Value: 109.89202084295582, - Timestamp: test002Time, - }, - &model.Sample{ - Metric: model.Metric{"percentile": "0.900000", model.MetricNameLabel: "rpc_latency_microseconds", "service": "foo"}, - Value: 160.21100853053224, - Timestamp: test002Time, - }, - &model.Sample{ - Metric: model.Metric{"percentile": "0.990000", model.MetricNameLabel: "rpc_latency_microseconds", "service": "zed"}, - Value: 1.772733213161236, - Timestamp: test002Time, - }, - &model.Sample{ - Metric: model.Metric{"percentile": "0.990000", model.MetricNameLabel: "rpc_latency_microseconds", "service": "bar"}, - Value: 109.99626121011262, - Timestamp: test002Time, - }, - &model.Sample{ - Metric: model.Metric{"percentile": "0.990000", model.MetricNameLabel: "rpc_latency_microseconds", "service": "foo"}, - Value: 172.49828748957728, - Timestamp: test002Time, - }, - }, - }, - }, - } - - for i, scenario := range scenarios { - scenario.test(t, i) - } -} - -func TestProcessor002Process(t *testing.T) { - testProcessor002Process(t) -} - -func BenchmarkProcessor002Process(b *testing.B) { - b.StopTimer() - - pre := runtime.MemStats{} - runtime.ReadMemStats(&pre) - - b.StartTimer() - - for i := 0; i < b.N; i++ { - testProcessor002Process(b) - } - - post := runtime.MemStats{} - runtime.ReadMemStats(&post) - - allocated := post.TotalAlloc - pre.TotalAlloc - - b.Logf("Allocated %d at %f per cycle with %d cycles.", allocated, float64(allocated)/float64(b.N), b.N) -} - -func BenchmarkProcessor002ParseOnly(b *testing.B) { - b.StopTimer() - data, err := ioutil.ReadFile("fixtures/test0_0_1-0_0_2-large.json") - if err != nil { - b.Fatal(err) - } - ing := fakeIngester{} - b.StartTimer() - - for i := 0; i < b.N; i++ { - if err := Processor002.ProcessSingle(bytes.NewReader(data), ing, &ProcessOptions{}); err != nil { - b.Fatal(err) - } - } -} - -type fakeIngester struct{} - -func (i fakeIngester) Ingest(model.Samples) error { - return nil -} diff --git a/Godeps/_workspace/src/github.com/prometheus/client_golang/extraction/textprocessor.go b/Godeps/_workspace/src/github.com/prometheus/client_golang/extraction/textprocessor.go deleted file mode 100644 index 2eca1c63a60b..000000000000 --- a/Godeps/_workspace/src/github.com/prometheus/client_golang/extraction/textprocessor.go +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright 2014 The Prometheus 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 extraction - -import ( - "io" - - "github.com/prometheus/client_golang/text" -) - -type processor004 struct{} - -// Processor004 s responsible for decoding payloads from the text based variety -// of protocol version 0.0.4. -var Processor004 = &processor004{} - -func (t *processor004) ProcessSingle(i io.Reader, out Ingester, o *ProcessOptions) error { - var parser text.Parser - metricFamilies, err := parser.TextToMetricFamilies(i) - if err != nil { - return err - } - for _, metricFamily := range metricFamilies { - if err := extractMetricFamily(out, o, metricFamily); err != nil { - return err - } - } - return nil -} diff --git a/Godeps/_workspace/src/github.com/prometheus/client_golang/extraction/textprocessor_test.go b/Godeps/_workspace/src/github.com/prometheus/client_golang/extraction/textprocessor_test.go deleted file mode 100644 index ff704a9bc3a8..000000000000 --- a/Godeps/_workspace/src/github.com/prometheus/client_golang/extraction/textprocessor_test.go +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright 2014 The Prometheus 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 extraction - -import ( - "sort" - "strings" - "testing" - - "github.com/prometheus/client_golang/model" -) - -var ( - ts = model.Now() - in = ` -# Only a quite simple scenario with two metric families. -# More complicated tests of the parser itself can be found in the text package. -# TYPE mf2 counter -mf2 3 -mf1{label="value1"} -3.14 123456 -mf1{label="value2"} 42 -mf2 4 -` - out = map[model.LabelValue]model.Samples{ - "mf1": model.Samples{ - &model.Sample{ - Metric: model.Metric{model.MetricNameLabel: "mf1", "label": "value1"}, - Value: -3.14, - Timestamp: 123456, - }, - &model.Sample{ - Metric: model.Metric{model.MetricNameLabel: "mf1", "label": "value2"}, - Value: 42, - Timestamp: ts, - }, - }, - "mf2": model.Samples{ - &model.Sample{ - Metric: model.Metric{model.MetricNameLabel: "mf2"}, - Value: 3, - Timestamp: ts, - }, - &model.Sample{ - Metric: model.Metric{model.MetricNameLabel: "mf2"}, - Value: 4, - Timestamp: ts, - }, - }, - } -) - -type testIngester struct { - results []model.Samples -} - -func (i *testIngester) Ingest(s model.Samples) error { - i.results = append(i.results, s) - return nil -} - -func TestTextProcessor(t *testing.T) { - var ingester testIngester - i := strings.NewReader(in) - o := &ProcessOptions{ - Timestamp: ts, - } - - err := Processor004.ProcessSingle(i, &ingester, o) - if err != nil { - t.Fatal(err) - } - if expected, got := len(out), len(ingester.results); expected != got { - t.Fatalf("Expected length %d, got %d", expected, got) - } - for _, r := range ingester.results { - expected, ok := out[r[0].Metric[model.MetricNameLabel]] - if !ok { - t.Fatalf( - "Unexpected metric name %q", - r[0].Metric[model.MetricNameLabel], - ) - } - sort.Sort(expected) - sort.Sort(r) - if !expected.Equal(r) { - t.Errorf("expected %s, got %s", expected, r) - } - } -} diff --git a/Godeps/_workspace/src/github.com/prometheus/client_golang/model/labelname.go b/Godeps/_workspace/src/github.com/prometheus/client_golang/model/labelname.go deleted file mode 100644 index 75b2e79dae0d..000000000000 --- a/Godeps/_workspace/src/github.com/prometheus/client_golang/model/labelname.go +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright 2013 The Prometheus 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 model - -import ( - "strings" -) - -const ( - // ExporterLabelPrefix is the label name prefix to prepend if a - // synthetic label is already present in the exported metrics. - ExporterLabelPrefix LabelName = "exporter_" - - // MetricNameLabel is the label name indicating the metric name of a - // timeseries. - MetricNameLabel LabelName = "__name__" - - // ReservedLabelPrefix is a prefix which is not legal in user-supplied - // label names. - ReservedLabelPrefix = "__" - - // JobLabel is the label name indicating the job from which a timeseries - // was scraped. - JobLabel LabelName = "job" - - // BucketLabel is used for the label that defines the upper bound of a - // bucket of a histogram ("le" -> "less or equal"). - BucketLabel = "le" - - // QuantileLabel is used for the label that defines the quantile in a - // summary. - QuantileLabel = "quantile" -) - -// A LabelName is a key for a LabelSet or Metric. It has a value associated -// therewith. -type LabelName string - -// LabelNames is a sortable LabelName slice. In implements sort.Interface. -type LabelNames []LabelName - -func (l LabelNames) Len() int { - return len(l) -} - -func (l LabelNames) Less(i, j int) bool { - return l[i] < l[j] -} - -func (l LabelNames) Swap(i, j int) { - l[i], l[j] = l[j], l[i] -} - -func (l LabelNames) String() string { - labelStrings := make([]string, 0, len(l)) - for _, label := range l { - labelStrings = append(labelStrings, string(label)) - } - return strings.Join(labelStrings, ", ") -} diff --git a/Godeps/_workspace/src/github.com/prometheus/client_golang/model/labelname_test.go b/Godeps/_workspace/src/github.com/prometheus/client_golang/model/labelname_test.go deleted file mode 100644 index 693228d347c9..000000000000 --- a/Godeps/_workspace/src/github.com/prometheus/client_golang/model/labelname_test.go +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2013 The Prometheus 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 model - -import ( - "sort" - "testing" -) - -func testLabelNames(t testing.TB) { - var scenarios = []struct { - in LabelNames - out LabelNames - }{ - { - in: LabelNames{"ZZZ", "zzz"}, - out: LabelNames{"ZZZ", "zzz"}, - }, - { - in: LabelNames{"aaa", "AAA"}, - out: LabelNames{"AAA", "aaa"}, - }, - } - - for i, scenario := range scenarios { - sort.Sort(scenario.in) - - for j, expected := range scenario.out { - if expected != scenario.in[j] { - t.Errorf("%d.%d expected %s, got %s", i, j, expected, scenario.in[j]) - } - } - } -} - -func TestLabelNames(t *testing.T) { - testLabelNames(t) -} - -func BenchmarkLabelNames(b *testing.B) { - for i := 0; i < b.N; i++ { - testLabelNames(b) - } -} diff --git a/Godeps/_workspace/src/github.com/prometheus/client_golang/model/labelset.go b/Godeps/_workspace/src/github.com/prometheus/client_golang/model/labelset.go deleted file mode 100644 index b1b54fba35f3..000000000000 --- a/Godeps/_workspace/src/github.com/prometheus/client_golang/model/labelset.go +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2013 The Prometheus 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 model - -import ( - "fmt" - "sort" - "strings" -) - -// A LabelSet is a collection of LabelName and LabelValue pairs. The LabelSet -// may be fully-qualified down to the point where it may resolve to a single -// Metric in the data store or not. All operations that occur within the realm -// of a LabelSet can emit a vector of Metric entities to which the LabelSet may -// match. -type LabelSet map[LabelName]LabelValue - -// Merge is a helper function to non-destructively merge two label sets. -func (l LabelSet) Merge(other LabelSet) LabelSet { - result := make(LabelSet, len(l)) - - for k, v := range l { - result[k] = v - } - - for k, v := range other { - result[k] = v - } - - return result -} - -func (l LabelSet) String() string { - labelStrings := make([]string, 0, len(l)) - for label, value := range l { - labelStrings = append(labelStrings, fmt.Sprintf("%s=%q", label, value)) - } - - switch len(labelStrings) { - case 0: - return "" - default: - sort.Strings(labelStrings) - return fmt.Sprintf("{%s}", strings.Join(labelStrings, ", ")) - } -} - -// MergeFromMetric merges Metric into this LabelSet. -func (l LabelSet) MergeFromMetric(m Metric) { - for k, v := range m { - l[k] = v - } -} diff --git a/Godeps/_workspace/src/github.com/prometheus/client_golang/model/labelvalue.go b/Godeps/_workspace/src/github.com/prometheus/client_golang/model/labelvalue.go deleted file mode 100644 index df2d14cc122c..000000000000 --- a/Godeps/_workspace/src/github.com/prometheus/client_golang/model/labelvalue.go +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright 2013 The Prometheus 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 model - -import ( - "sort" -) - -// A LabelValue is an associated value for a LabelName. -type LabelValue string - -// LabelValues is a sortable LabelValue slice. It implements sort.Interface. -type LabelValues []LabelValue - -func (l LabelValues) Len() int { - return len(l) -} - -func (l LabelValues) Less(i, j int) bool { - return sort.StringsAreSorted([]string{string(l[i]), string(l[j])}) -} - -func (l LabelValues) Swap(i, j int) { - l[i], l[j] = l[j], l[i] -} diff --git a/Godeps/_workspace/src/github.com/prometheus/client_golang/model/labelvalue_test.go b/Godeps/_workspace/src/github.com/prometheus/client_golang/model/labelvalue_test.go deleted file mode 100644 index 15904edf4f1c..000000000000 --- a/Godeps/_workspace/src/github.com/prometheus/client_golang/model/labelvalue_test.go +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2013 The Prometheus 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 model - -import ( - "sort" - "testing" -) - -func testLabelValues(t testing.TB) { - var scenarios = []struct { - in LabelValues - out LabelValues - }{ - { - in: LabelValues{"ZZZ", "zzz"}, - out: LabelValues{"ZZZ", "zzz"}, - }, - { - in: LabelValues{"aaa", "AAA"}, - out: LabelValues{"AAA", "aaa"}, - }, - } - - for i, scenario := range scenarios { - sort.Sort(scenario.in) - - for j, expected := range scenario.out { - if expected != scenario.in[j] { - t.Errorf("%d.%d expected %s, got %s", i, j, expected, scenario.in[j]) - } - } - } -} - -func TestLabelValues(t *testing.T) { - testLabelValues(t) -} - -func BenchmarkLabelValues(b *testing.B) { - for i := 0; i < b.N; i++ { - testLabelValues(b) - } -} diff --git a/Godeps/_workspace/src/github.com/prometheus/client_golang/model/metric.go b/Godeps/_workspace/src/github.com/prometheus/client_golang/model/metric.go deleted file mode 100644 index 32f9d7fbca74..000000000000 --- a/Godeps/_workspace/src/github.com/prometheus/client_golang/model/metric.go +++ /dev/null @@ -1,132 +0,0 @@ -// Copyright 2013 The Prometheus 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 model - -import ( - "encoding/json" - "fmt" - "sort" - "strings" -) - -var separator = []byte{0} - -// A Metric is similar to a LabelSet, but the key difference is that a Metric is -// a singleton and refers to one and only one stream of samples. -type Metric map[LabelName]LabelValue - -// Equal compares the fingerprints of both metrics. -func (m Metric) Equal(o Metric) bool { - return m.Fingerprint().Equal(o.Fingerprint()) -} - -// Before compares the fingerprints of both metrics. -func (m Metric) Before(o Metric) bool { - return m.Fingerprint().Less(o.Fingerprint()) -} - -// String implements Stringer. -func (m Metric) String() string { - metricName, hasName := m[MetricNameLabel] - numLabels := len(m) - 1 - if !hasName { - numLabels = len(m) - } - labelStrings := make([]string, 0, numLabels) - for label, value := range m { - if label != MetricNameLabel { - labelStrings = append(labelStrings, fmt.Sprintf("%s=%q", label, value)) - } - } - - switch numLabels { - case 0: - if hasName { - return string(metricName) - } - return "{}" - default: - sort.Strings(labelStrings) - return fmt.Sprintf("%s{%s}", metricName, strings.Join(labelStrings, ", ")) - } -} - -// Fingerprint returns a Metric's Fingerprint. -func (m Metric) Fingerprint() Fingerprint { - return metricToFingerprint(m) -} - -// Clone returns a copy of the Metric. -func (m Metric) Clone() Metric { - clone := Metric{} - for k, v := range m { - clone[k] = v - } - return clone -} - -// MergeFromLabelSet merges a label set into this Metric, prefixing a collision -// prefix to the label names merged from the label set where required. -func (m Metric) MergeFromLabelSet(labels LabelSet, collisionPrefix LabelName) { - for k, v := range labels { - if collisionPrefix != "" { - for { - if _, exists := m[k]; !exists { - break - } - k = collisionPrefix + k - } - } - - m[k] = v - } -} - -// COWMetric wraps a Metric to enable copy-on-write access patterns. -type COWMetric struct { - Copied bool - Metric Metric -} - -// Set sets a label name in the wrapped Metric to a given value and copies the -// Metric initially, if it is not already a copy. -func (m *COWMetric) Set(ln LabelName, lv LabelValue) { - m.doCOW() - m.Metric[ln] = lv -} - -// Delete deletes a given label name from the wrapped Metric and copies the -// Metric initially, if it is not already a copy. -func (m *COWMetric) Delete(ln LabelName) { - m.doCOW() - delete(m.Metric, ln) -} - -// doCOW copies the underlying Metric if it is not already a copy. -func (m *COWMetric) doCOW() { - if !m.Copied { - m.Metric = m.Metric.Clone() - m.Copied = true - } -} - -// String implements fmt.Stringer. -func (m COWMetric) String() string { - return m.Metric.String() -} - -// MarshalJSON implements json.Marshaler. -func (m COWMetric) MarshalJSON() ([]byte, error) { - return json.Marshal(m.Metric) -} diff --git a/Godeps/_workspace/src/github.com/prometheus/client_golang/model/metric_test.go b/Godeps/_workspace/src/github.com/prometheus/client_golang/model/metric_test.go deleted file mode 100644 index d51b1842f6ab..000000000000 --- a/Godeps/_workspace/src/github.com/prometheus/client_golang/model/metric_test.go +++ /dev/null @@ -1,121 +0,0 @@ -// Copyright 2013 The Prometheus 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 model - -import "testing" - -func testMetric(t testing.TB) { - var scenarios = []struct { - input Metric - fingerprint Fingerprint - }{ - { - input: Metric{}, - fingerprint: 14695981039346656037, - }, - { - input: Metric{ - "first_name": "electro", - "occupation": "robot", - "manufacturer": "westinghouse", - }, - fingerprint: 11310079640881077873, - }, - { - input: Metric{ - "x": "y", - }, - fingerprint: 13948396922932177635, - }, - { - input: Metric{ - "a": "bb", - "b": "c", - }, - fingerprint: 3198632812309449502, - }, - { - input: Metric{ - "a": "b", - "bb": "c", - }, - fingerprint: 5774953389407657638, - }, - } - - for i, scenario := range scenarios { - if scenario.fingerprint != scenario.input.Fingerprint() { - t.Errorf("%d. expected %d, got %d", i, scenario.fingerprint, scenario.input.Fingerprint()) - } - } -} - -func TestMetric(t *testing.T) { - testMetric(t) -} - -func BenchmarkMetric(b *testing.B) { - for i := 0; i < b.N; i++ { - testMetric(b) - } -} - -func TestCOWMetric(t *testing.T) { - testMetric := Metric{ - "to_delete": "test1", - "to_change": "test2", - } - - scenarios := []struct { - fn func(*COWMetric) - out Metric - }{ - { - fn: func(cm *COWMetric) { - cm.Delete("to_delete") - }, - out: Metric{ - "to_change": "test2", - }, - }, - { - fn: func(cm *COWMetric) { - cm.Set("to_change", "changed") - }, - out: Metric{ - "to_delete": "test1", - "to_change": "changed", - }, - }, - } - - for i, s := range scenarios { - orig := testMetric.Clone() - cm := &COWMetric{ - Metric: orig, - } - - s.fn(cm) - - // Test that the original metric was not modified. - if !orig.Equal(testMetric) { - t.Fatalf("%d. original metric changed; expected %v, got %v", i, testMetric, orig) - } - - // Test that the new metric has the right changes. - if !cm.Metric.Equal(s.out) { - t.Fatalf("%d. copied metric doesn't contain expected changes; expected %v, got %v", i, s.out, cm.Metric) - } - } -} diff --git a/Godeps/_workspace/src/github.com/prometheus/client_golang/model/sample.go b/Godeps/_workspace/src/github.com/prometheus/client_golang/model/sample.go deleted file mode 100644 index c13a44d95c9c..000000000000 --- a/Godeps/_workspace/src/github.com/prometheus/client_golang/model/sample.go +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright 2013 The Prometheus 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 model - -// Sample is a sample value with a timestamp and a metric. -type Sample struct { - Metric Metric - Value SampleValue - Timestamp Timestamp -} - -// Equal compares first the metrics, then the timestamp, then the value. -func (s *Sample) Equal(o *Sample) bool { - if s == o { - return true - } - - if !s.Metric.Equal(o.Metric) { - return false - } - if !s.Timestamp.Equal(o.Timestamp) { - return false - } - if !s.Value.Equal(o.Value) { - return false - } - - return true -} - -// Samples is a sortable Sample slice. It implements sort.Interface. -type Samples []*Sample - -func (s Samples) Len() int { - return len(s) -} - -// Less compares first the metrics, then the timestamp. -func (s Samples) Less(i, j int) bool { - switch { - case s[i].Metric.Before(s[j].Metric): - return true - case s[j].Metric.Before(s[i].Metric): - return false - case s[i].Timestamp.Before(s[j].Timestamp): - return true - default: - return false - } -} - -func (s Samples) Swap(i, j int) { - s[i], s[j] = s[j], s[i] -} - -// Equal compares two sets of samples and returns true if they are equal. -func (s Samples) Equal(o Samples) bool { - if len(s) != len(o) { - return false - } - - for i, sample := range s { - if !sample.Equal(o[i]) { - return false - } - } - return true -} diff --git a/Godeps/_workspace/src/github.com/prometheus/client_golang/model/sample_test.go b/Godeps/_workspace/src/github.com/prometheus/client_golang/model/sample_test.go deleted file mode 100644 index 3dc4ad2511a4..000000000000 --- a/Godeps/_workspace/src/github.com/prometheus/client_golang/model/sample_test.go +++ /dev/null @@ -1,126 +0,0 @@ -// Copyright 2013 The Prometheus 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 model - -import ( - "sort" - "testing" -) - -func TestSamplesSort(t *testing.T) { - input := Samples{ - &Sample{ - // Fingerprint: 81f9c9ed24563f8f. - Metric: Metric{ - MetricNameLabel: "A", - }, - Timestamp: 1, - }, - &Sample{ - // Fingerprint: 81f9c9ed24563f8f. - Metric: Metric{ - MetricNameLabel: "A", - }, - Timestamp: 2, - }, - &Sample{ - // Fingerprint: 1bf6c9ed24543f8f. - Metric: Metric{ - MetricNameLabel: "C", - }, - Timestamp: 1, - }, - &Sample{ - // Fingerprint: 1bf6c9ed24543f8f. - Metric: Metric{ - MetricNameLabel: "C", - }, - Timestamp: 2, - }, - &Sample{ - // Fingerprint: 68f4c9ed24533f8f. - Metric: Metric{ - MetricNameLabel: "B", - }, - Timestamp: 1, - }, - &Sample{ - // Fingerprint: 68f4c9ed24533f8f. - Metric: Metric{ - MetricNameLabel: "B", - }, - Timestamp: 2, - }, - } - - expected := Samples{ - &Sample{ - // Fingerprint: 1bf6c9ed24543f8f. - Metric: Metric{ - MetricNameLabel: "C", - }, - Timestamp: 1, - }, - &Sample{ - // Fingerprint: 1bf6c9ed24543f8f. - Metric: Metric{ - MetricNameLabel: "C", - }, - Timestamp: 2, - }, - &Sample{ - // Fingerprint: 68f4c9ed24533f8f. - Metric: Metric{ - MetricNameLabel: "B", - }, - Timestamp: 1, - }, - &Sample{ - // Fingerprint: 68f4c9ed24533f8f. - Metric: Metric{ - MetricNameLabel: "B", - }, - Timestamp: 2, - }, - &Sample{ - // Fingerprint: 81f9c9ed24563f8f. - Metric: Metric{ - MetricNameLabel: "A", - }, - Timestamp: 1, - }, - &Sample{ - // Fingerprint: 81f9c9ed24563f8f. - Metric: Metric{ - MetricNameLabel: "A", - }, - Timestamp: 2, - }, - } - - sort.Sort(input) - - for i, actual := range input { - actualFp := actual.Metric.Fingerprint() - expectedFp := expected[i].Metric.Fingerprint() - - if !actualFp.Equal(expectedFp) { - t.Fatalf("%d. Incorrect fingerprint. Got %s; want %s", i, actualFp.String(), expectedFp.String()) - } - - if actual.Timestamp != expected[i].Timestamp { - t.Fatalf("%d. Incorrect timestamp. Got %s; want %s", i, actual.Timestamp, expected[i].Timestamp) - } - } -} diff --git a/Godeps/_workspace/src/github.com/prometheus/client_golang/model/samplevalue.go b/Godeps/_workspace/src/github.com/prometheus/client_golang/model/samplevalue.go deleted file mode 100644 index 469c2c0b0e5f..000000000000 --- a/Godeps/_workspace/src/github.com/prometheus/client_golang/model/samplevalue.go +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright 2013 The Prometheus 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 model - -import ( - "fmt" - "strconv" -) - -// A SampleValue is a representation of a value for a given sample at a given -// time. -type SampleValue float64 - -// Equal does a straight v==o. -func (v SampleValue) Equal(o SampleValue) bool { - return v == o -} - -// MarshalJSON implements json.Marshaler. -func (v SampleValue) MarshalJSON() ([]byte, error) { - return []byte(fmt.Sprintf(`"%s"`, v)), nil -} - -func (v SampleValue) String() string { - return strconv.FormatFloat(float64(v), 'f', -1, 64) -} diff --git a/Godeps/_workspace/src/github.com/prometheus/client_golang/model/signature.go b/Godeps/_workspace/src/github.com/prometheus/client_golang/model/signature.go deleted file mode 100644 index cc77b192dd1c..000000000000 --- a/Godeps/_workspace/src/github.com/prometheus/client_golang/model/signature.go +++ /dev/null @@ -1,150 +0,0 @@ -// Copyright 2014 The Prometheus 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 model - -import ( - "bytes" - "hash" - "hash/fnv" - "sync" -) - -// SeparatorByte is a byte that cannot occur in valid UTF-8 sequences and is -// used to separate label names, label values, and other strings from each other -// when calculating their combined hash value (aka signature aka fingerprint). -const SeparatorByte byte = 255 - -var ( - // cache the signature of an empty label set. - emptyLabelSignature = fnv.New64a().Sum64() - - hashAndBufPool sync.Pool -) - -type hashAndBuf struct { - h hash.Hash64 - b bytes.Buffer -} - -func getHashAndBuf() *hashAndBuf { - hb := hashAndBufPool.Get() - if hb == nil { - return &hashAndBuf{h: fnv.New64a()} - } - return hb.(*hashAndBuf) -} - -func putHashAndBuf(hb *hashAndBuf) { - hashAndBufPool.Put(hb) -} - -// LabelsToSignature returns a unique signature (i.e., fingerprint) for a given -// label set. -func LabelsToSignature(labels map[string]string) uint64 { - if len(labels) == 0 { - return emptyLabelSignature - } - - var result uint64 - hb := getHashAndBuf() - defer putHashAndBuf(hb) - - for labelName, labelValue := range labels { - hb.b.WriteString(labelName) - hb.b.WriteByte(SeparatorByte) - hb.b.WriteString(labelValue) - hb.h.Write(hb.b.Bytes()) - result ^= hb.h.Sum64() - hb.h.Reset() - hb.b.Reset() - } - return result -} - -// metricToFingerprint works exactly as LabelsToSignature but takes a Metric as -// parameter (rather than a label map) and returns a Fingerprint. -func metricToFingerprint(m Metric) Fingerprint { - if len(m) == 0 { - return Fingerprint(emptyLabelSignature) - } - - var result uint64 - hb := getHashAndBuf() - defer putHashAndBuf(hb) - - for labelName, labelValue := range m { - hb.b.WriteString(string(labelName)) - hb.b.WriteByte(SeparatorByte) - hb.b.WriteString(string(labelValue)) - hb.h.Write(hb.b.Bytes()) - result ^= hb.h.Sum64() - hb.h.Reset() - hb.b.Reset() - } - return Fingerprint(result) -} - -// SignatureForLabels works like LabelsToSignature but takes a Metric as -// parameter (rather than a label map) and only includes the labels with the -// specified LabelNames into the signature calculation. -func SignatureForLabels(m Metric, labels LabelNames) uint64 { - if len(m) == 0 || len(labels) == 0 { - return emptyLabelSignature - } - - var result uint64 - hb := getHashAndBuf() - defer putHashAndBuf(hb) - - for _, label := range labels { - hb.b.WriteString(string(label)) - hb.b.WriteByte(SeparatorByte) - hb.b.WriteString(string(m[label])) - hb.h.Write(hb.b.Bytes()) - result ^= hb.h.Sum64() - hb.h.Reset() - hb.b.Reset() - } - return result -} - -// SignatureWithoutLabels works like LabelsToSignature but takes a Metric as -// parameter (rather than a label map) and excludes the labels with any of the -// specified LabelNames from the signature calculation. -func SignatureWithoutLabels(m Metric, labels map[LabelName]struct{}) uint64 { - if len(m) == 0 { - return emptyLabelSignature - } - - var result uint64 - hb := getHashAndBuf() - defer putHashAndBuf(hb) - - for labelName, labelValue := range m { - if _, exclude := labels[labelName]; exclude { - continue - } - hb.b.WriteString(string(labelName)) - hb.b.WriteByte(SeparatorByte) - hb.b.WriteString(string(labelValue)) - hb.h.Write(hb.b.Bytes()) - result ^= hb.h.Sum64() - hb.h.Reset() - hb.b.Reset() - } - if result == 0 { - return emptyLabelSignature - } - return result -} diff --git a/Godeps/_workspace/src/github.com/prometheus/client_golang/model/signature_test.go b/Godeps/_workspace/src/github.com/prometheus/client_golang/model/signature_test.go deleted file mode 100644 index 7b3327d44069..000000000000 --- a/Godeps/_workspace/src/github.com/prometheus/client_golang/model/signature_test.go +++ /dev/null @@ -1,256 +0,0 @@ -// Copyright 2014 The Prometheus 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 model - -import ( - "runtime" - "sync" - "testing" -) - -func TestLabelsToSignature(t *testing.T) { - var scenarios = []struct { - in map[string]string - out uint64 - }{ - { - in: map[string]string{}, - out: 14695981039346656037, - }, - { - in: map[string]string{"name": "garland, briggs", "fear": "love is not enough"}, - out: 12952432476264840823, - }, - } - - for i, scenario := range scenarios { - actual := LabelsToSignature(scenario.in) - - if actual != scenario.out { - t.Errorf("%d. expected %d, got %d", i, scenario.out, actual) - } - } -} - -func TestMetricToFingerprint(t *testing.T) { - var scenarios = []struct { - in Metric - out Fingerprint - }{ - { - in: Metric{}, - out: 14695981039346656037, - }, - { - in: Metric{"name": "garland, briggs", "fear": "love is not enough"}, - out: 12952432476264840823, - }, - } - - for i, scenario := range scenarios { - actual := metricToFingerprint(scenario.in) - - if actual != scenario.out { - t.Errorf("%d. expected %d, got %d", i, scenario.out, actual) - } - } -} - -func TestSignatureForLabels(t *testing.T) { - var scenarios = []struct { - in Metric - labels LabelNames - out uint64 - }{ - { - in: Metric{}, - labels: nil, - out: 14695981039346656037, - }, - { - in: Metric{"name": "garland, briggs", "fear": "love is not enough"}, - labels: LabelNames{"fear", "name"}, - out: 12952432476264840823, - }, - { - in: Metric{"name": "garland, briggs", "fear": "love is not enough", "foo": "bar"}, - labels: LabelNames{"fear", "name"}, - out: 12952432476264840823, - }, - { - in: Metric{"name": "garland, briggs", "fear": "love is not enough"}, - labels: LabelNames{}, - out: 14695981039346656037, - }, - { - in: Metric{"name": "garland, briggs", "fear": "love is not enough"}, - labels: nil, - out: 14695981039346656037, - }, - } - - for i, scenario := range scenarios { - actual := SignatureForLabels(scenario.in, scenario.labels) - - if actual != scenario.out { - t.Errorf("%d. expected %d, got %d", i, scenario.out, actual) - } - } -} - -func TestSignatureWithoutLabels(t *testing.T) { - var scenarios = []struct { - in Metric - labels map[LabelName]struct{} - out uint64 - }{ - { - in: Metric{}, - labels: nil, - out: 14695981039346656037, - }, - { - in: Metric{"name": "garland, briggs", "fear": "love is not enough"}, - labels: map[LabelName]struct{}{"fear": struct{}{}, "name": struct{}{}}, - out: 14695981039346656037, - }, - { - in: Metric{"name": "garland, briggs", "fear": "love is not enough", "foo": "bar"}, - labels: map[LabelName]struct{}{"foo": struct{}{}}, - out: 12952432476264840823, - }, - { - in: Metric{"name": "garland, briggs", "fear": "love is not enough"}, - labels: map[LabelName]struct{}{}, - out: 12952432476264840823, - }, - { - in: Metric{"name": "garland, briggs", "fear": "love is not enough"}, - labels: nil, - out: 12952432476264840823, - }, - } - - for i, scenario := range scenarios { - actual := SignatureWithoutLabels(scenario.in, scenario.labels) - - if actual != scenario.out { - t.Errorf("%d. expected %d, got %d", i, scenario.out, actual) - } - } -} - -func benchmarkLabelToSignature(b *testing.B, l map[string]string, e uint64) { - for i := 0; i < b.N; i++ { - if a := LabelsToSignature(l); a != e { - b.Fatalf("expected signature of %d for %s, got %d", e, l, a) - } - } -} - -func BenchmarkLabelToSignatureScalar(b *testing.B) { - benchmarkLabelToSignature(b, nil, 14695981039346656037) -} - -func BenchmarkLabelToSignatureSingle(b *testing.B) { - benchmarkLabelToSignature(b, map[string]string{"first-label": "first-label-value"}, 5147259542624943964) -} - -func BenchmarkLabelToSignatureDouble(b *testing.B) { - benchmarkLabelToSignature(b, map[string]string{"first-label": "first-label-value", "second-label": "second-label-value"}, 18269973311206963528) -} - -func BenchmarkLabelToSignatureTriple(b *testing.B) { - benchmarkLabelToSignature(b, map[string]string{"first-label": "first-label-value", "second-label": "second-label-value", "third-label": "third-label-value"}, 15738406913934009676) -} - -func benchmarkMetricToFingerprint(b *testing.B, m Metric, e Fingerprint) { - for i := 0; i < b.N; i++ { - if a := metricToFingerprint(m); a != e { - b.Fatalf("expected signature of %d for %s, got %d", e, m, a) - } - } -} - -func BenchmarkMetricToFingerprintScalar(b *testing.B) { - benchmarkMetricToFingerprint(b, nil, 14695981039346656037) -} - -func BenchmarkMetricToFingerprintSingle(b *testing.B) { - benchmarkMetricToFingerprint(b, Metric{"first-label": "first-label-value"}, 5147259542624943964) -} - -func BenchmarkMetricToFingerprintDouble(b *testing.B) { - benchmarkMetricToFingerprint(b, Metric{"first-label": "first-label-value", "second-label": "second-label-value"}, 18269973311206963528) -} - -func BenchmarkMetricToFingerprintTriple(b *testing.B) { - benchmarkMetricToFingerprint(b, Metric{"first-label": "first-label-value", "second-label": "second-label-value", "third-label": "third-label-value"}, 15738406913934009676) -} - -func TestEmptyLabelSignature(t *testing.T) { - input := []map[string]string{nil, {}} - - var ms runtime.MemStats - runtime.ReadMemStats(&ms) - - alloc := ms.Alloc - - for _, labels := range input { - LabelsToSignature(labels) - } - - runtime.ReadMemStats(&ms) - - if got := ms.Alloc; alloc != got { - t.Fatal("expected LabelsToSignature with empty labels not to perform allocations") - } -} - -func benchmarkMetricToFingerprintConc(b *testing.B, m Metric, e Fingerprint, concLevel int) { - var start, end sync.WaitGroup - start.Add(1) - end.Add(concLevel) - - for i := 0; i < concLevel; i++ { - go func() { - start.Wait() - for j := b.N / concLevel; j >= 0; j-- { - if a := metricToFingerprint(m); a != e { - b.Fatalf("expected signature of %d for %s, got %d", e, m, a) - } - } - end.Done() - }() - } - b.ResetTimer() - start.Done() - end.Wait() -} - -func BenchmarkMetricToFingerprintTripleConc1(b *testing.B) { - benchmarkMetricToFingerprintConc(b, Metric{"first-label": "first-label-value", "second-label": "second-label-value", "third-label": "third-label-value"}, 15738406913934009676, 1) -} - -func BenchmarkMetricToFingerprintTripleConc2(b *testing.B) { - benchmarkMetricToFingerprintConc(b, Metric{"first-label": "first-label-value", "second-label": "second-label-value", "third-label": "third-label-value"}, 15738406913934009676, 2) -} - -func BenchmarkMetricToFingerprintTripleConc4(b *testing.B) { - benchmarkMetricToFingerprintConc(b, Metric{"first-label": "first-label-value", "second-label": "second-label-value", "third-label": "third-label-value"}, 15738406913934009676, 4) -} - -func BenchmarkMetricToFingerprintTripleConc8(b *testing.B) { - benchmarkMetricToFingerprintConc(b, Metric{"first-label": "first-label-value", "second-label": "second-label-value", "third-label": "third-label-value"}, 15738406913934009676, 8) -} diff --git a/Godeps/_workspace/src/github.com/prometheus/client_golang/model/timestamp.go b/Godeps/_workspace/src/github.com/prometheus/client_golang/model/timestamp.go deleted file mode 100644 index afffdcf753e5..000000000000 --- a/Godeps/_workspace/src/github.com/prometheus/client_golang/model/timestamp.go +++ /dev/null @@ -1,116 +0,0 @@ -// Copyright 2013 The Prometheus 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 model - -import ( - "math" - "strconv" - - native_time "time" -) - -// Timestamp is the number of milliseconds since the epoch -// (1970-01-01 00:00 UTC) excluding leap seconds. -type Timestamp int64 - -const ( - // MinimumTick is the minimum supported time resolution. This has to be - // at least native_time.Second in order for the code below to work. - MinimumTick = native_time.Millisecond - // second is the timestamp duration equivalent to one second. - second = int64(native_time.Second / MinimumTick) - // The number of nanoseconds per minimum tick. - nanosPerTick = int64(MinimumTick / native_time.Nanosecond) - - // Earliest is the earliest timestamp representable. Handy for - // initializing a high watermark. - Earliest = Timestamp(math.MinInt64) - // Latest is the latest timestamp representable. Handy for initializing - // a low watermark. - Latest = Timestamp(math.MaxInt64) -) - -// Equal reports whether two timestamps represent the same instant. -func (t Timestamp) Equal(o Timestamp) bool { - return t == o -} - -// Before reports whether the timestamp t is before o. -func (t Timestamp) Before(o Timestamp) bool { - return t < o -} - -// After reports whether the timestamp t is after o. -func (t Timestamp) After(o Timestamp) bool { - return t > o -} - -// Add returns the Timestamp t + d. -func (t Timestamp) Add(d native_time.Duration) Timestamp { - return t + Timestamp(d/MinimumTick) -} - -// Sub returns the Duration t - o. -func (t Timestamp) Sub(o Timestamp) native_time.Duration { - return native_time.Duration(t-o) * MinimumTick -} - -// Time returns the time.Time representation of t. -func (t Timestamp) Time() native_time.Time { - return native_time.Unix(int64(t)/second, (int64(t)%second)*nanosPerTick) -} - -// Unix returns t as a Unix time, the number of seconds elapsed -// since January 1, 1970 UTC. -func (t Timestamp) Unix() int64 { - return int64(t) / second -} - -// UnixNano returns t as a Unix time, the number of nanoseconds elapsed -// since January 1, 1970 UTC. -func (t Timestamp) UnixNano() int64 { - return int64(t) * nanosPerTick -} - -// String returns a string representation of the timestamp. -func (t Timestamp) String() string { - return strconv.FormatFloat(float64(t)/float64(second), 'f', -1, 64) -} - -// MarshalJSON implements the json.Marshaler interface. -func (t Timestamp) MarshalJSON() ([]byte, error) { - return []byte(t.String()), nil -} - -// Now returns the current time as a Timestamp. -func Now() Timestamp { - return TimestampFromTime(native_time.Now()) -} - -// TimestampFromTime returns the Timestamp equivalent to the time.Time t. -func TimestampFromTime(t native_time.Time) Timestamp { - return TimestampFromUnixNano(t.UnixNano()) -} - -// TimestampFromUnix returns the Timestamp equivalent to the Unix timestamp t -// provided in seconds. -func TimestampFromUnix(t int64) Timestamp { - return Timestamp(t * second) -} - -// TimestampFromUnixNano returns the Timestamp equivalent to the Unix timestamp -// t provided in nanoseconds. -func TimestampFromUnixNano(t int64) Timestamp { - return Timestamp(t / nanosPerTick) -} diff --git a/Godeps/_workspace/src/github.com/prometheus/client_golang/model/timestamp_test.go b/Godeps/_workspace/src/github.com/prometheus/client_golang/model/timestamp_test.go deleted file mode 100644 index fa028a47deba..000000000000 --- a/Godeps/_workspace/src/github.com/prometheus/client_golang/model/timestamp_test.go +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright 2013 The Prometheus 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 model - -import ( - "testing" - native_time "time" -) - -func TestComparators(t *testing.T) { - t1a := TimestampFromUnix(0) - t1b := TimestampFromUnix(0) - t2 := TimestampFromUnix(2*second - 1) - - if !t1a.Equal(t1b) { - t.Fatalf("Expected %s to be equal to %s", t1a, t1b) - } - if t1a.Equal(t2) { - t.Fatalf("Expected %s to not be equal to %s", t1a, t2) - } - - if !t1a.Before(t2) { - t.Fatalf("Expected %s to be before %s", t1a, t2) - } - if t1a.Before(t1b) { - t.Fatalf("Expected %s to not be before %s", t1a, t1b) - } - - if !t2.After(t1a) { - t.Fatalf("Expected %s to be after %s", t2, t1a) - } - if t1b.After(t1a) { - t.Fatalf("Expected %s to not be after %s", t1b, t1a) - } -} - -func TestTimestampConversions(t *testing.T) { - unixSecs := int64(1136239445) - unixNsecs := int64(123456789) - unixNano := unixSecs*1000000000 + unixNsecs - - t1 := native_time.Unix(unixSecs, unixNsecs-unixNsecs%nanosPerTick) - t2 := native_time.Unix(unixSecs, unixNsecs) - - ts := TimestampFromUnixNano(unixNano) - if !ts.Time().Equal(t1) { - t.Fatalf("Expected %s, got %s", t1, ts.Time()) - } - - // Test available precision. - ts = TimestampFromTime(t2) - if !ts.Time().Equal(t1) { - t.Fatalf("Expected %s, got %s", t1, ts.Time()) - } - - if ts.UnixNano() != unixNano-unixNano%nanosPerTick { - t.Fatalf("Expected %d, got %d", unixNano, ts.UnixNano()) - } -} - -func TestDuration(t *testing.T) { - duration := native_time.Second + native_time.Minute + native_time.Hour - goTime := native_time.Unix(1136239445, 0) - - ts := TimestampFromTime(goTime) - if !goTime.Add(duration).Equal(ts.Add(duration).Time()) { - t.Fatalf("Expected %s to be equal to %s", goTime.Add(duration), ts.Add(duration)) - } - - earlier := ts.Add(-duration) - delta := ts.Sub(earlier) - if delta != duration { - t.Fatalf("Expected %s to be equal to %s", delta, duration) - } -} diff --git a/Godeps/_workspace/src/github.com/prometheus/client_golang/prometheus/counter.go b/Godeps/_workspace/src/github.com/prometheus/client_golang/prometheus/counter.go index f8d633fbd555..a2952d1c8819 100644 --- a/Godeps/_workspace/src/github.com/prometheus/client_golang/prometheus/counter.go +++ b/Godeps/_workspace/src/github.com/prometheus/client_golang/prometheus/counter.go @@ -33,7 +33,7 @@ type Counter interface { // Set is used to set the Counter to an arbitrary value. It is only used // if you have to transfer a value from an external counter into this - // Prometheus metrics. Do not use it for regular handling of a + // Prometheus metric. Do not use it for regular handling of a // Prometheus counter (as it can be used to break the contract of // monotonically increasing values). Set(float64) diff --git a/Godeps/_workspace/src/github.com/prometheus/client_golang/prometheus/desc.go b/Godeps/_workspace/src/github.com/prometheus/client_golang/prometheus/desc.go index 7e1f9e85372c..fcde784d6405 100644 --- a/Godeps/_workspace/src/github.com/prometheus/client_golang/prometheus/desc.go +++ b/Godeps/_workspace/src/github.com/prometheus/client_golang/prometheus/desc.go @@ -9,18 +9,20 @@ import ( "sort" "strings" - "github.com/prometheus/client_golang/model" + "github.com/golang/protobuf/proto" dto "github.com/prometheus/client_model/go" - - "github.com/golang/protobuf/proto" ) var ( metricNameRE = regexp.MustCompile(`^[a-zA-Z_][a-zA-Z0-9_:]*$`) - labelNameRE = regexp.MustCompile(`^[a-zA-Z_][a-zA-Z0-9_]*$`) + labelNameRE = regexp.MustCompile("^[a-zA-Z_][a-zA-Z0-9_]*$") ) +// reservedLabelPrefix is a prefix which is not legal in user-supplied +// label names. +const reservedLabelPrefix = "__" + // Labels represents a collection of label name -> value mappings. This type is // commonly used with the With(Labels) and GetMetricWith(Labels) methods of // metric vector Collectors, e.g.: @@ -134,7 +136,7 @@ func NewDesc(fqName, help string, variableLabels []string, constLabels Labels) * for _, val := range labelValues { b.Reset() b.WriteString(val) - b.WriteByte(model.SeparatorByte) + b.WriteByte(separatorByte) h.Write(b.Bytes()) } d.id = h.Sum64() @@ -145,12 +147,12 @@ func NewDesc(fqName, help string, variableLabels []string, constLabels Labels) * h.Reset() b.Reset() b.WriteString(help) - b.WriteByte(model.SeparatorByte) + b.WriteByte(separatorByte) h.Write(b.Bytes()) for _, labelName := range labelNames { b.Reset() b.WriteString(labelName) - b.WriteByte(model.SeparatorByte) + b.WriteByte(separatorByte) h.Write(b.Bytes()) } d.dimHash = h.Sum64() @@ -195,5 +197,5 @@ func (d *Desc) String() string { func checkLabelName(l string) bool { return labelNameRE.MatchString(l) && - !strings.HasPrefix(l, model.ReservedLabelPrefix) + !strings.HasPrefix(l, reservedLabelPrefix) } diff --git a/Godeps/_workspace/src/github.com/prometheus/client_golang/prometheus/doc.go b/Godeps/_workspace/src/github.com/prometheus/client_golang/prometheus/doc.go index b98c135262ad..425fe8793cd8 100644 --- a/Godeps/_workspace/src/github.com/prometheus/client_golang/prometheus/doc.go +++ b/Godeps/_workspace/src/github.com/prometheus/client_golang/prometheus/doc.go @@ -61,12 +61,13 @@ // It also exports some stats about the HTTP usage of the /metrics // endpoint. (See the Handler function for more detail.) // -// A more advanced metric type is the Summary. +// Two more advanced metric types are the Summary and Histogram. // -// In addition to the fundamental metric types Gauge, Counter, and Summary, a -// very important part of the Prometheus data model is the partitioning of -// samples along dimensions called labels, which results in metric vectors. The -// fundamental types are GaugeVec, CounterVec, and SummaryVec. +// In addition to the fundamental metric types Gauge, Counter, Summary, and +// Histogram, a very important part of the Prometheus data model is the +// partitioning of samples along dimensions called labels, which results in +// metric vectors. The fundamental types are GaugeVec, CounterVec, SummaryVec, +// and HistogramVec. // // Those are all the parts needed for basic usage. Detailed documentation and // examples are provided below. diff --git a/Godeps/_workspace/src/github.com/prometheus/client_golang/prometheus/examples_test.go b/Godeps/_workspace/src/github.com/prometheus/client_golang/prometheus/examples_test.go index d106c42c6b71..0344e465b0c3 100644 --- a/Godeps/_workspace/src/github.com/prometheus/client_golang/prometheus/examples_test.go +++ b/Godeps/_workspace/src/github.com/prometheus/client_golang/prometheus/examples_test.go @@ -392,6 +392,9 @@ func ExampleSummaryVec() { temps.WithLabelValues("lithobates-catesbeianus").Observe(32 + math.Floor(100*math.Cos(float64(i)*0.11))/10) } + // Create a Summary without any observations. + temps.WithLabelValues("leiopelma-hochstetteri") + // Just for demonstration, let's check the state of the summary vector // by (ab)using its Collect method and the Write method of its elements // (which is usually only used by Prometheus internally - code like the @@ -414,6 +417,26 @@ func ExampleSummaryVec() { // Output: // [label: < // name: "species" + // value: "leiopelma-hochstetteri" + // > + // summary: < + // sample_count: 0 + // sample_sum: 0 + // quantile: < + // quantile: 0.5 + // value: nan + // > + // quantile: < + // quantile: 0.9 + // value: nan + // > + // quantile: < + // quantile: 0.99 + // value: nan + // > + // > + // label: < + // name: "species" // value: "lithobates-catesbeianus" // > // summary: < @@ -455,6 +478,56 @@ func ExampleSummaryVec() { // ] } +func ExampleConstSummary() { + desc := prometheus.NewDesc( + "http_request_duration_seconds", + "A summary of the HTTP request durations.", + []string{"code", "method"}, + prometheus.Labels{"owner": "example"}, + ) + + // Create a constant summary from values we got from a 3rd party telemetry system. + s := prometheus.MustNewConstSummary( + desc, + 4711, 403.34, + map[float64]float64{0.5: 42.3, 0.9: 323.3}, + "200", "get", + ) + + // Just for demonstration, let's check the state of the summary by + // (ab)using its Write method (which is usually only used by Prometheus + // internally). + metric := &dto.Metric{} + s.Write(metric) + fmt.Println(proto.MarshalTextString(metric)) + + // Output: + // label: < + // name: "code" + // value: "200" + // > + // label: < + // name: "method" + // value: "get" + // > + // label: < + // name: "owner" + // value: "example" + // > + // summary: < + // sample_count: 4711 + // sample_sum: 403.34 + // quantile: < + // quantile: 0.5 + // value: 42.3 + // > + // quantile: < + // quantile: 0.9 + // value: 323.3 + // > + // > +} + func ExampleHistogram() { temps := prometheus.NewHistogram(prometheus.HistogramOpts{ Name: "pond_temperature_celsius", @@ -501,6 +574,64 @@ func ExampleHistogram() { // > } +func ExampleConstHistogram() { + desc := prometheus.NewDesc( + "http_request_duration_seconds", + "A histogram of the HTTP request durations.", + []string{"code", "method"}, + prometheus.Labels{"owner": "example"}, + ) + + // Create a constant histogram from values we got from a 3rd party telemetry system. + h := prometheus.MustNewConstHistogram( + desc, + 4711, 403.34, + map[float64]uint64{25: 121, 50: 2403, 100: 3221, 200: 4233}, + "200", "get", + ) + + // Just for demonstration, let's check the state of the histogram by + // (ab)using its Write method (which is usually only used by Prometheus + // internally). + metric := &dto.Metric{} + h.Write(metric) + fmt.Println(proto.MarshalTextString(metric)) + + // Output: + // label: < + // name: "code" + // value: "200" + // > + // label: < + // name: "method" + // value: "get" + // > + // label: < + // name: "owner" + // value: "example" + // > + // histogram: < + // sample_count: 4711 + // sample_sum: 403.34 + // bucket: < + // cumulative_count: 121 + // upper_bound: 25 + // > + // bucket: < + // cumulative_count: 2403 + // upper_bound: 50 + // > + // bucket: < + // cumulative_count: 3221 + // upper_bound: 100 + // > + // bucket: < + // cumulative_count: 4233 + // upper_bound: 200 + // > + // > +} + func ExamplePushCollectors() { hostname, _ := os.Hostname() completionTime := prometheus.NewGauge(prometheus.GaugeOpts{ diff --git a/Godeps/_workspace/src/github.com/prometheus/client_golang/prometheus/go_collector.go b/Godeps/_workspace/src/github.com/prometheus/client_golang/prometheus/go_collector.go index d7b7a20a1239..85fa20be4559 100644 --- a/Godeps/_workspace/src/github.com/prometheus/client_golang/prometheus/go_collector.go +++ b/Godeps/_workspace/src/github.com/prometheus/client_golang/prometheus/go_collector.go @@ -2,10 +2,13 @@ package prometheus import ( "runtime" + "runtime/debug" + "time" ) type goCollector struct { goroutines Gauge + gcDesc *Desc } // NewGoCollector returns a collector which exports metrics about the current @@ -13,19 +16,35 @@ type goCollector struct { func NewGoCollector() *goCollector { return &goCollector{ goroutines: NewGauge(GaugeOpts{ - Name: "process_goroutines", + Name: "go_goroutines", Help: "Number of goroutines that currently exist.", }), + gcDesc: NewDesc( + "go_gc_duration_seconds", + "A summary of the GC invocation durations.", + nil, nil), } } // Describe returns all descriptions of the collector. func (c *goCollector) Describe(ch chan<- *Desc) { ch <- c.goroutines.Desc() + ch <- c.gcDesc } // Collect returns the current state of all metrics of the collector. func (c *goCollector) Collect(ch chan<- Metric) { c.goroutines.Set(float64(runtime.NumGoroutine())) ch <- c.goroutines + + var stats debug.GCStats + stats.PauseQuantiles = make([]time.Duration, 5) + debug.ReadGCStats(&stats) + + quantiles := make(map[float64]float64) + for idx, pq := range stats.PauseQuantiles[1:] { + quantiles[float64(idx+1)/float64(len(stats.PauseQuantiles)-1)] = pq.Seconds() + } + quantiles[0.0] = stats.PauseQuantiles[0].Seconds() + ch <- MustNewConstSummary(c.gcDesc, uint64(stats.NumGC), float64(stats.PauseTotal.Seconds()), quantiles) } diff --git a/Godeps/_workspace/src/github.com/prometheus/client_golang/prometheus/go_collector_test.go b/Godeps/_workspace/src/github.com/prometheus/client_golang/prometheus/go_collector_test.go index b0582d1b98b4..9a8858cbd2b8 100644 --- a/Godeps/_workspace/src/github.com/prometheus/client_golang/prometheus/go_collector_test.go +++ b/Godeps/_workspace/src/github.com/prometheus/client_golang/prometheus/go_collector_test.go @@ -1,7 +1,7 @@ package prometheus import ( - "reflect" + "runtime" "testing" "time" @@ -35,6 +35,9 @@ func TestGoCollector(t *testing.T) { case Gauge: pb := &dto.Metric{} m.Write(pb) + if pb.GetGauge() == nil { + continue + } if old == -1 { old = int(pb.GetGauge().GetValue()) @@ -47,9 +50,71 @@ func TestGoCollector(t *testing.T) { t.Errorf("want 1 new goroutine, got %d", diff) } + // GoCollector performs two sends per call. + // On line 27 we need to receive the second send + // to shut down cleanly. + <-ch + return + } + case <-time.After(1 * time.Second): + t.Fatalf("expected collect timed out") + } + } +} + +func TestGCCollector(t *testing.T) { + var ( + c = NewGoCollector() + ch = make(chan Metric) + waitc = make(chan struct{}) + closec = make(chan struct{}) + oldGC uint64 + oldPause float64 + ) + defer close(closec) + + go func() { + c.Collect(ch) + // force GC + runtime.GC() + <-waitc + c.Collect(ch) + }() + + first := true + for { + select { + case metric := <-ch: + switch m := metric.(type) { + case *constSummary, *value: + pb := &dto.Metric{} + m.Write(pb) + if pb.GetSummary() == nil { + continue + } + + if len(pb.GetSummary().Quantile) != 5 { + t.Errorf("expected 4 buckets, got %d", len(pb.GetSummary().Quantile)) + } + for idx, want := range []float64{0.0, 0.25, 0.5, 0.75, 1.0} { + if *pb.GetSummary().Quantile[idx].Quantile != want { + t.Errorf("bucket #%d is off, got %f, want %f", idx, *pb.GetSummary().Quantile[idx].Quantile, want) + } + } + if first { + first = false + oldGC = *pb.GetSummary().SampleCount + oldPause = *pb.GetSummary().SampleSum + close(waitc) + continue + } + if diff := *pb.GetSummary().SampleCount - oldGC; diff != 1 { + t.Errorf("want 1 new garbage collection run, got %d", diff) + } + if diff := *pb.GetSummary().SampleSum - oldPause; diff <= 0 { + t.Errorf("want moar pause, got %f", diff) + } return - default: - t.Errorf("want type Gauge, got %s", reflect.TypeOf(metric)) } case <-time.After(1 * time.Second): t.Fatalf("expected collect timed out") diff --git a/Godeps/_workspace/src/github.com/prometheus/client_golang/prometheus/histogram.go b/Godeps/_workspace/src/github.com/prometheus/client_golang/prometheus/histogram.go index 9b36a6115065..f98a41bc89d6 100644 --- a/Godeps/_workspace/src/github.com/prometheus/client_golang/prometheus/histogram.go +++ b/Godeps/_workspace/src/github.com/prometheus/client_golang/prometheus/histogram.go @@ -22,7 +22,6 @@ import ( "github.com/golang/protobuf/proto" - "github.com/prometheus/client_golang/model" dto "github.com/prometheus/client_model/go" ) @@ -49,6 +48,10 @@ type Histogram interface { Observe(float64) } +// bucketLabel is used for the label that defines the upper bound of a +// bucket of a histogram ("le" -> "less or equal"). +const bucketLabel = "le" + var ( // DefBuckets are the default Histogram buckets. The default buckets are // tailored to broadly measure the response time (in seconds) of a @@ -57,7 +60,7 @@ var ( DefBuckets = []float64{.005, .01, .025, .05, .1, .25, .5, 1, 2.5, 5, 10} errBucketLabelNotAllowed = fmt.Errorf( - "%q is not allowed as label name in histograms", model.BucketLabel, + "%q is not allowed as label name in histograms", bucketLabel, ) ) @@ -147,7 +150,7 @@ type HistogramOpts struct { // element in the slice is the upper inclusive bound of a bucket. The // values must be sorted in strictly increasing order. There is no need // to add a highest bucket with +Inf bound, it will be added - // implicitly. The default value is DefObjectives. + // implicitly. The default value is DefBuckets. Buckets []float64 } @@ -171,12 +174,12 @@ func newHistogram(desc *Desc, opts HistogramOpts, labelValues ...string) Histogr } for _, n := range desc.variableLabels { - if n == model.BucketLabel { + if n == bucketLabel { panic(errBucketLabelNotAllowed) } } for _, lp := range desc.constLabelPairs { - if lp.GetName() == model.BucketLabel { + if lp.GetName() == bucketLabel { panic(errBucketLabelNotAllowed) } } @@ -213,6 +216,13 @@ func newHistogram(desc *Desc, opts HistogramOpts, labelValues ...string) Histogr } type histogram struct { + // sumBits contains the bits of the float64 representing the sum of all + // observations. sumBits and count have to go first in the struct to + // guarantee alignment for atomic operations. + // http://golang.org/pkg/sync/atomic/#pkg-note-BUG + sumBits uint64 + count uint64 + SelfCollector // Note that there is no mutex required. @@ -222,9 +232,6 @@ type histogram struct { counts []uint64 labelPairs []*dto.LabelPair - - sumBits uint64 // The bits of the float64 representing the sum of all observations. - count uint64 } func (h *histogram) Desc() *Desc { @@ -342,3 +349,102 @@ func (m *HistogramVec) WithLabelValues(lvs ...string) Histogram { func (m *HistogramVec) With(labels Labels) Histogram { return m.MetricVec.With(labels).(Histogram) } + +type constHistogram struct { + desc *Desc + count uint64 + sum float64 + buckets map[float64]uint64 + labelPairs []*dto.LabelPair +} + +func (h *constHistogram) Desc() *Desc { + return h.desc +} + +func (h *constHistogram) Write(out *dto.Metric) error { + his := &dto.Histogram{} + buckets := make([]*dto.Bucket, 0, len(h.buckets)) + + his.SampleCount = proto.Uint64(h.count) + his.SampleSum = proto.Float64(h.sum) + + for upperBound, count := range h.buckets { + buckets = append(buckets, &dto.Bucket{ + CumulativeCount: proto.Uint64(count), + UpperBound: proto.Float64(upperBound), + }) + } + + if len(buckets) > 0 { + sort.Sort(buckSort(buckets)) + } + his.Bucket = buckets + + out.Histogram = his + out.Label = h.labelPairs + + return nil +} + +// NewConstHistogram returns a metric representing a Prometheus histogram with +// fixed values for the count, sum, and bucket counts. As those parameters +// cannot be changed, the returned value does not implement the Histogram +// interface (but only the Metric interface). Users of this package will not +// have much use for it in regular operations. However, when implementing custom +// Collectors, it is useful as a throw-away metric that is generated on the fly +// to send it to Prometheus in the Collect method. +// +// buckets is a map of upper bounds to cumulative counts, excluding the +Inf +// bucket. +// +// NewConstHistogram returns an error if the length of labelValues is not +// consistent with the variable labels in Desc. +func NewConstHistogram( + desc *Desc, + count uint64, + sum float64, + buckets map[float64]uint64, + labelValues ...string, +) (Metric, error) { + if len(desc.variableLabels) != len(labelValues) { + return nil, errInconsistentCardinality + } + return &constHistogram{ + desc: desc, + count: count, + sum: sum, + buckets: buckets, + labelPairs: makeLabelPairs(desc, labelValues), + }, nil +} + +// MustNewConstHistogram is a version of NewConstHistogram that panics where +// NewConstMetric would have returned an error. +func MustNewConstHistogram( + desc *Desc, + count uint64, + sum float64, + buckets map[float64]uint64, + labelValues ...string, +) Metric { + m, err := NewConstHistogram(desc, count, sum, buckets, labelValues...) + if err != nil { + panic(err) + } + return m +} + +type buckSort []*dto.Bucket + +func (s buckSort) Len() int { + return len(s) +} + +func (s buckSort) Swap(i, j int) { + s[i], s[j] = s[j], s[i] +} + +func (s buckSort) Less(i, j int) bool { + return s[i].GetUpperBound() < s[j].GetUpperBound() +} diff --git a/Godeps/_workspace/src/github.com/prometheus/client_golang/prometheus/histogram_test.go b/Godeps/_workspace/src/github.com/prometheus/client_golang/prometheus/histogram_test.go index 855af4695019..11cf66b4fe2e 100644 --- a/Godeps/_workspace/src/github.com/prometheus/client_golang/prometheus/histogram_test.go +++ b/Godeps/_workspace/src/github.com/prometheus/client_golang/prometheus/histogram_test.go @@ -124,6 +124,10 @@ func BenchmarkHistogramWrite8(b *testing.B) { var testBuckets = []float64{-2, -1, -0.5, 0, 0.5, 1, 2, math.Inf(+1)} func TestHistogramConcurrency(t *testing.T) { + if testing.Short() { + t.Skip("Skipping test in short mode.") + } + rand.Seed(42) it := func(n uint32) bool { @@ -198,6 +202,10 @@ func TestHistogramConcurrency(t *testing.T) { } func TestHistogramVecConcurrency(t *testing.T) { + if testing.Short() { + t.Skip("Skipping test in short mode.") + } + rand.Seed(42) objectives := make([]float64, 0, len(DefObjectives)) diff --git a/Godeps/_workspace/src/github.com/prometheus/client_golang/prometheus/http.go b/Godeps/_workspace/src/github.com/prometheus/client_golang/prometheus/http.go index dac92fd907c3..eabe602468f1 100644 --- a/Godeps/_workspace/src/github.com/prometheus/client_golang/prometheus/http.go +++ b/Godeps/_workspace/src/github.com/prometheus/client_golang/prometheus/http.go @@ -14,6 +14,9 @@ package prometheus import ( + "bufio" + "io" + "net" "net/http" "strconv" "strings" @@ -141,7 +144,18 @@ func InstrumentHandlerFuncWithOpts(opts SummaryOpts, handlerFunc func(http.Respo urlLen = len(r.URL.String()) } go computeApproximateRequestSize(r, out, urlLen) - handlerFunc(delegate, r) + + _, cn := w.(http.CloseNotifier) + _, fl := w.(http.Flusher) + _, hj := w.(http.Hijacker) + _, rf := w.(io.ReaderFrom) + var rw http.ResponseWriter + if cn && fl && hj && rf { + rw = &fancyResponseWriterDelegator{delegate} + } else { + rw = delegate + } + handlerFunc(rw, r) elapsed := float64(time.Since(now)) / float64(time.Microsecond) @@ -178,7 +192,7 @@ type responseWriterDelegator struct { handler, method string status int - written int + written int64 wroteHeader bool } @@ -193,7 +207,32 @@ func (r *responseWriterDelegator) Write(b []byte) (int, error) { r.WriteHeader(http.StatusOK) } n, err := r.ResponseWriter.Write(b) - r.written += n + r.written += int64(n) + return n, err +} + +type fancyResponseWriterDelegator struct { + *responseWriterDelegator +} + +func (f *fancyResponseWriterDelegator) CloseNotify() <-chan bool { + return f.ResponseWriter.(http.CloseNotifier).CloseNotify() +} + +func (f *fancyResponseWriterDelegator) Flush() { + f.ResponseWriter.(http.Flusher).Flush() +} + +func (f *fancyResponseWriterDelegator) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return f.ResponseWriter.(http.Hijacker).Hijack() +} + +func (f *fancyResponseWriterDelegator) ReadFrom(r io.Reader) (int64, error) { + if !f.wroteHeader { + f.WriteHeader(http.StatusOK) + } + n, err := f.ResponseWriter.(io.ReaderFrom).ReadFrom(r) + f.written += n return n, err } diff --git a/Godeps/_workspace/src/github.com/prometheus/client_golang/prometheus/metric.go b/Godeps/_workspace/src/github.com/prometheus/client_golang/prometheus/metric.go index d8905de2e880..86fd81c108bd 100644 --- a/Godeps/_workspace/src/github.com/prometheus/client_golang/prometheus/metric.go +++ b/Godeps/_workspace/src/github.com/prometheus/client_golang/prometheus/metric.go @@ -19,6 +19,8 @@ import ( dto "github.com/prometheus/client_model/go" ) +const separatorByte byte = 255 + // A Metric models a single sample value with its meta data being exported to // Prometheus. Implementers of Metric in this package inclued Gauge, Counter, // Untyped, and Summary. Users can implement their own Metric types, but that diff --git a/Godeps/_workspace/src/github.com/prometheus/client_golang/prometheus/registry.go b/Godeps/_workspace/src/github.com/prometheus/client_golang/prometheus/registry.go index 2515311b94d9..5970aaeeba95 100644 --- a/Godeps/_workspace/src/github.com/prometheus/client_golang/prometheus/registry.go +++ b/Godeps/_workspace/src/github.com/prometheus/client_golang/prometheus/registry.go @@ -33,13 +33,10 @@ import ( "strings" "sync" - "bitbucket.org/ww/goautoneg" "github.com/golang/protobuf/proto" + "github.com/prometheus/common/expfmt" dto "github.com/prometheus/client_model/go" - - "github.com/prometheus/client_golang/model" - "github.com/prometheus/client_golang/text" ) var ( @@ -170,6 +167,11 @@ func Unregister(c Collector) bool { // checks are performed, but no further consistency checks (which would require // knowledge of a metric descriptor). // +// Sorting concerns: The caller is responsible for sorting the label pairs in +// each metric. However, the order of metrics will be sorted by the registry as +// it is required anyway after merging with the metric families collected +// conventionally. +// // The function must be callable at any time and concurrently. func SetMetricFamilyInjectionHook(hook func() []*dto.MetricFamily) { defRegistry.metricFamilyInjectionHook = hook @@ -341,7 +343,7 @@ func (r *registry) Push(job, instance, pushURL, method string) error { } buf := r.getBuf() defer r.giveBuf(buf) - if _, err := r.writePB(buf, text.WriteProtoDelimited); err != nil { + if err := r.writePB(expfmt.NewEncoder(buf, expfmt.FmtProtoDelim)); err != nil { if r.panicOnCollectError { panic(err) } @@ -364,11 +366,11 @@ func (r *registry) Push(job, instance, pushURL, method string) error { } func (r *registry) ServeHTTP(w http.ResponseWriter, req *http.Request) { - enc, contentType := chooseEncoder(req) + contentType := expfmt.Negotiate(req.Header) buf := r.getBuf() defer r.giveBuf(buf) writer, encoding := decorateWriter(req, buf) - if _, err := r.writePB(writer, enc); err != nil { + if err := r.writePB(expfmt.NewEncoder(writer, contentType)); err != nil { if r.panicOnCollectError { panic(err) } @@ -379,7 +381,7 @@ func (r *registry) ServeHTTP(w http.ResponseWriter, req *http.Request) { closer.Close() } header := w.Header() - header.Set(contentTypeHeader, contentType) + header.Set(contentTypeHeader, string(contentType)) header.Set(contentLengthHeader, fmt.Sprint(buf.Len())) if encoding != "" { header.Set(contentEncodingHeader, encoding) @@ -387,7 +389,7 @@ func (r *registry) ServeHTTP(w http.ResponseWriter, req *http.Request) { w.Write(buf.Bytes()) } -func (r *registry) writePB(w io.Writer, writeEncoded encoder) (int, error) { +func (r *registry) writePB(encoder expfmt.Encoder) error { var metricHashes map[uint64]struct{} if r.collectChecksEnabled { metricHashes = make(map[uint64]struct{}) @@ -439,7 +441,7 @@ func (r *registry) writePB(w io.Writer, writeEncoded encoder) (int, error) { // TODO: Consider different means of error reporting so // that a single erroneous metric could be skipped // instead of blowing up the whole collection. - return 0, fmt.Errorf("error collecting metric %v: %s", desc, err) + return fmt.Errorf("error collecting metric %v: %s", desc, err) } switch { case metricFamily.Type != nil: @@ -455,11 +457,11 @@ func (r *registry) writePB(w io.Writer, writeEncoded encoder) (int, error) { case dtoMetric.Histogram != nil: metricFamily.Type = dto.MetricType_HISTOGRAM.Enum() default: - return 0, fmt.Errorf("empty metric collected: %s", dtoMetric) + return fmt.Errorf("empty metric collected: %s", dtoMetric) } if r.collectChecksEnabled { if err := r.checkConsistency(metricFamily, dtoMetric, desc, metricHashes); err != nil { - return 0, err + return err } } metricFamily.Metric = append(metricFamily.Metric, dtoMetric) @@ -473,7 +475,7 @@ func (r *registry) writePB(w io.Writer, writeEncoded encoder) (int, error) { if r.collectChecksEnabled { for _, m := range mf.Metric { if err := r.checkConsistency(mf, m, nil, metricHashes); err != nil { - return 0, err + return err } } } @@ -482,7 +484,7 @@ func (r *registry) writePB(w io.Writer, writeEncoded encoder) (int, error) { for _, m := range mf.Metric { if r.collectChecksEnabled { if err := r.checkConsistency(existingMF, m, nil, metricHashes); err != nil { - return 0, err + return err } } existingMF.Metric = append(existingMF.Metric, m) @@ -503,15 +505,12 @@ func (r *registry) writePB(w io.Writer, writeEncoded encoder) (int, error) { } sort.Strings(names) - var written int for _, name := range names { - w, err := writeEncoded(w, metricFamiliesByName[name]) - written += w - if err != nil { - return written, err + if err := encoder.Encode(metricFamiliesByName[name]); err != nil { + return err } } - return written, nil + return nil } func (r *registry) checkConsistency(metricFamily *dto.MetricFamily, dtoMetric *dto.Metric, desc *Desc, metricHashes map[uint64]struct{}) error { @@ -520,10 +519,11 @@ func (r *registry) checkConsistency(metricFamily *dto.MetricFamily, dtoMetric *d if metricFamily.GetType() == dto.MetricType_GAUGE && dtoMetric.Gauge == nil || metricFamily.GetType() == dto.MetricType_COUNTER && dtoMetric.Counter == nil || metricFamily.GetType() == dto.MetricType_SUMMARY && dtoMetric.Summary == nil || + metricFamily.GetType() == dto.MetricType_HISTOGRAM && dtoMetric.Histogram == nil || metricFamily.GetType() == dto.MetricType_UNTYPED && dtoMetric.Untyped == nil { return fmt.Errorf( - "collected metric %q is not a %s", - dtoMetric, metricFamily.Type, + "collected metric %s %s is not a %s", + metricFamily.GetName(), dtoMetric, metricFamily.GetType(), ) } @@ -531,19 +531,24 @@ func (r *registry) checkConsistency(metricFamily *dto.MetricFamily, dtoMetric *d h := fnv.New64a() var buf bytes.Buffer buf.WriteString(metricFamily.GetName()) - buf.WriteByte(model.SeparatorByte) + buf.WriteByte(separatorByte) h.Write(buf.Bytes()) + // Make sure label pairs are sorted. We depend on it for the consistency + // check. Label pairs must be sorted by contract. But the point of this + // method is to check for contract violations. So we better do the sort + // now. + sort.Sort(LabelPairSorter(dtoMetric.Label)) for _, lp := range dtoMetric.Label { buf.Reset() buf.WriteString(lp.GetValue()) - buf.WriteByte(model.SeparatorByte) + buf.WriteByte(separatorByte) h.Write(buf.Bytes()) } metricHash := h.Sum64() if _, exists := metricHashes[metricHash]; exists { return fmt.Errorf( - "collected metric %q was collected before with the same name and label values", - dtoMetric, + "collected metric %s %s was collected before with the same name and label values", + metricFamily.GetName(), dtoMetric, ) } metricHashes[metricHash] = struct{}{} @@ -555,14 +560,14 @@ func (r *registry) checkConsistency(metricFamily *dto.MetricFamily, dtoMetric *d // Desc consistency with metric family. if metricFamily.GetName() != desc.fqName { return fmt.Errorf( - "collected metric %q has name %q but should have %q", - dtoMetric, metricFamily.GetName(), desc.fqName, + "collected metric %s %s has name %q but should have %q", + metricFamily.GetName(), dtoMetric, metricFamily.GetName(), desc.fqName, ) } if metricFamily.GetHelp() != desc.help { return fmt.Errorf( - "collected metric %q has help %q but should have %q", - dtoMetric, metricFamily.GetHelp(), desc.help, + "collected metric %s %s has help %q but should have %q", + metricFamily.GetName(), dtoMetric, metricFamily.GetHelp(), desc.help, ) } @@ -576,8 +581,8 @@ func (r *registry) checkConsistency(metricFamily *dto.MetricFamily, dtoMetric *d } if len(lpsFromDesc) != len(dtoMetric.Label) { return fmt.Errorf( - "labels in collected metric %q are inconsistent with descriptor %s", - dtoMetric, desc, + "labels in collected metric %s %s are inconsistent with descriptor %s", + metricFamily.GetName(), dtoMetric, desc, ) } sort.Sort(LabelPairSorter(lpsFromDesc)) @@ -586,8 +591,8 @@ func (r *registry) checkConsistency(metricFamily *dto.MetricFamily, dtoMetric *d if lpFromDesc.GetName() != lpFromMetric.GetName() || lpFromDesc.Value != nil && lpFromDesc.GetValue() != lpFromMetric.GetValue() { return fmt.Errorf( - "labels in collected metric %q are inconsistent with descriptor %s", - dtoMetric, desc, + "labels in collected metric %s %s are inconsistent with descriptor %s", + metricFamily.GetName(), dtoMetric, desc, ) } } @@ -597,7 +602,10 @@ func (r *registry) checkConsistency(metricFamily *dto.MetricFamily, dtoMetric *d // Is the desc registered? if _, exist := r.descIDs[desc.id]; !exist { - return fmt.Errorf("collected metric %q with unregistered descriptor %s", dtoMetric, desc) + return fmt.Errorf( + "collected metric %s %s with unregistered descriptor %s", + metricFamily.GetName(), dtoMetric, desc, + ) } return nil @@ -672,34 +680,6 @@ func newDefaultRegistry() *registry { return r } -func chooseEncoder(req *http.Request) (encoder, string) { - accepts := goautoneg.ParseAccept(req.Header.Get(acceptHeader)) - for _, accept := range accepts { - switch { - case accept.Type == "application" && - accept.SubType == "vnd.google.protobuf" && - accept.Params["proto"] == "io.prometheus.client.MetricFamily": - switch accept.Params["encoding"] { - case "delimited": - return text.WriteProtoDelimited, DelimitedTelemetryContentType - case "text": - return text.WriteProtoText, ProtoTextTelemetryContentType - case "compact-text": - return text.WriteProtoCompactText, ProtoCompactTextTelemetryContentType - default: - continue - } - case accept.Type == "text" && - accept.SubType == "plain" && - (accept.Params["version"] == "0.0.4" || accept.Params["version"] == ""): - return text.MetricFamilyToText, TextTelemetryContentType - default: - continue - } - } - return text.MetricFamilyToText, TextTelemetryContentType -} - // decorateWriter wraps a writer to handle gzip compression if requested. It // returns the decorated writer and the appropriate "Content-Encoding" header // (which is empty if no compression is enabled). diff --git a/Godeps/_workspace/src/github.com/prometheus/client_golang/prometheus/registry_test.go b/Godeps/_workspace/src/github.com/prometheus/client_golang/prometheus/registry_test.go index bbf11f69778c..f30c90c06be1 100644 --- a/Godeps/_workspace/src/github.com/prometheus/client_golang/prometheus/registry_test.go +++ b/Godeps/_workspace/src/github.com/prometheus/client_golang/prometheus/registry_test.go @@ -68,14 +68,14 @@ func testHandler(t testing.TB) { Metric: []*dto.Metric{ { Label: []*dto.LabelPair{ - { - Name: proto.String("externallabelname"), - Value: proto.String("externalval1"), - }, { Name: proto.String("externalconstname"), Value: proto.String("externalconstvalue"), }, + { + Name: proto.String("externallabelname"), + Value: proto.String("externalval1"), + }, }, Counter: &dto.Counter{ Value: proto.Float64(1), @@ -100,27 +100,27 @@ func testHandler(t testing.TB) { externalMetricFamilyAsBytes := externalBuf.Bytes() externalMetricFamilyAsText := []byte(`# HELP externalname externaldocstring # TYPE externalname counter -externalname{externallabelname="externalval1",externalconstname="externalconstvalue"} 1 +externalname{externalconstname="externalconstvalue",externallabelname="externalval1"} 1 `) externalMetricFamilyAsProtoText := []byte(`name: "externalname" help: "externaldocstring" type: COUNTER metric: < - label: < - name: "externallabelname" - value: "externalval1" - > label: < name: "externalconstname" value: "externalconstvalue" > + label: < + name: "externallabelname" + value: "externalval1" + > counter: < value: 1 > > `) - externalMetricFamilyAsProtoCompactText := []byte(`name:"externalname" help:"externaldocstring" type:COUNTER metric: label: counter: > + externalMetricFamilyAsProtoCompactText := []byte(`name:"externalname" help:"externaldocstring" type:COUNTER metric: label: counter: > `) expectedMetricFamily := &dto.MetricFamily{ diff --git a/Godeps/_workspace/src/github.com/prometheus/client_golang/prometheus/summary.go b/Godeps/_workspace/src/github.com/prometheus/client_golang/prometheus/summary.go index dd336c51994a..fe81e004f670 100644 --- a/Godeps/_workspace/src/github.com/prometheus/client_golang/prometheus/summary.go +++ b/Godeps/_workspace/src/github.com/prometheus/client_golang/prometheus/summary.go @@ -25,10 +25,12 @@ import ( "github.com/golang/protobuf/proto" dto "github.com/prometheus/client_model/go" - - "github.com/prometheus/client_golang/model" ) +// quantileLabel is used for the label that defines the quantile in a +// summary. +const quantileLabel = "quantile" + // A Summary captures individual observations from an event or sample stream and // summarizes them in a manner similar to traditional summary statistics: 1. sum // of observations, 2. observation count, 3. rank estimations. @@ -57,7 +59,7 @@ var ( DefObjectives = map[float64]float64{0.5: 0.05, 0.9: 0.01, 0.99: 0.001} errQuantileLabelNotAllowed = fmt.Errorf( - "%q is not allowed as label name in summaries", model.QuantileLabel, + "%q is not allowed as label name in summaries", quantileLabel, ) ) @@ -112,7 +114,9 @@ type SummaryOpts struct { ConstLabels Labels // Objectives defines the quantile rank estimates with their respective - // absolute error. The default value is DefObjectives. + // absolute error. If Objectives[q] = e, then the value reported + // for q will be the φ-quantile value for some φ between q-e and q+e. + // The default value is DefObjectives. Objectives map[float64]float64 // MaxAge defines the duration for which an observation stays relevant @@ -170,12 +174,12 @@ func newSummary(desc *Desc, opts SummaryOpts, labelValues ...string) Summary { } for _, n := range desc.variableLabels { - if n == model.QuantileLabel { + if n == quantileLabel { panic(errQuantileLabelNotAllowed) } } for _, lp := range desc.constLabelPairs { - if lp.GetName() == model.QuantileLabel { + if lp.GetName() == quantileLabel { panic(errQuantileLabelNotAllowed) } } @@ -448,3 +452,89 @@ func (m *SummaryVec) WithLabelValues(lvs ...string) Summary { func (m *SummaryVec) With(labels Labels) Summary { return m.MetricVec.With(labels).(Summary) } + +type constSummary struct { + desc *Desc + count uint64 + sum float64 + quantiles map[float64]float64 + labelPairs []*dto.LabelPair +} + +func (s *constSummary) Desc() *Desc { + return s.desc +} + +func (s *constSummary) Write(out *dto.Metric) error { + sum := &dto.Summary{} + qs := make([]*dto.Quantile, 0, len(s.quantiles)) + + sum.SampleCount = proto.Uint64(s.count) + sum.SampleSum = proto.Float64(s.sum) + + for rank, q := range s.quantiles { + qs = append(qs, &dto.Quantile{ + Quantile: proto.Float64(rank), + Value: proto.Float64(q), + }) + } + + if len(qs) > 0 { + sort.Sort(quantSort(qs)) + } + sum.Quantile = qs + + out.Summary = sum + out.Label = s.labelPairs + + return nil +} + +// NewConstSummary returns a metric representing a Prometheus summary with fixed +// values for the count, sum, and quantiles. As those parameters cannot be +// changed, the returned value does not implement the Summary interface (but +// only the Metric interface). Users of this package will not have much use for +// it in regular operations. However, when implementing custom Collectors, it is +// useful as a throw-away metric that is generated on the fly to send it to +// Prometheus in the Collect method. +// +// quantiles maps ranks to quantile values. For example, a median latency of +// 0.23s and a 99th percentile latency of 0.56s would be expressed as: +// map[float64]float64{0.5: 0.23, 0.99: 0.56} +// +// NewConstSummary returns an error if the length of labelValues is not +// consistent with the variable labels in Desc. +func NewConstSummary( + desc *Desc, + count uint64, + sum float64, + quantiles map[float64]float64, + labelValues ...string, +) (Metric, error) { + if len(desc.variableLabels) != len(labelValues) { + return nil, errInconsistentCardinality + } + return &constSummary{ + desc: desc, + count: count, + sum: sum, + quantiles: quantiles, + labelPairs: makeLabelPairs(desc, labelValues), + }, nil +} + +// MustNewConstSummary is a version of NewConstSummary that panics where +// NewConstMetric would have returned an error. +func MustNewConstSummary( + desc *Desc, + count uint64, + sum float64, + quantiles map[float64]float64, + labelValues ...string, +) Metric { + m, err := NewConstSummary(desc, count, sum, quantiles, labelValues...) + if err != nil { + panic(err) + } + return m +} diff --git a/Godeps/_workspace/src/github.com/prometheus/client_golang/prometheus/untyped.go b/Godeps/_workspace/src/github.com/prometheus/client_golang/prometheus/untyped.go index a5a4e77b14b2..c65ab1c53126 100644 --- a/Godeps/_workspace/src/github.com/prometheus/client_golang/prometheus/untyped.go +++ b/Godeps/_workspace/src/github.com/prometheus/client_golang/prometheus/untyped.go @@ -21,7 +21,7 @@ import "hash/fnv" // An Untyped metric works the same as a Gauge. The only difference is that to // no type information is implied. // -// To create Gauge instances, use NewUntyped. +// To create Untyped instances, use NewUntyped. type Untyped interface { Metric Collector diff --git a/Godeps/_workspace/src/github.com/prometheus/client_golang/prometheus/value.go b/Godeps/_workspace/src/github.com/prometheus/client_golang/prometheus/value.go index 107d43e37217..b54ac11e888e 100644 --- a/Godeps/_workspace/src/github.com/prometheus/client_golang/prometheus/value.go +++ b/Godeps/_workspace/src/github.com/prometheus/client_golang/prometheus/value.go @@ -43,11 +43,15 @@ var errInconsistentCardinality = errors.New("inconsistent label cardinality") // ValueType. This is a low-level building block used by the library to back the // implementations of Counter, Gauge, and Untyped. type value struct { + // valBits containst the bits of the represented float64 value. It has + // to go first in the struct to guarantee alignment for atomic + // operations. http://golang.org/pkg/sync/atomic/#pkg-note-BUG + valBits uint64 + SelfCollector desc *Desc valType ValueType - valBits uint64 // These are the bits of the represented float64 value. labelPairs []*dto.LabelPair } diff --git a/Godeps/_workspace/src/github.com/prometheus/client_golang/prometheus/vec.go b/Godeps/_workspace/src/github.com/prometheus/client_golang/prometheus/vec.go index aa49deba1b4b..a1f3bdf37d83 100644 --- a/Godeps/_workspace/src/github.com/prometheus/client_golang/prometheus/vec.go +++ b/Godeps/_workspace/src/github.com/prometheus/client_golang/prometheus/vec.go @@ -58,6 +58,11 @@ func (m *MetricVec) Collect(ch chan<- Metric) { // GetMetricWithLabelValues returns the Metric for the given slice of label // values (same order as the VariableLabels in Desc). If that combination of // label values is accessed for the first time, a new Metric is created. +// +// It is possible to call this method without using the returned Metric to only +// create the new Metric but leave it at its start value (e.g. a Summary or +// Histogram without any observations). See also the SummaryVec example. +// // Keeping the Metric for later use is possible (and should be considered if // performance is critical), but keep in mind that Reset, DeleteLabelValues and // Delete can be used to delete the Metric from the MetricVec. In that case, the @@ -87,8 +92,9 @@ func (m *MetricVec) GetMetricWithLabelValues(lvs ...string) (Metric, error) { // GetMetricWith returns the Metric for the given Labels map (the label names // must match those of the VariableLabels in Desc). If that label map is -// accessed for the first time, a new Metric is created. Implications of keeping -// the Metric are the same as for GetMetricWithLabelValues. +// accessed for the first time, a new Metric is created. Implications of +// creating a Metric without using it and keeping the Metric for later use are +// the same as for GetMetricWithLabelValues. // // An error is returned if the number and names of the Labels are inconsistent // with those of the VariableLabels in Desc. diff --git a/Godeps/_workspace/src/github.com/prometheus/client_golang/text/create.go b/Godeps/_workspace/src/github.com/prometheus/client_golang/text/create.go deleted file mode 100644 index 44304599466d..000000000000 --- a/Godeps/_workspace/src/github.com/prometheus/client_golang/text/create.go +++ /dev/null @@ -1,315 +0,0 @@ -// Copyright 2014 The Prometheus 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 text contains helper functions to parse and create text-based -// exchange formats. The package currently supports (only) version 0.0.4 of the -// exchange format. Should other versions be supported in the future, some -// versioning scheme has to be applied. Possibilities include separate packages -// or separate functions. The best way depends on the nature of future changes, -// which is the reason why no versioning scheme has been applied prematurely -// here. -package text - -import ( - "bytes" - "fmt" - "io" - "math" - "strings" - - "github.com/prometheus/client_golang/model" - dto "github.com/prometheus/client_model/go" -) - -// MetricFamilyToText converts a MetricFamily proto message into text format and -// writes the resulting lines to 'out'. It returns the number of bytes written -// and any error encountered. This function does not perform checks on the -// content of the metric and label names, i.e. invalid metric or label names -// will result in invalid text format output. -// This method fulfills the type 'prometheus.encoder'. -func MetricFamilyToText(out io.Writer, in *dto.MetricFamily) (int, error) { - var written int - - // Fail-fast checks. - if len(in.Metric) == 0 { - return written, fmt.Errorf("MetricFamily has no metrics: %s", in) - } - name := in.GetName() - if name == "" { - return written, fmt.Errorf("MetricFamily has no name: %s", in) - } - if in.Type == nil { - return written, fmt.Errorf("MetricFamily has no type: %s", in) - } - - // Comments, first HELP, then TYPE. - if in.Help != nil { - n, err := fmt.Fprintf( - out, "# HELP %s %s\n", - name, escapeString(*in.Help, false), - ) - written += n - if err != nil { - return written, err - } - } - metricType := in.GetType() - n, err := fmt.Fprintf( - out, "# TYPE %s %s\n", - name, strings.ToLower(metricType.String()), - ) - written += n - if err != nil { - return written, err - } - - // Finally the samples, one line for each. - for _, metric := range in.Metric { - switch metricType { - case dto.MetricType_COUNTER: - if metric.Counter == nil { - return written, fmt.Errorf( - "expected counter in metric %s", metric, - ) - } - n, err = writeSample( - name, metric, "", "", - metric.Counter.GetValue(), - out, - ) - case dto.MetricType_GAUGE: - if metric.Gauge == nil { - return written, fmt.Errorf( - "expected gauge in metric %s", metric, - ) - } - n, err = writeSample( - name, metric, "", "", - metric.Gauge.GetValue(), - out, - ) - case dto.MetricType_UNTYPED: - if metric.Untyped == nil { - return written, fmt.Errorf( - "expected untyped in metric %s", metric, - ) - } - n, err = writeSample( - name, metric, "", "", - metric.Untyped.GetValue(), - out, - ) - case dto.MetricType_SUMMARY: - if metric.Summary == nil { - return written, fmt.Errorf( - "expected summary in metric %s", metric, - ) - } - for _, q := range metric.Summary.Quantile { - n, err = writeSample( - name, metric, - model.QuantileLabel, fmt.Sprint(q.GetQuantile()), - q.GetValue(), - out, - ) - written += n - if err != nil { - return written, err - } - } - n, err = writeSample( - name+"_sum", metric, "", "", - metric.Summary.GetSampleSum(), - out, - ) - if err != nil { - return written, err - } - written += n - n, err = writeSample( - name+"_count", metric, "", "", - float64(metric.Summary.GetSampleCount()), - out, - ) - case dto.MetricType_HISTOGRAM: - if metric.Histogram == nil { - return written, fmt.Errorf( - "expected summary in metric %s", metric, - ) - } - infSeen := false - for _, q := range metric.Histogram.Bucket { - n, err = writeSample( - name+"_bucket", metric, - model.BucketLabel, fmt.Sprint(q.GetUpperBound()), - float64(q.GetCumulativeCount()), - out, - ) - written += n - if err != nil { - return written, err - } - if math.IsInf(q.GetUpperBound(), +1) { - infSeen = true - } - } - if !infSeen { - n, err = writeSample( - name+"_bucket", metric, - model.BucketLabel, "+Inf", - float64(metric.Histogram.GetSampleCount()), - out, - ) - if err != nil { - return written, err - } - written += n - } - n, err = writeSample( - name+"_sum", metric, "", "", - metric.Histogram.GetSampleSum(), - out, - ) - if err != nil { - return written, err - } - written += n - n, err = writeSample( - name+"_count", metric, "", "", - float64(metric.Histogram.GetSampleCount()), - out, - ) - default: - return written, fmt.Errorf( - "unexpected type in metric %s", metric, - ) - } - written += n - if err != nil { - return written, err - } - } - return written, nil -} - -// writeSample writes a single sample in text format to out, given the metric -// name, the metric proto message itself, optionally an additional label name -// and value (use empty strings if not required), and the value. The function -// returns the number of bytes written and any error encountered. -func writeSample( - name string, - metric *dto.Metric, - additionalLabelName, additionalLabelValue string, - value float64, - out io.Writer, -) (int, error) { - var written int - n, err := fmt.Fprint(out, name) - written += n - if err != nil { - return written, err - } - n, err = labelPairsToText( - metric.Label, - additionalLabelName, additionalLabelValue, - out, - ) - written += n - if err != nil { - return written, err - } - n, err = fmt.Fprintf(out, " %v", value) - written += n - if err != nil { - return written, err - } - if metric.TimestampMs != nil { - n, err = fmt.Fprintf(out, " %v", *metric.TimestampMs) - written += n - if err != nil { - return written, err - } - } - n, err = out.Write([]byte{'\n'}) - written += n - if err != nil { - return written, err - } - return written, nil -} - -// labelPairsToText converts a slice of LabelPair proto messages plus the -// explicitly given additional label pair into text formatted as required by the -// text format and writes it to 'out'. An empty slice in combination with an -// empty string 'additionalLabelName' results in nothing being -// written. Otherwise, the label pairs are written, escaped as required by the -// text format, and enclosed in '{...}'. The function returns the number of -// bytes written and any error encountered. -func labelPairsToText( - in []*dto.LabelPair, - additionalLabelName, additionalLabelValue string, - out io.Writer, -) (int, error) { - if len(in) == 0 && additionalLabelName == "" { - return 0, nil - } - var written int - separator := '{' - for _, lp := range in { - n, err := fmt.Fprintf( - out, `%c%s="%s"`, - separator, lp.GetName(), escapeString(lp.GetValue(), true), - ) - written += n - if err != nil { - return written, err - } - separator = ',' - } - if additionalLabelName != "" { - n, err := fmt.Fprintf( - out, `%c%s="%s"`, - separator, additionalLabelName, - escapeString(additionalLabelValue, true), - ) - written += n - if err != nil { - return written, err - } - } - n, err := out.Write([]byte{'}'}) - written += n - if err != nil { - return written, err - } - return written, nil -} - -// escapeString replaces '\' by '\\', new line character by '\n', and - if -// includeDoubleQuote is true - '"' by '\"'. -func escapeString(v string, includeDoubleQuote bool) string { - result := bytes.NewBuffer(make([]byte, 0, len(v))) - for _, c := range v { - switch { - case c == '\\': - result.WriteString(`\\`) - case includeDoubleQuote && c == '"': - result.WriteString(`\"`) - case c == '\n': - result.WriteString(`\n`) - default: - result.WriteRune(c) - } - } - return result.String() -} diff --git a/Godeps/_workspace/src/github.com/prometheus/client_golang/text/create_test.go b/Godeps/_workspace/src/github.com/prometheus/client_golang/text/create_test.go deleted file mode 100644 index fe938de80c79..000000000000 --- a/Godeps/_workspace/src/github.com/prometheus/client_golang/text/create_test.go +++ /dev/null @@ -1,439 +0,0 @@ -// Copyright 2014 The Prometheus 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 text - -import ( - "bytes" - "math" - "strings" - "testing" - - "github.com/golang/protobuf/proto" - dto "github.com/prometheus/client_model/go" -) - -func testCreate(t testing.TB) { - var scenarios = []struct { - in *dto.MetricFamily - out string - }{ - // 0: Counter, NaN as value, timestamp given. - { - in: &dto.MetricFamily{ - Name: proto.String("name"), - Help: proto.String("two-line\n doc str\\ing"), - Type: dto.MetricType_COUNTER.Enum(), - Metric: []*dto.Metric{ - &dto.Metric{ - Label: []*dto.LabelPair{ - &dto.LabelPair{ - Name: proto.String("labelname"), - Value: proto.String("val1"), - }, - &dto.LabelPair{ - Name: proto.String("basename"), - Value: proto.String("basevalue"), - }, - }, - Counter: &dto.Counter{ - Value: proto.Float64(math.NaN()), - }, - }, - &dto.Metric{ - Label: []*dto.LabelPair{ - &dto.LabelPair{ - Name: proto.String("labelname"), - Value: proto.String("val2"), - }, - &dto.LabelPair{ - Name: proto.String("basename"), - Value: proto.String("basevalue"), - }, - }, - Counter: &dto.Counter{ - Value: proto.Float64(.23), - }, - TimestampMs: proto.Int64(1234567890), - }, - }, - }, - out: `# HELP name two-line\n doc str\\ing -# TYPE name counter -name{labelname="val1",basename="basevalue"} NaN -name{labelname="val2",basename="basevalue"} 0.23 1234567890 -`, - }, - // 1: Gauge, some escaping required, +Inf as value, multi-byte characters in label values. - { - in: &dto.MetricFamily{ - Name: proto.String("gauge_name"), - Help: proto.String("gauge\ndoc\nstr\"ing"), - Type: dto.MetricType_GAUGE.Enum(), - Metric: []*dto.Metric{ - &dto.Metric{ - Label: []*dto.LabelPair{ - &dto.LabelPair{ - Name: proto.String("name_1"), - Value: proto.String("val with\nnew line"), - }, - &dto.LabelPair{ - Name: proto.String("name_2"), - Value: proto.String("val with \\backslash and \"quotes\""), - }, - }, - Gauge: &dto.Gauge{ - Value: proto.Float64(math.Inf(+1)), - }, - }, - &dto.Metric{ - Label: []*dto.LabelPair{ - &dto.LabelPair{ - Name: proto.String("name_1"), - Value: proto.String("Björn"), - }, - &dto.LabelPair{ - Name: proto.String("name_2"), - Value: proto.String("佖佥"), - }, - }, - Gauge: &dto.Gauge{ - Value: proto.Float64(3.14E42), - }, - }, - }, - }, - out: `# HELP gauge_name gauge\ndoc\nstr"ing -# TYPE gauge_name gauge -gauge_name{name_1="val with\nnew line",name_2="val with \\backslash and \"quotes\""} +Inf -gauge_name{name_1="Björn",name_2="佖佥"} 3.14e+42 -`, - }, - // 2: Untyped, no help, one sample with no labels and -Inf as value, another sample with one label. - { - in: &dto.MetricFamily{ - Name: proto.String("untyped_name"), - Type: dto.MetricType_UNTYPED.Enum(), - Metric: []*dto.Metric{ - &dto.Metric{ - Untyped: &dto.Untyped{ - Value: proto.Float64(math.Inf(-1)), - }, - }, - &dto.Metric{ - Label: []*dto.LabelPair{ - &dto.LabelPair{ - Name: proto.String("name_1"), - Value: proto.String("value 1"), - }, - }, - Untyped: &dto.Untyped{ - Value: proto.Float64(-1.23e-45), - }, - }, - }, - }, - out: `# TYPE untyped_name untyped -untyped_name -Inf -untyped_name{name_1="value 1"} -1.23e-45 -`, - }, - // 3: Summary. - { - in: &dto.MetricFamily{ - Name: proto.String("summary_name"), - Help: proto.String("summary docstring"), - Type: dto.MetricType_SUMMARY.Enum(), - Metric: []*dto.Metric{ - &dto.Metric{ - Summary: &dto.Summary{ - SampleCount: proto.Uint64(42), - SampleSum: proto.Float64(-3.4567), - Quantile: []*dto.Quantile{ - &dto.Quantile{ - Quantile: proto.Float64(0.5), - Value: proto.Float64(-1.23), - }, - &dto.Quantile{ - Quantile: proto.Float64(0.9), - Value: proto.Float64(.2342354), - }, - &dto.Quantile{ - Quantile: proto.Float64(0.99), - Value: proto.Float64(0), - }, - }, - }, - }, - &dto.Metric{ - Label: []*dto.LabelPair{ - &dto.LabelPair{ - Name: proto.String("name_1"), - Value: proto.String("value 1"), - }, - &dto.LabelPair{ - Name: proto.String("name_2"), - Value: proto.String("value 2"), - }, - }, - Summary: &dto.Summary{ - SampleCount: proto.Uint64(4711), - SampleSum: proto.Float64(2010.1971), - Quantile: []*dto.Quantile{ - &dto.Quantile{ - Quantile: proto.Float64(0.5), - Value: proto.Float64(1), - }, - &dto.Quantile{ - Quantile: proto.Float64(0.9), - Value: proto.Float64(2), - }, - &dto.Quantile{ - Quantile: proto.Float64(0.99), - Value: proto.Float64(3), - }, - }, - }, - }, - }, - }, - out: `# HELP summary_name summary docstring -# TYPE summary_name summary -summary_name{quantile="0.5"} -1.23 -summary_name{quantile="0.9"} 0.2342354 -summary_name{quantile="0.99"} 0 -summary_name_sum -3.4567 -summary_name_count 42 -summary_name{name_1="value 1",name_2="value 2",quantile="0.5"} 1 -summary_name{name_1="value 1",name_2="value 2",quantile="0.9"} 2 -summary_name{name_1="value 1",name_2="value 2",quantile="0.99"} 3 -summary_name_sum{name_1="value 1",name_2="value 2"} 2010.1971 -summary_name_count{name_1="value 1",name_2="value 2"} 4711 -`, - }, - // 4: Histogram - { - in: &dto.MetricFamily{ - Name: proto.String("request_duration_microseconds"), - Help: proto.String("The response latency."), - Type: dto.MetricType_HISTOGRAM.Enum(), - Metric: []*dto.Metric{ - &dto.Metric{ - Histogram: &dto.Histogram{ - SampleCount: proto.Uint64(2693), - SampleSum: proto.Float64(1756047.3), - Bucket: []*dto.Bucket{ - &dto.Bucket{ - UpperBound: proto.Float64(100), - CumulativeCount: proto.Uint64(123), - }, - &dto.Bucket{ - UpperBound: proto.Float64(120), - CumulativeCount: proto.Uint64(412), - }, - &dto.Bucket{ - UpperBound: proto.Float64(144), - CumulativeCount: proto.Uint64(592), - }, - &dto.Bucket{ - UpperBound: proto.Float64(172.8), - CumulativeCount: proto.Uint64(1524), - }, - &dto.Bucket{ - UpperBound: proto.Float64(math.Inf(+1)), - CumulativeCount: proto.Uint64(2693), - }, - }, - }, - }, - }, - }, - out: `# 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 -`, - }, - // 5: Histogram with missing +Inf bucket. - { - in: &dto.MetricFamily{ - Name: proto.String("request_duration_microseconds"), - Help: proto.String("The response latency."), - Type: dto.MetricType_HISTOGRAM.Enum(), - Metric: []*dto.Metric{ - &dto.Metric{ - Histogram: &dto.Histogram{ - SampleCount: proto.Uint64(2693), - SampleSum: proto.Float64(1756047.3), - Bucket: []*dto.Bucket{ - &dto.Bucket{ - UpperBound: proto.Float64(100), - CumulativeCount: proto.Uint64(123), - }, - &dto.Bucket{ - UpperBound: proto.Float64(120), - CumulativeCount: proto.Uint64(412), - }, - &dto.Bucket{ - UpperBound: proto.Float64(144), - CumulativeCount: proto.Uint64(592), - }, - &dto.Bucket{ - UpperBound: proto.Float64(172.8), - CumulativeCount: proto.Uint64(1524), - }, - }, - }, - }, - }, - }, - out: `# 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 -`, - }, - } - - for i, scenario := range scenarios { - out := bytes.NewBuffer(make([]byte, 0, len(scenario.out))) - n, err := MetricFamilyToText(out, scenario.in) - if err != nil { - t.Errorf("%d. error: %s", i, err) - continue - } - if expected, got := len(scenario.out), n; expected != got { - t.Errorf( - "%d. expected %d bytes written, got %d", - i, expected, got, - ) - } - if expected, got := scenario.out, out.String(); expected != got { - t.Errorf( - "%d. expected out=%q, got %q", - i, expected, got, - ) - } - } - -} - -func TestCreate(t *testing.T) { - testCreate(t) -} - -func BenchmarkCreate(b *testing.B) { - for i := 0; i < b.N; i++ { - testCreate(b) - } -} - -func testCreateError(t testing.TB) { - var scenarios = []struct { - in *dto.MetricFamily - err string - }{ - // 0: No metric. - { - in: &dto.MetricFamily{ - Name: proto.String("name"), - Help: proto.String("doc string"), - Type: dto.MetricType_COUNTER.Enum(), - Metric: []*dto.Metric{}, - }, - err: "MetricFamily has no metrics", - }, - // 1: No metric name. - { - in: &dto.MetricFamily{ - Help: proto.String("doc string"), - Type: dto.MetricType_UNTYPED.Enum(), - Metric: []*dto.Metric{ - &dto.Metric{ - Untyped: &dto.Untyped{ - Value: proto.Float64(math.Inf(-1)), - }, - }, - }, - }, - err: "MetricFamily has no name", - }, - // 2: No metric type. - { - in: &dto.MetricFamily{ - Name: proto.String("name"), - Help: proto.String("doc string"), - Metric: []*dto.Metric{ - &dto.Metric{ - Untyped: &dto.Untyped{ - Value: proto.Float64(math.Inf(-1)), - }, - }, - }, - }, - err: "MetricFamily has no type", - }, - // 3: Wrong type. - { - in: &dto.MetricFamily{ - Name: proto.String("name"), - Help: proto.String("doc string"), - Type: dto.MetricType_COUNTER.Enum(), - Metric: []*dto.Metric{ - &dto.Metric{ - Untyped: &dto.Untyped{ - Value: proto.Float64(math.Inf(-1)), - }, - }, - }, - }, - err: "expected counter in metric", - }, - } - - for i, scenario := range scenarios { - var out bytes.Buffer - _, err := MetricFamilyToText(&out, scenario.in) - if err == nil { - t.Errorf("%d. expected error, got nil", i) - continue - } - if expected, got := scenario.err, err.Error(); strings.Index(got, expected) != 0 { - t.Errorf( - "%d. expected error starting with %q, got %q", - i, expected, got, - ) - } - } - -} - -func TestCreateError(t *testing.T) { - testCreateError(t) -} - -func BenchmarkCreateError(b *testing.B) { - for i := 0; i < b.N; i++ { - testCreateError(b) - } -} diff --git a/Godeps/_workspace/src/github.com/prometheus/client_golang/text/parse.go b/Godeps/_workspace/src/github.com/prometheus/client_golang/text/parse.go deleted file mode 100644 index e317d6850be9..000000000000 --- a/Godeps/_workspace/src/github.com/prometheus/client_golang/text/parse.go +++ /dev/null @@ -1,739 +0,0 @@ -// Copyright 2014 The Prometheus 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 text - -import ( - "bufio" - "bytes" - "fmt" - "io" - "math" - "strconv" - "strings" - - dto "github.com/prometheus/client_model/go" - - "github.com/golang/protobuf/proto" - "github.com/prometheus/client_golang/model" -) - -// A stateFn is a function that represents a state in a state machine. By -// executing it, the state is progressed to the next state. The stateFn returns -// another stateFn, which represents the new state. The end state is represented -// by nil. -type stateFn func() stateFn - -// ParseError signals errors while parsing the simple and flat text-based -// exchange format. -type ParseError struct { - Line int - Msg string -} - -// Error implements the error interface. -func (e ParseError) Error() string { - return fmt.Sprintf("text format parsing error in line %d: %s", e.Line, e.Msg) -} - -// Parser is used to parse the simple and flat text-based exchange format. Its -// nil value is ready to use. -type Parser struct { - metricFamiliesByName map[string]*dto.MetricFamily - buf *bufio.Reader // Where the parsed input is read through. - err error // Most recent error. - lineCount int // Tracks the line count for error messages. - currentByte byte // The most recent byte read. - currentToken bytes.Buffer // Re-used each time a token has to be gathered from multiple bytes. - currentMF *dto.MetricFamily - currentMetric *dto.Metric - currentLabelPair *dto.LabelPair - - // The remaining member variables are only used for summaries/histograms. - currentLabels map[string]string // All labels including '__name__' but excluding 'quantile'/'le' - // Summary specific. - summaries map[uint64]*dto.Metric // Key is created with LabelsToSignature. - currentQuantile float64 - // Histogram specific. - histograms map[uint64]*dto.Metric // Key is created with LabelsToSignature. - currentBucket float64 - // These tell us if the currently processed line ends on '_count' or - // '_sum' respectively and belong to a summary/histogram, representing the sample - // count and sum of that summary/histogram. - currentIsSummaryCount, currentIsSummarySum bool - currentIsHistogramCount, currentIsHistogramSum bool -} - -// TextToMetricFamilies reads 'in' as the simple and flat text-based exchange -// format and creates MetricFamily proto messages. It returns the MetricFamily -// proto messages in a map where the metric names are the keys, along with any -// error encountered. -// -// If the input contains duplicate metrics (i.e. lines with the same metric name -// and exactly the same label set), the resulting MetricFamily will contain -// duplicate Metric proto messages. Similar is true for duplicate label -// names. Checks for duplicates have to be performed separately, if required. -// -// Summaries are a rather special beast. You would probably not use them in the -// simple text format anyway. This method can deal with summaries if they are -// presented in exactly the way the text.Create function creates them. -// -// This method must not be called concurrently. If you want to parse different -// input concurrently, instantiate a separate Parser for each goroutine. -func (p *Parser) TextToMetricFamilies(in io.Reader) (map[string]*dto.MetricFamily, error) { - p.reset(in) - for nextState := p.startOfLine; nextState != nil; nextState = nextState() { - // Magic happens here... - } - // Get rid of empty metric families. - for k, mf := range p.metricFamiliesByName { - if len(mf.GetMetric()) == 0 { - delete(p.metricFamiliesByName, k) - } - } - return p.metricFamiliesByName, p.err -} - -func (p *Parser) reset(in io.Reader) { - p.metricFamiliesByName = map[string]*dto.MetricFamily{} - if p.buf == nil { - p.buf = bufio.NewReader(in) - } else { - p.buf.Reset(in) - } - p.err = nil - p.lineCount = 0 - if p.summaries == nil || len(p.summaries) > 0 { - p.summaries = map[uint64]*dto.Metric{} - } - if p.histograms == nil || len(p.histograms) > 0 { - p.histograms = map[uint64]*dto.Metric{} - } - p.currentQuantile = math.NaN() - p.currentBucket = math.NaN() -} - -// startOfLine represents the state where the next byte read from p.buf is the -// start of a line (or whitespace leading up to it). -func (p *Parser) startOfLine() stateFn { - p.lineCount++ - if p.skipBlankTab(); p.err != nil { - // End of input reached. This is the only case where - // that is not an error but a signal that we are done. - p.err = nil - return nil - } - switch p.currentByte { - case '#': - return p.startComment - case '\n': - return p.startOfLine // Empty line, start the next one. - } - return p.readingMetricName -} - -// startComment represents the state where the next byte read from p.buf is the -// start of a comment (or whitespace leading up to it). -func (p *Parser) startComment() stateFn { - if p.skipBlankTab(); p.err != nil { - return nil // Unexpected end of input. - } - if p.currentByte == '\n' { - return p.startOfLine - } - if p.readTokenUntilWhitespace(); p.err != nil { - return nil // Unexpected end of input. - } - // If we have hit the end of line already, there is nothing left - // to do. This is not considered a syntax error. - if p.currentByte == '\n' { - return p.startOfLine - } - keyword := p.currentToken.String() - if keyword != "HELP" && keyword != "TYPE" { - // Generic comment, ignore by fast forwarding to end of line. - for p.currentByte != '\n' { - if p.currentByte, p.err = p.buf.ReadByte(); p.err != nil { - return nil // Unexpected end of input. - } - } - return p.startOfLine - } - // There is something. Next has to be a metric name. - if p.skipBlankTab(); p.err != nil { - return nil // Unexpected end of input. - } - if p.readTokenAsMetricName(); p.err != nil { - return nil // Unexpected end of input. - } - if p.currentByte == '\n' { - // At the end of the line already. - // Again, this is not considered a syntax error. - return p.startOfLine - } - if !isBlankOrTab(p.currentByte) { - p.parseError("invalid metric name in comment") - return nil - } - p.setOrCreateCurrentMF() - if p.skipBlankTab(); p.err != nil { - return nil // Unexpected end of input. - } - if p.currentByte == '\n' { - // At the end of the line already. - // Again, this is not considered a syntax error. - return p.startOfLine - } - switch keyword { - case "HELP": - return p.readingHelp - case "TYPE": - return p.readingType - } - panic(fmt.Sprintf("code error: unexpected keyword %q", keyword)) -} - -// readingMetricName represents the state where the last byte read (now in -// p.currentByte) is the first byte of a metric name. -func (p *Parser) readingMetricName() stateFn { - if p.readTokenAsMetricName(); p.err != nil { - return nil - } - if p.currentToken.Len() == 0 { - p.parseError("invalid metric name") - return nil - } - p.setOrCreateCurrentMF() - // Now is the time to fix the type if it hasn't happened yet. - if p.currentMF.Type == nil { - p.currentMF.Type = dto.MetricType_UNTYPED.Enum() - } - p.currentMetric = &dto.Metric{} - // Do not append the newly created currentMetric to - // currentMF.Metric right now. First wait if this is a summary, - // and the metric exists already, which we can only know after - // having read all the labels. - if p.skipBlankTabIfCurrentBlankTab(); p.err != nil { - return nil // Unexpected end of input. - } - return p.readingLabels -} - -// readingLabels represents the state where the last byte read (now in -// p.currentByte) is either the first byte of the label set (i.e. a '{'), or the -// first byte of the value (otherwise). -func (p *Parser) readingLabels() stateFn { - // Summaries/histograms are special. We have to reset the - // currentLabels map, currentQuantile and currentBucket before starting to - // read labels. - if p.currentMF.GetType() == dto.MetricType_SUMMARY || p.currentMF.GetType() == dto.MetricType_HISTOGRAM { - p.currentLabels = map[string]string{} - p.currentLabels[string(model.MetricNameLabel)] = p.currentMF.GetName() - p.currentQuantile = math.NaN() - p.currentBucket = math.NaN() - } - if p.currentByte != '{' { - return p.readingValue - } - return p.startLabelName -} - -// startLabelName represents the state where the next byte read from p.buf is -// the start of a label name (or whitespace leading up to it). -func (p *Parser) startLabelName() stateFn { - if p.skipBlankTab(); p.err != nil { - return nil // Unexpected end of input. - } - if p.currentByte == '}' { - if p.skipBlankTab(); p.err != nil { - return nil // Unexpected end of input. - } - return p.readingValue - } - if p.readTokenAsLabelName(); p.err != nil { - return nil // Unexpected end of input. - } - if p.currentToken.Len() == 0 { - p.parseError(fmt.Sprintf("invalid label name for metric %q", p.currentMF.GetName())) - return nil - } - p.currentLabelPair = &dto.LabelPair{Name: proto.String(p.currentToken.String())} - if p.currentLabelPair.GetName() == string(model.MetricNameLabel) { - p.parseError(fmt.Sprintf("label name %q is reserved", model.MetricNameLabel)) - return nil - } - // Special summary/histogram treatment. Don't add 'quantile' and 'le' - // labels to 'real' labels. - if !(p.currentMF.GetType() == dto.MetricType_SUMMARY && p.currentLabelPair.GetName() == model.QuantileLabel) && - !(p.currentMF.GetType() == dto.MetricType_HISTOGRAM && p.currentLabelPair.GetName() == model.BucketLabel) { - p.currentMetric.Label = append(p.currentMetric.Label, p.currentLabelPair) - } - if p.skipBlankTabIfCurrentBlankTab(); p.err != nil { - return nil // Unexpected end of input. - } - if p.currentByte != '=' { - p.parseError(fmt.Sprintf("expected '=' after label name, found %q", p.currentByte)) - return nil - } - return p.startLabelValue -} - -// startLabelValue represents the state where the next byte read from p.buf is -// the start of a (quoted) label value (or whitespace leading up to it). -func (p *Parser) startLabelValue() stateFn { - if p.skipBlankTab(); p.err != nil { - return nil // Unexpected end of input. - } - if p.currentByte != '"' { - p.parseError(fmt.Sprintf("expected '\"' at start of label value, found %q", p.currentByte)) - return nil - } - if p.readTokenAsLabelValue(); p.err != nil { - return nil - } - p.currentLabelPair.Value = proto.String(p.currentToken.String()) - // Special treatment of summaries: - // - Quantile labels are special, will result in dto.Quantile later. - // - Other labels have to be added to currentLabels for signature calculation. - if p.currentMF.GetType() == dto.MetricType_SUMMARY { - if p.currentLabelPair.GetName() == model.QuantileLabel { - if p.currentQuantile, p.err = strconv.ParseFloat(p.currentLabelPair.GetValue(), 64); p.err != nil { - // Create a more helpful error message. - p.parseError(fmt.Sprintf("expected float as value for 'quantile' label, got %q", p.currentLabelPair.GetValue())) - return nil - } - } else { - p.currentLabels[p.currentLabelPair.GetName()] = p.currentLabelPair.GetValue() - } - } - // Similar special treatment of histograms. - if p.currentMF.GetType() == dto.MetricType_HISTOGRAM { - if p.currentLabelPair.GetName() == model.BucketLabel { - if p.currentBucket, p.err = strconv.ParseFloat(p.currentLabelPair.GetValue(), 64); p.err != nil { - // Create a more helpful error message. - p.parseError(fmt.Sprintf("expected float as value for 'le' label, got %q", p.currentLabelPair.GetValue())) - return nil - } - } else { - p.currentLabels[p.currentLabelPair.GetName()] = p.currentLabelPair.GetValue() - } - } - if p.skipBlankTab(); p.err != nil { - return nil // Unexpected end of input. - } - switch p.currentByte { - case ',': - return p.startLabelName - - case '}': - if p.skipBlankTab(); p.err != nil { - return nil // Unexpected end of input. - } - return p.readingValue - default: - p.parseError(fmt.Sprintf("unexpected end of label value %q", p.currentLabelPair.Value)) - return nil - } -} - -// readingValue represents the state where the last byte read (now in -// p.currentByte) is the first byte of the sample value (i.e. a float). -func (p *Parser) readingValue() stateFn { - // When we are here, we have read all the labels, so for the - // special case of a summary/histogram, we can finally find out - // if the metric already exists. - if p.currentMF.GetType() == dto.MetricType_SUMMARY { - signature := model.LabelsToSignature(p.currentLabels) - if summary := p.summaries[signature]; summary != nil { - p.currentMetric = summary - } else { - p.summaries[signature] = p.currentMetric - p.currentMF.Metric = append(p.currentMF.Metric, p.currentMetric) - } - } else if p.currentMF.GetType() == dto.MetricType_HISTOGRAM { - signature := model.LabelsToSignature(p.currentLabels) - if histogram := p.histograms[signature]; histogram != nil { - p.currentMetric = histogram - } else { - p.histograms[signature] = p.currentMetric - p.currentMF.Metric = append(p.currentMF.Metric, p.currentMetric) - } - } else { - p.currentMF.Metric = append(p.currentMF.Metric, p.currentMetric) - } - if p.readTokenUntilWhitespace(); p.err != nil { - return nil // Unexpected end of input. - } - value, err := strconv.ParseFloat(p.currentToken.String(), 64) - if err != nil { - // Create a more helpful error message. - p.parseError(fmt.Sprintf("expected float as value, got %q", p.currentToken.String())) - return nil - } - switch p.currentMF.GetType() { - case dto.MetricType_COUNTER: - p.currentMetric.Counter = &dto.Counter{Value: proto.Float64(value)} - case dto.MetricType_GAUGE: - p.currentMetric.Gauge = &dto.Gauge{Value: proto.Float64(value)} - case dto.MetricType_UNTYPED: - p.currentMetric.Untyped = &dto.Untyped{Value: proto.Float64(value)} - case dto.MetricType_SUMMARY: - // *sigh* - if p.currentMetric.Summary == nil { - p.currentMetric.Summary = &dto.Summary{} - } - switch { - case p.currentIsSummaryCount: - p.currentMetric.Summary.SampleCount = proto.Uint64(uint64(value)) - case p.currentIsSummarySum: - p.currentMetric.Summary.SampleSum = proto.Float64(value) - case !math.IsNaN(p.currentQuantile): - p.currentMetric.Summary.Quantile = append( - p.currentMetric.Summary.Quantile, - &dto.Quantile{ - Quantile: proto.Float64(p.currentQuantile), - Value: proto.Float64(value), - }, - ) - } - case dto.MetricType_HISTOGRAM: - // *sigh* - if p.currentMetric.Histogram == nil { - p.currentMetric.Histogram = &dto.Histogram{} - } - switch { - case p.currentIsHistogramCount: - p.currentMetric.Histogram.SampleCount = proto.Uint64(uint64(value)) - case p.currentIsHistogramSum: - p.currentMetric.Histogram.SampleSum = proto.Float64(value) - case !math.IsNaN(p.currentBucket): - p.currentMetric.Histogram.Bucket = append( - p.currentMetric.Histogram.Bucket, - &dto.Bucket{ - UpperBound: proto.Float64(p.currentBucket), - CumulativeCount: proto.Uint64(uint64(value)), - }, - ) - } - default: - p.err = fmt.Errorf("unexpected type for metric name %q", p.currentMF.GetName()) - } - if p.currentByte == '\n' { - return p.startOfLine - } - return p.startTimestamp -} - -// startTimestamp represents the state where the next byte read from p.buf is -// the start of the timestamp (or whitespace leading up to it). -func (p *Parser) startTimestamp() stateFn { - if p.skipBlankTab(); p.err != nil { - return nil // Unexpected end of input. - } - if p.readTokenUntilWhitespace(); p.err != nil { - return nil // Unexpected end of input. - } - timestamp, err := strconv.ParseInt(p.currentToken.String(), 10, 64) - if err != nil { - // Create a more helpful error message. - p.parseError(fmt.Sprintf("expected integer as timestamp, got %q", p.currentToken.String())) - return nil - } - p.currentMetric.TimestampMs = proto.Int64(timestamp) - if p.readTokenUntilNewline(false); p.err != nil { - return nil // Unexpected end of input. - } - if p.currentToken.Len() > 0 { - p.parseError(fmt.Sprintf("spurious string after timestamp: %q", p.currentToken.String())) - return nil - } - return p.startOfLine -} - -// readingHelp represents the state where the last byte read (now in -// p.currentByte) is the first byte of the docstring after 'HELP'. -func (p *Parser) readingHelp() stateFn { - if p.currentMF.Help != nil { - p.parseError(fmt.Sprintf("second HELP line for metric name %q", p.currentMF.GetName())) - return nil - } - // Rest of line is the docstring. - if p.readTokenUntilNewline(true); p.err != nil { - return nil // Unexpected end of input. - } - p.currentMF.Help = proto.String(p.currentToken.String()) - return p.startOfLine -} - -// readingType represents the state where the last byte read (now in -// p.currentByte) is the first byte of the type hint after 'HELP'. -func (p *Parser) readingType() stateFn { - if p.currentMF.Type != nil { - p.parseError(fmt.Sprintf("second TYPE line for metric name %q, or TYPE reported after samples", p.currentMF.GetName())) - return nil - } - // Rest of line is the type. - if p.readTokenUntilNewline(false); p.err != nil { - return nil // Unexpected end of input. - } - metricType, ok := dto.MetricType_value[strings.ToUpper(p.currentToken.String())] - if !ok { - p.parseError(fmt.Sprintf("unknown metric type %q", p.currentToken.String())) - return nil - } - p.currentMF.Type = dto.MetricType(metricType).Enum() - return p.startOfLine -} - -// parseError sets p.err to a ParseError at the current line with the given -// message. -func (p *Parser) parseError(msg string) { - p.err = ParseError{ - Line: p.lineCount, - Msg: msg, - } -} - -// skipBlankTab reads (and discards) bytes from p.buf until it encounters a byte -// that is neither ' ' nor '\t'. That byte is left in p.currentByte. -func (p *Parser) skipBlankTab() { - for { - if p.currentByte, p.err = p.buf.ReadByte(); p.err != nil || !isBlankOrTab(p.currentByte) { - return - } - } -} - -// skipBlankTabIfCurrentBlankTab works exactly as skipBlankTab but doesn't do -// anything if p.currentByte is neither ' ' nor '\t'. -func (p *Parser) skipBlankTabIfCurrentBlankTab() { - if isBlankOrTab(p.currentByte) { - p.skipBlankTab() - } -} - -// readTokenUntilWhitespace copies bytes from p.buf into p.currentToken. The -// first byte considered is the byte already read (now in p.currentByte). The -// first whitespace byte encountered is still copied into p.currentByte, but not -// into p.currentToken. -func (p *Parser) readTokenUntilWhitespace() { - p.currentToken.Reset() - for p.err == nil && !isBlankOrTab(p.currentByte) && p.currentByte != '\n' { - p.currentToken.WriteByte(p.currentByte) - p.currentByte, p.err = p.buf.ReadByte() - } -} - -// readTokenUntilNewline copies bytes from p.buf into p.currentToken. The first -// byte considered is the byte already read (now in p.currentByte). The first -// newline byte encountered is still copied into p.currentByte, but not into -// p.currentToken. If recognizeEscapeSequence is true, two escape sequences are -// recognized: '\\' tranlates into '\', and '\n' into a line-feed character. All -// other escape sequences are invalid and cause an error. -func (p *Parser) readTokenUntilNewline(recognizeEscapeSequence bool) { - p.currentToken.Reset() - escaped := false - for p.err == nil { - if recognizeEscapeSequence && escaped { - switch p.currentByte { - case '\\': - p.currentToken.WriteByte(p.currentByte) - case 'n': - p.currentToken.WriteByte('\n') - default: - p.parseError(fmt.Sprintf("invalid escape sequence '\\%c'", p.currentByte)) - return - } - escaped = false - } else { - switch p.currentByte { - case '\n': - return - case '\\': - escaped = true - default: - p.currentToken.WriteByte(p.currentByte) - } - } - p.currentByte, p.err = p.buf.ReadByte() - } -} - -// readTokenAsMetricName copies a metric name from p.buf into p.currentToken. -// The first byte considered is the byte already read (now in p.currentByte). -// The first byte not part of a metric name is still copied into p.currentByte, -// but not into p.currentToken. -func (p *Parser) readTokenAsMetricName() { - p.currentToken.Reset() - if !isValidMetricNameStart(p.currentByte) { - return - } - for { - p.currentToken.WriteByte(p.currentByte) - p.currentByte, p.err = p.buf.ReadByte() - if p.err != nil || !isValidMetricNameContinuation(p.currentByte) { - return - } - } -} - -// readTokenAsLabelName copies a label name from p.buf into p.currentToken. -// The first byte considered is the byte already read (now in p.currentByte). -// The first byte not part of a label name is still copied into p.currentByte, -// but not into p.currentToken. -func (p *Parser) readTokenAsLabelName() { - p.currentToken.Reset() - if !isValidLabelNameStart(p.currentByte) { - return - } - for { - p.currentToken.WriteByte(p.currentByte) - p.currentByte, p.err = p.buf.ReadByte() - if p.err != nil || !isValidLabelNameContinuation(p.currentByte) { - return - } - } -} - -// readTokenAsLabelValue copies a label value from p.buf into p.currentToken. -// In contrast to the other 'readTokenAs...' functions, which start with the -// last read byte in p.currentByte, this method ignores p.currentByte and starts -// with reading a new byte from p.buf. The first byte not part of a label value -// is still copied into p.currentByte, but not into p.currentToken. -func (p *Parser) readTokenAsLabelValue() { - p.currentToken.Reset() - escaped := false - for { - if p.currentByte, p.err = p.buf.ReadByte(); p.err != nil { - return - } - if escaped { - switch p.currentByte { - case '"', '\\': - p.currentToken.WriteByte(p.currentByte) - case 'n': - p.currentToken.WriteByte('\n') - default: - p.parseError(fmt.Sprintf("invalid escape sequence '\\%c'", p.currentByte)) - return - } - escaped = false - continue - } - switch p.currentByte { - case '"': - return - case '\n': - p.parseError(fmt.Sprintf("label value %q contains unescaped new-line", p.currentToken.String())) - return - case '\\': - escaped = true - default: - p.currentToken.WriteByte(p.currentByte) - } - } -} - -func (p *Parser) setOrCreateCurrentMF() { - p.currentIsSummaryCount = false - p.currentIsSummarySum = false - p.currentIsHistogramCount = false - p.currentIsHistogramSum = false - name := p.currentToken.String() - if p.currentMF = p.metricFamiliesByName[name]; p.currentMF != nil { - return - } - // Try out if this is a _sum or _count for a summary/histogram. - summaryName := summaryMetricName(name) - if p.currentMF = p.metricFamiliesByName[summaryName]; p.currentMF != nil { - if p.currentMF.GetType() == dto.MetricType_SUMMARY { - if isCount(name) { - p.currentIsSummaryCount = true - } - if isSum(name) { - p.currentIsSummarySum = true - } - return - } - } - histogramName := histogramMetricName(name) - if p.currentMF = p.metricFamiliesByName[histogramName]; p.currentMF != nil { - if p.currentMF.GetType() == dto.MetricType_HISTOGRAM { - if isCount(name) { - p.currentIsHistogramCount = true - } - if isSum(name) { - p.currentIsHistogramSum = true - } - return - } - } - p.currentMF = &dto.MetricFamily{Name: proto.String(name)} - p.metricFamiliesByName[name] = p.currentMF -} - -func isValidLabelNameStart(b byte) bool { - return (b >= 'a' && b <= 'z') || (b >= 'A' && b <= 'Z') || b == '_' -} - -func isValidLabelNameContinuation(b byte) bool { - return isValidLabelNameStart(b) || (b >= '0' && b <= '9') -} - -func isValidMetricNameStart(b byte) bool { - return isValidLabelNameStart(b) || b == ':' -} - -func isValidMetricNameContinuation(b byte) bool { - return isValidLabelNameContinuation(b) || b == ':' -} - -func isBlankOrTab(b byte) bool { - return b == ' ' || b == '\t' -} - -func isCount(name string) bool { - return len(name) > 6 && name[len(name)-6:] == "_count" -} - -func isSum(name string) bool { - return len(name) > 4 && name[len(name)-4:] == "_sum" -} - -func isBucket(name string) bool { - return len(name) > 7 && name[len(name)-7:] == "_bucket" -} - -func summaryMetricName(name string) string { - switch { - case isCount(name): - return name[:len(name)-6] - case isSum(name): - return name[:len(name)-4] - default: - return name - } -} - -func histogramMetricName(name string) string { - switch { - case isCount(name): - return name[:len(name)-6] - case isSum(name): - return name[:len(name)-4] - case isBucket(name): - return name[:len(name)-7] - default: - return name - } -} diff --git a/Godeps/_workspace/src/github.com/prometheus/client_golang/text/parse_test.go b/Godeps/_workspace/src/github.com/prometheus/client_golang/text/parse_test.go deleted file mode 100644 index cc3e6470f0a3..000000000000 --- a/Godeps/_workspace/src/github.com/prometheus/client_golang/text/parse_test.go +++ /dev/null @@ -1,588 +0,0 @@ -// Copyright 2014 The Prometheus 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 text - -import ( - "math" - "strings" - "testing" - - "github.com/golang/protobuf/proto" - dto "github.com/prometheus/client_model/go" -) - -var parser Parser - -func testParse(t testing.TB) { - var scenarios = []struct { - in string - out []*dto.MetricFamily - }{ - // 0: Empty lines as input. - { - in: ` - -`, - out: []*dto.MetricFamily{}, - }, - // 1: Minimal case. - { - in: ` -minimal_metric 1.234 -another_metric -3e3 103948 -# Even that: -no_labels{} 3 -# HELP line for non-existing metric will be ignored. -`, - out: []*dto.MetricFamily{ - &dto.MetricFamily{ - Name: proto.String("minimal_metric"), - Type: dto.MetricType_UNTYPED.Enum(), - Metric: []*dto.Metric{ - &dto.Metric{ - Untyped: &dto.Untyped{ - Value: proto.Float64(1.234), - }, - }, - }, - }, - &dto.MetricFamily{ - Name: proto.String("another_metric"), - Type: dto.MetricType_UNTYPED.Enum(), - Metric: []*dto.Metric{ - &dto.Metric{ - Untyped: &dto.Untyped{ - Value: proto.Float64(-3e3), - }, - TimestampMs: proto.Int64(103948), - }, - }, - }, - &dto.MetricFamily{ - Name: proto.String("no_labels"), - Type: dto.MetricType_UNTYPED.Enum(), - Metric: []*dto.Metric{ - &dto.Metric{ - Untyped: &dto.Untyped{ - Value: proto.Float64(3), - }, - }, - }, - }, - }, - }, - // 2: Counters & gauges, docstrings, various whitespace, escape sequences. - { - in: ` -# 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 -`, - out: []*dto.MetricFamily{ - &dto.MetricFamily{ - Name: proto.String("name"), - Help: proto.String("two-line\n doc str\\ing"), - Type: dto.MetricType_COUNTER.Enum(), - Metric: []*dto.Metric{ - &dto.Metric{ - Label: []*dto.LabelPair{ - &dto.LabelPair{ - Name: proto.String("labelname"), - Value: proto.String("val1"), - }, - &dto.LabelPair{ - Name: proto.String("basename"), - Value: proto.String("basevalue"), - }, - }, - Counter: &dto.Counter{ - Value: proto.Float64(math.NaN()), - }, - }, - &dto.Metric{ - Label: []*dto.LabelPair{ - &dto.LabelPair{ - Name: proto.String("labelname"), - Value: proto.String("val2"), - }, - &dto.LabelPair{ - Name: proto.String("basename"), - Value: proto.String("base\"v\\al\nue"), - }, - }, - Counter: &dto.Counter{ - Value: proto.Float64(.23), - }, - TimestampMs: proto.Int64(1234567890), - }, - }, - }, - &dto.MetricFamily{ - Name: proto.String("name2"), - Help: proto.String("doc str\"ing 2"), - Type: dto.MetricType_GAUGE.Enum(), - Metric: []*dto.Metric{ - &dto.Metric{ - Label: []*dto.LabelPair{ - &dto.LabelPair{ - Name: proto.String("labelname"), - Value: proto.String("val2"), - }, - &dto.LabelPair{ - Name: proto.String("basename"), - Value: proto.String("basevalue2"), - }, - }, - Gauge: &dto.Gauge{ - Value: proto.Float64(math.Inf(+1)), - }, - TimestampMs: proto.Int64(54321), - }, - &dto.Metric{ - Label: []*dto.LabelPair{ - &dto.LabelPair{ - Name: proto.String("labelname"), - Value: proto.String("val1"), - }, - }, - Gauge: &dto.Gauge{ - Value: proto.Float64(math.Inf(-1)), - }, - }, - }, - }, - }, - }, - // 3: The evil summary, mixed with other types and funny comments. - { - in: ` -# 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 -`, - out: []*dto.MetricFamily{ - &dto.MetricFamily{ - Name: proto.String("fake_sum"), - Type: dto.MetricType_UNTYPED.Enum(), - Metric: []*dto.Metric{ - &dto.Metric{ - Label: []*dto.LabelPair{ - &dto.LabelPair{ - Name: proto.String("n1"), - Value: proto.String("val1"), - }, - }, - Untyped: &dto.Untyped{ - Value: proto.Float64(2001), - }, - }, - }, - }, - &dto.MetricFamily{ - Name: proto.String("decoy"), - Type: dto.MetricType_UNTYPED.Enum(), - Metric: []*dto.Metric{ - &dto.Metric{ - Untyped: &dto.Untyped{ - Value: proto.Float64(-1), - }, - TimestampMs: proto.Int64(-2), - }, - }, - }, - &dto.MetricFamily{ - Name: proto.String("my_summary"), - Type: dto.MetricType_SUMMARY.Enum(), - Metric: []*dto.Metric{ - &dto.Metric{ - Label: []*dto.LabelPair{ - &dto.LabelPair{ - Name: proto.String("n1"), - Value: proto.String("val1"), - }, - }, - Summary: &dto.Summary{ - SampleCount: proto.Uint64(42), - SampleSum: proto.Float64(4711), - Quantile: []*dto.Quantile{ - &dto.Quantile{ - Quantile: proto.Float64(0.5), - Value: proto.Float64(110), - }, - &dto.Quantile{ - Quantile: proto.Float64(0.9), - Value: proto.Float64(140), - }, - }, - }, - TimestampMs: proto.Int64(2), - }, - &dto.Metric{ - Label: []*dto.LabelPair{ - &dto.LabelPair{ - Name: proto.String("n2"), - Value: proto.String("val2"), - }, - &dto.LabelPair{ - Name: proto.String("n1"), - Value: proto.String("val1"), - }, - }, - Summary: &dto.Summary{ - SampleCount: proto.Uint64(5), - Quantile: []*dto.Quantile{ - &dto.Quantile{ - Quantile: proto.Float64(-12.34), - Value: proto.Float64(math.NaN()), - }, - }, - }, - TimestampMs: proto.Int64(5), - }, - &dto.Metric{ - Label: []*dto.LabelPair{ - &dto.LabelPair{ - Name: proto.String("n1"), - Value: proto.String("val2"), - }, - }, - Summary: &dto.Summary{ - SampleSum: proto.Float64(8), - }, - TimestampMs: proto.Int64(15), - }, - &dto.Metric{ - Label: []*dto.LabelPair{ - &dto.LabelPair{ - Name: proto.String("n1"), - Value: proto.String("val3"), - }, - }, - Summary: &dto.Summary{ - Quantile: []*dto.Quantile{ - &dto.Quantile{ - Quantile: proto.Float64(0.2), - Value: proto.Float64(4711), - }, - }, - }, - }, - }, - }, - &dto.MetricFamily{ - Name: proto.String("another_summary"), - Type: dto.MetricType_SUMMARY.Enum(), - Metric: []*dto.Metric{ - &dto.Metric{ - Label: []*dto.LabelPair{ - &dto.LabelPair{ - Name: proto.String("n2"), - Value: proto.String("val2"), - }, - &dto.LabelPair{ - Name: proto.String("n1"), - Value: proto.String("val1"), - }, - }, - Summary: &dto.Summary{ - SampleCount: proto.Uint64(20), - Quantile: []*dto.Quantile{ - &dto.Quantile{ - Quantile: proto.Float64(0.3), - Value: proto.Float64(-1.2), - }, - }, - }, - }, - }, - }, - }, - }, - // 4: The histogram. - { - in: ` -# 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 -`, - out: []*dto.MetricFamily{ - { - Name: proto.String("request_duration_microseconds"), - Help: proto.String("The response latency."), - Type: dto.MetricType_HISTOGRAM.Enum(), - Metric: []*dto.Metric{ - &dto.Metric{ - Histogram: &dto.Histogram{ - SampleCount: proto.Uint64(2693), - SampleSum: proto.Float64(1756047.3), - Bucket: []*dto.Bucket{ - &dto.Bucket{ - UpperBound: proto.Float64(100), - CumulativeCount: proto.Uint64(123), - }, - &dto.Bucket{ - UpperBound: proto.Float64(120), - CumulativeCount: proto.Uint64(412), - }, - &dto.Bucket{ - UpperBound: proto.Float64(144), - CumulativeCount: proto.Uint64(592), - }, - &dto.Bucket{ - UpperBound: proto.Float64(172.8), - CumulativeCount: proto.Uint64(1524), - }, - &dto.Bucket{ - UpperBound: proto.Float64(math.Inf(+1)), - CumulativeCount: proto.Uint64(2693), - }, - }, - }, - }, - }, - }, - }, - }, - } - - for i, scenario := range scenarios { - out, err := parser.TextToMetricFamilies(strings.NewReader(scenario.in)) - if err != nil { - t.Errorf("%d. error: %s", i, err) - continue - } - if expected, got := len(scenario.out), len(out); expected != got { - t.Errorf( - "%d. expected %d MetricFamilies, got %d", - i, expected, got, - ) - } - for _, expected := range scenario.out { - got, ok := out[expected.GetName()] - if !ok { - t.Errorf( - "%d. expected MetricFamily %q, found none", - i, expected.GetName(), - ) - continue - } - if expected.String() != got.String() { - t.Errorf( - "%d. expected MetricFamily %s, got %s", - i, expected, got, - ) - } - } - } -} - -func TestParse(t *testing.T) { - testParse(t) -} - -func BenchmarkParse(b *testing.B) { - for i := 0; i < b.N; i++ { - testParse(b) - } -} - -func testParseError(t testing.TB) { - var scenarios = []struct { - in string - err string - }{ - // 0: No new-line at end of input. - { - in: `bla 3.14`, - err: "EOF", - }, - // 1: Invalid escape sequence in label value. - { - in: `metric{label="\t"} 3.14`, - err: "text format parsing error in line 1: invalid escape sequence", - }, - // 2: Newline in label value. - { - in: ` -metric{label="new -line"} 3.14 -`, - err: `text format parsing error in line 2: label value "new" contains unescaped new-line`, - }, - // 3: - { - in: `metric{@="bla"} 3.14`, - err: "text format parsing error in line 1: invalid label name for metric", - }, - // 4: - { - in: `metric{__name__="bla"} 3.14`, - err: `text format parsing error in line 1: label name "__name__" is reserved`, - }, - // 5: - { - in: `metric{label+="bla"} 3.14`, - err: "text format parsing error in line 1: expected '=' after label name", - }, - // 6: - { - in: `metric{label=bla} 3.14`, - err: "text format parsing error in line 1: expected '\"' at start of label value", - }, - // 7: - { - in: ` -# TYPE metric summary -metric{quantile="bla"} 3.14 -`, - err: "text format parsing error in line 3: expected float as value for 'quantile' label", - }, - // 8: - { - in: `metric{label="bla"+} 3.14`, - err: "text format parsing error in line 1: unexpected end of label value", - }, - // 9: - { - in: `metric{label="bla"} 3.14 2.72 -`, - err: "text format parsing error in line 1: expected integer as timestamp", - }, - // 10: - { - in: `metric{label="bla"} 3.14 2 3 -`, - err: "text format parsing error in line 1: spurious string after timestamp", - }, - // 11: - { - in: `metric{label="bla"} blubb -`, - err: "text format parsing error in line 1: expected float as value", - }, - // 12: - { - in: ` -# HELP metric one -# HELP metric two -`, - err: "text format parsing error in line 3: second HELP line for metric name", - }, - // 13: - { - in: ` -# TYPE metric counter -# TYPE metric untyped -`, - err: `text format parsing error in line 3: second TYPE line for metric name "metric", or TYPE reported after samples`, - }, - // 14: - { - in: ` -metric 4.12 -# TYPE metric counter -`, - err: `text format parsing error in line 3: second TYPE line for metric name "metric", or TYPE reported after samples`, - }, - // 14: - { - in: ` -# TYPE metric bla -`, - err: "text format parsing error in line 2: unknown metric type", - }, - // 15: - { - in: ` -# TYPE met-ric -`, - err: "text format parsing error in line 2: invalid metric name in comment", - }, - // 16: - { - in: `@invalidmetric{label="bla"} 3.14 2`, - err: "text format parsing error in line 1: invalid metric name", - }, - // 17: - { - in: `{label="bla"} 3.14 2`, - err: "text format parsing error in line 1: invalid metric name", - }, - // 18: - { - in: ` -# TYPE metric histogram -metric_bucket{le="bla"} 3.14 -`, - err: "text format parsing error in line 3: expected float as value for 'le' label", - }, - } - - for i, scenario := range scenarios { - _, err := parser.TextToMetricFamilies(strings.NewReader(scenario.in)) - if err == nil { - t.Errorf("%d. expected error, got nil", i) - continue - } - if expected, got := scenario.err, err.Error(); strings.Index(got, expected) != 0 { - t.Errorf( - "%d. expected error starting with %q, got %q", - i, expected, got, - ) - } - } - -} - -func TestParseError(t *testing.T) { - testParseError(t) -} - -func BenchmarkParseError(b *testing.B) { - for i := 0; i < b.N; i++ { - testParseError(b) - } -} diff --git a/Godeps/_workspace/src/github.com/prometheus/client_golang/text/proto.go b/Godeps/_workspace/src/github.com/prometheus/client_golang/text/proto.go deleted file mode 100644 index e82bbb3b4089..000000000000 --- a/Godeps/_workspace/src/github.com/prometheus/client_golang/text/proto.go +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2014 The Prometheus 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 text - -import ( - "fmt" - "io" - - "github.com/golang/protobuf/proto" - "github.com/matttproud/golang_protobuf_extensions/pbutil" - - dto "github.com/prometheus/client_model/go" -) - -// WriteProtoDelimited writes the MetricFamily to the writer in delimited -// protobuf format and returns the number of bytes written and any error -// encountered. -func WriteProtoDelimited(w io.Writer, p *dto.MetricFamily) (int, error) { - return pbutil.WriteDelimited(w, p) -} - -// WriteProtoText writes the MetricFamily to the writer in text format and -// returns the number of bytes written and any error encountered. -func WriteProtoText(w io.Writer, p *dto.MetricFamily) (int, error) { - return fmt.Fprintf(w, "%s\n", proto.MarshalTextString(p)) -} - -// WriteProtoCompactText writes the MetricFamily to the writer in compact text -// format and returns the number of bytes written and any error encountered. -func WriteProtoCompactText(w io.Writer, p *dto.MetricFamily) (int, error) { - return fmt.Fprintf(w, "%s\n", p) -} diff --git a/Godeps/_workspace/src/github.com/prometheus/client_golang/text/testdata/protobuf b/Godeps/_workspace/src/github.com/prometheus/client_golang/text/testdata/protobuf deleted file mode 100644 index df48256390c4..000000000000 Binary files a/Godeps/_workspace/src/github.com/prometheus/client_golang/text/testdata/protobuf and /dev/null differ diff --git a/Godeps/_workspace/src/github.com/prometheus/client_golang/text/testdata/protobuf.gz b/Godeps/_workspace/src/github.com/prometheus/client_golang/text/testdata/protobuf.gz deleted file mode 100644 index 2c8704d69e0a..000000000000 Binary files a/Godeps/_workspace/src/github.com/prometheus/client_golang/text/testdata/protobuf.gz and /dev/null differ diff --git a/Godeps/_workspace/src/github.com/prometheus/client_golang/text/testdata/text.gz b/Godeps/_workspace/src/github.com/prometheus/client_golang/text/testdata/text.gz deleted file mode 100644 index 46de5995ad79..000000000000 Binary files a/Godeps/_workspace/src/github.com/prometheus/client_golang/text/testdata/text.gz and /dev/null differ diff --git a/Godeps/_workspace/src/github.com/prometheus/client_golang/text/bench_test.go b/Godeps/_workspace/src/github.com/prometheus/common/expfmt/bench_test.go similarity index 99% rename from Godeps/_workspace/src/github.com/prometheus/client_golang/text/bench_test.go rename to Godeps/_workspace/src/github.com/prometheus/common/expfmt/bench_test.go index a97409ed3f93..92b16a028aad 100644 --- a/Godeps/_workspace/src/github.com/prometheus/client_golang/text/bench_test.go +++ b/Godeps/_workspace/src/github.com/prometheus/common/expfmt/bench_test.go @@ -11,7 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package text +package expfmt import ( "bytes" @@ -19,11 +19,14 @@ import ( "io" "io/ioutil" "testing" - dto "github.com/prometheus/client_model/go" "github.com/matttproud/golang_protobuf_extensions/pbutil" + + dto "github.com/prometheus/client_model/go" ) +var parser TextParser + // Benchmarks to show how much penalty text format parsing actually inflicts. // // Example results on Linux 3.13.0, Intel(R) Core(TM) i7-4700MQ CPU @ 2.40GHz, go1.4. diff --git a/Godeps/_workspace/src/github.com/prometheus/common/expfmt/decode.go b/Godeps/_workspace/src/github.com/prometheus/common/expfmt/decode.go new file mode 100644 index 000000000000..d36f0ecebcbb --- /dev/null +++ b/Godeps/_workspace/src/github.com/prometheus/common/expfmt/decode.go @@ -0,0 +1,410 @@ +// Copyright 2015 The Prometheus 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 expfmt + +import ( + "fmt" + "io" + "math" + "mime" + "net/http" + + dto "github.com/prometheus/client_model/go" + + "github.com/matttproud/golang_protobuf_extensions/pbutil" + "github.com/prometheus/common/model" +) + +// Decoder types decode an input stream into metric families. +type Decoder interface { + Decode(*dto.MetricFamily) error +} + +type DecodeOptions struct { + // Timestamp is added to each value from the stream that has no explicit timestamp set. + Timestamp model.Time +} + +// ResponseFormat extracts the correct format from a HTTP response header. +func ResponseFormat(h http.Header) (Format, error) { + ct := h.Get(hdrContentType) + + mediatype, params, err := mime.ParseMediaType(ct) + if err != nil { + return "", fmt.Errorf("invalid Content-Type header %q: %s", ct, err) + } + + const ( + textType = "text/plain" + jsonType = "application/json" + ) + + switch mediatype { + case ProtoType: + if p := params["proto"]; p != ProtoProtocol { + return "", fmt.Errorf("unrecognized protocol message %s", p) + } + if e := params["encoding"]; e != "delimited" { + return "", fmt.Errorf("unsupported encoding %s", e) + } + return FmtProtoDelim, nil + + case textType: + if v, ok := params["version"]; ok && v != TextVersion { + return "", fmt.Errorf("unrecognized protocol version %s", v) + } + return FmtText, nil + + case jsonType: + var prometheusAPIVersion string + + if params["schema"] == "prometheus/telemetry" && params["version"] != "" { + prometheusAPIVersion = params["version"] + } else { + prometheusAPIVersion = h.Get("X-Prometheus-API-Version") + } + + switch prometheusAPIVersion { + case "0.0.2": + return FmtJSON2, nil + default: + return "", fmt.Errorf("unrecognized API version %s", prometheusAPIVersion) + } + } + + return "", fmt.Errorf("unsupported media type %q, expected %q or %q", mediatype, ProtoType, textType) +} + +// NewDecoder returns a new decoder based on the HTTP header. +func NewDecoder(r io.Reader, format Format) (Decoder, error) { + switch format { + case FmtProtoDelim: + return &protoDecoder{r: r}, nil + case FmtText: + return &textDecoder{r: r}, nil + case FmtJSON2: + return newJSON2Decoder(r), nil + } + return nil, fmt.Errorf("unsupported decoding format %q", format) +} + +// protoDecoder implements the Decoder interface for protocol buffers. +type protoDecoder struct { + r io.Reader +} + +// Decode implements the Decoder interface. +func (d *protoDecoder) Decode(v *dto.MetricFamily) error { + _, err := pbutil.ReadDelimited(d.r, v) + return err +} + +// textDecoder implements the Decoder interface for the text protcol. +type textDecoder struct { + r io.Reader + p TextParser + fams []*dto.MetricFamily +} + +// Decode implements the Decoder interface. +func (d *textDecoder) Decode(v *dto.MetricFamily) error { + // TODO(fabxc): Wrap this as a line reader to make streaming safer. + if len(d.fams) == 0 { + // No cached metric families, read everything and parse metrics. + fams, err := d.p.TextToMetricFamilies(d.r) + if err != nil { + return err + } + if len(fams) == 0 { + return io.EOF + } + for _, f := range fams { + d.fams = append(d.fams, f) + } + } + + *v = *d.fams[len(d.fams)-1] + d.fams = d.fams[:len(d.fams)-1] + + return nil +} + +type SampleDecoder struct { + Dec Decoder + Opts *DecodeOptions + + f dto.MetricFamily +} + +func (sd *SampleDecoder) Decode(s *model.Vector) error { + if err := sd.Dec.Decode(&sd.f); err != nil { + return err + } + *s = extractSamples(&sd.f, sd.Opts) + return nil +} + +// Extract samples builds a slice of samples from the provided metric families. +func ExtractSamples(o *DecodeOptions, fams ...*dto.MetricFamily) model.Vector { + var all model.Vector + for _, f := range fams { + all = append(all, extractSamples(f, o)...) + } + return all +} + +func extractSamples(f *dto.MetricFamily, o *DecodeOptions) model.Vector { + switch f.GetType() { + case dto.MetricType_COUNTER: + return extractCounter(o, f) + case dto.MetricType_GAUGE: + return extractGauge(o, f) + case dto.MetricType_SUMMARY: + return extractSummary(o, f) + case dto.MetricType_UNTYPED: + return extractUntyped(o, f) + case dto.MetricType_HISTOGRAM: + return extractHistogram(o, f) + } + panic("expfmt.extractSamples: unknown metric family type") +} + +func extractCounter(o *DecodeOptions, f *dto.MetricFamily) model.Vector { + samples := make(model.Vector, 0, len(f.Metric)) + + for _, m := range f.Metric { + if m.Counter == nil { + continue + } + + lset := make(model.LabelSet, len(m.Label)+1) + for _, p := range m.Label { + lset[model.LabelName(p.GetName())] = model.LabelValue(p.GetValue()) + } + lset[model.MetricNameLabel] = model.LabelValue(f.GetName()) + + smpl := &model.Sample{ + Metric: model.Metric(lset), + Value: model.SampleValue(m.Counter.GetValue()), + } + + if m.TimestampMs != nil { + smpl.Timestamp = model.TimeFromUnixNano(*m.TimestampMs * 1000000) + } else { + smpl.Timestamp = o.Timestamp + } + + samples = append(samples, smpl) + } + + return samples +} + +func extractGauge(o *DecodeOptions, f *dto.MetricFamily) model.Vector { + samples := make(model.Vector, 0, len(f.Metric)) + + for _, m := range f.Metric { + if m.Gauge == nil { + continue + } + + lset := make(model.LabelSet, len(m.Label)+1) + for _, p := range m.Label { + lset[model.LabelName(p.GetName())] = model.LabelValue(p.GetValue()) + } + lset[model.MetricNameLabel] = model.LabelValue(f.GetName()) + + smpl := &model.Sample{ + Metric: model.Metric(lset), + Value: model.SampleValue(m.Gauge.GetValue()), + } + + if m.TimestampMs != nil { + smpl.Timestamp = model.TimeFromUnixNano(*m.TimestampMs * 1000000) + } else { + smpl.Timestamp = o.Timestamp + } + + samples = append(samples, smpl) + } + + return samples +} + +func extractUntyped(o *DecodeOptions, f *dto.MetricFamily) model.Vector { + samples := make(model.Vector, 0, len(f.Metric)) + + for _, m := range f.Metric { + if m.Untyped == nil { + continue + } + + lset := make(model.LabelSet, len(m.Label)+1) + for _, p := range m.Label { + lset[model.LabelName(p.GetName())] = model.LabelValue(p.GetValue()) + } + lset[model.MetricNameLabel] = model.LabelValue(f.GetName()) + + smpl := &model.Sample{ + Metric: model.Metric(lset), + Value: model.SampleValue(m.Untyped.GetValue()), + } + + if m.TimestampMs != nil { + smpl.Timestamp = model.TimeFromUnixNano(*m.TimestampMs * 1000000) + } else { + smpl.Timestamp = o.Timestamp + } + + samples = append(samples, smpl) + } + + return samples +} + +func extractSummary(o *DecodeOptions, f *dto.MetricFamily) model.Vector { + samples := make(model.Vector, 0, len(f.Metric)) + + for _, m := range f.Metric { + if m.Summary == nil { + continue + } + + timestamp := o.Timestamp + if m.TimestampMs != nil { + timestamp = model.TimeFromUnixNano(*m.TimestampMs * 1000000) + } + + for _, q := range m.Summary.Quantile { + lset := make(model.LabelSet, len(m.Label)+2) + for _, p := range m.Label { + lset[model.LabelName(p.GetName())] = model.LabelValue(p.GetValue()) + } + // BUG(matt): Update other names to "quantile". + lset[model.LabelName(model.QuantileLabel)] = model.LabelValue(fmt.Sprint(q.GetQuantile())) + lset[model.MetricNameLabel] = model.LabelValue(f.GetName()) + + samples = append(samples, &model.Sample{ + Metric: model.Metric(lset), + Value: model.SampleValue(q.GetValue()), + Timestamp: timestamp, + }) + } + + lset := make(model.LabelSet, len(m.Label)+1) + for _, p := range m.Label { + lset[model.LabelName(p.GetName())] = model.LabelValue(p.GetValue()) + } + lset[model.MetricNameLabel] = model.LabelValue(f.GetName() + "_sum") + + samples = append(samples, &model.Sample{ + Metric: model.Metric(lset), + Value: model.SampleValue(m.Summary.GetSampleSum()), + Timestamp: timestamp, + }) + + lset = make(model.LabelSet, len(m.Label)+1) + for _, p := range m.Label { + lset[model.LabelName(p.GetName())] = model.LabelValue(p.GetValue()) + } + lset[model.MetricNameLabel] = model.LabelValue(f.GetName() + "_count") + + samples = append(samples, &model.Sample{ + Metric: model.Metric(lset), + Value: model.SampleValue(m.Summary.GetSampleCount()), + Timestamp: timestamp, + }) + } + + return samples +} + +func extractHistogram(o *DecodeOptions, f *dto.MetricFamily) model.Vector { + samples := make(model.Vector, 0, len(f.Metric)) + + for _, m := range f.Metric { + if m.Histogram == nil { + continue + } + + timestamp := o.Timestamp + if m.TimestampMs != nil { + timestamp = model.TimeFromUnixNano(*m.TimestampMs * 1000000) + } + + infSeen := false + + for _, q := range m.Histogram.Bucket { + lset := make(model.LabelSet, len(m.Label)+2) + for _, p := range m.Label { + lset[model.LabelName(p.GetName())] = model.LabelValue(p.GetValue()) + } + lset[model.LabelName(model.BucketLabel)] = model.LabelValue(fmt.Sprint(q.GetUpperBound())) + lset[model.MetricNameLabel] = model.LabelValue(f.GetName() + "_bucket") + + if math.IsInf(q.GetUpperBound(), +1) { + infSeen = true + } + + samples = append(samples, &model.Sample{ + Metric: model.Metric(lset), + Value: model.SampleValue(q.GetCumulativeCount()), + Timestamp: timestamp, + }) + } + + lset := make(model.LabelSet, len(m.Label)+1) + for _, p := range m.Label { + lset[model.LabelName(p.GetName())] = model.LabelValue(p.GetValue()) + } + lset[model.MetricNameLabel] = model.LabelValue(f.GetName() + "_sum") + + samples = append(samples, &model.Sample{ + Metric: model.Metric(lset), + Value: model.SampleValue(m.Histogram.GetSampleSum()), + Timestamp: timestamp, + }) + + lset = make(model.LabelSet, len(m.Label)+1) + for _, p := range m.Label { + lset[model.LabelName(p.GetName())] = model.LabelValue(p.GetValue()) + } + lset[model.MetricNameLabel] = model.LabelValue(f.GetName() + "_count") + + count := &model.Sample{ + Metric: model.Metric(lset), + Value: model.SampleValue(m.Histogram.GetSampleCount()), + Timestamp: timestamp, + } + samples = append(samples, count) + + if !infSeen { + // Append an infinity bucket sample. + lset := make(model.LabelSet, len(m.Label)+2) + for _, p := range m.Label { + lset[model.LabelName(p.GetName())] = model.LabelValue(p.GetValue()) + } + lset[model.LabelName(model.BucketLabel)] = model.LabelValue("+Inf") + lset[model.MetricNameLabel] = model.LabelValue(f.GetName() + "_bucket") + + samples = append(samples, &model.Sample{ + Metric: model.Metric(lset), + Value: count.Value, + Timestamp: timestamp, + }) + } + } + + return samples +} diff --git a/Godeps/_workspace/src/github.com/prometheus/common/expfmt/decode_test.go b/Godeps/_workspace/src/github.com/prometheus/common/expfmt/decode_test.go new file mode 100644 index 000000000000..307fcd21fed8 --- /dev/null +++ b/Godeps/_workspace/src/github.com/prometheus/common/expfmt/decode_test.go @@ -0,0 +1,373 @@ +// Copyright 2015 The Prometheus 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 expfmt + +import ( + "errors" + "io" + "net/http" + "reflect" + "sort" + "strings" + "testing" + + "github.com/prometheus/common/model" +) + +func TestTextDecoder(t *testing.T) { + var ( + ts = model.Now() + in = ` +# Only a quite simple scenario with two metric families. +# More complicated tests of the parser itself can be found in the text package. +# TYPE mf2 counter +mf2 3 +mf1{label="value1"} -3.14 123456 +mf1{label="value2"} 42 +mf2 4 +` + out = model.Vector{ + &model.Sample{ + Metric: model.Metric{ + model.MetricNameLabel: "mf1", + "label": "value1", + }, + Value: -3.14, + Timestamp: 123456, + }, + &model.Sample{ + Metric: model.Metric{ + model.MetricNameLabel: "mf1", + "label": "value2", + }, + Value: 42, + Timestamp: ts, + }, + &model.Sample{ + Metric: model.Metric{ + model.MetricNameLabel: "mf2", + }, + Value: 3, + Timestamp: ts, + }, + &model.Sample{ + Metric: model.Metric{ + model.MetricNameLabel: "mf2", + }, + Value: 4, + Timestamp: ts, + }, + } + ) + + dec := &SampleDecoder{ + Dec: &textDecoder{r: strings.NewReader(in)}, + Opts: &DecodeOptions{ + Timestamp: ts, + }, + } + var all model.Vector + for { + var smpls model.Vector + err := dec.Decode(&smpls) + if err == io.EOF { + break + } + if err != nil { + t.Fatal(err) + } + all = append(all, smpls...) + } + sort.Sort(all) + sort.Sort(out) + if !reflect.DeepEqual(all, out) { + t.Fatalf("output does not match") + } +} + +func TestProtoDecoder(t *testing.T) { + + var testTime = model.Now() + + scenarios := []struct { + in string + expected model.Vector + }{ + { + in: "", + }, + { + in: "\x8f\x01\n\rrequest_count\x12\x12Number of requests\x18\x00\"0\n#\n\x0fsome_label_name\x12\x10some_label_value\x1a\t\t\x00\x00\x00\x00\x00\x00E\xc0\"6\n)\n\x12another_label_name\x12\x13another_label_value\x1a\t\t\x00\x00\x00\x00\x00\x00U@", + expected: model.Vector{ + &model.Sample{ + Metric: model.Metric{ + model.MetricNameLabel: "request_count", + "some_label_name": "some_label_value", + }, + Value: -42, + Timestamp: testTime, + }, + &model.Sample{ + Metric: model.Metric{ + model.MetricNameLabel: "request_count", + "another_label_name": "another_label_value", + }, + Value: 84, + Timestamp: testTime, + }, + }, + }, + { + in: "\xb9\x01\n\rrequest_count\x12\x12Number of requests\x18\x02\"O\n#\n\x0fsome_label_name\x12\x10some_label_value\"(\x1a\x12\t\xaeG\xe1z\x14\xae\xef?\x11\x00\x00\x00\x00\x00\x00E\xc0\x1a\x12\t+\x87\x16\xd9\xce\xf7\xef?\x11\x00\x00\x00\x00\x00\x00U\xc0\"A\n)\n\x12another_label_name\x12\x13another_label_value\"\x14\x1a\x12\t\x00\x00\x00\x00\x00\x00\xe0?\x11\x00\x00\x00\x00\x00\x00$@", + expected: model.Vector{ + &model.Sample{ + Metric: model.Metric{ + model.MetricNameLabel: "request_count_count", + "some_label_name": "some_label_value", + }, + Value: 0, + Timestamp: testTime, + }, + &model.Sample{ + Metric: model.Metric{ + model.MetricNameLabel: "request_count_sum", + "some_label_name": "some_label_value", + }, + Value: 0, + Timestamp: testTime, + }, + &model.Sample{ + Metric: model.Metric{ + model.MetricNameLabel: "request_count", + "some_label_name": "some_label_value", + "quantile": "0.99", + }, + Value: -42, + Timestamp: testTime, + }, + &model.Sample{ + Metric: model.Metric{ + model.MetricNameLabel: "request_count", + "some_label_name": "some_label_value", + "quantile": "0.999", + }, + Value: -84, + Timestamp: testTime, + }, + &model.Sample{ + Metric: model.Metric{ + model.MetricNameLabel: "request_count_count", + "another_label_name": "another_label_value", + }, + Value: 0, + Timestamp: testTime, + }, + &model.Sample{ + Metric: model.Metric{ + model.MetricNameLabel: "request_count_sum", + "another_label_name": "another_label_value", + }, + Value: 0, + Timestamp: testTime, + }, + &model.Sample{ + Metric: model.Metric{ + model.MetricNameLabel: "request_count", + "another_label_name": "another_label_value", + "quantile": "0.5", + }, + Value: 10, + Timestamp: testTime, + }, + }, + }, + { + in: "\x8d\x01\n\x1drequest_duration_microseconds\x12\x15The response latency.\x18\x04\"S:Q\b\x85\x15\x11\xcd\xcc\xccL\x8f\xcb:A\x1a\v\b{\x11\x00\x00\x00\x00\x00\x00Y@\x1a\f\b\x9c\x03\x11\x00\x00\x00\x00\x00\x00^@\x1a\f\b\xd0\x04\x11\x00\x00\x00\x00\x00\x00b@\x1a\f\b\xf4\v\x11\x9a\x99\x99\x99\x99\x99e@\x1a\f\b\x85\x15\x11\x00\x00\x00\x00\x00\x00\xf0\u007f", + expected: model.Vector{ + &model.Sample{ + Metric: model.Metric{ + model.MetricNameLabel: "request_duration_microseconds_bucket", + "le": "100", + }, + Value: 123, + Timestamp: testTime, + }, + &model.Sample{ + Metric: model.Metric{ + model.MetricNameLabel: "request_duration_microseconds_bucket", + "le": "120", + }, + Value: 412, + Timestamp: testTime, + }, + &model.Sample{ + Metric: model.Metric{ + model.MetricNameLabel: "request_duration_microseconds_bucket", + "le": "144", + }, + Value: 592, + Timestamp: testTime, + }, + &model.Sample{ + Metric: model.Metric{ + model.MetricNameLabel: "request_duration_microseconds_bucket", + "le": "172.8", + }, + Value: 1524, + Timestamp: testTime, + }, + &model.Sample{ + Metric: model.Metric{ + model.MetricNameLabel: "request_duration_microseconds_bucket", + "le": "+Inf", + }, + Value: 2693, + Timestamp: testTime, + }, + &model.Sample{ + Metric: model.Metric{ + model.MetricNameLabel: "request_duration_microseconds_sum", + }, + Value: 1756047.3, + Timestamp: testTime, + }, + &model.Sample{ + Metric: model.Metric{ + model.MetricNameLabel: "request_duration_microseconds_count", + }, + Value: 2693, + Timestamp: testTime, + }, + }, + }, + { + // The metric type is unset in this protobuf, which needs to be handled + // correctly by the decoder. + in: "\x1c\n\rrequest_count\"\v\x1a\t\t\x00\x00\x00\x00\x00\x00\xf0?", + expected: model.Vector{ + &model.Sample{ + Metric: model.Metric{ + model.MetricNameLabel: "request_count", + }, + Value: 1, + Timestamp: testTime, + }, + }, + }, + } + + for i, scenario := range scenarios { + dec := &SampleDecoder{ + Dec: &protoDecoder{r: strings.NewReader(scenario.in)}, + Opts: &DecodeOptions{ + Timestamp: testTime, + }, + } + + var all model.Vector + for { + var smpls model.Vector + err := dec.Decode(&smpls) + if err == io.EOF { + break + } + if err != nil { + t.Fatal(err) + } + all = append(all, smpls...) + } + sort.Sort(all) + sort.Sort(scenario.expected) + if !reflect.DeepEqual(all, scenario.expected) { + t.Fatalf("%d. output does not match, want: %#v, got %#v", i, scenario.expected, all) + } + } +} + +func testDiscriminatorHTTPHeader(t testing.TB) { + var scenarios = []struct { + input map[string]string + output Format + err error + }{ + { + input: map[string]string{"Content-Type": `application/vnd.google.protobuf; proto="io.prometheus.client.MetricFamily"; encoding="delimited"`}, + output: FmtProtoDelim, + err: nil, + }, + { + input: map[string]string{"Content-Type": `application/vnd.google.protobuf; proto="illegal"; encoding="delimited"`}, + output: "", + err: errors.New("unrecognized protocol message illegal"), + }, + { + input: map[string]string{"Content-Type": `application/vnd.google.protobuf; proto="io.prometheus.client.MetricFamily"; encoding="illegal"`}, + output: "", + err: errors.New("unsupported encoding illegal"), + }, + { + input: map[string]string{"Content-Type": `text/plain; version=0.0.4`}, + output: FmtText, + err: nil, + }, + { + input: map[string]string{"Content-Type": `text/plain`}, + output: FmtText, + err: nil, + }, + { + input: map[string]string{"Content-Type": `text/plain; version=0.0.3`}, + output: "", + err: errors.New("unrecognized protocol version 0.0.3"), + }, + } + + for i, scenario := range scenarios { + var header http.Header + + if len(scenario.input) > 0 { + header = http.Header{} + } + + for key, value := range scenario.input { + header.Add(key, value) + } + + actual, err := ResponseFormat(header) + + if scenario.err != err { + if scenario.err != nil && err != nil { + if scenario.err.Error() != err.Error() { + t.Errorf("%d. expected %s, got %s", i, scenario.err, err) + } + } else if scenario.err != nil || err != nil { + t.Errorf("%d. expected %s, got %s", i, scenario.err, err) + } + } + + if !reflect.DeepEqual(scenario.output, actual) { + t.Errorf("%d. expected %s, got %s", i, scenario.output, actual) + } + } +} + +func TestDiscriminatorHTTPHeader(t *testing.T) { + testDiscriminatorHTTPHeader(t) +} + +func BenchmarkDiscriminatorHTTPHeader(b *testing.B) { + for i := 0; i < b.N; i++ { + testDiscriminatorHTTPHeader(b) + } +} diff --git a/Godeps/_workspace/src/github.com/prometheus/common/expfmt/encode.go b/Godeps/_workspace/src/github.com/prometheus/common/expfmt/encode.go new file mode 100644 index 000000000000..392ca90ee257 --- /dev/null +++ b/Godeps/_workspace/src/github.com/prometheus/common/expfmt/encode.go @@ -0,0 +1,88 @@ +// Copyright 2015 The Prometheus 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 expfmt + +import ( + "fmt" + "io" + "net/http" + + "bitbucket.org/ww/goautoneg" + "github.com/golang/protobuf/proto" + "github.com/matttproud/golang_protobuf_extensions/pbutil" + + dto "github.com/prometheus/client_model/go" +) + +// Encoder types encode metric families into an underlying wire protocol. +type Encoder interface { + Encode(*dto.MetricFamily) error +} + +type encoder func(*dto.MetricFamily) error + +func (e encoder) Encode(v *dto.MetricFamily) error { + return e(v) +} + +// Negotiate returns the Content-Type based on the given Accept header. +// If no appropriate accepted type is found, FmtText is returned. +func Negotiate(h http.Header) Format { + for _, ac := range goautoneg.ParseAccept(h.Get(hdrAccept)) { + // Check for protocol buffer + if ac.Type+"/"+ac.SubType == ProtoType && ac.Params["proto"] == ProtoProtocol { + switch ac.Params["encoding"] { + case "delimited": + return FmtProtoDelim + case "text": + return FmtProtoText + case "compact-text": + return FmtProtoCompact + } + } + // Check for text format. + ver := ac.Params["version"] + if ac.Type == "text" && ac.SubType == "plain" && (ver == TextVersion || ver == "") { + return FmtText + } + } + return FmtText +} + +// NewEncoder returns a new encoder based on content type negotiation. +func NewEncoder(w io.Writer, format Format) Encoder { + switch format { + case FmtProtoDelim: + return encoder(func(v *dto.MetricFamily) error { + _, err := pbutil.WriteDelimited(w, v) + return err + }) + case FmtProtoCompact: + return encoder(func(v *dto.MetricFamily) error { + _, err := fmt.Fprintln(w, v.String()) + return err + }) + case FmtProtoText: + return encoder(func(v *dto.MetricFamily) error { + _, err := fmt.Fprintln(w, proto.MarshalTextString(v)) + return err + }) + case FmtText: + return encoder(func(v *dto.MetricFamily) error { + _, err := MetricFamilyToText(w, v) + return err + }) + } + panic("expfmt.NewEncoder: unknown format") +} diff --git a/Godeps/_workspace/src/github.com/prometheus/common/expfmt/expfmt.go b/Godeps/_workspace/src/github.com/prometheus/common/expfmt/expfmt.go new file mode 100644 index 000000000000..3637dd7661d7 --- /dev/null +++ b/Godeps/_workspace/src/github.com/prometheus/common/expfmt/expfmt.go @@ -0,0 +1,37 @@ +// Copyright 2015 The Prometheus 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. + +// A package for reading and writing Prometheus metrics. +package expfmt + +type Format string + +const ( + TextVersion = "0.0.4" + + ProtoType = `application/vnd.google.protobuf` + ProtoProtocol = `io.prometheus.client.MetricFamily` + ProtoFmt = ProtoType + "; proto=" + ProtoProtocol + ";" + + // The Content-Type values for the different wire protocols. + FmtText Format = `text/plain; version=` + TextVersion + FmtProtoDelim Format = ProtoFmt + ` encoding=delimited` + FmtProtoText Format = ProtoFmt + ` encoding=text` + FmtProtoCompact Format = ProtoFmt + ` encoding=compact-text` + FmtJSON2 Format = `application/json; version=0.0.2` +) + +const ( + hdrContentType = "Content-Type" + hdrAccept = "Accept" +) diff --git a/Godeps/_workspace/src/github.com/prometheus/common/expfmt/fuzz.go b/Godeps/_workspace/src/github.com/prometheus/common/expfmt/fuzz.go new file mode 100644 index 000000000000..14f920146921 --- /dev/null +++ b/Godeps/_workspace/src/github.com/prometheus/common/expfmt/fuzz.go @@ -0,0 +1,36 @@ +// Copyright 2014 The Prometheus 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. + +// Build only when actually fuzzing +// +build gofuzz + +package expfmt + +import "bytes" + +// Fuzz text metric parser with with github.com/dvyukov/go-fuzz: +// +// go-fuzz-build github.com/prometheus/client_golang/text +// go-fuzz -bin text-fuzz.zip -workdir fuzz +// +// Further input samples should go in the folder fuzz/corpus. +func Fuzz(in []byte) int { + parser := TextParser{} + _, err := parser.TextToMetricFamilies(bytes.NewReader(in)) + + if err != nil { + return 0 + } + + return 1 +} diff --git a/Godeps/_workspace/src/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_0 b/Godeps/_workspace/src/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_0 new file mode 100644 index 000000000000..139597f9cb07 --- /dev/null +++ b/Godeps/_workspace/src/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_0 @@ -0,0 +1,2 @@ + + diff --git a/Godeps/_workspace/src/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_1 b/Godeps/_workspace/src/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_1 new file mode 100644 index 000000000000..2ae8706797b3 --- /dev/null +++ b/Godeps/_workspace/src/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_1 @@ -0,0 +1,6 @@ + +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/Godeps/_workspace/src/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_2 b/Godeps/_workspace/src/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_2 new file mode 100644 index 000000000000..5c351db36d3c --- /dev/null +++ b/Godeps/_workspace/src/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_2 @@ -0,0 +1,12 @@ + +# 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/Godeps/_workspace/src/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_3 b/Godeps/_workspace/src/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_3 new file mode 100644 index 000000000000..0b3c345aa9c4 --- /dev/null +++ b/Godeps/_workspace/src/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_3 @@ -0,0 +1,22 @@ + +# 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/Godeps/_workspace/src/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_4 b/Godeps/_workspace/src/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_4 new file mode 100644 index 000000000000..bde0a387aa2a --- /dev/null +++ b/Godeps/_workspace/src/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_4 @@ -0,0 +1,10 @@ + +# 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/Godeps/_workspace/src/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_0 b/Godeps/_workspace/src/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_0 new file mode 100644 index 000000000000..4c67f9a198a8 --- /dev/null +++ b/Godeps/_workspace/src/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_0 @@ -0,0 +1 @@ +bla 3.14 \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_1 b/Godeps/_workspace/src/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_1 new file mode 100644 index 000000000000..b853478ee2f5 --- /dev/null +++ b/Godeps/_workspace/src/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_1 @@ -0,0 +1 @@ +metric{label="\t"} 3.14 \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_10 b/Godeps/_workspace/src/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_10 new file mode 100644 index 000000000000..b5fe5f5a68cd --- /dev/null +++ b/Godeps/_workspace/src/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_10 @@ -0,0 +1 @@ +metric{label="bla"} 3.14 2 3 diff --git a/Godeps/_workspace/src/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_11 b/Godeps/_workspace/src/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_11 new file mode 100644 index 000000000000..57c7fbc0bc40 --- /dev/null +++ b/Godeps/_workspace/src/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_11 @@ -0,0 +1 @@ +metric{label="bla"} blubb diff --git a/Godeps/_workspace/src/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_12 b/Godeps/_workspace/src/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_12 new file mode 100644 index 000000000000..0a9df79a1e67 --- /dev/null +++ b/Godeps/_workspace/src/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_12 @@ -0,0 +1,3 @@ + +# HELP metric one +# HELP metric two diff --git a/Godeps/_workspace/src/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_13 b/Godeps/_workspace/src/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_13 new file mode 100644 index 000000000000..5bc7427813e1 --- /dev/null +++ b/Godeps/_workspace/src/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_13 @@ -0,0 +1,3 @@ + +# TYPE metric counter +# TYPE metric untyped diff --git a/Godeps/_workspace/src/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_14 b/Godeps/_workspace/src/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_14 new file mode 100644 index 000000000000..a9a24265b295 --- /dev/null +++ b/Godeps/_workspace/src/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_14 @@ -0,0 +1,3 @@ + +metric 4.12 +# TYPE metric counter diff --git a/Godeps/_workspace/src/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_15 b/Godeps/_workspace/src/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_15 new file mode 100644 index 000000000000..7e95ca8f4c1d --- /dev/null +++ b/Godeps/_workspace/src/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_15 @@ -0,0 +1,2 @@ + +# TYPE metric bla diff --git a/Godeps/_workspace/src/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_16 b/Godeps/_workspace/src/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_16 new file mode 100644 index 000000000000..7825f8887233 --- /dev/null +++ b/Godeps/_workspace/src/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_16 @@ -0,0 +1,2 @@ + +# TYPE met-ric diff --git a/Godeps/_workspace/src/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_17 b/Godeps/_workspace/src/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_17 new file mode 100644 index 000000000000..8f35cae0cf09 --- /dev/null +++ b/Godeps/_workspace/src/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_17 @@ -0,0 +1 @@ +@invalidmetric{label="bla"} 3.14 2 \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_18 b/Godeps/_workspace/src/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_18 new file mode 100644 index 000000000000..7ca2cc268b0b --- /dev/null +++ b/Godeps/_workspace/src/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_18 @@ -0,0 +1 @@ +{label="bla"} 3.14 2 \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_19 b/Godeps/_workspace/src/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_19 new file mode 100644 index 000000000000..7a6ccc0dd47c --- /dev/null +++ b/Godeps/_workspace/src/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_19 @@ -0,0 +1,3 @@ + +# TYPE metric histogram +metric_bucket{le="bla"} 3.14 diff --git a/Godeps/_workspace/src/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_2 b/Godeps/_workspace/src/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_2 new file mode 100644 index 000000000000..726d0017cb06 --- /dev/null +++ b/Godeps/_workspace/src/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_2 @@ -0,0 +1,3 @@ + +metric{label="new +line"} 3.14 diff --git a/Godeps/_workspace/src/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_3 b/Godeps/_workspace/src/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_3 new file mode 100644 index 000000000000..6aa9e3081409 --- /dev/null +++ b/Godeps/_workspace/src/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_3 @@ -0,0 +1 @@ +metric{@="bla"} 3.14 \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_4 b/Godeps/_workspace/src/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_4 new file mode 100644 index 000000000000..d112cb902526 --- /dev/null +++ b/Godeps/_workspace/src/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_4 @@ -0,0 +1 @@ +metric{__name__="bla"} 3.14 \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_5 b/Godeps/_workspace/src/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_5 new file mode 100644 index 000000000000..b34554a8d6bd --- /dev/null +++ b/Godeps/_workspace/src/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_5 @@ -0,0 +1 @@ +metric{label+="bla"} 3.14 \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_6 b/Godeps/_workspace/src/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_6 new file mode 100644 index 000000000000..c4d7df3d1110 --- /dev/null +++ b/Godeps/_workspace/src/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_6 @@ -0,0 +1 @@ +metric{label=bla} 3.14 \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_7 b/Godeps/_workspace/src/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_7 new file mode 100644 index 000000000000..97eafc4a6532 --- /dev/null +++ b/Godeps/_workspace/src/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_7 @@ -0,0 +1,3 @@ + +# TYPE metric summary +metric{quantile="bla"} 3.14 diff --git a/Godeps/_workspace/src/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_8 b/Godeps/_workspace/src/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_8 new file mode 100644 index 000000000000..fc706496b7cd --- /dev/null +++ b/Godeps/_workspace/src/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_8 @@ -0,0 +1 @@ +metric{label="bla"+} 3.14 \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_9 b/Godeps/_workspace/src/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_9 new file mode 100644 index 000000000000..57b4879c0598 --- /dev/null +++ b/Godeps/_workspace/src/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_9 @@ -0,0 +1 @@ +metric{label="bla"} 3.14 2.72 diff --git a/Godeps/_workspace/src/github.com/prometheus/common/expfmt/fuzz/corpus/minimal b/Godeps/_workspace/src/github.com/prometheus/common/expfmt/fuzz/corpus/minimal new file mode 100644 index 000000000000..be1e6a369ddb --- /dev/null +++ b/Godeps/_workspace/src/github.com/prometheus/common/expfmt/fuzz/corpus/minimal @@ -0,0 +1 @@ +m{} 0 diff --git a/Godeps/_workspace/src/github.com/prometheus/common/expfmt/json_decode.go b/Godeps/_workspace/src/github.com/prometheus/common/expfmt/json_decode.go new file mode 100644 index 000000000000..67e3a0d4d65e --- /dev/null +++ b/Godeps/_workspace/src/github.com/prometheus/common/expfmt/json_decode.go @@ -0,0 +1,162 @@ +// Copyright 2015 The Prometheus 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 expfmt + +import ( + "encoding/json" + "fmt" + "io" + "sort" + + "github.com/golang/protobuf/proto" + dto "github.com/prometheus/client_model/go" + + "github.com/prometheus/common/model" +) + +type json2Decoder struct { + dec *json.Decoder + fams []*dto.MetricFamily +} + +func newJSON2Decoder(r io.Reader) Decoder { + return &json2Decoder{ + dec: json.NewDecoder(r), + } +} + +type histogram002 struct { + Labels model.LabelSet `json:"labels"` + Values map[string]float64 `json:"value"` +} + +type counter002 struct { + Labels model.LabelSet `json:"labels"` + Value float64 `json:"value"` +} + +func protoLabelSet(base, ext model.LabelSet) []*dto.LabelPair { + labels := base.Clone().Merge(ext) + delete(labels, model.MetricNameLabel) + + names := make([]string, 0, len(labels)) + for ln := range labels { + names = append(names, string(ln)) + } + sort.Strings(names) + + pairs := make([]*dto.LabelPair, 0, len(labels)) + + for _, ln := range names { + lv := labels[model.LabelName(ln)] + + pairs = append(pairs, &dto.LabelPair{ + Name: proto.String(ln), + Value: proto.String(string(lv)), + }) + } + + return pairs +} + +func (d *json2Decoder) more() error { + var entities []struct { + BaseLabels model.LabelSet `json:"baseLabels"` + Docstring string `json:"docstring"` + Metric struct { + Type string `json:"type"` + Values json.RawMessage `json:"value"` + } `json:"metric"` + } + + if err := d.dec.Decode(&entities); err != nil { + return err + } + for _, e := range entities { + f := &dto.MetricFamily{ + Name: proto.String(string(e.BaseLabels[model.MetricNameLabel])), + Help: proto.String(e.Docstring), + Type: dto.MetricType_UNTYPED.Enum(), + Metric: []*dto.Metric{}, + } + + d.fams = append(d.fams, f) + + switch e.Metric.Type { + case "counter", "gauge": + var values []counter002 + + if err := json.Unmarshal(e.Metric.Values, &values); err != nil { + return fmt.Errorf("could not extract %s value: %s", e.Metric.Type, err) + } + + for _, ctr := range values { + f.Metric = append(f.Metric, &dto.Metric{ + Label: protoLabelSet(e.BaseLabels, ctr.Labels), + Untyped: &dto.Untyped{ + Value: proto.Float64(ctr.Value), + }, + }) + } + + case "histogram": + var values []histogram002 + + if err := json.Unmarshal(e.Metric.Values, &values); err != nil { + return fmt.Errorf("could not extract %s value: %s", e.Metric.Type, err) + } + + for _, hist := range values { + quants := make([]string, 0, len(values)) + for q := range hist.Values { + quants = append(quants, q) + } + + sort.Strings(quants) + + for _, q := range quants { + value := hist.Values[q] + // The correct label is "quantile" but to not break old expressions + // this remains "percentile" + hist.Labels["percentile"] = model.LabelValue(q) + + f.Metric = append(f.Metric, &dto.Metric{ + Label: protoLabelSet(e.BaseLabels, hist.Labels), + Untyped: &dto.Untyped{ + Value: proto.Float64(value), + }, + }) + } + } + + default: + return fmt.Errorf("unknown metric type %q", e.Metric.Type) + } + } + return nil +} + +// Decode implements the Decoder interface. +func (d *json2Decoder) Decode(v *dto.MetricFamily) error { + if len(d.fams) == 0 { + if err := d.more(); err != nil { + return err + } + } + + *v = *d.fams[0] + d.fams = d.fams[1:] + + return nil +} diff --git a/Godeps/_workspace/src/github.com/prometheus/common/expfmt/json_decode_test.go b/Godeps/_workspace/src/github.com/prometheus/common/expfmt/json_decode_test.go new file mode 100644 index 000000000000..c98ea29e1768 --- /dev/null +++ b/Godeps/_workspace/src/github.com/prometheus/common/expfmt/json_decode_test.go @@ -0,0 +1,124 @@ +// Copyright 2015 The Prometheus 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 expfmt + +import ( + "os" + "reflect" + "testing" + + "github.com/golang/protobuf/proto" + dto "github.com/prometheus/client_model/go" +) + +func TestJSON2Decode(t *testing.T) { + f, err := os.Open("testdata/json2") + if err != nil { + t.Fatal(err) + } + defer f.Close() + + dec := newJSON2Decoder(f) + + var v1 dto.MetricFamily + if err := dec.Decode(&v1); err != nil { + t.Fatal(err) + } + + exp1 := dto.MetricFamily{ + Type: dto.MetricType_UNTYPED.Enum(), + Help: proto.String("RPC calls."), + Name: proto.String("rpc_calls_total"), + Metric: []*dto.Metric{ + { + Label: []*dto.LabelPair{ + { + Name: proto.String("job"), + Value: proto.String("batch_job"), + }, { + Name: proto.String("service"), + Value: proto.String("zed"), + }, + }, + Untyped: &dto.Untyped{ + Value: proto.Float64(25), + }, + }, + { + Label: []*dto.LabelPair{ + { + Name: proto.String("job"), + Value: proto.String("batch_job"), + }, { + Name: proto.String("service"), + Value: proto.String("bar"), + }, + }, + Untyped: &dto.Untyped{ + Value: proto.Float64(24), + }, + }, + }, + } + + if !reflect.DeepEqual(v1, exp1) { + t.Fatalf("Expected %v, got %v", exp1, v1) + } + + var v2 dto.MetricFamily + if err := dec.Decode(&v2); err != nil { + t.Fatal(err) + } + + exp2 := dto.MetricFamily{ + Type: dto.MetricType_UNTYPED.Enum(), + Help: proto.String("RPC latency."), + Name: proto.String("rpc_latency_microseconds"), + Metric: []*dto.Metric{ + { + Label: []*dto.LabelPair{ + { + Name: proto.String("percentile"), + Value: proto.String("0.010000"), + }, { + Name: proto.String("service"), + Value: proto.String("foo"), + }, + }, + Untyped: &dto.Untyped{ + Value: proto.Float64(15), + }, + }, + { + Label: []*dto.LabelPair{ + { + Name: proto.String("percentile"), + Value: proto.String("0.990000"), + }, { + Name: proto.String("service"), + Value: proto.String("foo"), + }, + }, + Untyped: &dto.Untyped{ + Value: proto.Float64(17), + }, + }, + }, + } + + if !reflect.DeepEqual(v2, exp2) { + t.Fatalf("Expected %v, got %v", exp2, v2) + } + +} diff --git a/Godeps/_workspace/src/github.com/prometheus/common/expfmt/testdata/json2 b/Godeps/_workspace/src/github.com/prometheus/common/expfmt/testdata/json2 new file mode 100644 index 000000000000..b914c9386595 --- /dev/null +++ b/Godeps/_workspace/src/github.com/prometheus/common/expfmt/testdata/json2 @@ -0,0 +1,46 @@ +[ + { + "baseLabels": { + "__name__": "rpc_calls_total", + "job": "batch_job" + }, + "docstring": "RPC calls.", + "metric": { + "type": "counter", + "value": [ + { + "labels": { + "service": "zed" + }, + "value": 25 + }, + { + "labels": { + "service": "bar" + }, + "value": 24 + } + ] + } + }, + { + "baseLabels": { + "__name__": "rpc_latency_microseconds" + }, + "docstring": "RPC latency.", + "metric": { + "type": "histogram", + "value": [ + { + "labels": { + "service": "foo" + }, + "value": { + "0.010000": 15, + "0.990000": 17 + } + } + ] + } + } +] diff --git a/Godeps/_workspace/src/github.com/prometheus/common/expfmt/testdata/protobuf b/Godeps/_workspace/src/github.com/prometheus/common/expfmt/testdata/protobuf new file mode 100644 index 000000000000..d5aae5091508 --- /dev/null +++ b/Godeps/_workspace/src/github.com/prometheus/common/expfmt/testdata/protobuf @@ -0,0 +1,516 @@ +fc08 0a22 6874 7470 5f72 6571 7565 7374 +5f64 7572 6174 696f 6e5f 6d69 6372 6f73 +6563 6f6e 6473 122b 5468 6520 4854 5450 +2072 6571 7565 7374 206c 6174 656e 6369 +6573 2069 6e20 6d69 6372 6f73 6563 6f6e +6473 2e18 0222 570a 0c0a 0768 616e 646c +6572 1201 2f22 4708 0011 0000 0000 0000 +0000 1a12 0900 0000 0000 00e0 3f11 0000 +0000 0000 0000 1a12 09cd cccc cccc ccec +3f11 0000 0000 0000 0000 1a12 09ae 47e1 +7a14 aeef 3f11 0000 0000 0000 0000 225d +0a12 0a07 6861 6e64 6c65 7212 072f 616c +6572 7473 2247 0800 1100 0000 0000 0000 +001a 1209 0000 0000 0000 e03f 1100 0000 +0000 0000 001a 1209 cdcc cccc cccc ec3f +1100 0000 0000 0000 001a 1209 ae47 e17a +14ae ef3f 1100 0000 0000 0000 0022 620a +170a 0768 616e 646c 6572 120c 2f61 7069 +2f6d 6574 7269 6373 2247 0800 1100 0000 +0000 0000 001a 1209 0000 0000 0000 e03f +1100 0000 0000 0000 001a 1209 cdcc cccc +cccc ec3f 1100 0000 0000 0000 001a 1209 +ae47 e17a 14ae ef3f 1100 0000 0000 0000 +0022 600a 150a 0768 616e 646c 6572 120a +2f61 7069 2f71 7565 7279 2247 0800 1100 +0000 0000 0000 001a 1209 0000 0000 0000 +e03f 1100 0000 0000 0000 001a 1209 cdcc +cccc cccc ec3f 1100 0000 0000 0000 001a +1209 ae47 e17a 14ae ef3f 1100 0000 0000 +0000 0022 660a 1b0a 0768 616e 646c 6572 +1210 2f61 7069 2f71 7565 7279 5f72 616e +6765 2247 0800 1100 0000 0000 0000 001a +1209 0000 0000 0000 e03f 1100 0000 0000 +0000 001a 1209 cdcc cccc cccc ec3f 1100 +0000 0000 0000 001a 1209 ae47 e17a 14ae +ef3f 1100 0000 0000 0000 0022 620a 170a +0768 616e 646c 6572 120c 2f61 7069 2f74 +6172 6765 7473 2247 0800 1100 0000 0000 +0000 001a 1209 0000 0000 0000 e03f 1100 +0000 0000 0000 001a 1209 cdcc cccc cccc +ec3f 1100 0000 0000 0000 001a 1209 ae47 +e17a 14ae ef3f 1100 0000 0000 0000 0022 +600a 150a 0768 616e 646c 6572 120a 2f63 +6f6e 736f 6c65 732f 2247 0800 1100 0000 +0000 0000 001a 1209 0000 0000 0000 e03f +1100 0000 0000 0000 001a 1209 cdcc cccc +cccc ec3f 1100 0000 0000 0000 001a 1209 +ae47 e17a 14ae ef3f 1100 0000 0000 0000 +0022 5c0a 110a 0768 616e 646c 6572 1206 +2f67 7261 7068 2247 0800 1100 0000 0000 +0000 001a 1209 0000 0000 0000 e03f 1100 +0000 0000 0000 001a 1209 cdcc cccc cccc +ec3f 1100 0000 0000 0000 001a 1209 ae47 +e17a 14ae ef3f 1100 0000 0000 0000 0022 +5b0a 100a 0768 616e 646c 6572 1205 2f68 +6561 7022 4708 0011 0000 0000 0000 0000 +1a12 0900 0000 0000 00e0 3f11 0000 0000 +0000 0000 1a12 09cd cccc cccc ccec 3f11 +0000 0000 0000 0000 1a12 09ae 47e1 7a14 +aeef 3f11 0000 0000 0000 0000 225e 0a13 +0a07 6861 6e64 6c65 7212 082f 7374 6174 +6963 2f22 4708 0011 0000 0000 0000 0000 +1a12 0900 0000 0000 00e0 3f11 0000 0000 +0000 0000 1a12 09cd cccc cccc ccec 3f11 +0000 0000 0000 0000 1a12 09ae 47e1 7a14 +aeef 3f11 0000 0000 0000 0000 2260 0a15 +0a07 6861 6e64 6c65 7212 0a70 726f 6d65 +7468 6575 7322 4708 3b11 5b8f c2f5 083f +f440 1a12 0900 0000 0000 00e0 3f11 e17a +14ae c7af 9340 1a12 09cd cccc cccc ccec +3f11 2fdd 2406 81f0 9640 1a12 09ae 47e1 +7a14 aeef 3f11 3d0a d7a3 b095 a740 e608 +0a17 6874 7470 5f72 6571 7565 7374 5f73 +697a 655f 6279 7465 7312 2054 6865 2048 +5454 5020 7265 7175 6573 7420 7369 7a65 +7320 696e 2062 7974 6573 2e18 0222 570a +0c0a 0768 616e 646c 6572 1201 2f22 4708 +0011 0000 0000 0000 0000 1a12 0900 0000 +0000 00e0 3f11 0000 0000 0000 0000 1a12 +09cd cccc cccc ccec 3f11 0000 0000 0000 +0000 1a12 09ae 47e1 7a14 aeef 3f11 0000 +0000 0000 0000 225d 0a12 0a07 6861 6e64 +6c65 7212 072f 616c 6572 7473 2247 0800 +1100 0000 0000 0000 001a 1209 0000 0000 +0000 e03f 1100 0000 0000 0000 001a 1209 +cdcc cccc cccc ec3f 1100 0000 0000 0000 +001a 1209 ae47 e17a 14ae ef3f 1100 0000 +0000 0000 0022 620a 170a 0768 616e 646c +6572 120c 2f61 7069 2f6d 6574 7269 6373 +2247 0800 1100 0000 0000 0000 001a 1209 +0000 0000 0000 e03f 1100 0000 0000 0000 +001a 1209 cdcc cccc cccc ec3f 1100 0000 +0000 0000 001a 1209 ae47 e17a 14ae ef3f +1100 0000 0000 0000 0022 600a 150a 0768 +616e 646c 6572 120a 2f61 7069 2f71 7565 +7279 2247 0800 1100 0000 0000 0000 001a +1209 0000 0000 0000 e03f 1100 0000 0000 +0000 001a 1209 cdcc cccc cccc ec3f 1100 +0000 0000 0000 001a 1209 ae47 e17a 14ae +ef3f 1100 0000 0000 0000 0022 660a 1b0a +0768 616e 646c 6572 1210 2f61 7069 2f71 +7565 7279 5f72 616e 6765 2247 0800 1100 +0000 0000 0000 001a 1209 0000 0000 0000 +e03f 1100 0000 0000 0000 001a 1209 cdcc +cccc cccc ec3f 1100 0000 0000 0000 001a +1209 ae47 e17a 14ae ef3f 1100 0000 0000 +0000 0022 620a 170a 0768 616e 646c 6572 +120c 2f61 7069 2f74 6172 6765 7473 2247 +0800 1100 0000 0000 0000 001a 1209 0000 +0000 0000 e03f 1100 0000 0000 0000 001a +1209 cdcc cccc cccc ec3f 1100 0000 0000 +0000 001a 1209 ae47 e17a 14ae ef3f 1100 +0000 0000 0000 0022 600a 150a 0768 616e +646c 6572 120a 2f63 6f6e 736f 6c65 732f +2247 0800 1100 0000 0000 0000 001a 1209 +0000 0000 0000 e03f 1100 0000 0000 0000 +001a 1209 cdcc cccc cccc ec3f 1100 0000 +0000 0000 001a 1209 ae47 e17a 14ae ef3f +1100 0000 0000 0000 0022 5c0a 110a 0768 +616e 646c 6572 1206 2f67 7261 7068 2247 +0800 1100 0000 0000 0000 001a 1209 0000 +0000 0000 e03f 1100 0000 0000 0000 001a +1209 cdcc cccc cccc ec3f 1100 0000 0000 +0000 001a 1209 ae47 e17a 14ae ef3f 1100 +0000 0000 0000 0022 5b0a 100a 0768 616e +646c 6572 1205 2f68 6561 7022 4708 0011 +0000 0000 0000 0000 1a12 0900 0000 0000 +00e0 3f11 0000 0000 0000 0000 1a12 09cd +cccc cccc ccec 3f11 0000 0000 0000 0000 +1a12 09ae 47e1 7a14 aeef 3f11 0000 0000 +0000 0000 225e 0a13 0a07 6861 6e64 6c65 +7212 082f 7374 6174 6963 2f22 4708 0011 +0000 0000 0000 0000 1a12 0900 0000 0000 +00e0 3f11 0000 0000 0000 0000 1a12 09cd +cccc cccc ccec 3f11 0000 0000 0000 0000 +1a12 09ae 47e1 7a14 aeef 3f11 0000 0000 +0000 0000 2260 0a15 0a07 6861 6e64 6c65 +7212 0a70 726f 6d65 7468 6575 7322 4708 +3b11 0000 0000 40c4 d040 1a12 0900 0000 +0000 00e0 3f11 0000 0000 0030 7240 1a12 +09cd cccc cccc ccec 3f11 0000 0000 0030 +7240 1a12 09ae 47e1 7a14 aeef 3f11 0000 +0000 0030 7240 7c0a 1368 7474 705f 7265 +7175 6573 7473 5f74 6f74 616c 1223 546f +7461 6c20 6e75 6d62 6572 206f 6620 4854 +5450 2072 6571 7565 7374 7320 6d61 6465 +2e18 0022 3e0a 0b0a 0463 6f64 6512 0332 +3030 0a15 0a07 6861 6e64 6c65 7212 0a70 +726f 6d65 7468 6575 730a 0d0a 066d 6574 +686f 6412 0367 6574 1a09 0900 0000 0000 +804d 40e8 080a 1868 7474 705f 7265 7370 +6f6e 7365 5f73 697a 655f 6279 7465 7312 +2154 6865 2048 5454 5020 7265 7370 6f6e +7365 2073 697a 6573 2069 6e20 6279 7465 +732e 1802 2257 0a0c 0a07 6861 6e64 6c65 +7212 012f 2247 0800 1100 0000 0000 0000 +001a 1209 0000 0000 0000 e03f 1100 0000 +0000 0000 001a 1209 cdcc cccc cccc ec3f +1100 0000 0000 0000 001a 1209 ae47 e17a +14ae ef3f 1100 0000 0000 0000 0022 5d0a +120a 0768 616e 646c 6572 1207 2f61 6c65 +7274 7322 4708 0011 0000 0000 0000 0000 +1a12 0900 0000 0000 00e0 3f11 0000 0000 +0000 0000 1a12 09cd cccc cccc ccec 3f11 +0000 0000 0000 0000 1a12 09ae 47e1 7a14 +aeef 3f11 0000 0000 0000 0000 2262 0a17 +0a07 6861 6e64 6c65 7212 0c2f 6170 692f +6d65 7472 6963 7322 4708 0011 0000 0000 +0000 0000 1a12 0900 0000 0000 00e0 3f11 +0000 0000 0000 0000 1a12 09cd cccc cccc +ccec 3f11 0000 0000 0000 0000 1a12 09ae +47e1 7a14 aeef 3f11 0000 0000 0000 0000 +2260 0a15 0a07 6861 6e64 6c65 7212 0a2f +6170 692f 7175 6572 7922 4708 0011 0000 +0000 0000 0000 1a12 0900 0000 0000 00e0 +3f11 0000 0000 0000 0000 1a12 09cd cccc +cccc ccec 3f11 0000 0000 0000 0000 1a12 +09ae 47e1 7a14 aeef 3f11 0000 0000 0000 +0000 2266 0a1b 0a07 6861 6e64 6c65 7212 +102f 6170 692f 7175 6572 795f 7261 6e67 +6522 4708 0011 0000 0000 0000 0000 1a12 +0900 0000 0000 00e0 3f11 0000 0000 0000 +0000 1a12 09cd cccc cccc ccec 3f11 0000 +0000 0000 0000 1a12 09ae 47e1 7a14 aeef +3f11 0000 0000 0000 0000 2262 0a17 0a07 +6861 6e64 6c65 7212 0c2f 6170 692f 7461 +7267 6574 7322 4708 0011 0000 0000 0000 +0000 1a12 0900 0000 0000 00e0 3f11 0000 +0000 0000 0000 1a12 09cd cccc cccc ccec +3f11 0000 0000 0000 0000 1a12 09ae 47e1 +7a14 aeef 3f11 0000 0000 0000 0000 2260 +0a15 0a07 6861 6e64 6c65 7212 0a2f 636f +6e73 6f6c 6573 2f22 4708 0011 0000 0000 +0000 0000 1a12 0900 0000 0000 00e0 3f11 +0000 0000 0000 0000 1a12 09cd cccc cccc +ccec 3f11 0000 0000 0000 0000 1a12 09ae +47e1 7a14 aeef 3f11 0000 0000 0000 0000 +225c 0a11 0a07 6861 6e64 6c65 7212 062f +6772 6170 6822 4708 0011 0000 0000 0000 +0000 1a12 0900 0000 0000 00e0 3f11 0000 +0000 0000 0000 1a12 09cd cccc cccc ccec +3f11 0000 0000 0000 0000 1a12 09ae 47e1 +7a14 aeef 3f11 0000 0000 0000 0000 225b +0a10 0a07 6861 6e64 6c65 7212 052f 6865 +6170 2247 0800 1100 0000 0000 0000 001a +1209 0000 0000 0000 e03f 1100 0000 0000 +0000 001a 1209 cdcc cccc cccc ec3f 1100 +0000 0000 0000 001a 1209 ae47 e17a 14ae +ef3f 1100 0000 0000 0000 0022 5e0a 130a +0768 616e 646c 6572 1208 2f73 7461 7469 +632f 2247 0800 1100 0000 0000 0000 001a +1209 0000 0000 0000 e03f 1100 0000 0000 +0000 001a 1209 cdcc cccc cccc ec3f 1100 +0000 0000 0000 001a 1209 ae47 e17a 14ae +ef3f 1100 0000 0000 0000 0022 600a 150a +0768 616e 646c 6572 120a 7072 6f6d 6574 +6865 7573 2247 083b 1100 0000 00e0 b4fc +401a 1209 0000 0000 0000 e03f 1100 0000 +0000 349f 401a 1209 cdcc cccc cccc ec3f +1100 0000 0000 08a0 401a 1209 ae47 e17a +14ae ef3f 1100 0000 0000 0aa0 405c 0a19 +7072 6f63 6573 735f 6370 755f 7365 636f +6e64 735f 746f 7461 6c12 3054 6f74 616c +2075 7365 7220 616e 6420 7379 7374 656d +2043 5055 2074 696d 6520 7370 656e 7420 +696e 2073 6563 6f6e 6473 2e18 0022 0b1a +0909 a470 3d0a d7a3 d03f 4f0a 1270 726f +6365 7373 5f67 6f72 6f75 7469 6e65 7312 +2a4e 756d 6265 7220 6f66 2067 6f72 6f75 +7469 6e65 7320 7468 6174 2063 7572 7265 +6e74 6c79 2065 7869 7374 2e18 0122 0b12 +0909 0000 0000 0000 5140 4a0a 0f70 726f +6365 7373 5f6d 6178 5f66 6473 1228 4d61 +7869 6d75 6d20 6e75 6d62 6572 206f 6620 +6f70 656e 2066 696c 6520 6465 7363 7269 +7074 6f72 732e 1801 220b 1209 0900 0000 +0000 00c0 4043 0a10 7072 6f63 6573 735f +6f70 656e 5f66 6473 1220 4e75 6d62 6572 +206f 6620 6f70 656e 2066 696c 6520 6465 +7363 7269 7074 6f72 732e 1801 220b 1209 +0900 0000 0000 003d 404e 0a1d 7072 6f63 +6573 735f 7265 7369 6465 6e74 5f6d 656d +6f72 795f 6279 7465 7312 1e52 6573 6964 +656e 7420 6d65 6d6f 7279 2073 697a 6520 +696e 2062 7974 6573 2e18 0122 0b12 0909 +0000 0000 004b 8841 630a 1a70 726f 6365 +7373 5f73 7461 7274 5f74 696d 655f 7365 +636f 6e64 7312 3653 7461 7274 2074 696d +6520 6f66 2074 6865 2070 726f 6365 7373 +2073 696e 6365 2075 6e69 7820 6570 6f63 +6820 696e 2073 6563 6f6e 6473 2e18 0122 +0b12 0909 3d0a 172d e831 d541 4c0a 1c70 +726f 6365 7373 5f76 6972 7475 616c 5f6d +656d 6f72 795f 6279 7465 7312 1d56 6972 +7475 616c 206d 656d 6f72 7920 7369 7a65 +2069 6e20 6279 7465 732e 1801 220b 1209 +0900 0000 0020 12c0 415f 0a27 7072 6f6d +6574 6865 7573 5f64 6e73 5f73 645f 6c6f +6f6b 7570 5f66 6169 6c75 7265 735f 746f +7461 6c12 2554 6865 206e 756d 6265 7220 +6f66 2044 4e53 2d53 4420 6c6f 6f6b 7570 +2066 6169 6c75 7265 732e 1800 220b 1a09 +0900 0000 0000 0000 004f 0a1f 7072 6f6d +6574 6865 7573 5f64 6e73 5f73 645f 6c6f +6f6b 7570 735f 746f 7461 6c12 1d54 6865 +206e 756d 6265 7220 6f66 2044 4e53 2d53 +4420 6c6f 6f6b 7570 732e 1800 220b 1a09 +0900 0000 0000 0008 40cf 010a 2a70 726f +6d65 7468 6575 735f 6576 616c 7561 746f +725f 6475 7261 7469 6f6e 5f6d 696c 6c69 +7365 636f 6e64 7312 2c54 6865 2064 7572 +6174 696f 6e20 666f 7220 616c 6c20 6576 +616c 7561 7469 6f6e 7320 746f 2065 7865 +6375 7465 2e18 0222 7122 6f08 0b11 0000 +0000 0000 2240 1a12 097b 14ae 47e1 7a84 +3f11 0000 0000 0000 0000 1a12 099a 9999 +9999 99a9 3f11 0000 0000 0000 0000 1a12 +0900 0000 0000 00e0 3f11 0000 0000 0000 +0000 1a12 09cd cccc cccc ccec 3f11 0000 +0000 0000 f03f 1a12 09ae 47e1 7a14 aeef +3f11 0000 0000 0000 f03f a301 0a39 7072 +6f6d 6574 6865 7573 5f6c 6f63 616c 5f73 +746f 7261 6765 5f63 6865 636b 706f 696e +745f 6475 7261 7469 6f6e 5f6d 696c 6c69 +7365 636f 6e64 7312 5754 6865 2064 7572 +6174 696f 6e20 2869 6e20 6d69 6c6c 6973 +6563 6f6e 6473 2920 6974 2074 6f6f 6b20 +746f 2063 6865 636b 706f 696e 7420 696e +2d6d 656d 6f72 7920 6d65 7472 6963 7320 +616e 6420 6865 6164 2063 6875 6e6b 732e +1801 220b 1209 0900 0000 0000 0000 00f2 +010a 2870 726f 6d65 7468 6575 735f 6c6f +6361 6c5f 7374 6f72 6167 655f 6368 756e +6b5f 6f70 735f 746f 7461 6c12 3354 6865 +2074 6f74 616c 206e 756d 6265 7220 6f66 +2063 6875 6e6b 206f 7065 7261 7469 6f6e +7320 6279 2074 6865 6972 2074 7970 652e +1800 221b 0a0e 0a04 7479 7065 1206 6372 +6561 7465 1a09 0900 0000 0000 b880 4022 +1c0a 0f0a 0474 7970 6512 0770 6572 7369 +7374 1a09 0900 0000 0000 c05b 4022 180a +0b0a 0474 7970 6512 0370 696e 1a09 0900 +0000 0000 807b 4022 1e0a 110a 0474 7970 +6512 0974 7261 6e73 636f 6465 1a09 0900 +0000 0000 a06b 4022 1a0a 0d0a 0474 7970 +6512 0575 6e70 696e 1a09 0900 0000 0000 +807b 40c4 010a 3c70 726f 6d65 7468 6575 +735f 6c6f 6361 6c5f 7374 6f72 6167 655f +696e 6465 7869 6e67 5f62 6174 6368 5f6c +6174 656e 6379 5f6d 696c 6c69 7365 636f +6e64 7312 3751 7561 6e74 696c 6573 2066 +6f72 2062 6174 6368 2069 6e64 6578 696e +6720 6c61 7465 6e63 6965 7320 696e 206d +696c 6c69 7365 636f 6e64 732e 1802 2249 +2247 0801 1100 0000 0000 0000 001a 1209 +0000 0000 0000 e03f 1100 0000 0000 0000 +001a 1209 cdcc cccc cccc ec3f 1100 0000 +0000 0000 001a 1209 ae47 e17a 14ae ef3f +1100 0000 0000 0000 00bf 010a 2d70 726f +6d65 7468 6575 735f 6c6f 6361 6c5f 7374 +6f72 6167 655f 696e 6465 7869 6e67 5f62 +6174 6368 5f73 697a 6573 1241 5175 616e +7469 6c65 7320 666f 7220 696e 6465 7869 +6e67 2062 6174 6368 2073 697a 6573 2028 +6e75 6d62 6572 206f 6620 6d65 7472 6963 +7320 7065 7220 6261 7463 6829 2e18 0222 +4922 4708 0111 0000 0000 0000 0040 1a12 +0900 0000 0000 00e0 3f11 0000 0000 0000 +0040 1a12 09cd cccc cccc ccec 3f11 0000 +0000 0000 0040 1a12 09ae 47e1 7a14 aeef +3f11 0000 0000 0000 0040 660a 3070 726f +6d65 7468 6575 735f 6c6f 6361 6c5f 7374 +6f72 6167 655f 696e 6465 7869 6e67 5f71 +7565 7565 5f63 6170 6163 6974 7912 2354 +6865 2063 6170 6163 6974 7920 6f66 2074 +6865 2069 6e64 6578 696e 6720 7175 6575 +652e 1801 220b 1209 0900 0000 0000 00d0 +406d 0a2e 7072 6f6d 6574 6865 7573 5f6c +6f63 616c 5f73 746f 7261 6765 5f69 6e64 +6578 696e 675f 7175 6575 655f 6c65 6e67 +7468 122c 5468 6520 6e75 6d62 6572 206f +6620 6d65 7472 6963 7320 7761 6974 696e +6720 746f 2062 6520 696e 6465 7865 642e +1801 220b 1209 0900 0000 0000 0000 0067 +0a2f 7072 6f6d 6574 6865 7573 5f6c 6f63 +616c 5f73 746f 7261 6765 5f69 6e67 6573 +7465 645f 7361 6d70 6c65 735f 746f 7461 +6c12 2554 6865 2074 6f74 616c 206e 756d +6265 7220 6f66 2073 616d 706c 6573 2069 +6e67 6573 7465 642e 1800 220b 1a09 0900 +0000 0080 27cd 40c3 010a 3770 726f 6d65 +7468 6575 735f 6c6f 6361 6c5f 7374 6f72 +6167 655f 696e 7661 6c69 645f 7072 656c +6f61 645f 7265 7175 6573 7473 5f74 6f74 +616c 1279 5468 6520 746f 7461 6c20 6e75 +6d62 6572 206f 6620 7072 656c 6f61 6420 +7265 7175 6573 7473 2072 6566 6572 7269 +6e67 2074 6f20 6120 6e6f 6e2d 6578 6973 +7465 6e74 2073 6572 6965 732e 2054 6869 +7320 6973 2061 6e20 696e 6469 6361 7469 +6f6e 206f 6620 6f75 7464 6174 6564 206c +6162 656c 2069 6e64 6578 6573 2e18 0022 +0b1a 0909 0000 0000 0000 0000 6f0a 2a70 +726f 6d65 7468 6575 735f 6c6f 6361 6c5f +7374 6f72 6167 655f 6d65 6d6f 7279 5f63 +6875 6e6b 6465 7363 7312 3254 6865 2063 +7572 7265 6e74 206e 756d 6265 7220 6f66 +2063 6875 6e6b 2064 6573 6372 6970 746f +7273 2069 6e20 6d65 6d6f 7279 2e18 0122 +0b12 0909 0000 0000 0020 8f40 9c01 0a26 +7072 6f6d 6574 6865 7573 5f6c 6f63 616c +5f73 746f 7261 6765 5f6d 656d 6f72 795f +6368 756e 6b73 1263 5468 6520 6375 7272 +656e 7420 6e75 6d62 6572 206f 6620 6368 +756e 6b73 2069 6e20 6d65 6d6f 7279 2c20 +6578 636c 7564 696e 6720 636c 6f6e 6564 +2063 6875 6e6b 7320 2869 2e65 2e20 6368 +756e 6b73 2077 6974 686f 7574 2061 2064 +6573 6372 6970 746f 7229 2e18 0122 0b12 +0909 0000 0000 00e8 8d40 600a 2670 726f +6d65 7468 6575 735f 6c6f 6361 6c5f 7374 +6f72 6167 655f 6d65 6d6f 7279 5f73 6572 +6965 7312 2754 6865 2063 7572 7265 6e74 +206e 756d 6265 7220 6f66 2073 6572 6965 +7320 696e 206d 656d 6f72 792e 1801 220b +1209 0900 0000 0000 807a 40b7 010a 3570 +726f 6d65 7468 6575 735f 6c6f 6361 6c5f +7374 6f72 6167 655f 7065 7273 6973 745f +6c61 7465 6e63 795f 6d69 6372 6f73 6563 +6f6e 6473 1231 4120 7375 6d6d 6172 7920 +6f66 206c 6174 656e 6369 6573 2066 6f72 +2070 6572 7369 7374 696e 6720 6561 6368 +2063 6875 6e6b 2e18 0222 4922 4708 6f11 +1c2f dd24 e68c cc40 1a12 0900 0000 0000 +00e0 3f11 8d97 6e12 8360 3e40 1a12 09cd +cccc cccc ccec 3f11 0ad7 a370 3d62 6b40 +1a12 09ae 47e1 7a14 aeef 3f11 7b14 ae47 +e1b6 7240 6a0a 2f70 726f 6d65 7468 6575 +735f 6c6f 6361 6c5f 7374 6f72 6167 655f +7065 7273 6973 745f 7175 6575 655f 6361 +7061 6369 7479 1228 5468 6520 746f 7461 +6c20 6361 7061 6369 7479 206f 6620 7468 +6520 7065 7273 6973 7420 7175 6575 652e +1801 220b 1209 0900 0000 0000 0090 407a +0a2d 7072 6f6d 6574 6865 7573 5f6c 6f63 +616c 5f73 746f 7261 6765 5f70 6572 7369 +7374 5f71 7565 7565 5f6c 656e 6774 6812 +3a54 6865 2063 7572 7265 6e74 206e 756d +6265 7220 6f66 2063 6875 6e6b 7320 7761 +6974 696e 6720 696e 2074 6865 2070 6572 +7369 7374 2071 7565 7565 2e18 0122 0b12 +0909 0000 0000 0000 0000 ac01 0a29 7072 +6f6d 6574 6865 7573 5f6c 6f63 616c 5f73 +746f 7261 6765 5f73 6572 6965 735f 6f70 +735f 746f 7461 6c12 3454 6865 2074 6f74 +616c 206e 756d 6265 7220 6f66 2073 6572 +6965 7320 6f70 6572 6174 696f 6e73 2062 +7920 7468 6569 7220 7479 7065 2e18 0022 +1b0a 0e0a 0474 7970 6512 0663 7265 6174 +651a 0909 0000 0000 0000 0040 222a 0a1d +0a04 7479 7065 1215 6d61 696e 7465 6e61 +6e63 655f 696e 5f6d 656d 6f72 791a 0909 +0000 0000 0000 1440 d601 0a2d 7072 6f6d +6574 6865 7573 5f6e 6f74 6966 6963 6174 +696f 6e73 5f6c 6174 656e 6379 5f6d 696c +6c69 7365 636f 6e64 7312 584c 6174 656e +6379 2071 7561 6e74 696c 6573 2066 6f72 +2073 656e 6469 6e67 2061 6c65 7274 206e +6f74 6966 6963 6174 696f 6e73 2028 6e6f +7420 696e 636c 7564 696e 6720 6472 6f70 +7065 6420 6e6f 7469 6669 6361 7469 6f6e +7329 2e18 0222 4922 4708 0011 0000 0000 +0000 0000 1a12 0900 0000 0000 00e0 3f11 +0000 0000 0000 0000 1a12 09cd cccc cccc +ccec 3f11 0000 0000 0000 0000 1a12 09ae +47e1 7a14 aeef 3f11 0000 0000 0000 0000 +680a 2770 726f 6d65 7468 6575 735f 6e6f +7469 6669 6361 7469 6f6e 735f 7175 6575 +655f 6361 7061 6369 7479 122e 5468 6520 +6361 7061 6369 7479 206f 6620 7468 6520 +616c 6572 7420 6e6f 7469 6669 6361 7469 +6f6e 7320 7175 6575 652e 1801 220b 1209 +0900 0000 0000 0059 4067 0a25 7072 6f6d +6574 6865 7573 5f6e 6f74 6966 6963 6174 +696f 6e73 5f71 7565 7565 5f6c 656e 6774 +6812 2f54 6865 206e 756d 6265 7220 6f66 +2061 6c65 7274 206e 6f74 6966 6963 6174 +696f 6e73 2069 6e20 7468 6520 7175 6575 +652e 1801 220b 1209 0900 0000 0000 0000 +009e 020a 3070 726f 6d65 7468 6575 735f +7275 6c65 5f65 7661 6c75 6174 696f 6e5f +6475 7261 7469 6f6e 5f6d 696c 6c69 7365 +636f 6e64 7312 2354 6865 2064 7572 6174 +696f 6e20 666f 7220 6120 7275 6c65 2074 +6f20 6578 6563 7574 652e 1802 2260 0a15 +0a09 7275 6c65 5f74 7970 6512 0861 6c65 +7274 696e 6722 4708 3711 0000 0000 0000 +2840 1a12 0900 0000 0000 00e0 3f11 0000 +0000 0000 0000 1a12 09cd cccc cccc ccec +3f11 0000 0000 0000 0000 1a12 09ae 47e1 +7a14 aeef 3f11 0000 0000 0000 0840 2261 +0a16 0a09 7275 6c65 5f74 7970 6512 0972 +6563 6f72 6469 6e67 2247 0837 1100 0000 +0000 002e 401a 1209 0000 0000 0000 e03f +1100 0000 0000 0000 001a 1209 cdcc cccc +cccc ec3f 1100 0000 0000 0000 001a 1209 +ae47 e17a 14ae ef3f 1100 0000 0000 0008 +4069 0a29 7072 6f6d 6574 6865 7573 5f72 +756c 655f 6576 616c 7561 7469 6f6e 5f66 +6169 6c75 7265 735f 746f 7461 6c12 2d54 +6865 2074 6f74 616c 206e 756d 6265 7220 +6f66 2072 756c 6520 6576 616c 7561 7469 +6f6e 2066 6169 6c75 7265 732e 1800 220b +1a09 0900 0000 0000 0000 0060 0a21 7072 +6f6d 6574 6865 7573 5f73 616d 706c 6573 +5f71 7565 7565 5f63 6170 6163 6974 7912 +2c43 6170 6163 6974 7920 6f66 2074 6865 +2071 7565 7565 2066 6f72 2075 6e77 7269 +7474 656e 2073 616d 706c 6573 2e18 0122 +0b12 0909 0000 0000 0000 b040 da01 0a1f +7072 6f6d 6574 6865 7573 5f73 616d 706c +6573 5f71 7565 7565 5f6c 656e 6774 6812 +a701 4375 7272 656e 7420 6e75 6d62 6572 +206f 6620 6974 656d 7320 696e 2074 6865 +2071 7565 7565 2066 6f72 2075 6e77 7269 +7474 656e 2073 616d 706c 6573 2e20 4561 +6368 2069 7465 6d20 636f 6d70 7269 7365 +7320 616c 6c20 7361 6d70 6c65 7320 6578 +706f 7365 6420 6279 206f 6e65 2074 6172 +6765 7420 6173 206f 6e65 206d 6574 7269 +6320 6661 6d69 6c79 2028 692e 652e 206d +6574 7269 6373 206f 6620 7468 6520 7361 +6d65 206e 616d 6529 2e18 0122 0b12 0909 +0000 0000 0000 0000 d902 0a29 7072 6f6d +6574 6865 7573 5f74 6172 6765 745f 696e +7465 7276 616c 5f6c 656e 6774 685f 7365 +636f 6e64 7312 2141 6374 7561 6c20 696e +7465 7276 616c 7320 6265 7477 6565 6e20 +7363 7261 7065 732e 1802 2282 010a 0f0a +0869 6e74 6572 7661 6c12 0331 3573 226f +0804 1100 0000 0000 804d 401a 1209 7b14 +ae47 e17a 843f 1100 0000 0000 002c 401a +1209 9a99 9999 9999 a93f 1100 0000 0000 +002c 401a 1209 0000 0000 0000 e03f 1100 +0000 0000 002e 401a 1209 cdcc cccc cccc +ec3f 1100 0000 0000 002e 401a 1209 ae47 +e17a 14ae ef3f 1100 0000 0000 002e 4022 +8101 0a0e 0a08 696e 7465 7276 616c 1202 +3173 226f 083a 1100 0000 0000 003c 401a +1209 7b14 ae47 e17a 843f 1100 0000 0000 +0000 001a 1209 9a99 9999 9999 a93f 1100 +0000 0000 0000 001a 1209 0000 0000 0000 +e03f 1100 0000 0000 0000 001a 1209 cdcc +cccc cccc ec3f 1100 0000 0000 00f0 3f1a +1209 ae47 e17a 14ae ef3f 1100 0000 0000 +00f0 3f \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/prometheus/common/expfmt/testdata/protobuf.gz b/Godeps/_workspace/src/github.com/prometheus/common/expfmt/testdata/protobuf.gz new file mode 100644 index 000000000000..62fccb616501 --- /dev/null +++ b/Godeps/_workspace/src/github.com/prometheus/common/expfmt/testdata/protobuf.gz @@ -0,0 +1,129 @@ +1f8b 0808 efa0 c754 0003 7072 6f74 6f62 +7566 00ed 594d 8c1c c515 9eb1 8d3d 5b86 +6037 265e 8c4d ca03 c4bb ceee cc9a 9f58 +01cc f6ca 4424 041b 8837 21c8 24ed daee +9a99 cef6 1f55 d578 c7e4 b004 0e39 8088 +8448 048a 124b 4442 9110 e110 25b9 c54a +9072 01c5 9724 4a24 2472 413e 448a 8592 +1b87 bcea aeda eeea 99d9 3530 49a4 68e7 +b0bb 5355 fdde abf7 bef7 bdf7 7a3f 6ca0 +664f 88c4 61f4 8994 72e1 7829 23c2 8f23 +27f4 5d16 73ea c691 c7ad cf2d f628 fed2 +e2e2 c358 9dc3 0111 3472 7dca b11f e1f2 +d9d6 e496 e6a3 e86a b4a3 4722 2fa0 ccaa +b79b f737 6abb 6bea b3cf 9ac8 ff78 6fbe +bcf6 cedb f2f3 7763 ed8d fbff 766e cf1b +ff28 d69a df44 5621 7847 9bc0 2fc1 c727 +7e09 ed2d c45f dd26 89df 0ea9 60be 3b46 +1d67 d0f5 850e 94e9 008f b2fe f834 74d0 +8d85 865d 8506 8791 a84b ffa3 de12 8475 +e938 2352 f116 208c c701 e563 84d4 e368 +77a1 617b bbcb 48d2 1b9f f4d3 6857 21fd +aa76 8f92 647c c2bf 85ae 2b84 37da 5c40 +e6ba 6374 8de9 fc84 c590 0c3d 9aca f0de +bdfb f40b bffd 5763 fe9f 7659 8314 f0fb +9fbf 6897 35b4 dfbd 65fb d397 7f60 9735 +1c43 7f7e f5cd 975e b3df 6fa0 bd06 fb70 +ff1c 7596 fa82 720b 0f50 8edc cce8 263b +b0c9 339b 3cb3 c933 5afa ff2f cfc8 13f6 +5b17 ed01 0d73 cc1e d090 af99 1a60 ed3b +e8ba 32cd 7047 c482 04d6 cd8b f217 8ed2 +7089 321c 770c bae1 3824 1e6d 4dd6 9af7 +a29d 689b 1b7b d4da 7adb dcdc 085b d135 +68bb fc33 f6ac ad00 cd7d 13b9 b5ab 27ec +4b0d 34a9 b4f3 0470 45cb 2c77 b0c4 72f9 +ee26 cd7d 02ec 6cd2 dc26 cd7d 6ce1 ff73 +9a7b ef17 1f0e d2dc 1d3f 19a4 b9c6 f941 +9a43 e7ed c7d1 0d20 d5a5 9c3b 6e92 3a6a +2053 6437 9793 5dca 81ea c006 ccfb 5cd0 +101f 7ff8 6b58 f821 d04e 4223 2169 676d +8eab 3577 028d fd34 91dd dac5 f987 90a5 +8577 6316 a7c2 8f80 bf0e 9f5c 23cf 6215 +8b1e 11d8 4d19 0391 411f d315 9f8b d664 +bdb9 d352 b458 7bc4 7e00 5dab e585 64c5 +e9c0 9439 7582 acf8 611a 9618 3906 ab70 +c70f 28f6 2877 999f 8898 7153 d405 fb38 +daa5 45c9 f399 2c7c f2a3 c838 669f 4407 +b40c 6062 df03 cb9d 9086 31e4 79ce d437 +7d55 2de3 7c39 e3e9 124d 97c4 7de5 7b0b +2eda a7c5 018e 9870 a48f 7544 accf 9f92 +6bb9 dfc1 4040 0156 a741 6ae4 529c 46fe +0aa6 49ec f68c 88e4 3a8e a1bd b397 8efc +71e1 41b4 5feb 78d2 6722 2581 69f1 81af +e7ab 1b1a 8cad 0b0b 0e3a 5420 d2f1 22b0 +db73 8238 5e4e 13a7 43fc 2005 af28 24dd +2a6b 5611 a2fb 4e9e 9a3d 751f cecf 627d +56c3 47a3 ff21 f499 51f2 b5dc 03eb c8ad +c86b d87f a8a3 c325 81f4 4912 a404 025b +7e81 1104 bef6 f88c 94ad b770 2786 1c08 +02ac 9e82 25c0 6c0c 38a5 6e2a a82c b94f +34e3 c64e 95ba 4d99 6c4f ed91 e9f6 ac91 +e2af bc2c 3f3f 9bff 88f4 7079 7e90 1e2e +cfbf 5a47 5f28 5d28 885d 8827 871b 912e +75dc 1e75 9793 d88f c488 fb3d 6adc 6f2a +7b27 536c 4f63 1fd0 068e 94b7 2c64 0118 +6615 3654 5dce 9801 58d5 8353 69b4 5cc9 +925a ed83 3a9a 5ac7 4878 0432 50c7 f376 +6993 a8b4 58d9 2199 924c f97d a92f f1ef +332c fa49 d66e dd88 3e85 b6c9 2fd6 7697 +5122 a88e faaf 57ed e67e 74ad dadc 0122 +38f0 8ade bd70 da6e 4eca 4e2d dbdd 9af8 +d15a 0ff6 94dd bc09 ca52 be33 21a0 6e73 +d9ce e9fd f3cb 7673 1ff4 6ff9 fe55 6964 +3efb 561d dd33 f2ce 7ee4 01bb 455d 6789 +08b7 e7e4 6fc5 fa66 6c8e 3e92 9248 00ff +f00c 78d9 49ac 1fac be48 2b9e 9330 fc32 +d486 fa58 aacf 6fea 68f6 4a6f 9175 a0d6 +8269 f69a c1b9 fd79 973a 5504 5623 08c2 +921f 991e b8c0 6071 cbd7 aa17 182c 6eb0 +d641 731b db0f 8d59 0a40 2409 717d d187 +061f 10a8 bf69 a65d bb48 76d8 44f8 453b +44ad 2b55 13d0 a82b 7a39 b50c fae1 2cf1 +85d4 0219 b7a4 9452 af9a 4f5d d45e 475b +17c6 10ea 399c 8449 60b2 6f35 abd4 11ac +9f29 b3e5 eaa1 77ec dfd5 d1d1 7514 010d +fa9e 9330 1ac4 c4ab 4e49 fd61 0ad5 d962 +5862 b443 1953 1726 388a a3d9 acec cb82 +092d 07e0 bb85 177b 3e98 2849 46fa c377 +73b2 9215 3a15 1ea4 8107 c9b0 4403 e5ac +8112 121b 8c6f de41 15be 8c5d 6495 e7d6 +6d59 ecf3 1e64 807f 4a8d 4096 76d9 d346 +70f0 0bf6 8fea e8b3 57a4 905b ee3a ca4a +1a66 a0c4 b841 ea49 37b9 411c 51cd b3c0 +d82d dad2 5fce fa30 47a6 02dc 58d8 396d +5877 e979 fbcc c6c6 e57e b70e 0d37 2edf +1d71 fdd5 73f6 afea e8ce 911a 14f9 9608 +aff4 df82 230b 98a7 6148 5896 7305 c149 +1a51 0f4a 0f50 023c 925d 5933 45bc 7b7f +fbdd 5bde 7fee 6d83 299e ff61 643d 73e6 +5e83 29a0 254d 8e2d 2d1b 4c91 95e8 5f32 +fbdb eb24 95b6 bb42 1453 05c6 ab74 a19e +18c6 16df b7cf ad43 aaa6 2a45 1677 ad0b +14cd 1910 930d 54d7 6aaf d7d1 f448 dd79 +6c4b b5f8 8ea1 ac91 23e0 6315 6360 e4e6 +6174 406d 5e1f 12e8 2768 44a0 7905 3e51 +005c 3bbb c7fe 9359 7ea2 58f8 1d45 007c +78d5 fcc6 83f9 2adc be5c 8638 8db2 f4c9 +de55 6043 0e54 a358 f634 3ac3 3c16 2709 +a498 7168 ad2a 8d67 a8eb 196d b379 ad0a +c65a c38a d1b0 6b0c 09f7 6376 17dd ba81 +2285 b0b6 598e 8629 50f0 1a0a ab1f 6f31 +ea2c 4b03 ea14 6df2 88ee f3e6 c1ee 1acb +272b 4db5 1c80 2732 8919 681a 996d 1029 +88c6 51e5 d1a9 613d c215 46a3 6137 09fa +7459 c304 0303 9967 aa68 7d22 15be 9175 +55f7 5426 a5d9 6159 9739 a678 66e4 c474 +061d 2c69 d24d 4005 5433 c72b 80ca f6b3 +10a4 d159 e60b c821 dd1d 98a1 7ed3 fe6b +dd98 c94c 0d0a 4daf d58f 0f90 952f 6868 +8268 843e fc45 c9f0 f238 76e3 3061 8017 +9ecd 5dba 5da1 2b09 140d 4fd2 0e14 439c +bfee c284 67df f246 0adc 0350 ebab 02a9 +9b2b 7559 9003 5887 1fd3 5518 ff65 8b11 +a75c b223 398a 81e7 d5ed d6e6 f183 0b6e +3628 eb7d 2042 2ace 5279 1597 9124 7f0b +fbdd 3acc 1e0d 7dc4 da7a e44e 0e43 e2b6 +1c19 ab27 860c 8933 f6e0 9038 3304 7dad +214d 706b 4813 dcb2 9b4f d781 900b 23b6 +1c91 36dc a5f6 eff9 af0c aaff 06f1 48e5 +4433 2000 00 \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/prometheus/common/expfmt/testdata/test.gz b/Godeps/_workspace/src/github.com/prometheus/common/expfmt/testdata/test.gz new file mode 100644 index 000000000000..3f8199dfb26e --- /dev/null +++ b/Godeps/_workspace/src/github.com/prometheus/common/expfmt/testdata/test.gz @@ -0,0 +1,163 @@ +1f8b 0808 2aa1 c754 0003 7465 7874 00b5 +5b5d 939b 3816 7def 5fa1 ea79 99a9 4d3c +601b db3c f4c3 5426 55f3 309b ca6e 7ab7 +6a9e 281a d436 150c 04c4 a4bd 5df3 dff7 +4a88 361f 025d 094f 1e92 34e8 1cae 8ea4 +ab7b 04fd 03f9 ede3 ef9f c989 b122 28e9 +b79a 562c 88eb 3264 499e 05e7 242a f38a +4679 1657 e4f1 44c9 6f8f 8f9f 896c 46d2 +90d1 2c4a 6845 928c 749b aeee 7e20 8f7f +7cfe 8861 adea f339 2c2f 77fa a6af a730 +8b53 5a3e dcff 7cff ee5b 1d66 2c49 e9c3 +bdb3 f2ee ff22 ce12 027f 3101 9621 80ee +7659 90a8 28af 3366 8eeb 2042 f887 558b +7553 d158 a8a7 a4b1 d450 7259 2a69 84ee +e28a e4e7 3365 6512 dd40 d429 2e1b 6527 +b96c e5ed 10da 6a6c 4c31 0043 cbf2 7213 +9915 4c96 22ab 9816 48dc d02d 10d8 8440 +050d ca30 3bd2 db89 ace2 5b22 b592 6fa9 +e092 74a9 ec46 3403 0216 9647 7a8b cc3c +c565 29ba 9a6b 81e0 2de1 02b1 cd28 3a60 +f8b9 ca53 5a2d 2f1c 2698 2c44 9e62 b294 +f84a 6729 b029 4107 7a2c c3e2 b458 5a05 +8b85 ac2a 164b 491b 2a4b 394d c01d d889 +86c5 6225 c724 1642 2a48 2c75 144c 9632 +1a60 3ba8 8ac1 ed68 f96a 57f2 5868 a9e6 +b194 b325 b354 d40c 7e05 1665 0e45 dc89 +d68a bdca dd38 fbd5 7aef dd84 90cb e21e +bcc3 6ab7 59df 8690 336e 9cc3 7eb5 396c +8df5 eeb0 425c 7bff 70d8 ad3c 47fe 712d +46a0 4fe8 fa60 96c7 16bc 4afe 4783 a70b +a30a dfcd ef09 cf2d eeab cd76 07af 74d8 +d7fb 26b6 1a81 524c 6a0c 6a16 a675 cd9d +a67a abac 0c07 e98f d158 ac0c 5827 3c29 +c694 819d 9144 0fb1 34ba 6604 6889 4c2c +edb4 4e73 2674 4e2c 1cce cab1 9ac0 4dd4 +427a d359 ad26 fca4 4629 2d6a 81f5 3427 +31d6 0c6b 32f5 ca4d 5942 8c7e 7aac a587 +3423 3051 0fed 1667 959b f477 1ad5 1038 +2b33 6802 c7aa 6560 fb26 b59a b16a 334a +a150 c6ae 0e0b c5ea 83f4 6f93 da4c f8ae +195d b408 537b 8644 6215 c119 b149 41d4 +0e6a 460f 1dc0 c267 e1c1 5851 d08e 6a52 +9749 1f34 230d 0283 334c 6bdf b527 f017 +1368 1866 0cd0 66bb 3d1c b07a 619c 4e15 +b09c 8529 7914 7f67 f5f9 8996 247f ee39 +9e8a 9cc3 982a 8d4e 0b17 4fa6 e59d e2de +6b94 c7d0 edb5 e3dc bf53 4ac3 ff93 c70f +f7b0 8728 e3ac 0ac8 9c74 c292 3537 359e +6ccc 3030 65a3 0638 5786 87f9 96b0 79dc +8c31 1bb7 9d73 6673 1169 ad99 2918 ad85 +de9c e914 195b 2dbd 2e08 8cb1 3fb3 62c0 +eb84 7368 5ab1 d456 0ba1 1812 6868 d22c +f046 9269 6d1a 46b0 91e3 c2c9 a587 5939 +356b 1673 e1f4 5e0d 2ddf d870 1988 8800 +1bdb 352b 0623 0911 860d 239f c279 e1a4 +c300 0d3d 9b05 1e2d 19ca b5e9 0453 1a30 +bd5c 3898 8171 33c4 a245 d25a 379d 4023 +27a6 1747 0fc1 bb37 3328 5a16 9d7f d3a9 +32f4 637a 51b4 0823 0b67 8c46 2b83 3071 +3a71 148e 4caf 0f06 84f4 71ce d65f 4021 +7c98 e31d 9650 341c bb2d 52b1 9e27 5b6f +f79d 7758 5ae1 a6fc 1c5c 8f68 05cd 8b3a +685f 7a75 5d5d 5d81 a703 1252 5d2a 46cf +e4c3 e7ff 1096 9cc1 3515 3463 dc35 0d3f +1c9d 666c 8dde 740b 1819 6f18 d931 2ff3 +9a25 1938 af4f 6f16 b373 919d 4246 a2ba +2c21 9ef4 42e8 4b52 b151 309d f6c7 b03e +d23b c58d bd33 7cf4 397c 099e e38a fc33 +7c49 cef5 b963 7173 e83d 7986 7124 31ad +a232 2958 5e8e 2568 f1fd 47b6 570f aebf +1e3e 91f3 8a9b 9f0c 1ff5 06ec 3feb edf2 +7a34 e230 6992 1834 0bce f49c 432d d498 +db7f cbab a4b9 2acc f1d8 1bcf 73f4 4350 +b7f1 569b c3de f1fc 35fd 87b3 1f86 068b +bc64 019f 66ed fc20 5ff8 a566 e681 2630 +91db c610 6116 5152 67c9 0ba1 451e 9de6 +e6a4 82b8 1fac a281 bbda aed7 9bdd c1df +1e36 3b88 7624 e49f 49c9 ea30 edf7 efbf +cd45 9c8c 4a86 7e60 ca26 de6a eb6e f707 +dfe5 2a1e 3a71 c9a5 1ec4 1974 290e d23c +ff5a 17c1 7398 a435 0c47 bbc0 41c4 eb8c +fef5 d397 f75f 7e25 4d53 d236 ed86 8a22 +edac 7154 7b47 1735 225a 7d94 d8e8 da76 +7b45 54f4 cf30 ad43 587c dd4f 05d2 34e9 +7e63 dfde 21cf 3964 cd34 2512 0497 2051 +e590 9c68 5433 aa8a 5747 df9e 3ae1 21af +ddbd c671 c596 698b f696 a017 81c5 2725 +d660 5334 df70 89bb 3641 8839 45d6 1bc5 +9449 f308 966c 05d8 f048 83e8 44a3 af45 +9e64 0c33 837e 14bf 9871 bdfb 1349 20ff +c12c e5f3 e84a 0549 e5bd cc31 f218 45ec +d650 46c6 d0aa cebe 2a17 8761 606f a9c8 +12af 5ae4 430a 0815 76ab ee6a 6783 6365 +d186 6f87 a55c 504f 17be 1124 2561 9742 +b9a6 e69f a148 06b3 8057 fe98 87fb a8a4 +21e3 8706 9e7f 30c5 42ec 1594 27e2 6ba4 +ad31 38c9 00e8 af1d 5320 2bc3 ace2 27e9 +00df ba9e 29bc ceae 4fd6 8d63 92c5 5080 +65c7 e029 64d1 2968 7ecd e8d2 9f0d ff92 +0bb4 1259 5234 242d 6ef8 8b49 5798 7e7c +31cf 5664 5163 92f9 dcb6 8cce bf31 dd72 +3e91 1117 5234 29d2 359d 3dcd 8b99 fe74 +799b 28cd bc69 9afc 784d 126d 1284 95d6 +34f9 c978 e234 9ca6 3345 a046 5363 bd00 +ef2f c55b 1088 d136 c518 0fef b79a d690 +6dc2 228c 1276 11c9 feed 0759 ddbf 8db3 +686b 3086 036e cdd6 3505 7377 fc7b 53c3 +0ea5 343b b2d3 a052 6d27 e4f7 3061 bc3f +b07b 3fc9 eed1 d8b8 5ff2 1166 bd92 204c +f63e 5270 f971 5085 e722 a573 9bb1 6c41 +5a08 a627 4a72 ed2e 3c81 db38 dbbd bee6 +4a32 a8de 9238 284a 9ae6 613c 7a73 ade8 +996c 7a7d 815d d267 5a96 72ec 4292 e5d9 +7b71 c8c0 5d72 454b d8ab 5640 9480 16bc +f6e2 439b 444d 0dc7 dd7b cd62 4889 316c +6c4f 3495 e38e dacc 6603 47a8 368b d7cf +0569 3445 49c0 0f1e 9af2 549e b38c aab2 +ced1 84d8 b805 58df cbf1 4334 337b 0c70 +1dcf 37ea cc6c 473a d1bf 03b7 16a5 75cc +073e 4af3 8cb6 0535 94e6 2bba 6a7f f89e +b013 0c32 4c8c ab06 883d a71f 9141 af79 +8f11 8598 8434 f373 a2c7 f2a6 f978 4920 +2e6a d978 bbd6 e753 591e 778a 88ce 6f9b +ffd2 6ec9 3cf4 6b99 c88b 0289 e323 4543 +a80a 8450 fade cc3e 4ebb ffcf a147 75c0 +c659 6df6 fb1b 9035 47c6 9b95 b7f1 6fc1 +26e8 76eb dd6a bbdb d8f1 3515 8303 c3bb +9af5 16b3 1cb2 82d8 e3a7 88a2 8490 9971 +5048 4800 b68e 98e0 d74c f509 14ac 54d3 +1e75 6a88 c914 d596 12b0 7017 f710 5750 +2831 fa24 d42c 7d8d ad97 f9c1 ded7 8f9e +a2dd 1c87 88a1 b39f 2980 27a0 e730 8147 +6661 16f1 ad57 a63e f1a6 4521 5296 b3e4 +59d6 0895 daa7 fede 5c24 df7a e6a7 a299 +d88e c467 46a4 4703 1e28 e787 41ed 8e15 +9779 51c0 96d5 6ba4 dc97 10d1 2872 a11e +356f 930d f123 1f6b 8ab7 2018 3b5f 04a6 +c964 aaa5 d107 232c 906a 9427 d7f8 2cfb +6875 cfb6 761d 6cf8 4ac3 a30a 5b66 2aa3 +e8a7 32d3 4c5b 55dc 659d d2e0 7a0c 8f3e +bc27 1ca8 39b3 c771 2b56 0f0a f82a 5a35 +f945 880a eb5a f5ae fff6 bca3 c572 2bde +d189 048a 58bc 0557 91ff 3538 aac7 b135 +6fc6 27f8 fa25 8c71 bf4b b854 c67f c340 +4d10 2f1f a929 62f1 8bb7 8b87 eaca 0eda +9a4b 3b1e ab1e a1eb 2116 bce2 ade7 b004 +114b fd0a 997d fba9 a157 d41e 1a84 2a69 +b547 1d83 ccfc 61b0 4388 db22 5dd5 d9f7 +3261 b01f b507 33aa d027 5847 1976 a2dd +d6f1 77da 5865 26fe 30aa 5d13 46cf fd8d +6022 70f2 915b 38de 1cc4 3c17 25cc 854a +bc4b 6d8f 9ce8 4b01 c621 e665 22b8 72d2 +7c8e 48c2 4afc d41c b7c1 08c2 34ba 48a7 +de1e c149 d580 07f6 2bf8 4b59 0e29 bba3 +9168 66fb 69a2 0b78 7558 c214 904d df3e +2ef8 2512 5f09 b4b7 a1f6 a5ec 3be5 6a44 +6558 a887 5143 a9d8 6ee6 11af edf5 877b +d71b 7ca2 245e 1bbb db1b 9179 3724 f346 +19c5 9ecb bf25 9729 9948 997d 42fe 7ad0 +84a1 c992 238e b55d 8f54 53c0 b90d d568 +1fb4 a6ba 1dd3 e813 017b 2643 aae1 c8f3 +41f3 168d 7bf3 71df feee ff2d f9e8 431a +5200 00 \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/prometheus/client_golang/text/testdata/text b/Godeps/_workspace/src/github.com/prometheus/common/expfmt/testdata/text similarity index 99% rename from Godeps/_workspace/src/github.com/prometheus/client_golang/text/testdata/text rename to Godeps/_workspace/src/github.com/prometheus/common/expfmt/testdata/text index 1b2b30221313..f3d8c3784436 100644 --- a/Godeps/_workspace/src/github.com/prometheus/client_golang/text/testdata/text +++ b/Godeps/_workspace/src/github.com/prometheus/common/expfmt/testdata/text @@ -175,9 +175,9 @@ http_response_size_bytes_count{handler="prometheus"} 119 # HELP process_cpu_seconds_total Total user and system CPU time spent in seconds. # TYPE process_cpu_seconds_total counter process_cpu_seconds_total 0.55 -# HELP process_goroutines Number of goroutines that currently exist. -# TYPE process_goroutines gauge -process_goroutines 70 +# HELP go_goroutines Number of goroutines that currently exist. +# TYPE go_goroutines gauge +go_goroutines 70 # HELP process_max_fds Maximum number of open file descriptors. # TYPE process_max_fds gauge process_max_fds 8192 diff --git a/Godeps/_workspace/src/github.com/prometheus/common/expfmt/text_create.go b/Godeps/_workspace/src/github.com/prometheus/common/expfmt/text_create.go new file mode 100644 index 000000000000..0bb9c14cc2b6 --- /dev/null +++ b/Godeps/_workspace/src/github.com/prometheus/common/expfmt/text_create.go @@ -0,0 +1,305 @@ +// Copyright 2014 The Prometheus 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 expfmt + +import ( + "bytes" + "fmt" + "io" + "math" + "strings" + + dto "github.com/prometheus/client_model/go" + "github.com/prometheus/common/model" +) + +// MetricFamilyToText converts a MetricFamily proto message into text format and +// writes the resulting lines to 'out'. It returns the number of bytes written +// and any error encountered. This function does not perform checks on the +// content of the metric and label names, i.e. invalid metric or label names +// will result in invalid text format output. +// This method fulfills the type 'prometheus.encoder'. +func MetricFamilyToText(out io.Writer, in *dto.MetricFamily) (int, error) { + var written int + + // Fail-fast checks. + if len(in.Metric) == 0 { + return written, fmt.Errorf("MetricFamily has no metrics: %s", in) + } + name := in.GetName() + if name == "" { + return written, fmt.Errorf("MetricFamily has no name: %s", in) + } + + // Comments, first HELP, then TYPE. + if in.Help != nil { + n, err := fmt.Fprintf( + out, "# HELP %s %s\n", + name, escapeString(*in.Help, false), + ) + written += n + if err != nil { + return written, err + } + } + metricType := in.GetType() + n, err := fmt.Fprintf( + out, "# TYPE %s %s\n", + name, strings.ToLower(metricType.String()), + ) + written += n + if err != nil { + return written, err + } + + // Finally the samples, one line for each. + for _, metric := range in.Metric { + switch metricType { + case dto.MetricType_COUNTER: + if metric.Counter == nil { + return written, fmt.Errorf( + "expected counter in metric %s %s", name, metric, + ) + } + n, err = writeSample( + name, metric, "", "", + metric.Counter.GetValue(), + out, + ) + case dto.MetricType_GAUGE: + if metric.Gauge == nil { + return written, fmt.Errorf( + "expected gauge in metric %s %s", name, metric, + ) + } + n, err = writeSample( + name, metric, "", "", + metric.Gauge.GetValue(), + out, + ) + case dto.MetricType_UNTYPED: + if metric.Untyped == nil { + return written, fmt.Errorf( + "expected untyped in metric %s %s", name, metric, + ) + } + n, err = writeSample( + name, metric, "", "", + metric.Untyped.GetValue(), + out, + ) + case dto.MetricType_SUMMARY: + if metric.Summary == nil { + return written, fmt.Errorf( + "expected summary in metric %s %s", name, metric, + ) + } + for _, q := range metric.Summary.Quantile { + n, err = writeSample( + name, metric, + model.QuantileLabel, fmt.Sprint(q.GetQuantile()), + q.GetValue(), + out, + ) + written += n + if err != nil { + return written, err + } + } + n, err = writeSample( + name+"_sum", metric, "", "", + metric.Summary.GetSampleSum(), + out, + ) + if err != nil { + return written, err + } + written += n + n, err = writeSample( + name+"_count", metric, "", "", + float64(metric.Summary.GetSampleCount()), + out, + ) + case dto.MetricType_HISTOGRAM: + if metric.Histogram == nil { + return written, fmt.Errorf( + "expected histogram in metric %s %s", name, metric, + ) + } + infSeen := false + for _, q := range metric.Histogram.Bucket { + n, err = writeSample( + name+"_bucket", metric, + model.BucketLabel, fmt.Sprint(q.GetUpperBound()), + float64(q.GetCumulativeCount()), + out, + ) + written += n + if err != nil { + return written, err + } + if math.IsInf(q.GetUpperBound(), +1) { + infSeen = true + } + } + if !infSeen { + n, err = writeSample( + name+"_bucket", metric, + model.BucketLabel, "+Inf", + float64(metric.Histogram.GetSampleCount()), + out, + ) + if err != nil { + return written, err + } + written += n + } + n, err = writeSample( + name+"_sum", metric, "", "", + metric.Histogram.GetSampleSum(), + out, + ) + if err != nil { + return written, err + } + written += n + n, err = writeSample( + name+"_count", metric, "", "", + float64(metric.Histogram.GetSampleCount()), + out, + ) + default: + return written, fmt.Errorf( + "unexpected type in metric %s %s", name, metric, + ) + } + written += n + if err != nil { + return written, err + } + } + return written, nil +} + +// writeSample writes a single sample in text format to out, given the metric +// name, the metric proto message itself, optionally an additional label name +// and value (use empty strings if not required), and the value. The function +// returns the number of bytes written and any error encountered. +func writeSample( + name string, + metric *dto.Metric, + additionalLabelName, additionalLabelValue string, + value float64, + out io.Writer, +) (int, error) { + var written int + n, err := fmt.Fprint(out, name) + written += n + if err != nil { + return written, err + } + n, err = labelPairsToText( + metric.Label, + additionalLabelName, additionalLabelValue, + out, + ) + written += n + if err != nil { + return written, err + } + n, err = fmt.Fprintf(out, " %v", value) + written += n + if err != nil { + return written, err + } + if metric.TimestampMs != nil { + n, err = fmt.Fprintf(out, " %v", *metric.TimestampMs) + written += n + if err != nil { + return written, err + } + } + n, err = out.Write([]byte{'\n'}) + written += n + if err != nil { + return written, err + } + return written, nil +} + +// labelPairsToText converts a slice of LabelPair proto messages plus the +// explicitly given additional label pair into text formatted as required by the +// text format and writes it to 'out'. An empty slice in combination with an +// empty string 'additionalLabelName' results in nothing being +// written. Otherwise, the label pairs are written, escaped as required by the +// text format, and enclosed in '{...}'. The function returns the number of +// bytes written and any error encountered. +func labelPairsToText( + in []*dto.LabelPair, + additionalLabelName, additionalLabelValue string, + out io.Writer, +) (int, error) { + if len(in) == 0 && additionalLabelName == "" { + return 0, nil + } + var written int + separator := '{' + for _, lp := range in { + n, err := fmt.Fprintf( + out, `%c%s="%s"`, + separator, lp.GetName(), escapeString(lp.GetValue(), true), + ) + written += n + if err != nil { + return written, err + } + separator = ',' + } + if additionalLabelName != "" { + n, err := fmt.Fprintf( + out, `%c%s="%s"`, + separator, additionalLabelName, + escapeString(additionalLabelValue, true), + ) + written += n + if err != nil { + return written, err + } + } + n, err := out.Write([]byte{'}'}) + written += n + if err != nil { + return written, err + } + return written, nil +} + +// escapeString replaces '\' by '\\', new line character by '\n', and - if +// includeDoubleQuote is true - '"' by '\"'. +func escapeString(v string, includeDoubleQuote bool) string { + result := bytes.NewBuffer(make([]byte, 0, len(v))) + for _, c := range v { + switch { + case c == '\\': + result.WriteString(`\\`) + case includeDoubleQuote && c == '"': + result.WriteString(`\"`) + case c == '\n': + result.WriteString(`\n`) + default: + result.WriteRune(c) + } + } + return result.String() +} diff --git a/Godeps/_workspace/src/github.com/prometheus/common/expfmt/text_create_test.go b/Godeps/_workspace/src/github.com/prometheus/common/expfmt/text_create_test.go new file mode 100644 index 000000000000..e4cc5d803bb8 --- /dev/null +++ b/Godeps/_workspace/src/github.com/prometheus/common/expfmt/text_create_test.go @@ -0,0 +1,443 @@ +// Copyright 2014 The Prometheus 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 expfmt + +import ( + "bytes" + "math" + "strings" + "testing" + + "github.com/golang/protobuf/proto" + + dto "github.com/prometheus/client_model/go" +) + +func testCreate(t testing.TB) { + var scenarios = []struct { + in *dto.MetricFamily + out string + }{ + // 0: Counter, NaN as value, timestamp given. + { + in: &dto.MetricFamily{ + Name: proto.String("name"), + Help: proto.String("two-line\n doc str\\ing"), + Type: dto.MetricType_COUNTER.Enum(), + Metric: []*dto.Metric{ + &dto.Metric{ + Label: []*dto.LabelPair{ + &dto.LabelPair{ + Name: proto.String("labelname"), + Value: proto.String("val1"), + }, + &dto.LabelPair{ + Name: proto.String("basename"), + Value: proto.String("basevalue"), + }, + }, + Counter: &dto.Counter{ + Value: proto.Float64(math.NaN()), + }, + }, + &dto.Metric{ + Label: []*dto.LabelPair{ + &dto.LabelPair{ + Name: proto.String("labelname"), + Value: proto.String("val2"), + }, + &dto.LabelPair{ + Name: proto.String("basename"), + Value: proto.String("basevalue"), + }, + }, + Counter: &dto.Counter{ + Value: proto.Float64(.23), + }, + TimestampMs: proto.Int64(1234567890), + }, + }, + }, + out: `# HELP name two-line\n doc str\\ing +# TYPE name counter +name{labelname="val1",basename="basevalue"} NaN +name{labelname="val2",basename="basevalue"} 0.23 1234567890 +`, + }, + // 1: Gauge, some escaping required, +Inf as value, multi-byte characters in label values. + { + in: &dto.MetricFamily{ + Name: proto.String("gauge_name"), + Help: proto.String("gauge\ndoc\nstr\"ing"), + Type: dto.MetricType_GAUGE.Enum(), + Metric: []*dto.Metric{ + &dto.Metric{ + Label: []*dto.LabelPair{ + &dto.LabelPair{ + Name: proto.String("name_1"), + Value: proto.String("val with\nnew line"), + }, + &dto.LabelPair{ + Name: proto.String("name_2"), + Value: proto.String("val with \\backslash and \"quotes\""), + }, + }, + Gauge: &dto.Gauge{ + Value: proto.Float64(math.Inf(+1)), + }, + }, + &dto.Metric{ + Label: []*dto.LabelPair{ + &dto.LabelPair{ + Name: proto.String("name_1"), + Value: proto.String("Björn"), + }, + &dto.LabelPair{ + Name: proto.String("name_2"), + Value: proto.String("佖佥"), + }, + }, + Gauge: &dto.Gauge{ + Value: proto.Float64(3.14E42), + }, + }, + }, + }, + out: `# HELP gauge_name gauge\ndoc\nstr"ing +# TYPE gauge_name gauge +gauge_name{name_1="val with\nnew line",name_2="val with \\backslash and \"quotes\""} +Inf +gauge_name{name_1="Björn",name_2="佖佥"} 3.14e+42 +`, + }, + // 2: Untyped, no help, one sample with no labels and -Inf as value, another sample with one label. + { + in: &dto.MetricFamily{ + Name: proto.String("untyped_name"), + Type: dto.MetricType_UNTYPED.Enum(), + Metric: []*dto.Metric{ + &dto.Metric{ + Untyped: &dto.Untyped{ + Value: proto.Float64(math.Inf(-1)), + }, + }, + &dto.Metric{ + Label: []*dto.LabelPair{ + &dto.LabelPair{ + Name: proto.String("name_1"), + Value: proto.String("value 1"), + }, + }, + Untyped: &dto.Untyped{ + Value: proto.Float64(-1.23e-45), + }, + }, + }, + }, + out: `# TYPE untyped_name untyped +untyped_name -Inf +untyped_name{name_1="value 1"} -1.23e-45 +`, + }, + // 3: Summary. + { + in: &dto.MetricFamily{ + Name: proto.String("summary_name"), + Help: proto.String("summary docstring"), + Type: dto.MetricType_SUMMARY.Enum(), + Metric: []*dto.Metric{ + &dto.Metric{ + Summary: &dto.Summary{ + SampleCount: proto.Uint64(42), + SampleSum: proto.Float64(-3.4567), + Quantile: []*dto.Quantile{ + &dto.Quantile{ + Quantile: proto.Float64(0.5), + Value: proto.Float64(-1.23), + }, + &dto.Quantile{ + Quantile: proto.Float64(0.9), + Value: proto.Float64(.2342354), + }, + &dto.Quantile{ + Quantile: proto.Float64(0.99), + Value: proto.Float64(0), + }, + }, + }, + }, + &dto.Metric{ + Label: []*dto.LabelPair{ + &dto.LabelPair{ + Name: proto.String("name_1"), + Value: proto.String("value 1"), + }, + &dto.LabelPair{ + Name: proto.String("name_2"), + Value: proto.String("value 2"), + }, + }, + Summary: &dto.Summary{ + SampleCount: proto.Uint64(4711), + SampleSum: proto.Float64(2010.1971), + Quantile: []*dto.Quantile{ + &dto.Quantile{ + Quantile: proto.Float64(0.5), + Value: proto.Float64(1), + }, + &dto.Quantile{ + Quantile: proto.Float64(0.9), + Value: proto.Float64(2), + }, + &dto.Quantile{ + Quantile: proto.Float64(0.99), + Value: proto.Float64(3), + }, + }, + }, + }, + }, + }, + out: `# HELP summary_name summary docstring +# TYPE summary_name summary +summary_name{quantile="0.5"} -1.23 +summary_name{quantile="0.9"} 0.2342354 +summary_name{quantile="0.99"} 0 +summary_name_sum -3.4567 +summary_name_count 42 +summary_name{name_1="value 1",name_2="value 2",quantile="0.5"} 1 +summary_name{name_1="value 1",name_2="value 2",quantile="0.9"} 2 +summary_name{name_1="value 1",name_2="value 2",quantile="0.99"} 3 +summary_name_sum{name_1="value 1",name_2="value 2"} 2010.1971 +summary_name_count{name_1="value 1",name_2="value 2"} 4711 +`, + }, + // 4: Histogram + { + in: &dto.MetricFamily{ + Name: proto.String("request_duration_microseconds"), + Help: proto.String("The response latency."), + Type: dto.MetricType_HISTOGRAM.Enum(), + Metric: []*dto.Metric{ + &dto.Metric{ + Histogram: &dto.Histogram{ + SampleCount: proto.Uint64(2693), + SampleSum: proto.Float64(1756047.3), + Bucket: []*dto.Bucket{ + &dto.Bucket{ + UpperBound: proto.Float64(100), + CumulativeCount: proto.Uint64(123), + }, + &dto.Bucket{ + UpperBound: proto.Float64(120), + CumulativeCount: proto.Uint64(412), + }, + &dto.Bucket{ + UpperBound: proto.Float64(144), + CumulativeCount: proto.Uint64(592), + }, + &dto.Bucket{ + UpperBound: proto.Float64(172.8), + CumulativeCount: proto.Uint64(1524), + }, + &dto.Bucket{ + UpperBound: proto.Float64(math.Inf(+1)), + CumulativeCount: proto.Uint64(2693), + }, + }, + }, + }, + }, + }, + out: `# 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 +`, + }, + // 5: Histogram with missing +Inf bucket. + { + in: &dto.MetricFamily{ + Name: proto.String("request_duration_microseconds"), + Help: proto.String("The response latency."), + Type: dto.MetricType_HISTOGRAM.Enum(), + Metric: []*dto.Metric{ + &dto.Metric{ + Histogram: &dto.Histogram{ + SampleCount: proto.Uint64(2693), + SampleSum: proto.Float64(1756047.3), + Bucket: []*dto.Bucket{ + &dto.Bucket{ + UpperBound: proto.Float64(100), + CumulativeCount: proto.Uint64(123), + }, + &dto.Bucket{ + UpperBound: proto.Float64(120), + CumulativeCount: proto.Uint64(412), + }, + &dto.Bucket{ + UpperBound: proto.Float64(144), + CumulativeCount: proto.Uint64(592), + }, + &dto.Bucket{ + UpperBound: proto.Float64(172.8), + CumulativeCount: proto.Uint64(1524), + }, + }, + }, + }, + }, + }, + out: `# 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 +`, + }, + // 6: No metric type, should result in default type Counter. + { + in: &dto.MetricFamily{ + Name: proto.String("name"), + Help: proto.String("doc string"), + Metric: []*dto.Metric{ + &dto.Metric{ + Counter: &dto.Counter{ + Value: proto.Float64(math.Inf(-1)), + }, + }, + }, + }, + out: `# HELP name doc string +# TYPE name counter +name -Inf +`, + }, + } + + for i, scenario := range scenarios { + out := bytes.NewBuffer(make([]byte, 0, len(scenario.out))) + n, err := MetricFamilyToText(out, scenario.in) + if err != nil { + t.Errorf("%d. error: %s", i, err) + continue + } + if expected, got := len(scenario.out), n; expected != got { + t.Errorf( + "%d. expected %d bytes written, got %d", + i, expected, got, + ) + } + if expected, got := scenario.out, out.String(); expected != got { + t.Errorf( + "%d. expected out=%q, got %q", + i, expected, got, + ) + } + } + +} + +func TestCreate(t *testing.T) { + testCreate(t) +} + +func BenchmarkCreate(b *testing.B) { + for i := 0; i < b.N; i++ { + testCreate(b) + } +} + +func testCreateError(t testing.TB) { + var scenarios = []struct { + in *dto.MetricFamily + err string + }{ + // 0: No metric. + { + in: &dto.MetricFamily{ + Name: proto.String("name"), + Help: proto.String("doc string"), + Type: dto.MetricType_COUNTER.Enum(), + Metric: []*dto.Metric{}, + }, + err: "MetricFamily has no metrics", + }, + // 1: No metric name. + { + in: &dto.MetricFamily{ + Help: proto.String("doc string"), + Type: dto.MetricType_UNTYPED.Enum(), + Metric: []*dto.Metric{ + &dto.Metric{ + Untyped: &dto.Untyped{ + Value: proto.Float64(math.Inf(-1)), + }, + }, + }, + }, + err: "MetricFamily has no name", + }, + // 2: Wrong type. + { + in: &dto.MetricFamily{ + Name: proto.String("name"), + Help: proto.String("doc string"), + Type: dto.MetricType_COUNTER.Enum(), + Metric: []*dto.Metric{ + &dto.Metric{ + Untyped: &dto.Untyped{ + Value: proto.Float64(math.Inf(-1)), + }, + }, + }, + }, + err: "expected counter in metric", + }, + } + + for i, scenario := range scenarios { + var out bytes.Buffer + _, err := MetricFamilyToText(&out, scenario.in) + if err == nil { + t.Errorf("%d. expected error, got nil", i) + continue + } + if expected, got := scenario.err, err.Error(); strings.Index(got, expected) != 0 { + t.Errorf( + "%d. expected error starting with %q, got %q", + i, expected, got, + ) + } + } + +} + +func TestCreateError(t *testing.T) { + testCreateError(t) +} + +func BenchmarkCreateError(b *testing.B) { + for i := 0; i < b.N; i++ { + testCreateError(b) + } +} diff --git a/Godeps/_workspace/src/github.com/prometheus/common/expfmt/text_parse.go b/Godeps/_workspace/src/github.com/prometheus/common/expfmt/text_parse.go new file mode 100644 index 000000000000..84433bc4f6ef --- /dev/null +++ b/Godeps/_workspace/src/github.com/prometheus/common/expfmt/text_parse.go @@ -0,0 +1,746 @@ +// Copyright 2014 The Prometheus 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 expfmt + +import ( + "bufio" + "bytes" + "fmt" + "io" + "math" + "strconv" + "strings" + + dto "github.com/prometheus/client_model/go" + + "github.com/golang/protobuf/proto" + "github.com/prometheus/common/model" +) + +// A stateFn is a function that represents a state in a state machine. By +// executing it, the state is progressed to the next state. The stateFn returns +// another stateFn, which represents the new state. The end state is represented +// by nil. +type stateFn func() stateFn + +// ParseError signals errors while parsing the simple and flat text-based +// exchange format. +type ParseError struct { + Line int + Msg string +} + +// Error implements the error interface. +func (e ParseError) Error() string { + return fmt.Sprintf("text format parsing error in line %d: %s", e.Line, e.Msg) +} + +// TextParser is used to parse the simple and flat text-based exchange format. Its +// nil value is ready to use. +type TextParser struct { + metricFamiliesByName map[string]*dto.MetricFamily + buf *bufio.Reader // Where the parsed input is read through. + err error // Most recent error. + lineCount int // Tracks the line count for error messages. + currentByte byte // The most recent byte read. + currentToken bytes.Buffer // Re-used each time a token has to be gathered from multiple bytes. + currentMF *dto.MetricFamily + currentMetric *dto.Metric + currentLabelPair *dto.LabelPair + + // The remaining member variables are only used for summaries/histograms. + currentLabels map[string]string // All labels including '__name__' but excluding 'quantile'/'le' + // Summary specific. + summaries map[uint64]*dto.Metric // Key is created with LabelsToSignature. + currentQuantile float64 + // Histogram specific. + histograms map[uint64]*dto.Metric // Key is created with LabelsToSignature. + currentBucket float64 + // These tell us if the currently processed line ends on '_count' or + // '_sum' respectively and belong to a summary/histogram, representing the sample + // count and sum of that summary/histogram. + currentIsSummaryCount, currentIsSummarySum bool + currentIsHistogramCount, currentIsHistogramSum bool +} + +// TextToMetricFamilies reads 'in' as the simple and flat text-based exchange +// format and creates MetricFamily proto messages. It returns the MetricFamily +// proto messages in a map where the metric names are the keys, along with any +// error encountered. +// +// If the input contains duplicate metrics (i.e. lines with the same metric name +// and exactly the same label set), the resulting MetricFamily will contain +// duplicate Metric proto messages. Similar is true for duplicate label +// names. Checks for duplicates have to be performed separately, if required. +// Also note that neither the metrics within each MetricFamily are sorted nor +// the label pairs within each Metric. Sorting is not required for the most +// frequent use of this method, which is sample ingestion in the Prometheus +// server. However, for presentation purposes, you might want to sort the +// metrics, and in some cases, you must sort the labels, e.g. for consumption by +// the metric family injection hook of the Prometheus registry. +// +// Summaries and histograms are rather special beasts. You would probably not +// use them in the simple text format anyway. This method can deal with +// summaries and histograms if they are presented in exactly the way the +// text.Create function creates them. +// +// This method must not be called concurrently. If you want to parse different +// input concurrently, instantiate a separate Parser for each goroutine. +func (p *TextParser) TextToMetricFamilies(in io.Reader) (map[string]*dto.MetricFamily, error) { + p.reset(in) + for nextState := p.startOfLine; nextState != nil; nextState = nextState() { + // Magic happens here... + } + // Get rid of empty metric families. + for k, mf := range p.metricFamiliesByName { + if len(mf.GetMetric()) == 0 { + delete(p.metricFamiliesByName, k) + } + } + return p.metricFamiliesByName, p.err +} + +func (p *TextParser) reset(in io.Reader) { + p.metricFamiliesByName = map[string]*dto.MetricFamily{} + if p.buf == nil { + p.buf = bufio.NewReader(in) + } else { + p.buf.Reset(in) + } + p.err = nil + p.lineCount = 0 + if p.summaries == nil || len(p.summaries) > 0 { + p.summaries = map[uint64]*dto.Metric{} + } + if p.histograms == nil || len(p.histograms) > 0 { + p.histograms = map[uint64]*dto.Metric{} + } + p.currentQuantile = math.NaN() + p.currentBucket = math.NaN() +} + +// startOfLine represents the state where the next byte read from p.buf is the +// start of a line (or whitespace leading up to it). +func (p *TextParser) startOfLine() stateFn { + p.lineCount++ + if p.skipBlankTab(); p.err != nil { + // End of input reached. This is the only case where + // that is not an error but a signal that we are done. + p.err = nil + return nil + } + switch p.currentByte { + case '#': + return p.startComment + case '\n': + return p.startOfLine // Empty line, start the next one. + } + return p.readingMetricName +} + +// startComment represents the state where the next byte read from p.buf is the +// start of a comment (or whitespace leading up to it). +func (p *TextParser) startComment() stateFn { + if p.skipBlankTab(); p.err != nil { + return nil // Unexpected end of input. + } + if p.currentByte == '\n' { + return p.startOfLine + } + if p.readTokenUntilWhitespace(); p.err != nil { + return nil // Unexpected end of input. + } + // If we have hit the end of line already, there is nothing left + // to do. This is not considered a syntax error. + if p.currentByte == '\n' { + return p.startOfLine + } + keyword := p.currentToken.String() + if keyword != "HELP" && keyword != "TYPE" { + // Generic comment, ignore by fast forwarding to end of line. + for p.currentByte != '\n' { + if p.currentByte, p.err = p.buf.ReadByte(); p.err != nil { + return nil // Unexpected end of input. + } + } + return p.startOfLine + } + // There is something. Next has to be a metric name. + if p.skipBlankTab(); p.err != nil { + return nil // Unexpected end of input. + } + if p.readTokenAsMetricName(); p.err != nil { + return nil // Unexpected end of input. + } + if p.currentByte == '\n' { + // At the end of the line already. + // Again, this is not considered a syntax error. + return p.startOfLine + } + if !isBlankOrTab(p.currentByte) { + p.parseError("invalid metric name in comment") + return nil + } + p.setOrCreateCurrentMF() + if p.skipBlankTab(); p.err != nil { + return nil // Unexpected end of input. + } + if p.currentByte == '\n' { + // At the end of the line already. + // Again, this is not considered a syntax error. + return p.startOfLine + } + switch keyword { + case "HELP": + return p.readingHelp + case "TYPE": + return p.readingType + } + panic(fmt.Sprintf("code error: unexpected keyword %q", keyword)) +} + +// readingMetricName represents the state where the last byte read (now in +// p.currentByte) is the first byte of a metric name. +func (p *TextParser) readingMetricName() stateFn { + if p.readTokenAsMetricName(); p.err != nil { + return nil + } + if p.currentToken.Len() == 0 { + p.parseError("invalid metric name") + return nil + } + p.setOrCreateCurrentMF() + // Now is the time to fix the type if it hasn't happened yet. + if p.currentMF.Type == nil { + p.currentMF.Type = dto.MetricType_UNTYPED.Enum() + } + p.currentMetric = &dto.Metric{} + // Do not append the newly created currentMetric to + // currentMF.Metric right now. First wait if this is a summary, + // and the metric exists already, which we can only know after + // having read all the labels. + if p.skipBlankTabIfCurrentBlankTab(); p.err != nil { + return nil // Unexpected end of input. + } + return p.readingLabels +} + +// readingLabels represents the state where the last byte read (now in +// p.currentByte) is either the first byte of the label set (i.e. a '{'), or the +// first byte of the value (otherwise). +func (p *TextParser) readingLabels() stateFn { + // Summaries/histograms are special. We have to reset the + // currentLabels map, currentQuantile and currentBucket before starting to + // read labels. + if p.currentMF.GetType() == dto.MetricType_SUMMARY || p.currentMF.GetType() == dto.MetricType_HISTOGRAM { + p.currentLabels = map[string]string{} + p.currentLabels[string(model.MetricNameLabel)] = p.currentMF.GetName() + p.currentQuantile = math.NaN() + p.currentBucket = math.NaN() + } + if p.currentByte != '{' { + return p.readingValue + } + return p.startLabelName +} + +// startLabelName represents the state where the next byte read from p.buf is +// the start of a label name (or whitespace leading up to it). +func (p *TextParser) startLabelName() stateFn { + if p.skipBlankTab(); p.err != nil { + return nil // Unexpected end of input. + } + if p.currentByte == '}' { + if p.skipBlankTab(); p.err != nil { + return nil // Unexpected end of input. + } + return p.readingValue + } + if p.readTokenAsLabelName(); p.err != nil { + return nil // Unexpected end of input. + } + if p.currentToken.Len() == 0 { + p.parseError(fmt.Sprintf("invalid label name for metric %q", p.currentMF.GetName())) + return nil + } + p.currentLabelPair = &dto.LabelPair{Name: proto.String(p.currentToken.String())} + if p.currentLabelPair.GetName() == string(model.MetricNameLabel) { + p.parseError(fmt.Sprintf("label name %q is reserved", model.MetricNameLabel)) + return nil + } + // Special summary/histogram treatment. Don't add 'quantile' and 'le' + // labels to 'real' labels. + if !(p.currentMF.GetType() == dto.MetricType_SUMMARY && p.currentLabelPair.GetName() == model.QuantileLabel) && + !(p.currentMF.GetType() == dto.MetricType_HISTOGRAM && p.currentLabelPair.GetName() == model.BucketLabel) { + p.currentMetric.Label = append(p.currentMetric.Label, p.currentLabelPair) + } + if p.skipBlankTabIfCurrentBlankTab(); p.err != nil { + return nil // Unexpected end of input. + } + if p.currentByte != '=' { + p.parseError(fmt.Sprintf("expected '=' after label name, found %q", p.currentByte)) + return nil + } + return p.startLabelValue +} + +// startLabelValue represents the state where the next byte read from p.buf is +// the start of a (quoted) label value (or whitespace leading up to it). +func (p *TextParser) startLabelValue() stateFn { + if p.skipBlankTab(); p.err != nil { + return nil // Unexpected end of input. + } + if p.currentByte != '"' { + p.parseError(fmt.Sprintf("expected '\"' at start of label value, found %q", p.currentByte)) + return nil + } + if p.readTokenAsLabelValue(); p.err != nil { + return nil + } + p.currentLabelPair.Value = proto.String(p.currentToken.String()) + // Special treatment of summaries: + // - Quantile labels are special, will result in dto.Quantile later. + // - Other labels have to be added to currentLabels for signature calculation. + if p.currentMF.GetType() == dto.MetricType_SUMMARY { + if p.currentLabelPair.GetName() == model.QuantileLabel { + if p.currentQuantile, p.err = strconv.ParseFloat(p.currentLabelPair.GetValue(), 64); p.err != nil { + // Create a more helpful error message. + p.parseError(fmt.Sprintf("expected float as value for 'quantile' label, got %q", p.currentLabelPair.GetValue())) + return nil + } + } else { + p.currentLabels[p.currentLabelPair.GetName()] = p.currentLabelPair.GetValue() + } + } + // Similar special treatment of histograms. + if p.currentMF.GetType() == dto.MetricType_HISTOGRAM { + if p.currentLabelPair.GetName() == model.BucketLabel { + if p.currentBucket, p.err = strconv.ParseFloat(p.currentLabelPair.GetValue(), 64); p.err != nil { + // Create a more helpful error message. + p.parseError(fmt.Sprintf("expected float as value for 'le' label, got %q", p.currentLabelPair.GetValue())) + return nil + } + } else { + p.currentLabels[p.currentLabelPair.GetName()] = p.currentLabelPair.GetValue() + } + } + if p.skipBlankTab(); p.err != nil { + return nil // Unexpected end of input. + } + switch p.currentByte { + case ',': + return p.startLabelName + + case '}': + if p.skipBlankTab(); p.err != nil { + return nil // Unexpected end of input. + } + return p.readingValue + default: + p.parseError(fmt.Sprintf("unexpected end of label value %q", p.currentLabelPair.Value)) + return nil + } +} + +// readingValue represents the state where the last byte read (now in +// p.currentByte) is the first byte of the sample value (i.e. a float). +func (p *TextParser) readingValue() stateFn { + // When we are here, we have read all the labels, so for the + // special case of a summary/histogram, we can finally find out + // if the metric already exists. + if p.currentMF.GetType() == dto.MetricType_SUMMARY { + signature := model.LabelsToSignature(p.currentLabels) + if summary := p.summaries[signature]; summary != nil { + p.currentMetric = summary + } else { + p.summaries[signature] = p.currentMetric + p.currentMF.Metric = append(p.currentMF.Metric, p.currentMetric) + } + } else if p.currentMF.GetType() == dto.MetricType_HISTOGRAM { + signature := model.LabelsToSignature(p.currentLabels) + if histogram := p.histograms[signature]; histogram != nil { + p.currentMetric = histogram + } else { + p.histograms[signature] = p.currentMetric + p.currentMF.Metric = append(p.currentMF.Metric, p.currentMetric) + } + } else { + p.currentMF.Metric = append(p.currentMF.Metric, p.currentMetric) + } + if p.readTokenUntilWhitespace(); p.err != nil { + return nil // Unexpected end of input. + } + value, err := strconv.ParseFloat(p.currentToken.String(), 64) + if err != nil { + // Create a more helpful error message. + p.parseError(fmt.Sprintf("expected float as value, got %q", p.currentToken.String())) + return nil + } + switch p.currentMF.GetType() { + case dto.MetricType_COUNTER: + p.currentMetric.Counter = &dto.Counter{Value: proto.Float64(value)} + case dto.MetricType_GAUGE: + p.currentMetric.Gauge = &dto.Gauge{Value: proto.Float64(value)} + case dto.MetricType_UNTYPED: + p.currentMetric.Untyped = &dto.Untyped{Value: proto.Float64(value)} + case dto.MetricType_SUMMARY: + // *sigh* + if p.currentMetric.Summary == nil { + p.currentMetric.Summary = &dto.Summary{} + } + switch { + case p.currentIsSummaryCount: + p.currentMetric.Summary.SampleCount = proto.Uint64(uint64(value)) + case p.currentIsSummarySum: + p.currentMetric.Summary.SampleSum = proto.Float64(value) + case !math.IsNaN(p.currentQuantile): + p.currentMetric.Summary.Quantile = append( + p.currentMetric.Summary.Quantile, + &dto.Quantile{ + Quantile: proto.Float64(p.currentQuantile), + Value: proto.Float64(value), + }, + ) + } + case dto.MetricType_HISTOGRAM: + // *sigh* + if p.currentMetric.Histogram == nil { + p.currentMetric.Histogram = &dto.Histogram{} + } + switch { + case p.currentIsHistogramCount: + p.currentMetric.Histogram.SampleCount = proto.Uint64(uint64(value)) + case p.currentIsHistogramSum: + p.currentMetric.Histogram.SampleSum = proto.Float64(value) + case !math.IsNaN(p.currentBucket): + p.currentMetric.Histogram.Bucket = append( + p.currentMetric.Histogram.Bucket, + &dto.Bucket{ + UpperBound: proto.Float64(p.currentBucket), + CumulativeCount: proto.Uint64(uint64(value)), + }, + ) + } + default: + p.err = fmt.Errorf("unexpected type for metric name %q", p.currentMF.GetName()) + } + if p.currentByte == '\n' { + return p.startOfLine + } + return p.startTimestamp +} + +// startTimestamp represents the state where the next byte read from p.buf is +// the start of the timestamp (or whitespace leading up to it). +func (p *TextParser) startTimestamp() stateFn { + if p.skipBlankTab(); p.err != nil { + return nil // Unexpected end of input. + } + if p.readTokenUntilWhitespace(); p.err != nil { + return nil // Unexpected end of input. + } + timestamp, err := strconv.ParseInt(p.currentToken.String(), 10, 64) + if err != nil { + // Create a more helpful error message. + p.parseError(fmt.Sprintf("expected integer as timestamp, got %q", p.currentToken.String())) + return nil + } + p.currentMetric.TimestampMs = proto.Int64(timestamp) + if p.readTokenUntilNewline(false); p.err != nil { + return nil // Unexpected end of input. + } + if p.currentToken.Len() > 0 { + p.parseError(fmt.Sprintf("spurious string after timestamp: %q", p.currentToken.String())) + return nil + } + return p.startOfLine +} + +// readingHelp represents the state where the last byte read (now in +// p.currentByte) is the first byte of the docstring after 'HELP'. +func (p *TextParser) readingHelp() stateFn { + if p.currentMF.Help != nil { + p.parseError(fmt.Sprintf("second HELP line for metric name %q", p.currentMF.GetName())) + return nil + } + // Rest of line is the docstring. + if p.readTokenUntilNewline(true); p.err != nil { + return nil // Unexpected end of input. + } + p.currentMF.Help = proto.String(p.currentToken.String()) + return p.startOfLine +} + +// readingType represents the state where the last byte read (now in +// p.currentByte) is the first byte of the type hint after 'HELP'. +func (p *TextParser) readingType() stateFn { + if p.currentMF.Type != nil { + p.parseError(fmt.Sprintf("second TYPE line for metric name %q, or TYPE reported after samples", p.currentMF.GetName())) + return nil + } + // Rest of line is the type. + if p.readTokenUntilNewline(false); p.err != nil { + return nil // Unexpected end of input. + } + metricType, ok := dto.MetricType_value[strings.ToUpper(p.currentToken.String())] + if !ok { + p.parseError(fmt.Sprintf("unknown metric type %q", p.currentToken.String())) + return nil + } + p.currentMF.Type = dto.MetricType(metricType).Enum() + return p.startOfLine +} + +// parseError sets p.err to a ParseError at the current line with the given +// message. +func (p *TextParser) parseError(msg string) { + p.err = ParseError{ + Line: p.lineCount, + Msg: msg, + } +} + +// skipBlankTab reads (and discards) bytes from p.buf until it encounters a byte +// that is neither ' ' nor '\t'. That byte is left in p.currentByte. +func (p *TextParser) skipBlankTab() { + for { + if p.currentByte, p.err = p.buf.ReadByte(); p.err != nil || !isBlankOrTab(p.currentByte) { + return + } + } +} + +// skipBlankTabIfCurrentBlankTab works exactly as skipBlankTab but doesn't do +// anything if p.currentByte is neither ' ' nor '\t'. +func (p *TextParser) skipBlankTabIfCurrentBlankTab() { + if isBlankOrTab(p.currentByte) { + p.skipBlankTab() + } +} + +// readTokenUntilWhitespace copies bytes from p.buf into p.currentToken. The +// first byte considered is the byte already read (now in p.currentByte). The +// first whitespace byte encountered is still copied into p.currentByte, but not +// into p.currentToken. +func (p *TextParser) readTokenUntilWhitespace() { + p.currentToken.Reset() + for p.err == nil && !isBlankOrTab(p.currentByte) && p.currentByte != '\n' { + p.currentToken.WriteByte(p.currentByte) + p.currentByte, p.err = p.buf.ReadByte() + } +} + +// readTokenUntilNewline copies bytes from p.buf into p.currentToken. The first +// byte considered is the byte already read (now in p.currentByte). The first +// newline byte encountered is still copied into p.currentByte, but not into +// p.currentToken. If recognizeEscapeSequence is true, two escape sequences are +// recognized: '\\' tranlates into '\', and '\n' into a line-feed character. All +// other escape sequences are invalid and cause an error. +func (p *TextParser) readTokenUntilNewline(recognizeEscapeSequence bool) { + p.currentToken.Reset() + escaped := false + for p.err == nil { + if recognizeEscapeSequence && escaped { + switch p.currentByte { + case '\\': + p.currentToken.WriteByte(p.currentByte) + case 'n': + p.currentToken.WriteByte('\n') + default: + p.parseError(fmt.Sprintf("invalid escape sequence '\\%c'", p.currentByte)) + return + } + escaped = false + } else { + switch p.currentByte { + case '\n': + return + case '\\': + escaped = true + default: + p.currentToken.WriteByte(p.currentByte) + } + } + p.currentByte, p.err = p.buf.ReadByte() + } +} + +// readTokenAsMetricName copies a metric name from p.buf into p.currentToken. +// The first byte considered is the byte already read (now in p.currentByte). +// The first byte not part of a metric name is still copied into p.currentByte, +// but not into p.currentToken. +func (p *TextParser) readTokenAsMetricName() { + p.currentToken.Reset() + if !isValidMetricNameStart(p.currentByte) { + return + } + for { + p.currentToken.WriteByte(p.currentByte) + p.currentByte, p.err = p.buf.ReadByte() + if p.err != nil || !isValidMetricNameContinuation(p.currentByte) { + return + } + } +} + +// readTokenAsLabelName copies a label name from p.buf into p.currentToken. +// The first byte considered is the byte already read (now in p.currentByte). +// The first byte not part of a label name is still copied into p.currentByte, +// but not into p.currentToken. +func (p *TextParser) readTokenAsLabelName() { + p.currentToken.Reset() + if !isValidLabelNameStart(p.currentByte) { + return + } + for { + p.currentToken.WriteByte(p.currentByte) + p.currentByte, p.err = p.buf.ReadByte() + if p.err != nil || !isValidLabelNameContinuation(p.currentByte) { + return + } + } +} + +// readTokenAsLabelValue copies a label value from p.buf into p.currentToken. +// In contrast to the other 'readTokenAs...' functions, which start with the +// last read byte in p.currentByte, this method ignores p.currentByte and starts +// with reading a new byte from p.buf. The first byte not part of a label value +// is still copied into p.currentByte, but not into p.currentToken. +func (p *TextParser) readTokenAsLabelValue() { + p.currentToken.Reset() + escaped := false + for { + if p.currentByte, p.err = p.buf.ReadByte(); p.err != nil { + return + } + if escaped { + switch p.currentByte { + case '"', '\\': + p.currentToken.WriteByte(p.currentByte) + case 'n': + p.currentToken.WriteByte('\n') + default: + p.parseError(fmt.Sprintf("invalid escape sequence '\\%c'", p.currentByte)) + return + } + escaped = false + continue + } + switch p.currentByte { + case '"': + return + case '\n': + p.parseError(fmt.Sprintf("label value %q contains unescaped new-line", p.currentToken.String())) + return + case '\\': + escaped = true + default: + p.currentToken.WriteByte(p.currentByte) + } + } +} + +func (p *TextParser) setOrCreateCurrentMF() { + p.currentIsSummaryCount = false + p.currentIsSummarySum = false + p.currentIsHistogramCount = false + p.currentIsHistogramSum = false + name := p.currentToken.String() + if p.currentMF = p.metricFamiliesByName[name]; p.currentMF != nil { + return + } + // Try out if this is a _sum or _count for a summary/histogram. + summaryName := summaryMetricName(name) + if p.currentMF = p.metricFamiliesByName[summaryName]; p.currentMF != nil { + if p.currentMF.GetType() == dto.MetricType_SUMMARY { + if isCount(name) { + p.currentIsSummaryCount = true + } + if isSum(name) { + p.currentIsSummarySum = true + } + return + } + } + histogramName := histogramMetricName(name) + if p.currentMF = p.metricFamiliesByName[histogramName]; p.currentMF != nil { + if p.currentMF.GetType() == dto.MetricType_HISTOGRAM { + if isCount(name) { + p.currentIsHistogramCount = true + } + if isSum(name) { + p.currentIsHistogramSum = true + } + return + } + } + p.currentMF = &dto.MetricFamily{Name: proto.String(name)} + p.metricFamiliesByName[name] = p.currentMF +} + +func isValidLabelNameStart(b byte) bool { + return (b >= 'a' && b <= 'z') || (b >= 'A' && b <= 'Z') || b == '_' +} + +func isValidLabelNameContinuation(b byte) bool { + return isValidLabelNameStart(b) || (b >= '0' && b <= '9') +} + +func isValidMetricNameStart(b byte) bool { + return isValidLabelNameStart(b) || b == ':' +} + +func isValidMetricNameContinuation(b byte) bool { + return isValidLabelNameContinuation(b) || b == ':' +} + +func isBlankOrTab(b byte) bool { + return b == ' ' || b == '\t' +} + +func isCount(name string) bool { + return len(name) > 6 && name[len(name)-6:] == "_count" +} + +func isSum(name string) bool { + return len(name) > 4 && name[len(name)-4:] == "_sum" +} + +func isBucket(name string) bool { + return len(name) > 7 && name[len(name)-7:] == "_bucket" +} + +func summaryMetricName(name string) string { + switch { + case isCount(name): + return name[:len(name)-6] + case isSum(name): + return name[:len(name)-4] + default: + return name + } +} + +func histogramMetricName(name string) string { + switch { + case isCount(name): + return name[:len(name)-6] + case isSum(name): + return name[:len(name)-4] + case isBucket(name): + return name[:len(name)-7] + default: + return name + } +} diff --git a/Godeps/_workspace/src/github.com/prometheus/common/expfmt/text_parse_test.go b/Godeps/_workspace/src/github.com/prometheus/common/expfmt/text_parse_test.go new file mode 100644 index 000000000000..589c87a9d5fd --- /dev/null +++ b/Godeps/_workspace/src/github.com/prometheus/common/expfmt/text_parse_test.go @@ -0,0 +1,586 @@ +// Copyright 2014 The Prometheus 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 expfmt + +import ( + "math" + "strings" + "testing" + + "github.com/golang/protobuf/proto" + dto "github.com/prometheus/client_model/go" +) + +func testTextParse(t testing.TB) { + var scenarios = []struct { + in string + out []*dto.MetricFamily + }{ + // 0: Empty lines as input. + { + in: ` + +`, + out: []*dto.MetricFamily{}, + }, + // 1: Minimal case. + { + in: ` +minimal_metric 1.234 +another_metric -3e3 103948 +# Even that: +no_labels{} 3 +# HELP line for non-existing metric will be ignored. +`, + out: []*dto.MetricFamily{ + &dto.MetricFamily{ + Name: proto.String("minimal_metric"), + Type: dto.MetricType_UNTYPED.Enum(), + Metric: []*dto.Metric{ + &dto.Metric{ + Untyped: &dto.Untyped{ + Value: proto.Float64(1.234), + }, + }, + }, + }, + &dto.MetricFamily{ + Name: proto.String("another_metric"), + Type: dto.MetricType_UNTYPED.Enum(), + Metric: []*dto.Metric{ + &dto.Metric{ + Untyped: &dto.Untyped{ + Value: proto.Float64(-3e3), + }, + TimestampMs: proto.Int64(103948), + }, + }, + }, + &dto.MetricFamily{ + Name: proto.String("no_labels"), + Type: dto.MetricType_UNTYPED.Enum(), + Metric: []*dto.Metric{ + &dto.Metric{ + Untyped: &dto.Untyped{ + Value: proto.Float64(3), + }, + }, + }, + }, + }, + }, + // 2: Counters & gauges, docstrings, various whitespace, escape sequences. + { + in: ` +# 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 +`, + out: []*dto.MetricFamily{ + &dto.MetricFamily{ + Name: proto.String("name"), + Help: proto.String("two-line\n doc str\\ing"), + Type: dto.MetricType_COUNTER.Enum(), + Metric: []*dto.Metric{ + &dto.Metric{ + Label: []*dto.LabelPair{ + &dto.LabelPair{ + Name: proto.String("labelname"), + Value: proto.String("val1"), + }, + &dto.LabelPair{ + Name: proto.String("basename"), + Value: proto.String("basevalue"), + }, + }, + Counter: &dto.Counter{ + Value: proto.Float64(math.NaN()), + }, + }, + &dto.Metric{ + Label: []*dto.LabelPair{ + &dto.LabelPair{ + Name: proto.String("labelname"), + Value: proto.String("val2"), + }, + &dto.LabelPair{ + Name: proto.String("basename"), + Value: proto.String("base\"v\\al\nue"), + }, + }, + Counter: &dto.Counter{ + Value: proto.Float64(.23), + }, + TimestampMs: proto.Int64(1234567890), + }, + }, + }, + &dto.MetricFamily{ + Name: proto.String("name2"), + Help: proto.String("doc str\"ing 2"), + Type: dto.MetricType_GAUGE.Enum(), + Metric: []*dto.Metric{ + &dto.Metric{ + Label: []*dto.LabelPair{ + &dto.LabelPair{ + Name: proto.String("labelname"), + Value: proto.String("val2"), + }, + &dto.LabelPair{ + Name: proto.String("basename"), + Value: proto.String("basevalue2"), + }, + }, + Gauge: &dto.Gauge{ + Value: proto.Float64(math.Inf(+1)), + }, + TimestampMs: proto.Int64(54321), + }, + &dto.Metric{ + Label: []*dto.LabelPair{ + &dto.LabelPair{ + Name: proto.String("labelname"), + Value: proto.String("val1"), + }, + }, + Gauge: &dto.Gauge{ + Value: proto.Float64(math.Inf(-1)), + }, + }, + }, + }, + }, + }, + // 3: The evil summary, mixed with other types and funny comments. + { + in: ` +# 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 +`, + out: []*dto.MetricFamily{ + &dto.MetricFamily{ + Name: proto.String("fake_sum"), + Type: dto.MetricType_UNTYPED.Enum(), + Metric: []*dto.Metric{ + &dto.Metric{ + Label: []*dto.LabelPair{ + &dto.LabelPair{ + Name: proto.String("n1"), + Value: proto.String("val1"), + }, + }, + Untyped: &dto.Untyped{ + Value: proto.Float64(2001), + }, + }, + }, + }, + &dto.MetricFamily{ + Name: proto.String("decoy"), + Type: dto.MetricType_UNTYPED.Enum(), + Metric: []*dto.Metric{ + &dto.Metric{ + Untyped: &dto.Untyped{ + Value: proto.Float64(-1), + }, + TimestampMs: proto.Int64(-2), + }, + }, + }, + &dto.MetricFamily{ + Name: proto.String("my_summary"), + Type: dto.MetricType_SUMMARY.Enum(), + Metric: []*dto.Metric{ + &dto.Metric{ + Label: []*dto.LabelPair{ + &dto.LabelPair{ + Name: proto.String("n1"), + Value: proto.String("val1"), + }, + }, + Summary: &dto.Summary{ + SampleCount: proto.Uint64(42), + SampleSum: proto.Float64(4711), + Quantile: []*dto.Quantile{ + &dto.Quantile{ + Quantile: proto.Float64(0.5), + Value: proto.Float64(110), + }, + &dto.Quantile{ + Quantile: proto.Float64(0.9), + Value: proto.Float64(140), + }, + }, + }, + TimestampMs: proto.Int64(2), + }, + &dto.Metric{ + Label: []*dto.LabelPair{ + &dto.LabelPair{ + Name: proto.String("n2"), + Value: proto.String("val2"), + }, + &dto.LabelPair{ + Name: proto.String("n1"), + Value: proto.String("val1"), + }, + }, + Summary: &dto.Summary{ + SampleCount: proto.Uint64(5), + Quantile: []*dto.Quantile{ + &dto.Quantile{ + Quantile: proto.Float64(-12.34), + Value: proto.Float64(math.NaN()), + }, + }, + }, + TimestampMs: proto.Int64(5), + }, + &dto.Metric{ + Label: []*dto.LabelPair{ + &dto.LabelPair{ + Name: proto.String("n1"), + Value: proto.String("val2"), + }, + }, + Summary: &dto.Summary{ + SampleSum: proto.Float64(8), + }, + TimestampMs: proto.Int64(15), + }, + &dto.Metric{ + Label: []*dto.LabelPair{ + &dto.LabelPair{ + Name: proto.String("n1"), + Value: proto.String("val3"), + }, + }, + Summary: &dto.Summary{ + Quantile: []*dto.Quantile{ + &dto.Quantile{ + Quantile: proto.Float64(0.2), + Value: proto.Float64(4711), + }, + }, + }, + }, + }, + }, + &dto.MetricFamily{ + Name: proto.String("another_summary"), + Type: dto.MetricType_SUMMARY.Enum(), + Metric: []*dto.Metric{ + &dto.Metric{ + Label: []*dto.LabelPair{ + &dto.LabelPair{ + Name: proto.String("n2"), + Value: proto.String("val2"), + }, + &dto.LabelPair{ + Name: proto.String("n1"), + Value: proto.String("val1"), + }, + }, + Summary: &dto.Summary{ + SampleCount: proto.Uint64(20), + Quantile: []*dto.Quantile{ + &dto.Quantile{ + Quantile: proto.Float64(0.3), + Value: proto.Float64(-1.2), + }, + }, + }, + }, + }, + }, + }, + }, + // 4: The histogram. + { + in: ` +# 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 +`, + out: []*dto.MetricFamily{ + { + Name: proto.String("request_duration_microseconds"), + Help: proto.String("The response latency."), + Type: dto.MetricType_HISTOGRAM.Enum(), + Metric: []*dto.Metric{ + &dto.Metric{ + Histogram: &dto.Histogram{ + SampleCount: proto.Uint64(2693), + SampleSum: proto.Float64(1756047.3), + Bucket: []*dto.Bucket{ + &dto.Bucket{ + UpperBound: proto.Float64(100), + CumulativeCount: proto.Uint64(123), + }, + &dto.Bucket{ + UpperBound: proto.Float64(120), + CumulativeCount: proto.Uint64(412), + }, + &dto.Bucket{ + UpperBound: proto.Float64(144), + CumulativeCount: proto.Uint64(592), + }, + &dto.Bucket{ + UpperBound: proto.Float64(172.8), + CumulativeCount: proto.Uint64(1524), + }, + &dto.Bucket{ + UpperBound: proto.Float64(math.Inf(+1)), + CumulativeCount: proto.Uint64(2693), + }, + }, + }, + }, + }, + }, + }, + }, + } + + for i, scenario := range scenarios { + out, err := parser.TextToMetricFamilies(strings.NewReader(scenario.in)) + if err != nil { + t.Errorf("%d. error: %s", i, err) + continue + } + if expected, got := len(scenario.out), len(out); expected != got { + t.Errorf( + "%d. expected %d MetricFamilies, got %d", + i, expected, got, + ) + } + for _, expected := range scenario.out { + got, ok := out[expected.GetName()] + if !ok { + t.Errorf( + "%d. expected MetricFamily %q, found none", + i, expected.GetName(), + ) + continue + } + if expected.String() != got.String() { + t.Errorf( + "%d. expected MetricFamily %s, got %s", + i, expected, got, + ) + } + } + } +} + +func TestTextParse(t *testing.T) { + testTextParse(t) +} + +func BenchmarkTextParse(b *testing.B) { + for i := 0; i < b.N; i++ { + testTextParse(b) + } +} + +func testTextParseError(t testing.TB) { + var scenarios = []struct { + in string + err string + }{ + // 0: No new-line at end of input. + { + in: `bla 3.14`, + err: "EOF", + }, + // 1: Invalid escape sequence in label value. + { + in: `metric{label="\t"} 3.14`, + err: "text format parsing error in line 1: invalid escape sequence", + }, + // 2: Newline in label value. + { + in: ` +metric{label="new +line"} 3.14 +`, + err: `text format parsing error in line 2: label value "new" contains unescaped new-line`, + }, + // 3: + { + in: `metric{@="bla"} 3.14`, + err: "text format parsing error in line 1: invalid label name for metric", + }, + // 4: + { + in: `metric{__name__="bla"} 3.14`, + err: `text format parsing error in line 1: label name "__name__" is reserved`, + }, + // 5: + { + in: `metric{label+="bla"} 3.14`, + err: "text format parsing error in line 1: expected '=' after label name", + }, + // 6: + { + in: `metric{label=bla} 3.14`, + err: "text format parsing error in line 1: expected '\"' at start of label value", + }, + // 7: + { + in: ` +# TYPE metric summary +metric{quantile="bla"} 3.14 +`, + err: "text format parsing error in line 3: expected float as value for 'quantile' label", + }, + // 8: + { + in: `metric{label="bla"+} 3.14`, + err: "text format parsing error in line 1: unexpected end of label value", + }, + // 9: + { + in: `metric{label="bla"} 3.14 2.72 +`, + err: "text format parsing error in line 1: expected integer as timestamp", + }, + // 10: + { + in: `metric{label="bla"} 3.14 2 3 +`, + err: "text format parsing error in line 1: spurious string after timestamp", + }, + // 11: + { + in: `metric{label="bla"} blubb +`, + err: "text format parsing error in line 1: expected float as value", + }, + // 12: + { + in: ` +# HELP metric one +# HELP metric two +`, + err: "text format parsing error in line 3: second HELP line for metric name", + }, + // 13: + { + in: ` +# TYPE metric counter +# TYPE metric untyped +`, + err: `text format parsing error in line 3: second TYPE line for metric name "metric", or TYPE reported after samples`, + }, + // 14: + { + in: ` +metric 4.12 +# TYPE metric counter +`, + err: `text format parsing error in line 3: second TYPE line for metric name "metric", or TYPE reported after samples`, + }, + // 14: + { + in: ` +# TYPE metric bla +`, + err: "text format parsing error in line 2: unknown metric type", + }, + // 15: + { + in: ` +# TYPE met-ric +`, + err: "text format parsing error in line 2: invalid metric name in comment", + }, + // 16: + { + in: `@invalidmetric{label="bla"} 3.14 2`, + err: "text format parsing error in line 1: invalid metric name", + }, + // 17: + { + in: `{label="bla"} 3.14 2`, + err: "text format parsing error in line 1: invalid metric name", + }, + // 18: + { + in: ` +# TYPE metric histogram +metric_bucket{le="bla"} 3.14 +`, + err: "text format parsing error in line 3: expected float as value for 'le' label", + }, + } + + for i, scenario := range scenarios { + _, err := parser.TextToMetricFamilies(strings.NewReader(scenario.in)) + if err == nil { + t.Errorf("%d. expected error, got nil", i) + continue + } + if expected, got := scenario.err, err.Error(); strings.Index(got, expected) != 0 { + t.Errorf( + "%d. expected error starting with %q, got %q", + i, expected, got, + ) + } + } + +} + +func TestTextParseError(t *testing.T) { + testTextParseError(t) +} + +func BenchmarkParseError(b *testing.B) { + for i := 0; i < b.N; i++ { + testTextParseError(b) + } +} diff --git a/Godeps/_workspace/src/github.com/prometheus/client_golang/model/fingerprinting.go b/Godeps/_workspace/src/github.com/prometheus/common/model/fingerprinting.go similarity index 85% rename from Godeps/_workspace/src/github.com/prometheus/client_golang/model/fingerprinting.go rename to Godeps/_workspace/src/github.com/prometheus/common/model/fingerprinting.go index 5b2ffe3bb355..fc4de4106e85 100644 --- a/Godeps/_workspace/src/github.com/prometheus/client_golang/model/fingerprinting.go +++ b/Godeps/_workspace/src/github.com/prometheus/common/model/fingerprinting.go @@ -22,28 +22,23 @@ import ( // For our purposes, FNV-1A 64-bit is used. type Fingerprint uint64 -func (f Fingerprint) String() string { - return fmt.Sprintf("%016x", uint64(f)) -} - -// Less implements sort.Interface. -func (f Fingerprint) Less(o Fingerprint) bool { - return f < o -} - -// Equal implements sort.Interface. -func (f Fingerprint) Equal(o Fingerprint) bool { - return f == o +// FingerprintFromString transforms a string representation into a Fingerprint. +func FingerprintFromString(s string) (Fingerprint, error) { + num, err := strconv.ParseUint(s, 16, 64) + return Fingerprint(num), err } -// LoadFromString transforms a string representation into a Fingerprint. -func (f *Fingerprint) LoadFromString(s string) error { +// ParseFingerprint parses the input string into a fingerprint. +func ParseFingerprint(s string) (Fingerprint, error) { num, err := strconv.ParseUint(s, 16, 64) if err != nil { - return err + return 0, err } - *f = Fingerprint(num) - return nil + return Fingerprint(num), nil +} + +func (f Fingerprint) String() string { + return fmt.Sprintf("%016x", uint64(f)) } // Fingerprints represents a collection of Fingerprint subject to a given diff --git a/Godeps/_workspace/src/github.com/prometheus/common/model/labels.go b/Godeps/_workspace/src/github.com/prometheus/common/model/labels.go new file mode 100644 index 000000000000..6459c8f791b5 --- /dev/null +++ b/Godeps/_workspace/src/github.com/prometheus/common/model/labels.go @@ -0,0 +1,188 @@ +// Copyright 2013 The Prometheus 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 model + +import ( + "encoding/json" + "fmt" + "regexp" + "sort" + "strings" +) + +const ( + // AlertNameLabel is the name of the label containing the an alert's name. + AlertNameLabel = "alertname" + + // ExportedLabelPrefix is the prefix to prepend to the label names present in + // exported metrics if a label of the same name is added by the server. + ExportedLabelPrefix = "exported_" + + // MetricNameLabel is the label name indicating the metric name of a + // timeseries. + MetricNameLabel = "__name__" + + // SchemeLabel is the name of the label that holds the scheme on which to + // scrape a target. + SchemeLabel = "__scheme__" + + // AddressLabel is the name of the label that holds the address of + // a scrape target. + AddressLabel = "__address__" + + // MetricsPathLabel is the name of the label that holds the path on which to + // scrape a target. + MetricsPathLabel = "__metrics_path__" + + // ReservedLabelPrefix is a prefix which is not legal in user-supplied + // label names. + ReservedLabelPrefix = "__" + + // MetaLabelPrefix is a prefix for labels that provide meta information. + // Labels with this prefix are used for intermediate label processing and + // will not be attached to time series. + MetaLabelPrefix = "__meta_" + + // TmpLabelPrefix is a prefix for temporary labels as part of relabelling. + // Labels with this prefix are used for intermediate label processing and + // will not be attached to time series. This is reserved for use in + // Prometheus configuration files by users. + TmpLabelPrefix = "__tmp_" + + // ParamLabelPrefix is a prefix for labels that provide URL parameters + // used to scrape a target. + ParamLabelPrefix = "__param_" + + // JobLabel is the label name indicating the job from which a timeseries + // was scraped. + JobLabel = "job" + + // InstanceLabel is the label name used for the instance label. + InstanceLabel = "instance" + + // BucketLabel is used for the label that defines the upper bound of a + // bucket of a histogram ("le" -> "less or equal"). + BucketLabel = "le" + + // QuantileLabel is used for the label that defines the quantile in a + // summary. + QuantileLabel = "quantile" +) + +// LabelNameRE is a regular expression matching valid label names. +var LabelNameRE = regexp.MustCompile("^[a-zA-Z_][a-zA-Z0-9_]*$") + +// A LabelName is a key for a LabelSet or Metric. It has a value associated +// therewith. +type LabelName string + +// UnmarshalYAML implements the yaml.Unmarshaler interface. +func (ln *LabelName) UnmarshalYAML(unmarshal func(interface{}) error) error { + var s string + if err := unmarshal(&s); err != nil { + return err + } + if !LabelNameRE.MatchString(s) { + return fmt.Errorf("%q is not a valid label name", s) + } + *ln = LabelName(s) + return nil +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (ln *LabelName) UnmarshalJSON(b []byte) error { + var s string + if err := json.Unmarshal(b, &s); err != nil { + return err + } + if !LabelNameRE.MatchString(s) { + return fmt.Errorf("%q is not a valid label name", s) + } + *ln = LabelName(s) + return nil +} + +// LabelNames is a sortable LabelName slice. In implements sort.Interface. +type LabelNames []LabelName + +func (l LabelNames) Len() int { + return len(l) +} + +func (l LabelNames) Less(i, j int) bool { + return l[i] < l[j] +} + +func (l LabelNames) Swap(i, j int) { + l[i], l[j] = l[j], l[i] +} + +func (l LabelNames) String() string { + labelStrings := make([]string, 0, len(l)) + for _, label := range l { + labelStrings = append(labelStrings, string(label)) + } + return strings.Join(labelStrings, ", ") +} + +// A LabelValue is an associated value for a LabelName. +type LabelValue string + +// LabelValues is a sortable LabelValue slice. It implements sort.Interface. +type LabelValues []LabelValue + +func (l LabelValues) Len() int { + return len(l) +} + +func (l LabelValues) Less(i, j int) bool { + return sort.StringsAreSorted([]string{string(l[i]), string(l[j])}) +} + +func (l LabelValues) Swap(i, j int) { + l[i], l[j] = l[j], l[i] +} + +// LabelPair pairs a name with a value. +type LabelPair struct { + Name LabelName + Value LabelValue +} + +// LabelPairs is a sortable slice of LabelPair pointers. It implements +// sort.Interface. +type LabelPairs []*LabelPair + +func (l LabelPairs) Len() int { + return len(l) +} + +func (l LabelPairs) Less(i, j int) bool { + switch { + case l[i].Name > l[j].Name: + return false + case l[i].Name < l[j].Name: + return true + case l[i].Value > l[j].Value: + return false + case l[i].Value < l[j].Value: + return true + default: + return false + } +} + +func (l LabelPairs) Swap(i, j int) { + l[i], l[j] = l[j], l[i] +} diff --git a/Godeps/_workspace/src/github.com/prometheus/common/model/labels_test.go b/Godeps/_workspace/src/github.com/prometheus/common/model/labels_test.go new file mode 100644 index 000000000000..ab17025c76aa --- /dev/null +++ b/Godeps/_workspace/src/github.com/prometheus/common/model/labels_test.go @@ -0,0 +1,91 @@ +// Copyright 2013 The Prometheus 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 model + +import ( + "sort" + "testing" +) + +func testLabelNames(t testing.TB) { + var scenarios = []struct { + in LabelNames + out LabelNames + }{ + { + in: LabelNames{"ZZZ", "zzz"}, + out: LabelNames{"ZZZ", "zzz"}, + }, + { + in: LabelNames{"aaa", "AAA"}, + out: LabelNames{"AAA", "aaa"}, + }, + } + + for i, scenario := range scenarios { + sort.Sort(scenario.in) + + for j, expected := range scenario.out { + if expected != scenario.in[j] { + t.Errorf("%d.%d expected %s, got %s", i, j, expected, scenario.in[j]) + } + } + } +} + +func TestLabelNames(t *testing.T) { + testLabelNames(t) +} + +func BenchmarkLabelNames(b *testing.B) { + for i := 0; i < b.N; i++ { + testLabelNames(b) + } +} + +func testLabelValues(t testing.TB) { + var scenarios = []struct { + in LabelValues + out LabelValues + }{ + { + in: LabelValues{"ZZZ", "zzz"}, + out: LabelValues{"ZZZ", "zzz"}, + }, + { + in: LabelValues{"aaa", "AAA"}, + out: LabelValues{"AAA", "aaa"}, + }, + } + + for i, scenario := range scenarios { + sort.Sort(scenario.in) + + for j, expected := range scenario.out { + if expected != scenario.in[j] { + t.Errorf("%d.%d expected %s, got %s", i, j, expected, scenario.in[j]) + } + } + } +} + +func TestLabelValues(t *testing.T) { + testLabelValues(t) +} + +func BenchmarkLabelValues(b *testing.B) { + for i := 0; i < b.N; i++ { + testLabelValues(b) + } +} diff --git a/Godeps/_workspace/src/github.com/prometheus/common/model/labelset.go b/Godeps/_workspace/src/github.com/prometheus/common/model/labelset.go new file mode 100644 index 000000000000..142b9d1e2d3a --- /dev/null +++ b/Godeps/_workspace/src/github.com/prometheus/common/model/labelset.go @@ -0,0 +1,153 @@ +// Copyright 2013 The Prometheus 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 model + +import ( + "encoding/json" + "fmt" + "sort" + "strings" +) + +// A LabelSet is a collection of LabelName and LabelValue pairs. The LabelSet +// may be fully-qualified down to the point where it may resolve to a single +// Metric in the data store or not. All operations that occur within the realm +// of a LabelSet can emit a vector of Metric entities to which the LabelSet may +// match. +type LabelSet map[LabelName]LabelValue + +func (ls LabelSet) Equal(o LabelSet) bool { + if len(ls) != len(o) { + return false + } + for ln, lv := range ls { + olv, ok := o[ln] + if !ok { + return false + } + if olv != lv { + return false + } + } + return true +} + +// Before compares the metrics, using the following criteria: +// +// If m has fewer labels than o, it is before o. If it has more, it is not. +// +// If the number of labels is the same, the superset of all label names is +// sorted alphanumerically. The first differing label pair found in that order +// determines the outcome: If the label does not exist at all in m, then m is +// before o, and vice versa. Otherwise the label value is compared +// alphanumerically. +// +// If m and o are equal, the method returns false. +func (ls LabelSet) Before(o LabelSet) bool { + if len(ls) < len(o) { + return true + } + if len(ls) > len(o) { + return false + } + + lns := make(LabelNames, 0, len(ls)+len(o)) + for ln := range ls { + lns = append(lns, ln) + } + for ln := range o { + lns = append(lns, ln) + } + // It's probably not worth it to de-dup lns. + sort.Sort(lns) + for _, ln := range lns { + mlv, ok := ls[ln] + if !ok { + return true + } + olv, ok := o[ln] + if !ok { + return false + } + if mlv < olv { + return true + } + if mlv > olv { + return false + } + } + return false +} + +func (ls LabelSet) Clone() LabelSet { + lsn := make(LabelSet, len(ls)) + for ln, lv := range ls { + lsn[ln] = lv + } + return lsn +} + +// Merge is a helper function to non-destructively merge two label sets. +func (l LabelSet) Merge(other LabelSet) LabelSet { + result := make(LabelSet, len(l)) + + for k, v := range l { + result[k] = v + } + + for k, v := range other { + result[k] = v + } + + return result +} + +func (l LabelSet) String() string { + lstrs := make([]string, 0, len(l)) + for l, v := range l { + lstrs = append(lstrs, fmt.Sprintf("%s=%q", l, v)) + } + + sort.Strings(lstrs) + return fmt.Sprintf("{%s}", strings.Join(lstrs, ", ")) +} + +// Fingerprint returns the LabelSet's fingerprint. +func (ls LabelSet) Fingerprint() Fingerprint { + return labelSetToFingerprint(ls) +} + +// FastFingerprint returns the LabelSet's Fingerprint calculated by a faster hashing +// algorithm, which is, however, more susceptible to hash collisions. +func (ls LabelSet) FastFingerprint() Fingerprint { + return labelSetToFastFingerprint(ls) +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (l *LabelSet) UnmarshalJSON(b []byte) error { + var m map[LabelName]LabelValue + if err := json.Unmarshal(b, &m); err != nil { + return err + } + // encoding/json only unmarshals maps of the form map[string]T. It treats + // LabelName as a string and does not call its UnmarshalJSON method. + // Thus, we have to replicate the behavior here. + for ln := range m { + if !LabelNameRE.MatchString(string(ln)) { + return fmt.Errorf("%q is not a valid label name", ln) + } + } + *l = LabelSet(m) + return nil +} diff --git a/Godeps/_workspace/src/github.com/prometheus/common/model/metric.go b/Godeps/_workspace/src/github.com/prometheus/common/model/metric.go new file mode 100644 index 000000000000..25fc3c942585 --- /dev/null +++ b/Godeps/_workspace/src/github.com/prometheus/common/model/metric.go @@ -0,0 +1,81 @@ +// Copyright 2013 The Prometheus 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 model + +import ( + "fmt" + "sort" + "strings" +) + +var separator = []byte{0} + +// A Metric is similar to a LabelSet, but the key difference is that a Metric is +// a singleton and refers to one and only one stream of samples. +type Metric LabelSet + +// Equal compares the metrics. +func (m Metric) Equal(o Metric) bool { + return LabelSet(m).Equal(LabelSet(o)) +} + +// Before compares the metrics' underlying label sets. +func (m Metric) Before(o Metric) bool { + return LabelSet(m).Before(LabelSet(o)) +} + +// Clone returns a copy of the Metric. +func (m Metric) Clone() Metric { + clone := Metric{} + for k, v := range m { + clone[k] = v + } + return clone +} + +func (m Metric) String() string { + metricName, hasName := m[MetricNameLabel] + numLabels := len(m) - 1 + if !hasName { + numLabels = len(m) + } + labelStrings := make([]string, 0, numLabels) + for label, value := range m { + if label != MetricNameLabel { + labelStrings = append(labelStrings, fmt.Sprintf("%s=%q", label, value)) + } + } + + switch numLabels { + case 0: + if hasName { + return string(metricName) + } + return "{}" + default: + sort.Strings(labelStrings) + return fmt.Sprintf("%s{%s}", metricName, strings.Join(labelStrings, ", ")) + } +} + +// Fingerprint returns a Metric's Fingerprint. +func (m Metric) Fingerprint() Fingerprint { + return LabelSet(m).Fingerprint() +} + +// FastFingerprint returns a Metric's Fingerprint calculated by a faster hashing +// algorithm, which is, however, more susceptible to hash collisions. +func (m Metric) FastFingerprint() Fingerprint { + return LabelSet(m).FastFingerprint() +} diff --git a/Godeps/_workspace/src/github.com/prometheus/common/model/metric_test.go b/Godeps/_workspace/src/github.com/prometheus/common/model/metric_test.go new file mode 100644 index 000000000000..5c7cfceafe96 --- /dev/null +++ b/Godeps/_workspace/src/github.com/prometheus/common/model/metric_test.go @@ -0,0 +1,83 @@ +// Copyright 2013 The Prometheus 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 model + +import "testing" + +func testMetric(t testing.TB) { + var scenarios = []struct { + input LabelSet + fingerprint Fingerprint + fastFingerprint Fingerprint + }{ + { + input: LabelSet{}, + fingerprint: 14695981039346656037, + fastFingerprint: 14695981039346656037, + }, + { + input: LabelSet{ + "first_name": "electro", + "occupation": "robot", + "manufacturer": "westinghouse", + }, + fingerprint: 5911716720268894962, + fastFingerprint: 11310079640881077873, + }, + { + input: LabelSet{ + "x": "y", + }, + fingerprint: 8241431561484471700, + fastFingerprint: 13948396922932177635, + }, + { + input: LabelSet{ + "a": "bb", + "b": "c", + }, + fingerprint: 3016285359649981711, + fastFingerprint: 3198632812309449502, + }, + { + input: LabelSet{ + "a": "b", + "bb": "c", + }, + fingerprint: 7122421792099404749, + fastFingerprint: 5774953389407657638, + }, + } + + for i, scenario := range scenarios { + input := Metric(scenario.input) + + if scenario.fingerprint != input.Fingerprint() { + t.Errorf("%d. expected %d, got %d", i, scenario.fingerprint, input.Fingerprint()) + } + if scenario.fastFingerprint != input.FastFingerprint() { + t.Errorf("%d. expected %d, got %d", i, scenario.fastFingerprint, input.FastFingerprint()) + } + } +} + +func TestMetric(t *testing.T) { + testMetric(t) +} + +func BenchmarkMetric(b *testing.B) { + for i := 0; i < b.N; i++ { + testMetric(b) + } +} diff --git a/Godeps/_workspace/src/github.com/prometheus/client_golang/model/model.go b/Godeps/_workspace/src/github.com/prometheus/common/model/model.go similarity index 84% rename from Godeps/_workspace/src/github.com/prometheus/client_golang/model/model.go rename to Godeps/_workspace/src/github.com/prometheus/common/model/model.go index 189c5dcf6c16..88f013a47a41 100644 --- a/Godeps/_workspace/src/github.com/prometheus/client_golang/model/model.go +++ b/Godeps/_workspace/src/github.com/prometheus/common/model/model.go @@ -11,5 +11,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -// Package model contains core representation of Prometheus client primitives. +// Package model contains common data structures that are shared across +// Prometheus componenets and libraries. package model diff --git a/Godeps/_workspace/src/github.com/prometheus/common/model/signature.go b/Godeps/_workspace/src/github.com/prometheus/common/model/signature.go new file mode 100644 index 000000000000..28f370065a9e --- /dev/null +++ b/Godeps/_workspace/src/github.com/prometheus/common/model/signature.go @@ -0,0 +1,190 @@ +// Copyright 2014 The Prometheus 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 model + +import ( + "bytes" + "hash" + "hash/fnv" + "sort" + "sync" +) + +// SeparatorByte is a byte that cannot occur in valid UTF-8 sequences and is +// used to separate label names, label values, and other strings from each other +// when calculating their combined hash value (aka signature aka fingerprint). +const SeparatorByte byte = 255 + +var ( + // cache the signature of an empty label set. + emptyLabelSignature = fnv.New64a().Sum64() + + hashAndBufPool sync.Pool +) + +type hashAndBuf struct { + h hash.Hash64 + b bytes.Buffer +} + +func getHashAndBuf() *hashAndBuf { + hb := hashAndBufPool.Get() + if hb == nil { + return &hashAndBuf{h: fnv.New64a()} + } + return hb.(*hashAndBuf) +} + +func putHashAndBuf(hb *hashAndBuf) { + hb.h.Reset() + hb.b.Reset() + hashAndBufPool.Put(hb) +} + +// LabelsToSignature returns a quasi-unique signature (i.e., fingerprint) for a +// given label set. (Collisions are possible but unlikely if the number of label +// sets the function is applied to is small.) +func LabelsToSignature(labels map[string]string) uint64 { + if len(labels) == 0 { + return emptyLabelSignature + } + + labelNames := make([]string, 0, len(labels)) + for labelName := range labels { + labelNames = append(labelNames, labelName) + } + sort.Strings(labelNames) + + hb := getHashAndBuf() + defer putHashAndBuf(hb) + + for _, labelName := range labelNames { + hb.b.WriteString(labelName) + hb.b.WriteByte(SeparatorByte) + hb.b.WriteString(labels[labelName]) + hb.b.WriteByte(SeparatorByte) + hb.h.Write(hb.b.Bytes()) + hb.b.Reset() + } + return hb.h.Sum64() +} + +// labelSetToFingerprint works exactly as LabelsToSignature but takes a LabelSet as +// parameter (rather than a label map) and returns a Fingerprint. +func labelSetToFingerprint(ls LabelSet) Fingerprint { + if len(ls) == 0 { + return Fingerprint(emptyLabelSignature) + } + + labelNames := make(LabelNames, 0, len(ls)) + for labelName := range ls { + labelNames = append(labelNames, labelName) + } + sort.Sort(labelNames) + + hb := getHashAndBuf() + defer putHashAndBuf(hb) + + for _, labelName := range labelNames { + hb.b.WriteString(string(labelName)) + hb.b.WriteByte(SeparatorByte) + hb.b.WriteString(string(ls[labelName])) + hb.b.WriteByte(SeparatorByte) + hb.h.Write(hb.b.Bytes()) + hb.b.Reset() + } + return Fingerprint(hb.h.Sum64()) +} + +// labelSetToFastFingerprint works similar to labelSetToFingerprint but uses a +// faster and less allocation-heavy hash function, which is more susceptible to +// create hash collisions. Therefore, collision detection should be applied. +func labelSetToFastFingerprint(ls LabelSet) Fingerprint { + if len(ls) == 0 { + return Fingerprint(emptyLabelSignature) + } + + var result uint64 + hb := getHashAndBuf() + defer putHashAndBuf(hb) + + for labelName, labelValue := range ls { + hb.b.WriteString(string(labelName)) + hb.b.WriteByte(SeparatorByte) + hb.b.WriteString(string(labelValue)) + hb.h.Write(hb.b.Bytes()) + result ^= hb.h.Sum64() + hb.h.Reset() + hb.b.Reset() + } + return Fingerprint(result) +} + +// SignatureForLabels works like LabelsToSignature but takes a Metric as +// parameter (rather than a label map) and only includes the labels with the +// specified LabelNames into the signature calculation. The labels passed in +// will be sorted by this function. +func SignatureForLabels(m Metric, labels ...LabelName) uint64 { + if len(m) == 0 || len(labels) == 0 { + return emptyLabelSignature + } + + sort.Sort(LabelNames(labels)) + + hb := getHashAndBuf() + defer putHashAndBuf(hb) + + for _, label := range labels { + hb.b.WriteString(string(label)) + hb.b.WriteByte(SeparatorByte) + hb.b.WriteString(string(m[label])) + hb.b.WriteByte(SeparatorByte) + hb.h.Write(hb.b.Bytes()) + hb.b.Reset() + } + return hb.h.Sum64() +} + +// SignatureWithoutLabels works like LabelsToSignature but takes a Metric as +// parameter (rather than a label map) and excludes the labels with any of the +// specified LabelNames from the signature calculation. +func SignatureWithoutLabels(m Metric, labels map[LabelName]struct{}) uint64 { + if len(m) == 0 { + return emptyLabelSignature + } + + labelNames := make(LabelNames, 0, len(m)) + for labelName := range m { + if _, exclude := labels[labelName]; !exclude { + labelNames = append(labelNames, labelName) + } + } + if len(labelNames) == 0 { + return emptyLabelSignature + } + sort.Sort(labelNames) + + hb := getHashAndBuf() + defer putHashAndBuf(hb) + + for _, labelName := range labelNames { + hb.b.WriteString(string(labelName)) + hb.b.WriteByte(SeparatorByte) + hb.b.WriteString(string(m[labelName])) + hb.b.WriteByte(SeparatorByte) + hb.h.Write(hb.b.Bytes()) + hb.b.Reset() + } + return hb.h.Sum64() +} diff --git a/Godeps/_workspace/src/github.com/prometheus/common/model/signature_test.go b/Godeps/_workspace/src/github.com/prometheus/common/model/signature_test.go new file mode 100644 index 000000000000..d9c665f8c79e --- /dev/null +++ b/Godeps/_workspace/src/github.com/prometheus/common/model/signature_test.go @@ -0,0 +1,304 @@ +// Copyright 2014 The Prometheus 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 model + +import ( + "runtime" + "sync" + "testing" +) + +func TestLabelsToSignature(t *testing.T) { + var scenarios = []struct { + in map[string]string + out uint64 + }{ + { + in: map[string]string{}, + out: 14695981039346656037, + }, + { + in: map[string]string{"name": "garland, briggs", "fear": "love is not enough"}, + out: 5799056148416392346, + }, + } + + for i, scenario := range scenarios { + actual := LabelsToSignature(scenario.in) + + if actual != scenario.out { + t.Errorf("%d. expected %d, got %d", i, scenario.out, actual) + } + } +} + +func TestMetricToFingerprint(t *testing.T) { + var scenarios = []struct { + in LabelSet + out Fingerprint + }{ + { + in: LabelSet{}, + out: 14695981039346656037, + }, + { + in: LabelSet{"name": "garland, briggs", "fear": "love is not enough"}, + out: 5799056148416392346, + }, + } + + for i, scenario := range scenarios { + actual := labelSetToFingerprint(scenario.in) + + if actual != scenario.out { + t.Errorf("%d. expected %d, got %d", i, scenario.out, actual) + } + } +} + +func TestMetricToFastFingerprint(t *testing.T) { + var scenarios = []struct { + in LabelSet + out Fingerprint + }{ + { + in: LabelSet{}, + out: 14695981039346656037, + }, + { + in: LabelSet{"name": "garland, briggs", "fear": "love is not enough"}, + out: 12952432476264840823, + }, + } + + for i, scenario := range scenarios { + actual := labelSetToFastFingerprint(scenario.in) + + if actual != scenario.out { + t.Errorf("%d. expected %d, got %d", i, scenario.out, actual) + } + } +} + +func TestSignatureForLabels(t *testing.T) { + var scenarios = []struct { + in Metric + labels LabelNames + out uint64 + }{ + { + in: Metric{}, + labels: nil, + out: 14695981039346656037, + }, + { + in: Metric{"name": "garland, briggs", "fear": "love is not enough"}, + labels: LabelNames{"fear", "name"}, + out: 5799056148416392346, + }, + { + in: Metric{"name": "garland, briggs", "fear": "love is not enough", "foo": "bar"}, + labels: LabelNames{"fear", "name"}, + out: 5799056148416392346, + }, + { + in: Metric{"name": "garland, briggs", "fear": "love is not enough"}, + labels: LabelNames{}, + out: 14695981039346656037, + }, + { + in: Metric{"name": "garland, briggs", "fear": "love is not enough"}, + labels: nil, + out: 14695981039346656037, + }, + } + + for i, scenario := range scenarios { + actual := SignatureForLabels(scenario.in, scenario.labels...) + + if actual != scenario.out { + t.Errorf("%d. expected %d, got %d", i, scenario.out, actual) + } + } +} + +func TestSignatureWithoutLabels(t *testing.T) { + var scenarios = []struct { + in Metric + labels map[LabelName]struct{} + out uint64 + }{ + { + in: Metric{}, + labels: nil, + out: 14695981039346656037, + }, + { + in: Metric{"name": "garland, briggs", "fear": "love is not enough"}, + labels: map[LabelName]struct{}{"fear": struct{}{}, "name": struct{}{}}, + out: 14695981039346656037, + }, + { + in: Metric{"name": "garland, briggs", "fear": "love is not enough", "foo": "bar"}, + labels: map[LabelName]struct{}{"foo": struct{}{}}, + out: 5799056148416392346, + }, + { + in: Metric{"name": "garland, briggs", "fear": "love is not enough"}, + labels: map[LabelName]struct{}{}, + out: 5799056148416392346, + }, + { + in: Metric{"name": "garland, briggs", "fear": "love is not enough"}, + labels: nil, + out: 5799056148416392346, + }, + } + + for i, scenario := range scenarios { + actual := SignatureWithoutLabels(scenario.in, scenario.labels) + + if actual != scenario.out { + t.Errorf("%d. expected %d, got %d", i, scenario.out, actual) + } + } +} + +func benchmarkLabelToSignature(b *testing.B, l map[string]string, e uint64) { + for i := 0; i < b.N; i++ { + if a := LabelsToSignature(l); a != e { + b.Fatalf("expected signature of %d for %s, got %d", e, l, a) + } + } +} + +func BenchmarkLabelToSignatureScalar(b *testing.B) { + benchmarkLabelToSignature(b, nil, 14695981039346656037) +} + +func BenchmarkLabelToSignatureSingle(b *testing.B) { + benchmarkLabelToSignature(b, map[string]string{"first-label": "first-label-value"}, 5146282821936882169) +} + +func BenchmarkLabelToSignatureDouble(b *testing.B) { + benchmarkLabelToSignature(b, map[string]string{"first-label": "first-label-value", "second-label": "second-label-value"}, 3195800080984914717) +} + +func BenchmarkLabelToSignatureTriple(b *testing.B) { + benchmarkLabelToSignature(b, map[string]string{"first-label": "first-label-value", "second-label": "second-label-value", "third-label": "third-label-value"}, 13843036195897128121) +} + +func benchmarkMetricToFingerprint(b *testing.B, ls LabelSet, e Fingerprint) { + for i := 0; i < b.N; i++ { + if a := labelSetToFingerprint(ls); a != e { + b.Fatalf("expected signature of %d for %s, got %d", e, ls, a) + } + } +} + +func BenchmarkMetricToFingerprintScalar(b *testing.B) { + benchmarkMetricToFingerprint(b, nil, 14695981039346656037) +} + +func BenchmarkMetricToFingerprintSingle(b *testing.B) { + benchmarkMetricToFingerprint(b, LabelSet{"first-label": "first-label-value"}, 5146282821936882169) +} + +func BenchmarkMetricToFingerprintDouble(b *testing.B) { + benchmarkMetricToFingerprint(b, LabelSet{"first-label": "first-label-value", "second-label": "second-label-value"}, 3195800080984914717) +} + +func BenchmarkMetricToFingerprintTriple(b *testing.B) { + benchmarkMetricToFingerprint(b, LabelSet{"first-label": "first-label-value", "second-label": "second-label-value", "third-label": "third-label-value"}, 13843036195897128121) +} + +func benchmarkMetricToFastFingerprint(b *testing.B, ls LabelSet, e Fingerprint) { + for i := 0; i < b.N; i++ { + if a := labelSetToFastFingerprint(ls); a != e { + b.Fatalf("expected signature of %d for %s, got %d", e, ls, a) + } + } +} + +func BenchmarkMetricToFastFingerprintScalar(b *testing.B) { + benchmarkMetricToFastFingerprint(b, nil, 14695981039346656037) +} + +func BenchmarkMetricToFastFingerprintSingle(b *testing.B) { + benchmarkMetricToFastFingerprint(b, LabelSet{"first-label": "first-label-value"}, 5147259542624943964) +} + +func BenchmarkMetricToFastFingerprintDouble(b *testing.B) { + benchmarkMetricToFastFingerprint(b, LabelSet{"first-label": "first-label-value", "second-label": "second-label-value"}, 18269973311206963528) +} + +func BenchmarkMetricToFastFingerprintTriple(b *testing.B) { + benchmarkMetricToFastFingerprint(b, LabelSet{"first-label": "first-label-value", "second-label": "second-label-value", "third-label": "third-label-value"}, 15738406913934009676) +} + +func BenchmarkEmptyLabelSignature(b *testing.B) { + input := []map[string]string{nil, {}} + + var ms runtime.MemStats + runtime.ReadMemStats(&ms) + + alloc := ms.Alloc + + for _, labels := range input { + LabelsToSignature(labels) + } + + runtime.ReadMemStats(&ms) + + if got := ms.Alloc; alloc != got { + b.Fatal("expected LabelsToSignature with empty labels not to perform allocations") + } +} + +func benchmarkMetricToFastFingerprintConc(b *testing.B, ls LabelSet, e Fingerprint, concLevel int) { + var start, end sync.WaitGroup + start.Add(1) + end.Add(concLevel) + + for i := 0; i < concLevel; i++ { + go func() { + start.Wait() + for j := b.N / concLevel; j >= 0; j-- { + if a := labelSetToFastFingerprint(ls); a != e { + b.Fatalf("expected signature of %d for %s, got %d", e, ls, a) + } + } + end.Done() + }() + } + b.ResetTimer() + start.Done() + end.Wait() +} + +func BenchmarkMetricToFastFingerprintTripleConc1(b *testing.B) { + benchmarkMetricToFastFingerprintConc(b, LabelSet{"first-label": "first-label-value", "second-label": "second-label-value", "third-label": "third-label-value"}, 15738406913934009676, 1) +} + +func BenchmarkMetricToFastFingerprintTripleConc2(b *testing.B) { + benchmarkMetricToFastFingerprintConc(b, LabelSet{"first-label": "first-label-value", "second-label": "second-label-value", "third-label": "third-label-value"}, 15738406913934009676, 2) +} + +func BenchmarkMetricToFastFingerprintTripleConc4(b *testing.B) { + benchmarkMetricToFastFingerprintConc(b, LabelSet{"first-label": "first-label-value", "second-label": "second-label-value", "third-label": "third-label-value"}, 15738406913934009676, 4) +} + +func BenchmarkMetricToFastFingerprintTripleConc8(b *testing.B) { + benchmarkMetricToFastFingerprintConc(b, LabelSet{"first-label": "first-label-value", "second-label": "second-label-value", "third-label": "third-label-value"}, 15738406913934009676, 8) +} diff --git a/Godeps/_workspace/src/github.com/prometheus/common/model/time.go b/Godeps/_workspace/src/github.com/prometheus/common/model/time.go new file mode 100644 index 000000000000..ebc8bf6cc841 --- /dev/null +++ b/Godeps/_workspace/src/github.com/prometheus/common/model/time.go @@ -0,0 +1,230 @@ +// Copyright 2013 The Prometheus 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 model + +import ( + "fmt" + "math" + "regexp" + "strconv" + "strings" + "time" +) + +const ( + // MinimumTick is the minimum supported time resolution. This has to be + // at least time.Second in order for the code below to work. + minimumTick = time.Millisecond + // second is the Time duration equivalent to one second. + second = int64(time.Second / minimumTick) + // The number of nanoseconds per minimum tick. + nanosPerTick = int64(minimumTick / time.Nanosecond) + + // Earliest is the earliest Time representable. Handy for + // initializing a high watermark. + Earliest = Time(math.MinInt64) + // Latest is the latest Time representable. Handy for initializing + // a low watermark. + Latest = Time(math.MaxInt64) +) + +// Time is the number of milliseconds since the epoch +// (1970-01-01 00:00 UTC) excluding leap seconds. +type Time int64 + +// Interval describes and interval between two timestamps. +type Interval struct { + Start, End Time +} + +// Now returns the current time as a Time. +func Now() Time { + return TimeFromUnixNano(time.Now().UnixNano()) +} + +// TimeFromUnix returns the Time equivalent to the Unix Time t +// provided in seconds. +func TimeFromUnix(t int64) Time { + return Time(t * second) +} + +// TimeFromUnixNano returns the Time equivalent to the Unix Time +// t provided in nanoseconds. +func TimeFromUnixNano(t int64) Time { + return Time(t / nanosPerTick) +} + +// Equal reports whether two Times represent the same instant. +func (t Time) Equal(o Time) bool { + return t == o +} + +// Before reports whether the Time t is before o. +func (t Time) Before(o Time) bool { + return t < o +} + +// After reports whether the Time t is after o. +func (t Time) After(o Time) bool { + return t > o +} + +// Add returns the Time t + d. +func (t Time) Add(d time.Duration) Time { + return t + Time(d/minimumTick) +} + +// Sub returns the Duration t - o. +func (t Time) Sub(o Time) time.Duration { + return time.Duration(t-o) * minimumTick +} + +// Time returns the time.Time representation of t. +func (t Time) Time() time.Time { + return time.Unix(int64(t)/second, (int64(t)%second)*nanosPerTick) +} + +// Unix returns t as a Unix time, the number of seconds elapsed +// since January 1, 1970 UTC. +func (t Time) Unix() int64 { + return int64(t) / second +} + +// UnixNano returns t as a Unix time, the number of nanoseconds elapsed +// since January 1, 1970 UTC. +func (t Time) UnixNano() int64 { + return int64(t) * nanosPerTick +} + +// The number of digits after the dot. +var dotPrecision = int(math.Log10(float64(second))) + +// String returns a string representation of the Time. +func (t Time) String() string { + return strconv.FormatFloat(float64(t)/float64(second), 'f', -1, 64) +} + +// MarshalJSON implements the json.Marshaler interface. +func (t Time) MarshalJSON() ([]byte, error) { + return []byte(t.String()), nil +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (t *Time) UnmarshalJSON(b []byte) error { + p := strings.Split(string(b), ".") + switch len(p) { + case 1: + v, err := strconv.ParseInt(string(p[0]), 10, 64) + if err != nil { + return err + } + *t = Time(v * second) + + case 2: + v, err := strconv.ParseInt(string(p[0]), 10, 64) + if err != nil { + return err + } + v *= second + + prec := dotPrecision - len(p[1]) + if prec < 0 { + p[1] = p[1][:dotPrecision] + } else if prec > 0 { + p[1] = p[1] + strings.Repeat("0", prec) + } + + va, err := strconv.ParseInt(p[1], 10, 32) + if err != nil { + return err + } + + *t = Time(v + va) + + default: + return fmt.Errorf("invalid time %q", string(b)) + } + return nil +} + +// Duration wraps time.Duration. It is used to parse the custom duration format +// from YAML. +// This type should not propagate beyond the scope of input/output processing. +type Duration time.Duration + +// StringToDuration parses a string into a time.Duration, assuming that a year +// a day always has 24h. +func ParseDuration(durationStr string) (Duration, error) { + matches := durationRE.FindStringSubmatch(durationStr) + if len(matches) != 3 { + return 0, fmt.Errorf("not a valid duration string: %q", durationStr) + } + durSeconds, _ := strconv.Atoi(matches[1]) + dur := time.Duration(durSeconds) * time.Second + unit := matches[2] + switch unit { + case "d": + dur *= 60 * 60 * 24 + case "h": + dur *= 60 * 60 + case "m": + dur *= 60 + case "s": + dur *= 1 + default: + return 0, fmt.Errorf("invalid time unit in duration string: %q", unit) + } + return Duration(dur), nil +} + +var durationRE = regexp.MustCompile("^([0-9]+)([ywdhms]+)$") + +func (d Duration) String() string { + seconds := int64(time.Duration(d) / time.Second) + factors := map[string]int64{ + "d": 60 * 60 * 24, + "h": 60 * 60, + "m": 60, + "s": 1, + } + unit := "s" + switch int64(0) { + case seconds % factors["d"]: + unit = "d" + case seconds % factors["h"]: + unit = "h" + case seconds % factors["m"]: + unit = "m" + } + return fmt.Sprintf("%v%v", seconds/factors[unit], unit) +} + +// MarshalYAML implements the yaml.Marshaler interface. +func (d Duration) MarshalYAML() (interface{}, error) { + return d.String(), nil +} + +// UnmarshalYAML implements the yaml.Unmarshaler interface. +func (d *Duration) UnmarshalYAML(unmarshal func(interface{}) error) error { + var s string + if err := unmarshal(&s); err != nil { + return err + } + dur, err := ParseDuration(s) + if err != nil { + return err + } + *d = dur + return nil +} diff --git a/Godeps/_workspace/src/github.com/prometheus/common/model/time_test.go b/Godeps/_workspace/src/github.com/prometheus/common/model/time_test.go new file mode 100644 index 000000000000..9013a62775b1 --- /dev/null +++ b/Godeps/_workspace/src/github.com/prometheus/common/model/time_test.go @@ -0,0 +1,86 @@ +// Copyright 2013 The Prometheus 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 model + +import ( + "testing" + "time" +) + +func TestComparators(t *testing.T) { + t1a := TimeFromUnix(0) + t1b := TimeFromUnix(0) + t2 := TimeFromUnix(2*second - 1) + + if !t1a.Equal(t1b) { + t.Fatalf("Expected %s to be equal to %s", t1a, t1b) + } + if t1a.Equal(t2) { + t.Fatalf("Expected %s to not be equal to %s", t1a, t2) + } + + if !t1a.Before(t2) { + t.Fatalf("Expected %s to be before %s", t1a, t2) + } + if t1a.Before(t1b) { + t.Fatalf("Expected %s to not be before %s", t1a, t1b) + } + + if !t2.After(t1a) { + t.Fatalf("Expected %s to be after %s", t2, t1a) + } + if t1b.After(t1a) { + t.Fatalf("Expected %s to not be after %s", t1b, t1a) + } +} + +func TestTimeConversions(t *testing.T) { + unixSecs := int64(1136239445) + unixNsecs := int64(123456789) + unixNano := unixSecs*1e9 + unixNsecs + + t1 := time.Unix(unixSecs, unixNsecs-unixNsecs%nanosPerTick) + t2 := time.Unix(unixSecs, unixNsecs) + + ts := TimeFromUnixNano(unixNano) + if !ts.Time().Equal(t1) { + t.Fatalf("Expected %s, got %s", t1, ts.Time()) + } + + // Test available precision. + ts = TimeFromUnixNano(t2.UnixNano()) + if !ts.Time().Equal(t1) { + t.Fatalf("Expected %s, got %s", t1, ts.Time()) + } + + if ts.UnixNano() != unixNano-unixNano%nanosPerTick { + t.Fatalf("Expected %d, got %d", unixNano, ts.UnixNano()) + } +} + +func TestDuration(t *testing.T) { + duration := time.Second + time.Minute + time.Hour + goTime := time.Unix(1136239445, 0) + + ts := TimeFromUnix(goTime.Unix()) + if !goTime.Add(duration).Equal(ts.Add(duration).Time()) { + t.Fatalf("Expected %s to be equal to %s", goTime.Add(duration), ts.Add(duration)) + } + + earlier := ts.Add(-duration) + delta := ts.Sub(earlier) + if delta != duration { + t.Fatalf("Expected %s to be equal to %s", delta, duration) + } +} diff --git a/Godeps/_workspace/src/github.com/prometheus/common/model/value.go b/Godeps/_workspace/src/github.com/prometheus/common/model/value.go new file mode 100644 index 000000000000..10ffb0bd6114 --- /dev/null +++ b/Godeps/_workspace/src/github.com/prometheus/common/model/value.go @@ -0,0 +1,395 @@ +// Copyright 2013 The Prometheus 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 model + +import ( + "encoding/json" + "fmt" + "sort" + "strconv" + "strings" +) + +// A SampleValue is a representation of a value for a given sample at a given +// time. +type SampleValue float64 + +// MarshalJSON implements json.Marshaler. +func (v SampleValue) MarshalJSON() ([]byte, error) { + return json.Marshal(v.String()) +} + +// UnmarshalJSON implements json.Unmarshaler. +func (v *SampleValue) UnmarshalJSON(b []byte) error { + if len(b) < 2 || b[0] != '"' || b[len(b)-1] != '"' { + return fmt.Errorf("sample value must be a quoted string") + } + f, err := strconv.ParseFloat(string(b[1:len(b)-1]), 64) + if err != nil { + return err + } + *v = SampleValue(f) + return nil +} + +func (v SampleValue) Equal(o SampleValue) bool { + return v == o +} + +func (v SampleValue) String() string { + return strconv.FormatFloat(float64(v), 'f', -1, 64) +} + +// SamplePair pairs a SampleValue with a Timestamp. +type SamplePair struct { + Timestamp Time + Value SampleValue +} + +// MarshalJSON implements json.Marshaler. +func (s SamplePair) MarshalJSON() ([]byte, error) { + t, err := json.Marshal(s.Timestamp) + if err != nil { + return nil, err + } + v, err := json.Marshal(s.Value) + if err != nil { + return nil, err + } + return []byte(fmt.Sprintf("[%s,%s]", t, v)), nil +} + +// UnmarshalJSON implements json.Unmarshaler. +func (s *SamplePair) UnmarshalJSON(b []byte) error { + v := [...]json.Unmarshaler{&s.Timestamp, &s.Value} + return json.Unmarshal(b, &v) +} + +// Equal returns true if this SamplePair and o have equal Values and equal +// Timestamps. +func (s *SamplePair) Equal(o *SamplePair) bool { + return s == o || (s.Value == o.Value && s.Timestamp.Equal(o.Timestamp)) +} + +func (s SamplePair) String() string { + return fmt.Sprintf("%s @[%s]", s.Value, s.Timestamp) +} + +// Sample is a sample pair associated with a metric. +type Sample struct { + Metric Metric `json:"metric"` + Value SampleValue `json:"value"` + Timestamp Time `json:"timestamp"` +} + +// Equal compares first the metrics, then the timestamp, then the value. +func (s *Sample) Equal(o *Sample) bool { + if s == o { + return true + } + + if !s.Metric.Equal(o.Metric) { + return false + } + if !s.Timestamp.Equal(o.Timestamp) { + return false + } + if s.Value != o.Value { + return false + } + + return true +} + +func (s Sample) String() string { + return fmt.Sprintf("%s => %s", s.Metric, SamplePair{ + Timestamp: s.Timestamp, + Value: s.Value, + }) +} + +// MarshalJSON implements json.Marshaler. +func (s Sample) MarshalJSON() ([]byte, error) { + v := struct { + Metric Metric `json:"metric"` + Value SamplePair `json:"value"` + }{ + Metric: s.Metric, + Value: SamplePair{ + Timestamp: s.Timestamp, + Value: s.Value, + }, + } + + return json.Marshal(&v) +} + +// UnmarshalJSON implements json.Unmarshaler. +func (s *Sample) UnmarshalJSON(b []byte) error { + v := struct { + Metric Metric `json:"metric"` + Value SamplePair `json:"value"` + }{ + Metric: s.Metric, + Value: SamplePair{ + Timestamp: s.Timestamp, + Value: s.Value, + }, + } + + if err := json.Unmarshal(b, &v); err != nil { + return err + } + + s.Metric = v.Metric + s.Timestamp = v.Value.Timestamp + s.Value = v.Value.Value + + return nil +} + +// Samples is a sortable Sample slice. It implements sort.Interface. +type Samples []*Sample + +func (s Samples) Len() int { + return len(s) +} + +// Less compares first the metrics, then the timestamp. +func (s Samples) Less(i, j int) bool { + switch { + case s[i].Metric.Before(s[j].Metric): + return true + case s[j].Metric.Before(s[i].Metric): + return false + case s[i].Timestamp.Before(s[j].Timestamp): + return true + default: + return false + } +} + +func (s Samples) Swap(i, j int) { + s[i], s[j] = s[j], s[i] +} + +// Equal compares two sets of samples and returns true if they are equal. +func (s Samples) Equal(o Samples) bool { + if len(s) != len(o) { + return false + } + + for i, sample := range s { + if !sample.Equal(o[i]) { + return false + } + } + return true +} + +// SampleStream is a stream of Values belonging to an attached COWMetric. +type SampleStream struct { + Metric Metric `json:"metric"` + Values []SamplePair `json:"values"` +} + +func (ss SampleStream) String() string { + vals := make([]string, len(ss.Values)) + for i, v := range ss.Values { + vals[i] = v.String() + } + return fmt.Sprintf("%s =>\n%s", ss.Metric, strings.Join(vals, "\n")) +} + +// Value is a generic interface for values resulting from a query evaluation. +type Value interface { + Type() ValueType + String() string +} + +func (Matrix) Type() ValueType { return ValMatrix } +func (Vector) Type() ValueType { return ValVector } +func (*Scalar) Type() ValueType { return ValScalar } +func (*String) Type() ValueType { return ValString } + +type ValueType int + +const ( + ValNone ValueType = iota + ValScalar + ValVector + ValMatrix + ValString +) + +// MarshalJSON implements json.Marshaler. +func (et ValueType) MarshalJSON() ([]byte, error) { + return json.Marshal(et.String()) +} + +func (et *ValueType) UnmarshalJSON(b []byte) error { + var s string + if err := json.Unmarshal(b, &s); err != nil { + return err + } + switch s { + case "": + *et = ValNone + case "scalar": + *et = ValScalar + case "vector": + *et = ValVector + case "matrix": + *et = ValMatrix + case "string": + *et = ValString + default: + return fmt.Errorf("unknown value type %q", s) + } + return nil +} + +func (e ValueType) String() string { + switch e { + case ValNone: + return "" + case ValScalar: + return "scalar" + case ValVector: + return "vector" + case ValMatrix: + return "matrix" + case ValString: + return "string" + } + panic("ValueType.String: unhandled value type") +} + +// Scalar is a scalar value evaluated at the set timestamp. +type Scalar struct { + Value SampleValue `json:"value"` + Timestamp Time `json:"timestamp"` +} + +func (s Scalar) String() string { + return fmt.Sprintf("scalar: %v @[%v]", s.Value, s.Timestamp) +} + +// MarshalJSON implements json.Marshaler. +func (s Scalar) MarshalJSON() ([]byte, error) { + v := strconv.FormatFloat(float64(s.Value), 'f', -1, 64) + return json.Marshal([...]interface{}{s.Timestamp, string(v)}) +} + +// UnmarshalJSON implements json.Unmarshaler. +func (s *Scalar) UnmarshalJSON(b []byte) error { + var f string + v := [...]interface{}{&s.Timestamp, &f} + + if err := json.Unmarshal(b, &v); err != nil { + return err + } + + value, err := strconv.ParseFloat(f, 64) + if err != nil { + return fmt.Errorf("error parsing sample value: %s", err) + } + s.Value = SampleValue(value) + return nil +} + +// String is a string value evaluated at the set timestamp. +type String struct { + Value string `json:"value"` + Timestamp Time `json:"timestamp"` +} + +func (s *String) String() string { + return s.Value +} + +// MarshalJSON implements json.Marshaler. +func (s String) MarshalJSON() ([]byte, error) { + return json.Marshal([]interface{}{s.Timestamp, s.Value}) +} + +// UnmarshalJSON implements json.Unmarshaler. +func (s *String) UnmarshalJSON(b []byte) error { + v := [...]interface{}{&s.Timestamp, &s.Value} + return json.Unmarshal(b, &v) +} + +// Vector is basically only an alias for Samples, but the +// contract is that in a Vector, all Samples have the same timestamp. +type Vector []*Sample + +func (vec Vector) String() string { + entries := make([]string, len(vec)) + for i, s := range vec { + entries[i] = s.String() + } + return strings.Join(entries, "\n") +} + +func (vec Vector) Len() int { return len(vec) } +func (vec Vector) Swap(i, j int) { vec[i], vec[j] = vec[j], vec[i] } + +// Less compares first the metrics, then the timestamp. +func (vec Vector) Less(i, j int) bool { + switch { + case vec[i].Metric.Before(vec[j].Metric): + return true + case vec[j].Metric.Before(vec[i].Metric): + return false + case vec[i].Timestamp.Before(vec[j].Timestamp): + return true + default: + return false + } +} + +// Equal compares two sets of samples and returns true if they are equal. +func (vec Vector) Equal(o Vector) bool { + if len(vec) != len(o) { + return false + } + + for i, sample := range vec { + if !sample.Equal(o[i]) { + return false + } + } + return true +} + +// Matrix is a list of time series. +type Matrix []*SampleStream + +func (m Matrix) Len() int { return len(m) } +func (m Matrix) Less(i, j int) bool { return m[i].Metric.Before(m[j].Metric) } +func (m Matrix) Swap(i, j int) { m[i], m[j] = m[j], m[i] } + +func (mat Matrix) String() string { + matCp := make(Matrix, len(mat)) + copy(matCp, mat) + sort.Sort(matCp) + + strs := make([]string, len(matCp)) + + for i, ss := range matCp { + strs[i] = ss.String() + } + + return strings.Join(strs, "\n") +} diff --git a/Godeps/_workspace/src/github.com/prometheus/common/model/value_test.go b/Godeps/_workspace/src/github.com/prometheus/common/model/value_test.go new file mode 100644 index 000000000000..2e9c7eb09d1a --- /dev/null +++ b/Godeps/_workspace/src/github.com/prometheus/common/model/value_test.go @@ -0,0 +1,362 @@ +// Copyright 2013 The Prometheus 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 model + +import ( + "encoding/json" + "math" + "reflect" + "sort" + "testing" +) + +func TestSamplePairJSON(t *testing.T) { + input := []struct { + plain string + value SamplePair + }{ + { + plain: `[1234.567,"123.1"]`, + value: SamplePair{ + Value: 123.1, + Timestamp: 1234567, + }, + }, + } + + for _, test := range input { + b, err := json.Marshal(test.value) + if err != nil { + t.Error(err) + continue + } + + if string(b) != test.plain { + t.Errorf("encoding error: expected %q, got %q", test.plain, b) + continue + } + + var sp SamplePair + err = json.Unmarshal(b, &sp) + if err != nil { + t.Error(err) + continue + } + + if sp != test.value { + t.Errorf("decoding error: expected %v, got %v", test.value, sp) + } + } +} + +func TestSampleJSON(t *testing.T) { + input := []struct { + plain string + value Sample + }{ + { + plain: `{"metric":{"__name__":"test_metric"},"value":[1234.567,"123.1"]}`, + value: Sample{ + Metric: Metric{ + MetricNameLabel: "test_metric", + }, + Value: 123.1, + Timestamp: 1234567, + }, + }, + } + + for _, test := range input { + b, err := json.Marshal(test.value) + if err != nil { + t.Error(err) + continue + } + + if string(b) != test.plain { + t.Errorf("encoding error: expected %q, got %q", test.plain, b) + continue + } + + var sv Sample + err = json.Unmarshal(b, &sv) + if err != nil { + t.Error(err) + continue + } + + if !reflect.DeepEqual(sv, test.value) { + t.Errorf("decoding error: expected %v, got %v", test.value, sv) + } + } +} + +func TestVectorJSON(t *testing.T) { + input := []struct { + plain string + value Vector + }{ + { + plain: `[]`, + value: Vector{}, + }, + { + plain: `[{"metric":{"__name__":"test_metric"},"value":[1234.567,"123.1"]}]`, + value: Vector{&Sample{ + Metric: Metric{ + MetricNameLabel: "test_metric", + }, + Value: 123.1, + Timestamp: 1234567, + }}, + }, + { + plain: `[{"metric":{"__name__":"test_metric"},"value":[1234.567,"123.1"]},{"metric":{"foo":"bar"},"value":[1.234,"+Inf"]}]`, + value: Vector{ + &Sample{ + Metric: Metric{ + MetricNameLabel: "test_metric", + }, + Value: 123.1, + Timestamp: 1234567, + }, + &Sample{ + Metric: Metric{ + "foo": "bar", + }, + Value: SampleValue(math.Inf(1)), + Timestamp: 1234, + }, + }, + }, + } + + for _, test := range input { + b, err := json.Marshal(test.value) + if err != nil { + t.Error(err) + continue + } + + if string(b) != test.plain { + t.Errorf("encoding error: expected %q, got %q", test.plain, b) + continue + } + + var vec Vector + err = json.Unmarshal(b, &vec) + if err != nil { + t.Error(err) + continue + } + + if !reflect.DeepEqual(vec, test.value) { + t.Errorf("decoding error: expected %v, got %v", test.value, vec) + } + } +} + +func TestScalarJSON(t *testing.T) { + input := []struct { + plain string + value Scalar + }{ + { + plain: `[123.456,"456"]`, + value: Scalar{ + Timestamp: 123456, + Value: 456, + }, + }, + { + plain: `[123123.456,"+Inf"]`, + value: Scalar{ + Timestamp: 123123456, + Value: SampleValue(math.Inf(1)), + }, + }, + { + plain: `[123123.456,"-Inf"]`, + value: Scalar{ + Timestamp: 123123456, + Value: SampleValue(math.Inf(-1)), + }, + }, + } + + for _, test := range input { + b, err := json.Marshal(test.value) + if err != nil { + t.Error(err) + continue + } + + if string(b) != test.plain { + t.Errorf("encoding error: expected %q, got %q", test.plain, b) + continue + } + + var sv Scalar + err = json.Unmarshal(b, &sv) + if err != nil { + t.Error(err) + continue + } + + if sv != test.value { + t.Errorf("decoding error: expected %v, got %v", test.value, sv) + } + } +} + +func TestStringJSON(t *testing.T) { + input := []struct { + plain string + value String + }{ + { + plain: `[123.456,"test"]`, + value: String{ + Timestamp: 123456, + Value: "test", + }, + }, + { + plain: `[123123.456,"台北"]`, + value: String{ + Timestamp: 123123456, + Value: "台北", + }, + }, + } + + for _, test := range input { + b, err := json.Marshal(test.value) + if err != nil { + t.Error(err) + continue + } + + if string(b) != test.plain { + t.Errorf("encoding error: expected %q, got %q", test.plain, b) + continue + } + + var sv String + err = json.Unmarshal(b, &sv) + if err != nil { + t.Error(err) + continue + } + + if sv != test.value { + t.Errorf("decoding error: expected %v, got %v", test.value, sv) + } + } +} + +func TestVectorSort(t *testing.T) { + input := Vector{ + &Sample{ + Metric: Metric{ + MetricNameLabel: "A", + }, + Timestamp: 1, + }, + &Sample{ + Metric: Metric{ + MetricNameLabel: "A", + }, + Timestamp: 2, + }, + &Sample{ + Metric: Metric{ + MetricNameLabel: "C", + }, + Timestamp: 1, + }, + &Sample{ + Metric: Metric{ + MetricNameLabel: "C", + }, + Timestamp: 2, + }, + &Sample{ + Metric: Metric{ + MetricNameLabel: "B", + }, + Timestamp: 1, + }, + &Sample{ + Metric: Metric{ + MetricNameLabel: "B", + }, + Timestamp: 2, + }, + } + + expected := Vector{ + &Sample{ + Metric: Metric{ + MetricNameLabel: "A", + }, + Timestamp: 1, + }, + &Sample{ + Metric: Metric{ + MetricNameLabel: "A", + }, + Timestamp: 2, + }, + &Sample{ + Metric: Metric{ + MetricNameLabel: "B", + }, + Timestamp: 1, + }, + &Sample{ + Metric: Metric{ + MetricNameLabel: "B", + }, + Timestamp: 2, + }, + &Sample{ + Metric: Metric{ + MetricNameLabel: "C", + }, + Timestamp: 1, + }, + &Sample{ + Metric: Metric{ + MetricNameLabel: "C", + }, + Timestamp: 2, + }, + } + + sort.Sort(input) + + for i, actual := range input { + actualFp := actual.Metric.Fingerprint() + expectedFp := expected[i].Metric.Fingerprint() + + if actualFp != expectedFp { + t.Fatalf("%d. Incorrect fingerprint. Got %s; want %s", i, actualFp.String(), expectedFp.String()) + } + + if actual.Timestamp != expected[i].Timestamp { + t.Fatalf("%d. Incorrect timestamp. Got %s; want %s", i, actual.Timestamp, expected[i].Timestamp) + } + } +} diff --git a/Godeps/_workspace/src/github.com/rackspace/gophercloud/CONTRIBUTING.md b/Godeps/_workspace/src/github.com/rackspace/gophercloud/CONTRIBUTING.md index 9748c1ad2b11..6ba5beb85438 100644 --- a/Godeps/_workspace/src/github.com/rackspace/gophercloud/CONTRIBUTING.md +++ b/Godeps/_workspace/src/github.com/rackspace/gophercloud/CONTRIBUTING.md @@ -28,11 +28,10 @@ fork as `origin` instead: git remote add origin git@github.com//gophercloud ``` -4. Checkout the latest development branch ([click here](/branches) to see all -the branches): +4. Checkout the latest development branch: ```bash - git checkout release/v1.0.1 + git checkout master ``` 5. If you're working on something (discussed more in detail below), you will diff --git a/Godeps/_workspace/src/github.com/rackspace/gophercloud/acceptance/openstack/compute/v2/network_test.go b/Godeps/_workspace/src/github.com/rackspace/gophercloud/acceptance/openstack/compute/v2/network_test.go new file mode 100644 index 000000000000..7ebe7ec7bba9 --- /dev/null +++ b/Godeps/_workspace/src/github.com/rackspace/gophercloud/acceptance/openstack/compute/v2/network_test.go @@ -0,0 +1,78 @@ +// +build acceptance compute servers + +package v2 + +import ( + "os" + "testing" + + "github.com/rackspace/gophercloud" + "github.com/rackspace/gophercloud/openstack/compute/v2/extensions/networks" + "github.com/rackspace/gophercloud/openstack/compute/v2/servers" + th "github.com/rackspace/gophercloud/testhelper" +) + +func getNetworkIDFromNetworkExtension(t *testing.T, client *gophercloud.ServiceClient, networkName string) (string, error) { + allPages, err := networks.List(client).AllPages() + if err != nil { + t.Fatalf("Unable to list networks: %v", err) + } + + networkList, err := networks.ExtractNetworks(allPages) + if err != nil { + t.Fatalf("Unable to list networks: %v", err) + } + + networkID := "" + for _, network := range networkList { + t.Logf("Network: %v", network) + if network.Label == networkName { + networkID = network.ID + } + } + + t.Logf("Found network ID for %s: %s\n", networkName, networkID) + + return networkID, nil +} + +func TestNetworks(t *testing.T) { + networkName := os.Getenv("OS_NETWORK_NAME") + if networkName == "" { + t.Fatalf("OS_NETWORK_NAME must be set") + } + + choices, err := ComputeChoicesFromEnv() + if err != nil { + t.Fatal(err) + } + + client, err := newClient() + if err != nil { + t.Fatalf("Unable to create a compute client: %v", err) + } + + networkID, err := getNetworkIDFromNetworkExtension(t, client, networkName) + if err != nil { + t.Fatalf("Unable to get network ID: %v", err) + } + + // createNetworkServer is defined in tenantnetworks_test.go + server, err := createNetworkServer(t, client, choices, networkID) + if err != nil { + t.Fatalf("Unable to create server: %v", err) + } + defer func() { + servers.Delete(client, server.ID) + t.Logf("Server deleted.") + }() + + if err = waitForStatus(client, server, "ACTIVE"); err != nil { + t.Fatalf("Unable to wait for server: %v", err) + } + + allPages, err := networks.List(client).AllPages() + allNetworks, err := networks.ExtractNetworks(allPages) + th.AssertNoErr(t, err) + t.Logf("Retrieved all %d networks: %+v", len(allNetworks), allNetworks) +} diff --git a/Godeps/_workspace/src/github.com/rackspace/gophercloud/acceptance/openstack/compute/v2/servergroup_test.go b/Godeps/_workspace/src/github.com/rackspace/gophercloud/acceptance/openstack/compute/v2/servergroup_test.go index 80015e143f52..945854e3b27f 100644 --- a/Godeps/_workspace/src/github.com/rackspace/gophercloud/acceptance/openstack/compute/v2/servergroup_test.go +++ b/Godeps/_workspace/src/github.com/rackspace/gophercloud/acceptance/openstack/compute/v2/servergroup_test.go @@ -3,10 +3,15 @@ package v2 import ( + "fmt" "testing" "github.com/rackspace/gophercloud" + "github.com/rackspace/gophercloud/acceptance/tools" + "github.com/rackspace/gophercloud/openstack/compute/v2/extensions/schedulerhints" "github.com/rackspace/gophercloud/openstack/compute/v2/extensions/servergroups" + "github.com/rackspace/gophercloud/openstack/compute/v2/servers" + th "github.com/rackspace/gophercloud/testhelper" ) func createServerGroup(t *testing.T, computeClient *gophercloud.ServiceClient) (*servergroups.ServerGroup, error) { @@ -36,7 +41,53 @@ func getServerGroup(t *testing.T, computeClient *gophercloud.ServiceClient, sgID return nil } +func createServerInGroup(t *testing.T, computeClient *gophercloud.ServiceClient, choices *ComputeChoices, serverGroup *servergroups.ServerGroup) (*servers.Server, error) { + if testing.Short() { + t.Skip("Skipping test that requires server creation in short mode.") + } + + name := tools.RandomString("ACPTTEST", 16) + t.Logf("Attempting to create server: %s\n", name) + + pwd := tools.MakeNewPassword("") + + serverCreateOpts := servers.CreateOpts{ + Name: name, + FlavorRef: choices.FlavorID, + ImageRef: choices.ImageID, + AdminPass: pwd, + } + server, err := servers.Create(computeClient, schedulerhints.CreateOptsExt{ + serverCreateOpts, + schedulerhints.SchedulerHints{ + Group: serverGroup.ID, + }, + }).Extract() + if err != nil { + t.Fatalf("Unable to create server: %v", err) + } + + th.AssertEquals(t, pwd, server.AdminPass) + + return server, err +} + +func verifySchedulerWorked(t *testing.T, firstServer, secondServer *servers.Server) error { + t.Logf("First server hostID: %v", firstServer.HostID) + t.Logf("Second server hostID: %v", secondServer.HostID) + if firstServer.HostID == secondServer.HostID { + return nil + } + + return fmt.Errorf("%s and %s were not scheduled on the same host.", firstServer.ID, secondServer.ID) +} + func TestServerGroups(t *testing.T) { + choices, err := ComputeChoicesFromEnv() + if err != nil { + t.Fatal(err) + } + computeClient, err := newClient() if err != nil { t.Fatalf("Unable to create a compute client: %v", err) @@ -48,11 +99,45 @@ func TestServerGroups(t *testing.T) { } defer func() { servergroups.Delete(computeClient, sg.ID) - t.Logf("ServerGroup deleted.") + t.Logf("Server Group deleted.") }() err = getServerGroup(t, computeClient, sg.ID) if err != nil { t.Fatalf("Unable to get server group: %v", err) } + + firstServer, err := createServerInGroup(t, computeClient, choices, sg) + if err != nil { + t.Fatalf("Unable to create server: %v", err) + } + defer func() { + servers.Delete(computeClient, firstServer.ID) + t.Logf("Server deleted.") + }() + + if err = waitForStatus(computeClient, firstServer, "ACTIVE"); err != nil { + t.Fatalf("Unable to wait for server: %v", err) + } + + firstServer, err = servers.Get(computeClient, firstServer.ID).Extract() + + secondServer, err := createServerInGroup(t, computeClient, choices, sg) + if err != nil { + t.Fatalf("Unable to create server: %v", err) + } + defer func() { + servers.Delete(computeClient, secondServer.ID) + t.Logf("Server deleted.") + }() + + if err = waitForStatus(computeClient, secondServer, "ACTIVE"); err != nil { + t.Fatalf("Unable to wait for server: %v", err) + } + + secondServer, err = servers.Get(computeClient, secondServer.ID).Extract() + + if err = verifySchedulerWorked(t, firstServer, secondServer); err != nil { + t.Fatalf("Scheduling did not work: %v", err) + } } diff --git a/Godeps/_workspace/src/github.com/rackspace/gophercloud/acceptance/openstack/compute/v2/servers_test.go b/Godeps/_workspace/src/github.com/rackspace/gophercloud/acceptance/openstack/compute/v2/servers_test.go index 7b928e9ef509..f6c7c052458a 100644 --- a/Godeps/_workspace/src/github.com/rackspace/gophercloud/acceptance/openstack/compute/v2/servers_test.go +++ b/Godeps/_workspace/src/github.com/rackspace/gophercloud/acceptance/openstack/compute/v2/servers_test.go @@ -107,6 +107,12 @@ func createServer(t *testing.T, client *gophercloud.ServiceClient, choices *Comp servers.Network{UUID: network.ID}, }, AdminPass: pwd, + Personality: servers.Personality{ + &servers.File{ + Path: "/etc/test", + Contents: []byte("hello world"), + }, + }, }).Extract() if err != nil { t.Fatalf("Unable to create server: %v", err) diff --git a/Godeps/_workspace/src/github.com/rackspace/gophercloud/acceptance/rackspace/identity/v2/tokens_test.go b/Godeps/_workspace/src/github.com/rackspace/gophercloud/acceptance/rackspace/identity/v2/tokens_test.go new file mode 100644 index 000000000000..95ee7e660cd5 --- /dev/null +++ b/Godeps/_workspace/src/github.com/rackspace/gophercloud/acceptance/rackspace/identity/v2/tokens_test.go @@ -0,0 +1,61 @@ +// +build acceptance + +package v2 + +import ( + "os" + "testing" + + "github.com/rackspace/gophercloud" + "github.com/rackspace/gophercloud/acceptance/tools" + "github.com/rackspace/gophercloud/rackspace" + "github.com/rackspace/gophercloud/rackspace/identity/v2/tokens" + 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, auth bool) *gophercloud.ServiceClient { + ao := rackspaceAuthOptions(t) + + provider, err := rackspace.NewClient(ao.IdentityEndpoint) + th.AssertNoErr(t, err) + + if auth { + err = rackspace.Authenticate(provider, ao) + th.AssertNoErr(t, err) + } + + return rackspace.NewIdentityV2(provider) +} + +func TestTokenAuth(t *testing.T) { + authedClient := createClient(t, true) + token := authedClient.TokenID + + tenantID := os.Getenv("RS_TENANT_ID") + if tenantID == "" { + t.Skip("You must set RS_TENANT_ID environment variable to run this test") + } + + authOpts := tokens.AuthOptions{} + authOpts.TenantID = tenantID + authOpts.Token = token + + _, err := tokens.Create(authedClient, authOpts).ExtractToken() + th.AssertNoErr(t, err) +} diff --git a/Godeps/_workspace/src/github.com/rackspace/gophercloud/auth_options.go b/Godeps/_workspace/src/github.com/rackspace/gophercloud/auth_options.go index 9819e45f2d75..d26e16ac1c43 100644 --- a/Godeps/_workspace/src/github.com/rackspace/gophercloud/auth_options.go +++ b/Godeps/_workspace/src/github.com/rackspace/gophercloud/auth_options.go @@ -43,4 +43,8 @@ type AuthOptions struct { // false, it will not cache these settings, but re-authentication will not be // possible. This setting defaults to false. AllowReauth bool + + // TokenID allows users to authenticate (possibly as another user) with an + // authentication token ID. + TokenID string } diff --git a/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/blockstorage/v1/snapshots/requests.go b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/blockstorage/v1/snapshots/requests.go index d2f10aa6b592..71936e51b643 100644 --- a/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/blockstorage/v1/snapshots/requests.go +++ b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/blockstorage/v1/snapshots/requests.go @@ -171,3 +171,36 @@ func UpdateMetadata(client *gophercloud.ServiceClient, id string, opts UpdateMet }) 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/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/blockstorage/v1/volumes/fixtures_test.go b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/blockstorage/v1/volumes/fixtures_test.go deleted file mode 100644 index a1b8697c2a73..000000000000 --- a/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/blockstorage/v1/volumes/fixtures_test.go +++ /dev/null @@ -1,113 +0,0 @@ -package volumes - -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/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/blockstorage/v1/volumes/requests.go b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/blockstorage/v1/volumes/requests.go index 253aaf7c5450..3e9243ac4957 100644 --- a/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/blockstorage/v1/volumes/requests.go +++ b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/blockstorage/v1/volumes/requests.go @@ -201,3 +201,36 @@ func Update(client *gophercloud.ServiceClient, id string, opts UpdateOptsBuilder }) return res } + +// IDFromName is a convienience function that returns a server's ID given its name. +func IDFromName(client *gophercloud.ServiceClient, name string) (string, error) { + volumeCount := 0 + volumeID := "" + if name == "" { + return "", fmt.Errorf("A volume name must be provided.") + } + pager := List(client, nil) + pager.EachPage(func(page pagination.Page) (bool, error) { + volumeList, err := ExtractVolumes(page) + if err != nil { + return false, err + } + + for _, s := range volumeList { + if s.Name == name { + volumeCount++ + volumeID = s.ID + } + } + return true, nil + }) + + switch volumeCount { + case 0: + return "", fmt.Errorf("Unable to find volume: %s", name) + case 1: + return volumeID, nil + default: + return "", fmt.Errorf("Found %d volumes matching %s", volumeCount, name) + } +} diff --git a/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/blockstorage/v1/volumes/requests_test.go b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/blockstorage/v1/volumes/requests_test.go index c484cf08df3a..75c2bbc59657 100644 --- a/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/blockstorage/v1/volumes/requests_test.go +++ b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/blockstorage/v1/volumes/requests_test.go @@ -3,6 +3,7 @@ package volumes import ( "testing" + fixtures "github.com/rackspace/gophercloud/openstack/blockstorage/v1/volumes/testing" "github.com/rackspace/gophercloud/pagination" th "github.com/rackspace/gophercloud/testhelper" "github.com/rackspace/gophercloud/testhelper/client" @@ -12,7 +13,7 @@ func TestList(t *testing.T) { th.SetupHTTP() defer th.TeardownHTTP() - MockListResponse(t) + fixtures.MockListResponse(t) count := 0 @@ -49,7 +50,7 @@ func TestListAll(t *testing.T) { th.SetupHTTP() defer th.TeardownHTTP() - MockListResponse(t) + fixtures.MockListResponse(t) allPages, err := List(client.ServiceClient(), &ListOpts{}).AllPages() th.AssertNoErr(t, err) @@ -75,7 +76,7 @@ func TestGet(t *testing.T) { th.SetupHTTP() defer th.TeardownHTTP() - MockGetResponse(t) + fixtures.MockGetResponse(t) v, err := Get(client.ServiceClient(), "d32019d3-bc6e-4319-9c1d-6722fc136a22").Extract() th.AssertNoErr(t, err) @@ -89,7 +90,7 @@ func TestCreate(t *testing.T) { th.SetupHTTP() defer th.TeardownHTTP() - MockCreateResponse(t) + fixtures.MockCreateResponse(t) options := &CreateOpts{Size: 75} n, err := Create(client.ServiceClient(), options).Extract() @@ -103,7 +104,7 @@ func TestDelete(t *testing.T) { th.SetupHTTP() defer th.TeardownHTTP() - MockDeleteResponse(t) + fixtures.MockDeleteResponse(t) res := Delete(client.ServiceClient(), "d32019d3-bc6e-4319-9c1d-6722fc136a22") th.AssertNoErr(t, res.Err) @@ -113,7 +114,7 @@ func TestUpdate(t *testing.T) { th.SetupHTTP() defer th.TeardownHTTP() - MockUpdateResponse(t) + fixtures.MockUpdateResponse(t) options := UpdateOpts{Name: "vol-002"} v, err := Update(client.ServiceClient(), "d32019d3-bc6e-4319-9c1d-6722fc136a22", options).Extract() diff --git a/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/blockstorage/v1/volumes/testing/doc.go b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/blockstorage/v1/volumes/testing/doc.go new file mode 100644 index 000000000000..2f66ba5e45a0 --- /dev/null +++ b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/blockstorage/v1/volumes/testing/doc.go @@ -0,0 +1,7 @@ +/* +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/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/blockstorage/v1/volumes/testing/fixtures.go b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/blockstorage/v1/volumes/testing/fixtures.go new file mode 100644 index 000000000000..3df7653f7634 --- /dev/null +++ b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/blockstorage/v1/volumes/testing/fixtures.go @@ -0,0 +1,113 @@ +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/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/bootfromvolume/requests_test.go b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/bootfromvolume/requests_test.go index 5bf9137906c1..8a7fa7467534 100644 --- a/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/bootfromvolume/requests_test.go +++ b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/bootfromvolume/requests_test.go @@ -32,6 +32,8 @@ func TestCreateOpts(t *testing.T) { "name": "createdserver", "imageRef": "asdfasdfasdf", "flavorRef": "performance1-1", + "flavorName": "", + "imageName": "", "block_device_mapping_v2":[ { "uuid":"123456", diff --git a/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/diskconfig/requests_test.go b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/diskconfig/requests_test.go index e3c26d49a552..17418a3ce3ac 100644 --- a/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/diskconfig/requests_test.go +++ b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/diskconfig/requests_test.go @@ -25,6 +25,8 @@ func TestCreateOpts(t *testing.T) { "name": "createdserver", "imageRef": "asdfasdfasdf", "flavorRef": "performance1-1", + "flavorName": "", + "imageName": "", "OS-DCF:diskConfig": "MANUAL" } } diff --git a/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/networks/doc.go b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/networks/doc.go new file mode 100644 index 000000000000..fafe4a04d745 --- /dev/null +++ b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/networks/doc.go @@ -0,0 +1,2 @@ +// Package network provides the ability to manage nova-networks +package networks diff --git a/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/networks/fixtures.go b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/networks/fixtures.go new file mode 100644 index 000000000000..12b94859b16b --- /dev/null +++ b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/networks/fixtures.go @@ -0,0 +1,209 @@ +// +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/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/networks/requests.go b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/networks/requests.go new file mode 100644 index 000000000000..eb203878ba0a --- /dev/null +++ b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/networks/requests.go @@ -0,0 +1,22 @@ +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/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/networks/requests_test.go b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/networks/requests_test.go new file mode 100644 index 000000000000..722b3f0bd073 --- /dev/null +++ b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/networks/requests_test.go @@ -0,0 +1,37 @@ +package networks + +import ( + "testing" + + "github.com/rackspace/gophercloud/pagination" + th "github.com/rackspace/gophercloud/testhelper" + "github.com/rackspace/gophercloud/testhelper/client" +) + +func TestList(t *testing.T) { + th.SetupHTTP() + defer th.TeardownHTTP() + HandleListSuccessfully(t) + + count := 0 + err := List(client.ServiceClient()).EachPage(func(page pagination.Page) (bool, error) { + count++ + actual, err := ExtractNetworks(page) + th.AssertNoErr(t, err) + th.CheckDeepEquals(t, ExpectedNetworkSlice, actual) + + return true, nil + }) + th.AssertNoErr(t, err) + th.CheckEquals(t, 1, count) +} + +func TestGet(t *testing.T) { + th.SetupHTTP() + defer th.TeardownHTTP() + HandleGetSuccessfully(t) + + actual, err := Get(client.ServiceClient(), "20c8acc0-f747-4d71-a389-46d078ebf000").Extract() + th.AssertNoErr(t, err) + th.CheckDeepEquals(t, &SecondNetwork, actual) +} diff --git a/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/networks/results.go b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/networks/results.go new file mode 100644 index 000000000000..55b361d7fc98 --- /dev/null +++ b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/networks/results.go @@ -0,0 +1,222 @@ +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/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/networks/urls.go b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/networks/urls.go new file mode 100644 index 000000000000..69664620aff9 --- /dev/null +++ b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/networks/urls.go @@ -0,0 +1,17 @@ +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/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/networks/urls_test.go b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/networks/urls_test.go new file mode 100644 index 000000000000..be54c90a566a --- /dev/null +++ b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/networks/urls_test.go @@ -0,0 +1,25 @@ +package networks + +import ( + "testing" + + th "github.com/rackspace/gophercloud/testhelper" + "github.com/rackspace/gophercloud/testhelper/client" +) + +func TestListURL(t *testing.T) { + th.SetupHTTP() + defer th.TeardownHTTP() + c := client.ServiceClient() + + th.CheckEquals(t, c.Endpoint+"os-networks", listURL(c)) +} + +func TestGetURL(t *testing.T) { + th.SetupHTTP() + defer th.TeardownHTTP() + c := client.ServiceClient() + id := "1" + + th.CheckEquals(t, c.Endpoint+"os-networks/"+id, getURL(c, id)) +} diff --git a/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/schedulerhints/doc.go b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/schedulerhints/doc.go new file mode 100644 index 000000000000..0bd45661b562 --- /dev/null +++ b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/schedulerhints/doc.go @@ -0,0 +1,3 @@ +// Package schedulerhints enables instances to provide the OpenStack scheduler +// hints about where they should be placed in the cloud. +package schedulerhints diff --git a/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/schedulerhints/requests.go b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/schedulerhints/requests.go new file mode 100644 index 000000000000..567eef41a11d --- /dev/null +++ b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/schedulerhints/requests.go @@ -0,0 +1,134 @@ +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/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/schedulerhints/requests_test.go b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/schedulerhints/requests_test.go new file mode 100644 index 000000000000..9b38b35d9c4c --- /dev/null +++ b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/schedulerhints/requests_test.go @@ -0,0 +1,130 @@ +package schedulerhints + +import ( + "testing" + + "github.com/rackspace/gophercloud/openstack/compute/v2/servers" + th "github.com/rackspace/gophercloud/testhelper" +) + +func TestCreateOpts(t *testing.T) { + base := servers.CreateOpts{ + Name: "createdserver", + ImageRef: "asdfasdfasdf", + FlavorRef: "performance1-1", + } + + schedulerHints := SchedulerHints{ + Group: "101aed42-22d9-4a3e-9ba1-21103b0d1aba", + DifferentHost: []string{ + "a0cf03a5-d921-4877-bb5c-86d26cf818e1", + "8c19174f-4220-44f0-824a-cd1eeef10287", + }, + SameHost: []string{ + "a0cf03a5-d921-4877-bb5c-86d26cf818e1", + "8c19174f-4220-44f0-824a-cd1eeef10287", + }, + Query: []interface{}{">=", "$free_ram_mb", "1024"}, + TargetCell: "foobar", + BuildNearHostIP: "192.168.1.1/24", + } + + ext := CreateOptsExt{ + CreateOptsBuilder: base, + SchedulerHints: schedulerHints, + } + + expected := ` + { + "server": { + "name": "createdserver", + "imageRef": "asdfasdfasdf", + "flavorRef": "performance1-1", + "flavorName": "", + "imageName": "" + }, + "os:scheduler_hints": { + "group": "101aed42-22d9-4a3e-9ba1-21103b0d1aba", + "different_host": [ + "a0cf03a5-d921-4877-bb5c-86d26cf818e1", + "8c19174f-4220-44f0-824a-cd1eeef10287" + ], + "same_host": [ + "a0cf03a5-d921-4877-bb5c-86d26cf818e1", + "8c19174f-4220-44f0-824a-cd1eeef10287" + ], + "query": [ + ">=", "$free_ram_mb", "1024" + ], + "target_cell": "foobar", + "build_near_host_ip": "192.168.1.1", + "cidr": "/24" + } + } + ` + actual, err := ext.ToServerCreateMap() + th.AssertNoErr(t, err) + th.CheckJSONEquals(t, expected, actual) +} + +func TestCreateOptsWithComplexQuery(t *testing.T) { + base := servers.CreateOpts{ + Name: "createdserver", + ImageRef: "asdfasdfasdf", + FlavorRef: "performance1-1", + } + + schedulerHints := SchedulerHints{ + Group: "101aed42-22d9-4a3e-9ba1-21103b0d1aba", + DifferentHost: []string{ + "a0cf03a5-d921-4877-bb5c-86d26cf818e1", + "8c19174f-4220-44f0-824a-cd1eeef10287", + }, + SameHost: []string{ + "a0cf03a5-d921-4877-bb5c-86d26cf818e1", + "8c19174f-4220-44f0-824a-cd1eeef10287", + }, + Query: []interface{}{"and", []string{">=", "$free_ram_mb", "1024"}, []string{">=", "$free_disk_mb", "204800"}}, + TargetCell: "foobar", + BuildNearHostIP: "192.168.1.1/24", + } + + ext := CreateOptsExt{ + CreateOptsBuilder: base, + SchedulerHints: schedulerHints, + } + + expected := ` + { + "server": { + "name": "createdserver", + "imageRef": "asdfasdfasdf", + "flavorRef": "performance1-1", + "flavorName": "", + "imageName": "" + }, + "os:scheduler_hints": { + "group": "101aed42-22d9-4a3e-9ba1-21103b0d1aba", + "different_host": [ + "a0cf03a5-d921-4877-bb5c-86d26cf818e1", + "8c19174f-4220-44f0-824a-cd1eeef10287" + ], + "same_host": [ + "a0cf03a5-d921-4877-bb5c-86d26cf818e1", + "8c19174f-4220-44f0-824a-cd1eeef10287" + ], + "query": [ + "and", + [">=", "$free_ram_mb", "1024"], + [">=", "$free_disk_mb", "204800"] + ], + "target_cell": "foobar", + "build_near_host_ip": "192.168.1.1", + "cidr": "/24" + } + } + ` + actual, err := ext.ToServerCreateMap() + th.AssertNoErr(t, err) + th.CheckJSONEquals(t, expected, actual) +} diff --git a/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/secgroups/fixtures.go b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/secgroups/fixtures.go index 1c6ba394920f..8c42e48e4edf 100644 --- a/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/secgroups/fixtures.go +++ b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/secgroups/fixtures.go @@ -242,6 +242,7 @@ func mockAddServerToGroupResponse(t *testing.T, serverID string) { w.Header().Add("Content-Type", "application/json") w.WriteHeader(http.StatusAccepted) + fmt.Fprintf(w, `{}`) }) } @@ -261,5 +262,6 @@ func mockRemoveServerFromGroupResponse(t *testing.T, serverID string) { w.Header().Add("Content-Type", "application/json") w.WriteHeader(http.StatusAccepted) + fmt.Fprintf(w, `{}`) }) } diff --git a/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/volumeattach/fixtures.go b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/volumeattach/fixtures.go deleted file mode 100644 index a7f03b322c89..000000000000 --- a/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/volumeattach/fixtures.go +++ /dev/null @@ -1,138 +0,0 @@ -// +build fixtures - -package volumeattach - -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" - } -} -` - -// FirstVolumeAttachment is the first result in ListOutput. -var FirstVolumeAttachment = VolumeAttachment{ - Device: "/dev/vdd", - ID: "a26887c6-c47b-4654-abb5-dfadf7d3f803", - ServerID: "4d8c3732-a248-40ed-bebc-539a6ffd25c0", - VolumeID: "a26887c6-c47b-4654-abb5-dfadf7d3f803", -} - -// SecondVolumeAttachment is the first result in ListOutput. -var SecondVolumeAttachment = VolumeAttachment{ - Device: "/dev/vdc", - ID: "a26887c6-c47b-4654-abb5-dfadf7d3f804", - ServerID: "4d8c3732-a248-40ed-bebc-539a6ffd25c0", - VolumeID: "a26887c6-c47b-4654-abb5-dfadf7d3f804", -} - -// ExpectedVolumeAttachmentSlide is the slice of results that should be parsed -// from ListOutput, in the expected order. -var ExpectedVolumeAttachmentSlice = []VolumeAttachment{FirstVolumeAttachment, SecondVolumeAttachment} - -// CreatedVolumeAttachment is the parsed result from CreatedOutput. -var CreatedVolumeAttachment = 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/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/volumeattach/requests_test.go b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/volumeattach/requests_test.go index e17f7e00637d..b0a765befa95 100644 --- a/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/volumeattach/requests_test.go +++ b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/volumeattach/requests_test.go @@ -3,15 +3,44 @@ package volumeattach import ( "testing" + fixtures "github.com/rackspace/gophercloud/openstack/compute/v2/extensions/volumeattach/testing" "github.com/rackspace/gophercloud/pagination" th "github.com/rackspace/gophercloud/testhelper" "github.com/rackspace/gophercloud/testhelper/client" ) +// FirstVolumeAttachment is the first result in ListOutput. +var FirstVolumeAttachment = VolumeAttachment{ + Device: "/dev/vdd", + ID: "a26887c6-c47b-4654-abb5-dfadf7d3f803", + ServerID: "4d8c3732-a248-40ed-bebc-539a6ffd25c0", + VolumeID: "a26887c6-c47b-4654-abb5-dfadf7d3f803", +} + +// SecondVolumeAttachment is the first result in ListOutput. +var SecondVolumeAttachment = VolumeAttachment{ + Device: "/dev/vdc", + ID: "a26887c6-c47b-4654-abb5-dfadf7d3f804", + ServerID: "4d8c3732-a248-40ed-bebc-539a6ffd25c0", + VolumeID: "a26887c6-c47b-4654-abb5-dfadf7d3f804", +} + +// ExpectedVolumeAttachmentSlide is the slice of results that should be parsed +// from ListOutput, in the expected order. +var ExpectedVolumeAttachmentSlice = []VolumeAttachment{FirstVolumeAttachment, SecondVolumeAttachment} + +//CreatedVolumeAttachment is the parsed result from CreatedOutput. +var CreatedVolumeAttachment = VolumeAttachment{ + Device: "/dev/vdc", + ID: "a26887c6-c47b-4654-abb5-dfadf7d3f804", + ServerID: "4d8c3732-a248-40ed-bebc-539a6ffd25c0", + VolumeID: "a26887c6-c47b-4654-abb5-dfadf7d3f804", +} + func TestList(t *testing.T) { th.SetupHTTP() defer th.TeardownHTTP() - HandleListSuccessfully(t) + fixtures.HandleListSuccessfully(t) serverId := "4d8c3732-a248-40ed-bebc-539a6ffd25c0" count := 0 @@ -30,7 +59,7 @@ func TestList(t *testing.T) { func TestCreate(t *testing.T) { th.SetupHTTP() defer th.TeardownHTTP() - HandleCreateSuccessfully(t) + fixtures.HandleCreateSuccessfully(t) serverId := "4d8c3732-a248-40ed-bebc-539a6ffd25c0" actual, err := Create(client.ServiceClient(), serverId, CreateOpts{ @@ -44,7 +73,7 @@ func TestCreate(t *testing.T) { func TestGet(t *testing.T) { th.SetupHTTP() defer th.TeardownHTTP() - HandleGetSuccessfully(t) + fixtures.HandleGetSuccessfully(t) aId := "a26887c6-c47b-4654-abb5-dfadf7d3f804" serverId := "4d8c3732-a248-40ed-bebc-539a6ffd25c0" @@ -56,7 +85,7 @@ func TestGet(t *testing.T) { func TestDelete(t *testing.T) { th.SetupHTTP() defer th.TeardownHTTP() - HandleDeleteSuccessfully(t) + fixtures.HandleDeleteSuccessfully(t) aId := "a26887c6-c47b-4654-abb5-dfadf7d3f804" serverId := "4d8c3732-a248-40ed-bebc-539a6ffd25c0" diff --git a/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/volumeattach/testing/doc.go b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/volumeattach/testing/doc.go new file mode 100644 index 000000000000..183391a6291f --- /dev/null +++ b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/volumeattach/testing/doc.go @@ -0,0 +1,7 @@ +/* +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/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/volumeattach/testing/fixtures.go b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/volumeattach/testing/fixtures.go new file mode 100644 index 000000000000..c469bfbc8593 --- /dev/null +++ b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/volumeattach/testing/fixtures.go @@ -0,0 +1,110 @@ +// +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/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/compute/v2/flavors/requests.go b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/compute/v2/flavors/requests.go index 586be67ac258..59123aaf76f3 100644 --- a/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/compute/v2/flavors/requests.go +++ b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/compute/v2/flavors/requests.go @@ -1,6 +1,8 @@ package flavors import ( + "fmt" + "github.com/rackspace/gophercloud" "github.com/rackspace/gophercloud/pagination" ) @@ -66,3 +68,36 @@ func Get(client *gophercloud.ServiceClient, id string) GetResult { _, res.Err = client.Get(getURL(client, id), &res.Body, nil) return res } + +// IDFromName is a convienience function that returns a flavor's ID given its name. +func IDFromName(client *gophercloud.ServiceClient, name string) (string, error) { + flavorCount := 0 + flavorID := "" + if name == "" { + return "", fmt.Errorf("A flavor name must be provided.") + } + pager := ListDetail(client, nil) + pager.EachPage(func(page pagination.Page) (bool, error) { + flavorList, err := ExtractFlavors(page) + if err != nil { + return false, err + } + + for _, f := range flavorList { + if f.Name == name { + flavorCount++ + flavorID = f.ID + } + } + return true, nil + }) + + switch flavorCount { + case 0: + return "", fmt.Errorf("Unable to find flavor: %s", name) + case 1: + return flavorID, nil + default: + return "", fmt.Errorf("Found %d flavors matching %s", flavorCount, name) + } +} diff --git a/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/compute/v2/images/requests.go b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/compute/v2/images/requests.go index 7ce5139519c7..1e021ad4cd05 100644 --- a/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/compute/v2/images/requests.go +++ b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/compute/v2/images/requests.go @@ -1,6 +1,8 @@ package images import ( + "fmt" + "github.com/rackspace/gophercloud" "github.com/rackspace/gophercloud/pagination" ) @@ -70,3 +72,38 @@ func Delete(client *gophercloud.ServiceClient, id string) DeleteResult { _, result.Err = client.Delete(deleteURL(client, id), nil) return result } + +// IDFromName is a convienience function that returns an image's ID given its name. +func IDFromName(client *gophercloud.ServiceClient, name string) (string, error) { + imageCount := 0 + imageID := "" + if name == "" { + return "", fmt.Errorf("An image name must be provided.") + } + pager := ListDetail(client, &ListOpts{ + Name: name, + }) + pager.EachPage(func(page pagination.Page) (bool, error) { + imageList, err := ExtractImages(page) + if err != nil { + return false, err + } + + for _, i := range imageList { + if i.Name == name { + imageCount++ + imageID = i.ID + } + } + return true, nil + }) + + switch imageCount { + case 0: + return "", fmt.Errorf("Unable to find image: %s", name) + case 1: + return imageID, nil + default: + return "", fmt.Errorf("Found %d images matching %s", imageCount, name) + } +} diff --git a/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/compute/v2/servers/requests.go b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/compute/v2/servers/requests.go index aa8c1a87b277..f9839d9f287a 100644 --- a/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/compute/v2/servers/requests.go +++ b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/compute/v2/servers/requests.go @@ -2,10 +2,13 @@ package servers import ( "encoding/base64" + "encoding/json" "errors" "fmt" "github.com/rackspace/gophercloud" + "github.com/rackspace/gophercloud/openstack/compute/v2/flavors" + "github.com/rackspace/gophercloud/openstack/compute/v2/images" "github.com/rackspace/gophercloud/pagination" ) @@ -14,6 +17,7 @@ import ( type ListOptsBuilder interface { ToServerListQuery() (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 server attributes you want to see returned. Marker and Limit are used @@ -45,6 +49,9 @@ type ListOpts struct { // Integer value for the limit of values to return. Limit int `q:"limit"` + + // Bool to show all tenants + AllTenants bool `q:"all_tenants"` } // ToServerListQuery formats a ListOpts into a query string. @@ -95,18 +102,54 @@ type Network struct { FixedIP string } +// Personality is an array of files that are injected into the server at launch. +type Personality []*File + +// File is used within CreateOpts and RebuildOpts to inject a file into the server at launch. +// File implements the json.Marshaler interface, so when a Create or Rebuild operation is requested, +// json.Marshal will call File's MarshalJSON method. +type File struct { + // Path of the file + Path string + // Contents of the file. Maximum content size is 255 bytes. + Contents []byte +} + +// MarshalJSON marshals the escaped file, base64 encoding the contents. +func (f *File) MarshalJSON() ([]byte, error) { + file := struct { + Path string `json:"path"` + Contents string `json:"contents"` + }{ + Path: f.Path, + Contents: base64.StdEncoding.EncodeToString(f.Contents), + } + return json.Marshal(file) +} + // CreateOpts specifies server creation parameters. type CreateOpts struct { // Name [required] is the name to assign to the newly launched server. Name string - // ImageRef [required] is the ID or full URL to the image that contains the server's OS and initial state. - // Optional if using the boot-from-volume extension. + // ImageRef [optional; required if ImageName is not provided] is the ID or full + // URL to the image that contains the server's OS and initial state. + // Also optional if using the boot-from-volume extension. ImageRef string - // FlavorRef [required] is the ID or full URL to the flavor that describes the server's specs. + // ImageName [optional; required if ImageRef is not provided] is the name of the + // image that contains the server's OS and initial state. + // Also optional if using the boot-from-volume extension. + ImageName string + + // FlavorRef [optional; required if FlavorName is not provided] is the ID or + // full URL to the flavor that describes the server's specs. FlavorRef string + // FlavorName [optional; required if FlavorRef is not provided] is the name of + // the flavor that describes the server's specs. + FlavorName string + // SecurityGroups [optional] lists the names of the security groups to which this server should belong. SecurityGroups []string @@ -124,9 +167,9 @@ type CreateOpts struct { // Metadata [optional] contains key-value pairs (up to 255 bytes each) to attach to the server. Metadata map[string]string - // Personality [optional] includes the path and contents of a file to inject into the server at launch. - // The maximum size of the file is 255 bytes (decoded). - Personality []byte + // Personality [optional] includes files to inject into the server at launch. + // Create will base64-encode file contents for you. + Personality Personality // ConfigDrive [optional] enables metadata injection through a configuration drive. ConfigDrive bool @@ -148,16 +191,14 @@ func (opts CreateOpts) ToServerCreateMap() (map[string]interface{}, error) { server["name"] = opts.Name server["imageRef"] = opts.ImageRef + server["imageName"] = opts.ImageName server["flavorRef"] = opts.FlavorRef + server["flavorName"] = opts.FlavorName if opts.UserData != nil { encoded := base64.StdEncoding.EncodeToString(opts.UserData) server["user_data"] = &encoded } - if opts.Personality != nil { - encoded := base64.StdEncoding.EncodeToString(opts.Personality) - server["personality"] = &encoded - } if opts.ConfigDrive { server["config_drive"] = "true" } @@ -202,6 +243,10 @@ func (opts CreateOpts) ToServerCreateMap() (map[string]interface{}, error) { server["networks"] = networks } + if len(opts.Personality) > 0 { + server["personality"] = opts.Personality + } + return map[string]interface{}{"server": server}, nil } @@ -215,6 +260,38 @@ func Create(client *gophercloud.ServiceClient, opts CreateOptsBuilder) CreateRes return res } + // If ImageRef isn't provided, use ImageName to ascertain the image ID. + if reqBody["server"].(map[string]interface{})["imageRef"].(string) == "" { + imageName := reqBody["server"].(map[string]interface{})["imageName"].(string) + if imageName == "" { + res.Err = errors.New("One and only one of ImageRef and ImageName must be provided.") + return res + } + imageID, err := images.IDFromName(client, imageName) + if err != nil { + res.Err = err + return res + } + reqBody["server"].(map[string]interface{})["imageRef"] = imageID + } + delete(reqBody["server"].(map[string]interface{}), "imageName") + + // If FlavorRef isn't provided, use FlavorName to ascertain the flavor ID. + if reqBody["server"].(map[string]interface{})["flavorRef"].(string) == "" { + flavorName := reqBody["server"].(map[string]interface{})["flavorName"].(string) + if flavorName == "" { + res.Err = errors.New("One and only one of FlavorRef and FlavorName must be provided.") + return res + } + flavorID, err := flavors.IDFromName(client, flavorName) + if err != nil { + res.Err = err + return res + } + reqBody["server"].(map[string]interface{})["flavorRef"] = flavorID + } + delete(reqBody["server"].(map[string]interface{}), "flavorName") + _, res.Err = client.Post(listURL(client), reqBody, &res.Body, nil) return res } @@ -391,9 +468,9 @@ type RebuildOpts struct { // Metadata [optional] contains key-value pairs (up to 255 bytes each) to attach to the server. Metadata map[string]string - // Personality [optional] includes the path and contents of a file to inject into the server at launch. - // The maximum size of the file is 255 bytes (decoded). - Personality []byte + // Personality [optional] includes files to inject into the server at launch. + // Rebuild will base64-encode file contents for you. + Personality Personality } // ToServerRebuildMap formats a RebuildOpts struct into a map for use in JSON @@ -429,9 +506,8 @@ func (opts RebuildOpts) ToServerRebuildMap() (map[string]interface{}, error) { server["metadata"] = opts.Metadata } - if opts.Personality != nil { - encoded := base64.StdEncoding.EncodeToString(opts.Personality) - server["personality"] = &encoded + if len(opts.Personality) > 0 { + server["personality"] = opts.Personality } return map[string]interface{}{"rebuild": server}, nil @@ -678,9 +754,7 @@ func Metadatum(client *gophercloud.ServiceClient, id, key string) GetMetadatumRe // DeleteMetadatum will delete the key-value pair with the given key for the given server ID. func DeleteMetadatum(client *gophercloud.ServiceClient, id, key string) DeleteMetadatumResult { var res DeleteMetadatumResult - _, res.Err = client.Delete(metadatumURL(client, id, key), &gophercloud.RequestOpts{ - JSONResponse: &res.Body, - }) + _, res.Err = client.Delete(metadatumURL(client, id, key), nil) return res } @@ -741,5 +815,38 @@ func CreateImage(client *gophercloud.ServiceClient, serverId string, opts Create }) res.Err = err res.Header = response.Header - return res + return res +} + +// IDFromName is a convienience function that returns a server's ID given its name. +func IDFromName(client *gophercloud.ServiceClient, name string) (string, error) { + serverCount := 0 + serverID := "" + if name == "" { + return "", fmt.Errorf("A server name must be provided.") + } + pager := List(client, nil) + pager.EachPage(func(page pagination.Page) (bool, error) { + serverList, err := ExtractServers(page) + if err != nil { + return false, err + } + + for _, s := range serverList { + if s.Name == name { + serverCount++ + serverID = s.ID + } + } + return true, nil + }) + + switch serverCount { + case 0: + return "", fmt.Errorf("Unable to find server: %s", name) + case 1: + return serverID, nil + default: + return "", fmt.Errorf("Found %d servers matching %s", serverCount, name) + } } diff --git a/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/compute/v2/servers/requests_test.go b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/compute/v2/servers/requests_test.go index 1f39fe143bd0..88cb54dd7bd0 100644 --- a/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/compute/v2/servers/requests_test.go +++ b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/compute/v2/servers/requests_test.go @@ -1,6 +1,8 @@ package servers import ( + "encoding/base64" + "encoding/json" "net/http" "testing" @@ -334,3 +336,38 @@ func TestCreateServerImage(t *testing.T) { _, err := CreateImage(client.ServiceClient(), "serverimage", CreateImageOpts{Name: "test"}).ExtractImageID() th.AssertNoErr(t, err) } + +func TestMarshalPersonality(t *testing.T) { + name := "/etc/test" + contents := []byte("asdfasdf") + + personality := Personality{ + &File{ + Path: name, + Contents: contents, + }, + } + + data, err := json.Marshal(personality) + if err != nil { + t.Fatal(err) + } + + var actual []map[string]string + err = json.Unmarshal(data, &actual) + if err != nil { + t.Fatal(err) + } + + if len(actual) != 1 { + t.Fatal("expected personality length 1") + } + + if actual[0]["path"] != name { + t.Fatal("file path incorrect") + } + + if actual[0]["contents"] != base64.StdEncoding.EncodeToString(contents) { + t.Fatal("file contents incorrect") + } +} diff --git a/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/identity/v2/tokens/errors.go b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/identity/v2/tokens/errors.go index 3a9172e0cc79..3dfdc08dbedd 100644 --- a/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/identity/v2/tokens/errors.go +++ b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/identity/v2/tokens/errors.go @@ -18,7 +18,7 @@ var ( // ErrDomainNameProvided is returned if you attempt to authenticate with a DomainName. ErrDomainNameProvided = unacceptedAttributeErr("DomainName") - // ErrUsernameRequired is returned if you attempt ot authenticate without a Username. + // ErrUsernameRequired is returned if you attempt to authenticate without a Username. ErrUsernameRequired = errors.New("You must supply a Username in your AuthOptions.") // ErrPasswordRequired is returned if you don't provide a password. diff --git a/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/identity/v2/tokens/requests.go b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/identity/v2/tokens/requests.go index efa054fb3994..074a89e69c32 100644 --- a/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/identity/v2/tokens/requests.go +++ b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/identity/v2/tokens/requests.go @@ -1,6 +1,10 @@ package tokens -import "github.com/rackspace/gophercloud" +import ( + "fmt" + + "github.com/rackspace/gophercloud" +) // AuthOptionsBuilder describes any argument that may be passed to the Create call. type AuthOptionsBuilder interface { @@ -38,20 +42,24 @@ func (auth AuthOptions) ToTokenCreateMap() (map[string]interface{}, error) { return nil, ErrDomainNameProvided } - // Username and Password are always required. - if auth.Username == "" { - return nil, ErrUsernameRequired - } - if auth.Password == "" { - return nil, ErrPasswordRequired - } - // Populate the request map. authMap := make(map[string]interface{}) - authMap["passwordCredentials"] = map[string]interface{}{ - "username": auth.Username, - "password": auth.Password, + if auth.Username != "" { + if auth.Password != "" { + authMap["passwordCredentials"] = map[string]interface{}{ + "username": auth.Username, + "password": auth.Password, + } + } else { + return nil, ErrPasswordRequired + } + } else if auth.TokenID != "" { + authMap["token"] = map[string]interface{}{ + "id": auth.TokenID, + } + } else { + return nil, fmt.Errorf("You must provide either username/password or tenantID/token values.") } if auth.TenantID != "" { diff --git a/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/identity/v2/tokens/requests_test.go b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/identity/v2/tokens/requests_test.go index 2f02825a47aa..8b78c855048a 100644 --- a/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/identity/v2/tokens/requests_test.go +++ b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/identity/v2/tokens/requests_test.go @@ -1,6 +1,7 @@ package tokens import ( + "fmt" "testing" "github.com/rackspace/gophercloud" @@ -22,7 +23,7 @@ func tokenPostErr(t *testing.T, options gophercloud.AuthOptions, expectedErr err HandleTokenPost(t, "") actualErr := Create(client.ServiceClient(), AuthOptions{options}).Err - th.CheckEquals(t, expectedErr, actualErr) + th.CheckDeepEquals(t, expectedErr, actualErr) } func TestCreateWithPassword(t *testing.T) { @@ -128,7 +129,7 @@ func TestRequireUsername(t *testing.T) { Password: "thing", } - tokenPostErr(t, options, ErrUsernameRequired) + tokenPostErr(t, options, fmt.Errorf("You must provide either username/password or tenantID/token values.")) } func TestRequirePassword(t *testing.T) { diff --git a/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/identity/v3/roles/doc.go b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/identity/v3/roles/doc.go new file mode 100644 index 000000000000..bdbc674d659b --- /dev/null +++ b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/identity/v3/roles/doc.go @@ -0,0 +1,3 @@ +// Package roles provides information and interaction with the roles API +// resource for the OpenStack Identity service. +package roles diff --git a/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/identity/v3/roles/requests.go b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/identity/v3/roles/requests.go new file mode 100644 index 000000000000..d95c1e52f6f8 --- /dev/null +++ b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/identity/v3/roles/requests.go @@ -0,0 +1,50 @@ +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/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/identity/v3/roles/requests_test.go b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/identity/v3/roles/requests_test.go new file mode 100644 index 000000000000..d62dbff9a2f7 --- /dev/null +++ b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/identity/v3/roles/requests_test.go @@ -0,0 +1,104 @@ +package roles + +import ( + "fmt" + "net/http" + "reflect" + "testing" + + "github.com/rackspace/gophercloud/pagination" + "github.com/rackspace/gophercloud/testhelper" + "github.com/rackspace/gophercloud/testhelper/client" +) + +func TestListSinglePage(t *testing.T) { + testhelper.SetupHTTP() + defer testhelper.TeardownHTTP() + + testhelper.Mux.HandleFunc("/role_assignments", func(w http.ResponseWriter, r *http.Request) { + testhelper.TestMethod(t, r, "GET") + testhelper.TestHeader(t, r, "X-Auth-Token", client.TokenID) + + w.Header().Add("Content-Type", "application/json") + fmt.Fprintf(w, ` + { + "role_assignments": [ + { + "links": { + "assignment": "http://identity:35357/v3/domains/161718/users/313233/roles/123456" + }, + "role": { + "id": "123456" + }, + "scope": { + "domain": { + "id": "161718" + } + }, + "user": { + "id": "313233" + } + }, + { + "links": { + "assignment": "http://identity:35357/v3/projects/456789/groups/101112/roles/123456", + "membership": "http://identity:35357/v3/groups/101112/users/313233" + }, + "role": { + "id": "123456" + }, + "scope": { + "project": { + "id": "456789" + } + }, + "user": { + "id": "313233" + } + } + ], + "links": { + "self": "http://identity:35357/v3/role_assignments?effective", + "previous": null, + "next": null + } + } + `) + }) + + count := 0 + err := ListAssignments(client.ServiceClient(), ListAssignmentsOpts{}).EachPage(func(page pagination.Page) (bool, error) { + count++ + actual, err := ExtractRoleAssignments(page) + if err != nil { + return false, err + } + + expected := []RoleAssignment{ + RoleAssignment{ + Role: Role{ID: "123456"}, + Scope: Scope{Domain: Domain{ID: "161718"}}, + User: User{ID: "313233"}, + Group: Group{}, + }, + RoleAssignment{ + Role: Role{ID: "123456"}, + Scope: Scope{Project: Project{ID: "456789"}}, + User: User{ID: "313233"}, + Group: Group{}, + }, + } + + if !reflect.DeepEqual(expected, actual) { + t.Errorf("Expected %#v, got %#v", expected, actual) + } + + return true, nil + }) + if err != nil { + t.Errorf("Unexpected error while paging: %v", err) + } + if count != 1 { + t.Errorf("Expected 1 page, got %d", count) + } +} diff --git a/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/identity/v3/roles/results.go b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/identity/v3/roles/results.go new file mode 100644 index 000000000000..d25abd25d773 --- /dev/null +++ b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/identity/v3/roles/results.go @@ -0,0 +1,81 @@ +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/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/identity/v3/roles/urls.go b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/identity/v3/roles/urls.go new file mode 100644 index 000000000000..b009340d0963 --- /dev/null +++ b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/identity/v3/roles/urls.go @@ -0,0 +1,7 @@ +package roles + +import "github.com/rackspace/gophercloud" + +func listAssignmentsURL(client *gophercloud.ServiceClient) string { + return client.ServiceURL("role_assignments") +} diff --git a/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/identity/v3/roles/urls_test.go b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/identity/v3/roles/urls_test.go new file mode 100644 index 000000000000..04679dae4031 --- /dev/null +++ b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/identity/v3/roles/urls_test.go @@ -0,0 +1,15 @@ +package roles + +import ( + "testing" + + "github.com/rackspace/gophercloud" +) + +func TestListAssignmentsURL(t *testing.T) { + client := gophercloud.ServiceClient{Endpoint: "http://localhost:5000/v3/"} + url := listAssignmentsURL(&client) + if url != "http://localhost:5000/v3/role_assignments" { + t.Errorf("Unexpected list URL generated: [%s]", url) + } +} diff --git a/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/networking/v2/extensions/fwaas/firewalls/requests_test.go b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/networking/v2/extensions/fwaas/firewalls/requests_test.go index f24e2835ea9c..19d32c5ac306 100644 --- a/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/networking/v2/extensions/fwaas/firewalls/requests_test.go +++ b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/networking/v2/extensions/fwaas/firewalls/requests_test.go @@ -212,9 +212,9 @@ func TestUpdate(t *testing.T) { "name": "fw", "admin_state_up": false, "tenant_id": "b4eedccc6fb74fa8a7ad6b08382b852b", - "firewall_policy_id": "19ab8c87-4a32-4e6a-a74e-b77fffb89a0c" + "firewall_policy_id": "19ab8c87-4a32-4e6a-a74e-b77fffb89a0c", "id": "ea5b5315-64f6-4ea3-8e58-981cc37c6576", - "description": "OpenStack firewall", + "description": "OpenStack firewall" } } `) diff --git a/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/networking/v2/extensions/lbaas/pools/requests_test.go b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/networking/v2/extensions/lbaas/pools/requests_test.go index 6da29a6b8e64..3b5c7c7105bb 100644 --- a/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/networking/v2/extensions/lbaas/pools/requests_test.go +++ b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/networking/v2/extensions/lbaas/pools/requests_test.go @@ -296,6 +296,7 @@ func TestAssociateHealthMonitor(t *testing.T) { w.Header().Add("Content-Type", "application/json") w.WriteHeader(http.StatusCreated) + fmt.Fprintf(w, `{}`) }) _, err := AssociateMonitor(fake.ServiceClient(), "332abe93-f488-41ba-870b-2ac66be7f853", "b624decf-d5d3-4c66-9a3d-f047e7786181").Extract() diff --git a/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/networking/v2/extensions/security/groups/requests.go b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/networking/v2/extensions/security/groups/requests.go index 55e4b3b8043c..2712ac1621f9 100644 --- a/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/networking/v2/extensions/security/groups/requests.go +++ b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/networking/v2/extensions/security/groups/requests.go @@ -45,6 +45,9 @@ 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 } @@ -62,6 +65,7 @@ func Create(c *gophercloud.ServiceClient, opts CreateOpts) CreateResult { type secgroup struct { Name string `json:"name"` + TenantID string `json:"tenant_id,omitempty"` Description string `json:"description,omitempty"` } @@ -71,6 +75,7 @@ func Create(c *gophercloud.ServiceClient, opts CreateOpts) CreateResult { reqBody := request{SecGroup: secgroup{ Name: opts.Name, + TenantID: opts.TenantID, Description: opts.Description, }} @@ -91,3 +96,36 @@ func Delete(c *gophercloud.ServiceClient, id string) 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/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/networking/v2/extensions/security/rules/requests.go b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/networking/v2/extensions/security/rules/requests.go index 0b2d10b0efeb..a80ceb309995 100644 --- a/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/networking/v2/extensions/security/rules/requests.go +++ b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/networking/v2/extensions/security/rules/requests.go @@ -99,6 +99,9 @@ type CreateOpts struct { // 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 provisions a new security group with default @@ -133,6 +136,7 @@ func Create(c *gophercloud.ServiceClient, opts CreateOpts) CreateResult { 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 { @@ -148,6 +152,7 @@ func Create(c *gophercloud.ServiceClient, opts CreateOpts) CreateResult { Protocol: opts.Protocol, RemoteGroupID: opts.RemoteGroupID, RemoteIPPrefix: opts.RemoteIPPrefix, + TenantID: opts.TenantID, }} _, res.Err = c.Post(rootURL(c), reqBody, &res.Body, nil) diff --git a/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/networking/v2/networks/requests.go b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/networking/v2/networks/requests.go index 7be322740068..25ab7a8b6457 100644 --- a/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/networking/v2/networks/requests.go +++ b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/networking/v2/networks/requests.go @@ -1,6 +1,8 @@ package networks import ( + "fmt" + "github.com/rackspace/gophercloud" "github.com/rackspace/gophercloud/pagination" ) @@ -189,3 +191,36 @@ func Delete(c *gophercloud.ServiceClient, networkID string) 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/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/networking/v2/networks/requests_test.go b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/networking/v2/networks/requests_test.go index a263b7b16b2c..81eb79cb5416 100644 --- a/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/networking/v2/networks/requests_test.go +++ b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/networking/v2/networks/requests_test.go @@ -204,6 +204,7 @@ func TestCreateWithOptionalFields(t *testing.T) { `) w.WriteHeader(http.StatusCreated) + fmt.Fprintf(w, `{}`) }) iTrue := true diff --git a/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/networking/v2/ports/requests.go b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/networking/v2/ports/requests.go index 781a3c3e745a..2caf1cace44b 100644 --- a/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/networking/v2/ports/requests.go +++ b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/networking/v2/ports/requests.go @@ -1,6 +1,8 @@ package ports import ( + "fmt" + "github.com/rackspace/gophercloud" "github.com/rackspace/gophercloud/pagination" ) @@ -223,3 +225,36 @@ func Delete(c *gophercloud.ServiceClient, id string) 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/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/networking/v2/subnets/requests.go b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/networking/v2/subnets/requests.go index 6e01f059d754..6cde048ed04c 100644 --- a/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/networking/v2/subnets/requests.go +++ b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/networking/v2/subnets/requests.go @@ -1,6 +1,8 @@ package subnets import ( + "fmt" + "github.com/rackspace/gophercloud" "github.com/rackspace/gophercloud/pagination" ) @@ -200,10 +202,10 @@ func (opts UpdateOpts) ToSubnetUpdateMap() (map[string]interface{}, error) { if opts.GatewayIP != "" { s["gateway_ip"] = opts.GatewayIP } - if len(opts.DNSNameservers) != 0 { + if opts.DNSNameservers != nil { s["dns_nameservers"] = opts.DNSNameservers } - if len(opts.HostRoutes) != 0 { + if opts.HostRoutes != nil { s["host_routes"] = opts.HostRoutes } @@ -234,3 +236,36 @@ func Delete(c *gophercloud.ServiceClient, id string) 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/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/networking/v2/subnets/results.go b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/networking/v2/subnets/results.go index 1910f17dd96f..77b956a17eff 100644 --- a/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/networking/v2/subnets/results.go +++ b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/networking/v2/subnets/results.go @@ -55,8 +55,8 @@ type AllocationPool struct { // 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 `json:"destination"` - NextHop string `json:"nexthop"` + DestinationCIDR string `mapstructure:"destination" json:"destination"` + NextHop string `mapstructure:"nexthop" json:"nexthop"` } // Subnet represents a subnet. See package documentation for a top-level diff --git a/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/networking/v2/subnets/results_test.go b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/networking/v2/subnets/results_test.go new file mode 100644 index 000000000000..d4048388cdbc --- /dev/null +++ b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/networking/v2/subnets/results_test.go @@ -0,0 +1,54 @@ +package subnets + +import ( + "encoding/json" + "github.com/rackspace/gophercloud" + th "github.com/rackspace/gophercloud/testhelper" + "testing" +) + +func TestHostRoute(t *testing.T) { + sejson := []byte(` + {"subnet": { + "name": "test-subnet", + "enable_dhcp": false, + "network_id": "3e66c41e-cbbd-4019-9aab-740b7e4150a0", + "tenant_id": "f86e123198cf42d19c8854c5f80c2f06", + "dns_nameservers": [], + "gateway_ip": "172.16.0.1", + "ipv6_ra_mode": null, + "allocation_pools": [ + { + "start": "172.16.0.2", + "end": "172.16.255.254" + } + ], + "host_routes": [ + { + "destination": "172.20.1.0/24", + "nexthop": "172.16.0.2" + } + ], + "ip_version": 4, + "ipv6_address_mode": null, + "cidr": "172.16.0.0/16", + "id": "6dcaa873-7115-41af-9ef5-915f73636e43", + "subnetpool_id": null + }} +`) + + var dejson interface{} + err := json.Unmarshal(sejson, &dejson) + if err != nil { + t.Fatalf("%s", err) + } + + resp := commonResult{gophercloud.Result{Body: dejson}} + subnet, err := resp.Extract() + if err != nil { + t.Fatalf("%s", err) + } + route := subnet.HostRoutes[0] + th.AssertEquals(t, route.NextHop, "172.16.0.2") + th.AssertEquals(t, route.DestinationCIDR, "172.20.1.0/24") +} diff --git a/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/objectstorage/v1/accounts/requests.go b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/objectstorage/v1/accounts/requests.go index a6451157050f..66c46a9787bb 100644 --- a/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/objectstorage/v1/accounts/requests.go +++ b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/objectstorage/v1/accounts/requests.go @@ -43,7 +43,9 @@ func Get(c *gophercloud.ServiceClient, opts GetOptsBuilder) GetResult { MoreHeaders: h, OkCodes: []int{204}, }) - res.Header = resp.Header + if resp != nil { + res.Header = resp.Header + } res.Err = err return res } @@ -97,7 +99,9 @@ func Update(c *gophercloud.ServiceClient, opts UpdateOptsBuilder) UpdateResult { MoreHeaders: h, OkCodes: []int{201, 202, 204}, }) - res.Header = resp.Header + if resp != nil { + res.Header = resp.Header + } res.Err = err return res } diff --git a/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/objectstorage/v1/containers/requests.go b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/objectstorage/v1/containers/requests.go index bbf8cdb952cc..50ff9f48f3b3 100644 --- a/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/objectstorage/v1/containers/requests.go +++ b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/objectstorage/v1/containers/requests.go @@ -114,7 +114,9 @@ func Create(c *gophercloud.ServiceClient, containerName string, opts CreateOptsB MoreHeaders: h, OkCodes: []int{201, 202, 204}, }) - res.Header = resp.Header + if resp != nil { + res.Header = resp.Header + } res.Err = err return res } @@ -180,7 +182,9 @@ func Update(c *gophercloud.ServiceClient, containerName string, opts UpdateOptsB MoreHeaders: h, OkCodes: []int{201, 202, 204}, }) - res.Header = resp.Header + if resp != nil { + res.Header = resp.Header + } res.Err = err return res } @@ -193,7 +197,9 @@ func Get(c *gophercloud.ServiceClient, containerName string) GetResult { resp, err := c.Request("HEAD", getURL(c, containerName), gophercloud.RequestOpts{ OkCodes: []int{200, 204}, }) - res.Header = resp.Header + if resp != nil { + res.Header = resp.Header + } res.Err = err return res } diff --git a/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/objectstorage/v1/objects/fixtures.go b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/objectstorage/v1/objects/fixtures.go index ec616371a3c5..7a6e6e1ee776 100644 --- a/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/objectstorage/v1/objects/fixtures.go +++ b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/objectstorage/v1/objects/fixtures.go @@ -3,7 +3,9 @@ package objects import ( + "crypto/md5" "fmt" + "io" "net/http" "testing" @@ -107,12 +109,18 @@ func HandleListObjectNamesSuccessfully(t *testing.T) { // 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) { +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) }) } @@ -120,7 +128,7 @@ func HandleCreateTextObjectSuccessfully(t *testing.T) { // 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) { +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) @@ -130,6 +138,11 @@ func HandleCreateTypelessObjectSuccessfully(t *testing.T) { 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) }) } diff --git a/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/objectstorage/v1/objects/requests.go b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/objectstorage/v1/objects/requests.go index 7eedde25509f..c2fbaae27235 100644 --- a/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/objectstorage/v1/objects/requests.go +++ b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/objectstorage/v1/objects/requests.go @@ -1,7 +1,9 @@ package objects import ( + "bytes" "crypto/hmac" + "crypto/md5" "crypto/sha1" "fmt" "io" @@ -134,10 +136,11 @@ func Download(c *gophercloud.ServiceClient, containerName, objectName string, op MoreHeaders: h, OkCodes: []int{200, 304}, }) - - res.Body = resp.Body + if resp != nil { + res.Header = resp.Header + res.Body = resp.Body + } res.Err = err - res.Header = resp.Header return res } @@ -187,8 +190,9 @@ func (opts CreateOpts) ToObjectCreateParams() (map[string]string, string, error) return h, q.String(), nil } -// Create is a function that creates a new object or replaces an existing object. -func Create(c *gophercloud.ServiceClient, containerName, objectName string, content io.Reader, opts CreateOptsBuilder) CreateResult { +// 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) @@ -208,14 +212,37 @@ func Create(c *gophercloud.ServiceClient, containerName, objectName string, cont url += query } + hash := md5.New() + + contentBuffer := bytes.NewBuffer([]byte{}) + _, err := io.Copy(contentBuffer, io.TeeReader(content, hash)) + if err != nil { + res.Err = err + return res + } + + localChecksum := hash.Sum(nil) + h["ETag"] = fmt.Sprintf("%x", localChecksum) + ropts := gophercloud.RequestOpts{ - RawBody: content, + RawBody: strings.NewReader(contentBuffer.String()), MoreHeaders: h, } resp, err := c.Request("PUT", url, ropts) - res.Header = resp.Header - res.Err = err + 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 } @@ -270,7 +297,9 @@ func Copy(c *gophercloud.ServiceClient, containerName, objectName string, opts C MoreHeaders: h, OkCodes: []int{201}, }) - res.Header = resp.Header + if resp != nil { + res.Header = resp.Header + } res.Err = err return res } @@ -310,7 +339,9 @@ func Delete(c *gophercloud.ServiceClient, containerName, objectName string, opts } resp, err := c.Delete(url, nil) - res.Header = resp.Header + if resp != nil { + res.Header = resp.Header + } res.Err = err return res } @@ -354,7 +385,9 @@ func Get(c *gophercloud.ServiceClient, containerName, objectName string, opts Ge resp, err := c.Request("HEAD", url, gophercloud.RequestOpts{ OkCodes: []int{200, 204}, }) - res.Header = resp.Header + if resp != nil { + res.Header = resp.Header + } res.Err = err return res } @@ -410,7 +443,9 @@ func Update(c *gophercloud.ServiceClient, containerName, objectName string, opts resp, err := c.Request("POST", url, gophercloud.RequestOpts{ MoreHeaders: h, }) - res.Header = resp.Header + if resp != nil { + res.Header = resp.Header + } res.Err = err return res } diff --git a/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/objectstorage/v1/objects/requests_test.go b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/objectstorage/v1/objects/requests_test.go index 6be3534205ff..f7d6822913ef 100644 --- a/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/objectstorage/v1/objects/requests_test.go +++ b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/objectstorage/v1/objects/requests_test.go @@ -2,7 +2,10 @@ package objects import ( "bytes" + "fmt" "io" + "net/http" + "strings" "testing" "github.com/rackspace/gophercloud/pagination" @@ -83,24 +86,44 @@ func TestListObjectNames(t *testing.T) { func TestCreateObject(t *testing.T) { th.SetupHTTP() defer th.TeardownHTTP() - HandleCreateTextObjectSuccessfully(t) - content := bytes.NewBufferString("Did gyre and gimble in the wabe") + content := "Did gyre and gimble in the wabe" + + HandleCreateTextObjectSuccessfully(t, content) + options := &CreateOpts{ContentType: "text/plain"} - res := Create(fake.ServiceClient(), "testContainer", "testObject", content, options) + res := Create(fake.ServiceClient(), "testContainer", "testObject", strings.NewReader(content), options) th.AssertNoErr(t, res.Err) } func TestCreateObjectWithoutContentType(t *testing.T) { th.SetupHTTP() defer th.TeardownHTTP() - HandleCreateTypelessObjectSuccessfully(t) - content := bytes.NewBufferString("The sky was the color of television, tuned to a dead channel.") - res := Create(fake.ServiceClient(), "testContainer", "testObject", content, &CreateOpts{}) + content := "The sky was the color of television, tuned to a dead channel." + + HandleCreateTypelessObjectSuccessfully(t, content) + + res := Create(fake.ServiceClient(), "testContainer", "testObject", strings.NewReader(content), &CreateOpts{}) th.AssertNoErr(t, res.Err) } +func TestErrorIsRaisedForChecksumMismatch(t *testing.T) { + th.SetupHTTP() + defer th.TeardownHTTP() + + th.Mux.HandleFunc("/testContainer/testObject", func(w http.ResponseWriter, r *http.Request) { + w.Header().Set("ETag", "acbd18db4cc2f85cedef654fccc4a4d8") + w.WriteHeader(http.StatusCreated) + }) + + content := strings.NewReader("The sky was the color of television, tuned to a dead channel.") + res := Create(fake.ServiceClient(), "testContainer", "testObject", content, &CreateOpts{}) + + err := fmt.Errorf("Local checksum does not match API ETag header") + th.AssertDeepEquals(t, err, res.Err) +} + func TestCopyObject(t *testing.T) { th.SetupHTTP() defer th.TeardownHTTP() diff --git a/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/orchestration/v1/stackevents/fixtures.go b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/orchestration/v1/stackevents/fixtures.go index 016ae003b32f..235787a51457 100644 --- a/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/orchestration/v1/stackevents/fixtures.go +++ b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/orchestration/v1/stackevents/fixtures.go @@ -67,7 +67,7 @@ const FindOutput = ` "events": [ { "resource_name": "hello_world", - "event_time": "2015-02-05T21:33:11Z", + "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", @@ -90,7 +90,7 @@ const FindOutput = ` }, { "resource_name": "hello_world", - "event_time": "2015-02-05T21:33:27Z", + "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", @@ -184,7 +184,7 @@ const ListOutput = ` "events": [ { "resource_name": "hello_world", - "event_time": "2015-02-05T21:33:11Z", + "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", @@ -207,7 +207,7 @@ const ListOutput = ` }, { "resource_name": "hello_world", - "event_time": "2015-02-05T21:33:27Z", + "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", @@ -309,7 +309,7 @@ const ListResourceEventsOutput = ` "events": [ { "resource_name": "hello_world", - "event_time": "2015-02-05T21:33:11Z", + "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", @@ -332,7 +332,7 @@ const ListResourceEventsOutput = ` }, { "resource_name": "hello_world", - "event_time": "2015-02-05T21:33:27Z", + "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", @@ -408,7 +408,7 @@ const GetOutput = ` { "event":{ "resource_name": "hello_world", - "event_time": "2015-02-05T21:33:27Z", + "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", diff --git a/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/orchestration/v1/stackevents/results.go b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/orchestration/v1/stackevents/results.go index 3c8f1da49106..cf9e240982df 100644 --- a/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/orchestration/v1/stackevents/results.go +++ b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/orchestration/v1/stackevents/results.go @@ -57,7 +57,7 @@ func (r FindResult) Extract() ([]Event, error) { for i, eventRaw := range events { event := eventRaw.(map[string]interface{}) if date, ok := event["event_time"]; ok && date != nil { - t, err := time.Parse(time.RFC3339, date.(string)) + t, err := time.Parse(gophercloud.STACK_TIME_FMT, date.(string)) if err != nil { return nil, err } @@ -121,7 +121,7 @@ func ExtractEvents(page pagination.Page) ([]Event, error) { for i, eventRaw := range events { event := eventRaw.(map[string]interface{}) if date, ok := event["event_time"]; ok && date != nil { - t, err := time.Parse(time.RFC3339, date.(string)) + t, err := time.Parse(gophercloud.STACK_TIME_FMT, date.(string)) if err != nil { return nil, err } @@ -161,7 +161,7 @@ func (r GetResult) Extract() (*Event, error) { event := r.Body.(map[string]interface{})["event"].(map[string]interface{}) if date, ok := event["event_time"]; ok && date != nil { - t, err := time.Parse(time.RFC3339, date.(string)) + t, err := time.Parse(gophercloud.STACK_TIME_FMT, date.(string)) if err != nil { return nil, err } diff --git a/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/orchestration/v1/stackresources/fixtures.go b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/orchestration/v1/stackresources/fixtures.go index 0b930f4841a2..c3c3d3fbc962 100644 --- a/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/orchestration/v1/stackresources/fixtures.go +++ b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/orchestration/v1/stackresources/fixtures.go @@ -53,7 +53,7 @@ const FindOutput = ` ], "logical_resource_id": "hello_world", "resource_status_reason": "state changed", - "updated_time": "2015-02-05T21:33:11Z", + "updated_time": "2015-02-05T21:33:11", "required_by": [], "resource_status": "CREATE_IN_PROGRESS", "physical_resource_id": "49181cd6-169a-4130-9455-31185bbfc5bf", @@ -117,7 +117,7 @@ const ListOutput = `{ ], "logical_resource_id": "hello_world", "resource_status_reason": "state changed", - "updated_time": "2015-02-05T21:33:11Z", + "updated_time": "2015-02-05T21:33:11", "required_by": [], "resource_status": "CREATE_IN_PROGRESS", "physical_resource_id": "49181cd6-169a-4130-9455-31185bbfc5bf", @@ -188,7 +188,7 @@ const GetOutput = ` ], "logical_resource_id": "wordpress_instance", "resource_status": "CREATE_COMPLETE", - "updated_time": "2014-12-10T18:34:35Z", + "updated_time": "2014-12-10T18:34:35", "required_by": [], "resource_status_reason": "state changed", "physical_resource_id": "00e3a2fe-c65d-403c-9483-4db9930dd194", diff --git a/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/orchestration/v1/stackresources/requests.go b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/orchestration/v1/stackresources/requests.go index ee9c3c250cc1..fcb8d8a2f82e 100644 --- a/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/orchestration/v1/stackresources/requests.go +++ b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/orchestration/v1/stackresources/requests.go @@ -25,12 +25,6 @@ type ListOptsBuilder interface { // 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"` - // Include resources from nest stacks up to Depth levels of recursion. Depth int `q:"nested_depth"` } @@ -57,9 +51,7 @@ func List(client *gophercloud.ServiceClient, stackName, stackID string, opts Lis } createPageFn := func(r pagination.PageResult) pagination.Page { - p := ResourcePage{pagination.MarkerPageBase{PageResult: r}} - p.MarkerPageBase.Owner = p - return p + return ResourcePage{pagination.SinglePageBase(r)} } return pagination.NewPager(client, url, createPageFn) diff --git a/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/orchestration/v1/stackresources/results.go b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/orchestration/v1/stackresources/results.go index 69f21daef39a..df79d582a968 100644 --- a/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/orchestration/v1/stackresources/results.go +++ b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/orchestration/v1/stackresources/results.go @@ -48,7 +48,7 @@ func (r FindResult) Extract() ([]Resource, error) { for i, resourceRaw := range resources { resource := resourceRaw.(map[string]interface{}) if date, ok := resource["updated_time"]; ok && date != nil { - t, err := time.Parse(time.RFC3339, date.(string)) + t, err := time.Parse(gophercloud.STACK_TIME_FMT, date.(string)) if err != nil { return nil, err } @@ -63,7 +63,7 @@ func (r FindResult) Extract() ([]Resource, error) { // 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.MarkerPageBase + pagination.SinglePageBase } // IsEmpty returns true if a page contains no Server results. @@ -109,7 +109,7 @@ func ExtractResources(page pagination.Page) ([]Resource, error) { for i, resourceRaw := range resources { resource := resourceRaw.(map[string]interface{}) if date, ok := resource["updated_time"]; ok && date != nil { - t, err := time.Parse(time.RFC3339, date.(string)) + t, err := time.Parse(gophercloud.STACK_TIME_FMT, date.(string)) if err != nil { return nil, err } @@ -143,7 +143,7 @@ func (r GetResult) Extract() (*Resource, error) { resource := r.Body.(map[string]interface{})["resource"].(map[string]interface{}) if date, ok := resource["updated_time"]; ok && date != nil { - t, err := time.Parse(time.RFC3339, date.(string)) + t, err := time.Parse(gophercloud.STACK_TIME_FMT, date.(string)) if err != nil { return nil, err } diff --git a/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/orchestration/v1/stacks/fixtures.go b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/orchestration/v1/stacks/fixtures.go index 6d3e9597a21b..3a621dab6c10 100644 --- a/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/orchestration/v1/stacks/fixtures.go +++ b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/orchestration/v1/stacks/fixtures.go @@ -95,7 +95,7 @@ const FullListOutput = ` ], "stack_status_reason": "Stack CREATE completed successfully", "stack_name": "postman_stack", - "creation_time": "2015-02-03T20:07:39Z", + "creation_time": "2015-02-03T20:07:39", "updated_time": null, "stack_status": "CREATE_COMPLETE", "id": "16ef0584-4458-41eb-87c8-0dc8d5f66c87" @@ -110,8 +110,8 @@ const FullListOutput = ` ], "stack_status_reason": "Stack successfully updated", "stack_name": "gophercloud-test-stack-2", - "creation_time": "2014-12-11T17:39:16Z", - "updated_time": "2014-12-11T17:40:37Z", + "creation_time": "2014-12-11T17:39:16", + "updated_time": "2014-12-11T17:40:37", "stack_status": "UPDATE_COMPLETE", "id": "db6977b2-27aa-4775-9ae7-6213212d4ada" } @@ -181,7 +181,7 @@ const GetOutput = ` "stack_status_reason": "Stack CREATE completed successfully", "stack_name": "postman_stack", "outputs": [], - "creation_time": "2015-02-03T20:07:39Z", + "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", diff --git a/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/orchestration/v1/stacks/results.go b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/orchestration/v1/stacks/results.go index 04d3f8ea964a..dca06e4e0d06 100644 --- a/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/orchestration/v1/stacks/results.go +++ b/Godeps/_workspace/src/github.com/rackspace/gophercloud/openstack/orchestration/v1/stacks/results.go @@ -100,7 +100,7 @@ func ExtractStacks(page pagination.Page) ([]ListedStack, error) { thisStack := (rawStacks[i]).(map[string]interface{}) if t, ok := thisStack["creation_time"].(string); ok && t != "" { - creationTime, err := time.Parse(time.RFC3339, t) + creationTime, err := time.Parse(gophercloud.STACK_TIME_FMT, t) if err != nil { return res.Stacks, err } @@ -108,7 +108,7 @@ func ExtractStacks(page pagination.Page) ([]ListedStack, error) { } if t, ok := thisStack["updated_time"].(string); ok && t != "" { - updatedTime, err := time.Parse(time.RFC3339, t) + updatedTime, err := time.Parse(gophercloud.STACK_TIME_FMT, t) if err != nil { return res.Stacks, err } @@ -170,7 +170,7 @@ func (r GetResult) Extract() (*RetrievedStack, error) { b := r.Body.(map[string]interface{})["stack"].(map[string]interface{}) if date, ok := b["creation_time"]; ok && date != nil { - t, err := time.Parse(time.RFC3339, date.(string)) + t, err := time.Parse(gophercloud.STACK_TIME_FMT, date.(string)) if err != nil { return nil, err } @@ -178,7 +178,7 @@ func (r GetResult) Extract() (*RetrievedStack, error) { } if date, ok := b["updated_time"]; ok && date != nil { - t, err := time.Parse(time.RFC3339, date.(string)) + t, err := time.Parse(gophercloud.STACK_TIME_FMT, date.(string)) if err != nil { return nil, err } @@ -249,7 +249,7 @@ func (r PreviewResult) Extract() (*PreviewedStack, error) { b := r.Body.(map[string]interface{})["stack"].(map[string]interface{}) if date, ok := b["creation_time"]; ok && date != nil { - t, err := time.Parse(time.RFC3339, date.(string)) + t, err := time.Parse(gophercloud.STACK_TIME_FMT, date.(string)) if err != nil { return nil, err } @@ -257,7 +257,7 @@ func (r PreviewResult) Extract() (*PreviewedStack, error) { } if date, ok := b["updated_time"]; ok && date != nil { - t, err := time.Parse(time.RFC3339, date.(string)) + t, err := time.Parse(gophercloud.STACK_TIME_FMT, date.(string)) if err != nil { return nil, err } diff --git a/Godeps/_workspace/src/github.com/rackspace/gophercloud/pagination/http.go b/Godeps/_workspace/src/github.com/rackspace/gophercloud/pagination/http.go index cabcccd79f39..1b3fe94ab9f2 100644 --- a/Godeps/_workspace/src/github.com/rackspace/gophercloud/pagination/http.go +++ b/Godeps/_workspace/src/github.com/rackspace/gophercloud/pagination/http.go @@ -36,13 +36,19 @@ func PageResultFrom(resp *http.Response) (PageResult, error) { parsedBody = rawBody } + return PageResultFromParsed(resp, parsedBody), err +} + +// PageResultFromParsed constructs a PageResult from an HTTP response that has already had its +// body parsed as JSON (and closed). +func PageResultFromParsed(resp *http.Response, body interface{}) PageResult { return PageResult{ Result: gophercloud.Result{ - Body: parsedBody, + Body: body, Header: resp.Header, }, URL: *resp.Request.URL, - }, err + } } // Request performs an HTTP request and extracts the http.Response from the result. diff --git a/Godeps/_workspace/src/github.com/rackspace/gophercloud/pagination/pager.go b/Godeps/_workspace/src/github.com/rackspace/gophercloud/pagination/pager.go index ea47c695dc3d..a7593ac883dd 100644 --- a/Godeps/_workspace/src/github.com/rackspace/gophercloud/pagination/pager.go +++ b/Godeps/_workspace/src/github.com/rackspace/gophercloud/pagination/pager.go @@ -174,8 +174,10 @@ func (p Pager) AllPages() (Page, error) { if err != nil { return nil, err } - // Remove the trailing comma. - pagesSlice = pagesSlice[:len(pagesSlice)-1] + if len(pagesSlice) > 0 { + // Remove the trailing comma. + pagesSlice = pagesSlice[:len(pagesSlice)-1] + } var b []byte // Combine the slice of slices in to a single slice. for _, slice := range pagesSlice { diff --git a/Godeps/_workspace/src/github.com/rackspace/gophercloud/provider_client.go b/Godeps/_workspace/src/github.com/rackspace/gophercloud/provider_client.go index 0dff2cfc3033..d920913e76c8 100644 --- a/Godeps/_workspace/src/github.com/rackspace/gophercloud/provider_client.go +++ b/Godeps/_workspace/src/github.com/rackspace/gophercloud/provider_client.go @@ -85,9 +85,9 @@ type RequestOpts struct { // content type of the request will default to "application/json" unless overridden by MoreHeaders. // It's an error to specify both a JSONBody and a RawBody. JSONBody interface{} - // RawBody contains an io.Reader that will be consumed by the request directly. No content-type + // RawBody contains an io.ReadSeeker that will be consumed by the request directly. No content-type // will be set unless one is provided explicitly by MoreHeaders. - RawBody io.Reader + RawBody io.ReadSeeker // JSONResponse, if provided, will be populated with the contents of the response body parsed as // JSON. @@ -124,11 +124,11 @@ var applicationJSON = "application/json" // Request performs an HTTP request using the ProviderClient's current HTTPClient. An authentication // header will automatically be provided. func (client *ProviderClient) Request(method, url string, options RequestOpts) (*http.Response, error) { - var body io.Reader + var body io.ReadSeeker var contentType *string // Derive the content body by either encoding an arbitrary object as JSON, or by taking a provided - // io.Reader as-is. Default the content-type to application/json. + // io.ReadSeeker as-is. Default the content-type to application/json. if options.JSONBody != nil { if options.RawBody != nil { panic("Please provide only one of JSONBody or RawBody to gophercloud.Request().") @@ -189,6 +189,9 @@ func (client *ProviderClient) Request(method, url string, options RequestOpts) ( if err != nil { return nil, fmt.Errorf("Error trying to re-authenticate: %s", err) } + if options.RawBody != nil { + options.RawBody.Seek(0, 0) + } resp, err = client.Request(method, url, options) if err != nil { return nil, fmt.Errorf("Successfully re-authenticated, but got error executing request: %s", err) @@ -224,7 +227,9 @@ func (client *ProviderClient) Request(method, url string, options RequestOpts) ( // Parse the response body as JSON, if requested to do so. if options.JSONResponse != nil { defer resp.Body.Close() - json.NewDecoder(resp.Body).Decode(options.JSONResponse) + if err := json.NewDecoder(resp.Body).Decode(options.JSONResponse); err != nil { + return nil, err + } } return resp, nil @@ -260,7 +265,7 @@ func (client *ProviderClient) Post(url string, JSONBody interface{}, JSONRespons opts = &RequestOpts{} } - if v, ok := (JSONBody).(io.Reader); ok { + if v, ok := (JSONBody).(io.ReadSeeker); ok { opts.RawBody = v } else if JSONBody != nil { opts.JSONBody = JSONBody @@ -278,7 +283,7 @@ func (client *ProviderClient) Put(url string, JSONBody interface{}, JSONResponse opts = &RequestOpts{} } - if v, ok := (JSONBody).(io.Reader); ok { + if v, ok := (JSONBody).(io.ReadSeeker); ok { opts.RawBody = v } else if JSONBody != nil { opts.JSONBody = JSONBody diff --git a/Godeps/_workspace/src/github.com/rackspace/gophercloud/rackspace/blockstorage/v1/volumes/delegate_test.go b/Godeps/_workspace/src/github.com/rackspace/gophercloud/rackspace/blockstorage/v1/volumes/delegate_test.go index b44564cc1f6e..b6831f211489 100644 --- a/Godeps/_workspace/src/github.com/rackspace/gophercloud/rackspace/blockstorage/v1/volumes/delegate_test.go +++ b/Godeps/_workspace/src/github.com/rackspace/gophercloud/rackspace/blockstorage/v1/volumes/delegate_test.go @@ -3,7 +3,8 @@ package volumes import ( "testing" - os "github.com/rackspace/gophercloud/openstack/blockstorage/v1/volumes" + "github.com/rackspace/gophercloud/openstack/blockstorage/v1/volumes" + os "github.com/rackspace/gophercloud/openstack/blockstorage/v1/volumes/testing" "github.com/rackspace/gophercloud/pagination" th "github.com/rackspace/gophercloud/testhelper" fake "github.com/rackspace/gophercloud/testhelper/client" @@ -64,7 +65,7 @@ func TestCreate(t *testing.T) { os.MockCreateResponse(t) - n, err := Create(fake.ServiceClient(), CreateOpts{os.CreateOpts{Size: 75}}).Extract() + n, err := Create(fake.ServiceClient(), CreateOpts{volumes.CreateOpts{Size: 75}}).Extract() th.AssertNoErr(t, err) th.AssertEquals(t, n.Size, 4) @@ -72,12 +73,12 @@ func TestCreate(t *testing.T) { } func TestSizeRange(t *testing.T) { - _, err := Create(fake.ServiceClient(), CreateOpts{os.CreateOpts{Size: 1}}).Extract() + _, err := Create(fake.ServiceClient(), CreateOpts{volumes.CreateOpts{Size: 1}}).Extract() if err == nil { t.Fatalf("Expected error, got none") } - _, err = Create(fake.ServiceClient(), CreateOpts{os.CreateOpts{Size: 2000}}).Extract() + _, err = Create(fake.ServiceClient(), CreateOpts{volumes.CreateOpts{Size: 2000}}).Extract() if err == nil { t.Fatalf("Expected error, got none") } diff --git a/Godeps/_workspace/src/github.com/rackspace/gophercloud/rackspace/compute/v2/bootfromvolume/delegate_test.go b/Godeps/_workspace/src/github.com/rackspace/gophercloud/rackspace/compute/v2/bootfromvolume/delegate_test.go index 0b5352751b4c..571a1bed2b79 100644 --- a/Godeps/_workspace/src/github.com/rackspace/gophercloud/rackspace/compute/v2/bootfromvolume/delegate_test.go +++ b/Godeps/_workspace/src/github.com/rackspace/gophercloud/rackspace/compute/v2/bootfromvolume/delegate_test.go @@ -33,6 +33,8 @@ func TestCreateOpts(t *testing.T) { "name": "createdserver", "imageRef": "asdfasdfasdf", "flavorRef": "performance1-1", + "flavorName": "", + "imageName": "", "block_device_mapping_v2":[ { "uuid":"123456", diff --git a/Godeps/_workspace/src/github.com/rackspace/gophercloud/rackspace/compute/v2/flavors/delegate.go b/Godeps/_workspace/src/github.com/rackspace/gophercloud/rackspace/compute/v2/flavors/delegate.go index 6bfc20c5644f..081ea478cd81 100644 --- a/Godeps/_workspace/src/github.com/rackspace/gophercloud/rackspace/compute/v2/flavors/delegate.go +++ b/Godeps/_workspace/src/github.com/rackspace/gophercloud/rackspace/compute/v2/flavors/delegate.go @@ -36,11 +36,8 @@ func ListDetail(client *gophercloud.ServiceClient, opts os.ListOptsBuilder) pagi } // Get returns details about a single flavor, identity by ID. -func Get(client *gophercloud.ServiceClient, id string) os.GetResult { - return os.Get(client, id) -} - -// ExtractFlavors interprets a page of List results as Flavors. -func ExtractFlavors(page pagination.Page) ([]os.Flavor, error) { - return os.ExtractFlavors(page) +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/Godeps/_workspace/src/github.com/rackspace/gophercloud/rackspace/compute/v2/flavors/fixtures.go b/Godeps/_workspace/src/github.com/rackspace/gophercloud/rackspace/compute/v2/flavors/fixtures.go index 894f916f6759..957dccfd7dd2 100644 --- a/Godeps/_workspace/src/github.com/rackspace/gophercloud/rackspace/compute/v2/flavors/fixtures.go +++ b/Godeps/_workspace/src/github.com/rackspace/gophercloud/rackspace/compute/v2/flavors/fixtures.go @@ -2,10 +2,6 @@ package flavors -import ( - os "github.com/rackspace/gophercloud/openstack/compute/v2/flavors" -) - // ListOutput is a sample response of a flavor List request. const ListOutput = ` { @@ -103,7 +99,7 @@ const GetOutput = ` // Performance1Flavor is the expected result of parsing GetOutput, or the first element of // ListOutput. -var Performance1Flavor = os.Flavor{ +var Performance1Flavor = Flavor{ ID: "performance1-1", Disk: 20, RAM: 1024, @@ -111,10 +107,16 @@ var Performance1Flavor = os.Flavor{ 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 = os.Flavor{ +var Performance2Flavor = Flavor{ ID: "performance1-2", Disk: 40, RAM: 2048, @@ -122,8 +124,14 @@ var Performance2Flavor = os.Flavor{ 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 = []os.Flavor{Performance1Flavor, Performance2Flavor} +var ExpectedFlavorSlice = []Flavor{Performance1Flavor, Performance2Flavor} diff --git a/Godeps/_workspace/src/github.com/rackspace/gophercloud/rackspace/compute/v2/flavors/results.go b/Godeps/_workspace/src/github.com/rackspace/gophercloud/rackspace/compute/v2/flavors/results.go new file mode 100644 index 000000000000..af444a766d34 --- /dev/null +++ b/Godeps/_workspace/src/github.com/rackspace/gophercloud/rackspace/compute/v2/flavors/results.go @@ -0,0 +1,104 @@ +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/Godeps/_workspace/src/github.com/rackspace/gophercloud/rackspace/compute/v2/flavors/urls.go b/Godeps/_workspace/src/github.com/rackspace/gophercloud/rackspace/compute/v2/flavors/urls.go new file mode 100644 index 000000000000..f4e2c3dac421 --- /dev/null +++ b/Godeps/_workspace/src/github.com/rackspace/gophercloud/rackspace/compute/v2/flavors/urls.go @@ -0,0 +1,9 @@ +package flavors + +import ( + "github.com/rackspace/gophercloud" +) + +func getURL(client *gophercloud.ServiceClient, id string) string { + return client.ServiceURL("flavors", id) +} diff --git a/Godeps/_workspace/src/github.com/rackspace/gophercloud/rackspace/compute/v2/servers/requests.go b/Godeps/_workspace/src/github.com/rackspace/gophercloud/rackspace/compute/v2/servers/requests.go index 809183ec7c03..d4472a08088f 100644 --- a/Godeps/_workspace/src/github.com/rackspace/gophercloud/rackspace/compute/v2/servers/requests.go +++ b/Godeps/_workspace/src/github.com/rackspace/gophercloud/rackspace/compute/v2/servers/requests.go @@ -12,13 +12,24 @@ type CreateOpts struct { // Name [required] is the name to assign to the newly launched server. Name string - // ImageRef [required] is the ID or full URL to the image that contains the server's OS and initial state. - // Optional if using the boot-from-volume extension. + // ImageRef [optional; required if ImageName is not provided] is the ID or full + // URL to the image that contains the server's OS and initial state. + // Also optional if using the boot-from-volume extension. ImageRef string - // FlavorRef [required] is the ID or full URL to the flavor that describes the server's specs. + // ImageName [optional; required if ImageRef is not provided] is the name of the + // image that contains the server's OS and initial state. + // Also optional if using the boot-from-volume extension. + ImageName string + + // FlavorRef [optional; required if FlavorName is not provided] is the ID or + // full URL to the flavor that describes the server's specs. FlavorRef string + // FlavorName [optional; required if FlavorRef is not provided] is the name of + // the flavor that describes the server's specs. + FlavorName string + // SecurityGroups [optional] lists the names of the security groups to which this server should belong. SecurityGroups []string @@ -36,9 +47,9 @@ type CreateOpts struct { // Metadata [optional] contains key-value pairs (up to 255 bytes each) to attach to the server. Metadata map[string]string - // Personality [optional] includes the path and contents of a file to inject into the server at launch. - // The maximum size of the file is 255 bytes (decoded). - Personality []byte + // Personality [optional] includes files to inject into the server at launch. + // Create will base64-encode file contents for you. + Personality os.Personality // ConfigDrive [optional] enables metadata injection through a configuration drive. ConfigDrive bool @@ -58,7 +69,7 @@ type CreateOpts struct { DiskConfig diskconfig.DiskConfig // BlockDevice [optional] will create the server from a volume, which is created from an image, - // a snapshot, or an another volume. + // a snapshot, or another volume. BlockDevice []bootfromvolume.BlockDevice } @@ -68,7 +79,9 @@ func (opts CreateOpts) ToServerCreateMap() (map[string]interface{}, error) { base := os.CreateOpts{ Name: opts.Name, ImageRef: opts.ImageRef, + ImageName: opts.ImageName, FlavorRef: opts.FlavorRef, + FlavorName: opts.FlavorName, SecurityGroups: opts.SecurityGroups, UserData: opts.UserData, AvailabilityZone: opts.AvailabilityZone, @@ -104,7 +117,9 @@ func (opts CreateOpts) ToServerCreateMap() (map[string]interface{}, error) { // key_name doesn't actually come from the extension (or at least isn't documented there) so // we need to add it manually. serverMap := res["server"].(map[string]interface{}) - serverMap["key_name"] = opts.KeyPair + if opts.KeyPair != "" { + serverMap["key_name"] = opts.KeyPair + } return res, nil } @@ -130,9 +145,9 @@ type RebuildOpts struct { // Metadata [optional] contains key-value pairs (up to 255 bytes each) to attach to the server. Metadata map[string]string - // Personality [optional] includes the path and contents of a file to inject into the server at launch. - // The maximum size of the file is 255 bytes (decoded). - Personality []byte + // Personality [optional] includes files to inject into the server at launch. + // Rebuild will base64-encode file contents for you. + Personality os.Personality // Rackspace-specific stuff begins here. diff --git a/Godeps/_workspace/src/github.com/rackspace/gophercloud/rackspace/compute/v2/servers/requests_test.go b/Godeps/_workspace/src/github.com/rackspace/gophercloud/rackspace/compute/v2/servers/requests_test.go index 3c0f806936f0..828b5dc491e0 100644 --- a/Godeps/_workspace/src/github.com/rackspace/gophercloud/rackspace/compute/v2/servers/requests_test.go +++ b/Godeps/_workspace/src/github.com/rackspace/gophercloud/rackspace/compute/v2/servers/requests_test.go @@ -22,6 +22,8 @@ func TestCreateOpts(t *testing.T) { "name": "createdserver", "imageRef": "image-id", "flavorRef": "flavor-id", + "flavorName": "", + "imageName": "", "key_name": "mykey", "OS-DCF:diskConfig": "MANUAL" } diff --git a/Godeps/_workspace/src/github.com/rackspace/gophercloud/rackspace/compute/v2/volumeattach/delegate_test.go b/Godeps/_workspace/src/github.com/rackspace/gophercloud/rackspace/compute/v2/volumeattach/delegate_test.go index e26416cba0de..f7ef45e621a8 100644 --- a/Godeps/_workspace/src/github.com/rackspace/gophercloud/rackspace/compute/v2/volumeattach/delegate_test.go +++ b/Godeps/_workspace/src/github.com/rackspace/gophercloud/rackspace/compute/v2/volumeattach/delegate_test.go @@ -3,24 +3,53 @@ package volumeattach import ( "testing" - os "github.com/rackspace/gophercloud/openstack/compute/v2/extensions/volumeattach" + "github.com/rackspace/gophercloud/openstack/compute/v2/extensions/volumeattach" + fixtures "github.com/rackspace/gophercloud/openstack/compute/v2/extensions/volumeattach/testing" "github.com/rackspace/gophercloud/pagination" th "github.com/rackspace/gophercloud/testhelper" "github.com/rackspace/gophercloud/testhelper/client" ) +// FirstVolumeAttachment is the first result in ListOutput. +var FirstVolumeAttachment = volumeattach.VolumeAttachment{ + Device: "/dev/vdd", + ID: "a26887c6-c47b-4654-abb5-dfadf7d3f803", + ServerID: "4d8c3732-a248-40ed-bebc-539a6ffd25c0", + VolumeID: "a26887c6-c47b-4654-abb5-dfadf7d3f803", +} + +// SecondVolumeAttachment is the first result in ListOutput. +var SecondVolumeAttachment = volumeattach.VolumeAttachment{ + Device: "/dev/vdc", + ID: "a26887c6-c47b-4654-abb5-dfadf7d3f804", + ServerID: "4d8c3732-a248-40ed-bebc-539a6ffd25c0", + VolumeID: "a26887c6-c47b-4654-abb5-dfadf7d3f804", +} + +// ExpectedVolumeAttachmentSlide is the slice of results that should be parsed +// from ListOutput, in the expected order. +var ExpectedVolumeAttachmentSlice = []volumeattach.VolumeAttachment{FirstVolumeAttachment, SecondVolumeAttachment} + +//CreatedVolumeAttachment is the parsed result from CreatedOutput. +var CreatedVolumeAttachment = volumeattach.VolumeAttachment{ + Device: "/dev/vdc", + ID: "a26887c6-c47b-4654-abb5-dfadf7d3f804", + ServerID: "4d8c3732-a248-40ed-bebc-539a6ffd25c0", + VolumeID: "a26887c6-c47b-4654-abb5-dfadf7d3f804", +} + func TestList(t *testing.T) { th.SetupHTTP() defer th.TeardownHTTP() - os.HandleListSuccessfully(t) + fixtures.HandleListSuccessfully(t) serverId := "4d8c3732-a248-40ed-bebc-539a6ffd25c0" count := 0 err := List(client.ServiceClient(), serverId).EachPage(func(page pagination.Page) (bool, error) { count++ - actual, err := os.ExtractVolumeAttachments(page) + actual, err := volumeattach.ExtractVolumeAttachments(page) th.AssertNoErr(t, err) - th.CheckDeepEquals(t, os.ExpectedVolumeAttachmentSlice, actual) + th.CheckDeepEquals(t, ExpectedVolumeAttachmentSlice, actual) return true, nil }) @@ -31,33 +60,33 @@ func TestList(t *testing.T) { func TestCreate(t *testing.T) { th.SetupHTTP() defer th.TeardownHTTP() - os.HandleCreateSuccessfully(t) + fixtures.HandleCreateSuccessfully(t) serverId := "4d8c3732-a248-40ed-bebc-539a6ffd25c0" - actual, err := Create(client.ServiceClient(), serverId, os.CreateOpts{ + actual, err := Create(client.ServiceClient(), serverId, volumeattach.CreateOpts{ Device: "/dev/vdc", VolumeID: "a26887c6-c47b-4654-abb5-dfadf7d3f804", }).Extract() th.AssertNoErr(t, err) - th.CheckDeepEquals(t, &os.CreatedVolumeAttachment, actual) + th.CheckDeepEquals(t, &CreatedVolumeAttachment, actual) } func TestGet(t *testing.T) { th.SetupHTTP() defer th.TeardownHTTP() - os.HandleGetSuccessfully(t) + fixtures.HandleGetSuccessfully(t) aId := "a26887c6-c47b-4654-abb5-dfadf7d3f804" serverId := "4d8c3732-a248-40ed-bebc-539a6ffd25c0" actual, err := Get(client.ServiceClient(), serverId, aId).Extract() th.AssertNoErr(t, err) - th.CheckDeepEquals(t, &os.SecondVolumeAttachment, actual) + th.CheckDeepEquals(t, &SecondVolumeAttachment, actual) } func TestDelete(t *testing.T) { th.SetupHTTP() defer th.TeardownHTTP() - os.HandleDeleteSuccessfully(t) + fixtures.HandleDeleteSuccessfully(t) aId := "a26887c6-c47b-4654-abb5-dfadf7d3f804" serverId := "4d8c3732-a248-40ed-bebc-539a6ffd25c0" diff --git a/Godeps/_workspace/src/github.com/rackspace/gophercloud/rackspace/lb/v1/nodes/fixtures.go b/Godeps/_workspace/src/github.com/rackspace/gophercloud/rackspace/lb/v1/nodes/fixtures.go index 7c85945cafe1..8899fc5e975c 100644 --- a/Godeps/_workspace/src/github.com/rackspace/gophercloud/rackspace/lb/v1/nodes/fixtures.go +++ b/Godeps/_workspace/src/github.com/rackspace/gophercloud/rackspace/lb/v1/nodes/fixtures.go @@ -107,6 +107,42 @@ func mockCreateResponse(t *testing.T, lbID int) { }) } +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") diff --git a/Godeps/_workspace/src/github.com/rackspace/gophercloud/rackspace/lb/v1/nodes/requests.go b/Godeps/_workspace/src/github.com/rackspace/gophercloud/rackspace/lb/v1/nodes/requests.go index 02af86b5c1e2..dc2d46c8913a 100644 --- a/Godeps/_workspace/src/github.com/rackspace/gophercloud/rackspace/lb/v1/nodes/requests.go +++ b/Godeps/_workspace/src/github.com/rackspace/gophercloud/rackspace/lb/v1/nodes/requests.go @@ -119,12 +119,7 @@ func Create(client *gophercloud.ServiceClient, loadBalancerID int, opts CreateOp return res } - pr, err := pagination.PageResultFrom(resp) - if err != nil { - res.Err = err - return res - } - + pr := pagination.PageResultFromParsed(resp, res.Body) return CreateResult{pagination.SinglePageBase(pr)} } diff --git a/Godeps/_workspace/src/github.com/rackspace/gophercloud/rackspace/lb/v1/nodes/requests_test.go b/Godeps/_workspace/src/github.com/rackspace/gophercloud/rackspace/lb/v1/nodes/requests_test.go index 003d347c073b..a964af8f90d4 100644 --- a/Godeps/_workspace/src/github.com/rackspace/gophercloud/rackspace/lb/v1/nodes/requests_test.go +++ b/Godeps/_workspace/src/github.com/rackspace/gophercloud/rackspace/lb/v1/nodes/requests_test.go @@ -108,6 +108,38 @@ func TestCreate(t *testing.T) { th.CheckDeepEquals(t, expected, actual) } +func TestCreateErr(t *testing.T) { + th.SetupHTTP() + defer th.TeardownHTTP() + + mockCreateErrResponse(t, lbID) + + opts := CreateOpts{ + CreateOpt{ + Address: "10.2.2.3", + Port: 80, + Condition: ENABLED, + Type: PRIMARY, + }, + CreateOpt{ + Address: "10.2.2.4", + Port: 81, + Condition: ENABLED, + Type: SECONDARY, + }, + } + + page := Create(client.ServiceClient(), lbID, opts) + + actual, err := page.ExtractNodes() + if err == nil { + t.Fatal("Did not receive expected error from ExtractNodes") + } + if actual != nil { + t.Fatalf("Received non-nil result from failed ExtractNodes: %#v", actual) + } +} + func TestBulkDelete(t *testing.T) { th.SetupHTTP() defer th.TeardownHTTP() diff --git a/Godeps/_workspace/src/github.com/rackspace/gophercloud/rackspace/lb/v1/nodes/results.go b/Godeps/_workspace/src/github.com/rackspace/gophercloud/rackspace/lb/v1/nodes/results.go index 916485f2fcba..57835dc4b5d2 100644 --- a/Godeps/_workspace/src/github.com/rackspace/gophercloud/rackspace/lb/v1/nodes/results.go +++ b/Godeps/_workspace/src/github.com/rackspace/gophercloud/rackspace/lb/v1/nodes/results.go @@ -126,6 +126,9 @@ type CreateResult struct { // 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) } diff --git a/Godeps/_workspace/src/github.com/rackspace/gophercloud/rackspace/lb/v1/sessions/fixtures.go b/Godeps/_workspace/src/github.com/rackspace/gophercloud/rackspace/lb/v1/sessions/fixtures.go index 9596819d16d5..077ef0470191 100644 --- a/Godeps/_workspace/src/github.com/rackspace/gophercloud/rackspace/lb/v1/sessions/fixtures.go +++ b/Godeps/_workspace/src/github.com/rackspace/gophercloud/rackspace/lb/v1/sessions/fixtures.go @@ -46,6 +46,7 @@ func mockEnableResponse(t *testing.T, lbID int) { `) w.WriteHeader(http.StatusAccepted) + fmt.Fprintf(w, `{}`) }) } diff --git a/Godeps/_workspace/src/github.com/rackspace/gophercloud/rackspace/lb/v1/ssl/fixtures.go b/Godeps/_workspace/src/github.com/rackspace/gophercloud/rackspace/lb/v1/ssl/fixtures.go index 1d401001250b..5a52962d49ab 100644 --- a/Godeps/_workspace/src/github.com/rackspace/gophercloud/rackspace/lb/v1/ssl/fixtures.go +++ b/Godeps/_workspace/src/github.com/rackspace/gophercloud/rackspace/lb/v1/ssl/fixtures.go @@ -63,6 +63,7 @@ func mockUpdateResponse(t *testing.T, lbID int) { `) w.WriteHeader(http.StatusOK) + fmt.Fprintf(w, `{}`) }) } diff --git a/Godeps/_workspace/src/github.com/rackspace/gophercloud/rackspace/lb/v1/throttle/fixtures.go b/Godeps/_workspace/src/github.com/rackspace/gophercloud/rackspace/lb/v1/throttle/fixtures.go index 40223f60a672..f3e49fa6884e 100644 --- a/Godeps/_workspace/src/github.com/rackspace/gophercloud/rackspace/lb/v1/throttle/fixtures.go +++ b/Godeps/_workspace/src/github.com/rackspace/gophercloud/rackspace/lb/v1/throttle/fixtures.go @@ -49,6 +49,7 @@ func mockCreateResponse(t *testing.T, lbID int) { `) w.WriteHeader(http.StatusAccepted) + fmt.Fprintf(w, `{}`) }) } diff --git a/Godeps/_workspace/src/github.com/rackspace/gophercloud/rackspace/networking/v2/networks/delegate_test.go b/Godeps/_workspace/src/github.com/rackspace/gophercloud/rackspace/networking/v2/networks/delegate_test.go index f51c732d4367..0b3a6b15eb4f 100644 --- a/Godeps/_workspace/src/github.com/rackspace/gophercloud/rackspace/networking/v2/networks/delegate_test.go +++ b/Godeps/_workspace/src/github.com/rackspace/gophercloud/rackspace/networking/v2/networks/delegate_test.go @@ -203,8 +203,17 @@ func TestCreateWithOptionalFields(t *testing.T) { } } `) - w.WriteHeader(http.StatusCreated) + fmt.Fprintf(w, ` +{ + "network": { + "name": "sample_network", + "admin_state_up": true, + "shared": true, + "tenant_id": "12345" + } +} + `) }) iTrue := true diff --git a/Godeps/_workspace/src/github.com/rackspace/gophercloud/rackspace/objectstorage/v1/bulk/requests.go b/Godeps/_workspace/src/github.com/rackspace/gophercloud/rackspace/objectstorage/v1/bulk/requests.go index 898b73b0bd84..0aeec155b778 100644 --- a/Godeps/_workspace/src/github.com/rackspace/gophercloud/rackspace/objectstorage/v1/bulk/requests.go +++ b/Godeps/_workspace/src/github.com/rackspace/gophercloud/rackspace/objectstorage/v1/bulk/requests.go @@ -43,7 +43,9 @@ func Delete(c *gophercloud.ServiceClient, opts DeleteOptsBuilder) DeleteResult { JSONBody: reqBody, JSONResponse: &res.Body, }) - res.Header = resp.Header + if resp != nil { + res.Header = resp.Header + } res.Err = err return res } diff --git a/Godeps/_workspace/src/github.com/rackspace/gophercloud/rackspace/objectstorage/v1/cdncontainers/requests.go b/Godeps/_workspace/src/github.com/rackspace/gophercloud/rackspace/objectstorage/v1/cdncontainers/requests.go index 8e4abbe436c2..6acebb0aad23 100644 --- a/Godeps/_workspace/src/github.com/rackspace/gophercloud/rackspace/objectstorage/v1/cdncontainers/requests.go +++ b/Godeps/_workspace/src/github.com/rackspace/gophercloud/rackspace/objectstorage/v1/cdncontainers/requests.go @@ -53,7 +53,9 @@ func Enable(c *gophercloud.ServiceClient, containerName string, opts EnableOptsB MoreHeaders: h, OkCodes: []int{201, 202, 204}, }) - res.Header = resp.Header + if resp != nil { + res.Header = resp.Header + } res.Err = err return res } @@ -66,7 +68,9 @@ func Get(c *gophercloud.ServiceClient, containerName string) GetResult { resp, err := c.Request("HEAD", getURL(c, containerName), gophercloud.RequestOpts{ OkCodes: []int{200, 204}, }) - res.Header = resp.Header + if resp != nil { + res.Header = resp.Header + } res.Err = err return res } @@ -149,7 +153,9 @@ func Update(c *gophercloud.ServiceClient, containerName string, opts UpdateOptsB MoreHeaders: h, OkCodes: []int{202, 204}, }) - res.Header = resp.Header + if resp != nil { + res.Header = resp.Header + } res.Err = err return res } diff --git a/Godeps/_workspace/src/github.com/rackspace/gophercloud/rackspace/objectstorage/v1/objects/delegate.go b/Godeps/_workspace/src/github.com/rackspace/gophercloud/rackspace/objectstorage/v1/objects/delegate.go index 028d66a0ab77..94c820ba7bdd 100644 --- a/Godeps/_workspace/src/github.com/rackspace/gophercloud/rackspace/objectstorage/v1/objects/delegate.go +++ b/Godeps/_workspace/src/github.com/rackspace/gophercloud/rackspace/objectstorage/v1/objects/delegate.go @@ -33,7 +33,7 @@ func Download(c *gophercloud.ServiceClient, containerName, objectName string, op } // Create is a function that creates a new object or replaces an existing object. -func Create(c *gophercloud.ServiceClient, containerName, objectName string, content io.Reader, opts os.CreateOptsBuilder) os.CreateResult { +func Create(c *gophercloud.ServiceClient, containerName, objectName string, content io.ReadSeeker, opts os.CreateOptsBuilder) os.CreateResult { return os.Create(c, containerName, objectName, content, opts) } diff --git a/Godeps/_workspace/src/github.com/rackspace/gophercloud/rackspace/objectstorage/v1/objects/delegate_test.go b/Godeps/_workspace/src/github.com/rackspace/gophercloud/rackspace/objectstorage/v1/objects/delegate_test.go index 8ab8029c37b5..21cd4179a5d2 100644 --- a/Godeps/_workspace/src/github.com/rackspace/gophercloud/rackspace/objectstorage/v1/objects/delegate_test.go +++ b/Godeps/_workspace/src/github.com/rackspace/gophercloud/rackspace/objectstorage/v1/objects/delegate_test.go @@ -1,7 +1,7 @@ package objects import ( - "bytes" + "strings" "testing" os "github.com/rackspace/gophercloud/openstack/objectstorage/v1/objects" @@ -66,21 +66,23 @@ func TestListObjectNames(t *testing.T) { func TestCreateObject(t *testing.T) { th.SetupHTTP() defer th.TeardownHTTP() - os.HandleCreateTextObjectSuccessfully(t) + + content := "Did gyre and gimble in the wabe" + os.HandleCreateTextObjectSuccessfully(t, content) - content := bytes.NewBufferString("Did gyre and gimble in the wabe") options := &os.CreateOpts{ContentType: "text/plain"} - res := Create(fake.ServiceClient(), "testContainer", "testObject", content, options) + res := Create(fake.ServiceClient(), "testContainer", "testObject", strings.NewReader(content), options) th.AssertNoErr(t, res.Err) } func TestCreateObjectWithoutContentType(t *testing.T) { th.SetupHTTP() defer th.TeardownHTTP() - os.HandleCreateTypelessObjectSuccessfully(t) - content := bytes.NewBufferString("The sky was the color of television, tuned to a dead channel.") - res := Create(fake.ServiceClient(), "testContainer", "testObject", content, &os.CreateOpts{}) + content := "The sky was the color of television, tuned to a dead channel." + os.HandleCreateTypelessObjectSuccessfully(t, content) + + res := Create(fake.ServiceClient(), "testContainer", "testObject", strings.NewReader(content), &os.CreateOpts{}) th.AssertNoErr(t, res.Err) } diff --git a/Godeps/_workspace/src/github.com/rackspace/gophercloud/results.go b/Godeps/_workspace/src/github.com/rackspace/gophercloud/results.go index 7c86ce46230c..27fd1b60fa21 100644 --- a/Godeps/_workspace/src/github.com/rackspace/gophercloud/results.go +++ b/Godeps/_workspace/src/github.com/rackspace/gophercloud/results.go @@ -113,6 +113,9 @@ func DecodeHeader(from, to interface{}) error { // RFC3339Milli describes a common time format used by some API responses. const RFC3339Milli = "2006-01-02T15:04:05.999999Z" +// Time format used in cloud orchestration +const STACK_TIME_FMT = "2006-01-02T15:04:05" + /* Link is an internal type to be used in packages of collection resources that are paginated in a certain way. diff --git a/Godeps/_workspace/src/github.com/samuel/go-zookeeper/zk/conn.go b/Godeps/_workspace/src/github.com/samuel/go-zookeeper/zk/conn.go index 47d5534a89fc..b46467025a7f 100644 --- a/Godeps/_workspace/src/github.com/samuel/go-zookeeper/zk/conn.go +++ b/Godeps/_workspace/src/github.com/samuel/go-zookeeper/zk/conn.go @@ -1,3 +1,4 @@ +// Package zk is a native Go client library for the ZooKeeper orchestration service. package zk /* @@ -14,7 +15,6 @@ import ( "errors" "fmt" "io" - "log" "net" "strconv" "strings" @@ -23,8 +23,17 @@ import ( "time" ) +// ErrNoServer indicates that an operation cannot be completed +// because attempts to connect to all servers in the list failed. var ErrNoServer = errors.New("zk: could not connect to a server") +// ErrInvalidPath indicates that an operation was being attempted on +// an invalid path. (e.g. empty path) +var ErrInvalidPath = errors.New("zk: invalid path") + +// DefaultLogger uses the stdlib log package for logging. +var DefaultLogger Logger = defaultLogger{} + const ( bufferSize = 1536 * 1024 eventChanSize = 6 @@ -47,6 +56,11 @@ type watchPathType struct { type Dialer func(network, address string, timeout time.Duration) (net.Conn, error) +// Logger is an interface that can be implemented to provide custom log output. +type Logger interface { + Printf(string, ...interface{}) +} + type Conn struct { lastZxid int64 sessionID int64 @@ -74,6 +88,8 @@ type Conn struct { // Debug (used by unit tests) reconnectDelay time.Duration + + logger Logger } type request struct { @@ -160,6 +176,7 @@ func ConnectWithDialer(servers []string, sessionTimeout time.Duration, dialer Di watchers: make(map[watchPathType][]chan Event), passwd: emptyPassword, timeout: int32(sessionTimeout.Nanoseconds() / 1e6), + logger: DefaultLogger, // Debug reconnectDelay: 0, @@ -182,10 +199,17 @@ func (c *Conn) Close() { } } +// States returns the current state of the connection. func (c *Conn) State() State { return State(atomic.LoadInt32((*int32)(&c.state))) } +// SetLogger sets the logger to be used for printing errors. +// Logger is an interface provided by this package. +func (c *Conn) SetLogger(l Logger) { + c.logger = l +} + func (c *Conn) setState(state State) { atomic.StoreInt32((*int32)(&c.state), int32(state)) select { @@ -221,7 +245,7 @@ func (c *Conn) connect() error { return nil } - log.Printf("Failed to connect to %s: %+v", c.servers[c.serverIndex], err) + c.logger.Printf("Failed to connect to %s: %+v", c.servers[c.serverIndex], err) } } @@ -267,7 +291,7 @@ func (c *Conn) loop() { // Yeesh if err != io.EOF && err != ErrSessionExpired && !strings.Contains(err.Error(), "use of closed network connection") { - log.Println(err) + c.logger.Printf(err.Error()) } select { @@ -367,7 +391,7 @@ func (c *Conn) sendSetWatches() { res := &setWatchesResponse{} _, err := c.request(opSetWatches, req, res, nil) if err != nil { - log.Printf("Failed to set previous watches: %s", err.Error()) + c.logger.Printf("Failed to set previous watches: %s", err.Error()) } }() } @@ -439,9 +463,6 @@ func (c *Conn) authenticate() error { return ErrSessionExpired } - if c.sessionID != r.SessionID { - atomic.StoreUint32(&c.xid, 0) - } c.timeout = r.TimeOut c.sessionID = r.SessionID c.passwd = r.Passwd @@ -582,7 +603,7 @@ func (c *Conn) recvLoop(conn net.Conn) error { } else if res.Xid == -2 { // Ping response. Ignore. } else if res.Xid < 0 { - log.Printf("Xid < 0 (%d) but not ping or watcher event", res.Xid) + c.logger.Printf("Xid < 0 (%d) but not ping or watcher event", res.Xid) } else { if res.Zxid > 0 { c.lastZxid = res.Zxid @@ -596,7 +617,7 @@ func (c *Conn) recvLoop(conn net.Conn) error { c.requestsLock.Unlock() if !ok { - log.Printf("Response for unknown request with xid %d", res.Xid) + c.logger.Printf("Response for unknown request with xid %d", res.Xid) } else { if res.Err != 0 { err = res.Err.toError() @@ -694,6 +715,9 @@ func (c *Conn) GetW(path string) ([]byte, *Stat, <-chan Event, error) { } func (c *Conn) Set(path string, data []byte, version int32) (*Stat, error) { + if path == "" { + return nil, ErrInvalidPath + } res := &setDataResponse{} _, err := c.request(opSetData, &SetDataRequest{path, data, version}, res, nil) return &res.Stat, err diff --git a/Godeps/_workspace/src/github.com/samuel/go-zookeeper/zk/constants.go b/Godeps/_workspace/src/github.com/samuel/go-zookeeper/zk/constants.go index 0546af2efae4..f9b39b904f74 100644 --- a/Godeps/_workspace/src/github.com/samuel/go-zookeeper/zk/constants.go +++ b/Godeps/_workspace/src/github.com/samuel/go-zookeeper/zk/constants.go @@ -57,7 +57,6 @@ const ( StateUnknown = State(-1) StateDisconnected = State(0) StateConnecting = State(1) - StateSyncConnected = State(3) StateAuthFailed = State(4) StateConnectedReadOnly = State(5) StateSaslAuthenticated = State(6) @@ -77,7 +76,6 @@ var ( stateNames = map[State]string{ StateUnknown: "StateUnknown", StateDisconnected: "StateDisconnected", - StateSyncConnected: "StateSyncConnected", StateConnectedReadOnly: "StateConnectedReadOnly", StateSaslAuthenticated: "StateSaslAuthenticated", StateExpired: "StateExpired", diff --git a/Godeps/_workspace/src/github.com/samuel/go-zookeeper/zk/flw.go b/Godeps/_workspace/src/github.com/samuel/go-zookeeper/zk/flw.go index c1225ffa25ab..1045c98cfdb3 100644 --- a/Godeps/_workspace/src/github.com/samuel/go-zookeeper/zk/flw.go +++ b/Godeps/_workspace/src/github.com/samuel/go-zookeeper/zk/flw.go @@ -49,15 +49,17 @@ func FLWSrvr(servers []string, timeout time.Duration) ([]*ServerStats, bool) { continue } - match := re.FindAllStringSubmatch(string(response), -1)[0][1:] + matches := re.FindAllStringSubmatch(string(response), -1) - if match == nil { + if matches == nil { err := fmt.Errorf("unable to parse fields from zookeeper response (no regex matches)") ss[i] = &ServerStats{Error: err} imOk = false continue } + match := matches[0][1:] + // determine current server var srvrMode Mode switch match[10] { diff --git a/Godeps/_workspace/src/github.com/samuel/go-zookeeper/zk/lock.go b/Godeps/_workspace/src/github.com/samuel/go-zookeeper/zk/lock.go index fb77e4a5383d..f13a8b0ba6ea 100644 --- a/Godeps/_workspace/src/github.com/samuel/go-zookeeper/zk/lock.go +++ b/Godeps/_workspace/src/github.com/samuel/go-zookeeper/zk/lock.go @@ -8,10 +8,13 @@ import ( ) var ( - ErrDeadlock = errors.New("zk: trying to acquire a lock twice") + // ErrDeadlock is returned by Lock when trying to lock twice without unlocking first + ErrDeadlock = errors.New("zk: trying to acquire a lock twice") + // ErrNotLocked is returned by Unlock when trying to release a lock that has not first be acquired. ErrNotLocked = errors.New("zk: not locked") ) +// Lock is a mutual exclusion lock. type Lock struct { c *Conn path string @@ -20,6 +23,9 @@ type Lock struct { seq int } +// NewLock creates a new lock instance using the provided connection, path, and acl. +// The path must be a node that is only used by this lock. A lock instances starts +// unlocked until Lock() is called. func NewLock(c *Conn, path string, acl []ACL) *Lock { return &Lock{ c: c, @@ -33,6 +39,9 @@ func parseSeq(path string) (int, error) { return strconv.Atoi(parts[len(parts)-1]) } +// Lock attempts to acquire the lock. It will wait to return until the lock +// is acquired or an error occurs. If this instance already has the lock +// then ErrDeadlock is returned. func (l *Lock) Lock() error { if l.lockPath != "" { return ErrDeadlock @@ -118,6 +127,8 @@ func (l *Lock) Lock() error { return nil } +// Unlock releases an acquired lock. If the lock is not currently acquired by +// this Lock instance than ErrNotLocked is returned. func (l *Lock) Unlock() error { if l.lockPath == "" { return ErrNotLocked diff --git a/Godeps/_workspace/src/github.com/samuel/go-zookeeper/zk/structs.go b/Godeps/_workspace/src/github.com/samuel/go-zookeeper/zk/structs.go index 3c9058adb7d7..8fbc069ee1f5 100644 --- a/Godeps/_workspace/src/github.com/samuel/go-zookeeper/zk/structs.go +++ b/Godeps/_workspace/src/github.com/samuel/go-zookeeper/zk/structs.go @@ -3,6 +3,7 @@ package zk import ( "encoding/binary" "errors" + "log" "reflect" "runtime" "time" @@ -14,6 +15,12 @@ var ( ErrShortBuffer = errors.New("zk: buffer too small") ) +type defaultLogger struct{} + +func (defaultLogger) Printf(format string, a ...interface{}) { + log.Printf(format, a...) +} + type ACL struct { Perms int32 Scheme string diff --git a/Godeps/_workspace/src/github.com/samuel/go-zookeeper/zk/structs_test.go b/Godeps/_workspace/src/github.com/samuel/go-zookeeper/zk/structs_test.go index 64f18e8d3efc..cafbbd95c261 100644 --- a/Godeps/_workspace/src/github.com/samuel/go-zookeeper/zk/structs_test.go +++ b/Godeps/_workspace/src/github.com/samuel/go-zookeeper/zk/structs_test.go @@ -58,3 +58,14 @@ func TestDecodeShortBuffer(t *testing.T) { return } } + +func BenchmarkEncode(b *testing.B) { + buf := make([]byte, 4096) + st := &connectRequest{Passwd: []byte("1234567890")} + b.ReportAllocs() + for i := 0; i < b.N; i++ { + if _, err := encodePacket(buf, st); err != nil { + b.Fatal(err) + } + } +} diff --git a/Godeps/_workspace/src/github.com/spf13/pflag/.travis.yml b/Godeps/_workspace/src/github.com/spf13/pflag/.travis.yml new file mode 100644 index 000000000000..c40fb69818b0 --- /dev/null +++ b/Godeps/_workspace/src/github.com/spf13/pflag/.travis.yml @@ -0,0 +1,17 @@ +sudo: false + +language: go + +go: + - 1.3 + - 1.4 + - tip + +install: + - go get github.com/golang/lint/golint + - export PATH=$GOPATH/bin:$PATH + - go install ./... + +script: + - verify/all.sh + - go test ./... diff --git a/Godeps/_workspace/src/github.com/spf13/pflag/LICENSE b/Godeps/_workspace/src/github.com/spf13/pflag/LICENSE new file mode 100644 index 000000000000..63ed1cfea1fb --- /dev/null +++ b/Godeps/_workspace/src/github.com/spf13/pflag/LICENSE @@ -0,0 +1,28 @@ +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/Godeps/_workspace/src/github.com/spf13/pflag/verify/all.sh b/Godeps/_workspace/src/github.com/spf13/pflag/verify/all.sh new file mode 100644 index 000000000000..739f89c0b4ba --- /dev/null +++ b/Godeps/_workspace/src/github.com/spf13/pflag/verify/all.sh @@ -0,0 +1,69 @@ +#!/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/Godeps/_workspace/src/github.com/spf13/pflag/verify/gofmt.sh b/Godeps/_workspace/src/github.com/spf13/pflag/verify/gofmt.sh new file mode 100644 index 000000000000..f66acf803b54 --- /dev/null +++ b/Godeps/_workspace/src/github.com/spf13/pflag/verify/gofmt.sh @@ -0,0 +1,19 @@ +#!/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/Godeps/_workspace/src/github.com/spf13/pflag/verify/golint.sh b/Godeps/_workspace/src/github.com/spf13/pflag/verify/golint.sh new file mode 100644 index 000000000000..685c1778e598 --- /dev/null +++ b/Godeps/_workspace/src/github.com/spf13/pflag/verify/golint.sh @@ -0,0 +1,15 @@ +#!/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/Godeps/_workspace/src/github.com/ugorji/go/codec/0doc.go b/Godeps/_workspace/src/github.com/ugorji/go/codec/0doc.go index 0f33922b730d..dd8b589de070 100644 --- a/Godeps/_workspace/src/github.com/ugorji/go/codec/0doc.go +++ b/Godeps/_workspace/src/github.com/ugorji/go/codec/0doc.go @@ -1,5 +1,5 @@ // Copyright (c) 2012-2015 Ugorji Nwoke. All rights reserved. -// Use of this source code is governed by a BSD-style license found in the LICENSE file. +// Use of this source code is governed by a MIT license found in the LICENSE file. /* High Performance, Feature-Rich Idiomatic Go codec/encoding library for diff --git a/Godeps/_workspace/src/github.com/ugorji/go/codec/binc.go b/Godeps/_workspace/src/github.com/ugorji/go/codec/binc.go index dc3aa80a9510..645376479ae1 100644 --- a/Godeps/_workspace/src/github.com/ugorji/go/codec/binc.go +++ b/Godeps/_workspace/src/github.com/ugorji/go/codec/binc.go @@ -1,10 +1,11 @@ // Copyright (c) 2012-2015 Ugorji Nwoke. All rights reserved. -// Use of this source code is governed by a BSD-style license found in the LICENSE file. +// Use of this source code is governed by a MIT license found in the LICENSE file. package codec import ( "math" + "reflect" "time" ) @@ -69,7 +70,15 @@ func (e *bincEncDriver) IsBuiltinType(rt uintptr) bool { func (e *bincEncDriver) EncodeBuiltin(rt uintptr, v interface{}) { if rt == timeTypId { - bs := encodeTime(v.(time.Time)) + var bs []byte + switch x := v.(type) { + case time.Time: + bs = encodeTime(x) + case *time.Time: + bs = encodeTime(*x) + default: + e.e.errorf("binc error encoding builtin: expect time.Time, received %T", v) + } e.w.writen1(bincVdTimestamp<<4 | uint8(len(bs))) e.w.writeb(bs) } @@ -897,5 +906,9 @@ func (h *BincHandle) newDecDriver(d *Decoder) decDriver { return &bincDecDriver{d: d, r: d.r, h: h, br: d.bytes} } +func (h *BincHandle) SetBytesExt(rt reflect.Type, tag uint64, ext BytesExt) (err error) { + return h.SetExt(rt, tag, &setExtWrapper{b: ext}) +} + var _ decDriver = (*bincDecDriver)(nil) var _ encDriver = (*bincEncDriver)(nil) diff --git a/Godeps/_workspace/src/github.com/ugorji/go/codec/cbor.go b/Godeps/_workspace/src/github.com/ugorji/go/codec/cbor.go index b56bcef9bab0..8b6e13a89e98 100644 --- a/Godeps/_workspace/src/github.com/ugorji/go/codec/cbor.go +++ b/Godeps/_workspace/src/github.com/ugorji/go/codec/cbor.go @@ -1,9 +1,12 @@ // Copyright (c) 2012-2015 Ugorji Nwoke. All rights reserved. -// Use of this source code is governed by a BSD-style license found in the LICENSE file. +// Use of this source code is governed by a MIT license found in the LICENSE file. package codec -import "math" +import ( + "math" + "reflect" +) const ( cborMajorUint byte = iota @@ -98,7 +101,7 @@ func (e *cborEncDriver) encUint(v uint64, bd byte) { } else if v <= math.MaxUint32 { e.w.writen1(bd + 0x1a) bigenHelper{e.x[:4], e.w}.writeUint32(uint32(v)) - } else if v <= math.MaxUint64 { + } else { // if v <= math.MaxUint64 { e.w.writen1(bd + 0x1b) bigenHelper{e.x[:8], e.w}.writeUint64(v) } @@ -158,7 +161,11 @@ func (e *cborEncDriver) EncodeSymbol(v string) { } func (e *cborEncDriver) EncodeStringBytes(c charEncoding, v []byte) { - e.encLen(cborBaseBytes, len(v)) + if c == c_RAW { + e.encLen(cborBaseBytes, len(v)) + } else { + e.encLen(cborBaseString, len(v)) + } e.w.writeb(v) } @@ -562,5 +569,9 @@ func (h *CborHandle) newDecDriver(d *Decoder) decDriver { return &cborDecDriver{d: d, r: d.r, h: h, br: d.bytes} } +func (h *CborHandle) SetInterfaceExt(rt reflect.Type, tag uint64, ext InterfaceExt) (err error) { + return h.SetExt(rt, tag, &setExtWrapper{i: ext}) +} + var _ decDriver = (*cborDecDriver)(nil) var _ encDriver = (*cborEncDriver)(nil) diff --git a/Godeps/_workspace/src/github.com/ugorji/go/codec/cbor_test.go b/Godeps/_workspace/src/github.com/ugorji/go/codec/cbor_test.go index b03a9da078a4..205dffa7d15b 100644 --- a/Godeps/_workspace/src/github.com/ugorji/go/codec/cbor_test.go +++ b/Godeps/_workspace/src/github.com/ugorji/go/codec/cbor_test.go @@ -1,5 +1,5 @@ // Copyright (c) 2012-2015 Ugorji Nwoke. All rights reserved. -// Use of this source code is governed by a BSD-style license found in the LICENSE file. +// Use of this source code is governed by a MIT license found in the LICENSE file. package codec diff --git a/Godeps/_workspace/src/github.com/ugorji/go/codec/codec_test.go b/Godeps/_workspace/src/github.com/ugorji/go/codec/codec_test.go index 205af445a24a..d9583a9b139d 100644 --- a/Godeps/_workspace/src/github.com/ugorji/go/codec/codec_test.go +++ b/Godeps/_workspace/src/github.com/ugorji/go/codec/codec_test.go @@ -1,5 +1,5 @@ // Copyright (c) 2012-2015 Ugorji Nwoke. All rights reserved. -// Use of this source code is governed by a BSD-style license found in the LICENSE file. +// Use of this source code is governed by a MIT license found in the LICENSE file. package codec @@ -860,6 +860,60 @@ func testCodecRpcOne(t *testing.T, rr Rpc, h Handle, doRequest bool, exitSleepMs return } +func doTestMapEncodeForCanonical(t *testing.T, name string, h Handle) { + v1 := map[string]interface{}{ + "a": 1, + "b": "hello", + "c": map[string]interface{}{ + "c/a": 1, + "c/b": "world", + "c/c": []int{1, 2, 3, 4}, + "c/d": map[string]interface{}{ + "c/d/a": "fdisajfoidsajfopdjsaopfjdsapofda", + "c/d/b": "fdsafjdposakfodpsakfopdsakfpodsakfpodksaopfkdsopafkdopsa", + "c/d/c": "poir02 ir30qif4p03qir0pogjfpoaerfgjp ofke[padfk[ewapf kdp[afep[aw", + "c/d/d": "fdsopafkd[sa f-32qor-=4qeof -afo-erfo r-eafo 4e- o r4-qwo ag", + "c/d/e": "kfep[a sfkr0[paf[a foe-[wq ewpfao-q ro3-q ro-4qof4-qor 3-e orfkropzjbvoisdb", + "c/d/f": "", + }, + "c/e": map[int]string{ + 1: "1", + 22: "22", + 333: "333", + 4444: "4444", + 55555: "55555", + }, + "c/f": map[string]int{ + "1": 1, + "22": 22, + "333": 333, + "4444": 4444, + "55555": 55555, + }, + }, + } + var v2 map[string]interface{} + var b1, b2 []byte + + // encode v1 into b1, decode b1 into v2, encode v2 into b2, compare b1 and b2 + + bh := h.getBasicHandle() + canonical0 := bh.Canonical + bh.Canonical = true + defer func() { bh.Canonical = canonical0 }() + + e1 := NewEncoderBytes(&b1, h) + e1.MustEncode(v1) + d1 := NewDecoderBytes(b1, h) + d1.MustDecode(&v2) + e2 := NewEncoderBytes(&b2, h) + e2.MustEncode(v2) + if !bytes.Equal(b1, b2) { + logT(t, "Unequal bytes: %v VS %v", b1, b2) + t.FailNow() + } +} + // Comprehensive testing that generates data encoded from python handle (cbor, msgpack), // and validates that our code can read and write it out accordingly. // We keep this unexported here, and put actual test in ext_dep_test.go. @@ -1048,6 +1102,10 @@ func TestCborCodecsEmbeddedPointer(t *testing.T) { testCodecEmbeddedPointer(t, testCborH) } +func TestCborMapEncodeForCanonical(t *testing.T) { + doTestMapEncodeForCanonical(t, "cbor", testCborH) +} + func TestJsonCodecsTable(t *testing.T) { testCodecTableOne(t, testJsonH) } diff --git a/Godeps/_workspace/src/github.com/ugorji/go/codec/codecgen/gen.go b/Godeps/_workspace/src/github.com/ugorji/go/codec/codecgen/gen.go index 0a32b6cb3daa..582ba4443491 100644 --- a/Godeps/_workspace/src/github.com/ugorji/go/codec/codecgen/gen.go +++ b/Godeps/_workspace/src/github.com/ugorji/go/codec/codecgen/gen.go @@ -1,5 +1,5 @@ // Copyright (c) 2012-2015 Ugorji Nwoke. All rights reserved. -// Use of this source code is governed by a BSD-style license found in the LICENSE file. +// Use of this source code is governed by a MIT license found in the LICENSE file. // codecgen generates codec.Selfer implementations for a set of types. package main @@ -14,6 +14,7 @@ import ( "go/build" "go/parser" "go/token" + "math/rand" "os" "os/exec" "path/filepath" @@ -23,6 +24,8 @@ import ( "time" ) +const genCodecPkg = "codec1978" // keep this in sync with codec.genCodecPkg + const genFrunMainTmpl = `//+build ignore package main @@ -45,6 +48,7 @@ import ( "os" "reflect" "bytes" + "strings" "go/format" ) @@ -69,7 +73,7 @@ func CodecGenTempWrite{{ .RandString }}() { var t{{ $index }} {{ . }} typs = append(typs, reflect.TypeOf(t{{ $index }})) {{ end }} - {{ if not .CodecPkgFiles }}{{ .CodecPkgName }}.{{ end }}Gen(&out, "{{ .BuildTag }}", "{{ .PackageName }}", {{ .UseUnsafe }}, typs...) + {{ if not .CodecPkgFiles }}{{ .CodecPkgName }}.{{ end }}Gen(&out, "{{ .BuildTag }}", "{{ .PackageName }}", "{{ .RandString }}", {{ .UseUnsafe }}, {{ if not .CodecPkgFiles }}{{ .CodecPkgName }}.{{ end }}NewTypeInfos(strings.Split("{{ .StructTags }}", ",")), typs...) bout, err := format.Source(out.Bytes()) if err != nil { fout.Write(out.Bytes()) @@ -89,8 +93,8 @@ func CodecGenTempWrite{{ .RandString }}() { // Tool then executes: "go run __frun__" which creates fout. // fout contains Codec(En|De)codeSelf implementations for every type T. // -func Generate(outfile, buildTag, codecPkgPath string, useUnsafe bool, goRunTag string, - regexName *regexp.Regexp, deleteTempFile bool, infiles ...string) (err error) { +func Generate(outfile, buildTag, codecPkgPath string, uid int64, useUnsafe bool, goRunTag string, + st string, regexName *regexp.Regexp, deleteTempFile bool, infiles ...string) (err error) { // For each file, grab AST, find each type, and write a call to it. if len(infiles) == 0 { return @@ -99,6 +103,13 @@ func Generate(outfile, buildTag, codecPkgPath string, useUnsafe bool, goRunTag s err = errors.New("outfile and codec package path cannot be blank") return } + if uid < 0 { + uid = -uid + } + if uid == 0 { + rr := rand.New(rand.NewSource(time.Now().UnixNano())) + uid = 101 + rr.Int63n(9777) + } // We have to parse dir for package, before opening the temp file for writing (else ImportDir fails). // Also, ImportDir(...) must take an absolute path. lastdir := filepath.Dir(outfile) @@ -118,17 +129,19 @@ func Generate(outfile, buildTag, codecPkgPath string, useUnsafe bool, goRunTag s PackageName string RandString string BuildTag string + StructTags string Types []string CodecPkgFiles bool UseUnsafe bool } tv := tmplT{ - CodecPkgName: "codec1978", + CodecPkgName: genCodecPkg, OutFile: outfile, CodecImportPath: codecPkgPath, BuildTag: buildTag, UseUnsafe: useUnsafe, - RandString: strconv.FormatInt(time.Now().UnixNano(), 10), + RandString: strconv.FormatInt(uid, 10), + StructTags: st, } tv.ImportPath = pkg.ImportPath if tv.ImportPath == tv.CodecImportPath { @@ -259,11 +272,12 @@ func main() { t := flag.String("t", "", "build tag to put in file") r := flag.String("r", ".*", "regex for type name to match") rt := flag.String("rt", "", "tags for go run") + st := flag.String("st", "codec,json", "struct tag keys to introspect") x := flag.Bool("x", false, "keep temp file") u := flag.Bool("u", false, "Use unsafe, e.g. to avoid unnecessary allocation on []byte->string") - + d := flag.Int64("d", 0, "random identifier for use in generated code") flag.Parse() - if err := Generate(*o, *t, *c, *u, *rt, + if err := Generate(*o, *t, *c, *d, *u, *rt, *st, regexp.MustCompile(*r), !*x, flag.Args()...); err != nil { fmt.Fprintf(os.Stderr, "codecgen error: %v\n", err) os.Exit(1) diff --git a/Godeps/_workspace/src/github.com/ugorji/go/codec/codecgen_test.go b/Godeps/_workspace/src/github.com/ugorji/go/codec/codecgen_test.go index 2fdfd161d151..bb7e0bfcfeb3 100644 --- a/Godeps/_workspace/src/github.com/ugorji/go/codec/codecgen_test.go +++ b/Godeps/_workspace/src/github.com/ugorji/go/codec/codecgen_test.go @@ -8,6 +8,7 @@ import ( ) func TestCodecgenJson1(t *testing.T) { + // This is just a simplistic test for codecgen. const callCodecgenDirect bool = true v := newTestStruc(2, false, !testSkipIntf, false) var bs []byte diff --git a/Godeps/_workspace/src/github.com/ugorji/go/codec/decode.go b/Godeps/_workspace/src/github.com/ugorji/go/codec/decode.go index d6c0c6d18e0d..d068cf61e274 100644 --- a/Godeps/_workspace/src/github.com/ugorji/go/codec/decode.go +++ b/Godeps/_workspace/src/github.com/ugorji/go/codec/decode.go @@ -1,5 +1,5 @@ // Copyright (c) 2012-2015 Ugorji Nwoke. All rights reserved. -// Use of this source code is governed by a BSD-style license found in the LICENSE file. +// Use of this source code is governed by a MIT license found in the LICENSE file. package codec @@ -25,10 +25,6 @@ var ( // decReader abstracts the reading source, allowing implementations that can // read from an io.Reader or directly off a byte slice with zero-copying. type decReader interface { - // TODO: - // Add method to get num bytes read. - // This will be used to annotate errors, so user knows at what point the error occurred. - unreadn1() // readx will use the implementation scratch buffer if possible i.e. n < len(scratchbuf), OR @@ -38,6 +34,9 @@ type decReader interface { readb([]byte) readn1() uint8 readn1eof() (v uint8, eof bool) + numread() int // number of bytes read + track() + stopTrack() []byte } type decReaderByteScanner interface { @@ -79,20 +78,13 @@ type decDriver interface { // decodeExt(verifyTag bool, tag byte) (xtag byte, xbs []byte) ReadMapStart() int ReadArrayStart() int - ReadMapEnd() - ReadArrayEnd() - ReadArrayEntrySeparator() - ReadMapEntrySeparator() - ReadMapKVSeparator() + // ReadEnd registers the end of a map or array. + ReadEnd() } type decNoSeparator struct{} -func (_ decNoSeparator) ReadMapEnd() {} -func (_ decNoSeparator) ReadArrayEnd() {} -func (_ decNoSeparator) ReadArrayEntrySeparator() {} -func (_ decNoSeparator) ReadMapEntrySeparator() {} -func (_ decNoSeparator) ReadMapKVSeparator() {} +func (_ decNoSeparator) ReadEnd() {} type DecodeOptions struct { // MapType specifies type to use during schema-less decoding of a map in the stream. @@ -114,6 +106,14 @@ type DecodeOptions struct { // If SignedInteger, use the int64 during schema-less decoding of unsigned values (not uint64). SignedInteger bool + + // MaxInitLen defines the initial length that we "make" a collection (slice, chan or map) with. + // If 0 or negative, we default to a sensible value based on the size of an element in the collection. + // + // For example, when decoding, a stream may say that it has MAX_UINT elements. + // We should not auto-matically provision a slice of that length, to prevent Out-Of-Memory crash. + // Instead, we provision up to MaxInitLen, fill that up, and start appending after that. + MaxInitLen int } // ------------------------------------ @@ -181,8 +181,15 @@ type ioDecReader struct { br decReaderByteScanner // temp byte array re-used internally for efficiency during read. // shares buffer with Decoder, so we keep size of struct within 8 words. - x *[scratchByteArrayLen]byte - bs ioDecByteScanner + x *[scratchByteArrayLen]byte + bs ioDecByteScanner + n int // num read + tr []byte // tracking bytes read + trb bool +} + +func (z *ioDecReader) numread() int { + return z.n } func (z *ioDecReader) readx(n int) (bs []byte) { @@ -197,6 +204,10 @@ func (z *ioDecReader) readx(n int) (bs []byte) { if _, err := io.ReadAtLeast(z.br, bs, n); err != nil { panic(err) } + z.n += len(bs) + if z.trb { + z.tr = append(z.tr, bs...) + } return } @@ -204,9 +215,14 @@ func (z *ioDecReader) readb(bs []byte) { if len(bs) == 0 { return } - if _, err := io.ReadAtLeast(z.br, bs, len(bs)); err != nil { + n, err := io.ReadAtLeast(z.br, bs, len(bs)) + z.n += n + if err != nil { panic(err) } + if z.trb { + z.tr = append(z.tr, bs...) + } } func (z *ioDecReader) readn1() (b uint8) { @@ -214,12 +230,20 @@ func (z *ioDecReader) readn1() (b uint8) { if err != nil { panic(err) } + z.n++ + if z.trb { + z.tr = append(z.tr, b) + } return b } func (z *ioDecReader) readn1eof() (b uint8, eof bool) { b, err := z.br.ReadByte() if err == nil { + z.n++ + if z.trb { + z.tr = append(z.tr, b) + } } else if err == io.EOF { eof = true } else { @@ -229,9 +253,28 @@ func (z *ioDecReader) readn1eof() (b uint8, eof bool) { } func (z *ioDecReader) unreadn1() { - if err := z.br.UnreadByte(); err != nil { + err := z.br.UnreadByte() + if err != nil { panic(err) } + z.n-- + if z.trb { + if l := len(z.tr) - 1; l >= 0 { + z.tr = z.tr[:l] + } + } +} + +func (z *ioDecReader) track() { + if z.tr != nil { + z.tr = z.tr[:0] + } + z.trb = true +} + +func (z *ioDecReader) stopTrack() (bs []byte) { + z.trb = false + return z.tr } // ------------------------------------ @@ -243,6 +286,11 @@ type bytesDecReader struct { b []byte // data c int // cursor a int // available + t int // track start +} + +func (z *bytesDecReader) numread() int { + return z.c } func (z *bytesDecReader) unreadn1() { @@ -298,9 +346,17 @@ func (z *bytesDecReader) readb(bs []byte) { copy(bs, z.readx(len(bs))) } +func (z *bytesDecReader) track() { + z.t = z.c +} + +func (z *bytesDecReader) stopTrack() (bs []byte) { + return z.b[z.t:z.c] +} + // ------------------------------------ -type decFnInfoX struct { +type decFnInfo struct { d *Decoder ti *typeInfo xfFn Ext @@ -308,40 +364,26 @@ type decFnInfoX struct { seq seqType } -// decFnInfo has methods for handling decoding of a specific type -// based on some characteristics (builtin, extension, reflect Kind, etc) -type decFnInfo struct { - // use decFnInfo as a value receiver. - // keep most of it less-used variables accessible via a pointer (*decFnInfoX). - // As sweet spot for value-receiver is 3 words, keep everything except - // decDriver (which everyone needs) directly accessible. - // ensure decFnInfoX is set for everyone who needs it i.e. - // rawExt, ext, builtin, (selfer|binary|text)Marshal, kSlice, kStruct, kMap, kInterface, fastpath - - dd decDriver - *decFnInfoX -} - // ---------------------------------------- type decFn struct { i decFnInfo - f func(decFnInfo, reflect.Value) + f func(*decFnInfo, reflect.Value) } -func (f decFnInfo) builtin(rv reflect.Value) { - f.dd.DecodeBuiltin(f.ti.rtid, rv.Addr().Interface()) +func (f *decFnInfo) builtin(rv reflect.Value) { + f.d.d.DecodeBuiltin(f.ti.rtid, rv.Addr().Interface()) } -func (f decFnInfo) rawExt(rv reflect.Value) { - f.dd.DecodeExt(rv.Addr().Interface(), 0, nil) +func (f *decFnInfo) rawExt(rv reflect.Value) { + f.d.d.DecodeExt(rv.Addr().Interface(), 0, nil) } -func (f decFnInfo) ext(rv reflect.Value) { - f.dd.DecodeExt(rv.Addr().Interface(), f.xfTag, f.xfFn) +func (f *decFnInfo) ext(rv reflect.Value) { + f.d.d.DecodeExt(rv.Addr().Interface(), f.xfTag, f.xfFn) } -func (f decFnInfo) getValueForUnmarshalInterface(rv reflect.Value, indir int8) (v interface{}) { +func (f *decFnInfo) getValueForUnmarshalInterface(rv reflect.Value, indir int8) (v interface{}) { if indir == -1 { v = rv.Addr().Interface() } else if indir == 0 { @@ -358,95 +400,105 @@ func (f decFnInfo) getValueForUnmarshalInterface(rv reflect.Value, indir int8) ( return } -func (f decFnInfo) selferUnmarshal(rv reflect.Value) { +func (f *decFnInfo) selferUnmarshal(rv reflect.Value) { f.getValueForUnmarshalInterface(rv, f.ti.csIndir).(Selfer).CodecDecodeSelf(f.d) } -func (f decFnInfo) binaryUnmarshal(rv reflect.Value) { +func (f *decFnInfo) binaryUnmarshal(rv reflect.Value) { bm := f.getValueForUnmarshalInterface(rv, f.ti.bunmIndir).(encoding.BinaryUnmarshaler) - xbs := f.dd.DecodeBytes(nil, false, true) + xbs := f.d.d.DecodeBytes(nil, false, true) if fnerr := bm.UnmarshalBinary(xbs); fnerr != nil { panic(fnerr) } } -func (f decFnInfo) textUnmarshal(rv reflect.Value) { +func (f *decFnInfo) textUnmarshal(rv reflect.Value) { tm := f.getValueForUnmarshalInterface(rv, f.ti.tunmIndir).(encoding.TextUnmarshaler) - fnerr := tm.UnmarshalText(f.dd.DecodeBytes(f.d.b[:], true, true)) - // fnerr := tm.UnmarshalText(f.dd.DecodeStringAsBytes(f.d.b[:])) + fnerr := tm.UnmarshalText(f.d.d.DecodeBytes(f.d.b[:], true, true)) + if fnerr != nil { + panic(fnerr) + } +} - // var fnerr error - // if sb, sbok := f.dd.(decDriverStringAsBytes); sbok { - // fnerr = tm.UnmarshalText(sb.decStringAsBytes(f.d.b[:0])) - // } else { - // fnerr = tm.UnmarshalText([]byte(f.dd.decodeString())) - // } +func (f *decFnInfo) jsonUnmarshal(rv reflect.Value) { + tm := f.getValueForUnmarshalInterface(rv, f.ti.junmIndir).(jsonUnmarshaler) + // bs := f.d.d.DecodeBytes(f.d.b[:], true, true) + // grab the bytes to be read, as UnmarshalJSON wants the full JSON to unmarshal it itself. + f.d.r.track() + f.d.swallow() + bs := f.d.r.stopTrack() + // fmt.Printf(">>>>>> REFLECTION JSON: %s\n", bs) + fnerr := tm.UnmarshalJSON(bs) if fnerr != nil { panic(fnerr) } } -func (f decFnInfo) kErr(rv reflect.Value) { +func (f *decFnInfo) kErr(rv reflect.Value) { f.d.errorf("no decoding function defined for kind %v", rv.Kind()) } -func (f decFnInfo) kString(rv reflect.Value) { - rv.SetString(f.dd.DecodeString()) +func (f *decFnInfo) kString(rv reflect.Value) { + rv.SetString(f.d.d.DecodeString()) +} + +func (f *decFnInfo) kBool(rv reflect.Value) { + rv.SetBool(f.d.d.DecodeBool()) } -func (f decFnInfo) kBool(rv reflect.Value) { - rv.SetBool(f.dd.DecodeBool()) +func (f *decFnInfo) kInt(rv reflect.Value) { + rv.SetInt(f.d.d.DecodeInt(intBitsize)) } -func (f decFnInfo) kInt(rv reflect.Value) { - rv.SetInt(f.dd.DecodeInt(intBitsize)) +func (f *decFnInfo) kInt64(rv reflect.Value) { + rv.SetInt(f.d.d.DecodeInt(64)) } -func (f decFnInfo) kInt64(rv reflect.Value) { - rv.SetInt(f.dd.DecodeInt(64)) +func (f *decFnInfo) kInt32(rv reflect.Value) { + rv.SetInt(f.d.d.DecodeInt(32)) } -func (f decFnInfo) kInt32(rv reflect.Value) { - rv.SetInt(f.dd.DecodeInt(32)) +func (f *decFnInfo) kInt8(rv reflect.Value) { + rv.SetInt(f.d.d.DecodeInt(8)) } -func (f decFnInfo) kInt8(rv reflect.Value) { - rv.SetInt(f.dd.DecodeInt(8)) +func (f *decFnInfo) kInt16(rv reflect.Value) { + rv.SetInt(f.d.d.DecodeInt(16)) } -func (f decFnInfo) kInt16(rv reflect.Value) { - rv.SetInt(f.dd.DecodeInt(16)) +func (f *decFnInfo) kFloat32(rv reflect.Value) { + rv.SetFloat(f.d.d.DecodeFloat(true)) } -func (f decFnInfo) kFloat32(rv reflect.Value) { - rv.SetFloat(f.dd.DecodeFloat(true)) +func (f *decFnInfo) kFloat64(rv reflect.Value) { + rv.SetFloat(f.d.d.DecodeFloat(false)) } -func (f decFnInfo) kFloat64(rv reflect.Value) { - rv.SetFloat(f.dd.DecodeFloat(false)) +func (f *decFnInfo) kUint8(rv reflect.Value) { + rv.SetUint(f.d.d.DecodeUint(8)) } -func (f decFnInfo) kUint8(rv reflect.Value) { - rv.SetUint(f.dd.DecodeUint(8)) +func (f *decFnInfo) kUint64(rv reflect.Value) { + rv.SetUint(f.d.d.DecodeUint(64)) } -func (f decFnInfo) kUint64(rv reflect.Value) { - rv.SetUint(f.dd.DecodeUint(64)) +func (f *decFnInfo) kUint(rv reflect.Value) { + rv.SetUint(f.d.d.DecodeUint(uintBitsize)) } -func (f decFnInfo) kUint(rv reflect.Value) { - rv.SetUint(f.dd.DecodeUint(uintBitsize)) +func (f *decFnInfo) kUintptr(rv reflect.Value) { + rv.SetUint(f.d.d.DecodeUint(uintBitsize)) } -func (f decFnInfo) kUint32(rv reflect.Value) { - rv.SetUint(f.dd.DecodeUint(32)) +func (f *decFnInfo) kUint32(rv reflect.Value) { + rv.SetUint(f.d.d.DecodeUint(32)) } -func (f decFnInfo) kUint16(rv reflect.Value) { - rv.SetUint(f.dd.DecodeUint(16)) +func (f *decFnInfo) kUint16(rv reflect.Value) { + rv.SetUint(f.d.d.DecodeUint(16)) } -// func (f decFnInfo) kPtr(rv reflect.Value) { +// func (f *decFnInfo) kPtr(rv reflect.Value) { // debugf(">>>>>>> ??? decode kPtr called - shouldn't get called") // if rv.IsNil() { // rv.Set(reflect.New(rv.Type().Elem())) @@ -456,11 +508,11 @@ func (f decFnInfo) kUint16(rv reflect.Value) { // var kIntfCtr uint64 -func (f decFnInfo) kInterfaceNaked() (rvn reflect.Value) { +func (f *decFnInfo) kInterfaceNaked() (rvn reflect.Value) { // nil interface: // use some hieristics to decode it appropriately // based on the detected next value in the stream. - v, vt, decodeFurther := f.dd.DecodeNaked() + v, vt, decodeFurther := f.d.d.DecodeNaked() if vt == valueTypeNil { return } @@ -506,7 +558,7 @@ func (f decFnInfo) kInterfaceNaked() (rvn reflect.Value) { } if decodeFurther { if useRvn { - f.d.decodeValue(rvn, decFn{}) + f.d.decodeValue(rvn, nil) } else if v != nil { // this v is a pointer, so we need to dereference it when done f.d.decode(v) @@ -521,7 +573,7 @@ func (f decFnInfo) kInterfaceNaked() (rvn reflect.Value) { return } -func (f decFnInfo) kInterface(rv reflect.Value) { +func (f *decFnInfo) kInterface(rv reflect.Value) { // debugf("\t===> kInterface") // Note: @@ -543,69 +595,66 @@ func (f decFnInfo) kInterface(rv reflect.Value) { // we just decode into it. // Else we create a settable value, decode into it, and set on the interface. if rve.CanSet() { - f.d.decodeValue(rve, decFn{}) + f.d.decodeValue(rve, nil) } else { rve2 := reflect.New(rve.Type()).Elem() rve2.Set(rve) - f.d.decodeValue(rve2, decFn{}) + f.d.decodeValue(rve2, nil) rv.Set(rve2) } } } -func (f decFnInfo) kStruct(rv reflect.Value) { +func (f *decFnInfo) kStruct(rv reflect.Value) { fti := f.ti d := f.d - if f.dd.IsContainerType(valueTypeMap) { - containerLen := f.dd.ReadMapStart() + dd := d.d + if dd.IsContainerType(valueTypeMap) { + containerLen := dd.ReadMapStart() if containerLen == 0 { - f.dd.ReadMapEnd() + dd.ReadEnd() return } tisfi := fti.sfi hasLen := containerLen >= 0 if hasLen { for j := 0; j < containerLen; j++ { - // rvkencname := f.dd.DecodeString() - rvkencname := stringView(f.dd.DecodeBytes(f.d.b[:], true, true)) + // rvkencname := dd.DecodeString() + rvkencname := stringView(dd.DecodeBytes(f.d.b[:], true, true)) // rvksi := ti.getForEncName(rvkencname) if k := fti.indexForEncName(rvkencname); k > -1 { si := tisfi[k] - if f.dd.TryDecodeAsNil() { + if dd.TryDecodeAsNil() { si.setToZeroValue(rv) } else { - d.decodeValue(si.field(rv, true), decFn{}) + d.decodeValue(si.field(rv, true), nil) } } else { d.structFieldNotFound(-1, rvkencname) } } } else { - for j := 0; !f.dd.CheckBreak(); j++ { - if j > 0 { - f.dd.ReadMapEntrySeparator() - } - // rvkencname := f.dd.DecodeString() - rvkencname := stringView(f.dd.DecodeBytes(f.d.b[:], true, true)) - f.dd.ReadMapKVSeparator() + for j := 0; !dd.CheckBreak(); j++ { + // rvkencname := dd.DecodeString() + rvkencname := stringView(dd.DecodeBytes(f.d.b[:], true, true)) // rvksi := ti.getForEncName(rvkencname) if k := fti.indexForEncName(rvkencname); k > -1 { si := tisfi[k] - if f.dd.TryDecodeAsNil() { + if dd.TryDecodeAsNil() { si.setToZeroValue(rv) } else { - d.decodeValue(si.field(rv, true), decFn{}) + d.decodeValue(si.field(rv, true), nil) } } else { d.structFieldNotFound(-1, rvkencname) } } - f.dd.ReadMapEnd() + dd.ReadEnd() } - } else if f.dd.IsContainerType(valueTypeArray) { - containerLen := f.dd.ReadArrayStart() + } else if dd.IsContainerType(valueTypeArray) { + containerLen := dd.ReadArrayStart() if containerLen == 0 { - f.dd.ReadArrayEnd() + dd.ReadEnd() return } // Not much gain from doing it two ways for array. @@ -616,55 +665,47 @@ func (f decFnInfo) kStruct(rv reflect.Value) { if j == containerLen { break } - } else if f.dd.CheckBreak() { + } else if dd.CheckBreak() { break } - if j > 0 { - f.dd.ReadArrayEntrySeparator() - } - if f.dd.TryDecodeAsNil() { + if dd.TryDecodeAsNil() { si.setToZeroValue(rv) } else { - d.decodeValue(si.field(rv, true), decFn{}) + d.decodeValue(si.field(rv, true), nil) } - // if si.i != -1 { - // d.decodeValue(rv.Field(int(si.i)), decFn{}) - // } else { - // d.decEmbeddedField(rv, si.is) - // } } if containerLen > len(fti.sfip) { // read remaining values and throw away for j := len(fti.sfip); j < containerLen; j++ { - if j > 0 { - f.dd.ReadArrayEntrySeparator() - } d.structFieldNotFound(j, "") } } - f.dd.ReadArrayEnd() + dd.ReadEnd() } else { f.d.error(onlyMapOrArrayCanDecodeIntoStructErr) return } } -func (f decFnInfo) kSlice(rv reflect.Value) { +func (f *decFnInfo) kSlice(rv reflect.Value) { // A slice can be set from a map or array in stream. // This way, the order can be kept (as order is lost with map). ti := f.ti d := f.d - if f.dd.IsContainerType(valueTypeBytes) || f.dd.IsContainerType(valueTypeString) { - if ti.rtid == uint8SliceTypId || ti.rt.Elem().Kind() == reflect.Uint8 { + dd := d.d + rtelem0 := ti.rt.Elem() + + if dd.IsContainerType(valueTypeBytes) || dd.IsContainerType(valueTypeString) { + if ti.rtid == uint8SliceTypId || rtelem0.Kind() == reflect.Uint8 { if f.seq == seqTypeChan { - bs2 := f.dd.DecodeBytes(nil, false, true) + bs2 := dd.DecodeBytes(nil, false, true) ch := rv.Interface().(chan<- byte) for _, b := range bs2 { ch <- b } } else { rvbs := rv.Bytes() - bs2 := f.dd.DecodeBytes(rvbs, false, false) + bs2 := dd.DecodeBytes(rvbs, false, false) if rvbs == nil && bs2 != nil || rvbs != nil && bs2 == nil || len(bs2) != len(rvbs) { if rv.CanSet() { rv.SetBytes(bs2) @@ -681,88 +722,102 @@ func (f decFnInfo) kSlice(rv reflect.Value) { slh, containerLenS := d.decSliceHelperStart() + var rvlen, numToRead int + var truncated bool // says that the len of the sequence is not same as the expected number of elements. + + numToRead = containerLenS // if truncated, reset numToRead + // an array can never return a nil slice. so no need to check f.array here. if rv.IsNil() { // either chan or slice + if rvlen, truncated = decInferLen(containerLenS, f.d.h.MaxInitLen, int(rtelem0.Size())); truncated { + numToRead = rvlen + } if f.seq == seqTypeSlice { - if containerLenS <= 0 { - rv.Set(reflect.MakeSlice(ti.rt, 0, 0)) - } else { - rv.Set(reflect.MakeSlice(ti.rt, containerLenS, containerLenS)) - } + rv.Set(reflect.MakeSlice(ti.rt, rvlen, rvlen)) } else if f.seq == seqTypeChan { - if containerLenS <= 0 { - rv.Set(reflect.MakeChan(ti.rt, 0)) - } else { - rv.Set(reflect.MakeChan(ti.rt, containerLenS)) - } + rv.Set(reflect.MakeChan(ti.rt, rvlen)) } + } else { + rvlen = rv.Len() } - rvlen := rv.Len() if containerLenS == 0 { if f.seq == seqTypeSlice && rvlen != 0 { rv.SetLen(0) } - // slh.End() // f.dd.ReadArrayEnd() + // dd.ReadEnd() return } - rtelem0 := ti.rt.Elem() rtelem := rtelem0 for rtelem.Kind() == reflect.Ptr { rtelem = rtelem.Elem() } fn := d.getDecFn(rtelem, true, true) - rv0 := rv + var rv0, rv9 reflect.Value + rv0 = rv rvChanged := false rvcap := rv.Cap() // for j := 0; j < containerLenS; j++ { - hasLen := containerLenS >= 0 - if hasLen { + if containerLenS >= 0 { // hasLen if f.seq == seqTypeChan { // handle chan specially: for j := 0; j < containerLenS; j++ { - rv0 := reflect.New(rtelem0).Elem() - d.decodeValue(rv0, fn) - rv.Send(rv0) + rv9 = reflect.New(rtelem0).Elem() + d.decodeValue(rv9, fn) + rv.Send(rv9) } - } else { - numToRead := containerLenS + } else { // slice or array if containerLenS > rvcap { if f.seq == seqTypeArray { - d.arrayCannotExpand(rv.Len(), containerLenS) - numToRead = rvlen + d.arrayCannotExpand(rvlen, containerLenS) } else { - rv = reflect.MakeSlice(ti.rt, containerLenS, containerLenS) - if rvlen > 0 && !isMutableKind(ti.rt.Kind()) { - rv1 := rv0 - rv1.SetLen(rvcap) - reflect.Copy(rv, rv1) + oldRvlenGtZero := rvlen > 0 + rvlen, truncated = decInferLen(containerLenS, f.d.h.MaxInitLen, int(rtelem0.Size())) + rv = reflect.MakeSlice(ti.rt, rvlen, rvlen) + if oldRvlenGtZero && !isImmutableKind(rtelem0.Kind()) { + reflect.Copy(rv, rv0) // only copy up to length NOT cap i.e. rv0.Slice(0, rvcap) } rvChanged = true - rvlen = containerLenS } + numToRead = rvlen } else if containerLenS != rvlen { - rv.SetLen(containerLenS) - rvlen = containerLenS + if f.seq == seqTypeSlice { + rv.SetLen(containerLenS) + rvlen = containerLenS + } } j := 0 + // we read up to the numToRead for ; j < numToRead; j++ { d.decodeValue(rv.Index(j), fn) } + + // if slice, expand and read up to containerLenS (or EOF) iff truncated + // if array, swallow all the rest. + if f.seq == seqTypeArray { for ; j < containerLenS; j++ { d.swallow() } + } else if truncated { // slice was truncated, as chan NOT in this block + for ; j < containerLenS; j++ { + rv = expandSliceValue(rv, 1) + rv9 = rv.Index(j) + if resetSliceElemToZeroValue { + rv9.Set(reflect.Zero(rtelem0)) + } + d.decodeValue(rv9, fn) + } } } } else { - for j := 0; !f.dd.CheckBreak(); j++ { + for j := 0; !dd.CheckBreak(); j++ { var decodeIntoBlank bool // if indefinite, etc, then expand the slice if necessary if j >= rvlen { @@ -770,22 +825,27 @@ func (f decFnInfo) kSlice(rv reflect.Value) { d.arrayCannotExpand(rvlen, j+1) decodeIntoBlank = true } else if f.seq == seqTypeSlice { - rv = reflect.Append(rv, reflect.Zero(rtelem0)) + // rv = reflect.Append(rv, reflect.Zero(rtelem0)) // uses append logic, plus varargs + rv = expandSliceValue(rv, 1) + rv9 = rv.Index(j) + // rv.Index(rv.Len() - 1).Set(reflect.Zero(rtelem0)) + if resetSliceElemToZeroValue { + rv9.Set(reflect.Zero(rtelem0)) + } rvlen++ rvChanged = true } - } - if j > 0 { - slh.Sep(j) + } else if f.seq != seqTypeChan { // slice or array + rv9 = rv.Index(j) } if f.seq == seqTypeChan { - rv0 := reflect.New(rtelem0).Elem() - d.decodeValue(rv0, fn) - rv.Send(rv0) + rv9 = reflect.New(rtelem0).Elem() + d.decodeValue(rv9, fn) + rv.Send(rv9) } else if decodeIntoBlank { d.swallow() - } else { - d.decodeValue(rv.Index(j), fn) + } else { // seqTypeSlice + d.decodeValue(rv9, fn) } } slh.End() @@ -796,13 +856,15 @@ func (f decFnInfo) kSlice(rv reflect.Value) { } } -func (f decFnInfo) kArray(rv reflect.Value) { +func (f *decFnInfo) kArray(rv reflect.Value) { // f.d.decodeValue(rv.Slice(0, rv.Len())) f.kSlice(rv.Slice(0, rv.Len())) } -func (f decFnInfo) kMap(rv reflect.Value) { - containerLen := f.dd.ReadMapStart() +func (f *decFnInfo) kMap(rv reflect.Value) { + d := f.d + dd := d.d + containerLen := dd.ReadMapStart() ti := f.ti if rv.IsNil() { @@ -810,15 +872,14 @@ func (f decFnInfo) kMap(rv reflect.Value) { } if containerLen == 0 { - // f.dd.ReadMapEnd() + // It is not length-prefix style container. They have no End marker. + // dd.ReadMapEnd() return } - d := f.d - ktype, vtype := ti.rt.Key(), ti.rt.Elem() ktypeId := reflect.ValueOf(ktype).Pointer() - var keyFn, valFn decFn + var keyFn, valFn *decFn var xtyp reflect.Type for xtyp = ktype; xtyp.Kind() == reflect.Ptr; xtyp = xtyp.Elem() { } @@ -848,10 +909,7 @@ func (f decFnInfo) kMap(rv reflect.Value) { rv.SetMapIndex(rvk, rvv) } } else { - for j := 0; !f.dd.CheckBreak(); j++ { - if j > 0 { - f.dd.ReadMapEntrySeparator() - } + for j := 0; !dd.CheckBreak(); j++ { rvk := reflect.New(ktype).Elem() d.decodeValue(rvk, keyFn) @@ -866,15 +924,14 @@ func (f decFnInfo) kMap(rv reflect.Value) { if !rvv.IsValid() { rvv = reflect.New(vtype).Elem() } - f.dd.ReadMapKVSeparator() d.decodeValue(rvv, valFn) rv.SetMapIndex(rvk, rvv) } - f.dd.ReadMapEnd() + dd.ReadEnd() } } -type rtidDecFn struct { +type decRtidFn struct { rtid uintptr fn decFn } @@ -885,19 +942,22 @@ type Decoder struct { // Try to put things that go together to fit within a cache line (8 words). d decDriver + // NOTE: Decoder shouldn't call it's read methods, + // as the handler MAY need to do some coordination. r decReader - //sa [32]rtidDecFn - s []rtidDecFn + // sa [initCollectionCap]decRtidFn + s []decRtidFn h *BasicHandle rb bytesDecReader hh Handle be bool // is binary encoding bytes bool // is bytes reader + js bool // is json handle ri ioDecReader - f map[uintptr]decFn - _ uintptr // for alignment purposes, so next one starts from a cache line + f map[uintptr]*decFn + // _ uintptr // for alignment purposes, so next one starts from a cache line b [scratchByteArrayLen]byte } @@ -908,7 +968,7 @@ type Decoder struct { // (eg bufio.Reader, bytes.Buffer). func NewDecoder(r io.Reader, h Handle) (d *Decoder) { d = &Decoder{hh: h, h: h.getBasicHandle(), be: h.isBinary()} - //d.s = d.sa[:0] + // d.s = d.sa[:0] d.ri.x = &d.b d.ri.bs.r = r var ok bool @@ -917,6 +977,7 @@ func NewDecoder(r io.Reader, h Handle) (d *Decoder) { d.ri.br = &d.ri.bs } d.r = &d.ri + _, d.js = h.(*JsonHandle) d.d = h.newDecDriver(d) return } @@ -925,10 +986,11 @@ func NewDecoder(r io.Reader, h Handle) (d *Decoder) { // from a byte slice with zero copying. func NewDecoderBytes(in []byte, h Handle) (d *Decoder) { d = &Decoder{hh: h, h: h.getBasicHandle(), be: h.isBinary(), bytes: true} - //d.s = d.sa[:0] + // d.s = d.sa[:0] d.rb.b = in d.rb.a = len(in) d.r = &d.rb + _, d.js = h.(*JsonHandle) d.d = h.newDecDriver(d) // d.d = h.newDecDriver(decReaderT{true, &d.rb, &d.ri}) return @@ -993,7 +1055,7 @@ func (d *Decoder) Decode(v interface{}) (err error) { // this is not a smart swallow, as it allocates objects and does unnecessary work. func (d *Decoder) swallowViaHammer() { var blank interface{} - d.decodeValue(reflect.ValueOf(&blank).Elem(), decFn{}) + d.decodeValue(reflect.ValueOf(&blank).Elem(), nil) } func (d *Decoder) swallow() { @@ -1012,14 +1074,10 @@ func (d *Decoder) swallow() { } else if dd.CheckBreak() { break } - if j > 0 { - dd.ReadMapEntrySeparator() - } d.swallow() - dd.ReadMapKVSeparator() d.swallow() } - dd.ReadMapEnd() + dd.ReadEnd() case dd.IsContainerType(valueTypeArray): containerLenS := dd.ReadArrayStart() clenGtEqualZero := containerLenS >= 0 @@ -1031,12 +1089,9 @@ func (d *Decoder) swallow() { } else if dd.CheckBreak() { break } - if j > 0 { - dd.ReadArrayEntrySeparator() - } d.swallow() } - dd.ReadArrayEnd() + dd.ReadEnd() case dd.IsContainerType(valueTypeBytes): dd.DecodeBytes(d.b[:], false, true) case dd.IsContainerType(valueTypeString): @@ -1120,7 +1175,7 @@ func (d *Decoder) decode(iv interface{}) { case reflect.Value: d.chkPtrValue(v) - d.decodeValueNotNil(v.Elem(), decFn{}) + d.decodeValueNotNil(v.Elem(), nil) case *string: @@ -1155,7 +1210,7 @@ func (d *Decoder) decode(iv interface{}) { *v = d.d.DecodeBytes(*v, false, false) case *interface{}: - d.decodeValueNotNil(reflect.ValueOf(iv).Elem(), decFn{}) + d.decodeValueNotNil(reflect.ValueOf(iv).Elem(), nil) default: if !fastpathDecodeTypeSwitch(iv, d) { @@ -1194,29 +1249,29 @@ func (d *Decoder) decodeI(iv interface{}, checkPtr, tryNil, checkFastpath, check rv, proceed := d.preDecodeValue(rv, tryNil) if proceed { fn := d.getDecFn(rv.Type(), checkFastpath, checkCodecSelfer) - fn.f(fn.i, rv) + fn.f(&fn.i, rv) } } -func (d *Decoder) decodeValue(rv reflect.Value, fn decFn) { +func (d *Decoder) decodeValue(rv reflect.Value, fn *decFn) { if rv, proceed := d.preDecodeValue(rv, true); proceed { - if fn.f == nil { + if fn == nil { fn = d.getDecFn(rv.Type(), true, true) } - fn.f(fn.i, rv) + fn.f(&fn.i, rv) } } -func (d *Decoder) decodeValueNotNil(rv reflect.Value, fn decFn) { +func (d *Decoder) decodeValueNotNil(rv reflect.Value, fn *decFn) { if rv, proceed := d.preDecodeValue(rv, false); proceed { - if fn.f == nil { + if fn == nil { fn = d.getDecFn(rv.Type(), true, true) } - fn.f(fn.i, rv) + fn.f(&fn.i, rv) } } -func (d *Decoder) getDecFn(rt reflect.Type, checkFastpath, checkCodecSelfer bool) (fn decFn) { +func (d *Decoder) getDecFn(rt reflect.Type, checkFastpath, checkCodecSelfer bool) (fn *decFn) { rtid := reflect.ValueOf(rt).Pointer() // retrieve or register a focus'ed function for this type @@ -1227,9 +1282,10 @@ func (d *Decoder) getDecFn(rt reflect.Type, checkFastpath, checkCodecSelfer bool if useMapForCodecCache { fn, ok = d.f[rtid] } else { - for _, v := range d.s { + for i := range d.s { + v := &(d.s[i]) if v.rtid == rtid { - fn, ok = v.fn, true + fn, ok = &(v.fn), true break } } @@ -1238,11 +1294,25 @@ func (d *Decoder) getDecFn(rt reflect.Type, checkFastpath, checkCodecSelfer bool return } + if useMapForCodecCache { + if d.f == nil { + d.f = make(map[uintptr]*decFn, initCollectionCap) + } + fn = new(decFn) + d.f[rtid] = fn + } else { + if d.s == nil { + d.s = make([]decRtidFn, 0, initCollectionCap) + } + d.s = append(d.s, decRtidFn{rtid: rtid}) + fn = &(d.s[len(d.s)-1]).fn + } + // debugf("\tCreating new dec fn for type: %v\n", rt) - ti := getTypeInfo(rtid, rt) - var fi decFnInfo - fi.dd = d.d - // fi.decFnInfoX = new(decFnInfoX) + ti := d.h.getTypeInfo(rtid, rt) + fi := &(fn.i) + fi.d = d + fi.ti = ti // An extension can be registered for any type, regardless of the Kind // (e.g. type BitSet int64, type MyStruct { / * unexported fields * / }, type X []int, etc. @@ -1254,31 +1324,26 @@ func (d *Decoder) getDecFn(rt reflect.Type, checkFastpath, checkCodecSelfer bool // NOTE: if decoding into a nil interface{}, we return a non-nil // value except even if the container registers a length of 0. if checkCodecSelfer && ti.cs { - fi.decFnInfoX = &decFnInfoX{d: d, ti: ti} - fn.f = (decFnInfo).selferUnmarshal + fn.f = (*decFnInfo).selferUnmarshal } else if rtid == rawExtTypId { - fi.decFnInfoX = &decFnInfoX{d: d, ti: ti} - fn.f = (decFnInfo).rawExt + fn.f = (*decFnInfo).rawExt } else if d.d.IsBuiltinType(rtid) { - fi.decFnInfoX = &decFnInfoX{d: d, ti: ti} - fn.f = (decFnInfo).builtin + fn.f = (*decFnInfo).builtin } else if xfFn := d.h.getExt(rtid); xfFn != nil { - // fi.decFnInfoX = &decFnInfoX{xfTag: xfFn.tag, xfFn: xfFn.ext} - fi.decFnInfoX = &decFnInfoX{d: d, ti: ti} fi.xfTag, fi.xfFn = xfFn.tag, xfFn.ext - fn.f = (decFnInfo).ext + fn.f = (*decFnInfo).ext } else if supportMarshalInterfaces && d.be && ti.bunm { - fi.decFnInfoX = &decFnInfoX{d: d, ti: ti} - fn.f = (decFnInfo).binaryUnmarshal + fn.f = (*decFnInfo).binaryUnmarshal + } else if supportMarshalInterfaces && !d.be && d.js && ti.junm { + //If JSON, we should check JSONUnmarshal before textUnmarshal + fn.f = (*decFnInfo).jsonUnmarshal } else if supportMarshalInterfaces && !d.be && ti.tunm { - fi.decFnInfoX = &decFnInfoX{d: d, ti: ti} - fn.f = (decFnInfo).textUnmarshal + fn.f = (*decFnInfo).textUnmarshal } else { rk := rt.Kind() if fastpathEnabled && checkFastpath && (rk == reflect.Map || rk == reflect.Slice) { if rt.PkgPath() == "" { if idx := fastpathAV.index(rtid); idx != -1 { - fi.decFnInfoX = &decFnInfoX{d: d, ti: ti} fn.f = fastpathAV[idx].decfn } } else { @@ -1294,8 +1359,7 @@ func (d *Decoder) getDecFn(rt reflect.Type, checkFastpath, checkCodecSelfer bool if idx := fastpathAV.index(rtuid); idx != -1 { xfnf := fastpathAV[idx].decfn xrt := fastpathAV[idx].rt - fi.decFnInfoX = &decFnInfoX{d: d, ti: ti} - fn.f = func(xf decFnInfo, xrv reflect.Value) { + fn.f = func(xf *decFnInfo, xrv reflect.Value) { // xfnf(xf, xrv.Convert(xrt)) xfnf(xf, xrv.Addr().Convert(reflect.PtrTo(xrt)).Elem()) } @@ -1305,72 +1369,58 @@ func (d *Decoder) getDecFn(rt reflect.Type, checkFastpath, checkCodecSelfer bool if fn.f == nil { switch rk { case reflect.String: - fn.f = (decFnInfo).kString + fn.f = (*decFnInfo).kString case reflect.Bool: - fn.f = (decFnInfo).kBool + fn.f = (*decFnInfo).kBool case reflect.Int: - fn.f = (decFnInfo).kInt + fn.f = (*decFnInfo).kInt case reflect.Int64: - fn.f = (decFnInfo).kInt64 + fn.f = (*decFnInfo).kInt64 case reflect.Int32: - fn.f = (decFnInfo).kInt32 + fn.f = (*decFnInfo).kInt32 case reflect.Int8: - fn.f = (decFnInfo).kInt8 + fn.f = (*decFnInfo).kInt8 case reflect.Int16: - fn.f = (decFnInfo).kInt16 + fn.f = (*decFnInfo).kInt16 case reflect.Float32: - fn.f = (decFnInfo).kFloat32 + fn.f = (*decFnInfo).kFloat32 case reflect.Float64: - fn.f = (decFnInfo).kFloat64 + fn.f = (*decFnInfo).kFloat64 case reflect.Uint8: - fn.f = (decFnInfo).kUint8 + fn.f = (*decFnInfo).kUint8 case reflect.Uint64: - fn.f = (decFnInfo).kUint64 + fn.f = (*decFnInfo).kUint64 case reflect.Uint: - fn.f = (decFnInfo).kUint + fn.f = (*decFnInfo).kUint case reflect.Uint32: - fn.f = (decFnInfo).kUint32 + fn.f = (*decFnInfo).kUint32 case reflect.Uint16: - fn.f = (decFnInfo).kUint16 + fn.f = (*decFnInfo).kUint16 // case reflect.Ptr: - // fn.f = (decFnInfo).kPtr + // fn.f = (*decFnInfo).kPtr + case reflect.Uintptr: + fn.f = (*decFnInfo).kUintptr case reflect.Interface: - fi.decFnInfoX = &decFnInfoX{d: d, ti: ti} - fn.f = (decFnInfo).kInterface + fn.f = (*decFnInfo).kInterface case reflect.Struct: - fi.decFnInfoX = &decFnInfoX{d: d, ti: ti} - fn.f = (decFnInfo).kStruct + fn.f = (*decFnInfo).kStruct case reflect.Chan: - fi.decFnInfoX = &decFnInfoX{d: d, ti: ti, seq: seqTypeChan} - fn.f = (decFnInfo).kSlice + fi.seq = seqTypeChan + fn.f = (*decFnInfo).kSlice case reflect.Slice: - fi.decFnInfoX = &decFnInfoX{d: d, ti: ti, seq: seqTypeSlice} - fn.f = (decFnInfo).kSlice + fi.seq = seqTypeSlice + fn.f = (*decFnInfo).kSlice case reflect.Array: - // fi.decFnInfoX = &decFnInfoX{array: true} - fi.decFnInfoX = &decFnInfoX{d: d, ti: ti, seq: seqTypeArray} - fn.f = (decFnInfo).kArray + fi.seq = seqTypeArray + fn.f = (*decFnInfo).kArray case reflect.Map: - fi.decFnInfoX = &decFnInfoX{d: d, ti: ti} - fn.f = (decFnInfo).kMap + fn.f = (*decFnInfo).kMap default: - fn.f = (decFnInfo).kErr + fn.f = (*decFnInfo).kErr } } } - fn.i = fi - if useMapForCodecCache { - if d.f == nil { - d.f = make(map[uintptr]decFn, 32) - } - d.f[rtid] = fn - } else { - if d.s == nil { - d.s = make([]rtidDecFn, 0, 32) - } - d.s = append(d.s, rtidDecFn{rtid, fn}) - } return } @@ -1415,7 +1465,10 @@ func (d *Decoder) error(err error) { } func (d *Decoder) errorf(format string, params ...interface{}) { - err := fmt.Errorf(format, params...) + params2 := make([]interface{}, len(params)+1) + params2[0] = d.r.numread() + copy(params2[1:], params) + err := fmt.Errorf("[pos %d]: "+format, params2...) panic(err) } @@ -1442,30 +1495,10 @@ func (d *Decoder) decSliceHelperStart() (x decSliceHelper, clen int) { return } -func (x decSliceHelper) Sep(index int) { - if x.ct == valueTypeArray { - x.dd.ReadArrayEntrySeparator() - } else { - if index%2 == 0 { - x.dd.ReadMapEntrySeparator() - } else { - x.dd.ReadMapKVSeparator() - } - } -} - func (x decSliceHelper) End() { - if x.ct == valueTypeArray { - x.dd.ReadArrayEnd() - } else { - x.dd.ReadMapEnd() - } + x.dd.ReadEnd() } -// func decErr(format string, params ...interface{}) { -// doPanic(msgTagDec, format, params...) -// } - func decByteSlice(r decReader, clen int, bs []byte) (bsOut []byte) { if clen == 0 { return zeroByteSlice @@ -1496,6 +1529,46 @@ func detachZeroCopyBytes(isBytesReader bool, dest []byte, in []byte) (out []byte return in } +// decInferLen will infer a sensible length, given the following: +// - clen: length wanted. +// - maxlen: max length to be returned. +// if <= 0, it is unset, and we infer it based on the unit size +// - unit: number of bytes for each element of the collection +func decInferLen(clen, maxlen, unit int) (rvlen int, truncated bool) { + // handle when maxlen is not set i.e. <= 0 + if clen <= 0 { + return + } + if maxlen <= 0 { + // no maxlen defined. Use maximum of 256K memory, with a floor of 4K items. + // maxlen = 256 * 1024 / unit + // if maxlen < (4 * 1024) { + // maxlen = 4 * 1024 + // } + if unit < (256 / 4) { + maxlen = 256 * 1024 / unit + } else { + maxlen = 4 * 1024 + } + } + if clen > maxlen { + rvlen = maxlen + truncated = true + } else { + rvlen = clen + } + return + // if clen <= 0 { + // rvlen = 0 + // } else if maxlen > 0 && clen > maxlen { + // rvlen = maxlen + // truncated = true + // } else { + // rvlen = clen + // } + // return +} + // // implement overall decReader wrapping both, for possible use inline: // type decReaderT struct { // bytes bool @@ -1514,37 +1587,5 @@ func detachZeroCopyBytes(isBytesReader bool, dest []byte, in []byte) (out []byte // d.ri.unreadn1() // } // } - -// func (d *Decoder) readb(b []byte) { -// if d.bytes { -// d.rb.readb(b) -// } else { -// d.ri.readb(b) -// } -// } - -// func (d *Decoder) readx(n int) []byte { -// if d.bytes { -// return d.rb.readx(n) -// } else { -// return d.ri.readx(n) -// } -// } - -// func (d *Decoder) readn1() uint8 { -// if d.bytes { -// return d.rb.readn1() -// } else { -// return d.ri.readn1() -// } -// } - -// func (d *Decoder) readn1eof() (v uint8, eof bool) { -// if d.bytes { -// return d.rb.readn1eof() -// } else { -// return d.ri.readn1eof() -// } -// } - -// var _ decReader = (*Decoder)(nil) // decReaderT{} // +// ... for other methods of decReader. +// Testing showed that performance improvement was negligible. diff --git a/Godeps/_workspace/src/github.com/ugorji/go/codec/encode.go b/Godeps/_workspace/src/github.com/ugorji/go/codec/encode.go index 803c9d1827db..9f1def5dc7ce 100644 --- a/Godeps/_workspace/src/github.com/ugorji/go/codec/encode.go +++ b/Godeps/_workspace/src/github.com/ugorji/go/codec/encode.go @@ -1,12 +1,11 @@ // Copyright (c) 2012-2015 Ugorji Nwoke. All rights reserved. -// Use of this source code is governed by a BSD-style license found in the LICENSE file. +// Use of this source code is governed by a MIT license found in the LICENSE file. package codec import ( "bytes" "encoding" - "errors" "fmt" "io" "reflect" @@ -63,12 +62,8 @@ type encDriver interface { EncodeRawExt(re *RawExt, e *Encoder) EncodeExt(v interface{}, xtag uint64, ext Ext, e *Encoder) EncodeArrayStart(length int) - EncodeArrayEnd() - EncodeArrayEntrySeparator() EncodeMapStart(length int) - EncodeMapEnd() - EncodeMapEntrySeparator() - EncodeMapKVSeparator() + EncodeEnd() EncodeString(c charEncoding, v string) EncodeSymbol(v string) EncodeStringBytes(c charEncoding, v []byte) @@ -77,13 +72,13 @@ type encDriver interface { //encStringRunes(c charEncoding, v []rune) } +type encDriverAsis interface { + EncodeAsis(v []byte) +} + type encNoSeparator struct{} -func (_ encNoSeparator) EncodeMapEnd() {} -func (_ encNoSeparator) EncodeArrayEnd() {} -func (_ encNoSeparator) EncodeArrayEntrySeparator() {} -func (_ encNoSeparator) EncodeMapEntrySeparator() {} -func (_ encNoSeparator) EncodeMapKVSeparator() {} +func (_ encNoSeparator) EncodeEnd() {} type encStructFieldBytesV struct { b []byte @@ -113,8 +108,9 @@ type EncodeOptions struct { // Canonical representation means that encoding a value will always result in the same // sequence of bytes. // - // This mostly will apply to maps. In this case, codec will do more work to encode the - // map keys out of band, and then sort them, before writing out the map to the stream. + // This only affects maps, as the iteration order for maps is random. + // In this case, the map keys will first be encoded into []byte, and then sorted, + // before writing the sorted keys and the corresponding map values to the stream. Canonical bool // AsSymbols defines what should be encoded as symbols. @@ -249,10 +245,10 @@ func (z *bytesEncWriter) grow(n int) (oldcursor int) { z.c = oldcursor + n if z.c > len(z.b) { if z.c > cap(z.b) { - // Tried using appendslice logic: (if cap < 1024, *2, else *1.25). - // However, it was too expensive, causing too many iterations of copy. - // Using bytes.Buffer model was much better (2*cap + n) - bs := make([]byte, 2*cap(z.b)+n) + // appendslice logic (if cap < 1024, *2, else *1.25): more expensive. many copy calls. + // bytes.Buffer model (2*cap + n): much better + // bs := make([]byte, 2*cap(z.b)+n) + bs := make([]byte, growCap(cap(z.b), 1, n)) copy(bs, z.b[:oldcursor]) z.b = bs } else { @@ -264,7 +260,7 @@ func (z *bytesEncWriter) grow(n int) (oldcursor int) { // --------------------------------------------- -type encFnInfoX struct { +type encFnInfo struct { e *Encoder ti *typeInfo xfFn Ext @@ -272,25 +268,13 @@ type encFnInfoX struct { seq seqType } -type encFnInfo struct { - // use encFnInfo as a value receiver. - // keep most of it less-used variables accessible via a pointer (*encFnInfoX). - // As sweet spot for value-receiver is 3 words, keep everything except - // encDriver (which everyone needs) directly accessible. - // ensure encFnInfoX is set for everyone who needs it i.e. - // rawExt, ext, builtin, (selfer|binary|text)Marshal, kSlice, kStruct, kMap, kInterface, fastpath - - ee encDriver - *encFnInfoX +func (f *encFnInfo) builtin(rv reflect.Value) { + f.e.e.EncodeBuiltin(f.ti.rtid, rv.Interface()) } -func (f encFnInfo) builtin(rv reflect.Value) { - f.ee.EncodeBuiltin(f.ti.rtid, rv.Interface()) -} - -func (f encFnInfo) rawExt(rv reflect.Value) { +func (f *encFnInfo) rawExt(rv reflect.Value) { // rev := rv.Interface().(RawExt) - // f.ee.EncodeRawExt(&rev, f.e) + // f.e.e.EncodeRawExt(&rev, f.e) var re *RawExt if rv.CanAddr() { re = rv.Addr().Interface().(*RawExt) @@ -298,26 +282,35 @@ func (f encFnInfo) rawExt(rv reflect.Value) { rev := rv.Interface().(RawExt) re = &rev } - f.ee.EncodeRawExt(re, f.e) + f.e.e.EncodeRawExt(re, f.e) } -func (f encFnInfo) ext(rv reflect.Value) { - // if this is a struct and it was addressable, then pass the address directly (not the value) - if rv.CanAddr() && rv.Kind() == reflect.Struct { +func (f *encFnInfo) ext(rv reflect.Value) { + // if this is a struct|array and it was addressable, then pass the address directly (not the value) + if k := rv.Kind(); (k == reflect.Struct || k == reflect.Array) && rv.CanAddr() { rv = rv.Addr() } - f.ee.EncodeExt(rv.Interface(), f.xfTag, f.xfFn, f.e) + f.e.e.EncodeExt(rv.Interface(), f.xfTag, f.xfFn, f.e) } -func (f encFnInfo) getValueForMarshalInterface(rv reflect.Value, indir int8) (v interface{}, proceed bool) { +func (f *encFnInfo) getValueForMarshalInterface(rv reflect.Value, indir int8) (v interface{}, proceed bool) { if indir == 0 { v = rv.Interface() } else if indir == -1 { - v = rv.Addr().Interface() + // If a non-pointer was passed to Encode(), then that value is not addressable. + // Take addr if addresable, else copy value to an addressable value. + if rv.CanAddr() { + v = rv.Addr().Interface() + } else { + rv2 := reflect.New(rv.Type()) + rv2.Elem().Set(rv) + v = rv2.Interface() + // fmt.Printf("rv.Type: %v, rv2.Type: %v, v: %v\n", rv.Type(), rv2.Type(), v) + } } else { for j := int8(0); j < indir; j++ { if rv.IsNil() { - f.ee.EncodeNil() + f.e.e.EncodeNil() return } rv = rv.Elem() @@ -327,74 +320,67 @@ func (f encFnInfo) getValueForMarshalInterface(rv reflect.Value, indir int8) (v return v, true } -func (f encFnInfo) selferMarshal(rv reflect.Value) { +func (f *encFnInfo) selferMarshal(rv reflect.Value) { if v, proceed := f.getValueForMarshalInterface(rv, f.ti.csIndir); proceed { v.(Selfer).CodecEncodeSelf(f.e) } } -func (f encFnInfo) binaryMarshal(rv reflect.Value) { +func (f *encFnInfo) binaryMarshal(rv reflect.Value) { if v, proceed := f.getValueForMarshalInterface(rv, f.ti.bmIndir); proceed { bs, fnerr := v.(encoding.BinaryMarshaler).MarshalBinary() - if fnerr != nil { - panic(fnerr) - } - if bs == nil { - f.ee.EncodeNil() - } else { - f.ee.EncodeStringBytes(c_RAW, bs) - } + f.e.marshal(bs, fnerr, false, c_RAW) } } -func (f encFnInfo) textMarshal(rv reflect.Value) { +func (f *encFnInfo) textMarshal(rv reflect.Value) { if v, proceed := f.getValueForMarshalInterface(rv, f.ti.tmIndir); proceed { // debugf(">>>> encoding.TextMarshaler: %T", rv.Interface()) bs, fnerr := v.(encoding.TextMarshaler).MarshalText() - if fnerr != nil { - panic(fnerr) - } - if bs == nil { - f.ee.EncodeNil() - } else { - f.ee.EncodeStringBytes(c_UTF8, bs) - } + f.e.marshal(bs, fnerr, false, c_UTF8) } } -func (f encFnInfo) kBool(rv reflect.Value) { - f.ee.EncodeBool(rv.Bool()) +func (f *encFnInfo) jsonMarshal(rv reflect.Value) { + if v, proceed := f.getValueForMarshalInterface(rv, f.ti.jmIndir); proceed { + bs, fnerr := v.(jsonMarshaler).MarshalJSON() + f.e.marshal(bs, fnerr, true, c_UTF8) + } +} + +func (f *encFnInfo) kBool(rv reflect.Value) { + f.e.e.EncodeBool(rv.Bool()) } -func (f encFnInfo) kString(rv reflect.Value) { - f.ee.EncodeString(c_UTF8, rv.String()) +func (f *encFnInfo) kString(rv reflect.Value) { + f.e.e.EncodeString(c_UTF8, rv.String()) } -func (f encFnInfo) kFloat64(rv reflect.Value) { - f.ee.EncodeFloat64(rv.Float()) +func (f *encFnInfo) kFloat64(rv reflect.Value) { + f.e.e.EncodeFloat64(rv.Float()) } -func (f encFnInfo) kFloat32(rv reflect.Value) { - f.ee.EncodeFloat32(float32(rv.Float())) +func (f *encFnInfo) kFloat32(rv reflect.Value) { + f.e.e.EncodeFloat32(float32(rv.Float())) } -func (f encFnInfo) kInt(rv reflect.Value) { - f.ee.EncodeInt(rv.Int()) +func (f *encFnInfo) kInt(rv reflect.Value) { + f.e.e.EncodeInt(rv.Int()) } -func (f encFnInfo) kUint(rv reflect.Value) { - f.ee.EncodeUint(rv.Uint()) +func (f *encFnInfo) kUint(rv reflect.Value) { + f.e.e.EncodeUint(rv.Uint()) } -func (f encFnInfo) kInvalid(rv reflect.Value) { - f.ee.EncodeNil() +func (f *encFnInfo) kInvalid(rv reflect.Value) { + f.e.e.EncodeNil() } -func (f encFnInfo) kErr(rv reflect.Value) { +func (f *encFnInfo) kErr(rv reflect.Value) { f.e.errorf("unsupported kind %s, for %#v", rv.Kind(), rv) } -func (f encFnInfo) kSlice(rv reflect.Value) { +func (f *encFnInfo) kSlice(rv reflect.Value) { ti := f.ti // array may be non-addressable, so we have to manage with care // (don't call rv.Bytes, rv.Slice, etc). @@ -402,13 +388,13 @@ func (f encFnInfo) kSlice(rv reflect.Value) { // Encode(S{}) will bomb on "panic: slice of unaddressable array". if f.seq != seqTypeArray { if rv.IsNil() { - f.ee.EncodeNil() + f.e.e.EncodeNil() return } // If in this method, then there was no extension function defined. // So it's okay to treat as []byte. if ti.rtid == uint8SliceTypId { - f.ee.EncodeStringBytes(c_RAW, rv.Bytes()) + f.e.e.EncodeStringBytes(c_RAW, rv.Bytes()) return } } @@ -417,9 +403,9 @@ func (f encFnInfo) kSlice(rv reflect.Value) { if rtelem.Kind() == reflect.Uint8 { switch f.seq { case seqTypeArray: - // if l == 0 { f.ee.encodeStringBytes(c_RAW, nil) } else + // if l == 0 { f.e.e.encodeStringBytes(c_RAW, nil) } else if rv.CanAddr() { - f.ee.EncodeStringBytes(c_RAW, rv.Slice(0, l).Bytes()) + f.e.e.EncodeStringBytes(c_RAW, rv.Slice(0, l).Bytes()) } else { var bs []byte if l <= cap(f.e.b) { @@ -432,10 +418,10 @@ func (f encFnInfo) kSlice(rv reflect.Value) { // for i := 0; i < l; i++ { // bs[i] = byte(rv.Index(i).Uint()) // } - f.ee.EncodeStringBytes(c_RAW, bs) + f.e.e.EncodeStringBytes(c_RAW, bs) } case seqTypeSlice: - f.ee.EncodeStringBytes(c_RAW, rv.Bytes()) + f.e.e.EncodeStringBytes(c_RAW, rv.Bytes()) case seqTypeChan: bs := f.e.b[:0] // do not use range, so that the number of elements encoded @@ -447,7 +433,7 @@ func (f encFnInfo) kSlice(rv reflect.Value) { for i := 0; i < l; i++ { bs = append(bs, <-ch) } - f.ee.EncodeStringBytes(c_RAW, bs) + f.e.e.EncodeStringBytes(c_RAW, bs) } return } @@ -457,13 +443,12 @@ func (f encFnInfo) kSlice(rv reflect.Value) { f.e.errorf("mapBySlice requires even slice length, but got %v", l) return } - f.ee.EncodeMapStart(l / 2) + f.e.e.EncodeMapStart(l / 2) } else { - f.ee.EncodeArrayStart(l) + f.e.e.EncodeArrayStart(l) } e := f.e - sep := !e.be if l > 0 { for rtelem.Kind() == reflect.Ptr { rtelem = rtelem.Elem() @@ -471,88 +456,38 @@ func (f encFnInfo) kSlice(rv reflect.Value) { // if kind is reflect.Interface, do not pre-determine the // encoding type, because preEncodeValue may break it down to // a concrete type and kInterface will bomb. - var fn encFn + var fn *encFn if rtelem.Kind() != reflect.Interface { rtelemid := reflect.ValueOf(rtelem).Pointer() fn = e.getEncFn(rtelemid, rtelem, true, true) } // TODO: Consider perf implication of encoding odd index values as symbols if type is string - if sep { - for j := 0; j < l; j++ { - if j > 0 { - if ti.mbs { - if j%2 == 0 { - f.ee.EncodeMapEntrySeparator() - } else { - f.ee.EncodeMapKVSeparator() - } - } else { - f.ee.EncodeArrayEntrySeparator() - } - } - if f.seq == seqTypeChan { - if rv2, ok2 := rv.Recv(); ok2 { - e.encodeValue(rv2, fn) - } - } else { - e.encodeValue(rv.Index(j), fn) - } - } - } else { - for j := 0; j < l; j++ { - if f.seq == seqTypeChan { - if rv2, ok2 := rv.Recv(); ok2 { - e.encodeValue(rv2, fn) - } - } else { - e.encodeValue(rv.Index(j), fn) + for j := 0; j < l; j++ { + if f.seq == seqTypeChan { + if rv2, ok2 := rv.Recv(); ok2 { + e.encodeValue(rv2, fn) } + } else { + e.encodeValue(rv.Index(j), fn) } } - } - if sep { - if ti.mbs { - f.ee.EncodeMapEnd() - } else { - f.ee.EncodeArrayEnd() - } } + + f.e.e.EncodeEnd() } -func (f encFnInfo) kStruct(rv reflect.Value) { +func (f *encFnInfo) kStruct(rv reflect.Value) { fti := f.ti e := f.e tisfi := fti.sfip toMap := !(fti.toArray || e.h.StructToArray) newlen := len(fti.sfi) + // Use sync.Pool to reduce allocating slices unnecessarily. // The cost of the occasional locking is less than the cost of locking. + pool, poolv, fkvs := encStructPoolGet(newlen) - var fkvs []encStructFieldKV - var pool *sync.Pool - var poolv interface{} - idxpool := newlen / 8 - if encStructPoolLen != 4 { - panic(errors.New("encStructPoolLen must be equal to 4")) // defensive, in case it is changed - } - if idxpool < encStructPoolLen { - pool = &encStructPool[idxpool] - poolv = pool.Get() - switch vv := poolv.(type) { - case *[8]encStructFieldKV: - fkvs = vv[:newlen] - case *[16]encStructFieldKV: - fkvs = vv[:newlen] - case *[32]encStructFieldKV: - fkvs = vv[:newlen] - case *[64]encStructFieldKV: - fkvs = vv[:newlen] - } - } - if fkvs == nil { - fkvs = make([]encStructFieldKV, newlen) - } // if toMap, use the sorted array. If toArray, use unsorted array (to match sequence in struct) if toMap { tisfi = fti.sfi @@ -587,60 +522,30 @@ func (f encFnInfo) kStruct(rv reflect.Value) { } // debugf(">>>> kStruct: newlen: %v", newlen) - sep := !e.be - ee := f.ee //don't dereference everytime - if sep { - if toMap { - ee.EncodeMapStart(newlen) - // asSymbols := e.h.AsSymbols&AsSymbolStructFieldNameFlag != 0 - asSymbols := e.h.AsSymbols == AsSymbolDefault || e.h.AsSymbols&AsSymbolStructFieldNameFlag != 0 - for j := 0; j < newlen; j++ { - kv = fkvs[j] - if j > 0 { - ee.EncodeMapEntrySeparator() - } - if asSymbols { - ee.EncodeSymbol(kv.k) - } else { - ee.EncodeString(c_UTF8, kv.k) - } - ee.EncodeMapKVSeparator() - e.encodeValue(kv.v, encFn{}) - } - ee.EncodeMapEnd() - } else { - ee.EncodeArrayStart(newlen) - for j := 0; j < newlen; j++ { - kv = fkvs[j] - if j > 0 { - ee.EncodeArrayEntrySeparator() - } - e.encodeValue(kv.v, encFn{}) + // sep := !e.be + ee := f.e.e //don't dereference everytime + + if toMap { + ee.EncodeMapStart(newlen) + // asSymbols := e.h.AsSymbols&AsSymbolStructFieldNameFlag != 0 + asSymbols := e.h.AsSymbols == AsSymbolDefault || e.h.AsSymbols&AsSymbolStructFieldNameFlag != 0 + for j := 0; j < newlen; j++ { + kv = fkvs[j] + if asSymbols { + ee.EncodeSymbol(kv.k) + } else { + ee.EncodeString(c_UTF8, kv.k) } - ee.EncodeArrayEnd() + e.encodeValue(kv.v, nil) } } else { - if toMap { - ee.EncodeMapStart(newlen) - // asSymbols := e.h.AsSymbols&AsSymbolStructFieldNameFlag != 0 - asSymbols := e.h.AsSymbols == AsSymbolDefault || e.h.AsSymbols&AsSymbolStructFieldNameFlag != 0 - for j := 0; j < newlen; j++ { - kv = fkvs[j] - if asSymbols { - ee.EncodeSymbol(kv.k) - } else { - ee.EncodeString(c_UTF8, kv.k) - } - e.encodeValue(kv.v, encFn{}) - } - } else { - ee.EncodeArrayStart(newlen) - for j := 0; j < newlen; j++ { - kv = fkvs[j] - e.encodeValue(kv.v, encFn{}) - } + ee.EncodeArrayStart(newlen) + for j := 0; j < newlen; j++ { + kv = fkvs[j] + e.encodeValue(kv.v, nil) } } + ee.EncodeEnd() // do not use defer. Instead, use explicit pool return at end of function. // defer has a cost we are trying to avoid. @@ -650,37 +555,35 @@ func (f encFnInfo) kStruct(rv reflect.Value) { } } -// func (f encFnInfo) kPtr(rv reflect.Value) { +// func (f *encFnInfo) kPtr(rv reflect.Value) { // debugf(">>>>>>> ??? encode kPtr called - shouldn't get called") // if rv.IsNil() { -// f.ee.encodeNil() +// f.e.e.encodeNil() // return // } // f.e.encodeValue(rv.Elem()) // } -func (f encFnInfo) kInterface(rv reflect.Value) { +func (f *encFnInfo) kInterface(rv reflect.Value) { if rv.IsNil() { - f.ee.EncodeNil() + f.e.e.EncodeNil() return } - f.e.encodeValue(rv.Elem(), encFn{}) + f.e.encodeValue(rv.Elem(), nil) } -func (f encFnInfo) kMap(rv reflect.Value) { +func (f *encFnInfo) kMap(rv reflect.Value) { + ee := f.e.e if rv.IsNil() { - f.ee.EncodeNil() + ee.EncodeNil() return } l := rv.Len() - f.ee.EncodeMapStart(l) + ee.EncodeMapStart(l) e := f.e - sep := !e.be if l == 0 { - if sep { - f.ee.EncodeMapEnd() - } + ee.EncodeEnd() return } var asSymbols bool @@ -691,7 +594,7 @@ func (f encFnInfo) kMap(rv reflect.Value) { // However, if kind is reflect.Interface, do not pre-determine the // encoding type, because preEncodeValue may break it down to // a concrete type and kInterface will bomb. - var keyFn, valFn encFn + var keyFn, valFn *encFn ti := f.ti rtkey := ti.rt.Key() rtval := ti.rt.Elem() @@ -718,11 +621,10 @@ func (f encFnInfo) kMap(rv reflect.Value) { } mks := rv.MapKeys() // for j, lmks := 0, len(mks); j < lmks; j++ { - ee := f.ee //don't dereference everytime if e.h.Canonical { // first encode each key to a []byte first, then sort them, then record // println(">>>>>>>> CANONICAL <<<<<<<<") - var mksv []byte // temporary byte slice for the encoding + var mksv []byte = make([]byte, 0, len(mks)*16) // temporary byte slice for the encoding e2 := NewEncoderBytes(&mksv, e.hh) mksbv := make([]encStructFieldBytesV, len(mks)) for i, k := range mks { @@ -730,35 +632,13 @@ func (f encFnInfo) kMap(rv reflect.Value) { e2.MustEncode(k) mksbv[i].v = k mksbv[i].b = mksv[l:] + // fmt.Printf(">>>>> %s\n", mksv[l:]) } sort.Sort(encStructFieldBytesVslice(mksbv)) for j := range mksbv { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - e.w.writeb(mksbv[j].b) - ee.EncodeMapKVSeparator() + e.asis(mksbv[j].b) e.encodeValue(rv.MapIndex(mksbv[j].v), valFn) } - ee.EncodeMapEnd() - } else if sep { - for j := range mks { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - if keyTypeIsString { - if asSymbols { - ee.EncodeSymbol(mks[j].String()) - } else { - ee.EncodeString(c_UTF8, mks[j].String()) - } - } else { - e.encodeValue(mks[j], keyFn) - } - ee.EncodeMapKVSeparator() - e.encodeValue(rv.MapIndex(mks[j]), valFn) - } - ee.EncodeMapEnd() } else { for j := range mks { if keyTypeIsString { @@ -773,6 +653,7 @@ func (f encFnInfo) kMap(rv reflect.Value) { e.encodeValue(rv.MapIndex(mks[j]), valFn) } } + ee.EncodeEnd() } // -------------------------------------------------- @@ -783,12 +664,12 @@ func (f encFnInfo) kMap(rv reflect.Value) { // instead of executing the checks every time. type encFn struct { i encFnInfo - f func(encFnInfo, reflect.Value) + f func(*encFnInfo, reflect.Value) } // -------------------------------------------------- -type rtidEncFn struct { +type encRtidFn struct { rtid uintptr fn encFn } @@ -796,17 +677,21 @@ type rtidEncFn struct { // An Encoder writes an object to an output stream in the codec format. type Encoder struct { // hopefully, reduce derefencing cost by laying the encWriter inside the Encoder - e encDriver + e encDriver + // NOTE: Encoder shouldn't call it's write methods, + // as the handler MAY need to do some coordination. w encWriter - s []rtidEncFn + s []encRtidFn be bool // is binary encoding + js bool // is json handle wi ioEncWriter wb bytesEncWriter h *BasicHandle + as encDriverAsis hh Handle - f map[uintptr]encFn + f map[uintptr]*encFn b [scratchByteArrayLen]byte } @@ -826,7 +711,9 @@ func NewEncoder(w io.Writer, h Handle) *Encoder { } e.wi.w = ww e.w = &e.wi + _, e.js = h.(*JsonHandle) e.e = h.newEncDriver(e) + e.as, _ = e.e.(encDriverAsis) return e } @@ -843,7 +730,9 @@ func NewEncoderBytes(out *[]byte, h Handle) *Encoder { } e.wb.b, e.wb.out = in, out e.w = &e.wb + _, e.js = h.(*JsonHandle) e.e = h.newEncDriver(e) + e.as, _ = e.e.(encDriverAsis) return e } @@ -873,8 +762,9 @@ func NewEncoderBytes(out *[]byte, h Handle) *Encoder { // The empty values (for omitempty option) are false, 0, any nil pointer // or interface value, and any array, slice, map, or string of length zero. // -// Anonymous fields are encoded inline if no struct tag is present. -// Else they are encoded as regular fields. +// Anonymous fields are encoded inline except: +// - the struct tag specifies a replacement name (first value) +// - the field is of an interface type // // Examples: // @@ -885,6 +775,9 @@ func NewEncoderBytes(out *[]byte, h Handle) *Encoder { // Field2 int `codec:"myName"` //Use key "myName" in encode stream // Field3 int32 `codec:",omitempty"` //use key "Field3". Omit if empty. // Field4 bool `codec:"f4,omitempty"` //use key "f4". Omit if empty. +// io.Reader //use key "Reader". +// MyStruct `codec:"my1" //use key "my1". +// MyStruct //inline it // ... // } // @@ -894,8 +787,9 @@ func NewEncoderBytes(out *[]byte, h Handle) *Encoder { // } // // The mode of encoding is based on the type of the value. When a value is seen: +// - If a Selfer, call its CodecEncodeSelf method // - If an extension is registered for it, call that extension function -// - If it implements BinaryMarshaler, call its MarshalBinary() (data []byte, err error) +// - If it implements encoding.(Binary|Text|JSON)Marshaler, call its Marshal(Binary|Text|JSON) method // - Else encode it based on its reflect.Kind // // Note that struct field names and keys in map[string]XXX will be treated as symbols. @@ -942,7 +836,7 @@ func (e *Encoder) encode(iv interface{}) { v.CodecEncodeSelf(e) case reflect.Value: - e.encodeValue(v, encFn{}) + e.encodeValue(v, nil) case string: e.e.EncodeString(c_UTF8, v) @@ -1010,12 +904,15 @@ func (e *Encoder) encode(iv interface{}) { default: // canonical mode is not supported for fastpath of maps (but is fine for slices) + const checkCodecSelfer1 = true // in case T is passed, where *T is a Selfer, still checkCodecSelfer if e.h.Canonical { if !fastpathEncodeTypeSwitchSlice(iv, e) { - e.encodeI(iv, false, false) + e.encodeI(iv, false, checkCodecSelfer1) + } + } else { + if !fastpathEncodeTypeSwitch(iv, e) { + e.encodeI(iv, false, checkCodecSelfer1) } - } else if !fastpathEncodeTypeSwitch(iv, e) { - e.encodeI(iv, false, false) } } } @@ -1025,7 +922,7 @@ func (e *Encoder) encodeI(iv interface{}, checkFastpath, checkCodecSelfer bool) rt := rv.Type() rtid := reflect.ValueOf(rt).Pointer() fn := e.getEncFn(rtid, rt, checkFastpath, checkCodecSelfer) - fn.f(fn.i, rv) + fn.f(&fn.i, rv) } } @@ -1055,27 +952,28 @@ LOOP: return rv, true } -func (e *Encoder) encodeValue(rv reflect.Value, fn encFn) { +func (e *Encoder) encodeValue(rv reflect.Value, fn *encFn) { // if a valid fn is passed, it MUST BE for the dereferenced type of rv if rv, proceed := e.preEncodeValue(rv); proceed { - if fn.f == nil { + if fn == nil { rt := rv.Type() rtid := reflect.ValueOf(rt).Pointer() fn = e.getEncFn(rtid, rt, true, true) } - fn.f(fn.i, rv) + fn.f(&fn.i, rv) } } -func (e *Encoder) getEncFn(rtid uintptr, rt reflect.Type, checkFastpath, checkCodecSelfer bool) (fn encFn) { +func (e *Encoder) getEncFn(rtid uintptr, rt reflect.Type, checkFastpath, checkCodecSelfer bool) (fn *encFn) { // rtid := reflect.ValueOf(rt).Pointer() var ok bool if useMapForCodecCache { fn, ok = e.f[rtid] } else { - for _, v := range e.s { + for i := range e.s { + v := &(e.s[i]) if v.rtid == rtid { - fn, ok = v.fn, true + fn, ok = &(v.fn), true break } } @@ -1083,37 +981,48 @@ func (e *Encoder) getEncFn(rtid uintptr, rt reflect.Type, checkFastpath, checkCo if ok { return } - // fi.encFnInfoX = new(encFnInfoX) - ti := getTypeInfo(rtid, rt) - var fi encFnInfo - fi.ee = e.e + + if useMapForCodecCache { + if e.f == nil { + e.f = make(map[uintptr]*encFn, initCollectionCap) + } + fn = new(encFn) + e.f[rtid] = fn + } else { + if e.s == nil { + e.s = make([]encRtidFn, 0, initCollectionCap) + } + e.s = append(e.s, encRtidFn{rtid: rtid}) + fn = &(e.s[len(e.s)-1]).fn + } + + ti := e.h.getTypeInfo(rtid, rt) + fi := &(fn.i) + fi.e = e + fi.ti = ti if checkCodecSelfer && ti.cs { - fi.encFnInfoX = &encFnInfoX{e: e, ti: ti} - fn.f = (encFnInfo).selferMarshal + fn.f = (*encFnInfo).selferMarshal } else if rtid == rawExtTypId { - fi.encFnInfoX = &encFnInfoX{e: e, ti: ti} - fn.f = (encFnInfo).rawExt + fn.f = (*encFnInfo).rawExt } else if e.e.IsBuiltinType(rtid) { - fi.encFnInfoX = &encFnInfoX{e: e, ti: ti} - fn.f = (encFnInfo).builtin + fn.f = (*encFnInfo).builtin } else if xfFn := e.h.getExt(rtid); xfFn != nil { - // fi.encFnInfoX = new(encFnInfoX) - fi.encFnInfoX = &encFnInfoX{e: e, ti: ti} fi.xfTag, fi.xfFn = xfFn.tag, xfFn.ext - fn.f = (encFnInfo).ext + fn.f = (*encFnInfo).ext } else if supportMarshalInterfaces && e.be && ti.bm { - fi.encFnInfoX = &encFnInfoX{e: e, ti: ti} - fn.f = (encFnInfo).binaryMarshal + fn.f = (*encFnInfo).binaryMarshal + } else if supportMarshalInterfaces && !e.be && e.js && ti.jm { + //If JSON, we should check JSONMarshal before textMarshal + fn.f = (*encFnInfo).jsonMarshal } else if supportMarshalInterfaces && !e.be && ti.tm { - fi.encFnInfoX = &encFnInfoX{e: e, ti: ti} - fn.f = (encFnInfo).textMarshal + fn.f = (*encFnInfo).textMarshal } else { rk := rt.Kind() - if fastpathEnabled && checkFastpath && (rk == reflect.Map || rk == reflect.Slice) { + // if fastpathEnabled && checkFastpath && (rk == reflect.Map || rk == reflect.Slice) { + if fastpathEnabled && checkFastpath && (rk == reflect.Slice || (rk == reflect.Map && !e.h.Canonical)) { if rt.PkgPath() == "" { if idx := fastpathAV.index(rtid); idx != -1 { - fi.encFnInfoX = &encFnInfoX{e: e, ti: ti} fn.f = fastpathAV[idx].encfn } } else { @@ -1129,8 +1038,7 @@ func (e *Encoder) getEncFn(rtid uintptr, rt reflect.Type, checkFastpath, checkCo if idx := fastpathAV.index(rtuid); idx != -1 { xfnf := fastpathAV[idx].encfn xrt := fastpathAV[idx].rt - fi.encFnInfoX = &encFnInfoX{e: e, ti: ti} - fn.f = func(xf encFnInfo, xrv reflect.Value) { + fn.f = func(xf *encFnInfo, xrv reflect.Value) { xfnf(xf, xrv.Convert(xrt)) } } @@ -1139,58 +1047,64 @@ func (e *Encoder) getEncFn(rtid uintptr, rt reflect.Type, checkFastpath, checkCo if fn.f == nil { switch rk { case reflect.Bool: - fn.f = (encFnInfo).kBool + fn.f = (*encFnInfo).kBool case reflect.String: - fn.f = (encFnInfo).kString + fn.f = (*encFnInfo).kString case reflect.Float64: - fn.f = (encFnInfo).kFloat64 + fn.f = (*encFnInfo).kFloat64 case reflect.Float32: - fn.f = (encFnInfo).kFloat32 + fn.f = (*encFnInfo).kFloat32 case reflect.Int, reflect.Int8, reflect.Int64, reflect.Int32, reflect.Int16: - fn.f = (encFnInfo).kInt - case reflect.Uint8, reflect.Uint64, reflect.Uint, reflect.Uint32, reflect.Uint16: - fn.f = (encFnInfo).kUint + fn.f = (*encFnInfo).kInt + case reflect.Uint8, reflect.Uint64, reflect.Uint, reflect.Uint32, reflect.Uint16, reflect.Uintptr: + fn.f = (*encFnInfo).kUint case reflect.Invalid: - fn.f = (encFnInfo).kInvalid + fn.f = (*encFnInfo).kInvalid case reflect.Chan: - fi.encFnInfoX = &encFnInfoX{e: e, ti: ti, seq: seqTypeChan} - fn.f = (encFnInfo).kSlice + fi.seq = seqTypeChan + fn.f = (*encFnInfo).kSlice case reflect.Slice: - fi.encFnInfoX = &encFnInfoX{e: e, ti: ti, seq: seqTypeSlice} - fn.f = (encFnInfo).kSlice + fi.seq = seqTypeSlice + fn.f = (*encFnInfo).kSlice case reflect.Array: - fi.encFnInfoX = &encFnInfoX{e: e, ti: ti, seq: seqTypeArray} - fn.f = (encFnInfo).kSlice + fi.seq = seqTypeArray + fn.f = (*encFnInfo).kSlice case reflect.Struct: - fi.encFnInfoX = &encFnInfoX{e: e, ti: ti} - fn.f = (encFnInfo).kStruct + fn.f = (*encFnInfo).kStruct // case reflect.Ptr: - // fn.f = (encFnInfo).kPtr + // fn.f = (*encFnInfo).kPtr case reflect.Interface: - fi.encFnInfoX = &encFnInfoX{e: e, ti: ti} - fn.f = (encFnInfo).kInterface + fn.f = (*encFnInfo).kInterface case reflect.Map: - fi.encFnInfoX = &encFnInfoX{e: e, ti: ti} - fn.f = (encFnInfo).kMap + fn.f = (*encFnInfo).kMap default: - fn.f = (encFnInfo).kErr + fn.f = (*encFnInfo).kErr } } } - fn.i = fi - if useMapForCodecCache { - if e.f == nil { - e.f = make(map[uintptr]encFn, 32) - } - e.f[rtid] = fn + return +} + +func (e *Encoder) marshal(bs []byte, fnerr error, asis bool, c charEncoding) { + if fnerr != nil { + panic(fnerr) + } + if bs == nil { + e.e.EncodeNil() + } else if asis { + e.asis(bs) } else { - if e.s == nil { - e.s = make([]rtidEncFn, 0, 32) - } - e.s = append(e.s, rtidEncFn{rtid, fn}) + e.e.EncodeStringBytes(c, bs) + } +} + +func (e *Encoder) asis(v []byte) { + if e.as == nil { + e.w.writeb(v) + } else { + e.as.EncodeAsis(v) } - return } func (e *Encoder) errorf(format string, params ...interface{}) { @@ -1205,7 +1119,7 @@ type encStructFieldKV struct { v reflect.Value } -const encStructPoolLen = 4 +const encStructPoolLen = 5 // encStructPool is an array of sync.Pool. // Each element of the array pools one of encStructPool(8|16|32|64). @@ -1223,6 +1137,57 @@ func init() { encStructPool[1].New = func() interface{} { return new([16]encStructFieldKV) } encStructPool[2].New = func() interface{} { return new([32]encStructFieldKV) } encStructPool[3].New = func() interface{} { return new([64]encStructFieldKV) } + encStructPool[4].New = func() interface{} { return new([128]encStructFieldKV) } +} + +func encStructPoolGet(newlen int) (p *sync.Pool, v interface{}, s []encStructFieldKV) { + // if encStructPoolLen != 5 { // constant chec, so removed at build time. + // panic(errors.New("encStructPoolLen must be equal to 4")) // defensive, in case it is changed + // } + // idxpool := newlen / 8 + + // if pool == nil { + // fkvs = make([]encStructFieldKV, newlen) + // } else { + // poolv = pool.Get() + // switch vv := poolv.(type) { + // case *[8]encStructFieldKV: + // fkvs = vv[:newlen] + // case *[16]encStructFieldKV: + // fkvs = vv[:newlen] + // case *[32]encStructFieldKV: + // fkvs = vv[:newlen] + // case *[64]encStructFieldKV: + // fkvs = vv[:newlen] + // case *[128]encStructFieldKV: + // fkvs = vv[:newlen] + // } + // } + + if newlen <= 8 { + p = &encStructPool[0] + v = p.Get() + s = v.(*[8]encStructFieldKV)[:newlen] + } else if newlen <= 16 { + p = &encStructPool[1] + v = p.Get() + s = v.(*[16]encStructFieldKV)[:newlen] + } else if newlen <= 32 { + p = &encStructPool[2] + v = p.Get() + s = v.(*[32]encStructFieldKV)[:newlen] + } else if newlen <= 64 { + p = &encStructPool[3] + v = p.Get() + s = v.(*[64]encStructFieldKV)[:newlen] + } else if newlen <= 128 { + p = &encStructPool[4] + v = p.Get() + s = v.(*[128]encStructFieldKV)[:newlen] + } else { + s = make([]encStructFieldKV, newlen) + } + return } // ---------------------------------------- diff --git a/Godeps/_workspace/src/github.com/ugorji/go/codec/fast-path.generated.go b/Godeps/_workspace/src/github.com/ugorji/go/codec/fast-path.generated.go index efd81da29fa0..554e80b613bd 100644 --- a/Godeps/_workspace/src/github.com/ugorji/go/codec/fast-path.generated.go +++ b/Godeps/_workspace/src/github.com/ugorji/go/codec/fast-path.generated.go @@ -1,7 +1,7 @@ // //+build ignore // Copyright (c) 2012-2015 Ugorji Nwoke. All rights reserved. -// Use of this source code is governed by a BSD-style license found in the LICENSE file. +// Use of this source code is governed by a MIT license found in the LICENSE file. // ************************************************************ // DO NOT EDIT. @@ -48,8 +48,8 @@ var fastpathTV fastpathT type fastpathE struct { rtid uintptr rt reflect.Type - encfn func(encFnInfo, reflect.Value) - decfn func(decFnInfo, reflect.Value) + encfn func(*encFnInfo, reflect.Value) + decfn func(*decFnInfo, reflect.Value) } type fastpathA [239]fastpathE @@ -85,7 +85,7 @@ func init() { return } i := 0 - fn := func(v interface{}, fe func(encFnInfo, reflect.Value), fd func(decFnInfo, reflect.Value)) (f fastpathE) { + fn := func(v interface{}, fe func(*encFnInfo, reflect.Value), fd func(*decFnInfo, reflect.Value)) (f fastpathE) { xrt := reflect.TypeOf(v) xptr := reflect.ValueOf(xrt).Pointer() fastpathAV[i] = fastpathE{xptr, xrt, fe, fd} @@ -93,246 +93,246 @@ func init() { return } - fn([]interface{}(nil), (encFnInfo).fastpathEncSliceIntfR, (decFnInfo).fastpathDecSliceIntfR) - fn([]string(nil), (encFnInfo).fastpathEncSliceStringR, (decFnInfo).fastpathDecSliceStringR) - fn([]float32(nil), (encFnInfo).fastpathEncSliceFloat32R, (decFnInfo).fastpathDecSliceFloat32R) - fn([]float64(nil), (encFnInfo).fastpathEncSliceFloat64R, (decFnInfo).fastpathDecSliceFloat64R) - fn([]uint(nil), (encFnInfo).fastpathEncSliceUintR, (decFnInfo).fastpathDecSliceUintR) - fn([]uint16(nil), (encFnInfo).fastpathEncSliceUint16R, (decFnInfo).fastpathDecSliceUint16R) - fn([]uint32(nil), (encFnInfo).fastpathEncSliceUint32R, (decFnInfo).fastpathDecSliceUint32R) - fn([]uint64(nil), (encFnInfo).fastpathEncSliceUint64R, (decFnInfo).fastpathDecSliceUint64R) - fn([]int(nil), (encFnInfo).fastpathEncSliceIntR, (decFnInfo).fastpathDecSliceIntR) - fn([]int8(nil), (encFnInfo).fastpathEncSliceInt8R, (decFnInfo).fastpathDecSliceInt8R) - fn([]int16(nil), (encFnInfo).fastpathEncSliceInt16R, (decFnInfo).fastpathDecSliceInt16R) - fn([]int32(nil), (encFnInfo).fastpathEncSliceInt32R, (decFnInfo).fastpathDecSliceInt32R) - fn([]int64(nil), (encFnInfo).fastpathEncSliceInt64R, (decFnInfo).fastpathDecSliceInt64R) - fn([]bool(nil), (encFnInfo).fastpathEncSliceBoolR, (decFnInfo).fastpathDecSliceBoolR) - - fn(map[interface{}]interface{}(nil), (encFnInfo).fastpathEncMapIntfIntfR, (decFnInfo).fastpathDecMapIntfIntfR) - fn(map[interface{}]string(nil), (encFnInfo).fastpathEncMapIntfStringR, (decFnInfo).fastpathDecMapIntfStringR) - fn(map[interface{}]uint(nil), (encFnInfo).fastpathEncMapIntfUintR, (decFnInfo).fastpathDecMapIntfUintR) - fn(map[interface{}]uint8(nil), (encFnInfo).fastpathEncMapIntfUint8R, (decFnInfo).fastpathDecMapIntfUint8R) - fn(map[interface{}]uint16(nil), (encFnInfo).fastpathEncMapIntfUint16R, (decFnInfo).fastpathDecMapIntfUint16R) - fn(map[interface{}]uint32(nil), (encFnInfo).fastpathEncMapIntfUint32R, (decFnInfo).fastpathDecMapIntfUint32R) - fn(map[interface{}]uint64(nil), (encFnInfo).fastpathEncMapIntfUint64R, (decFnInfo).fastpathDecMapIntfUint64R) - fn(map[interface{}]int(nil), (encFnInfo).fastpathEncMapIntfIntR, (decFnInfo).fastpathDecMapIntfIntR) - fn(map[interface{}]int8(nil), (encFnInfo).fastpathEncMapIntfInt8R, (decFnInfo).fastpathDecMapIntfInt8R) - fn(map[interface{}]int16(nil), (encFnInfo).fastpathEncMapIntfInt16R, (decFnInfo).fastpathDecMapIntfInt16R) - fn(map[interface{}]int32(nil), (encFnInfo).fastpathEncMapIntfInt32R, (decFnInfo).fastpathDecMapIntfInt32R) - fn(map[interface{}]int64(nil), (encFnInfo).fastpathEncMapIntfInt64R, (decFnInfo).fastpathDecMapIntfInt64R) - fn(map[interface{}]float32(nil), (encFnInfo).fastpathEncMapIntfFloat32R, (decFnInfo).fastpathDecMapIntfFloat32R) - fn(map[interface{}]float64(nil), (encFnInfo).fastpathEncMapIntfFloat64R, (decFnInfo).fastpathDecMapIntfFloat64R) - fn(map[interface{}]bool(nil), (encFnInfo).fastpathEncMapIntfBoolR, (decFnInfo).fastpathDecMapIntfBoolR) - fn(map[string]interface{}(nil), (encFnInfo).fastpathEncMapStringIntfR, (decFnInfo).fastpathDecMapStringIntfR) - fn(map[string]string(nil), (encFnInfo).fastpathEncMapStringStringR, (decFnInfo).fastpathDecMapStringStringR) - fn(map[string]uint(nil), (encFnInfo).fastpathEncMapStringUintR, (decFnInfo).fastpathDecMapStringUintR) - fn(map[string]uint8(nil), (encFnInfo).fastpathEncMapStringUint8R, (decFnInfo).fastpathDecMapStringUint8R) - fn(map[string]uint16(nil), (encFnInfo).fastpathEncMapStringUint16R, (decFnInfo).fastpathDecMapStringUint16R) - fn(map[string]uint32(nil), (encFnInfo).fastpathEncMapStringUint32R, (decFnInfo).fastpathDecMapStringUint32R) - fn(map[string]uint64(nil), (encFnInfo).fastpathEncMapStringUint64R, (decFnInfo).fastpathDecMapStringUint64R) - fn(map[string]int(nil), (encFnInfo).fastpathEncMapStringIntR, (decFnInfo).fastpathDecMapStringIntR) - fn(map[string]int8(nil), (encFnInfo).fastpathEncMapStringInt8R, (decFnInfo).fastpathDecMapStringInt8R) - fn(map[string]int16(nil), (encFnInfo).fastpathEncMapStringInt16R, (decFnInfo).fastpathDecMapStringInt16R) - fn(map[string]int32(nil), (encFnInfo).fastpathEncMapStringInt32R, (decFnInfo).fastpathDecMapStringInt32R) - fn(map[string]int64(nil), (encFnInfo).fastpathEncMapStringInt64R, (decFnInfo).fastpathDecMapStringInt64R) - fn(map[string]float32(nil), (encFnInfo).fastpathEncMapStringFloat32R, (decFnInfo).fastpathDecMapStringFloat32R) - fn(map[string]float64(nil), (encFnInfo).fastpathEncMapStringFloat64R, (decFnInfo).fastpathDecMapStringFloat64R) - fn(map[string]bool(nil), (encFnInfo).fastpathEncMapStringBoolR, (decFnInfo).fastpathDecMapStringBoolR) - fn(map[float32]interface{}(nil), (encFnInfo).fastpathEncMapFloat32IntfR, (decFnInfo).fastpathDecMapFloat32IntfR) - fn(map[float32]string(nil), (encFnInfo).fastpathEncMapFloat32StringR, (decFnInfo).fastpathDecMapFloat32StringR) - fn(map[float32]uint(nil), (encFnInfo).fastpathEncMapFloat32UintR, (decFnInfo).fastpathDecMapFloat32UintR) - fn(map[float32]uint8(nil), (encFnInfo).fastpathEncMapFloat32Uint8R, (decFnInfo).fastpathDecMapFloat32Uint8R) - fn(map[float32]uint16(nil), (encFnInfo).fastpathEncMapFloat32Uint16R, (decFnInfo).fastpathDecMapFloat32Uint16R) - fn(map[float32]uint32(nil), (encFnInfo).fastpathEncMapFloat32Uint32R, (decFnInfo).fastpathDecMapFloat32Uint32R) - fn(map[float32]uint64(nil), (encFnInfo).fastpathEncMapFloat32Uint64R, (decFnInfo).fastpathDecMapFloat32Uint64R) - fn(map[float32]int(nil), (encFnInfo).fastpathEncMapFloat32IntR, (decFnInfo).fastpathDecMapFloat32IntR) - fn(map[float32]int8(nil), (encFnInfo).fastpathEncMapFloat32Int8R, (decFnInfo).fastpathDecMapFloat32Int8R) - fn(map[float32]int16(nil), (encFnInfo).fastpathEncMapFloat32Int16R, (decFnInfo).fastpathDecMapFloat32Int16R) - fn(map[float32]int32(nil), (encFnInfo).fastpathEncMapFloat32Int32R, (decFnInfo).fastpathDecMapFloat32Int32R) - fn(map[float32]int64(nil), (encFnInfo).fastpathEncMapFloat32Int64R, (decFnInfo).fastpathDecMapFloat32Int64R) - fn(map[float32]float32(nil), (encFnInfo).fastpathEncMapFloat32Float32R, (decFnInfo).fastpathDecMapFloat32Float32R) - fn(map[float32]float64(nil), (encFnInfo).fastpathEncMapFloat32Float64R, (decFnInfo).fastpathDecMapFloat32Float64R) - fn(map[float32]bool(nil), (encFnInfo).fastpathEncMapFloat32BoolR, (decFnInfo).fastpathDecMapFloat32BoolR) - fn(map[float64]interface{}(nil), (encFnInfo).fastpathEncMapFloat64IntfR, (decFnInfo).fastpathDecMapFloat64IntfR) - fn(map[float64]string(nil), (encFnInfo).fastpathEncMapFloat64StringR, (decFnInfo).fastpathDecMapFloat64StringR) - fn(map[float64]uint(nil), (encFnInfo).fastpathEncMapFloat64UintR, (decFnInfo).fastpathDecMapFloat64UintR) - fn(map[float64]uint8(nil), (encFnInfo).fastpathEncMapFloat64Uint8R, (decFnInfo).fastpathDecMapFloat64Uint8R) - fn(map[float64]uint16(nil), (encFnInfo).fastpathEncMapFloat64Uint16R, (decFnInfo).fastpathDecMapFloat64Uint16R) - fn(map[float64]uint32(nil), (encFnInfo).fastpathEncMapFloat64Uint32R, (decFnInfo).fastpathDecMapFloat64Uint32R) - fn(map[float64]uint64(nil), (encFnInfo).fastpathEncMapFloat64Uint64R, (decFnInfo).fastpathDecMapFloat64Uint64R) - fn(map[float64]int(nil), (encFnInfo).fastpathEncMapFloat64IntR, (decFnInfo).fastpathDecMapFloat64IntR) - fn(map[float64]int8(nil), (encFnInfo).fastpathEncMapFloat64Int8R, (decFnInfo).fastpathDecMapFloat64Int8R) - fn(map[float64]int16(nil), (encFnInfo).fastpathEncMapFloat64Int16R, (decFnInfo).fastpathDecMapFloat64Int16R) - fn(map[float64]int32(nil), (encFnInfo).fastpathEncMapFloat64Int32R, (decFnInfo).fastpathDecMapFloat64Int32R) - fn(map[float64]int64(nil), (encFnInfo).fastpathEncMapFloat64Int64R, (decFnInfo).fastpathDecMapFloat64Int64R) - fn(map[float64]float32(nil), (encFnInfo).fastpathEncMapFloat64Float32R, (decFnInfo).fastpathDecMapFloat64Float32R) - fn(map[float64]float64(nil), (encFnInfo).fastpathEncMapFloat64Float64R, (decFnInfo).fastpathDecMapFloat64Float64R) - fn(map[float64]bool(nil), (encFnInfo).fastpathEncMapFloat64BoolR, (decFnInfo).fastpathDecMapFloat64BoolR) - fn(map[uint]interface{}(nil), (encFnInfo).fastpathEncMapUintIntfR, (decFnInfo).fastpathDecMapUintIntfR) - fn(map[uint]string(nil), (encFnInfo).fastpathEncMapUintStringR, (decFnInfo).fastpathDecMapUintStringR) - fn(map[uint]uint(nil), (encFnInfo).fastpathEncMapUintUintR, (decFnInfo).fastpathDecMapUintUintR) - fn(map[uint]uint8(nil), (encFnInfo).fastpathEncMapUintUint8R, (decFnInfo).fastpathDecMapUintUint8R) - fn(map[uint]uint16(nil), (encFnInfo).fastpathEncMapUintUint16R, (decFnInfo).fastpathDecMapUintUint16R) - fn(map[uint]uint32(nil), (encFnInfo).fastpathEncMapUintUint32R, (decFnInfo).fastpathDecMapUintUint32R) - fn(map[uint]uint64(nil), (encFnInfo).fastpathEncMapUintUint64R, (decFnInfo).fastpathDecMapUintUint64R) - fn(map[uint]int(nil), (encFnInfo).fastpathEncMapUintIntR, (decFnInfo).fastpathDecMapUintIntR) - fn(map[uint]int8(nil), (encFnInfo).fastpathEncMapUintInt8R, (decFnInfo).fastpathDecMapUintInt8R) - fn(map[uint]int16(nil), (encFnInfo).fastpathEncMapUintInt16R, (decFnInfo).fastpathDecMapUintInt16R) - fn(map[uint]int32(nil), (encFnInfo).fastpathEncMapUintInt32R, (decFnInfo).fastpathDecMapUintInt32R) - fn(map[uint]int64(nil), (encFnInfo).fastpathEncMapUintInt64R, (decFnInfo).fastpathDecMapUintInt64R) - fn(map[uint]float32(nil), (encFnInfo).fastpathEncMapUintFloat32R, (decFnInfo).fastpathDecMapUintFloat32R) - fn(map[uint]float64(nil), (encFnInfo).fastpathEncMapUintFloat64R, (decFnInfo).fastpathDecMapUintFloat64R) - fn(map[uint]bool(nil), (encFnInfo).fastpathEncMapUintBoolR, (decFnInfo).fastpathDecMapUintBoolR) - fn(map[uint8]interface{}(nil), (encFnInfo).fastpathEncMapUint8IntfR, (decFnInfo).fastpathDecMapUint8IntfR) - fn(map[uint8]string(nil), (encFnInfo).fastpathEncMapUint8StringR, (decFnInfo).fastpathDecMapUint8StringR) - fn(map[uint8]uint(nil), (encFnInfo).fastpathEncMapUint8UintR, (decFnInfo).fastpathDecMapUint8UintR) - fn(map[uint8]uint8(nil), (encFnInfo).fastpathEncMapUint8Uint8R, (decFnInfo).fastpathDecMapUint8Uint8R) - fn(map[uint8]uint16(nil), (encFnInfo).fastpathEncMapUint8Uint16R, (decFnInfo).fastpathDecMapUint8Uint16R) - fn(map[uint8]uint32(nil), (encFnInfo).fastpathEncMapUint8Uint32R, (decFnInfo).fastpathDecMapUint8Uint32R) - fn(map[uint8]uint64(nil), (encFnInfo).fastpathEncMapUint8Uint64R, (decFnInfo).fastpathDecMapUint8Uint64R) - fn(map[uint8]int(nil), (encFnInfo).fastpathEncMapUint8IntR, (decFnInfo).fastpathDecMapUint8IntR) - fn(map[uint8]int8(nil), (encFnInfo).fastpathEncMapUint8Int8R, (decFnInfo).fastpathDecMapUint8Int8R) - fn(map[uint8]int16(nil), (encFnInfo).fastpathEncMapUint8Int16R, (decFnInfo).fastpathDecMapUint8Int16R) - fn(map[uint8]int32(nil), (encFnInfo).fastpathEncMapUint8Int32R, (decFnInfo).fastpathDecMapUint8Int32R) - fn(map[uint8]int64(nil), (encFnInfo).fastpathEncMapUint8Int64R, (decFnInfo).fastpathDecMapUint8Int64R) - fn(map[uint8]float32(nil), (encFnInfo).fastpathEncMapUint8Float32R, (decFnInfo).fastpathDecMapUint8Float32R) - fn(map[uint8]float64(nil), (encFnInfo).fastpathEncMapUint8Float64R, (decFnInfo).fastpathDecMapUint8Float64R) - fn(map[uint8]bool(nil), (encFnInfo).fastpathEncMapUint8BoolR, (decFnInfo).fastpathDecMapUint8BoolR) - fn(map[uint16]interface{}(nil), (encFnInfo).fastpathEncMapUint16IntfR, (decFnInfo).fastpathDecMapUint16IntfR) - fn(map[uint16]string(nil), (encFnInfo).fastpathEncMapUint16StringR, (decFnInfo).fastpathDecMapUint16StringR) - fn(map[uint16]uint(nil), (encFnInfo).fastpathEncMapUint16UintR, (decFnInfo).fastpathDecMapUint16UintR) - fn(map[uint16]uint8(nil), (encFnInfo).fastpathEncMapUint16Uint8R, (decFnInfo).fastpathDecMapUint16Uint8R) - fn(map[uint16]uint16(nil), (encFnInfo).fastpathEncMapUint16Uint16R, (decFnInfo).fastpathDecMapUint16Uint16R) - fn(map[uint16]uint32(nil), (encFnInfo).fastpathEncMapUint16Uint32R, (decFnInfo).fastpathDecMapUint16Uint32R) - fn(map[uint16]uint64(nil), (encFnInfo).fastpathEncMapUint16Uint64R, (decFnInfo).fastpathDecMapUint16Uint64R) - fn(map[uint16]int(nil), (encFnInfo).fastpathEncMapUint16IntR, (decFnInfo).fastpathDecMapUint16IntR) - fn(map[uint16]int8(nil), (encFnInfo).fastpathEncMapUint16Int8R, (decFnInfo).fastpathDecMapUint16Int8R) - fn(map[uint16]int16(nil), (encFnInfo).fastpathEncMapUint16Int16R, (decFnInfo).fastpathDecMapUint16Int16R) - fn(map[uint16]int32(nil), (encFnInfo).fastpathEncMapUint16Int32R, (decFnInfo).fastpathDecMapUint16Int32R) - fn(map[uint16]int64(nil), (encFnInfo).fastpathEncMapUint16Int64R, (decFnInfo).fastpathDecMapUint16Int64R) - fn(map[uint16]float32(nil), (encFnInfo).fastpathEncMapUint16Float32R, (decFnInfo).fastpathDecMapUint16Float32R) - fn(map[uint16]float64(nil), (encFnInfo).fastpathEncMapUint16Float64R, (decFnInfo).fastpathDecMapUint16Float64R) - fn(map[uint16]bool(nil), (encFnInfo).fastpathEncMapUint16BoolR, (decFnInfo).fastpathDecMapUint16BoolR) - fn(map[uint32]interface{}(nil), (encFnInfo).fastpathEncMapUint32IntfR, (decFnInfo).fastpathDecMapUint32IntfR) - fn(map[uint32]string(nil), (encFnInfo).fastpathEncMapUint32StringR, (decFnInfo).fastpathDecMapUint32StringR) - fn(map[uint32]uint(nil), (encFnInfo).fastpathEncMapUint32UintR, (decFnInfo).fastpathDecMapUint32UintR) - fn(map[uint32]uint8(nil), (encFnInfo).fastpathEncMapUint32Uint8R, (decFnInfo).fastpathDecMapUint32Uint8R) - fn(map[uint32]uint16(nil), (encFnInfo).fastpathEncMapUint32Uint16R, (decFnInfo).fastpathDecMapUint32Uint16R) - fn(map[uint32]uint32(nil), (encFnInfo).fastpathEncMapUint32Uint32R, (decFnInfo).fastpathDecMapUint32Uint32R) - fn(map[uint32]uint64(nil), (encFnInfo).fastpathEncMapUint32Uint64R, (decFnInfo).fastpathDecMapUint32Uint64R) - fn(map[uint32]int(nil), (encFnInfo).fastpathEncMapUint32IntR, (decFnInfo).fastpathDecMapUint32IntR) - fn(map[uint32]int8(nil), (encFnInfo).fastpathEncMapUint32Int8R, (decFnInfo).fastpathDecMapUint32Int8R) - fn(map[uint32]int16(nil), (encFnInfo).fastpathEncMapUint32Int16R, (decFnInfo).fastpathDecMapUint32Int16R) - fn(map[uint32]int32(nil), (encFnInfo).fastpathEncMapUint32Int32R, (decFnInfo).fastpathDecMapUint32Int32R) - fn(map[uint32]int64(nil), (encFnInfo).fastpathEncMapUint32Int64R, (decFnInfo).fastpathDecMapUint32Int64R) - fn(map[uint32]float32(nil), (encFnInfo).fastpathEncMapUint32Float32R, (decFnInfo).fastpathDecMapUint32Float32R) - fn(map[uint32]float64(nil), (encFnInfo).fastpathEncMapUint32Float64R, (decFnInfo).fastpathDecMapUint32Float64R) - fn(map[uint32]bool(nil), (encFnInfo).fastpathEncMapUint32BoolR, (decFnInfo).fastpathDecMapUint32BoolR) - fn(map[uint64]interface{}(nil), (encFnInfo).fastpathEncMapUint64IntfR, (decFnInfo).fastpathDecMapUint64IntfR) - fn(map[uint64]string(nil), (encFnInfo).fastpathEncMapUint64StringR, (decFnInfo).fastpathDecMapUint64StringR) - fn(map[uint64]uint(nil), (encFnInfo).fastpathEncMapUint64UintR, (decFnInfo).fastpathDecMapUint64UintR) - fn(map[uint64]uint8(nil), (encFnInfo).fastpathEncMapUint64Uint8R, (decFnInfo).fastpathDecMapUint64Uint8R) - fn(map[uint64]uint16(nil), (encFnInfo).fastpathEncMapUint64Uint16R, (decFnInfo).fastpathDecMapUint64Uint16R) - fn(map[uint64]uint32(nil), (encFnInfo).fastpathEncMapUint64Uint32R, (decFnInfo).fastpathDecMapUint64Uint32R) - fn(map[uint64]uint64(nil), (encFnInfo).fastpathEncMapUint64Uint64R, (decFnInfo).fastpathDecMapUint64Uint64R) - fn(map[uint64]int(nil), (encFnInfo).fastpathEncMapUint64IntR, (decFnInfo).fastpathDecMapUint64IntR) - fn(map[uint64]int8(nil), (encFnInfo).fastpathEncMapUint64Int8R, (decFnInfo).fastpathDecMapUint64Int8R) - fn(map[uint64]int16(nil), (encFnInfo).fastpathEncMapUint64Int16R, (decFnInfo).fastpathDecMapUint64Int16R) - fn(map[uint64]int32(nil), (encFnInfo).fastpathEncMapUint64Int32R, (decFnInfo).fastpathDecMapUint64Int32R) - fn(map[uint64]int64(nil), (encFnInfo).fastpathEncMapUint64Int64R, (decFnInfo).fastpathDecMapUint64Int64R) - fn(map[uint64]float32(nil), (encFnInfo).fastpathEncMapUint64Float32R, (decFnInfo).fastpathDecMapUint64Float32R) - fn(map[uint64]float64(nil), (encFnInfo).fastpathEncMapUint64Float64R, (decFnInfo).fastpathDecMapUint64Float64R) - fn(map[uint64]bool(nil), (encFnInfo).fastpathEncMapUint64BoolR, (decFnInfo).fastpathDecMapUint64BoolR) - fn(map[int]interface{}(nil), (encFnInfo).fastpathEncMapIntIntfR, (decFnInfo).fastpathDecMapIntIntfR) - fn(map[int]string(nil), (encFnInfo).fastpathEncMapIntStringR, (decFnInfo).fastpathDecMapIntStringR) - fn(map[int]uint(nil), (encFnInfo).fastpathEncMapIntUintR, (decFnInfo).fastpathDecMapIntUintR) - fn(map[int]uint8(nil), (encFnInfo).fastpathEncMapIntUint8R, (decFnInfo).fastpathDecMapIntUint8R) - fn(map[int]uint16(nil), (encFnInfo).fastpathEncMapIntUint16R, (decFnInfo).fastpathDecMapIntUint16R) - fn(map[int]uint32(nil), (encFnInfo).fastpathEncMapIntUint32R, (decFnInfo).fastpathDecMapIntUint32R) - fn(map[int]uint64(nil), (encFnInfo).fastpathEncMapIntUint64R, (decFnInfo).fastpathDecMapIntUint64R) - fn(map[int]int(nil), (encFnInfo).fastpathEncMapIntIntR, (decFnInfo).fastpathDecMapIntIntR) - fn(map[int]int8(nil), (encFnInfo).fastpathEncMapIntInt8R, (decFnInfo).fastpathDecMapIntInt8R) - fn(map[int]int16(nil), (encFnInfo).fastpathEncMapIntInt16R, (decFnInfo).fastpathDecMapIntInt16R) - fn(map[int]int32(nil), (encFnInfo).fastpathEncMapIntInt32R, (decFnInfo).fastpathDecMapIntInt32R) - fn(map[int]int64(nil), (encFnInfo).fastpathEncMapIntInt64R, (decFnInfo).fastpathDecMapIntInt64R) - fn(map[int]float32(nil), (encFnInfo).fastpathEncMapIntFloat32R, (decFnInfo).fastpathDecMapIntFloat32R) - fn(map[int]float64(nil), (encFnInfo).fastpathEncMapIntFloat64R, (decFnInfo).fastpathDecMapIntFloat64R) - fn(map[int]bool(nil), (encFnInfo).fastpathEncMapIntBoolR, (decFnInfo).fastpathDecMapIntBoolR) - fn(map[int8]interface{}(nil), (encFnInfo).fastpathEncMapInt8IntfR, (decFnInfo).fastpathDecMapInt8IntfR) - fn(map[int8]string(nil), (encFnInfo).fastpathEncMapInt8StringR, (decFnInfo).fastpathDecMapInt8StringR) - fn(map[int8]uint(nil), (encFnInfo).fastpathEncMapInt8UintR, (decFnInfo).fastpathDecMapInt8UintR) - fn(map[int8]uint8(nil), (encFnInfo).fastpathEncMapInt8Uint8R, (decFnInfo).fastpathDecMapInt8Uint8R) - fn(map[int8]uint16(nil), (encFnInfo).fastpathEncMapInt8Uint16R, (decFnInfo).fastpathDecMapInt8Uint16R) - fn(map[int8]uint32(nil), (encFnInfo).fastpathEncMapInt8Uint32R, (decFnInfo).fastpathDecMapInt8Uint32R) - fn(map[int8]uint64(nil), (encFnInfo).fastpathEncMapInt8Uint64R, (decFnInfo).fastpathDecMapInt8Uint64R) - fn(map[int8]int(nil), (encFnInfo).fastpathEncMapInt8IntR, (decFnInfo).fastpathDecMapInt8IntR) - fn(map[int8]int8(nil), (encFnInfo).fastpathEncMapInt8Int8R, (decFnInfo).fastpathDecMapInt8Int8R) - fn(map[int8]int16(nil), (encFnInfo).fastpathEncMapInt8Int16R, (decFnInfo).fastpathDecMapInt8Int16R) - fn(map[int8]int32(nil), (encFnInfo).fastpathEncMapInt8Int32R, (decFnInfo).fastpathDecMapInt8Int32R) - fn(map[int8]int64(nil), (encFnInfo).fastpathEncMapInt8Int64R, (decFnInfo).fastpathDecMapInt8Int64R) - fn(map[int8]float32(nil), (encFnInfo).fastpathEncMapInt8Float32R, (decFnInfo).fastpathDecMapInt8Float32R) - fn(map[int8]float64(nil), (encFnInfo).fastpathEncMapInt8Float64R, (decFnInfo).fastpathDecMapInt8Float64R) - fn(map[int8]bool(nil), (encFnInfo).fastpathEncMapInt8BoolR, (decFnInfo).fastpathDecMapInt8BoolR) - fn(map[int16]interface{}(nil), (encFnInfo).fastpathEncMapInt16IntfR, (decFnInfo).fastpathDecMapInt16IntfR) - fn(map[int16]string(nil), (encFnInfo).fastpathEncMapInt16StringR, (decFnInfo).fastpathDecMapInt16StringR) - fn(map[int16]uint(nil), (encFnInfo).fastpathEncMapInt16UintR, (decFnInfo).fastpathDecMapInt16UintR) - fn(map[int16]uint8(nil), (encFnInfo).fastpathEncMapInt16Uint8R, (decFnInfo).fastpathDecMapInt16Uint8R) - fn(map[int16]uint16(nil), (encFnInfo).fastpathEncMapInt16Uint16R, (decFnInfo).fastpathDecMapInt16Uint16R) - fn(map[int16]uint32(nil), (encFnInfo).fastpathEncMapInt16Uint32R, (decFnInfo).fastpathDecMapInt16Uint32R) - fn(map[int16]uint64(nil), (encFnInfo).fastpathEncMapInt16Uint64R, (decFnInfo).fastpathDecMapInt16Uint64R) - fn(map[int16]int(nil), (encFnInfo).fastpathEncMapInt16IntR, (decFnInfo).fastpathDecMapInt16IntR) - fn(map[int16]int8(nil), (encFnInfo).fastpathEncMapInt16Int8R, (decFnInfo).fastpathDecMapInt16Int8R) - fn(map[int16]int16(nil), (encFnInfo).fastpathEncMapInt16Int16R, (decFnInfo).fastpathDecMapInt16Int16R) - fn(map[int16]int32(nil), (encFnInfo).fastpathEncMapInt16Int32R, (decFnInfo).fastpathDecMapInt16Int32R) - fn(map[int16]int64(nil), (encFnInfo).fastpathEncMapInt16Int64R, (decFnInfo).fastpathDecMapInt16Int64R) - fn(map[int16]float32(nil), (encFnInfo).fastpathEncMapInt16Float32R, (decFnInfo).fastpathDecMapInt16Float32R) - fn(map[int16]float64(nil), (encFnInfo).fastpathEncMapInt16Float64R, (decFnInfo).fastpathDecMapInt16Float64R) - fn(map[int16]bool(nil), (encFnInfo).fastpathEncMapInt16BoolR, (decFnInfo).fastpathDecMapInt16BoolR) - fn(map[int32]interface{}(nil), (encFnInfo).fastpathEncMapInt32IntfR, (decFnInfo).fastpathDecMapInt32IntfR) - fn(map[int32]string(nil), (encFnInfo).fastpathEncMapInt32StringR, (decFnInfo).fastpathDecMapInt32StringR) - fn(map[int32]uint(nil), (encFnInfo).fastpathEncMapInt32UintR, (decFnInfo).fastpathDecMapInt32UintR) - fn(map[int32]uint8(nil), (encFnInfo).fastpathEncMapInt32Uint8R, (decFnInfo).fastpathDecMapInt32Uint8R) - fn(map[int32]uint16(nil), (encFnInfo).fastpathEncMapInt32Uint16R, (decFnInfo).fastpathDecMapInt32Uint16R) - fn(map[int32]uint32(nil), (encFnInfo).fastpathEncMapInt32Uint32R, (decFnInfo).fastpathDecMapInt32Uint32R) - fn(map[int32]uint64(nil), (encFnInfo).fastpathEncMapInt32Uint64R, (decFnInfo).fastpathDecMapInt32Uint64R) - fn(map[int32]int(nil), (encFnInfo).fastpathEncMapInt32IntR, (decFnInfo).fastpathDecMapInt32IntR) - fn(map[int32]int8(nil), (encFnInfo).fastpathEncMapInt32Int8R, (decFnInfo).fastpathDecMapInt32Int8R) - fn(map[int32]int16(nil), (encFnInfo).fastpathEncMapInt32Int16R, (decFnInfo).fastpathDecMapInt32Int16R) - fn(map[int32]int32(nil), (encFnInfo).fastpathEncMapInt32Int32R, (decFnInfo).fastpathDecMapInt32Int32R) - fn(map[int32]int64(nil), (encFnInfo).fastpathEncMapInt32Int64R, (decFnInfo).fastpathDecMapInt32Int64R) - fn(map[int32]float32(nil), (encFnInfo).fastpathEncMapInt32Float32R, (decFnInfo).fastpathDecMapInt32Float32R) - fn(map[int32]float64(nil), (encFnInfo).fastpathEncMapInt32Float64R, (decFnInfo).fastpathDecMapInt32Float64R) - fn(map[int32]bool(nil), (encFnInfo).fastpathEncMapInt32BoolR, (decFnInfo).fastpathDecMapInt32BoolR) - fn(map[int64]interface{}(nil), (encFnInfo).fastpathEncMapInt64IntfR, (decFnInfo).fastpathDecMapInt64IntfR) - fn(map[int64]string(nil), (encFnInfo).fastpathEncMapInt64StringR, (decFnInfo).fastpathDecMapInt64StringR) - fn(map[int64]uint(nil), (encFnInfo).fastpathEncMapInt64UintR, (decFnInfo).fastpathDecMapInt64UintR) - fn(map[int64]uint8(nil), (encFnInfo).fastpathEncMapInt64Uint8R, (decFnInfo).fastpathDecMapInt64Uint8R) - fn(map[int64]uint16(nil), (encFnInfo).fastpathEncMapInt64Uint16R, (decFnInfo).fastpathDecMapInt64Uint16R) - fn(map[int64]uint32(nil), (encFnInfo).fastpathEncMapInt64Uint32R, (decFnInfo).fastpathDecMapInt64Uint32R) - fn(map[int64]uint64(nil), (encFnInfo).fastpathEncMapInt64Uint64R, (decFnInfo).fastpathDecMapInt64Uint64R) - fn(map[int64]int(nil), (encFnInfo).fastpathEncMapInt64IntR, (decFnInfo).fastpathDecMapInt64IntR) - fn(map[int64]int8(nil), (encFnInfo).fastpathEncMapInt64Int8R, (decFnInfo).fastpathDecMapInt64Int8R) - fn(map[int64]int16(nil), (encFnInfo).fastpathEncMapInt64Int16R, (decFnInfo).fastpathDecMapInt64Int16R) - fn(map[int64]int32(nil), (encFnInfo).fastpathEncMapInt64Int32R, (decFnInfo).fastpathDecMapInt64Int32R) - fn(map[int64]int64(nil), (encFnInfo).fastpathEncMapInt64Int64R, (decFnInfo).fastpathDecMapInt64Int64R) - fn(map[int64]float32(nil), (encFnInfo).fastpathEncMapInt64Float32R, (decFnInfo).fastpathDecMapInt64Float32R) - fn(map[int64]float64(nil), (encFnInfo).fastpathEncMapInt64Float64R, (decFnInfo).fastpathDecMapInt64Float64R) - fn(map[int64]bool(nil), (encFnInfo).fastpathEncMapInt64BoolR, (decFnInfo).fastpathDecMapInt64BoolR) - fn(map[bool]interface{}(nil), (encFnInfo).fastpathEncMapBoolIntfR, (decFnInfo).fastpathDecMapBoolIntfR) - fn(map[bool]string(nil), (encFnInfo).fastpathEncMapBoolStringR, (decFnInfo).fastpathDecMapBoolStringR) - fn(map[bool]uint(nil), (encFnInfo).fastpathEncMapBoolUintR, (decFnInfo).fastpathDecMapBoolUintR) - fn(map[bool]uint8(nil), (encFnInfo).fastpathEncMapBoolUint8R, (decFnInfo).fastpathDecMapBoolUint8R) - fn(map[bool]uint16(nil), (encFnInfo).fastpathEncMapBoolUint16R, (decFnInfo).fastpathDecMapBoolUint16R) - fn(map[bool]uint32(nil), (encFnInfo).fastpathEncMapBoolUint32R, (decFnInfo).fastpathDecMapBoolUint32R) - fn(map[bool]uint64(nil), (encFnInfo).fastpathEncMapBoolUint64R, (decFnInfo).fastpathDecMapBoolUint64R) - fn(map[bool]int(nil), (encFnInfo).fastpathEncMapBoolIntR, (decFnInfo).fastpathDecMapBoolIntR) - fn(map[bool]int8(nil), (encFnInfo).fastpathEncMapBoolInt8R, (decFnInfo).fastpathDecMapBoolInt8R) - fn(map[bool]int16(nil), (encFnInfo).fastpathEncMapBoolInt16R, (decFnInfo).fastpathDecMapBoolInt16R) - fn(map[bool]int32(nil), (encFnInfo).fastpathEncMapBoolInt32R, (decFnInfo).fastpathDecMapBoolInt32R) - fn(map[bool]int64(nil), (encFnInfo).fastpathEncMapBoolInt64R, (decFnInfo).fastpathDecMapBoolInt64R) - fn(map[bool]float32(nil), (encFnInfo).fastpathEncMapBoolFloat32R, (decFnInfo).fastpathDecMapBoolFloat32R) - fn(map[bool]float64(nil), (encFnInfo).fastpathEncMapBoolFloat64R, (decFnInfo).fastpathDecMapBoolFloat64R) - fn(map[bool]bool(nil), (encFnInfo).fastpathEncMapBoolBoolR, (decFnInfo).fastpathDecMapBoolBoolR) + fn([]interface{}(nil), (*encFnInfo).fastpathEncSliceIntfR, (*decFnInfo).fastpathDecSliceIntfR) + fn([]string(nil), (*encFnInfo).fastpathEncSliceStringR, (*decFnInfo).fastpathDecSliceStringR) + fn([]float32(nil), (*encFnInfo).fastpathEncSliceFloat32R, (*decFnInfo).fastpathDecSliceFloat32R) + fn([]float64(nil), (*encFnInfo).fastpathEncSliceFloat64R, (*decFnInfo).fastpathDecSliceFloat64R) + fn([]uint(nil), (*encFnInfo).fastpathEncSliceUintR, (*decFnInfo).fastpathDecSliceUintR) + fn([]uint16(nil), (*encFnInfo).fastpathEncSliceUint16R, (*decFnInfo).fastpathDecSliceUint16R) + fn([]uint32(nil), (*encFnInfo).fastpathEncSliceUint32R, (*decFnInfo).fastpathDecSliceUint32R) + fn([]uint64(nil), (*encFnInfo).fastpathEncSliceUint64R, (*decFnInfo).fastpathDecSliceUint64R) + fn([]int(nil), (*encFnInfo).fastpathEncSliceIntR, (*decFnInfo).fastpathDecSliceIntR) + fn([]int8(nil), (*encFnInfo).fastpathEncSliceInt8R, (*decFnInfo).fastpathDecSliceInt8R) + fn([]int16(nil), (*encFnInfo).fastpathEncSliceInt16R, (*decFnInfo).fastpathDecSliceInt16R) + fn([]int32(nil), (*encFnInfo).fastpathEncSliceInt32R, (*decFnInfo).fastpathDecSliceInt32R) + fn([]int64(nil), (*encFnInfo).fastpathEncSliceInt64R, (*decFnInfo).fastpathDecSliceInt64R) + fn([]bool(nil), (*encFnInfo).fastpathEncSliceBoolR, (*decFnInfo).fastpathDecSliceBoolR) + + fn(map[interface{}]interface{}(nil), (*encFnInfo).fastpathEncMapIntfIntfR, (*decFnInfo).fastpathDecMapIntfIntfR) + fn(map[interface{}]string(nil), (*encFnInfo).fastpathEncMapIntfStringR, (*decFnInfo).fastpathDecMapIntfStringR) + fn(map[interface{}]uint(nil), (*encFnInfo).fastpathEncMapIntfUintR, (*decFnInfo).fastpathDecMapIntfUintR) + fn(map[interface{}]uint8(nil), (*encFnInfo).fastpathEncMapIntfUint8R, (*decFnInfo).fastpathDecMapIntfUint8R) + fn(map[interface{}]uint16(nil), (*encFnInfo).fastpathEncMapIntfUint16R, (*decFnInfo).fastpathDecMapIntfUint16R) + fn(map[interface{}]uint32(nil), (*encFnInfo).fastpathEncMapIntfUint32R, (*decFnInfo).fastpathDecMapIntfUint32R) + fn(map[interface{}]uint64(nil), (*encFnInfo).fastpathEncMapIntfUint64R, (*decFnInfo).fastpathDecMapIntfUint64R) + fn(map[interface{}]int(nil), (*encFnInfo).fastpathEncMapIntfIntR, (*decFnInfo).fastpathDecMapIntfIntR) + fn(map[interface{}]int8(nil), (*encFnInfo).fastpathEncMapIntfInt8R, (*decFnInfo).fastpathDecMapIntfInt8R) + fn(map[interface{}]int16(nil), (*encFnInfo).fastpathEncMapIntfInt16R, (*decFnInfo).fastpathDecMapIntfInt16R) + fn(map[interface{}]int32(nil), (*encFnInfo).fastpathEncMapIntfInt32R, (*decFnInfo).fastpathDecMapIntfInt32R) + fn(map[interface{}]int64(nil), (*encFnInfo).fastpathEncMapIntfInt64R, (*decFnInfo).fastpathDecMapIntfInt64R) + fn(map[interface{}]float32(nil), (*encFnInfo).fastpathEncMapIntfFloat32R, (*decFnInfo).fastpathDecMapIntfFloat32R) + fn(map[interface{}]float64(nil), (*encFnInfo).fastpathEncMapIntfFloat64R, (*decFnInfo).fastpathDecMapIntfFloat64R) + fn(map[interface{}]bool(nil), (*encFnInfo).fastpathEncMapIntfBoolR, (*decFnInfo).fastpathDecMapIntfBoolR) + fn(map[string]interface{}(nil), (*encFnInfo).fastpathEncMapStringIntfR, (*decFnInfo).fastpathDecMapStringIntfR) + fn(map[string]string(nil), (*encFnInfo).fastpathEncMapStringStringR, (*decFnInfo).fastpathDecMapStringStringR) + fn(map[string]uint(nil), (*encFnInfo).fastpathEncMapStringUintR, (*decFnInfo).fastpathDecMapStringUintR) + fn(map[string]uint8(nil), (*encFnInfo).fastpathEncMapStringUint8R, (*decFnInfo).fastpathDecMapStringUint8R) + fn(map[string]uint16(nil), (*encFnInfo).fastpathEncMapStringUint16R, (*decFnInfo).fastpathDecMapStringUint16R) + fn(map[string]uint32(nil), (*encFnInfo).fastpathEncMapStringUint32R, (*decFnInfo).fastpathDecMapStringUint32R) + fn(map[string]uint64(nil), (*encFnInfo).fastpathEncMapStringUint64R, (*decFnInfo).fastpathDecMapStringUint64R) + fn(map[string]int(nil), (*encFnInfo).fastpathEncMapStringIntR, (*decFnInfo).fastpathDecMapStringIntR) + fn(map[string]int8(nil), (*encFnInfo).fastpathEncMapStringInt8R, (*decFnInfo).fastpathDecMapStringInt8R) + fn(map[string]int16(nil), (*encFnInfo).fastpathEncMapStringInt16R, (*decFnInfo).fastpathDecMapStringInt16R) + fn(map[string]int32(nil), (*encFnInfo).fastpathEncMapStringInt32R, (*decFnInfo).fastpathDecMapStringInt32R) + fn(map[string]int64(nil), (*encFnInfo).fastpathEncMapStringInt64R, (*decFnInfo).fastpathDecMapStringInt64R) + fn(map[string]float32(nil), (*encFnInfo).fastpathEncMapStringFloat32R, (*decFnInfo).fastpathDecMapStringFloat32R) + fn(map[string]float64(nil), (*encFnInfo).fastpathEncMapStringFloat64R, (*decFnInfo).fastpathDecMapStringFloat64R) + fn(map[string]bool(nil), (*encFnInfo).fastpathEncMapStringBoolR, (*decFnInfo).fastpathDecMapStringBoolR) + fn(map[float32]interface{}(nil), (*encFnInfo).fastpathEncMapFloat32IntfR, (*decFnInfo).fastpathDecMapFloat32IntfR) + fn(map[float32]string(nil), (*encFnInfo).fastpathEncMapFloat32StringR, (*decFnInfo).fastpathDecMapFloat32StringR) + fn(map[float32]uint(nil), (*encFnInfo).fastpathEncMapFloat32UintR, (*decFnInfo).fastpathDecMapFloat32UintR) + fn(map[float32]uint8(nil), (*encFnInfo).fastpathEncMapFloat32Uint8R, (*decFnInfo).fastpathDecMapFloat32Uint8R) + fn(map[float32]uint16(nil), (*encFnInfo).fastpathEncMapFloat32Uint16R, (*decFnInfo).fastpathDecMapFloat32Uint16R) + fn(map[float32]uint32(nil), (*encFnInfo).fastpathEncMapFloat32Uint32R, (*decFnInfo).fastpathDecMapFloat32Uint32R) + fn(map[float32]uint64(nil), (*encFnInfo).fastpathEncMapFloat32Uint64R, (*decFnInfo).fastpathDecMapFloat32Uint64R) + fn(map[float32]int(nil), (*encFnInfo).fastpathEncMapFloat32IntR, (*decFnInfo).fastpathDecMapFloat32IntR) + fn(map[float32]int8(nil), (*encFnInfo).fastpathEncMapFloat32Int8R, (*decFnInfo).fastpathDecMapFloat32Int8R) + fn(map[float32]int16(nil), (*encFnInfo).fastpathEncMapFloat32Int16R, (*decFnInfo).fastpathDecMapFloat32Int16R) + fn(map[float32]int32(nil), (*encFnInfo).fastpathEncMapFloat32Int32R, (*decFnInfo).fastpathDecMapFloat32Int32R) + fn(map[float32]int64(nil), (*encFnInfo).fastpathEncMapFloat32Int64R, (*decFnInfo).fastpathDecMapFloat32Int64R) + fn(map[float32]float32(nil), (*encFnInfo).fastpathEncMapFloat32Float32R, (*decFnInfo).fastpathDecMapFloat32Float32R) + fn(map[float32]float64(nil), (*encFnInfo).fastpathEncMapFloat32Float64R, (*decFnInfo).fastpathDecMapFloat32Float64R) + fn(map[float32]bool(nil), (*encFnInfo).fastpathEncMapFloat32BoolR, (*decFnInfo).fastpathDecMapFloat32BoolR) + fn(map[float64]interface{}(nil), (*encFnInfo).fastpathEncMapFloat64IntfR, (*decFnInfo).fastpathDecMapFloat64IntfR) + fn(map[float64]string(nil), (*encFnInfo).fastpathEncMapFloat64StringR, (*decFnInfo).fastpathDecMapFloat64StringR) + fn(map[float64]uint(nil), (*encFnInfo).fastpathEncMapFloat64UintR, (*decFnInfo).fastpathDecMapFloat64UintR) + fn(map[float64]uint8(nil), (*encFnInfo).fastpathEncMapFloat64Uint8R, (*decFnInfo).fastpathDecMapFloat64Uint8R) + fn(map[float64]uint16(nil), (*encFnInfo).fastpathEncMapFloat64Uint16R, (*decFnInfo).fastpathDecMapFloat64Uint16R) + fn(map[float64]uint32(nil), (*encFnInfo).fastpathEncMapFloat64Uint32R, (*decFnInfo).fastpathDecMapFloat64Uint32R) + fn(map[float64]uint64(nil), (*encFnInfo).fastpathEncMapFloat64Uint64R, (*decFnInfo).fastpathDecMapFloat64Uint64R) + fn(map[float64]int(nil), (*encFnInfo).fastpathEncMapFloat64IntR, (*decFnInfo).fastpathDecMapFloat64IntR) + fn(map[float64]int8(nil), (*encFnInfo).fastpathEncMapFloat64Int8R, (*decFnInfo).fastpathDecMapFloat64Int8R) + fn(map[float64]int16(nil), (*encFnInfo).fastpathEncMapFloat64Int16R, (*decFnInfo).fastpathDecMapFloat64Int16R) + fn(map[float64]int32(nil), (*encFnInfo).fastpathEncMapFloat64Int32R, (*decFnInfo).fastpathDecMapFloat64Int32R) + fn(map[float64]int64(nil), (*encFnInfo).fastpathEncMapFloat64Int64R, (*decFnInfo).fastpathDecMapFloat64Int64R) + fn(map[float64]float32(nil), (*encFnInfo).fastpathEncMapFloat64Float32R, (*decFnInfo).fastpathDecMapFloat64Float32R) + fn(map[float64]float64(nil), (*encFnInfo).fastpathEncMapFloat64Float64R, (*decFnInfo).fastpathDecMapFloat64Float64R) + fn(map[float64]bool(nil), (*encFnInfo).fastpathEncMapFloat64BoolR, (*decFnInfo).fastpathDecMapFloat64BoolR) + fn(map[uint]interface{}(nil), (*encFnInfo).fastpathEncMapUintIntfR, (*decFnInfo).fastpathDecMapUintIntfR) + fn(map[uint]string(nil), (*encFnInfo).fastpathEncMapUintStringR, (*decFnInfo).fastpathDecMapUintStringR) + fn(map[uint]uint(nil), (*encFnInfo).fastpathEncMapUintUintR, (*decFnInfo).fastpathDecMapUintUintR) + fn(map[uint]uint8(nil), (*encFnInfo).fastpathEncMapUintUint8R, (*decFnInfo).fastpathDecMapUintUint8R) + fn(map[uint]uint16(nil), (*encFnInfo).fastpathEncMapUintUint16R, (*decFnInfo).fastpathDecMapUintUint16R) + fn(map[uint]uint32(nil), (*encFnInfo).fastpathEncMapUintUint32R, (*decFnInfo).fastpathDecMapUintUint32R) + fn(map[uint]uint64(nil), (*encFnInfo).fastpathEncMapUintUint64R, (*decFnInfo).fastpathDecMapUintUint64R) + fn(map[uint]int(nil), (*encFnInfo).fastpathEncMapUintIntR, (*decFnInfo).fastpathDecMapUintIntR) + fn(map[uint]int8(nil), (*encFnInfo).fastpathEncMapUintInt8R, (*decFnInfo).fastpathDecMapUintInt8R) + fn(map[uint]int16(nil), (*encFnInfo).fastpathEncMapUintInt16R, (*decFnInfo).fastpathDecMapUintInt16R) + fn(map[uint]int32(nil), (*encFnInfo).fastpathEncMapUintInt32R, (*decFnInfo).fastpathDecMapUintInt32R) + fn(map[uint]int64(nil), (*encFnInfo).fastpathEncMapUintInt64R, (*decFnInfo).fastpathDecMapUintInt64R) + fn(map[uint]float32(nil), (*encFnInfo).fastpathEncMapUintFloat32R, (*decFnInfo).fastpathDecMapUintFloat32R) + fn(map[uint]float64(nil), (*encFnInfo).fastpathEncMapUintFloat64R, (*decFnInfo).fastpathDecMapUintFloat64R) + fn(map[uint]bool(nil), (*encFnInfo).fastpathEncMapUintBoolR, (*decFnInfo).fastpathDecMapUintBoolR) + fn(map[uint8]interface{}(nil), (*encFnInfo).fastpathEncMapUint8IntfR, (*decFnInfo).fastpathDecMapUint8IntfR) + fn(map[uint8]string(nil), (*encFnInfo).fastpathEncMapUint8StringR, (*decFnInfo).fastpathDecMapUint8StringR) + fn(map[uint8]uint(nil), (*encFnInfo).fastpathEncMapUint8UintR, (*decFnInfo).fastpathDecMapUint8UintR) + fn(map[uint8]uint8(nil), (*encFnInfo).fastpathEncMapUint8Uint8R, (*decFnInfo).fastpathDecMapUint8Uint8R) + fn(map[uint8]uint16(nil), (*encFnInfo).fastpathEncMapUint8Uint16R, (*decFnInfo).fastpathDecMapUint8Uint16R) + fn(map[uint8]uint32(nil), (*encFnInfo).fastpathEncMapUint8Uint32R, (*decFnInfo).fastpathDecMapUint8Uint32R) + fn(map[uint8]uint64(nil), (*encFnInfo).fastpathEncMapUint8Uint64R, (*decFnInfo).fastpathDecMapUint8Uint64R) + fn(map[uint8]int(nil), (*encFnInfo).fastpathEncMapUint8IntR, (*decFnInfo).fastpathDecMapUint8IntR) + fn(map[uint8]int8(nil), (*encFnInfo).fastpathEncMapUint8Int8R, (*decFnInfo).fastpathDecMapUint8Int8R) + fn(map[uint8]int16(nil), (*encFnInfo).fastpathEncMapUint8Int16R, (*decFnInfo).fastpathDecMapUint8Int16R) + fn(map[uint8]int32(nil), (*encFnInfo).fastpathEncMapUint8Int32R, (*decFnInfo).fastpathDecMapUint8Int32R) + fn(map[uint8]int64(nil), (*encFnInfo).fastpathEncMapUint8Int64R, (*decFnInfo).fastpathDecMapUint8Int64R) + fn(map[uint8]float32(nil), (*encFnInfo).fastpathEncMapUint8Float32R, (*decFnInfo).fastpathDecMapUint8Float32R) + fn(map[uint8]float64(nil), (*encFnInfo).fastpathEncMapUint8Float64R, (*decFnInfo).fastpathDecMapUint8Float64R) + fn(map[uint8]bool(nil), (*encFnInfo).fastpathEncMapUint8BoolR, (*decFnInfo).fastpathDecMapUint8BoolR) + fn(map[uint16]interface{}(nil), (*encFnInfo).fastpathEncMapUint16IntfR, (*decFnInfo).fastpathDecMapUint16IntfR) + fn(map[uint16]string(nil), (*encFnInfo).fastpathEncMapUint16StringR, (*decFnInfo).fastpathDecMapUint16StringR) + fn(map[uint16]uint(nil), (*encFnInfo).fastpathEncMapUint16UintR, (*decFnInfo).fastpathDecMapUint16UintR) + fn(map[uint16]uint8(nil), (*encFnInfo).fastpathEncMapUint16Uint8R, (*decFnInfo).fastpathDecMapUint16Uint8R) + fn(map[uint16]uint16(nil), (*encFnInfo).fastpathEncMapUint16Uint16R, (*decFnInfo).fastpathDecMapUint16Uint16R) + fn(map[uint16]uint32(nil), (*encFnInfo).fastpathEncMapUint16Uint32R, (*decFnInfo).fastpathDecMapUint16Uint32R) + fn(map[uint16]uint64(nil), (*encFnInfo).fastpathEncMapUint16Uint64R, (*decFnInfo).fastpathDecMapUint16Uint64R) + fn(map[uint16]int(nil), (*encFnInfo).fastpathEncMapUint16IntR, (*decFnInfo).fastpathDecMapUint16IntR) + fn(map[uint16]int8(nil), (*encFnInfo).fastpathEncMapUint16Int8R, (*decFnInfo).fastpathDecMapUint16Int8R) + fn(map[uint16]int16(nil), (*encFnInfo).fastpathEncMapUint16Int16R, (*decFnInfo).fastpathDecMapUint16Int16R) + fn(map[uint16]int32(nil), (*encFnInfo).fastpathEncMapUint16Int32R, (*decFnInfo).fastpathDecMapUint16Int32R) + fn(map[uint16]int64(nil), (*encFnInfo).fastpathEncMapUint16Int64R, (*decFnInfo).fastpathDecMapUint16Int64R) + fn(map[uint16]float32(nil), (*encFnInfo).fastpathEncMapUint16Float32R, (*decFnInfo).fastpathDecMapUint16Float32R) + fn(map[uint16]float64(nil), (*encFnInfo).fastpathEncMapUint16Float64R, (*decFnInfo).fastpathDecMapUint16Float64R) + fn(map[uint16]bool(nil), (*encFnInfo).fastpathEncMapUint16BoolR, (*decFnInfo).fastpathDecMapUint16BoolR) + fn(map[uint32]interface{}(nil), (*encFnInfo).fastpathEncMapUint32IntfR, (*decFnInfo).fastpathDecMapUint32IntfR) + fn(map[uint32]string(nil), (*encFnInfo).fastpathEncMapUint32StringR, (*decFnInfo).fastpathDecMapUint32StringR) + fn(map[uint32]uint(nil), (*encFnInfo).fastpathEncMapUint32UintR, (*decFnInfo).fastpathDecMapUint32UintR) + fn(map[uint32]uint8(nil), (*encFnInfo).fastpathEncMapUint32Uint8R, (*decFnInfo).fastpathDecMapUint32Uint8R) + fn(map[uint32]uint16(nil), (*encFnInfo).fastpathEncMapUint32Uint16R, (*decFnInfo).fastpathDecMapUint32Uint16R) + fn(map[uint32]uint32(nil), (*encFnInfo).fastpathEncMapUint32Uint32R, (*decFnInfo).fastpathDecMapUint32Uint32R) + fn(map[uint32]uint64(nil), (*encFnInfo).fastpathEncMapUint32Uint64R, (*decFnInfo).fastpathDecMapUint32Uint64R) + fn(map[uint32]int(nil), (*encFnInfo).fastpathEncMapUint32IntR, (*decFnInfo).fastpathDecMapUint32IntR) + fn(map[uint32]int8(nil), (*encFnInfo).fastpathEncMapUint32Int8R, (*decFnInfo).fastpathDecMapUint32Int8R) + fn(map[uint32]int16(nil), (*encFnInfo).fastpathEncMapUint32Int16R, (*decFnInfo).fastpathDecMapUint32Int16R) + fn(map[uint32]int32(nil), (*encFnInfo).fastpathEncMapUint32Int32R, (*decFnInfo).fastpathDecMapUint32Int32R) + fn(map[uint32]int64(nil), (*encFnInfo).fastpathEncMapUint32Int64R, (*decFnInfo).fastpathDecMapUint32Int64R) + fn(map[uint32]float32(nil), (*encFnInfo).fastpathEncMapUint32Float32R, (*decFnInfo).fastpathDecMapUint32Float32R) + fn(map[uint32]float64(nil), (*encFnInfo).fastpathEncMapUint32Float64R, (*decFnInfo).fastpathDecMapUint32Float64R) + fn(map[uint32]bool(nil), (*encFnInfo).fastpathEncMapUint32BoolR, (*decFnInfo).fastpathDecMapUint32BoolR) + fn(map[uint64]interface{}(nil), (*encFnInfo).fastpathEncMapUint64IntfR, (*decFnInfo).fastpathDecMapUint64IntfR) + fn(map[uint64]string(nil), (*encFnInfo).fastpathEncMapUint64StringR, (*decFnInfo).fastpathDecMapUint64StringR) + fn(map[uint64]uint(nil), (*encFnInfo).fastpathEncMapUint64UintR, (*decFnInfo).fastpathDecMapUint64UintR) + fn(map[uint64]uint8(nil), (*encFnInfo).fastpathEncMapUint64Uint8R, (*decFnInfo).fastpathDecMapUint64Uint8R) + fn(map[uint64]uint16(nil), (*encFnInfo).fastpathEncMapUint64Uint16R, (*decFnInfo).fastpathDecMapUint64Uint16R) + fn(map[uint64]uint32(nil), (*encFnInfo).fastpathEncMapUint64Uint32R, (*decFnInfo).fastpathDecMapUint64Uint32R) + fn(map[uint64]uint64(nil), (*encFnInfo).fastpathEncMapUint64Uint64R, (*decFnInfo).fastpathDecMapUint64Uint64R) + fn(map[uint64]int(nil), (*encFnInfo).fastpathEncMapUint64IntR, (*decFnInfo).fastpathDecMapUint64IntR) + fn(map[uint64]int8(nil), (*encFnInfo).fastpathEncMapUint64Int8R, (*decFnInfo).fastpathDecMapUint64Int8R) + fn(map[uint64]int16(nil), (*encFnInfo).fastpathEncMapUint64Int16R, (*decFnInfo).fastpathDecMapUint64Int16R) + fn(map[uint64]int32(nil), (*encFnInfo).fastpathEncMapUint64Int32R, (*decFnInfo).fastpathDecMapUint64Int32R) + fn(map[uint64]int64(nil), (*encFnInfo).fastpathEncMapUint64Int64R, (*decFnInfo).fastpathDecMapUint64Int64R) + fn(map[uint64]float32(nil), (*encFnInfo).fastpathEncMapUint64Float32R, (*decFnInfo).fastpathDecMapUint64Float32R) + fn(map[uint64]float64(nil), (*encFnInfo).fastpathEncMapUint64Float64R, (*decFnInfo).fastpathDecMapUint64Float64R) + fn(map[uint64]bool(nil), (*encFnInfo).fastpathEncMapUint64BoolR, (*decFnInfo).fastpathDecMapUint64BoolR) + fn(map[int]interface{}(nil), (*encFnInfo).fastpathEncMapIntIntfR, (*decFnInfo).fastpathDecMapIntIntfR) + fn(map[int]string(nil), (*encFnInfo).fastpathEncMapIntStringR, (*decFnInfo).fastpathDecMapIntStringR) + fn(map[int]uint(nil), (*encFnInfo).fastpathEncMapIntUintR, (*decFnInfo).fastpathDecMapIntUintR) + fn(map[int]uint8(nil), (*encFnInfo).fastpathEncMapIntUint8R, (*decFnInfo).fastpathDecMapIntUint8R) + fn(map[int]uint16(nil), (*encFnInfo).fastpathEncMapIntUint16R, (*decFnInfo).fastpathDecMapIntUint16R) + fn(map[int]uint32(nil), (*encFnInfo).fastpathEncMapIntUint32R, (*decFnInfo).fastpathDecMapIntUint32R) + fn(map[int]uint64(nil), (*encFnInfo).fastpathEncMapIntUint64R, (*decFnInfo).fastpathDecMapIntUint64R) + fn(map[int]int(nil), (*encFnInfo).fastpathEncMapIntIntR, (*decFnInfo).fastpathDecMapIntIntR) + fn(map[int]int8(nil), (*encFnInfo).fastpathEncMapIntInt8R, (*decFnInfo).fastpathDecMapIntInt8R) + fn(map[int]int16(nil), (*encFnInfo).fastpathEncMapIntInt16R, (*decFnInfo).fastpathDecMapIntInt16R) + fn(map[int]int32(nil), (*encFnInfo).fastpathEncMapIntInt32R, (*decFnInfo).fastpathDecMapIntInt32R) + fn(map[int]int64(nil), (*encFnInfo).fastpathEncMapIntInt64R, (*decFnInfo).fastpathDecMapIntInt64R) + fn(map[int]float32(nil), (*encFnInfo).fastpathEncMapIntFloat32R, (*decFnInfo).fastpathDecMapIntFloat32R) + fn(map[int]float64(nil), (*encFnInfo).fastpathEncMapIntFloat64R, (*decFnInfo).fastpathDecMapIntFloat64R) + fn(map[int]bool(nil), (*encFnInfo).fastpathEncMapIntBoolR, (*decFnInfo).fastpathDecMapIntBoolR) + fn(map[int8]interface{}(nil), (*encFnInfo).fastpathEncMapInt8IntfR, (*decFnInfo).fastpathDecMapInt8IntfR) + fn(map[int8]string(nil), (*encFnInfo).fastpathEncMapInt8StringR, (*decFnInfo).fastpathDecMapInt8StringR) + fn(map[int8]uint(nil), (*encFnInfo).fastpathEncMapInt8UintR, (*decFnInfo).fastpathDecMapInt8UintR) + fn(map[int8]uint8(nil), (*encFnInfo).fastpathEncMapInt8Uint8R, (*decFnInfo).fastpathDecMapInt8Uint8R) + fn(map[int8]uint16(nil), (*encFnInfo).fastpathEncMapInt8Uint16R, (*decFnInfo).fastpathDecMapInt8Uint16R) + fn(map[int8]uint32(nil), (*encFnInfo).fastpathEncMapInt8Uint32R, (*decFnInfo).fastpathDecMapInt8Uint32R) + fn(map[int8]uint64(nil), (*encFnInfo).fastpathEncMapInt8Uint64R, (*decFnInfo).fastpathDecMapInt8Uint64R) + fn(map[int8]int(nil), (*encFnInfo).fastpathEncMapInt8IntR, (*decFnInfo).fastpathDecMapInt8IntR) + fn(map[int8]int8(nil), (*encFnInfo).fastpathEncMapInt8Int8R, (*decFnInfo).fastpathDecMapInt8Int8R) + fn(map[int8]int16(nil), (*encFnInfo).fastpathEncMapInt8Int16R, (*decFnInfo).fastpathDecMapInt8Int16R) + fn(map[int8]int32(nil), (*encFnInfo).fastpathEncMapInt8Int32R, (*decFnInfo).fastpathDecMapInt8Int32R) + fn(map[int8]int64(nil), (*encFnInfo).fastpathEncMapInt8Int64R, (*decFnInfo).fastpathDecMapInt8Int64R) + fn(map[int8]float32(nil), (*encFnInfo).fastpathEncMapInt8Float32R, (*decFnInfo).fastpathDecMapInt8Float32R) + fn(map[int8]float64(nil), (*encFnInfo).fastpathEncMapInt8Float64R, (*decFnInfo).fastpathDecMapInt8Float64R) + fn(map[int8]bool(nil), (*encFnInfo).fastpathEncMapInt8BoolR, (*decFnInfo).fastpathDecMapInt8BoolR) + fn(map[int16]interface{}(nil), (*encFnInfo).fastpathEncMapInt16IntfR, (*decFnInfo).fastpathDecMapInt16IntfR) + fn(map[int16]string(nil), (*encFnInfo).fastpathEncMapInt16StringR, (*decFnInfo).fastpathDecMapInt16StringR) + fn(map[int16]uint(nil), (*encFnInfo).fastpathEncMapInt16UintR, (*decFnInfo).fastpathDecMapInt16UintR) + fn(map[int16]uint8(nil), (*encFnInfo).fastpathEncMapInt16Uint8R, (*decFnInfo).fastpathDecMapInt16Uint8R) + fn(map[int16]uint16(nil), (*encFnInfo).fastpathEncMapInt16Uint16R, (*decFnInfo).fastpathDecMapInt16Uint16R) + fn(map[int16]uint32(nil), (*encFnInfo).fastpathEncMapInt16Uint32R, (*decFnInfo).fastpathDecMapInt16Uint32R) + fn(map[int16]uint64(nil), (*encFnInfo).fastpathEncMapInt16Uint64R, (*decFnInfo).fastpathDecMapInt16Uint64R) + fn(map[int16]int(nil), (*encFnInfo).fastpathEncMapInt16IntR, (*decFnInfo).fastpathDecMapInt16IntR) + fn(map[int16]int8(nil), (*encFnInfo).fastpathEncMapInt16Int8R, (*decFnInfo).fastpathDecMapInt16Int8R) + fn(map[int16]int16(nil), (*encFnInfo).fastpathEncMapInt16Int16R, (*decFnInfo).fastpathDecMapInt16Int16R) + fn(map[int16]int32(nil), (*encFnInfo).fastpathEncMapInt16Int32R, (*decFnInfo).fastpathDecMapInt16Int32R) + fn(map[int16]int64(nil), (*encFnInfo).fastpathEncMapInt16Int64R, (*decFnInfo).fastpathDecMapInt16Int64R) + fn(map[int16]float32(nil), (*encFnInfo).fastpathEncMapInt16Float32R, (*decFnInfo).fastpathDecMapInt16Float32R) + fn(map[int16]float64(nil), (*encFnInfo).fastpathEncMapInt16Float64R, (*decFnInfo).fastpathDecMapInt16Float64R) + fn(map[int16]bool(nil), (*encFnInfo).fastpathEncMapInt16BoolR, (*decFnInfo).fastpathDecMapInt16BoolR) + fn(map[int32]interface{}(nil), (*encFnInfo).fastpathEncMapInt32IntfR, (*decFnInfo).fastpathDecMapInt32IntfR) + fn(map[int32]string(nil), (*encFnInfo).fastpathEncMapInt32StringR, (*decFnInfo).fastpathDecMapInt32StringR) + fn(map[int32]uint(nil), (*encFnInfo).fastpathEncMapInt32UintR, (*decFnInfo).fastpathDecMapInt32UintR) + fn(map[int32]uint8(nil), (*encFnInfo).fastpathEncMapInt32Uint8R, (*decFnInfo).fastpathDecMapInt32Uint8R) + fn(map[int32]uint16(nil), (*encFnInfo).fastpathEncMapInt32Uint16R, (*decFnInfo).fastpathDecMapInt32Uint16R) + fn(map[int32]uint32(nil), (*encFnInfo).fastpathEncMapInt32Uint32R, (*decFnInfo).fastpathDecMapInt32Uint32R) + fn(map[int32]uint64(nil), (*encFnInfo).fastpathEncMapInt32Uint64R, (*decFnInfo).fastpathDecMapInt32Uint64R) + fn(map[int32]int(nil), (*encFnInfo).fastpathEncMapInt32IntR, (*decFnInfo).fastpathDecMapInt32IntR) + fn(map[int32]int8(nil), (*encFnInfo).fastpathEncMapInt32Int8R, (*decFnInfo).fastpathDecMapInt32Int8R) + fn(map[int32]int16(nil), (*encFnInfo).fastpathEncMapInt32Int16R, (*decFnInfo).fastpathDecMapInt32Int16R) + fn(map[int32]int32(nil), (*encFnInfo).fastpathEncMapInt32Int32R, (*decFnInfo).fastpathDecMapInt32Int32R) + fn(map[int32]int64(nil), (*encFnInfo).fastpathEncMapInt32Int64R, (*decFnInfo).fastpathDecMapInt32Int64R) + fn(map[int32]float32(nil), (*encFnInfo).fastpathEncMapInt32Float32R, (*decFnInfo).fastpathDecMapInt32Float32R) + fn(map[int32]float64(nil), (*encFnInfo).fastpathEncMapInt32Float64R, (*decFnInfo).fastpathDecMapInt32Float64R) + fn(map[int32]bool(nil), (*encFnInfo).fastpathEncMapInt32BoolR, (*decFnInfo).fastpathDecMapInt32BoolR) + fn(map[int64]interface{}(nil), (*encFnInfo).fastpathEncMapInt64IntfR, (*decFnInfo).fastpathDecMapInt64IntfR) + fn(map[int64]string(nil), (*encFnInfo).fastpathEncMapInt64StringR, (*decFnInfo).fastpathDecMapInt64StringR) + fn(map[int64]uint(nil), (*encFnInfo).fastpathEncMapInt64UintR, (*decFnInfo).fastpathDecMapInt64UintR) + fn(map[int64]uint8(nil), (*encFnInfo).fastpathEncMapInt64Uint8R, (*decFnInfo).fastpathDecMapInt64Uint8R) + fn(map[int64]uint16(nil), (*encFnInfo).fastpathEncMapInt64Uint16R, (*decFnInfo).fastpathDecMapInt64Uint16R) + fn(map[int64]uint32(nil), (*encFnInfo).fastpathEncMapInt64Uint32R, (*decFnInfo).fastpathDecMapInt64Uint32R) + fn(map[int64]uint64(nil), (*encFnInfo).fastpathEncMapInt64Uint64R, (*decFnInfo).fastpathDecMapInt64Uint64R) + fn(map[int64]int(nil), (*encFnInfo).fastpathEncMapInt64IntR, (*decFnInfo).fastpathDecMapInt64IntR) + fn(map[int64]int8(nil), (*encFnInfo).fastpathEncMapInt64Int8R, (*decFnInfo).fastpathDecMapInt64Int8R) + fn(map[int64]int16(nil), (*encFnInfo).fastpathEncMapInt64Int16R, (*decFnInfo).fastpathDecMapInt64Int16R) + fn(map[int64]int32(nil), (*encFnInfo).fastpathEncMapInt64Int32R, (*decFnInfo).fastpathDecMapInt64Int32R) + fn(map[int64]int64(nil), (*encFnInfo).fastpathEncMapInt64Int64R, (*decFnInfo).fastpathDecMapInt64Int64R) + fn(map[int64]float32(nil), (*encFnInfo).fastpathEncMapInt64Float32R, (*decFnInfo).fastpathDecMapInt64Float32R) + fn(map[int64]float64(nil), (*encFnInfo).fastpathEncMapInt64Float64R, (*decFnInfo).fastpathDecMapInt64Float64R) + fn(map[int64]bool(nil), (*encFnInfo).fastpathEncMapInt64BoolR, (*decFnInfo).fastpathDecMapInt64BoolR) + fn(map[bool]interface{}(nil), (*encFnInfo).fastpathEncMapBoolIntfR, (*decFnInfo).fastpathDecMapBoolIntfR) + fn(map[bool]string(nil), (*encFnInfo).fastpathEncMapBoolStringR, (*decFnInfo).fastpathDecMapBoolStringR) + fn(map[bool]uint(nil), (*encFnInfo).fastpathEncMapBoolUintR, (*decFnInfo).fastpathDecMapBoolUintR) + fn(map[bool]uint8(nil), (*encFnInfo).fastpathEncMapBoolUint8R, (*decFnInfo).fastpathDecMapBoolUint8R) + fn(map[bool]uint16(nil), (*encFnInfo).fastpathEncMapBoolUint16R, (*decFnInfo).fastpathDecMapBoolUint16R) + fn(map[bool]uint32(nil), (*encFnInfo).fastpathEncMapBoolUint32R, (*decFnInfo).fastpathDecMapBoolUint32R) + fn(map[bool]uint64(nil), (*encFnInfo).fastpathEncMapBoolUint64R, (*decFnInfo).fastpathDecMapBoolUint64R) + fn(map[bool]int(nil), (*encFnInfo).fastpathEncMapBoolIntR, (*decFnInfo).fastpathDecMapBoolIntR) + fn(map[bool]int8(nil), (*encFnInfo).fastpathEncMapBoolInt8R, (*decFnInfo).fastpathDecMapBoolInt8R) + fn(map[bool]int16(nil), (*encFnInfo).fastpathEncMapBoolInt16R, (*decFnInfo).fastpathDecMapBoolInt16R) + fn(map[bool]int32(nil), (*encFnInfo).fastpathEncMapBoolInt32R, (*decFnInfo).fastpathDecMapBoolInt32R) + fn(map[bool]int64(nil), (*encFnInfo).fastpathEncMapBoolInt64R, (*decFnInfo).fastpathDecMapBoolInt64R) + fn(map[bool]float32(nil), (*encFnInfo).fastpathEncMapBoolFloat32R, (*decFnInfo).fastpathDecMapBoolFloat32R) + fn(map[bool]float64(nil), (*encFnInfo).fastpathEncMapBoolFloat64R, (*decFnInfo).fastpathDecMapBoolFloat64R) + fn(map[bool]bool(nil), (*encFnInfo).fastpathEncMapBoolBoolR, (*decFnInfo).fastpathDecMapBoolBoolR) sort.Sort(fastpathAslice(fastpathAV[:])) } @@ -2759,7 +2759,7 @@ func fastpathEncodeTypeSwitchMap(iv interface{}, e *Encoder) bool { // -- -- fast path functions -func (f encFnInfo) fastpathEncSliceIntfR(rv reflect.Value) { +func (f *encFnInfo) fastpathEncSliceIntfR(rv reflect.Value) { fastpathTV.EncSliceIntfV(rv.Interface().([]interface{}), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncSliceIntfV(v []interface{}, checkNil bool, e *Encoder) { @@ -2769,22 +2769,13 @@ func (_ fastpathT) EncSliceIntfV(v []interface{}, checkNil bool, e *Encoder) { return } ee.EncodeArrayStart(len(v)) - if e.be { - for _, v2 := range v { - e.encode(v2) - } - } else { - for j, v2 := range v { - if j > 0 { - ee.EncodeArrayEntrySeparator() - } - e.encode(v2) - } - ee.EncodeArrayEnd() + for _, v2 := range v { + e.encode(v2) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncSliceStringR(rv reflect.Value) { +func (f *encFnInfo) fastpathEncSliceStringR(rv reflect.Value) { fastpathTV.EncSliceStringV(rv.Interface().([]string), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncSliceStringV(v []string, checkNil bool, e *Encoder) { @@ -2794,22 +2785,13 @@ func (_ fastpathT) EncSliceStringV(v []string, checkNil bool, e *Encoder) { return } ee.EncodeArrayStart(len(v)) - if e.be { - for _, v2 := range v { - ee.EncodeString(c_UTF8, v2) - } - } else { - for j, v2 := range v { - if j > 0 { - ee.EncodeArrayEntrySeparator() - } - ee.EncodeString(c_UTF8, v2) - } - ee.EncodeArrayEnd() + for _, v2 := range v { + ee.EncodeString(c_UTF8, v2) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncSliceFloat32R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncSliceFloat32R(rv reflect.Value) { fastpathTV.EncSliceFloat32V(rv.Interface().([]float32), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncSliceFloat32V(v []float32, checkNil bool, e *Encoder) { @@ -2819,22 +2801,13 @@ func (_ fastpathT) EncSliceFloat32V(v []float32, checkNil bool, e *Encoder) { return } ee.EncodeArrayStart(len(v)) - if e.be { - for _, v2 := range v { - ee.EncodeFloat32(v2) - } - } else { - for j, v2 := range v { - if j > 0 { - ee.EncodeArrayEntrySeparator() - } - ee.EncodeFloat32(v2) - } - ee.EncodeArrayEnd() + for _, v2 := range v { + ee.EncodeFloat32(v2) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncSliceFloat64R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncSliceFloat64R(rv reflect.Value) { fastpathTV.EncSliceFloat64V(rv.Interface().([]float64), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncSliceFloat64V(v []float64, checkNil bool, e *Encoder) { @@ -2844,22 +2817,13 @@ func (_ fastpathT) EncSliceFloat64V(v []float64, checkNil bool, e *Encoder) { return } ee.EncodeArrayStart(len(v)) - if e.be { - for _, v2 := range v { - ee.EncodeFloat64(v2) - } - } else { - for j, v2 := range v { - if j > 0 { - ee.EncodeArrayEntrySeparator() - } - ee.EncodeFloat64(v2) - } - ee.EncodeArrayEnd() + for _, v2 := range v { + ee.EncodeFloat64(v2) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncSliceUintR(rv reflect.Value) { +func (f *encFnInfo) fastpathEncSliceUintR(rv reflect.Value) { fastpathTV.EncSliceUintV(rv.Interface().([]uint), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncSliceUintV(v []uint, checkNil bool, e *Encoder) { @@ -2869,22 +2833,13 @@ func (_ fastpathT) EncSliceUintV(v []uint, checkNil bool, e *Encoder) { return } ee.EncodeArrayStart(len(v)) - if e.be { - for _, v2 := range v { - ee.EncodeUint(uint64(v2)) - } - } else { - for j, v2 := range v { - if j > 0 { - ee.EncodeArrayEntrySeparator() - } - ee.EncodeUint(uint64(v2)) - } - ee.EncodeArrayEnd() + for _, v2 := range v { + ee.EncodeUint(uint64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncSliceUint16R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncSliceUint16R(rv reflect.Value) { fastpathTV.EncSliceUint16V(rv.Interface().([]uint16), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncSliceUint16V(v []uint16, checkNil bool, e *Encoder) { @@ -2894,22 +2849,13 @@ func (_ fastpathT) EncSliceUint16V(v []uint16, checkNil bool, e *Encoder) { return } ee.EncodeArrayStart(len(v)) - if e.be { - for _, v2 := range v { - ee.EncodeUint(uint64(v2)) - } - } else { - for j, v2 := range v { - if j > 0 { - ee.EncodeArrayEntrySeparator() - } - ee.EncodeUint(uint64(v2)) - } - ee.EncodeArrayEnd() + for _, v2 := range v { + ee.EncodeUint(uint64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncSliceUint32R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncSliceUint32R(rv reflect.Value) { fastpathTV.EncSliceUint32V(rv.Interface().([]uint32), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncSliceUint32V(v []uint32, checkNil bool, e *Encoder) { @@ -2919,22 +2865,13 @@ func (_ fastpathT) EncSliceUint32V(v []uint32, checkNil bool, e *Encoder) { return } ee.EncodeArrayStart(len(v)) - if e.be { - for _, v2 := range v { - ee.EncodeUint(uint64(v2)) - } - } else { - for j, v2 := range v { - if j > 0 { - ee.EncodeArrayEntrySeparator() - } - ee.EncodeUint(uint64(v2)) - } - ee.EncodeArrayEnd() + for _, v2 := range v { + ee.EncodeUint(uint64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncSliceUint64R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncSliceUint64R(rv reflect.Value) { fastpathTV.EncSliceUint64V(rv.Interface().([]uint64), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncSliceUint64V(v []uint64, checkNil bool, e *Encoder) { @@ -2944,22 +2881,13 @@ func (_ fastpathT) EncSliceUint64V(v []uint64, checkNil bool, e *Encoder) { return } ee.EncodeArrayStart(len(v)) - if e.be { - for _, v2 := range v { - ee.EncodeUint(uint64(v2)) - } - } else { - for j, v2 := range v { - if j > 0 { - ee.EncodeArrayEntrySeparator() - } - ee.EncodeUint(uint64(v2)) - } - ee.EncodeArrayEnd() + for _, v2 := range v { + ee.EncodeUint(uint64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncSliceIntR(rv reflect.Value) { +func (f *encFnInfo) fastpathEncSliceIntR(rv reflect.Value) { fastpathTV.EncSliceIntV(rv.Interface().([]int), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncSliceIntV(v []int, checkNil bool, e *Encoder) { @@ -2969,22 +2897,13 @@ func (_ fastpathT) EncSliceIntV(v []int, checkNil bool, e *Encoder) { return } ee.EncodeArrayStart(len(v)) - if e.be { - for _, v2 := range v { - ee.EncodeInt(int64(v2)) - } - } else { - for j, v2 := range v { - if j > 0 { - ee.EncodeArrayEntrySeparator() - } - ee.EncodeInt(int64(v2)) - } - ee.EncodeArrayEnd() + for _, v2 := range v { + ee.EncodeInt(int64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncSliceInt8R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncSliceInt8R(rv reflect.Value) { fastpathTV.EncSliceInt8V(rv.Interface().([]int8), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncSliceInt8V(v []int8, checkNil bool, e *Encoder) { @@ -2994,22 +2913,13 @@ func (_ fastpathT) EncSliceInt8V(v []int8, checkNil bool, e *Encoder) { return } ee.EncodeArrayStart(len(v)) - if e.be { - for _, v2 := range v { - ee.EncodeInt(int64(v2)) - } - } else { - for j, v2 := range v { - if j > 0 { - ee.EncodeArrayEntrySeparator() - } - ee.EncodeInt(int64(v2)) - } - ee.EncodeArrayEnd() + for _, v2 := range v { + ee.EncodeInt(int64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncSliceInt16R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncSliceInt16R(rv reflect.Value) { fastpathTV.EncSliceInt16V(rv.Interface().([]int16), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncSliceInt16V(v []int16, checkNil bool, e *Encoder) { @@ -3019,22 +2929,13 @@ func (_ fastpathT) EncSliceInt16V(v []int16, checkNil bool, e *Encoder) { return } ee.EncodeArrayStart(len(v)) - if e.be { - for _, v2 := range v { - ee.EncodeInt(int64(v2)) - } - } else { - for j, v2 := range v { - if j > 0 { - ee.EncodeArrayEntrySeparator() - } - ee.EncodeInt(int64(v2)) - } - ee.EncodeArrayEnd() + for _, v2 := range v { + ee.EncodeInt(int64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncSliceInt32R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncSliceInt32R(rv reflect.Value) { fastpathTV.EncSliceInt32V(rv.Interface().([]int32), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncSliceInt32V(v []int32, checkNil bool, e *Encoder) { @@ -3044,22 +2945,13 @@ func (_ fastpathT) EncSliceInt32V(v []int32, checkNil bool, e *Encoder) { return } ee.EncodeArrayStart(len(v)) - if e.be { - for _, v2 := range v { - ee.EncodeInt(int64(v2)) - } - } else { - for j, v2 := range v { - if j > 0 { - ee.EncodeArrayEntrySeparator() - } - ee.EncodeInt(int64(v2)) - } - ee.EncodeArrayEnd() + for _, v2 := range v { + ee.EncodeInt(int64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncSliceInt64R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncSliceInt64R(rv reflect.Value) { fastpathTV.EncSliceInt64V(rv.Interface().([]int64), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncSliceInt64V(v []int64, checkNil bool, e *Encoder) { @@ -3069,22 +2961,13 @@ func (_ fastpathT) EncSliceInt64V(v []int64, checkNil bool, e *Encoder) { return } ee.EncodeArrayStart(len(v)) - if e.be { - for _, v2 := range v { - ee.EncodeInt(int64(v2)) - } - } else { - for j, v2 := range v { - if j > 0 { - ee.EncodeArrayEntrySeparator() - } - ee.EncodeInt(int64(v2)) - } - ee.EncodeArrayEnd() + for _, v2 := range v { + ee.EncodeInt(int64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncSliceBoolR(rv reflect.Value) { +func (f *encFnInfo) fastpathEncSliceBoolR(rv reflect.Value) { fastpathTV.EncSliceBoolV(rv.Interface().([]bool), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncSliceBoolV(v []bool, checkNil bool, e *Encoder) { @@ -3094,22 +2977,13 @@ func (_ fastpathT) EncSliceBoolV(v []bool, checkNil bool, e *Encoder) { return } ee.EncodeArrayStart(len(v)) - if e.be { - for _, v2 := range v { - ee.EncodeBool(v2) - } - } else { - for j, v2 := range v { - if j > 0 { - ee.EncodeArrayEntrySeparator() - } - ee.EncodeBool(v2) - } - ee.EncodeArrayEnd() + for _, v2 := range v { + ee.EncodeBool(v2) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapIntfIntfR(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapIntfIntfR(rv reflect.Value) { fastpathTV.EncMapIntfIntfV(rv.Interface().(map[interface{}]interface{}), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapIntfIntfV(v map[interface{}]interface{}, checkNil bool, e *Encoder) { @@ -3120,27 +2994,14 @@ func (_ fastpathT) EncMapIntfIntfV(v map[interface{}]interface{}, checkNil bool, } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - e.encode(k2) - e.encode(v2) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - e.encode(k2) - ee.EncodeMapKVSeparator() - e.encode(v2) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + e.encode(k2) + e.encode(v2) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapIntfStringR(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapIntfStringR(rv reflect.Value) { fastpathTV.EncMapIntfStringV(rv.Interface().(map[interface{}]string), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapIntfStringV(v map[interface{}]string, checkNil bool, e *Encoder) { @@ -3151,27 +3012,14 @@ func (_ fastpathT) EncMapIntfStringV(v map[interface{}]string, checkNil bool, e } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - e.encode(k2) - ee.EncodeString(c_UTF8, v2) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - e.encode(k2) - ee.EncodeMapKVSeparator() - ee.EncodeString(c_UTF8, v2) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + e.encode(k2) + ee.EncodeString(c_UTF8, v2) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapIntfUintR(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapIntfUintR(rv reflect.Value) { fastpathTV.EncMapIntfUintV(rv.Interface().(map[interface{}]uint), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapIntfUintV(v map[interface{}]uint, checkNil bool, e *Encoder) { @@ -3182,27 +3030,14 @@ func (_ fastpathT) EncMapIntfUintV(v map[interface{}]uint, checkNil bool, e *Enc } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - e.encode(k2) - ee.EncodeUint(uint64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - e.encode(k2) - ee.EncodeMapKVSeparator() - ee.EncodeUint(uint64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + e.encode(k2) + ee.EncodeUint(uint64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapIntfUint8R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapIntfUint8R(rv reflect.Value) { fastpathTV.EncMapIntfUint8V(rv.Interface().(map[interface{}]uint8), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapIntfUint8V(v map[interface{}]uint8, checkNil bool, e *Encoder) { @@ -3213,27 +3048,14 @@ func (_ fastpathT) EncMapIntfUint8V(v map[interface{}]uint8, checkNil bool, e *E } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - e.encode(k2) - ee.EncodeUint(uint64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - e.encode(k2) - ee.EncodeMapKVSeparator() - ee.EncodeUint(uint64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + e.encode(k2) + ee.EncodeUint(uint64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapIntfUint16R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapIntfUint16R(rv reflect.Value) { fastpathTV.EncMapIntfUint16V(rv.Interface().(map[interface{}]uint16), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapIntfUint16V(v map[interface{}]uint16, checkNil bool, e *Encoder) { @@ -3244,27 +3066,14 @@ func (_ fastpathT) EncMapIntfUint16V(v map[interface{}]uint16, checkNil bool, e } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - e.encode(k2) - ee.EncodeUint(uint64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - e.encode(k2) - ee.EncodeMapKVSeparator() - ee.EncodeUint(uint64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + e.encode(k2) + ee.EncodeUint(uint64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapIntfUint32R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapIntfUint32R(rv reflect.Value) { fastpathTV.EncMapIntfUint32V(rv.Interface().(map[interface{}]uint32), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapIntfUint32V(v map[interface{}]uint32, checkNil bool, e *Encoder) { @@ -3275,27 +3084,14 @@ func (_ fastpathT) EncMapIntfUint32V(v map[interface{}]uint32, checkNil bool, e } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - e.encode(k2) - ee.EncodeUint(uint64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - e.encode(k2) - ee.EncodeMapKVSeparator() - ee.EncodeUint(uint64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + e.encode(k2) + ee.EncodeUint(uint64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapIntfUint64R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapIntfUint64R(rv reflect.Value) { fastpathTV.EncMapIntfUint64V(rv.Interface().(map[interface{}]uint64), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapIntfUint64V(v map[interface{}]uint64, checkNil bool, e *Encoder) { @@ -3306,27 +3102,14 @@ func (_ fastpathT) EncMapIntfUint64V(v map[interface{}]uint64, checkNil bool, e } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - e.encode(k2) - ee.EncodeUint(uint64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - e.encode(k2) - ee.EncodeMapKVSeparator() - ee.EncodeUint(uint64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + e.encode(k2) + ee.EncodeUint(uint64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapIntfIntR(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapIntfIntR(rv reflect.Value) { fastpathTV.EncMapIntfIntV(rv.Interface().(map[interface{}]int), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapIntfIntV(v map[interface{}]int, checkNil bool, e *Encoder) { @@ -3337,27 +3120,14 @@ func (_ fastpathT) EncMapIntfIntV(v map[interface{}]int, checkNil bool, e *Encod } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - e.encode(k2) - ee.EncodeInt(int64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - e.encode(k2) - ee.EncodeMapKVSeparator() - ee.EncodeInt(int64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + e.encode(k2) + ee.EncodeInt(int64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapIntfInt8R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapIntfInt8R(rv reflect.Value) { fastpathTV.EncMapIntfInt8V(rv.Interface().(map[interface{}]int8), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapIntfInt8V(v map[interface{}]int8, checkNil bool, e *Encoder) { @@ -3368,27 +3138,14 @@ func (_ fastpathT) EncMapIntfInt8V(v map[interface{}]int8, checkNil bool, e *Enc } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - e.encode(k2) - ee.EncodeInt(int64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - e.encode(k2) - ee.EncodeMapKVSeparator() - ee.EncodeInt(int64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + e.encode(k2) + ee.EncodeInt(int64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapIntfInt16R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapIntfInt16R(rv reflect.Value) { fastpathTV.EncMapIntfInt16V(rv.Interface().(map[interface{}]int16), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapIntfInt16V(v map[interface{}]int16, checkNil bool, e *Encoder) { @@ -3399,27 +3156,14 @@ func (_ fastpathT) EncMapIntfInt16V(v map[interface{}]int16, checkNil bool, e *E } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - e.encode(k2) - ee.EncodeInt(int64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - e.encode(k2) - ee.EncodeMapKVSeparator() - ee.EncodeInt(int64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + e.encode(k2) + ee.EncodeInt(int64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapIntfInt32R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapIntfInt32R(rv reflect.Value) { fastpathTV.EncMapIntfInt32V(rv.Interface().(map[interface{}]int32), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapIntfInt32V(v map[interface{}]int32, checkNil bool, e *Encoder) { @@ -3430,27 +3174,14 @@ func (_ fastpathT) EncMapIntfInt32V(v map[interface{}]int32, checkNil bool, e *E } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - e.encode(k2) - ee.EncodeInt(int64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - e.encode(k2) - ee.EncodeMapKVSeparator() - ee.EncodeInt(int64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + e.encode(k2) + ee.EncodeInt(int64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapIntfInt64R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapIntfInt64R(rv reflect.Value) { fastpathTV.EncMapIntfInt64V(rv.Interface().(map[interface{}]int64), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapIntfInt64V(v map[interface{}]int64, checkNil bool, e *Encoder) { @@ -3461,27 +3192,14 @@ func (_ fastpathT) EncMapIntfInt64V(v map[interface{}]int64, checkNil bool, e *E } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - e.encode(k2) - ee.EncodeInt(int64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - e.encode(k2) - ee.EncodeMapKVSeparator() - ee.EncodeInt(int64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + e.encode(k2) + ee.EncodeInt(int64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapIntfFloat32R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapIntfFloat32R(rv reflect.Value) { fastpathTV.EncMapIntfFloat32V(rv.Interface().(map[interface{}]float32), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapIntfFloat32V(v map[interface{}]float32, checkNil bool, e *Encoder) { @@ -3492,27 +3210,14 @@ func (_ fastpathT) EncMapIntfFloat32V(v map[interface{}]float32, checkNil bool, } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - e.encode(k2) - ee.EncodeFloat32(v2) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - e.encode(k2) - ee.EncodeMapKVSeparator() - ee.EncodeFloat32(v2) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + e.encode(k2) + ee.EncodeFloat32(v2) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapIntfFloat64R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapIntfFloat64R(rv reflect.Value) { fastpathTV.EncMapIntfFloat64V(rv.Interface().(map[interface{}]float64), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapIntfFloat64V(v map[interface{}]float64, checkNil bool, e *Encoder) { @@ -3523,27 +3228,14 @@ func (_ fastpathT) EncMapIntfFloat64V(v map[interface{}]float64, checkNil bool, } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - e.encode(k2) - ee.EncodeFloat64(v2) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - e.encode(k2) - ee.EncodeMapKVSeparator() - ee.EncodeFloat64(v2) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + e.encode(k2) + ee.EncodeFloat64(v2) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapIntfBoolR(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapIntfBoolR(rv reflect.Value) { fastpathTV.EncMapIntfBoolV(rv.Interface().(map[interface{}]bool), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapIntfBoolV(v map[interface{}]bool, checkNil bool, e *Encoder) { @@ -3554,27 +3246,14 @@ func (_ fastpathT) EncMapIntfBoolV(v map[interface{}]bool, checkNil bool, e *Enc } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - e.encode(k2) - ee.EncodeBool(v2) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - e.encode(k2) - ee.EncodeMapKVSeparator() - ee.EncodeBool(v2) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + e.encode(k2) + ee.EncodeBool(v2) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapStringIntfR(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapStringIntfR(rv reflect.Value) { fastpathTV.EncMapStringIntfV(rv.Interface().(map[string]interface{}), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapStringIntfV(v map[string]interface{}, checkNil bool, e *Encoder) { @@ -3585,35 +3264,18 @@ func (_ fastpathT) EncMapStringIntfV(v map[string]interface{}, checkNil bool, e } ee.EncodeMapStart(len(v)) asSymbols := e.h.AsSymbols&AsSymbolMapStringKeysFlag != 0 - if e.be { - for k2, v2 := range v { - if asSymbols { - ee.EncodeSymbol(k2) - } else { - ee.EncodeString(c_UTF8, k2) - } - e.encode(v2) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - if asSymbols { - ee.EncodeSymbol(k2) - } else { - ee.EncodeString(c_UTF8, k2) - } - ee.EncodeMapKVSeparator() - e.encode(v2) - j++ + for k2, v2 := range v { + if asSymbols { + ee.EncodeSymbol(k2) + } else { + ee.EncodeString(c_UTF8, k2) } - ee.EncodeMapEnd() + e.encode(v2) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapStringStringR(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapStringStringR(rv reflect.Value) { fastpathTV.EncMapStringStringV(rv.Interface().(map[string]string), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapStringStringV(v map[string]string, checkNil bool, e *Encoder) { @@ -3624,35 +3286,18 @@ func (_ fastpathT) EncMapStringStringV(v map[string]string, checkNil bool, e *En } ee.EncodeMapStart(len(v)) asSymbols := e.h.AsSymbols&AsSymbolMapStringKeysFlag != 0 - if e.be { - for k2, v2 := range v { - if asSymbols { - ee.EncodeSymbol(k2) - } else { - ee.EncodeString(c_UTF8, k2) - } - ee.EncodeString(c_UTF8, v2) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - if asSymbols { - ee.EncodeSymbol(k2) - } else { - ee.EncodeString(c_UTF8, k2) - } - ee.EncodeMapKVSeparator() - ee.EncodeString(c_UTF8, v2) - j++ + for k2, v2 := range v { + if asSymbols { + ee.EncodeSymbol(k2) + } else { + ee.EncodeString(c_UTF8, k2) } - ee.EncodeMapEnd() + ee.EncodeString(c_UTF8, v2) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapStringUintR(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapStringUintR(rv reflect.Value) { fastpathTV.EncMapStringUintV(rv.Interface().(map[string]uint), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapStringUintV(v map[string]uint, checkNil bool, e *Encoder) { @@ -3663,35 +3308,18 @@ func (_ fastpathT) EncMapStringUintV(v map[string]uint, checkNil bool, e *Encode } ee.EncodeMapStart(len(v)) asSymbols := e.h.AsSymbols&AsSymbolMapStringKeysFlag != 0 - if e.be { - for k2, v2 := range v { - if asSymbols { - ee.EncodeSymbol(k2) - } else { - ee.EncodeString(c_UTF8, k2) - } - ee.EncodeUint(uint64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - if asSymbols { - ee.EncodeSymbol(k2) - } else { - ee.EncodeString(c_UTF8, k2) - } - ee.EncodeMapKVSeparator() - ee.EncodeUint(uint64(v2)) - j++ + for k2, v2 := range v { + if asSymbols { + ee.EncodeSymbol(k2) + } else { + ee.EncodeString(c_UTF8, k2) } - ee.EncodeMapEnd() + ee.EncodeUint(uint64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapStringUint8R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapStringUint8R(rv reflect.Value) { fastpathTV.EncMapStringUint8V(rv.Interface().(map[string]uint8), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapStringUint8V(v map[string]uint8, checkNil bool, e *Encoder) { @@ -3702,35 +3330,18 @@ func (_ fastpathT) EncMapStringUint8V(v map[string]uint8, checkNil bool, e *Enco } ee.EncodeMapStart(len(v)) asSymbols := e.h.AsSymbols&AsSymbolMapStringKeysFlag != 0 - if e.be { - for k2, v2 := range v { - if asSymbols { - ee.EncodeSymbol(k2) - } else { - ee.EncodeString(c_UTF8, k2) - } - ee.EncodeUint(uint64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - if asSymbols { - ee.EncodeSymbol(k2) - } else { - ee.EncodeString(c_UTF8, k2) - } - ee.EncodeMapKVSeparator() - ee.EncodeUint(uint64(v2)) - j++ + for k2, v2 := range v { + if asSymbols { + ee.EncodeSymbol(k2) + } else { + ee.EncodeString(c_UTF8, k2) } - ee.EncodeMapEnd() + ee.EncodeUint(uint64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapStringUint16R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapStringUint16R(rv reflect.Value) { fastpathTV.EncMapStringUint16V(rv.Interface().(map[string]uint16), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapStringUint16V(v map[string]uint16, checkNil bool, e *Encoder) { @@ -3741,35 +3352,18 @@ func (_ fastpathT) EncMapStringUint16V(v map[string]uint16, checkNil bool, e *En } ee.EncodeMapStart(len(v)) asSymbols := e.h.AsSymbols&AsSymbolMapStringKeysFlag != 0 - if e.be { - for k2, v2 := range v { - if asSymbols { - ee.EncodeSymbol(k2) - } else { - ee.EncodeString(c_UTF8, k2) - } - ee.EncodeUint(uint64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - if asSymbols { - ee.EncodeSymbol(k2) - } else { - ee.EncodeString(c_UTF8, k2) - } - ee.EncodeMapKVSeparator() - ee.EncodeUint(uint64(v2)) - j++ + for k2, v2 := range v { + if asSymbols { + ee.EncodeSymbol(k2) + } else { + ee.EncodeString(c_UTF8, k2) } - ee.EncodeMapEnd() + ee.EncodeUint(uint64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapStringUint32R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapStringUint32R(rv reflect.Value) { fastpathTV.EncMapStringUint32V(rv.Interface().(map[string]uint32), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapStringUint32V(v map[string]uint32, checkNil bool, e *Encoder) { @@ -3780,35 +3374,18 @@ func (_ fastpathT) EncMapStringUint32V(v map[string]uint32, checkNil bool, e *En } ee.EncodeMapStart(len(v)) asSymbols := e.h.AsSymbols&AsSymbolMapStringKeysFlag != 0 - if e.be { - for k2, v2 := range v { - if asSymbols { - ee.EncodeSymbol(k2) - } else { - ee.EncodeString(c_UTF8, k2) - } - ee.EncodeUint(uint64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - if asSymbols { - ee.EncodeSymbol(k2) - } else { - ee.EncodeString(c_UTF8, k2) - } - ee.EncodeMapKVSeparator() - ee.EncodeUint(uint64(v2)) - j++ + for k2, v2 := range v { + if asSymbols { + ee.EncodeSymbol(k2) + } else { + ee.EncodeString(c_UTF8, k2) } - ee.EncodeMapEnd() + ee.EncodeUint(uint64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapStringUint64R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapStringUint64R(rv reflect.Value) { fastpathTV.EncMapStringUint64V(rv.Interface().(map[string]uint64), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapStringUint64V(v map[string]uint64, checkNil bool, e *Encoder) { @@ -3819,35 +3396,18 @@ func (_ fastpathT) EncMapStringUint64V(v map[string]uint64, checkNil bool, e *En } ee.EncodeMapStart(len(v)) asSymbols := e.h.AsSymbols&AsSymbolMapStringKeysFlag != 0 - if e.be { - for k2, v2 := range v { - if asSymbols { - ee.EncodeSymbol(k2) - } else { - ee.EncodeString(c_UTF8, k2) - } - ee.EncodeUint(uint64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - if asSymbols { - ee.EncodeSymbol(k2) - } else { - ee.EncodeString(c_UTF8, k2) - } - ee.EncodeMapKVSeparator() - ee.EncodeUint(uint64(v2)) - j++ + for k2, v2 := range v { + if asSymbols { + ee.EncodeSymbol(k2) + } else { + ee.EncodeString(c_UTF8, k2) } - ee.EncodeMapEnd() + ee.EncodeUint(uint64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapStringIntR(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapStringIntR(rv reflect.Value) { fastpathTV.EncMapStringIntV(rv.Interface().(map[string]int), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapStringIntV(v map[string]int, checkNil bool, e *Encoder) { @@ -3858,35 +3418,18 @@ func (_ fastpathT) EncMapStringIntV(v map[string]int, checkNil bool, e *Encoder) } ee.EncodeMapStart(len(v)) asSymbols := e.h.AsSymbols&AsSymbolMapStringKeysFlag != 0 - if e.be { - for k2, v2 := range v { - if asSymbols { - ee.EncodeSymbol(k2) - } else { - ee.EncodeString(c_UTF8, k2) - } - ee.EncodeInt(int64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - if asSymbols { - ee.EncodeSymbol(k2) - } else { - ee.EncodeString(c_UTF8, k2) - } - ee.EncodeMapKVSeparator() - ee.EncodeInt(int64(v2)) - j++ + for k2, v2 := range v { + if asSymbols { + ee.EncodeSymbol(k2) + } else { + ee.EncodeString(c_UTF8, k2) } - ee.EncodeMapEnd() + ee.EncodeInt(int64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapStringInt8R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapStringInt8R(rv reflect.Value) { fastpathTV.EncMapStringInt8V(rv.Interface().(map[string]int8), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapStringInt8V(v map[string]int8, checkNil bool, e *Encoder) { @@ -3897,35 +3440,18 @@ func (_ fastpathT) EncMapStringInt8V(v map[string]int8, checkNil bool, e *Encode } ee.EncodeMapStart(len(v)) asSymbols := e.h.AsSymbols&AsSymbolMapStringKeysFlag != 0 - if e.be { - for k2, v2 := range v { - if asSymbols { - ee.EncodeSymbol(k2) - } else { - ee.EncodeString(c_UTF8, k2) - } - ee.EncodeInt(int64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - if asSymbols { - ee.EncodeSymbol(k2) - } else { - ee.EncodeString(c_UTF8, k2) - } - ee.EncodeMapKVSeparator() - ee.EncodeInt(int64(v2)) - j++ + for k2, v2 := range v { + if asSymbols { + ee.EncodeSymbol(k2) + } else { + ee.EncodeString(c_UTF8, k2) } - ee.EncodeMapEnd() + ee.EncodeInt(int64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapStringInt16R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapStringInt16R(rv reflect.Value) { fastpathTV.EncMapStringInt16V(rv.Interface().(map[string]int16), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapStringInt16V(v map[string]int16, checkNil bool, e *Encoder) { @@ -3936,35 +3462,18 @@ func (_ fastpathT) EncMapStringInt16V(v map[string]int16, checkNil bool, e *Enco } ee.EncodeMapStart(len(v)) asSymbols := e.h.AsSymbols&AsSymbolMapStringKeysFlag != 0 - if e.be { - for k2, v2 := range v { - if asSymbols { - ee.EncodeSymbol(k2) - } else { - ee.EncodeString(c_UTF8, k2) - } - ee.EncodeInt(int64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - if asSymbols { - ee.EncodeSymbol(k2) - } else { - ee.EncodeString(c_UTF8, k2) - } - ee.EncodeMapKVSeparator() - ee.EncodeInt(int64(v2)) - j++ + for k2, v2 := range v { + if asSymbols { + ee.EncodeSymbol(k2) + } else { + ee.EncodeString(c_UTF8, k2) } - ee.EncodeMapEnd() + ee.EncodeInt(int64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapStringInt32R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapStringInt32R(rv reflect.Value) { fastpathTV.EncMapStringInt32V(rv.Interface().(map[string]int32), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapStringInt32V(v map[string]int32, checkNil bool, e *Encoder) { @@ -3975,35 +3484,18 @@ func (_ fastpathT) EncMapStringInt32V(v map[string]int32, checkNil bool, e *Enco } ee.EncodeMapStart(len(v)) asSymbols := e.h.AsSymbols&AsSymbolMapStringKeysFlag != 0 - if e.be { - for k2, v2 := range v { - if asSymbols { - ee.EncodeSymbol(k2) - } else { - ee.EncodeString(c_UTF8, k2) - } - ee.EncodeInt(int64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - if asSymbols { - ee.EncodeSymbol(k2) - } else { - ee.EncodeString(c_UTF8, k2) - } - ee.EncodeMapKVSeparator() - ee.EncodeInt(int64(v2)) - j++ + for k2, v2 := range v { + if asSymbols { + ee.EncodeSymbol(k2) + } else { + ee.EncodeString(c_UTF8, k2) } - ee.EncodeMapEnd() + ee.EncodeInt(int64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapStringInt64R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapStringInt64R(rv reflect.Value) { fastpathTV.EncMapStringInt64V(rv.Interface().(map[string]int64), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapStringInt64V(v map[string]int64, checkNil bool, e *Encoder) { @@ -4014,35 +3506,18 @@ func (_ fastpathT) EncMapStringInt64V(v map[string]int64, checkNil bool, e *Enco } ee.EncodeMapStart(len(v)) asSymbols := e.h.AsSymbols&AsSymbolMapStringKeysFlag != 0 - if e.be { - for k2, v2 := range v { - if asSymbols { - ee.EncodeSymbol(k2) - } else { - ee.EncodeString(c_UTF8, k2) - } - ee.EncodeInt(int64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - if asSymbols { - ee.EncodeSymbol(k2) - } else { - ee.EncodeString(c_UTF8, k2) - } - ee.EncodeMapKVSeparator() - ee.EncodeInt(int64(v2)) - j++ + for k2, v2 := range v { + if asSymbols { + ee.EncodeSymbol(k2) + } else { + ee.EncodeString(c_UTF8, k2) } - ee.EncodeMapEnd() + ee.EncodeInt(int64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapStringFloat32R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapStringFloat32R(rv reflect.Value) { fastpathTV.EncMapStringFloat32V(rv.Interface().(map[string]float32), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapStringFloat32V(v map[string]float32, checkNil bool, e *Encoder) { @@ -4053,35 +3528,18 @@ func (_ fastpathT) EncMapStringFloat32V(v map[string]float32, checkNil bool, e * } ee.EncodeMapStart(len(v)) asSymbols := e.h.AsSymbols&AsSymbolMapStringKeysFlag != 0 - if e.be { - for k2, v2 := range v { - if asSymbols { - ee.EncodeSymbol(k2) - } else { - ee.EncodeString(c_UTF8, k2) - } - ee.EncodeFloat32(v2) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - if asSymbols { - ee.EncodeSymbol(k2) - } else { - ee.EncodeString(c_UTF8, k2) - } - ee.EncodeMapKVSeparator() - ee.EncodeFloat32(v2) - j++ + for k2, v2 := range v { + if asSymbols { + ee.EncodeSymbol(k2) + } else { + ee.EncodeString(c_UTF8, k2) } - ee.EncodeMapEnd() + ee.EncodeFloat32(v2) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapStringFloat64R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapStringFloat64R(rv reflect.Value) { fastpathTV.EncMapStringFloat64V(rv.Interface().(map[string]float64), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapStringFloat64V(v map[string]float64, checkNil bool, e *Encoder) { @@ -4092,35 +3550,18 @@ func (_ fastpathT) EncMapStringFloat64V(v map[string]float64, checkNil bool, e * } ee.EncodeMapStart(len(v)) asSymbols := e.h.AsSymbols&AsSymbolMapStringKeysFlag != 0 - if e.be { - for k2, v2 := range v { - if asSymbols { - ee.EncodeSymbol(k2) - } else { - ee.EncodeString(c_UTF8, k2) - } - ee.EncodeFloat64(v2) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - if asSymbols { - ee.EncodeSymbol(k2) - } else { - ee.EncodeString(c_UTF8, k2) - } - ee.EncodeMapKVSeparator() - ee.EncodeFloat64(v2) - j++ + for k2, v2 := range v { + if asSymbols { + ee.EncodeSymbol(k2) + } else { + ee.EncodeString(c_UTF8, k2) } - ee.EncodeMapEnd() + ee.EncodeFloat64(v2) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapStringBoolR(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapStringBoolR(rv reflect.Value) { fastpathTV.EncMapStringBoolV(rv.Interface().(map[string]bool), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapStringBoolV(v map[string]bool, checkNil bool, e *Encoder) { @@ -4131,35 +3572,18 @@ func (_ fastpathT) EncMapStringBoolV(v map[string]bool, checkNil bool, e *Encode } ee.EncodeMapStart(len(v)) asSymbols := e.h.AsSymbols&AsSymbolMapStringKeysFlag != 0 - if e.be { - for k2, v2 := range v { - if asSymbols { - ee.EncodeSymbol(k2) - } else { - ee.EncodeString(c_UTF8, k2) - } - ee.EncodeBool(v2) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - if asSymbols { - ee.EncodeSymbol(k2) - } else { - ee.EncodeString(c_UTF8, k2) - } - ee.EncodeMapKVSeparator() - ee.EncodeBool(v2) - j++ + for k2, v2 := range v { + if asSymbols { + ee.EncodeSymbol(k2) + } else { + ee.EncodeString(c_UTF8, k2) } - ee.EncodeMapEnd() + ee.EncodeBool(v2) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapFloat32IntfR(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapFloat32IntfR(rv reflect.Value) { fastpathTV.EncMapFloat32IntfV(rv.Interface().(map[float32]interface{}), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapFloat32IntfV(v map[float32]interface{}, checkNil bool, e *Encoder) { @@ -4170,27 +3594,14 @@ func (_ fastpathT) EncMapFloat32IntfV(v map[float32]interface{}, checkNil bool, } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeFloat32(k2) - e.encode(v2) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeFloat32(k2) - ee.EncodeMapKVSeparator() - e.encode(v2) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeFloat32(k2) + e.encode(v2) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapFloat32StringR(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapFloat32StringR(rv reflect.Value) { fastpathTV.EncMapFloat32StringV(rv.Interface().(map[float32]string), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapFloat32StringV(v map[float32]string, checkNil bool, e *Encoder) { @@ -4201,27 +3612,14 @@ func (_ fastpathT) EncMapFloat32StringV(v map[float32]string, checkNil bool, e * } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeFloat32(k2) - ee.EncodeString(c_UTF8, v2) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeFloat32(k2) - ee.EncodeMapKVSeparator() - ee.EncodeString(c_UTF8, v2) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeFloat32(k2) + ee.EncodeString(c_UTF8, v2) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapFloat32UintR(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapFloat32UintR(rv reflect.Value) { fastpathTV.EncMapFloat32UintV(rv.Interface().(map[float32]uint), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapFloat32UintV(v map[float32]uint, checkNil bool, e *Encoder) { @@ -4232,27 +3630,14 @@ func (_ fastpathT) EncMapFloat32UintV(v map[float32]uint, checkNil bool, e *Enco } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeFloat32(k2) - ee.EncodeUint(uint64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeFloat32(k2) - ee.EncodeMapKVSeparator() - ee.EncodeUint(uint64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeFloat32(k2) + ee.EncodeUint(uint64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapFloat32Uint8R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapFloat32Uint8R(rv reflect.Value) { fastpathTV.EncMapFloat32Uint8V(rv.Interface().(map[float32]uint8), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapFloat32Uint8V(v map[float32]uint8, checkNil bool, e *Encoder) { @@ -4263,27 +3648,14 @@ func (_ fastpathT) EncMapFloat32Uint8V(v map[float32]uint8, checkNil bool, e *En } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeFloat32(k2) - ee.EncodeUint(uint64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeFloat32(k2) - ee.EncodeMapKVSeparator() - ee.EncodeUint(uint64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeFloat32(k2) + ee.EncodeUint(uint64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapFloat32Uint16R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapFloat32Uint16R(rv reflect.Value) { fastpathTV.EncMapFloat32Uint16V(rv.Interface().(map[float32]uint16), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapFloat32Uint16V(v map[float32]uint16, checkNil bool, e *Encoder) { @@ -4294,27 +3666,14 @@ func (_ fastpathT) EncMapFloat32Uint16V(v map[float32]uint16, checkNil bool, e * } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeFloat32(k2) - ee.EncodeUint(uint64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeFloat32(k2) - ee.EncodeMapKVSeparator() - ee.EncodeUint(uint64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeFloat32(k2) + ee.EncodeUint(uint64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapFloat32Uint32R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapFloat32Uint32R(rv reflect.Value) { fastpathTV.EncMapFloat32Uint32V(rv.Interface().(map[float32]uint32), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapFloat32Uint32V(v map[float32]uint32, checkNil bool, e *Encoder) { @@ -4325,27 +3684,14 @@ func (_ fastpathT) EncMapFloat32Uint32V(v map[float32]uint32, checkNil bool, e * } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeFloat32(k2) - ee.EncodeUint(uint64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeFloat32(k2) - ee.EncodeMapKVSeparator() - ee.EncodeUint(uint64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeFloat32(k2) + ee.EncodeUint(uint64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapFloat32Uint64R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapFloat32Uint64R(rv reflect.Value) { fastpathTV.EncMapFloat32Uint64V(rv.Interface().(map[float32]uint64), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapFloat32Uint64V(v map[float32]uint64, checkNil bool, e *Encoder) { @@ -4356,27 +3702,14 @@ func (_ fastpathT) EncMapFloat32Uint64V(v map[float32]uint64, checkNil bool, e * } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeFloat32(k2) - ee.EncodeUint(uint64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeFloat32(k2) - ee.EncodeMapKVSeparator() - ee.EncodeUint(uint64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeFloat32(k2) + ee.EncodeUint(uint64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapFloat32IntR(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapFloat32IntR(rv reflect.Value) { fastpathTV.EncMapFloat32IntV(rv.Interface().(map[float32]int), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapFloat32IntV(v map[float32]int, checkNil bool, e *Encoder) { @@ -4387,27 +3720,14 @@ func (_ fastpathT) EncMapFloat32IntV(v map[float32]int, checkNil bool, e *Encode } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeFloat32(k2) - ee.EncodeInt(int64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeFloat32(k2) - ee.EncodeMapKVSeparator() - ee.EncodeInt(int64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeFloat32(k2) + ee.EncodeInt(int64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapFloat32Int8R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapFloat32Int8R(rv reflect.Value) { fastpathTV.EncMapFloat32Int8V(rv.Interface().(map[float32]int8), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapFloat32Int8V(v map[float32]int8, checkNil bool, e *Encoder) { @@ -4418,27 +3738,14 @@ func (_ fastpathT) EncMapFloat32Int8V(v map[float32]int8, checkNil bool, e *Enco } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeFloat32(k2) - ee.EncodeInt(int64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeFloat32(k2) - ee.EncodeMapKVSeparator() - ee.EncodeInt(int64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeFloat32(k2) + ee.EncodeInt(int64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapFloat32Int16R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapFloat32Int16R(rv reflect.Value) { fastpathTV.EncMapFloat32Int16V(rv.Interface().(map[float32]int16), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapFloat32Int16V(v map[float32]int16, checkNil bool, e *Encoder) { @@ -4449,27 +3756,14 @@ func (_ fastpathT) EncMapFloat32Int16V(v map[float32]int16, checkNil bool, e *En } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeFloat32(k2) - ee.EncodeInt(int64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeFloat32(k2) - ee.EncodeMapKVSeparator() - ee.EncodeInt(int64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeFloat32(k2) + ee.EncodeInt(int64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapFloat32Int32R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapFloat32Int32R(rv reflect.Value) { fastpathTV.EncMapFloat32Int32V(rv.Interface().(map[float32]int32), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapFloat32Int32V(v map[float32]int32, checkNil bool, e *Encoder) { @@ -4480,27 +3774,14 @@ func (_ fastpathT) EncMapFloat32Int32V(v map[float32]int32, checkNil bool, e *En } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeFloat32(k2) - ee.EncodeInt(int64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeFloat32(k2) - ee.EncodeMapKVSeparator() - ee.EncodeInt(int64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeFloat32(k2) + ee.EncodeInt(int64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapFloat32Int64R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapFloat32Int64R(rv reflect.Value) { fastpathTV.EncMapFloat32Int64V(rv.Interface().(map[float32]int64), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapFloat32Int64V(v map[float32]int64, checkNil bool, e *Encoder) { @@ -4511,27 +3792,14 @@ func (_ fastpathT) EncMapFloat32Int64V(v map[float32]int64, checkNil bool, e *En } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeFloat32(k2) - ee.EncodeInt(int64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeFloat32(k2) - ee.EncodeMapKVSeparator() - ee.EncodeInt(int64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeFloat32(k2) + ee.EncodeInt(int64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapFloat32Float32R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapFloat32Float32R(rv reflect.Value) { fastpathTV.EncMapFloat32Float32V(rv.Interface().(map[float32]float32), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapFloat32Float32V(v map[float32]float32, checkNil bool, e *Encoder) { @@ -4542,27 +3810,14 @@ func (_ fastpathT) EncMapFloat32Float32V(v map[float32]float32, checkNil bool, e } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeFloat32(k2) - ee.EncodeFloat32(v2) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeFloat32(k2) - ee.EncodeMapKVSeparator() - ee.EncodeFloat32(v2) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeFloat32(k2) + ee.EncodeFloat32(v2) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapFloat32Float64R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapFloat32Float64R(rv reflect.Value) { fastpathTV.EncMapFloat32Float64V(rv.Interface().(map[float32]float64), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapFloat32Float64V(v map[float32]float64, checkNil bool, e *Encoder) { @@ -4573,27 +3828,14 @@ func (_ fastpathT) EncMapFloat32Float64V(v map[float32]float64, checkNil bool, e } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeFloat32(k2) - ee.EncodeFloat64(v2) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeFloat32(k2) - ee.EncodeMapKVSeparator() - ee.EncodeFloat64(v2) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeFloat32(k2) + ee.EncodeFloat64(v2) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapFloat32BoolR(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapFloat32BoolR(rv reflect.Value) { fastpathTV.EncMapFloat32BoolV(rv.Interface().(map[float32]bool), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapFloat32BoolV(v map[float32]bool, checkNil bool, e *Encoder) { @@ -4604,27 +3846,14 @@ func (_ fastpathT) EncMapFloat32BoolV(v map[float32]bool, checkNil bool, e *Enco } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeFloat32(k2) - ee.EncodeBool(v2) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeFloat32(k2) - ee.EncodeMapKVSeparator() - ee.EncodeBool(v2) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeFloat32(k2) + ee.EncodeBool(v2) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapFloat64IntfR(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapFloat64IntfR(rv reflect.Value) { fastpathTV.EncMapFloat64IntfV(rv.Interface().(map[float64]interface{}), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapFloat64IntfV(v map[float64]interface{}, checkNil bool, e *Encoder) { @@ -4635,27 +3864,14 @@ func (_ fastpathT) EncMapFloat64IntfV(v map[float64]interface{}, checkNil bool, } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeFloat64(k2) - e.encode(v2) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeFloat64(k2) - ee.EncodeMapKVSeparator() - e.encode(v2) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeFloat64(k2) + e.encode(v2) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapFloat64StringR(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapFloat64StringR(rv reflect.Value) { fastpathTV.EncMapFloat64StringV(rv.Interface().(map[float64]string), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapFloat64StringV(v map[float64]string, checkNil bool, e *Encoder) { @@ -4666,27 +3882,14 @@ func (_ fastpathT) EncMapFloat64StringV(v map[float64]string, checkNil bool, e * } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeFloat64(k2) - ee.EncodeString(c_UTF8, v2) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeFloat64(k2) - ee.EncodeMapKVSeparator() - ee.EncodeString(c_UTF8, v2) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeFloat64(k2) + ee.EncodeString(c_UTF8, v2) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapFloat64UintR(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapFloat64UintR(rv reflect.Value) { fastpathTV.EncMapFloat64UintV(rv.Interface().(map[float64]uint), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapFloat64UintV(v map[float64]uint, checkNil bool, e *Encoder) { @@ -4697,27 +3900,14 @@ func (_ fastpathT) EncMapFloat64UintV(v map[float64]uint, checkNil bool, e *Enco } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeFloat64(k2) - ee.EncodeUint(uint64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeFloat64(k2) - ee.EncodeMapKVSeparator() - ee.EncodeUint(uint64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeFloat64(k2) + ee.EncodeUint(uint64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapFloat64Uint8R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapFloat64Uint8R(rv reflect.Value) { fastpathTV.EncMapFloat64Uint8V(rv.Interface().(map[float64]uint8), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapFloat64Uint8V(v map[float64]uint8, checkNil bool, e *Encoder) { @@ -4728,27 +3918,14 @@ func (_ fastpathT) EncMapFloat64Uint8V(v map[float64]uint8, checkNil bool, e *En } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeFloat64(k2) - ee.EncodeUint(uint64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeFloat64(k2) - ee.EncodeMapKVSeparator() - ee.EncodeUint(uint64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeFloat64(k2) + ee.EncodeUint(uint64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapFloat64Uint16R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapFloat64Uint16R(rv reflect.Value) { fastpathTV.EncMapFloat64Uint16V(rv.Interface().(map[float64]uint16), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapFloat64Uint16V(v map[float64]uint16, checkNil bool, e *Encoder) { @@ -4759,27 +3936,14 @@ func (_ fastpathT) EncMapFloat64Uint16V(v map[float64]uint16, checkNil bool, e * } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeFloat64(k2) - ee.EncodeUint(uint64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeFloat64(k2) - ee.EncodeMapKVSeparator() - ee.EncodeUint(uint64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeFloat64(k2) + ee.EncodeUint(uint64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapFloat64Uint32R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapFloat64Uint32R(rv reflect.Value) { fastpathTV.EncMapFloat64Uint32V(rv.Interface().(map[float64]uint32), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapFloat64Uint32V(v map[float64]uint32, checkNil bool, e *Encoder) { @@ -4790,27 +3954,14 @@ func (_ fastpathT) EncMapFloat64Uint32V(v map[float64]uint32, checkNil bool, e * } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeFloat64(k2) - ee.EncodeUint(uint64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeFloat64(k2) - ee.EncodeMapKVSeparator() - ee.EncodeUint(uint64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeFloat64(k2) + ee.EncodeUint(uint64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapFloat64Uint64R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapFloat64Uint64R(rv reflect.Value) { fastpathTV.EncMapFloat64Uint64V(rv.Interface().(map[float64]uint64), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapFloat64Uint64V(v map[float64]uint64, checkNil bool, e *Encoder) { @@ -4821,27 +3972,14 @@ func (_ fastpathT) EncMapFloat64Uint64V(v map[float64]uint64, checkNil bool, e * } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeFloat64(k2) - ee.EncodeUint(uint64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeFloat64(k2) - ee.EncodeMapKVSeparator() - ee.EncodeUint(uint64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeFloat64(k2) + ee.EncodeUint(uint64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapFloat64IntR(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapFloat64IntR(rv reflect.Value) { fastpathTV.EncMapFloat64IntV(rv.Interface().(map[float64]int), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapFloat64IntV(v map[float64]int, checkNil bool, e *Encoder) { @@ -4852,27 +3990,14 @@ func (_ fastpathT) EncMapFloat64IntV(v map[float64]int, checkNil bool, e *Encode } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeFloat64(k2) - ee.EncodeInt(int64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeFloat64(k2) - ee.EncodeMapKVSeparator() - ee.EncodeInt(int64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeFloat64(k2) + ee.EncodeInt(int64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapFloat64Int8R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapFloat64Int8R(rv reflect.Value) { fastpathTV.EncMapFloat64Int8V(rv.Interface().(map[float64]int8), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapFloat64Int8V(v map[float64]int8, checkNil bool, e *Encoder) { @@ -4883,27 +4008,14 @@ func (_ fastpathT) EncMapFloat64Int8V(v map[float64]int8, checkNil bool, e *Enco } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeFloat64(k2) - ee.EncodeInt(int64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeFloat64(k2) - ee.EncodeMapKVSeparator() - ee.EncodeInt(int64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeFloat64(k2) + ee.EncodeInt(int64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapFloat64Int16R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapFloat64Int16R(rv reflect.Value) { fastpathTV.EncMapFloat64Int16V(rv.Interface().(map[float64]int16), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapFloat64Int16V(v map[float64]int16, checkNil bool, e *Encoder) { @@ -4914,27 +4026,14 @@ func (_ fastpathT) EncMapFloat64Int16V(v map[float64]int16, checkNil bool, e *En } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeFloat64(k2) - ee.EncodeInt(int64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeFloat64(k2) - ee.EncodeMapKVSeparator() - ee.EncodeInt(int64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeFloat64(k2) + ee.EncodeInt(int64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapFloat64Int32R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapFloat64Int32R(rv reflect.Value) { fastpathTV.EncMapFloat64Int32V(rv.Interface().(map[float64]int32), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapFloat64Int32V(v map[float64]int32, checkNil bool, e *Encoder) { @@ -4945,27 +4044,14 @@ func (_ fastpathT) EncMapFloat64Int32V(v map[float64]int32, checkNil bool, e *En } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeFloat64(k2) - ee.EncodeInt(int64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeFloat64(k2) - ee.EncodeMapKVSeparator() - ee.EncodeInt(int64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeFloat64(k2) + ee.EncodeInt(int64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapFloat64Int64R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapFloat64Int64R(rv reflect.Value) { fastpathTV.EncMapFloat64Int64V(rv.Interface().(map[float64]int64), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapFloat64Int64V(v map[float64]int64, checkNil bool, e *Encoder) { @@ -4976,27 +4062,14 @@ func (_ fastpathT) EncMapFloat64Int64V(v map[float64]int64, checkNil bool, e *En } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeFloat64(k2) - ee.EncodeInt(int64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeFloat64(k2) - ee.EncodeMapKVSeparator() - ee.EncodeInt(int64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeFloat64(k2) + ee.EncodeInt(int64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapFloat64Float32R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapFloat64Float32R(rv reflect.Value) { fastpathTV.EncMapFloat64Float32V(rv.Interface().(map[float64]float32), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapFloat64Float32V(v map[float64]float32, checkNil bool, e *Encoder) { @@ -5007,27 +4080,14 @@ func (_ fastpathT) EncMapFloat64Float32V(v map[float64]float32, checkNil bool, e } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeFloat64(k2) - ee.EncodeFloat32(v2) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeFloat64(k2) - ee.EncodeMapKVSeparator() - ee.EncodeFloat32(v2) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeFloat64(k2) + ee.EncodeFloat32(v2) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapFloat64Float64R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapFloat64Float64R(rv reflect.Value) { fastpathTV.EncMapFloat64Float64V(rv.Interface().(map[float64]float64), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapFloat64Float64V(v map[float64]float64, checkNil bool, e *Encoder) { @@ -5038,27 +4098,14 @@ func (_ fastpathT) EncMapFloat64Float64V(v map[float64]float64, checkNil bool, e } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeFloat64(k2) - ee.EncodeFloat64(v2) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeFloat64(k2) - ee.EncodeMapKVSeparator() - ee.EncodeFloat64(v2) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeFloat64(k2) + ee.EncodeFloat64(v2) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapFloat64BoolR(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapFloat64BoolR(rv reflect.Value) { fastpathTV.EncMapFloat64BoolV(rv.Interface().(map[float64]bool), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapFloat64BoolV(v map[float64]bool, checkNil bool, e *Encoder) { @@ -5069,27 +4116,14 @@ func (_ fastpathT) EncMapFloat64BoolV(v map[float64]bool, checkNil bool, e *Enco } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeFloat64(k2) - ee.EncodeBool(v2) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeFloat64(k2) - ee.EncodeMapKVSeparator() - ee.EncodeBool(v2) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeFloat64(k2) + ee.EncodeBool(v2) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapUintIntfR(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapUintIntfR(rv reflect.Value) { fastpathTV.EncMapUintIntfV(rv.Interface().(map[uint]interface{}), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapUintIntfV(v map[uint]interface{}, checkNil bool, e *Encoder) { @@ -5100,27 +4134,14 @@ func (_ fastpathT) EncMapUintIntfV(v map[uint]interface{}, checkNil bool, e *Enc } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - e.encode(v2) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeUint(uint64(k2)) - ee.EncodeMapKVSeparator() - e.encode(v2) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + e.encode(v2) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapUintStringR(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapUintStringR(rv reflect.Value) { fastpathTV.EncMapUintStringV(rv.Interface().(map[uint]string), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapUintStringV(v map[uint]string, checkNil bool, e *Encoder) { @@ -5131,27 +4152,14 @@ func (_ fastpathT) EncMapUintStringV(v map[uint]string, checkNil bool, e *Encode } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeString(c_UTF8, v2) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeUint(uint64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeString(c_UTF8, v2) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeString(c_UTF8, v2) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapUintUintR(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapUintUintR(rv reflect.Value) { fastpathTV.EncMapUintUintV(rv.Interface().(map[uint]uint), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapUintUintV(v map[uint]uint, checkNil bool, e *Encoder) { @@ -5162,27 +4170,14 @@ func (_ fastpathT) EncMapUintUintV(v map[uint]uint, checkNil bool, e *Encoder) { } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeUint(uint64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeUint(uint64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeUint(uint64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeUint(uint64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapUintUint8R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapUintUint8R(rv reflect.Value) { fastpathTV.EncMapUintUint8V(rv.Interface().(map[uint]uint8), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapUintUint8V(v map[uint]uint8, checkNil bool, e *Encoder) { @@ -5193,27 +4188,14 @@ func (_ fastpathT) EncMapUintUint8V(v map[uint]uint8, checkNil bool, e *Encoder) } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeUint(uint64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeUint(uint64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeUint(uint64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeUint(uint64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapUintUint16R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapUintUint16R(rv reflect.Value) { fastpathTV.EncMapUintUint16V(rv.Interface().(map[uint]uint16), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapUintUint16V(v map[uint]uint16, checkNil bool, e *Encoder) { @@ -5224,27 +4206,14 @@ func (_ fastpathT) EncMapUintUint16V(v map[uint]uint16, checkNil bool, e *Encode } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeUint(uint64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeUint(uint64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeUint(uint64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeUint(uint64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapUintUint32R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapUintUint32R(rv reflect.Value) { fastpathTV.EncMapUintUint32V(rv.Interface().(map[uint]uint32), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapUintUint32V(v map[uint]uint32, checkNil bool, e *Encoder) { @@ -5255,27 +4224,14 @@ func (_ fastpathT) EncMapUintUint32V(v map[uint]uint32, checkNil bool, e *Encode } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeUint(uint64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeUint(uint64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeUint(uint64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeUint(uint64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapUintUint64R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapUintUint64R(rv reflect.Value) { fastpathTV.EncMapUintUint64V(rv.Interface().(map[uint]uint64), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapUintUint64V(v map[uint]uint64, checkNil bool, e *Encoder) { @@ -5286,27 +4242,14 @@ func (_ fastpathT) EncMapUintUint64V(v map[uint]uint64, checkNil bool, e *Encode } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeUint(uint64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeUint(uint64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeUint(uint64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeUint(uint64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapUintIntR(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapUintIntR(rv reflect.Value) { fastpathTV.EncMapUintIntV(rv.Interface().(map[uint]int), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapUintIntV(v map[uint]int, checkNil bool, e *Encoder) { @@ -5317,27 +4260,14 @@ func (_ fastpathT) EncMapUintIntV(v map[uint]int, checkNil bool, e *Encoder) { } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeInt(int64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeUint(uint64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeInt(int64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeInt(int64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapUintInt8R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapUintInt8R(rv reflect.Value) { fastpathTV.EncMapUintInt8V(rv.Interface().(map[uint]int8), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapUintInt8V(v map[uint]int8, checkNil bool, e *Encoder) { @@ -5348,27 +4278,14 @@ func (_ fastpathT) EncMapUintInt8V(v map[uint]int8, checkNil bool, e *Encoder) { } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeInt(int64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeUint(uint64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeInt(int64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeInt(int64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapUintInt16R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapUintInt16R(rv reflect.Value) { fastpathTV.EncMapUintInt16V(rv.Interface().(map[uint]int16), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapUintInt16V(v map[uint]int16, checkNil bool, e *Encoder) { @@ -5379,27 +4296,14 @@ func (_ fastpathT) EncMapUintInt16V(v map[uint]int16, checkNil bool, e *Encoder) } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeInt(int64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeUint(uint64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeInt(int64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeInt(int64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapUintInt32R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapUintInt32R(rv reflect.Value) { fastpathTV.EncMapUintInt32V(rv.Interface().(map[uint]int32), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapUintInt32V(v map[uint]int32, checkNil bool, e *Encoder) { @@ -5410,27 +4314,14 @@ func (_ fastpathT) EncMapUintInt32V(v map[uint]int32, checkNil bool, e *Encoder) } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeInt(int64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeUint(uint64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeInt(int64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeInt(int64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapUintInt64R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapUintInt64R(rv reflect.Value) { fastpathTV.EncMapUintInt64V(rv.Interface().(map[uint]int64), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapUintInt64V(v map[uint]int64, checkNil bool, e *Encoder) { @@ -5441,58 +4332,32 @@ func (_ fastpathT) EncMapUintInt64V(v map[uint]int64, checkNil bool, e *Encoder) } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeInt(int64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeUint(uint64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeInt(int64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeInt(int64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapUintFloat32R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapUintFloat32R(rv reflect.Value) { fastpathTV.EncMapUintFloat32V(rv.Interface().(map[uint]float32), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapUintFloat32V(v map[uint]float32, checkNil bool, e *Encoder) { ee := e.e if checkNil && v == nil { ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - - if e.be { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeFloat32(v2) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeUint(uint64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeFloat32(v2) - j++ - } - ee.EncodeMapEnd() + return + } + ee.EncodeMapStart(len(v)) + + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeFloat32(v2) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapUintFloat64R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapUintFloat64R(rv reflect.Value) { fastpathTV.EncMapUintFloat64V(rv.Interface().(map[uint]float64), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapUintFloat64V(v map[uint]float64, checkNil bool, e *Encoder) { @@ -5503,27 +4368,14 @@ func (_ fastpathT) EncMapUintFloat64V(v map[uint]float64, checkNil bool, e *Enco } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeFloat64(v2) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeUint(uint64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeFloat64(v2) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeFloat64(v2) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapUintBoolR(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapUintBoolR(rv reflect.Value) { fastpathTV.EncMapUintBoolV(rv.Interface().(map[uint]bool), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapUintBoolV(v map[uint]bool, checkNil bool, e *Encoder) { @@ -5534,27 +4386,14 @@ func (_ fastpathT) EncMapUintBoolV(v map[uint]bool, checkNil bool, e *Encoder) { } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeBool(v2) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeUint(uint64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeBool(v2) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeBool(v2) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapUint8IntfR(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapUint8IntfR(rv reflect.Value) { fastpathTV.EncMapUint8IntfV(rv.Interface().(map[uint8]interface{}), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapUint8IntfV(v map[uint8]interface{}, checkNil bool, e *Encoder) { @@ -5565,27 +4404,14 @@ func (_ fastpathT) EncMapUint8IntfV(v map[uint8]interface{}, checkNil bool, e *E } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - e.encode(v2) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeUint(uint64(k2)) - ee.EncodeMapKVSeparator() - e.encode(v2) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + e.encode(v2) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapUint8StringR(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapUint8StringR(rv reflect.Value) { fastpathTV.EncMapUint8StringV(rv.Interface().(map[uint8]string), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapUint8StringV(v map[uint8]string, checkNil bool, e *Encoder) { @@ -5596,27 +4422,14 @@ func (_ fastpathT) EncMapUint8StringV(v map[uint8]string, checkNil bool, e *Enco } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeString(c_UTF8, v2) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeUint(uint64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeString(c_UTF8, v2) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeString(c_UTF8, v2) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapUint8UintR(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapUint8UintR(rv reflect.Value) { fastpathTV.EncMapUint8UintV(rv.Interface().(map[uint8]uint), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapUint8UintV(v map[uint8]uint, checkNil bool, e *Encoder) { @@ -5627,27 +4440,14 @@ func (_ fastpathT) EncMapUint8UintV(v map[uint8]uint, checkNil bool, e *Encoder) } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeUint(uint64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeUint(uint64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeUint(uint64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeUint(uint64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapUint8Uint8R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapUint8Uint8R(rv reflect.Value) { fastpathTV.EncMapUint8Uint8V(rv.Interface().(map[uint8]uint8), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapUint8Uint8V(v map[uint8]uint8, checkNil bool, e *Encoder) { @@ -5658,27 +4458,14 @@ func (_ fastpathT) EncMapUint8Uint8V(v map[uint8]uint8, checkNil bool, e *Encode } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeUint(uint64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeUint(uint64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeUint(uint64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeUint(uint64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapUint8Uint16R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapUint8Uint16R(rv reflect.Value) { fastpathTV.EncMapUint8Uint16V(rv.Interface().(map[uint8]uint16), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapUint8Uint16V(v map[uint8]uint16, checkNil bool, e *Encoder) { @@ -5689,27 +4476,14 @@ func (_ fastpathT) EncMapUint8Uint16V(v map[uint8]uint16, checkNil bool, e *Enco } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeUint(uint64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeUint(uint64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeUint(uint64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeUint(uint64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapUint8Uint32R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapUint8Uint32R(rv reflect.Value) { fastpathTV.EncMapUint8Uint32V(rv.Interface().(map[uint8]uint32), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapUint8Uint32V(v map[uint8]uint32, checkNil bool, e *Encoder) { @@ -5720,27 +4494,14 @@ func (_ fastpathT) EncMapUint8Uint32V(v map[uint8]uint32, checkNil bool, e *Enco } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeUint(uint64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeUint(uint64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeUint(uint64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeUint(uint64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapUint8Uint64R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapUint8Uint64R(rv reflect.Value) { fastpathTV.EncMapUint8Uint64V(rv.Interface().(map[uint8]uint64), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapUint8Uint64V(v map[uint8]uint64, checkNil bool, e *Encoder) { @@ -5751,27 +4512,14 @@ func (_ fastpathT) EncMapUint8Uint64V(v map[uint8]uint64, checkNil bool, e *Enco } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeUint(uint64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeUint(uint64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeUint(uint64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeUint(uint64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapUint8IntR(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapUint8IntR(rv reflect.Value) { fastpathTV.EncMapUint8IntV(rv.Interface().(map[uint8]int), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapUint8IntV(v map[uint8]int, checkNil bool, e *Encoder) { @@ -5782,27 +4530,14 @@ func (_ fastpathT) EncMapUint8IntV(v map[uint8]int, checkNil bool, e *Encoder) { } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeInt(int64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeUint(uint64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeInt(int64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeInt(int64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapUint8Int8R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapUint8Int8R(rv reflect.Value) { fastpathTV.EncMapUint8Int8V(rv.Interface().(map[uint8]int8), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapUint8Int8V(v map[uint8]int8, checkNil bool, e *Encoder) { @@ -5813,27 +4548,14 @@ func (_ fastpathT) EncMapUint8Int8V(v map[uint8]int8, checkNil bool, e *Encoder) } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeInt(int64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeUint(uint64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeInt(int64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeInt(int64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapUint8Int16R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapUint8Int16R(rv reflect.Value) { fastpathTV.EncMapUint8Int16V(rv.Interface().(map[uint8]int16), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapUint8Int16V(v map[uint8]int16, checkNil bool, e *Encoder) { @@ -5844,27 +4566,14 @@ func (_ fastpathT) EncMapUint8Int16V(v map[uint8]int16, checkNil bool, e *Encode } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeInt(int64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeUint(uint64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeInt(int64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeInt(int64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapUint8Int32R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapUint8Int32R(rv reflect.Value) { fastpathTV.EncMapUint8Int32V(rv.Interface().(map[uint8]int32), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapUint8Int32V(v map[uint8]int32, checkNil bool, e *Encoder) { @@ -5875,27 +4584,14 @@ func (_ fastpathT) EncMapUint8Int32V(v map[uint8]int32, checkNil bool, e *Encode } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeInt(int64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeUint(uint64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeInt(int64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeInt(int64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapUint8Int64R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapUint8Int64R(rv reflect.Value) { fastpathTV.EncMapUint8Int64V(rv.Interface().(map[uint8]int64), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapUint8Int64V(v map[uint8]int64, checkNil bool, e *Encoder) { @@ -5906,27 +4602,14 @@ func (_ fastpathT) EncMapUint8Int64V(v map[uint8]int64, checkNil bool, e *Encode } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeInt(int64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeUint(uint64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeInt(int64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeInt(int64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapUint8Float32R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapUint8Float32R(rv reflect.Value) { fastpathTV.EncMapUint8Float32V(rv.Interface().(map[uint8]float32), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapUint8Float32V(v map[uint8]float32, checkNil bool, e *Encoder) { @@ -5937,27 +4620,14 @@ func (_ fastpathT) EncMapUint8Float32V(v map[uint8]float32, checkNil bool, e *En } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeFloat32(v2) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeUint(uint64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeFloat32(v2) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeFloat32(v2) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapUint8Float64R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapUint8Float64R(rv reflect.Value) { fastpathTV.EncMapUint8Float64V(rv.Interface().(map[uint8]float64), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapUint8Float64V(v map[uint8]float64, checkNil bool, e *Encoder) { @@ -5968,27 +4638,14 @@ func (_ fastpathT) EncMapUint8Float64V(v map[uint8]float64, checkNil bool, e *En } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeFloat64(v2) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeUint(uint64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeFloat64(v2) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeFloat64(v2) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapUint8BoolR(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapUint8BoolR(rv reflect.Value) { fastpathTV.EncMapUint8BoolV(rv.Interface().(map[uint8]bool), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapUint8BoolV(v map[uint8]bool, checkNil bool, e *Encoder) { @@ -5999,27 +4656,14 @@ func (_ fastpathT) EncMapUint8BoolV(v map[uint8]bool, checkNil bool, e *Encoder) } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeBool(v2) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeUint(uint64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeBool(v2) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeBool(v2) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapUint16IntfR(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapUint16IntfR(rv reflect.Value) { fastpathTV.EncMapUint16IntfV(rv.Interface().(map[uint16]interface{}), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapUint16IntfV(v map[uint16]interface{}, checkNil bool, e *Encoder) { @@ -6030,27 +4674,14 @@ func (_ fastpathT) EncMapUint16IntfV(v map[uint16]interface{}, checkNil bool, e } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - e.encode(v2) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeUint(uint64(k2)) - ee.EncodeMapKVSeparator() - e.encode(v2) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + e.encode(v2) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapUint16StringR(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapUint16StringR(rv reflect.Value) { fastpathTV.EncMapUint16StringV(rv.Interface().(map[uint16]string), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapUint16StringV(v map[uint16]string, checkNil bool, e *Encoder) { @@ -6061,27 +4692,14 @@ func (_ fastpathT) EncMapUint16StringV(v map[uint16]string, checkNil bool, e *En } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeString(c_UTF8, v2) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeUint(uint64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeString(c_UTF8, v2) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeString(c_UTF8, v2) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapUint16UintR(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapUint16UintR(rv reflect.Value) { fastpathTV.EncMapUint16UintV(rv.Interface().(map[uint16]uint), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapUint16UintV(v map[uint16]uint, checkNil bool, e *Encoder) { @@ -6092,27 +4710,14 @@ func (_ fastpathT) EncMapUint16UintV(v map[uint16]uint, checkNil bool, e *Encode } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeUint(uint64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeUint(uint64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeUint(uint64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeUint(uint64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapUint16Uint8R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapUint16Uint8R(rv reflect.Value) { fastpathTV.EncMapUint16Uint8V(rv.Interface().(map[uint16]uint8), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapUint16Uint8V(v map[uint16]uint8, checkNil bool, e *Encoder) { @@ -6123,27 +4728,14 @@ func (_ fastpathT) EncMapUint16Uint8V(v map[uint16]uint8, checkNil bool, e *Enco } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeUint(uint64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeUint(uint64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeUint(uint64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeUint(uint64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapUint16Uint16R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapUint16Uint16R(rv reflect.Value) { fastpathTV.EncMapUint16Uint16V(rv.Interface().(map[uint16]uint16), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapUint16Uint16V(v map[uint16]uint16, checkNil bool, e *Encoder) { @@ -6154,27 +4746,14 @@ func (_ fastpathT) EncMapUint16Uint16V(v map[uint16]uint16, checkNil bool, e *En } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeUint(uint64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeUint(uint64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeUint(uint64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeUint(uint64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapUint16Uint32R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapUint16Uint32R(rv reflect.Value) { fastpathTV.EncMapUint16Uint32V(rv.Interface().(map[uint16]uint32), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapUint16Uint32V(v map[uint16]uint32, checkNil bool, e *Encoder) { @@ -6185,27 +4764,14 @@ func (_ fastpathT) EncMapUint16Uint32V(v map[uint16]uint32, checkNil bool, e *En } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeUint(uint64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeUint(uint64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeUint(uint64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeUint(uint64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapUint16Uint64R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapUint16Uint64R(rv reflect.Value) { fastpathTV.EncMapUint16Uint64V(rv.Interface().(map[uint16]uint64), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapUint16Uint64V(v map[uint16]uint64, checkNil bool, e *Encoder) { @@ -6216,27 +4782,14 @@ func (_ fastpathT) EncMapUint16Uint64V(v map[uint16]uint64, checkNil bool, e *En } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeUint(uint64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeUint(uint64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeUint(uint64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeUint(uint64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapUint16IntR(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapUint16IntR(rv reflect.Value) { fastpathTV.EncMapUint16IntV(rv.Interface().(map[uint16]int), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapUint16IntV(v map[uint16]int, checkNil bool, e *Encoder) { @@ -6247,27 +4800,14 @@ func (_ fastpathT) EncMapUint16IntV(v map[uint16]int, checkNil bool, e *Encoder) } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeInt(int64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeUint(uint64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeInt(int64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeInt(int64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapUint16Int8R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapUint16Int8R(rv reflect.Value) { fastpathTV.EncMapUint16Int8V(rv.Interface().(map[uint16]int8), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapUint16Int8V(v map[uint16]int8, checkNil bool, e *Encoder) { @@ -6278,27 +4818,14 @@ func (_ fastpathT) EncMapUint16Int8V(v map[uint16]int8, checkNil bool, e *Encode } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeInt(int64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeUint(uint64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeInt(int64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeInt(int64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapUint16Int16R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapUint16Int16R(rv reflect.Value) { fastpathTV.EncMapUint16Int16V(rv.Interface().(map[uint16]int16), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapUint16Int16V(v map[uint16]int16, checkNil bool, e *Encoder) { @@ -6309,27 +4836,14 @@ func (_ fastpathT) EncMapUint16Int16V(v map[uint16]int16, checkNil bool, e *Enco } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeInt(int64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeUint(uint64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeInt(int64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeInt(int64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapUint16Int32R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapUint16Int32R(rv reflect.Value) { fastpathTV.EncMapUint16Int32V(rv.Interface().(map[uint16]int32), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapUint16Int32V(v map[uint16]int32, checkNil bool, e *Encoder) { @@ -6340,27 +4854,14 @@ func (_ fastpathT) EncMapUint16Int32V(v map[uint16]int32, checkNil bool, e *Enco } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeInt(int64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeUint(uint64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeInt(int64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeInt(int64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapUint16Int64R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapUint16Int64R(rv reflect.Value) { fastpathTV.EncMapUint16Int64V(rv.Interface().(map[uint16]int64), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapUint16Int64V(v map[uint16]int64, checkNil bool, e *Encoder) { @@ -6371,27 +4872,14 @@ func (_ fastpathT) EncMapUint16Int64V(v map[uint16]int64, checkNil bool, e *Enco } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeInt(int64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeUint(uint64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeInt(int64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeInt(int64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapUint16Float32R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapUint16Float32R(rv reflect.Value) { fastpathTV.EncMapUint16Float32V(rv.Interface().(map[uint16]float32), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapUint16Float32V(v map[uint16]float32, checkNil bool, e *Encoder) { @@ -6402,27 +4890,14 @@ func (_ fastpathT) EncMapUint16Float32V(v map[uint16]float32, checkNil bool, e * } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeFloat32(v2) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeUint(uint64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeFloat32(v2) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeFloat32(v2) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapUint16Float64R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapUint16Float64R(rv reflect.Value) { fastpathTV.EncMapUint16Float64V(rv.Interface().(map[uint16]float64), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapUint16Float64V(v map[uint16]float64, checkNil bool, e *Encoder) { @@ -6433,27 +4908,14 @@ func (_ fastpathT) EncMapUint16Float64V(v map[uint16]float64, checkNil bool, e * } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeFloat64(v2) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeUint(uint64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeFloat64(v2) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeFloat64(v2) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapUint16BoolR(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapUint16BoolR(rv reflect.Value) { fastpathTV.EncMapUint16BoolV(rv.Interface().(map[uint16]bool), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapUint16BoolV(v map[uint16]bool, checkNil bool, e *Encoder) { @@ -6464,27 +4926,14 @@ func (_ fastpathT) EncMapUint16BoolV(v map[uint16]bool, checkNil bool, e *Encode } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeBool(v2) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeUint(uint64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeBool(v2) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeBool(v2) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapUint32IntfR(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapUint32IntfR(rv reflect.Value) { fastpathTV.EncMapUint32IntfV(rv.Interface().(map[uint32]interface{}), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapUint32IntfV(v map[uint32]interface{}, checkNil bool, e *Encoder) { @@ -6495,27 +4944,14 @@ func (_ fastpathT) EncMapUint32IntfV(v map[uint32]interface{}, checkNil bool, e } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - e.encode(v2) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeUint(uint64(k2)) - ee.EncodeMapKVSeparator() - e.encode(v2) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + e.encode(v2) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapUint32StringR(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapUint32StringR(rv reflect.Value) { fastpathTV.EncMapUint32StringV(rv.Interface().(map[uint32]string), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapUint32StringV(v map[uint32]string, checkNil bool, e *Encoder) { @@ -6526,27 +4962,14 @@ func (_ fastpathT) EncMapUint32StringV(v map[uint32]string, checkNil bool, e *En } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeString(c_UTF8, v2) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeUint(uint64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeString(c_UTF8, v2) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeString(c_UTF8, v2) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapUint32UintR(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapUint32UintR(rv reflect.Value) { fastpathTV.EncMapUint32UintV(rv.Interface().(map[uint32]uint), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapUint32UintV(v map[uint32]uint, checkNil bool, e *Encoder) { @@ -6557,27 +4980,14 @@ func (_ fastpathT) EncMapUint32UintV(v map[uint32]uint, checkNil bool, e *Encode } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeUint(uint64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeUint(uint64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeUint(uint64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeUint(uint64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapUint32Uint8R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapUint32Uint8R(rv reflect.Value) { fastpathTV.EncMapUint32Uint8V(rv.Interface().(map[uint32]uint8), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapUint32Uint8V(v map[uint32]uint8, checkNil bool, e *Encoder) { @@ -6588,27 +4998,14 @@ func (_ fastpathT) EncMapUint32Uint8V(v map[uint32]uint8, checkNil bool, e *Enco } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeUint(uint64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeUint(uint64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeUint(uint64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeUint(uint64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapUint32Uint16R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapUint32Uint16R(rv reflect.Value) { fastpathTV.EncMapUint32Uint16V(rv.Interface().(map[uint32]uint16), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapUint32Uint16V(v map[uint32]uint16, checkNil bool, e *Encoder) { @@ -6619,27 +5016,14 @@ func (_ fastpathT) EncMapUint32Uint16V(v map[uint32]uint16, checkNil bool, e *En } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeUint(uint64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeUint(uint64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeUint(uint64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeUint(uint64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapUint32Uint32R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapUint32Uint32R(rv reflect.Value) { fastpathTV.EncMapUint32Uint32V(rv.Interface().(map[uint32]uint32), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapUint32Uint32V(v map[uint32]uint32, checkNil bool, e *Encoder) { @@ -6650,27 +5034,14 @@ func (_ fastpathT) EncMapUint32Uint32V(v map[uint32]uint32, checkNil bool, e *En } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeUint(uint64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeUint(uint64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeUint(uint64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeUint(uint64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapUint32Uint64R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapUint32Uint64R(rv reflect.Value) { fastpathTV.EncMapUint32Uint64V(rv.Interface().(map[uint32]uint64), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapUint32Uint64V(v map[uint32]uint64, checkNil bool, e *Encoder) { @@ -6681,27 +5052,14 @@ func (_ fastpathT) EncMapUint32Uint64V(v map[uint32]uint64, checkNil bool, e *En } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeUint(uint64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeUint(uint64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeUint(uint64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeUint(uint64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapUint32IntR(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapUint32IntR(rv reflect.Value) { fastpathTV.EncMapUint32IntV(rv.Interface().(map[uint32]int), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapUint32IntV(v map[uint32]int, checkNil bool, e *Encoder) { @@ -6712,27 +5070,14 @@ func (_ fastpathT) EncMapUint32IntV(v map[uint32]int, checkNil bool, e *Encoder) } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeInt(int64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeUint(uint64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeInt(int64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeInt(int64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapUint32Int8R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapUint32Int8R(rv reflect.Value) { fastpathTV.EncMapUint32Int8V(rv.Interface().(map[uint32]int8), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapUint32Int8V(v map[uint32]int8, checkNil bool, e *Encoder) { @@ -6743,27 +5088,14 @@ func (_ fastpathT) EncMapUint32Int8V(v map[uint32]int8, checkNil bool, e *Encode } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeInt(int64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeUint(uint64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeInt(int64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeInt(int64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapUint32Int16R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapUint32Int16R(rv reflect.Value) { fastpathTV.EncMapUint32Int16V(rv.Interface().(map[uint32]int16), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapUint32Int16V(v map[uint32]int16, checkNil bool, e *Encoder) { @@ -6774,27 +5106,14 @@ func (_ fastpathT) EncMapUint32Int16V(v map[uint32]int16, checkNil bool, e *Enco } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeInt(int64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeUint(uint64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeInt(int64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeInt(int64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapUint32Int32R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapUint32Int32R(rv reflect.Value) { fastpathTV.EncMapUint32Int32V(rv.Interface().(map[uint32]int32), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapUint32Int32V(v map[uint32]int32, checkNil bool, e *Encoder) { @@ -6805,27 +5124,14 @@ func (_ fastpathT) EncMapUint32Int32V(v map[uint32]int32, checkNil bool, e *Enco } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeInt(int64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeUint(uint64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeInt(int64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeInt(int64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapUint32Int64R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapUint32Int64R(rv reflect.Value) { fastpathTV.EncMapUint32Int64V(rv.Interface().(map[uint32]int64), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapUint32Int64V(v map[uint32]int64, checkNil bool, e *Encoder) { @@ -6836,27 +5142,14 @@ func (_ fastpathT) EncMapUint32Int64V(v map[uint32]int64, checkNil bool, e *Enco } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeInt(int64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeUint(uint64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeInt(int64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeInt(int64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapUint32Float32R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapUint32Float32R(rv reflect.Value) { fastpathTV.EncMapUint32Float32V(rv.Interface().(map[uint32]float32), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapUint32Float32V(v map[uint32]float32, checkNil bool, e *Encoder) { @@ -6867,27 +5160,14 @@ func (_ fastpathT) EncMapUint32Float32V(v map[uint32]float32, checkNil bool, e * } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeFloat32(v2) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeUint(uint64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeFloat32(v2) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeFloat32(v2) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapUint32Float64R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapUint32Float64R(rv reflect.Value) { fastpathTV.EncMapUint32Float64V(rv.Interface().(map[uint32]float64), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapUint32Float64V(v map[uint32]float64, checkNil bool, e *Encoder) { @@ -6898,27 +5178,14 @@ func (_ fastpathT) EncMapUint32Float64V(v map[uint32]float64, checkNil bool, e * } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeFloat64(v2) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeUint(uint64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeFloat64(v2) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeFloat64(v2) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapUint32BoolR(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapUint32BoolR(rv reflect.Value) { fastpathTV.EncMapUint32BoolV(rv.Interface().(map[uint32]bool), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapUint32BoolV(v map[uint32]bool, checkNil bool, e *Encoder) { @@ -6929,27 +5196,14 @@ func (_ fastpathT) EncMapUint32BoolV(v map[uint32]bool, checkNil bool, e *Encode } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeBool(v2) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeUint(uint64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeBool(v2) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeBool(v2) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapUint64IntfR(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapUint64IntfR(rv reflect.Value) { fastpathTV.EncMapUint64IntfV(rv.Interface().(map[uint64]interface{}), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapUint64IntfV(v map[uint64]interface{}, checkNil bool, e *Encoder) { @@ -6960,27 +5214,14 @@ func (_ fastpathT) EncMapUint64IntfV(v map[uint64]interface{}, checkNil bool, e } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - e.encode(v2) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeUint(uint64(k2)) - ee.EncodeMapKVSeparator() - e.encode(v2) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + e.encode(v2) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapUint64StringR(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapUint64StringR(rv reflect.Value) { fastpathTV.EncMapUint64StringV(rv.Interface().(map[uint64]string), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapUint64StringV(v map[uint64]string, checkNil bool, e *Encoder) { @@ -6991,27 +5232,14 @@ func (_ fastpathT) EncMapUint64StringV(v map[uint64]string, checkNil bool, e *En } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeString(c_UTF8, v2) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeUint(uint64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeString(c_UTF8, v2) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeString(c_UTF8, v2) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapUint64UintR(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapUint64UintR(rv reflect.Value) { fastpathTV.EncMapUint64UintV(rv.Interface().(map[uint64]uint), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapUint64UintV(v map[uint64]uint, checkNil bool, e *Encoder) { @@ -7020,29 +5248,16 @@ func (_ fastpathT) EncMapUint64UintV(v map[uint64]uint, checkNil bool, e *Encode ee.EncodeNil() return } - ee.EncodeMapStart(len(v)) - - if e.be { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeUint(uint64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeUint(uint64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeUint(uint64(v2)) - j++ - } - ee.EncodeMapEnd() + ee.EncodeMapStart(len(v)) + + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeUint(uint64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapUint64Uint8R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapUint64Uint8R(rv reflect.Value) { fastpathTV.EncMapUint64Uint8V(rv.Interface().(map[uint64]uint8), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapUint64Uint8V(v map[uint64]uint8, checkNil bool, e *Encoder) { @@ -7053,27 +5268,14 @@ func (_ fastpathT) EncMapUint64Uint8V(v map[uint64]uint8, checkNil bool, e *Enco } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeUint(uint64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeUint(uint64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeUint(uint64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeUint(uint64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapUint64Uint16R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapUint64Uint16R(rv reflect.Value) { fastpathTV.EncMapUint64Uint16V(rv.Interface().(map[uint64]uint16), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapUint64Uint16V(v map[uint64]uint16, checkNil bool, e *Encoder) { @@ -7084,27 +5286,14 @@ func (_ fastpathT) EncMapUint64Uint16V(v map[uint64]uint16, checkNil bool, e *En } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeUint(uint64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeUint(uint64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeUint(uint64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeUint(uint64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapUint64Uint32R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapUint64Uint32R(rv reflect.Value) { fastpathTV.EncMapUint64Uint32V(rv.Interface().(map[uint64]uint32), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapUint64Uint32V(v map[uint64]uint32, checkNil bool, e *Encoder) { @@ -7115,27 +5304,14 @@ func (_ fastpathT) EncMapUint64Uint32V(v map[uint64]uint32, checkNil bool, e *En } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeUint(uint64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeUint(uint64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeUint(uint64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeUint(uint64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapUint64Uint64R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapUint64Uint64R(rv reflect.Value) { fastpathTV.EncMapUint64Uint64V(rv.Interface().(map[uint64]uint64), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapUint64Uint64V(v map[uint64]uint64, checkNil bool, e *Encoder) { @@ -7146,27 +5322,14 @@ func (_ fastpathT) EncMapUint64Uint64V(v map[uint64]uint64, checkNil bool, e *En } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeUint(uint64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeUint(uint64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeUint(uint64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeUint(uint64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapUint64IntR(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapUint64IntR(rv reflect.Value) { fastpathTV.EncMapUint64IntV(rv.Interface().(map[uint64]int), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapUint64IntV(v map[uint64]int, checkNil bool, e *Encoder) { @@ -7177,27 +5340,14 @@ func (_ fastpathT) EncMapUint64IntV(v map[uint64]int, checkNil bool, e *Encoder) } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeInt(int64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeUint(uint64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeInt(int64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeInt(int64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapUint64Int8R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapUint64Int8R(rv reflect.Value) { fastpathTV.EncMapUint64Int8V(rv.Interface().(map[uint64]int8), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapUint64Int8V(v map[uint64]int8, checkNil bool, e *Encoder) { @@ -7208,27 +5358,14 @@ func (_ fastpathT) EncMapUint64Int8V(v map[uint64]int8, checkNil bool, e *Encode } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeInt(int64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeUint(uint64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeInt(int64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeInt(int64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapUint64Int16R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapUint64Int16R(rv reflect.Value) { fastpathTV.EncMapUint64Int16V(rv.Interface().(map[uint64]int16), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapUint64Int16V(v map[uint64]int16, checkNil bool, e *Encoder) { @@ -7239,27 +5376,14 @@ func (_ fastpathT) EncMapUint64Int16V(v map[uint64]int16, checkNil bool, e *Enco } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeInt(int64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeUint(uint64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeInt(int64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeInt(int64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapUint64Int32R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapUint64Int32R(rv reflect.Value) { fastpathTV.EncMapUint64Int32V(rv.Interface().(map[uint64]int32), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapUint64Int32V(v map[uint64]int32, checkNil bool, e *Encoder) { @@ -7270,27 +5394,14 @@ func (_ fastpathT) EncMapUint64Int32V(v map[uint64]int32, checkNil bool, e *Enco } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeInt(int64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeUint(uint64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeInt(int64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeInt(int64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapUint64Int64R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapUint64Int64R(rv reflect.Value) { fastpathTV.EncMapUint64Int64V(rv.Interface().(map[uint64]int64), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapUint64Int64V(v map[uint64]int64, checkNil bool, e *Encoder) { @@ -7301,27 +5412,14 @@ func (_ fastpathT) EncMapUint64Int64V(v map[uint64]int64, checkNil bool, e *Enco } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeInt(int64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeUint(uint64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeInt(int64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeInt(int64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapUint64Float32R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapUint64Float32R(rv reflect.Value) { fastpathTV.EncMapUint64Float32V(rv.Interface().(map[uint64]float32), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapUint64Float32V(v map[uint64]float32, checkNil bool, e *Encoder) { @@ -7332,27 +5430,14 @@ func (_ fastpathT) EncMapUint64Float32V(v map[uint64]float32, checkNil bool, e * } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeFloat32(v2) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeUint(uint64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeFloat32(v2) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeFloat32(v2) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapUint64Float64R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapUint64Float64R(rv reflect.Value) { fastpathTV.EncMapUint64Float64V(rv.Interface().(map[uint64]float64), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapUint64Float64V(v map[uint64]float64, checkNil bool, e *Encoder) { @@ -7363,27 +5448,14 @@ func (_ fastpathT) EncMapUint64Float64V(v map[uint64]float64, checkNil bool, e * } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeFloat64(v2) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeUint(uint64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeFloat64(v2) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeFloat64(v2) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapUint64BoolR(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapUint64BoolR(rv reflect.Value) { fastpathTV.EncMapUint64BoolV(rv.Interface().(map[uint64]bool), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapUint64BoolV(v map[uint64]bool, checkNil bool, e *Encoder) { @@ -7394,27 +5466,14 @@ func (_ fastpathT) EncMapUint64BoolV(v map[uint64]bool, checkNil bool, e *Encode } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeBool(v2) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeUint(uint64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeBool(v2) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeBool(v2) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapIntIntfR(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapIntIntfR(rv reflect.Value) { fastpathTV.EncMapIntIntfV(rv.Interface().(map[int]interface{}), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapIntIntfV(v map[int]interface{}, checkNil bool, e *Encoder) { @@ -7425,27 +5484,14 @@ func (_ fastpathT) EncMapIntIntfV(v map[int]interface{}, checkNil bool, e *Encod } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - e.encode(v2) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeInt(int64(k2)) - ee.EncodeMapKVSeparator() - e.encode(v2) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + e.encode(v2) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapIntStringR(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapIntStringR(rv reflect.Value) { fastpathTV.EncMapIntStringV(rv.Interface().(map[int]string), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapIntStringV(v map[int]string, checkNil bool, e *Encoder) { @@ -7456,27 +5502,14 @@ func (_ fastpathT) EncMapIntStringV(v map[int]string, checkNil bool, e *Encoder) } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeString(c_UTF8, v2) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeInt(int64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeString(c_UTF8, v2) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeString(c_UTF8, v2) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapIntUintR(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapIntUintR(rv reflect.Value) { fastpathTV.EncMapIntUintV(rv.Interface().(map[int]uint), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapIntUintV(v map[int]uint, checkNil bool, e *Encoder) { @@ -7487,27 +5520,14 @@ func (_ fastpathT) EncMapIntUintV(v map[int]uint, checkNil bool, e *Encoder) { } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeUint(uint64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeInt(int64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeUint(uint64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeUint(uint64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapIntUint8R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapIntUint8R(rv reflect.Value) { fastpathTV.EncMapIntUint8V(rv.Interface().(map[int]uint8), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapIntUint8V(v map[int]uint8, checkNil bool, e *Encoder) { @@ -7518,27 +5538,14 @@ func (_ fastpathT) EncMapIntUint8V(v map[int]uint8, checkNil bool, e *Encoder) { } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeUint(uint64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeInt(int64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeUint(uint64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeUint(uint64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapIntUint16R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapIntUint16R(rv reflect.Value) { fastpathTV.EncMapIntUint16V(rv.Interface().(map[int]uint16), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapIntUint16V(v map[int]uint16, checkNil bool, e *Encoder) { @@ -7549,27 +5556,14 @@ func (_ fastpathT) EncMapIntUint16V(v map[int]uint16, checkNil bool, e *Encoder) } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeUint(uint64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeInt(int64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeUint(uint64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeUint(uint64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapIntUint32R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapIntUint32R(rv reflect.Value) { fastpathTV.EncMapIntUint32V(rv.Interface().(map[int]uint32), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapIntUint32V(v map[int]uint32, checkNil bool, e *Encoder) { @@ -7580,27 +5574,14 @@ func (_ fastpathT) EncMapIntUint32V(v map[int]uint32, checkNil bool, e *Encoder) } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeUint(uint64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeInt(int64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeUint(uint64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeUint(uint64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapIntUint64R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapIntUint64R(rv reflect.Value) { fastpathTV.EncMapIntUint64V(rv.Interface().(map[int]uint64), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapIntUint64V(v map[int]uint64, checkNil bool, e *Encoder) { @@ -7611,27 +5592,14 @@ func (_ fastpathT) EncMapIntUint64V(v map[int]uint64, checkNil bool, e *Encoder) } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeUint(uint64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeInt(int64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeUint(uint64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeUint(uint64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapIntIntR(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapIntIntR(rv reflect.Value) { fastpathTV.EncMapIntIntV(rv.Interface().(map[int]int), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapIntIntV(v map[int]int, checkNil bool, e *Encoder) { @@ -7642,27 +5610,14 @@ func (_ fastpathT) EncMapIntIntV(v map[int]int, checkNil bool, e *Encoder) { } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeInt(int64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeInt(int64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeInt(int64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeInt(int64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapIntInt8R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapIntInt8R(rv reflect.Value) { fastpathTV.EncMapIntInt8V(rv.Interface().(map[int]int8), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapIntInt8V(v map[int]int8, checkNil bool, e *Encoder) { @@ -7673,27 +5628,14 @@ func (_ fastpathT) EncMapIntInt8V(v map[int]int8, checkNil bool, e *Encoder) { } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeInt(int64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeInt(int64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeInt(int64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeInt(int64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapIntInt16R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapIntInt16R(rv reflect.Value) { fastpathTV.EncMapIntInt16V(rv.Interface().(map[int]int16), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapIntInt16V(v map[int]int16, checkNil bool, e *Encoder) { @@ -7704,27 +5646,14 @@ func (_ fastpathT) EncMapIntInt16V(v map[int]int16, checkNil bool, e *Encoder) { } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeInt(int64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeInt(int64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeInt(int64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeInt(int64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapIntInt32R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapIntInt32R(rv reflect.Value) { fastpathTV.EncMapIntInt32V(rv.Interface().(map[int]int32), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapIntInt32V(v map[int]int32, checkNil bool, e *Encoder) { @@ -7735,27 +5664,14 @@ func (_ fastpathT) EncMapIntInt32V(v map[int]int32, checkNil bool, e *Encoder) { } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeInt(int64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeInt(int64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeInt(int64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeInt(int64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapIntInt64R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapIntInt64R(rv reflect.Value) { fastpathTV.EncMapIntInt64V(rv.Interface().(map[int]int64), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapIntInt64V(v map[int]int64, checkNil bool, e *Encoder) { @@ -7766,27 +5682,14 @@ func (_ fastpathT) EncMapIntInt64V(v map[int]int64, checkNil bool, e *Encoder) { } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeInt(int64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeInt(int64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeInt(int64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeInt(int64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapIntFloat32R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapIntFloat32R(rv reflect.Value) { fastpathTV.EncMapIntFloat32V(rv.Interface().(map[int]float32), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapIntFloat32V(v map[int]float32, checkNil bool, e *Encoder) { @@ -7797,27 +5700,14 @@ func (_ fastpathT) EncMapIntFloat32V(v map[int]float32, checkNil bool, e *Encode } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeFloat32(v2) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeInt(int64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeFloat32(v2) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeFloat32(v2) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapIntFloat64R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapIntFloat64R(rv reflect.Value) { fastpathTV.EncMapIntFloat64V(rv.Interface().(map[int]float64), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapIntFloat64V(v map[int]float64, checkNil bool, e *Encoder) { @@ -7828,27 +5718,14 @@ func (_ fastpathT) EncMapIntFloat64V(v map[int]float64, checkNil bool, e *Encode } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeFloat64(v2) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeInt(int64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeFloat64(v2) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeFloat64(v2) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapIntBoolR(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapIntBoolR(rv reflect.Value) { fastpathTV.EncMapIntBoolV(rv.Interface().(map[int]bool), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapIntBoolV(v map[int]bool, checkNil bool, e *Encoder) { @@ -7859,27 +5736,14 @@ func (_ fastpathT) EncMapIntBoolV(v map[int]bool, checkNil bool, e *Encoder) { } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeBool(v2) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeInt(int64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeBool(v2) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeBool(v2) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapInt8IntfR(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapInt8IntfR(rv reflect.Value) { fastpathTV.EncMapInt8IntfV(rv.Interface().(map[int8]interface{}), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapInt8IntfV(v map[int8]interface{}, checkNil bool, e *Encoder) { @@ -7890,27 +5754,14 @@ func (_ fastpathT) EncMapInt8IntfV(v map[int8]interface{}, checkNil bool, e *Enc } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - e.encode(v2) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeInt(int64(k2)) - ee.EncodeMapKVSeparator() - e.encode(v2) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + e.encode(v2) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapInt8StringR(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapInt8StringR(rv reflect.Value) { fastpathTV.EncMapInt8StringV(rv.Interface().(map[int8]string), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapInt8StringV(v map[int8]string, checkNil bool, e *Encoder) { @@ -7921,27 +5772,14 @@ func (_ fastpathT) EncMapInt8StringV(v map[int8]string, checkNil bool, e *Encode } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeString(c_UTF8, v2) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeInt(int64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeString(c_UTF8, v2) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeString(c_UTF8, v2) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapInt8UintR(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapInt8UintR(rv reflect.Value) { fastpathTV.EncMapInt8UintV(rv.Interface().(map[int8]uint), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapInt8UintV(v map[int8]uint, checkNil bool, e *Encoder) { @@ -7952,27 +5790,14 @@ func (_ fastpathT) EncMapInt8UintV(v map[int8]uint, checkNil bool, e *Encoder) { } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeUint(uint64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeInt(int64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeUint(uint64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeUint(uint64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapInt8Uint8R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapInt8Uint8R(rv reflect.Value) { fastpathTV.EncMapInt8Uint8V(rv.Interface().(map[int8]uint8), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapInt8Uint8V(v map[int8]uint8, checkNil bool, e *Encoder) { @@ -7983,27 +5808,14 @@ func (_ fastpathT) EncMapInt8Uint8V(v map[int8]uint8, checkNil bool, e *Encoder) } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeUint(uint64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeInt(int64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeUint(uint64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeUint(uint64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapInt8Uint16R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapInt8Uint16R(rv reflect.Value) { fastpathTV.EncMapInt8Uint16V(rv.Interface().(map[int8]uint16), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapInt8Uint16V(v map[int8]uint16, checkNil bool, e *Encoder) { @@ -8014,27 +5826,14 @@ func (_ fastpathT) EncMapInt8Uint16V(v map[int8]uint16, checkNil bool, e *Encode } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeUint(uint64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeInt(int64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeUint(uint64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeUint(uint64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapInt8Uint32R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapInt8Uint32R(rv reflect.Value) { fastpathTV.EncMapInt8Uint32V(rv.Interface().(map[int8]uint32), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapInt8Uint32V(v map[int8]uint32, checkNil bool, e *Encoder) { @@ -8045,27 +5844,14 @@ func (_ fastpathT) EncMapInt8Uint32V(v map[int8]uint32, checkNil bool, e *Encode } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeUint(uint64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeInt(int64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeUint(uint64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeUint(uint64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapInt8Uint64R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapInt8Uint64R(rv reflect.Value) { fastpathTV.EncMapInt8Uint64V(rv.Interface().(map[int8]uint64), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapInt8Uint64V(v map[int8]uint64, checkNil bool, e *Encoder) { @@ -8076,27 +5862,14 @@ func (_ fastpathT) EncMapInt8Uint64V(v map[int8]uint64, checkNil bool, e *Encode } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeUint(uint64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeInt(int64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeUint(uint64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeUint(uint64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapInt8IntR(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapInt8IntR(rv reflect.Value) { fastpathTV.EncMapInt8IntV(rv.Interface().(map[int8]int), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapInt8IntV(v map[int8]int, checkNil bool, e *Encoder) { @@ -8107,27 +5880,14 @@ func (_ fastpathT) EncMapInt8IntV(v map[int8]int, checkNil bool, e *Encoder) { } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeInt(int64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeInt(int64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeInt(int64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeInt(int64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapInt8Int8R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapInt8Int8R(rv reflect.Value) { fastpathTV.EncMapInt8Int8V(rv.Interface().(map[int8]int8), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapInt8Int8V(v map[int8]int8, checkNil bool, e *Encoder) { @@ -8138,27 +5898,14 @@ func (_ fastpathT) EncMapInt8Int8V(v map[int8]int8, checkNil bool, e *Encoder) { } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeInt(int64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeInt(int64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeInt(int64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeInt(int64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapInt8Int16R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapInt8Int16R(rv reflect.Value) { fastpathTV.EncMapInt8Int16V(rv.Interface().(map[int8]int16), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapInt8Int16V(v map[int8]int16, checkNil bool, e *Encoder) { @@ -8169,27 +5916,14 @@ func (_ fastpathT) EncMapInt8Int16V(v map[int8]int16, checkNil bool, e *Encoder) } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeInt(int64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeInt(int64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeInt(int64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeInt(int64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapInt8Int32R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapInt8Int32R(rv reflect.Value) { fastpathTV.EncMapInt8Int32V(rv.Interface().(map[int8]int32), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapInt8Int32V(v map[int8]int32, checkNil bool, e *Encoder) { @@ -8200,27 +5934,14 @@ func (_ fastpathT) EncMapInt8Int32V(v map[int8]int32, checkNil bool, e *Encoder) } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeInt(int64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeInt(int64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeInt(int64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeInt(int64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapInt8Int64R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapInt8Int64R(rv reflect.Value) { fastpathTV.EncMapInt8Int64V(rv.Interface().(map[int8]int64), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapInt8Int64V(v map[int8]int64, checkNil bool, e *Encoder) { @@ -8231,27 +5952,14 @@ func (_ fastpathT) EncMapInt8Int64V(v map[int8]int64, checkNil bool, e *Encoder) } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeInt(int64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeInt(int64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeInt(int64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeInt(int64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapInt8Float32R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapInt8Float32R(rv reflect.Value) { fastpathTV.EncMapInt8Float32V(rv.Interface().(map[int8]float32), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapInt8Float32V(v map[int8]float32, checkNil bool, e *Encoder) { @@ -8262,27 +5970,14 @@ func (_ fastpathT) EncMapInt8Float32V(v map[int8]float32, checkNil bool, e *Enco } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeFloat32(v2) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeInt(int64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeFloat32(v2) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeFloat32(v2) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapInt8Float64R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapInt8Float64R(rv reflect.Value) { fastpathTV.EncMapInt8Float64V(rv.Interface().(map[int8]float64), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapInt8Float64V(v map[int8]float64, checkNil bool, e *Encoder) { @@ -8293,27 +5988,14 @@ func (_ fastpathT) EncMapInt8Float64V(v map[int8]float64, checkNil bool, e *Enco } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeFloat64(v2) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeInt(int64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeFloat64(v2) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeFloat64(v2) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapInt8BoolR(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapInt8BoolR(rv reflect.Value) { fastpathTV.EncMapInt8BoolV(rv.Interface().(map[int8]bool), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapInt8BoolV(v map[int8]bool, checkNil bool, e *Encoder) { @@ -8324,27 +6006,14 @@ func (_ fastpathT) EncMapInt8BoolV(v map[int8]bool, checkNil bool, e *Encoder) { } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeBool(v2) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeInt(int64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeBool(v2) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeBool(v2) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapInt16IntfR(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapInt16IntfR(rv reflect.Value) { fastpathTV.EncMapInt16IntfV(rv.Interface().(map[int16]interface{}), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapInt16IntfV(v map[int16]interface{}, checkNil bool, e *Encoder) { @@ -8355,27 +6024,14 @@ func (_ fastpathT) EncMapInt16IntfV(v map[int16]interface{}, checkNil bool, e *E } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - e.encode(v2) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeInt(int64(k2)) - ee.EncodeMapKVSeparator() - e.encode(v2) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + e.encode(v2) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapInt16StringR(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapInt16StringR(rv reflect.Value) { fastpathTV.EncMapInt16StringV(rv.Interface().(map[int16]string), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapInt16StringV(v map[int16]string, checkNil bool, e *Encoder) { @@ -8386,27 +6042,14 @@ func (_ fastpathT) EncMapInt16StringV(v map[int16]string, checkNil bool, e *Enco } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeString(c_UTF8, v2) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeInt(int64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeString(c_UTF8, v2) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeString(c_UTF8, v2) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapInt16UintR(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapInt16UintR(rv reflect.Value) { fastpathTV.EncMapInt16UintV(rv.Interface().(map[int16]uint), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapInt16UintV(v map[int16]uint, checkNil bool, e *Encoder) { @@ -8417,27 +6060,14 @@ func (_ fastpathT) EncMapInt16UintV(v map[int16]uint, checkNil bool, e *Encoder) } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeUint(uint64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeInt(int64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeUint(uint64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeUint(uint64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapInt16Uint8R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapInt16Uint8R(rv reflect.Value) { fastpathTV.EncMapInt16Uint8V(rv.Interface().(map[int16]uint8), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapInt16Uint8V(v map[int16]uint8, checkNil bool, e *Encoder) { @@ -8448,27 +6078,14 @@ func (_ fastpathT) EncMapInt16Uint8V(v map[int16]uint8, checkNil bool, e *Encode } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeUint(uint64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeInt(int64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeUint(uint64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeUint(uint64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapInt16Uint16R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapInt16Uint16R(rv reflect.Value) { fastpathTV.EncMapInt16Uint16V(rv.Interface().(map[int16]uint16), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapInt16Uint16V(v map[int16]uint16, checkNil bool, e *Encoder) { @@ -8479,27 +6096,14 @@ func (_ fastpathT) EncMapInt16Uint16V(v map[int16]uint16, checkNil bool, e *Enco } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeUint(uint64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeInt(int64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeUint(uint64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeUint(uint64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapInt16Uint32R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapInt16Uint32R(rv reflect.Value) { fastpathTV.EncMapInt16Uint32V(rv.Interface().(map[int16]uint32), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapInt16Uint32V(v map[int16]uint32, checkNil bool, e *Encoder) { @@ -8510,27 +6114,14 @@ func (_ fastpathT) EncMapInt16Uint32V(v map[int16]uint32, checkNil bool, e *Enco } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeUint(uint64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeInt(int64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeUint(uint64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeUint(uint64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapInt16Uint64R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapInt16Uint64R(rv reflect.Value) { fastpathTV.EncMapInt16Uint64V(rv.Interface().(map[int16]uint64), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapInt16Uint64V(v map[int16]uint64, checkNil bool, e *Encoder) { @@ -8541,58 +6132,32 @@ func (_ fastpathT) EncMapInt16Uint64V(v map[int16]uint64, checkNil bool, e *Enco } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeUint(uint64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeInt(int64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeUint(uint64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeUint(uint64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapInt16IntR(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapInt16IntR(rv reflect.Value) { fastpathTV.EncMapInt16IntV(rv.Interface().(map[int16]int), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapInt16IntV(v map[int16]int, checkNil bool, e *Encoder) { ee := e.e if checkNil && v == nil { ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - - if e.be { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeInt(int64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeInt(int64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeInt(int64(v2)) - j++ - } - ee.EncodeMapEnd() + return + } + ee.EncodeMapStart(len(v)) + + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeInt(int64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapInt16Int8R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapInt16Int8R(rv reflect.Value) { fastpathTV.EncMapInt16Int8V(rv.Interface().(map[int16]int8), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapInt16Int8V(v map[int16]int8, checkNil bool, e *Encoder) { @@ -8603,27 +6168,14 @@ func (_ fastpathT) EncMapInt16Int8V(v map[int16]int8, checkNil bool, e *Encoder) } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeInt(int64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeInt(int64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeInt(int64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeInt(int64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapInt16Int16R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapInt16Int16R(rv reflect.Value) { fastpathTV.EncMapInt16Int16V(rv.Interface().(map[int16]int16), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapInt16Int16V(v map[int16]int16, checkNil bool, e *Encoder) { @@ -8634,27 +6186,14 @@ func (_ fastpathT) EncMapInt16Int16V(v map[int16]int16, checkNil bool, e *Encode } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeInt(int64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeInt(int64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeInt(int64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeInt(int64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapInt16Int32R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapInt16Int32R(rv reflect.Value) { fastpathTV.EncMapInt16Int32V(rv.Interface().(map[int16]int32), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapInt16Int32V(v map[int16]int32, checkNil bool, e *Encoder) { @@ -8665,27 +6204,14 @@ func (_ fastpathT) EncMapInt16Int32V(v map[int16]int32, checkNil bool, e *Encode } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeInt(int64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeInt(int64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeInt(int64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeInt(int64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapInt16Int64R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapInt16Int64R(rv reflect.Value) { fastpathTV.EncMapInt16Int64V(rv.Interface().(map[int16]int64), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapInt16Int64V(v map[int16]int64, checkNil bool, e *Encoder) { @@ -8696,27 +6222,14 @@ func (_ fastpathT) EncMapInt16Int64V(v map[int16]int64, checkNil bool, e *Encode } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeInt(int64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeInt(int64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeInt(int64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeInt(int64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapInt16Float32R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapInt16Float32R(rv reflect.Value) { fastpathTV.EncMapInt16Float32V(rv.Interface().(map[int16]float32), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapInt16Float32V(v map[int16]float32, checkNil bool, e *Encoder) { @@ -8727,27 +6240,14 @@ func (_ fastpathT) EncMapInt16Float32V(v map[int16]float32, checkNil bool, e *En } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeFloat32(v2) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeInt(int64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeFloat32(v2) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeFloat32(v2) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapInt16Float64R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapInt16Float64R(rv reflect.Value) { fastpathTV.EncMapInt16Float64V(rv.Interface().(map[int16]float64), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapInt16Float64V(v map[int16]float64, checkNil bool, e *Encoder) { @@ -8758,27 +6258,14 @@ func (_ fastpathT) EncMapInt16Float64V(v map[int16]float64, checkNil bool, e *En } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeFloat64(v2) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeInt(int64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeFloat64(v2) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeFloat64(v2) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapInt16BoolR(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapInt16BoolR(rv reflect.Value) { fastpathTV.EncMapInt16BoolV(rv.Interface().(map[int16]bool), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapInt16BoolV(v map[int16]bool, checkNil bool, e *Encoder) { @@ -8789,27 +6276,14 @@ func (_ fastpathT) EncMapInt16BoolV(v map[int16]bool, checkNil bool, e *Encoder) } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeBool(v2) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeInt(int64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeBool(v2) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeBool(v2) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapInt32IntfR(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapInt32IntfR(rv reflect.Value) { fastpathTV.EncMapInt32IntfV(rv.Interface().(map[int32]interface{}), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapInt32IntfV(v map[int32]interface{}, checkNil bool, e *Encoder) { @@ -8820,27 +6294,14 @@ func (_ fastpathT) EncMapInt32IntfV(v map[int32]interface{}, checkNil bool, e *E } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - e.encode(v2) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeInt(int64(k2)) - ee.EncodeMapKVSeparator() - e.encode(v2) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + e.encode(v2) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapInt32StringR(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapInt32StringR(rv reflect.Value) { fastpathTV.EncMapInt32StringV(rv.Interface().(map[int32]string), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapInt32StringV(v map[int32]string, checkNil bool, e *Encoder) { @@ -8851,27 +6312,14 @@ func (_ fastpathT) EncMapInt32StringV(v map[int32]string, checkNil bool, e *Enco } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeString(c_UTF8, v2) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeInt(int64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeString(c_UTF8, v2) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeString(c_UTF8, v2) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapInt32UintR(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapInt32UintR(rv reflect.Value) { fastpathTV.EncMapInt32UintV(rv.Interface().(map[int32]uint), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapInt32UintV(v map[int32]uint, checkNil bool, e *Encoder) { @@ -8882,27 +6330,14 @@ func (_ fastpathT) EncMapInt32UintV(v map[int32]uint, checkNil bool, e *Encoder) } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeUint(uint64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeInt(int64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeUint(uint64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeUint(uint64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapInt32Uint8R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapInt32Uint8R(rv reflect.Value) { fastpathTV.EncMapInt32Uint8V(rv.Interface().(map[int32]uint8), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapInt32Uint8V(v map[int32]uint8, checkNil bool, e *Encoder) { @@ -8913,27 +6348,14 @@ func (_ fastpathT) EncMapInt32Uint8V(v map[int32]uint8, checkNil bool, e *Encode } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeUint(uint64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeInt(int64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeUint(uint64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeUint(uint64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapInt32Uint16R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapInt32Uint16R(rv reflect.Value) { fastpathTV.EncMapInt32Uint16V(rv.Interface().(map[int32]uint16), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapInt32Uint16V(v map[int32]uint16, checkNil bool, e *Encoder) { @@ -8944,27 +6366,14 @@ func (_ fastpathT) EncMapInt32Uint16V(v map[int32]uint16, checkNil bool, e *Enco } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeUint(uint64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeInt(int64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeUint(uint64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeUint(uint64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapInt32Uint32R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapInt32Uint32R(rv reflect.Value) { fastpathTV.EncMapInt32Uint32V(rv.Interface().(map[int32]uint32), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapInt32Uint32V(v map[int32]uint32, checkNil bool, e *Encoder) { @@ -8975,27 +6384,14 @@ func (_ fastpathT) EncMapInt32Uint32V(v map[int32]uint32, checkNil bool, e *Enco } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeUint(uint64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeInt(int64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeUint(uint64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeUint(uint64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapInt32Uint64R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapInt32Uint64R(rv reflect.Value) { fastpathTV.EncMapInt32Uint64V(rv.Interface().(map[int32]uint64), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapInt32Uint64V(v map[int32]uint64, checkNil bool, e *Encoder) { @@ -9006,27 +6402,14 @@ func (_ fastpathT) EncMapInt32Uint64V(v map[int32]uint64, checkNil bool, e *Enco } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeUint(uint64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeInt(int64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeUint(uint64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeUint(uint64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapInt32IntR(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapInt32IntR(rv reflect.Value) { fastpathTV.EncMapInt32IntV(rv.Interface().(map[int32]int), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapInt32IntV(v map[int32]int, checkNil bool, e *Encoder) { @@ -9037,27 +6420,14 @@ func (_ fastpathT) EncMapInt32IntV(v map[int32]int, checkNil bool, e *Encoder) { } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeInt(int64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeInt(int64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeInt(int64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeInt(int64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapInt32Int8R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapInt32Int8R(rv reflect.Value) { fastpathTV.EncMapInt32Int8V(rv.Interface().(map[int32]int8), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapInt32Int8V(v map[int32]int8, checkNil bool, e *Encoder) { @@ -9068,27 +6438,14 @@ func (_ fastpathT) EncMapInt32Int8V(v map[int32]int8, checkNil bool, e *Encoder) } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeInt(int64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeInt(int64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeInt(int64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeInt(int64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapInt32Int16R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapInt32Int16R(rv reflect.Value) { fastpathTV.EncMapInt32Int16V(rv.Interface().(map[int32]int16), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapInt32Int16V(v map[int32]int16, checkNil bool, e *Encoder) { @@ -9099,27 +6456,14 @@ func (_ fastpathT) EncMapInt32Int16V(v map[int32]int16, checkNil bool, e *Encode } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeInt(int64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeInt(int64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeInt(int64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeInt(int64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapInt32Int32R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapInt32Int32R(rv reflect.Value) { fastpathTV.EncMapInt32Int32V(rv.Interface().(map[int32]int32), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapInt32Int32V(v map[int32]int32, checkNil bool, e *Encoder) { @@ -9130,27 +6474,14 @@ func (_ fastpathT) EncMapInt32Int32V(v map[int32]int32, checkNil bool, e *Encode } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeInt(int64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeInt(int64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeInt(int64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeInt(int64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapInt32Int64R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapInt32Int64R(rv reflect.Value) { fastpathTV.EncMapInt32Int64V(rv.Interface().(map[int32]int64), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapInt32Int64V(v map[int32]int64, checkNil bool, e *Encoder) { @@ -9161,27 +6492,14 @@ func (_ fastpathT) EncMapInt32Int64V(v map[int32]int64, checkNil bool, e *Encode } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeInt(int64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeInt(int64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeInt(int64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeInt(int64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapInt32Float32R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapInt32Float32R(rv reflect.Value) { fastpathTV.EncMapInt32Float32V(rv.Interface().(map[int32]float32), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapInt32Float32V(v map[int32]float32, checkNil bool, e *Encoder) { @@ -9192,27 +6510,14 @@ func (_ fastpathT) EncMapInt32Float32V(v map[int32]float32, checkNil bool, e *En } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeFloat32(v2) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeInt(int64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeFloat32(v2) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeFloat32(v2) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapInt32Float64R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapInt32Float64R(rv reflect.Value) { fastpathTV.EncMapInt32Float64V(rv.Interface().(map[int32]float64), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapInt32Float64V(v map[int32]float64, checkNil bool, e *Encoder) { @@ -9223,27 +6528,14 @@ func (_ fastpathT) EncMapInt32Float64V(v map[int32]float64, checkNil bool, e *En } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeFloat64(v2) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeInt(int64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeFloat64(v2) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeFloat64(v2) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapInt32BoolR(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapInt32BoolR(rv reflect.Value) { fastpathTV.EncMapInt32BoolV(rv.Interface().(map[int32]bool), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapInt32BoolV(v map[int32]bool, checkNil bool, e *Encoder) { @@ -9254,27 +6546,14 @@ func (_ fastpathT) EncMapInt32BoolV(v map[int32]bool, checkNil bool, e *Encoder) } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeBool(v2) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeInt(int64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeBool(v2) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeBool(v2) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapInt64IntfR(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapInt64IntfR(rv reflect.Value) { fastpathTV.EncMapInt64IntfV(rv.Interface().(map[int64]interface{}), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapInt64IntfV(v map[int64]interface{}, checkNil bool, e *Encoder) { @@ -9285,27 +6564,14 @@ func (_ fastpathT) EncMapInt64IntfV(v map[int64]interface{}, checkNil bool, e *E } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - e.encode(v2) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeInt(int64(k2)) - ee.EncodeMapKVSeparator() - e.encode(v2) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + e.encode(v2) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapInt64StringR(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapInt64StringR(rv reflect.Value) { fastpathTV.EncMapInt64StringV(rv.Interface().(map[int64]string), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapInt64StringV(v map[int64]string, checkNil bool, e *Encoder) { @@ -9316,27 +6582,14 @@ func (_ fastpathT) EncMapInt64StringV(v map[int64]string, checkNil bool, e *Enco } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeString(c_UTF8, v2) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeInt(int64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeString(c_UTF8, v2) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeString(c_UTF8, v2) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapInt64UintR(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapInt64UintR(rv reflect.Value) { fastpathTV.EncMapInt64UintV(rv.Interface().(map[int64]uint), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapInt64UintV(v map[int64]uint, checkNil bool, e *Encoder) { @@ -9347,27 +6600,14 @@ func (_ fastpathT) EncMapInt64UintV(v map[int64]uint, checkNil bool, e *Encoder) } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeUint(uint64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeInt(int64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeUint(uint64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeUint(uint64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapInt64Uint8R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapInt64Uint8R(rv reflect.Value) { fastpathTV.EncMapInt64Uint8V(rv.Interface().(map[int64]uint8), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapInt64Uint8V(v map[int64]uint8, checkNil bool, e *Encoder) { @@ -9378,27 +6618,14 @@ func (_ fastpathT) EncMapInt64Uint8V(v map[int64]uint8, checkNil bool, e *Encode } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeUint(uint64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeInt(int64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeUint(uint64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeUint(uint64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapInt64Uint16R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapInt64Uint16R(rv reflect.Value) { fastpathTV.EncMapInt64Uint16V(rv.Interface().(map[int64]uint16), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapInt64Uint16V(v map[int64]uint16, checkNil bool, e *Encoder) { @@ -9409,27 +6636,14 @@ func (_ fastpathT) EncMapInt64Uint16V(v map[int64]uint16, checkNil bool, e *Enco } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeUint(uint64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeInt(int64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeUint(uint64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeUint(uint64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapInt64Uint32R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapInt64Uint32R(rv reflect.Value) { fastpathTV.EncMapInt64Uint32V(rv.Interface().(map[int64]uint32), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapInt64Uint32V(v map[int64]uint32, checkNil bool, e *Encoder) { @@ -9440,27 +6654,14 @@ func (_ fastpathT) EncMapInt64Uint32V(v map[int64]uint32, checkNil bool, e *Enco } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeUint(uint64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeInt(int64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeUint(uint64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeUint(uint64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapInt64Uint64R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapInt64Uint64R(rv reflect.Value) { fastpathTV.EncMapInt64Uint64V(rv.Interface().(map[int64]uint64), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapInt64Uint64V(v map[int64]uint64, checkNil bool, e *Encoder) { @@ -9471,27 +6672,14 @@ func (_ fastpathT) EncMapInt64Uint64V(v map[int64]uint64, checkNil bool, e *Enco } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeUint(uint64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeInt(int64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeUint(uint64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeUint(uint64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapInt64IntR(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapInt64IntR(rv reflect.Value) { fastpathTV.EncMapInt64IntV(rv.Interface().(map[int64]int), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapInt64IntV(v map[int64]int, checkNil bool, e *Encoder) { @@ -9502,27 +6690,14 @@ func (_ fastpathT) EncMapInt64IntV(v map[int64]int, checkNil bool, e *Encoder) { } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeInt(int64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeInt(int64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeInt(int64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeInt(int64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapInt64Int8R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapInt64Int8R(rv reflect.Value) { fastpathTV.EncMapInt64Int8V(rv.Interface().(map[int64]int8), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapInt64Int8V(v map[int64]int8, checkNil bool, e *Encoder) { @@ -9533,27 +6708,14 @@ func (_ fastpathT) EncMapInt64Int8V(v map[int64]int8, checkNil bool, e *Encoder) } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeInt(int64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeInt(int64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeInt(int64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeInt(int64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapInt64Int16R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapInt64Int16R(rv reflect.Value) { fastpathTV.EncMapInt64Int16V(rv.Interface().(map[int64]int16), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapInt64Int16V(v map[int64]int16, checkNil bool, e *Encoder) { @@ -9564,27 +6726,14 @@ func (_ fastpathT) EncMapInt64Int16V(v map[int64]int16, checkNil bool, e *Encode } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeInt(int64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeInt(int64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeInt(int64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeInt(int64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapInt64Int32R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapInt64Int32R(rv reflect.Value) { fastpathTV.EncMapInt64Int32V(rv.Interface().(map[int64]int32), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapInt64Int32V(v map[int64]int32, checkNil bool, e *Encoder) { @@ -9595,27 +6744,14 @@ func (_ fastpathT) EncMapInt64Int32V(v map[int64]int32, checkNil bool, e *Encode } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeInt(int64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeInt(int64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeInt(int64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeInt(int64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapInt64Int64R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapInt64Int64R(rv reflect.Value) { fastpathTV.EncMapInt64Int64V(rv.Interface().(map[int64]int64), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapInt64Int64V(v map[int64]int64, checkNil bool, e *Encoder) { @@ -9626,27 +6762,14 @@ func (_ fastpathT) EncMapInt64Int64V(v map[int64]int64, checkNil bool, e *Encode } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeInt(int64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeInt(int64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeInt(int64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeInt(int64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapInt64Float32R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapInt64Float32R(rv reflect.Value) { fastpathTV.EncMapInt64Float32V(rv.Interface().(map[int64]float32), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapInt64Float32V(v map[int64]float32, checkNil bool, e *Encoder) { @@ -9657,27 +6780,14 @@ func (_ fastpathT) EncMapInt64Float32V(v map[int64]float32, checkNil bool, e *En } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeFloat32(v2) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeInt(int64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeFloat32(v2) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeFloat32(v2) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapInt64Float64R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapInt64Float64R(rv reflect.Value) { fastpathTV.EncMapInt64Float64V(rv.Interface().(map[int64]float64), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapInt64Float64V(v map[int64]float64, checkNil bool, e *Encoder) { @@ -9688,27 +6798,14 @@ func (_ fastpathT) EncMapInt64Float64V(v map[int64]float64, checkNil bool, e *En } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeFloat64(v2) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeInt(int64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeFloat64(v2) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeFloat64(v2) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapInt64BoolR(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapInt64BoolR(rv reflect.Value) { fastpathTV.EncMapInt64BoolV(rv.Interface().(map[int64]bool), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapInt64BoolV(v map[int64]bool, checkNil bool, e *Encoder) { @@ -9719,27 +6816,14 @@ func (_ fastpathT) EncMapInt64BoolV(v map[int64]bool, checkNil bool, e *Encoder) } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeBool(v2) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeInt(int64(k2)) - ee.EncodeMapKVSeparator() - ee.EncodeBool(v2) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeBool(v2) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapBoolIntfR(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapBoolIntfR(rv reflect.Value) { fastpathTV.EncMapBoolIntfV(rv.Interface().(map[bool]interface{}), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapBoolIntfV(v map[bool]interface{}, checkNil bool, e *Encoder) { @@ -9750,27 +6834,14 @@ func (_ fastpathT) EncMapBoolIntfV(v map[bool]interface{}, checkNil bool, e *Enc } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeBool(k2) - e.encode(v2) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeBool(k2) - ee.EncodeMapKVSeparator() - e.encode(v2) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeBool(k2) + e.encode(v2) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapBoolStringR(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapBoolStringR(rv reflect.Value) { fastpathTV.EncMapBoolStringV(rv.Interface().(map[bool]string), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapBoolStringV(v map[bool]string, checkNil bool, e *Encoder) { @@ -9781,27 +6852,14 @@ func (_ fastpathT) EncMapBoolStringV(v map[bool]string, checkNil bool, e *Encode } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeBool(k2) - ee.EncodeString(c_UTF8, v2) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeBool(k2) - ee.EncodeMapKVSeparator() - ee.EncodeString(c_UTF8, v2) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeBool(k2) + ee.EncodeString(c_UTF8, v2) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapBoolUintR(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapBoolUintR(rv reflect.Value) { fastpathTV.EncMapBoolUintV(rv.Interface().(map[bool]uint), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapBoolUintV(v map[bool]uint, checkNil bool, e *Encoder) { @@ -9812,27 +6870,14 @@ func (_ fastpathT) EncMapBoolUintV(v map[bool]uint, checkNil bool, e *Encoder) { } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeBool(k2) - ee.EncodeUint(uint64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeBool(k2) - ee.EncodeMapKVSeparator() - ee.EncodeUint(uint64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeBool(k2) + ee.EncodeUint(uint64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapBoolUint8R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapBoolUint8R(rv reflect.Value) { fastpathTV.EncMapBoolUint8V(rv.Interface().(map[bool]uint8), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapBoolUint8V(v map[bool]uint8, checkNil bool, e *Encoder) { @@ -9843,27 +6888,14 @@ func (_ fastpathT) EncMapBoolUint8V(v map[bool]uint8, checkNil bool, e *Encoder) } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeBool(k2) - ee.EncodeUint(uint64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeBool(k2) - ee.EncodeMapKVSeparator() - ee.EncodeUint(uint64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeBool(k2) + ee.EncodeUint(uint64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapBoolUint16R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapBoolUint16R(rv reflect.Value) { fastpathTV.EncMapBoolUint16V(rv.Interface().(map[bool]uint16), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapBoolUint16V(v map[bool]uint16, checkNil bool, e *Encoder) { @@ -9874,27 +6906,14 @@ func (_ fastpathT) EncMapBoolUint16V(v map[bool]uint16, checkNil bool, e *Encode } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeBool(k2) - ee.EncodeUint(uint64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeBool(k2) - ee.EncodeMapKVSeparator() - ee.EncodeUint(uint64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeBool(k2) + ee.EncodeUint(uint64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapBoolUint32R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapBoolUint32R(rv reflect.Value) { fastpathTV.EncMapBoolUint32V(rv.Interface().(map[bool]uint32), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapBoolUint32V(v map[bool]uint32, checkNil bool, e *Encoder) { @@ -9905,27 +6924,14 @@ func (_ fastpathT) EncMapBoolUint32V(v map[bool]uint32, checkNil bool, e *Encode } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeBool(k2) - ee.EncodeUint(uint64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeBool(k2) - ee.EncodeMapKVSeparator() - ee.EncodeUint(uint64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeBool(k2) + ee.EncodeUint(uint64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapBoolUint64R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapBoolUint64R(rv reflect.Value) { fastpathTV.EncMapBoolUint64V(rv.Interface().(map[bool]uint64), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapBoolUint64V(v map[bool]uint64, checkNil bool, e *Encoder) { @@ -9936,27 +6942,14 @@ func (_ fastpathT) EncMapBoolUint64V(v map[bool]uint64, checkNil bool, e *Encode } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeBool(k2) - ee.EncodeUint(uint64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeBool(k2) - ee.EncodeMapKVSeparator() - ee.EncodeUint(uint64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeBool(k2) + ee.EncodeUint(uint64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapBoolIntR(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapBoolIntR(rv reflect.Value) { fastpathTV.EncMapBoolIntV(rv.Interface().(map[bool]int), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapBoolIntV(v map[bool]int, checkNil bool, e *Encoder) { @@ -9967,27 +6960,14 @@ func (_ fastpathT) EncMapBoolIntV(v map[bool]int, checkNil bool, e *Encoder) { } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeBool(k2) - ee.EncodeInt(int64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeBool(k2) - ee.EncodeMapKVSeparator() - ee.EncodeInt(int64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeBool(k2) + ee.EncodeInt(int64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapBoolInt8R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapBoolInt8R(rv reflect.Value) { fastpathTV.EncMapBoolInt8V(rv.Interface().(map[bool]int8), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapBoolInt8V(v map[bool]int8, checkNil bool, e *Encoder) { @@ -9998,27 +6978,14 @@ func (_ fastpathT) EncMapBoolInt8V(v map[bool]int8, checkNil bool, e *Encoder) { } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeBool(k2) - ee.EncodeInt(int64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeBool(k2) - ee.EncodeMapKVSeparator() - ee.EncodeInt(int64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeBool(k2) + ee.EncodeInt(int64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapBoolInt16R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapBoolInt16R(rv reflect.Value) { fastpathTV.EncMapBoolInt16V(rv.Interface().(map[bool]int16), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapBoolInt16V(v map[bool]int16, checkNil bool, e *Encoder) { @@ -10029,27 +6996,14 @@ func (_ fastpathT) EncMapBoolInt16V(v map[bool]int16, checkNil bool, e *Encoder) } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeBool(k2) - ee.EncodeInt(int64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeBool(k2) - ee.EncodeMapKVSeparator() - ee.EncodeInt(int64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeBool(k2) + ee.EncodeInt(int64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapBoolInt32R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapBoolInt32R(rv reflect.Value) { fastpathTV.EncMapBoolInt32V(rv.Interface().(map[bool]int32), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapBoolInt32V(v map[bool]int32, checkNil bool, e *Encoder) { @@ -10060,27 +7014,14 @@ func (_ fastpathT) EncMapBoolInt32V(v map[bool]int32, checkNil bool, e *Encoder) } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeBool(k2) - ee.EncodeInt(int64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeBool(k2) - ee.EncodeMapKVSeparator() - ee.EncodeInt(int64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeBool(k2) + ee.EncodeInt(int64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapBoolInt64R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapBoolInt64R(rv reflect.Value) { fastpathTV.EncMapBoolInt64V(rv.Interface().(map[bool]int64), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapBoolInt64V(v map[bool]int64, checkNil bool, e *Encoder) { @@ -10091,27 +7032,14 @@ func (_ fastpathT) EncMapBoolInt64V(v map[bool]int64, checkNil bool, e *Encoder) } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeBool(k2) - ee.EncodeInt(int64(v2)) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeBool(k2) - ee.EncodeMapKVSeparator() - ee.EncodeInt(int64(v2)) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeBool(k2) + ee.EncodeInt(int64(v2)) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapBoolFloat32R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapBoolFloat32R(rv reflect.Value) { fastpathTV.EncMapBoolFloat32V(rv.Interface().(map[bool]float32), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapBoolFloat32V(v map[bool]float32, checkNil bool, e *Encoder) { @@ -10120,29 +7048,16 @@ func (_ fastpathT) EncMapBoolFloat32V(v map[bool]float32, checkNil bool, e *Enco ee.EncodeNil() return } - ee.EncodeMapStart(len(v)) - - if e.be { - for k2, v2 := range v { - ee.EncodeBool(k2) - ee.EncodeFloat32(v2) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeBool(k2) - ee.EncodeMapKVSeparator() - ee.EncodeFloat32(v2) - j++ - } - ee.EncodeMapEnd() + ee.EncodeMapStart(len(v)) + + for k2, v2 := range v { + ee.EncodeBool(k2) + ee.EncodeFloat32(v2) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapBoolFloat64R(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapBoolFloat64R(rv reflect.Value) { fastpathTV.EncMapBoolFloat64V(rv.Interface().(map[bool]float64), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapBoolFloat64V(v map[bool]float64, checkNil bool, e *Encoder) { @@ -10153,27 +7068,14 @@ func (_ fastpathT) EncMapBoolFloat64V(v map[bool]float64, checkNil bool, e *Enco } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeBool(k2) - ee.EncodeFloat64(v2) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeBool(k2) - ee.EncodeMapKVSeparator() - ee.EncodeFloat64(v2) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeBool(k2) + ee.EncodeFloat64(v2) } + ee.EncodeEnd() } -func (f encFnInfo) fastpathEncMapBoolBoolR(rv reflect.Value) { +func (f *encFnInfo) fastpathEncMapBoolBoolR(rv reflect.Value) { fastpathTV.EncMapBoolBoolV(rv.Interface().(map[bool]bool), fastpathCheckNilFalse, f.e) } func (_ fastpathT) EncMapBoolBoolV(v map[bool]bool, checkNil bool, e *Encoder) { @@ -10184,24 +7086,11 @@ func (_ fastpathT) EncMapBoolBoolV(v map[bool]bool, checkNil bool, e *Encoder) { } ee.EncodeMapStart(len(v)) - if e.be { - for k2, v2 := range v { - ee.EncodeBool(k2) - ee.EncodeBool(v2) - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - ee.EncodeBool(k2) - ee.EncodeMapKVSeparator() - ee.EncodeBool(v2) - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + ee.EncodeBool(k2) + ee.EncodeBool(v2) } + ee.EncodeEnd() } // -- decode @@ -12130,9 +9019,9 @@ func fastpathDecodeTypeSwitch(iv interface{}, d *Decoder) bool { // -- -- fast path functions -func (f decFnInfo) fastpathDecSliceIntfR(rv reflect.Value) { +func (f *decFnInfo) fastpathDecSliceIntfR(rv reflect.Value) { array := f.seq == seqTypeArray - if !array && rv.CanAddr() { // CanSet => CanAddr + Exported + if !array && rv.CanAddr() { vp := rv.Addr().Interface().(*[]interface{}) v, changed := fastpathTV.DecSliceIntfV(*vp, fastpathCheckNilFalse, !array, f.d) if changed { @@ -12153,7 +9042,7 @@ func (f fastpathT) DecSliceIntfX(vp *[]interface{}, checkNil bool, d *Decoder) { func (_ fastpathT) DecSliceIntfV(v []interface{}, checkNil bool, canChange bool, d *Decoder) (_ []interface{}, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) { dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -12162,12 +9051,14 @@ func (_ fastpathT) DecSliceIntfV(v []interface{}, checkNil bool, canChange bool, } slh, containerLenS := d.decSliceHelperStart() + x2read := containerLenS + var xtrunc bool if canChange && v == nil { - if containerLenS <= 0 { - v = []interface{}{} - } else { - v = make([]interface{}, containerLenS, containerLenS) + var xlen int + if xlen, xtrunc = decInferLen(containerLenS, d.h.MaxInitLen, 16); xtrunc { + x2read = xlen } + v = make([]interface{}, xlen) changed = true } if containerLenS == 0 { @@ -12178,29 +9069,34 @@ func (_ fastpathT) DecSliceIntfV(v []interface{}, checkNil bool, canChange bool, return v, changed } - // for j := 0; j < containerLenS; j++ { if containerLenS > 0 { - decLen := containerLenS if containerLenS > cap(v) { if canChange { - s := make([]interface{}, containerLenS, containerLenS) - // copy(s, v[:cap(v)]) - v = s + var xlen int + if xlen, xtrunc = decInferLen(containerLenS, d.h.MaxInitLen, 16); xtrunc { + x2read = xlen + } + v = make([]interface{}, xlen) changed = true } else { d.arrayCannotExpand(len(v), containerLenS) - decLen = len(v) + x2read = len(v) } } else if containerLenS != len(v) { v = v[:containerLenS] changed = true } - // all checks done. cannot go past len. + j := 0 - for ; j < decLen; j++ { + for ; j < x2read; j++ { d.decode(&v[j]) } - if !canChange { + if xtrunc { + for ; j < containerLenS; j++ { + v = append(v, nil) + d.decode(&v[j]) + } + } else if !canChange { for ; j < containerLenS; j++ { d.swallow() } @@ -12216,10 +9112,7 @@ func (_ fastpathT) DecSliceIntfV(v []interface{}, checkNil bool, canChange bool, d.arrayCannotExpand(len(v), j+1) } } - if j > 0 { - slh.Sep(j) - } - if j < len(v) { // all checks done. cannot go past len. + if j < len(v) { d.decode(&v[j]) } else { @@ -12231,9 +9124,9 @@ func (_ fastpathT) DecSliceIntfV(v []interface{}, checkNil bool, canChange bool, return v, changed } -func (f decFnInfo) fastpathDecSliceStringR(rv reflect.Value) { +func (f *decFnInfo) fastpathDecSliceStringR(rv reflect.Value) { array := f.seq == seqTypeArray - if !array && rv.CanAddr() { // CanSet => CanAddr + Exported + if !array && rv.CanAddr() { vp := rv.Addr().Interface().(*[]string) v, changed := fastpathTV.DecSliceStringV(*vp, fastpathCheckNilFalse, !array, f.d) if changed { @@ -12254,7 +9147,7 @@ func (f fastpathT) DecSliceStringX(vp *[]string, checkNil bool, d *Decoder) { func (_ fastpathT) DecSliceStringV(v []string, checkNil bool, canChange bool, d *Decoder) (_ []string, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) { dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -12263,12 +9156,14 @@ func (_ fastpathT) DecSliceStringV(v []string, checkNil bool, canChange bool, } slh, containerLenS := d.decSliceHelperStart() + x2read := containerLenS + var xtrunc bool if canChange && v == nil { - if containerLenS <= 0 { - v = []string{} - } else { - v = make([]string, containerLenS, containerLenS) + var xlen int + if xlen, xtrunc = decInferLen(containerLenS, d.h.MaxInitLen, 16); xtrunc { + x2read = xlen } + v = make([]string, xlen) changed = true } if containerLenS == 0 { @@ -12279,29 +9174,34 @@ func (_ fastpathT) DecSliceStringV(v []string, checkNil bool, canChange bool, return v, changed } - // for j := 0; j < containerLenS; j++ { if containerLenS > 0 { - decLen := containerLenS if containerLenS > cap(v) { if canChange { - s := make([]string, containerLenS, containerLenS) - // copy(s, v[:cap(v)]) - v = s + var xlen int + if xlen, xtrunc = decInferLen(containerLenS, d.h.MaxInitLen, 16); xtrunc { + x2read = xlen + } + v = make([]string, xlen) changed = true } else { d.arrayCannotExpand(len(v), containerLenS) - decLen = len(v) + x2read = len(v) } } else if containerLenS != len(v) { v = v[:containerLenS] changed = true } - // all checks done. cannot go past len. + j := 0 - for ; j < decLen; j++ { + for ; j < x2read; j++ { v[j] = dd.DecodeString() } - if !canChange { + if xtrunc { + for ; j < containerLenS; j++ { + v = append(v, "") + v[j] = dd.DecodeString() + } + } else if !canChange { for ; j < containerLenS; j++ { d.swallow() } @@ -12317,10 +9217,7 @@ func (_ fastpathT) DecSliceStringV(v []string, checkNil bool, canChange bool, d.arrayCannotExpand(len(v), j+1) } } - if j > 0 { - slh.Sep(j) - } - if j < len(v) { // all checks done. cannot go past len. + if j < len(v) { v[j] = dd.DecodeString() } else { d.swallow() @@ -12331,9 +9228,9 @@ func (_ fastpathT) DecSliceStringV(v []string, checkNil bool, canChange bool, return v, changed } -func (f decFnInfo) fastpathDecSliceFloat32R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecSliceFloat32R(rv reflect.Value) { array := f.seq == seqTypeArray - if !array && rv.CanAddr() { // CanSet => CanAddr + Exported + if !array && rv.CanAddr() { vp := rv.Addr().Interface().(*[]float32) v, changed := fastpathTV.DecSliceFloat32V(*vp, fastpathCheckNilFalse, !array, f.d) if changed { @@ -12354,7 +9251,7 @@ func (f fastpathT) DecSliceFloat32X(vp *[]float32, checkNil bool, d *Decoder) { func (_ fastpathT) DecSliceFloat32V(v []float32, checkNil bool, canChange bool, d *Decoder) (_ []float32, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) { dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -12363,12 +9260,14 @@ func (_ fastpathT) DecSliceFloat32V(v []float32, checkNil bool, canChange bool, } slh, containerLenS := d.decSliceHelperStart() + x2read := containerLenS + var xtrunc bool if canChange && v == nil { - if containerLenS <= 0 { - v = []float32{} - } else { - v = make([]float32, containerLenS, containerLenS) + var xlen int + if xlen, xtrunc = decInferLen(containerLenS, d.h.MaxInitLen, 4); xtrunc { + x2read = xlen } + v = make([]float32, xlen) changed = true } if containerLenS == 0 { @@ -12379,29 +9278,34 @@ func (_ fastpathT) DecSliceFloat32V(v []float32, checkNil bool, canChange bool, return v, changed } - // for j := 0; j < containerLenS; j++ { if containerLenS > 0 { - decLen := containerLenS if containerLenS > cap(v) { if canChange { - s := make([]float32, containerLenS, containerLenS) - // copy(s, v[:cap(v)]) - v = s + var xlen int + if xlen, xtrunc = decInferLen(containerLenS, d.h.MaxInitLen, 4); xtrunc { + x2read = xlen + } + v = make([]float32, xlen) changed = true } else { d.arrayCannotExpand(len(v), containerLenS) - decLen = len(v) + x2read = len(v) } } else if containerLenS != len(v) { v = v[:containerLenS] changed = true } - // all checks done. cannot go past len. + j := 0 - for ; j < decLen; j++ { + for ; j < x2read; j++ { v[j] = float32(dd.DecodeFloat(true)) } - if !canChange { + if xtrunc { + for ; j < containerLenS; j++ { + v = append(v, 0) + v[j] = float32(dd.DecodeFloat(true)) + } + } else if !canChange { for ; j < containerLenS; j++ { d.swallow() } @@ -12417,10 +9321,7 @@ func (_ fastpathT) DecSliceFloat32V(v []float32, checkNil bool, canChange bool, d.arrayCannotExpand(len(v), j+1) } } - if j > 0 { - slh.Sep(j) - } - if j < len(v) { // all checks done. cannot go past len. + if j < len(v) { v[j] = float32(dd.DecodeFloat(true)) } else { d.swallow() @@ -12431,9 +9332,9 @@ func (_ fastpathT) DecSliceFloat32V(v []float32, checkNil bool, canChange bool, return v, changed } -func (f decFnInfo) fastpathDecSliceFloat64R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecSliceFloat64R(rv reflect.Value) { array := f.seq == seqTypeArray - if !array && rv.CanAddr() { // CanSet => CanAddr + Exported + if !array && rv.CanAddr() { vp := rv.Addr().Interface().(*[]float64) v, changed := fastpathTV.DecSliceFloat64V(*vp, fastpathCheckNilFalse, !array, f.d) if changed { @@ -12454,7 +9355,7 @@ func (f fastpathT) DecSliceFloat64X(vp *[]float64, checkNil bool, d *Decoder) { func (_ fastpathT) DecSliceFloat64V(v []float64, checkNil bool, canChange bool, d *Decoder) (_ []float64, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) { dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -12463,12 +9364,14 @@ func (_ fastpathT) DecSliceFloat64V(v []float64, checkNil bool, canChange bool, } slh, containerLenS := d.decSliceHelperStart() + x2read := containerLenS + var xtrunc bool if canChange && v == nil { - if containerLenS <= 0 { - v = []float64{} - } else { - v = make([]float64, containerLenS, containerLenS) + var xlen int + if xlen, xtrunc = decInferLen(containerLenS, d.h.MaxInitLen, 8); xtrunc { + x2read = xlen } + v = make([]float64, xlen) changed = true } if containerLenS == 0 { @@ -12479,29 +9382,34 @@ func (_ fastpathT) DecSliceFloat64V(v []float64, checkNil bool, canChange bool, return v, changed } - // for j := 0; j < containerLenS; j++ { if containerLenS > 0 { - decLen := containerLenS if containerLenS > cap(v) { if canChange { - s := make([]float64, containerLenS, containerLenS) - // copy(s, v[:cap(v)]) - v = s + var xlen int + if xlen, xtrunc = decInferLen(containerLenS, d.h.MaxInitLen, 8); xtrunc { + x2read = xlen + } + v = make([]float64, xlen) changed = true } else { d.arrayCannotExpand(len(v), containerLenS) - decLen = len(v) + x2read = len(v) } } else if containerLenS != len(v) { v = v[:containerLenS] changed = true } - // all checks done. cannot go past len. + j := 0 - for ; j < decLen; j++ { + for ; j < x2read; j++ { v[j] = dd.DecodeFloat(false) } - if !canChange { + if xtrunc { + for ; j < containerLenS; j++ { + v = append(v, 0) + v[j] = dd.DecodeFloat(false) + } + } else if !canChange { for ; j < containerLenS; j++ { d.swallow() } @@ -12517,10 +9425,7 @@ func (_ fastpathT) DecSliceFloat64V(v []float64, checkNil bool, canChange bool, d.arrayCannotExpand(len(v), j+1) } } - if j > 0 { - slh.Sep(j) - } - if j < len(v) { // all checks done. cannot go past len. + if j < len(v) { v[j] = dd.DecodeFloat(false) } else { d.swallow() @@ -12531,9 +9436,9 @@ func (_ fastpathT) DecSliceFloat64V(v []float64, checkNil bool, canChange bool, return v, changed } -func (f decFnInfo) fastpathDecSliceUintR(rv reflect.Value) { +func (f *decFnInfo) fastpathDecSliceUintR(rv reflect.Value) { array := f.seq == seqTypeArray - if !array && rv.CanAddr() { // CanSet => CanAddr + Exported + if !array && rv.CanAddr() { vp := rv.Addr().Interface().(*[]uint) v, changed := fastpathTV.DecSliceUintV(*vp, fastpathCheckNilFalse, !array, f.d) if changed { @@ -12554,7 +9459,7 @@ func (f fastpathT) DecSliceUintX(vp *[]uint, checkNil bool, d *Decoder) { func (_ fastpathT) DecSliceUintV(v []uint, checkNil bool, canChange bool, d *Decoder) (_ []uint, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) { dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -12563,12 +9468,14 @@ func (_ fastpathT) DecSliceUintV(v []uint, checkNil bool, canChange bool, } slh, containerLenS := d.decSliceHelperStart() + x2read := containerLenS + var xtrunc bool if canChange && v == nil { - if containerLenS <= 0 { - v = []uint{} - } else { - v = make([]uint, containerLenS, containerLenS) + var xlen int + if xlen, xtrunc = decInferLen(containerLenS, d.h.MaxInitLen, 8); xtrunc { + x2read = xlen } + v = make([]uint, xlen) changed = true } if containerLenS == 0 { @@ -12579,29 +9486,34 @@ func (_ fastpathT) DecSliceUintV(v []uint, checkNil bool, canChange bool, return v, changed } - // for j := 0; j < containerLenS; j++ { if containerLenS > 0 { - decLen := containerLenS if containerLenS > cap(v) { if canChange { - s := make([]uint, containerLenS, containerLenS) - // copy(s, v[:cap(v)]) - v = s + var xlen int + if xlen, xtrunc = decInferLen(containerLenS, d.h.MaxInitLen, 8); xtrunc { + x2read = xlen + } + v = make([]uint, xlen) changed = true } else { d.arrayCannotExpand(len(v), containerLenS) - decLen = len(v) + x2read = len(v) } } else if containerLenS != len(v) { v = v[:containerLenS] changed = true } - // all checks done. cannot go past len. + j := 0 - for ; j < decLen; j++ { + for ; j < x2read; j++ { v[j] = uint(dd.DecodeUint(uintBitsize)) } - if !canChange { + if xtrunc { + for ; j < containerLenS; j++ { + v = append(v, 0) + v[j] = uint(dd.DecodeUint(uintBitsize)) + } + } else if !canChange { for ; j < containerLenS; j++ { d.swallow() } @@ -12617,10 +9529,7 @@ func (_ fastpathT) DecSliceUintV(v []uint, checkNil bool, canChange bool, d.arrayCannotExpand(len(v), j+1) } } - if j > 0 { - slh.Sep(j) - } - if j < len(v) { // all checks done. cannot go past len. + if j < len(v) { v[j] = uint(dd.DecodeUint(uintBitsize)) } else { d.swallow() @@ -12631,9 +9540,9 @@ func (_ fastpathT) DecSliceUintV(v []uint, checkNil bool, canChange bool, return v, changed } -func (f decFnInfo) fastpathDecSliceUint16R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecSliceUint16R(rv reflect.Value) { array := f.seq == seqTypeArray - if !array && rv.CanAddr() { // CanSet => CanAddr + Exported + if !array && rv.CanAddr() { vp := rv.Addr().Interface().(*[]uint16) v, changed := fastpathTV.DecSliceUint16V(*vp, fastpathCheckNilFalse, !array, f.d) if changed { @@ -12654,7 +9563,7 @@ func (f fastpathT) DecSliceUint16X(vp *[]uint16, checkNil bool, d *Decoder) { func (_ fastpathT) DecSliceUint16V(v []uint16, checkNil bool, canChange bool, d *Decoder) (_ []uint16, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) { dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -12663,12 +9572,14 @@ func (_ fastpathT) DecSliceUint16V(v []uint16, checkNil bool, canChange bool, } slh, containerLenS := d.decSliceHelperStart() + x2read := containerLenS + var xtrunc bool if canChange && v == nil { - if containerLenS <= 0 { - v = []uint16{} - } else { - v = make([]uint16, containerLenS, containerLenS) + var xlen int + if xlen, xtrunc = decInferLen(containerLenS, d.h.MaxInitLen, 2); xtrunc { + x2read = xlen } + v = make([]uint16, xlen) changed = true } if containerLenS == 0 { @@ -12679,29 +9590,34 @@ func (_ fastpathT) DecSliceUint16V(v []uint16, checkNil bool, canChange bool, return v, changed } - // for j := 0; j < containerLenS; j++ { if containerLenS > 0 { - decLen := containerLenS if containerLenS > cap(v) { if canChange { - s := make([]uint16, containerLenS, containerLenS) - // copy(s, v[:cap(v)]) - v = s + var xlen int + if xlen, xtrunc = decInferLen(containerLenS, d.h.MaxInitLen, 2); xtrunc { + x2read = xlen + } + v = make([]uint16, xlen) changed = true } else { d.arrayCannotExpand(len(v), containerLenS) - decLen = len(v) + x2read = len(v) } } else if containerLenS != len(v) { v = v[:containerLenS] changed = true } - // all checks done. cannot go past len. + j := 0 - for ; j < decLen; j++ { + for ; j < x2read; j++ { v[j] = uint16(dd.DecodeUint(16)) } - if !canChange { + if xtrunc { + for ; j < containerLenS; j++ { + v = append(v, 0) + v[j] = uint16(dd.DecodeUint(16)) + } + } else if !canChange { for ; j < containerLenS; j++ { d.swallow() } @@ -12717,10 +9633,7 @@ func (_ fastpathT) DecSliceUint16V(v []uint16, checkNil bool, canChange bool, d.arrayCannotExpand(len(v), j+1) } } - if j > 0 { - slh.Sep(j) - } - if j < len(v) { // all checks done. cannot go past len. + if j < len(v) { v[j] = uint16(dd.DecodeUint(16)) } else { d.swallow() @@ -12731,9 +9644,9 @@ func (_ fastpathT) DecSliceUint16V(v []uint16, checkNil bool, canChange bool, return v, changed } -func (f decFnInfo) fastpathDecSliceUint32R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecSliceUint32R(rv reflect.Value) { array := f.seq == seqTypeArray - if !array && rv.CanAddr() { // CanSet => CanAddr + Exported + if !array && rv.CanAddr() { vp := rv.Addr().Interface().(*[]uint32) v, changed := fastpathTV.DecSliceUint32V(*vp, fastpathCheckNilFalse, !array, f.d) if changed { @@ -12754,7 +9667,7 @@ func (f fastpathT) DecSliceUint32X(vp *[]uint32, checkNil bool, d *Decoder) { func (_ fastpathT) DecSliceUint32V(v []uint32, checkNil bool, canChange bool, d *Decoder) (_ []uint32, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) { dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -12763,12 +9676,14 @@ func (_ fastpathT) DecSliceUint32V(v []uint32, checkNil bool, canChange bool, } slh, containerLenS := d.decSliceHelperStart() + x2read := containerLenS + var xtrunc bool if canChange && v == nil { - if containerLenS <= 0 { - v = []uint32{} - } else { - v = make([]uint32, containerLenS, containerLenS) + var xlen int + if xlen, xtrunc = decInferLen(containerLenS, d.h.MaxInitLen, 4); xtrunc { + x2read = xlen } + v = make([]uint32, xlen) changed = true } if containerLenS == 0 { @@ -12779,29 +9694,34 @@ func (_ fastpathT) DecSliceUint32V(v []uint32, checkNil bool, canChange bool, return v, changed } - // for j := 0; j < containerLenS; j++ { if containerLenS > 0 { - decLen := containerLenS if containerLenS > cap(v) { if canChange { - s := make([]uint32, containerLenS, containerLenS) - // copy(s, v[:cap(v)]) - v = s + var xlen int + if xlen, xtrunc = decInferLen(containerLenS, d.h.MaxInitLen, 4); xtrunc { + x2read = xlen + } + v = make([]uint32, xlen) changed = true } else { d.arrayCannotExpand(len(v), containerLenS) - decLen = len(v) + x2read = len(v) } } else if containerLenS != len(v) { v = v[:containerLenS] changed = true } - // all checks done. cannot go past len. + j := 0 - for ; j < decLen; j++ { + for ; j < x2read; j++ { v[j] = uint32(dd.DecodeUint(32)) } - if !canChange { + if xtrunc { + for ; j < containerLenS; j++ { + v = append(v, 0) + v[j] = uint32(dd.DecodeUint(32)) + } + } else if !canChange { for ; j < containerLenS; j++ { d.swallow() } @@ -12817,10 +9737,7 @@ func (_ fastpathT) DecSliceUint32V(v []uint32, checkNil bool, canChange bool, d.arrayCannotExpand(len(v), j+1) } } - if j > 0 { - slh.Sep(j) - } - if j < len(v) { // all checks done. cannot go past len. + if j < len(v) { v[j] = uint32(dd.DecodeUint(32)) } else { d.swallow() @@ -12831,9 +9748,9 @@ func (_ fastpathT) DecSliceUint32V(v []uint32, checkNil bool, canChange bool, return v, changed } -func (f decFnInfo) fastpathDecSliceUint64R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecSliceUint64R(rv reflect.Value) { array := f.seq == seqTypeArray - if !array && rv.CanAddr() { // CanSet => CanAddr + Exported + if !array && rv.CanAddr() { vp := rv.Addr().Interface().(*[]uint64) v, changed := fastpathTV.DecSliceUint64V(*vp, fastpathCheckNilFalse, !array, f.d) if changed { @@ -12854,7 +9771,7 @@ func (f fastpathT) DecSliceUint64X(vp *[]uint64, checkNil bool, d *Decoder) { func (_ fastpathT) DecSliceUint64V(v []uint64, checkNil bool, canChange bool, d *Decoder) (_ []uint64, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) { dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -12863,12 +9780,14 @@ func (_ fastpathT) DecSliceUint64V(v []uint64, checkNil bool, canChange bool, } slh, containerLenS := d.decSliceHelperStart() + x2read := containerLenS + var xtrunc bool if canChange && v == nil { - if containerLenS <= 0 { - v = []uint64{} - } else { - v = make([]uint64, containerLenS, containerLenS) + var xlen int + if xlen, xtrunc = decInferLen(containerLenS, d.h.MaxInitLen, 8); xtrunc { + x2read = xlen } + v = make([]uint64, xlen) changed = true } if containerLenS == 0 { @@ -12879,29 +9798,34 @@ func (_ fastpathT) DecSliceUint64V(v []uint64, checkNil bool, canChange bool, return v, changed } - // for j := 0; j < containerLenS; j++ { if containerLenS > 0 { - decLen := containerLenS if containerLenS > cap(v) { if canChange { - s := make([]uint64, containerLenS, containerLenS) - // copy(s, v[:cap(v)]) - v = s + var xlen int + if xlen, xtrunc = decInferLen(containerLenS, d.h.MaxInitLen, 8); xtrunc { + x2read = xlen + } + v = make([]uint64, xlen) changed = true } else { d.arrayCannotExpand(len(v), containerLenS) - decLen = len(v) + x2read = len(v) } } else if containerLenS != len(v) { v = v[:containerLenS] changed = true } - // all checks done. cannot go past len. + j := 0 - for ; j < decLen; j++ { + for ; j < x2read; j++ { v[j] = dd.DecodeUint(64) } - if !canChange { + if xtrunc { + for ; j < containerLenS; j++ { + v = append(v, 0) + v[j] = dd.DecodeUint(64) + } + } else if !canChange { for ; j < containerLenS; j++ { d.swallow() } @@ -12917,10 +9841,7 @@ func (_ fastpathT) DecSliceUint64V(v []uint64, checkNil bool, canChange bool, d.arrayCannotExpand(len(v), j+1) } } - if j > 0 { - slh.Sep(j) - } - if j < len(v) { // all checks done. cannot go past len. + if j < len(v) { v[j] = dd.DecodeUint(64) } else { d.swallow() @@ -12931,9 +9852,9 @@ func (_ fastpathT) DecSliceUint64V(v []uint64, checkNil bool, canChange bool, return v, changed } -func (f decFnInfo) fastpathDecSliceIntR(rv reflect.Value) { +func (f *decFnInfo) fastpathDecSliceIntR(rv reflect.Value) { array := f.seq == seqTypeArray - if !array && rv.CanAddr() { // CanSet => CanAddr + Exported + if !array && rv.CanAddr() { vp := rv.Addr().Interface().(*[]int) v, changed := fastpathTV.DecSliceIntV(*vp, fastpathCheckNilFalse, !array, f.d) if changed { @@ -12954,7 +9875,7 @@ func (f fastpathT) DecSliceIntX(vp *[]int, checkNil bool, d *Decoder) { func (_ fastpathT) DecSliceIntV(v []int, checkNil bool, canChange bool, d *Decoder) (_ []int, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) { dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -12963,12 +9884,14 @@ func (_ fastpathT) DecSliceIntV(v []int, checkNil bool, canChange bool, } slh, containerLenS := d.decSliceHelperStart() + x2read := containerLenS + var xtrunc bool if canChange && v == nil { - if containerLenS <= 0 { - v = []int{} - } else { - v = make([]int, containerLenS, containerLenS) + var xlen int + if xlen, xtrunc = decInferLen(containerLenS, d.h.MaxInitLen, 8); xtrunc { + x2read = xlen } + v = make([]int, xlen) changed = true } if containerLenS == 0 { @@ -12979,29 +9902,34 @@ func (_ fastpathT) DecSliceIntV(v []int, checkNil bool, canChange bool, return v, changed } - // for j := 0; j < containerLenS; j++ { if containerLenS > 0 { - decLen := containerLenS if containerLenS > cap(v) { if canChange { - s := make([]int, containerLenS, containerLenS) - // copy(s, v[:cap(v)]) - v = s + var xlen int + if xlen, xtrunc = decInferLen(containerLenS, d.h.MaxInitLen, 8); xtrunc { + x2read = xlen + } + v = make([]int, xlen) changed = true } else { d.arrayCannotExpand(len(v), containerLenS) - decLen = len(v) + x2read = len(v) } } else if containerLenS != len(v) { v = v[:containerLenS] changed = true } - // all checks done. cannot go past len. + j := 0 - for ; j < decLen; j++ { + for ; j < x2read; j++ { v[j] = int(dd.DecodeInt(intBitsize)) } - if !canChange { + if xtrunc { + for ; j < containerLenS; j++ { + v = append(v, 0) + v[j] = int(dd.DecodeInt(intBitsize)) + } + } else if !canChange { for ; j < containerLenS; j++ { d.swallow() } @@ -13017,10 +9945,7 @@ func (_ fastpathT) DecSliceIntV(v []int, checkNil bool, canChange bool, d.arrayCannotExpand(len(v), j+1) } } - if j > 0 { - slh.Sep(j) - } - if j < len(v) { // all checks done. cannot go past len. + if j < len(v) { v[j] = int(dd.DecodeInt(intBitsize)) } else { d.swallow() @@ -13031,9 +9956,9 @@ func (_ fastpathT) DecSliceIntV(v []int, checkNil bool, canChange bool, return v, changed } -func (f decFnInfo) fastpathDecSliceInt8R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecSliceInt8R(rv reflect.Value) { array := f.seq == seqTypeArray - if !array && rv.CanAddr() { // CanSet => CanAddr + Exported + if !array && rv.CanAddr() { vp := rv.Addr().Interface().(*[]int8) v, changed := fastpathTV.DecSliceInt8V(*vp, fastpathCheckNilFalse, !array, f.d) if changed { @@ -13054,7 +9979,7 @@ func (f fastpathT) DecSliceInt8X(vp *[]int8, checkNil bool, d *Decoder) { func (_ fastpathT) DecSliceInt8V(v []int8, checkNil bool, canChange bool, d *Decoder) (_ []int8, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) { dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -13063,12 +9988,14 @@ func (_ fastpathT) DecSliceInt8V(v []int8, checkNil bool, canChange bool, } slh, containerLenS := d.decSliceHelperStart() + x2read := containerLenS + var xtrunc bool if canChange && v == nil { - if containerLenS <= 0 { - v = []int8{} - } else { - v = make([]int8, containerLenS, containerLenS) + var xlen int + if xlen, xtrunc = decInferLen(containerLenS, d.h.MaxInitLen, 1); xtrunc { + x2read = xlen } + v = make([]int8, xlen) changed = true } if containerLenS == 0 { @@ -13079,29 +10006,34 @@ func (_ fastpathT) DecSliceInt8V(v []int8, checkNil bool, canChange bool, return v, changed } - // for j := 0; j < containerLenS; j++ { if containerLenS > 0 { - decLen := containerLenS if containerLenS > cap(v) { if canChange { - s := make([]int8, containerLenS, containerLenS) - // copy(s, v[:cap(v)]) - v = s + var xlen int + if xlen, xtrunc = decInferLen(containerLenS, d.h.MaxInitLen, 1); xtrunc { + x2read = xlen + } + v = make([]int8, xlen) changed = true } else { d.arrayCannotExpand(len(v), containerLenS) - decLen = len(v) + x2read = len(v) } } else if containerLenS != len(v) { v = v[:containerLenS] changed = true } - // all checks done. cannot go past len. + j := 0 - for ; j < decLen; j++ { + for ; j < x2read; j++ { v[j] = int8(dd.DecodeInt(8)) } - if !canChange { + if xtrunc { + for ; j < containerLenS; j++ { + v = append(v, 0) + v[j] = int8(dd.DecodeInt(8)) + } + } else if !canChange { for ; j < containerLenS; j++ { d.swallow() } @@ -13117,10 +10049,7 @@ func (_ fastpathT) DecSliceInt8V(v []int8, checkNil bool, canChange bool, d.arrayCannotExpand(len(v), j+1) } } - if j > 0 { - slh.Sep(j) - } - if j < len(v) { // all checks done. cannot go past len. + if j < len(v) { v[j] = int8(dd.DecodeInt(8)) } else { d.swallow() @@ -13131,9 +10060,9 @@ func (_ fastpathT) DecSliceInt8V(v []int8, checkNil bool, canChange bool, return v, changed } -func (f decFnInfo) fastpathDecSliceInt16R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecSliceInt16R(rv reflect.Value) { array := f.seq == seqTypeArray - if !array && rv.CanAddr() { // CanSet => CanAddr + Exported + if !array && rv.CanAddr() { vp := rv.Addr().Interface().(*[]int16) v, changed := fastpathTV.DecSliceInt16V(*vp, fastpathCheckNilFalse, !array, f.d) if changed { @@ -13154,7 +10083,7 @@ func (f fastpathT) DecSliceInt16X(vp *[]int16, checkNil bool, d *Decoder) { func (_ fastpathT) DecSliceInt16V(v []int16, checkNil bool, canChange bool, d *Decoder) (_ []int16, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) { dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -13163,12 +10092,14 @@ func (_ fastpathT) DecSliceInt16V(v []int16, checkNil bool, canChange bool, } slh, containerLenS := d.decSliceHelperStart() + x2read := containerLenS + var xtrunc bool if canChange && v == nil { - if containerLenS <= 0 { - v = []int16{} - } else { - v = make([]int16, containerLenS, containerLenS) + var xlen int + if xlen, xtrunc = decInferLen(containerLenS, d.h.MaxInitLen, 2); xtrunc { + x2read = xlen } + v = make([]int16, xlen) changed = true } if containerLenS == 0 { @@ -13179,29 +10110,34 @@ func (_ fastpathT) DecSliceInt16V(v []int16, checkNil bool, canChange bool, return v, changed } - // for j := 0; j < containerLenS; j++ { if containerLenS > 0 { - decLen := containerLenS if containerLenS > cap(v) { if canChange { - s := make([]int16, containerLenS, containerLenS) - // copy(s, v[:cap(v)]) - v = s + var xlen int + if xlen, xtrunc = decInferLen(containerLenS, d.h.MaxInitLen, 2); xtrunc { + x2read = xlen + } + v = make([]int16, xlen) changed = true } else { d.arrayCannotExpand(len(v), containerLenS) - decLen = len(v) + x2read = len(v) } } else if containerLenS != len(v) { v = v[:containerLenS] changed = true } - // all checks done. cannot go past len. + j := 0 - for ; j < decLen; j++ { + for ; j < x2read; j++ { v[j] = int16(dd.DecodeInt(16)) } - if !canChange { + if xtrunc { + for ; j < containerLenS; j++ { + v = append(v, 0) + v[j] = int16(dd.DecodeInt(16)) + } + } else if !canChange { for ; j < containerLenS; j++ { d.swallow() } @@ -13217,10 +10153,7 @@ func (_ fastpathT) DecSliceInt16V(v []int16, checkNil bool, canChange bool, d.arrayCannotExpand(len(v), j+1) } } - if j > 0 { - slh.Sep(j) - } - if j < len(v) { // all checks done. cannot go past len. + if j < len(v) { v[j] = int16(dd.DecodeInt(16)) } else { d.swallow() @@ -13231,9 +10164,9 @@ func (_ fastpathT) DecSliceInt16V(v []int16, checkNil bool, canChange bool, return v, changed } -func (f decFnInfo) fastpathDecSliceInt32R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecSliceInt32R(rv reflect.Value) { array := f.seq == seqTypeArray - if !array && rv.CanAddr() { // CanSet => CanAddr + Exported + if !array && rv.CanAddr() { vp := rv.Addr().Interface().(*[]int32) v, changed := fastpathTV.DecSliceInt32V(*vp, fastpathCheckNilFalse, !array, f.d) if changed { @@ -13254,7 +10187,7 @@ func (f fastpathT) DecSliceInt32X(vp *[]int32, checkNil bool, d *Decoder) { func (_ fastpathT) DecSliceInt32V(v []int32, checkNil bool, canChange bool, d *Decoder) (_ []int32, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) { dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -13263,12 +10196,14 @@ func (_ fastpathT) DecSliceInt32V(v []int32, checkNil bool, canChange bool, } slh, containerLenS := d.decSliceHelperStart() + x2read := containerLenS + var xtrunc bool if canChange && v == nil { - if containerLenS <= 0 { - v = []int32{} - } else { - v = make([]int32, containerLenS, containerLenS) + var xlen int + if xlen, xtrunc = decInferLen(containerLenS, d.h.MaxInitLen, 4); xtrunc { + x2read = xlen } + v = make([]int32, xlen) changed = true } if containerLenS == 0 { @@ -13279,29 +10214,34 @@ func (_ fastpathT) DecSliceInt32V(v []int32, checkNil bool, canChange bool, return v, changed } - // for j := 0; j < containerLenS; j++ { if containerLenS > 0 { - decLen := containerLenS if containerLenS > cap(v) { if canChange { - s := make([]int32, containerLenS, containerLenS) - // copy(s, v[:cap(v)]) - v = s + var xlen int + if xlen, xtrunc = decInferLen(containerLenS, d.h.MaxInitLen, 4); xtrunc { + x2read = xlen + } + v = make([]int32, xlen) changed = true } else { d.arrayCannotExpand(len(v), containerLenS) - decLen = len(v) + x2read = len(v) } } else if containerLenS != len(v) { v = v[:containerLenS] changed = true } - // all checks done. cannot go past len. + j := 0 - for ; j < decLen; j++ { + for ; j < x2read; j++ { v[j] = int32(dd.DecodeInt(32)) } - if !canChange { + if xtrunc { + for ; j < containerLenS; j++ { + v = append(v, 0) + v[j] = int32(dd.DecodeInt(32)) + } + } else if !canChange { for ; j < containerLenS; j++ { d.swallow() } @@ -13317,10 +10257,7 @@ func (_ fastpathT) DecSliceInt32V(v []int32, checkNil bool, canChange bool, d.arrayCannotExpand(len(v), j+1) } } - if j > 0 { - slh.Sep(j) - } - if j < len(v) { // all checks done. cannot go past len. + if j < len(v) { v[j] = int32(dd.DecodeInt(32)) } else { d.swallow() @@ -13331,9 +10268,9 @@ func (_ fastpathT) DecSliceInt32V(v []int32, checkNil bool, canChange bool, return v, changed } -func (f decFnInfo) fastpathDecSliceInt64R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecSliceInt64R(rv reflect.Value) { array := f.seq == seqTypeArray - if !array && rv.CanAddr() { // CanSet => CanAddr + Exported + if !array && rv.CanAddr() { vp := rv.Addr().Interface().(*[]int64) v, changed := fastpathTV.DecSliceInt64V(*vp, fastpathCheckNilFalse, !array, f.d) if changed { @@ -13354,7 +10291,7 @@ func (f fastpathT) DecSliceInt64X(vp *[]int64, checkNil bool, d *Decoder) { func (_ fastpathT) DecSliceInt64V(v []int64, checkNil bool, canChange bool, d *Decoder) (_ []int64, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) { dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -13363,12 +10300,14 @@ func (_ fastpathT) DecSliceInt64V(v []int64, checkNil bool, canChange bool, } slh, containerLenS := d.decSliceHelperStart() + x2read := containerLenS + var xtrunc bool if canChange && v == nil { - if containerLenS <= 0 { - v = []int64{} - } else { - v = make([]int64, containerLenS, containerLenS) + var xlen int + if xlen, xtrunc = decInferLen(containerLenS, d.h.MaxInitLen, 8); xtrunc { + x2read = xlen } + v = make([]int64, xlen) changed = true } if containerLenS == 0 { @@ -13379,29 +10318,34 @@ func (_ fastpathT) DecSliceInt64V(v []int64, checkNil bool, canChange bool, return v, changed } - // for j := 0; j < containerLenS; j++ { if containerLenS > 0 { - decLen := containerLenS if containerLenS > cap(v) { if canChange { - s := make([]int64, containerLenS, containerLenS) - // copy(s, v[:cap(v)]) - v = s + var xlen int + if xlen, xtrunc = decInferLen(containerLenS, d.h.MaxInitLen, 8); xtrunc { + x2read = xlen + } + v = make([]int64, xlen) changed = true } else { d.arrayCannotExpand(len(v), containerLenS) - decLen = len(v) + x2read = len(v) } } else if containerLenS != len(v) { v = v[:containerLenS] changed = true } - // all checks done. cannot go past len. + j := 0 - for ; j < decLen; j++ { + for ; j < x2read; j++ { v[j] = dd.DecodeInt(64) } - if !canChange { + if xtrunc { + for ; j < containerLenS; j++ { + v = append(v, 0) + v[j] = dd.DecodeInt(64) + } + } else if !canChange { for ; j < containerLenS; j++ { d.swallow() } @@ -13417,10 +10361,7 @@ func (_ fastpathT) DecSliceInt64V(v []int64, checkNil bool, canChange bool, d.arrayCannotExpand(len(v), j+1) } } - if j > 0 { - slh.Sep(j) - } - if j < len(v) { // all checks done. cannot go past len. + if j < len(v) { v[j] = dd.DecodeInt(64) } else { d.swallow() @@ -13431,9 +10372,9 @@ func (_ fastpathT) DecSliceInt64V(v []int64, checkNil bool, canChange bool, return v, changed } -func (f decFnInfo) fastpathDecSliceBoolR(rv reflect.Value) { +func (f *decFnInfo) fastpathDecSliceBoolR(rv reflect.Value) { array := f.seq == seqTypeArray - if !array && rv.CanAddr() { // CanSet => CanAddr + Exported + if !array && rv.CanAddr() { vp := rv.Addr().Interface().(*[]bool) v, changed := fastpathTV.DecSliceBoolV(*vp, fastpathCheckNilFalse, !array, f.d) if changed { @@ -13454,7 +10395,7 @@ func (f fastpathT) DecSliceBoolX(vp *[]bool, checkNil bool, d *Decoder) { func (_ fastpathT) DecSliceBoolV(v []bool, checkNil bool, canChange bool, d *Decoder) (_ []bool, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) { dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -13463,12 +10404,14 @@ func (_ fastpathT) DecSliceBoolV(v []bool, checkNil bool, canChange bool, } slh, containerLenS := d.decSliceHelperStart() + x2read := containerLenS + var xtrunc bool if canChange && v == nil { - if containerLenS <= 0 { - v = []bool{} - } else { - v = make([]bool, containerLenS, containerLenS) + var xlen int + if xlen, xtrunc = decInferLen(containerLenS, d.h.MaxInitLen, 1); xtrunc { + x2read = xlen } + v = make([]bool, xlen) changed = true } if containerLenS == 0 { @@ -13479,29 +10422,34 @@ func (_ fastpathT) DecSliceBoolV(v []bool, checkNil bool, canChange bool, return v, changed } - // for j := 0; j < containerLenS; j++ { if containerLenS > 0 { - decLen := containerLenS if containerLenS > cap(v) { if canChange { - s := make([]bool, containerLenS, containerLenS) - // copy(s, v[:cap(v)]) - v = s + var xlen int + if xlen, xtrunc = decInferLen(containerLenS, d.h.MaxInitLen, 1); xtrunc { + x2read = xlen + } + v = make([]bool, xlen) changed = true } else { d.arrayCannotExpand(len(v), containerLenS) - decLen = len(v) + x2read = len(v) } } else if containerLenS != len(v) { v = v[:containerLenS] changed = true } - // all checks done. cannot go past len. + j := 0 - for ; j < decLen; j++ { + for ; j < x2read; j++ { v[j] = dd.DecodeBool() } - if !canChange { + if xtrunc { + for ; j < containerLenS; j++ { + v = append(v, false) + v[j] = dd.DecodeBool() + } + } else if !canChange { for ; j < containerLenS; j++ { d.swallow() } @@ -13517,10 +10465,7 @@ func (_ fastpathT) DecSliceBoolV(v []bool, checkNil bool, canChange bool, d.arrayCannotExpand(len(v), j+1) } } - if j > 0 { - slh.Sep(j) - } - if j < len(v) { // all checks done. cannot go past len. + if j < len(v) { v[j] = dd.DecodeBool() } else { d.swallow() @@ -13531,7 +10476,7 @@ func (_ fastpathT) DecSliceBoolV(v []bool, checkNil bool, canChange bool, return v, changed } -func (f decFnInfo) fastpathDecMapIntfIntfR(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapIntfIntfR(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[interface{}]interface{}) v, changed := fastpathTV.DecMapIntfIntfV(*vp, fastpathCheckNilFalse, true, f.d) @@ -13552,7 +10497,7 @@ func (f fastpathT) DecMapIntfIntfX(vp *map[interface{}]interface{}, checkNil boo func (_ fastpathT) DecMapIntfIntfV(v map[interface{}]interface{}, checkNil bool, canChange bool, d *Decoder) (_ map[interface{}]interface{}, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -13562,11 +10507,8 @@ func (_ fastpathT) DecMapIntfIntfV(v map[interface{}]interface{}, checkNil bool, containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[interface{}]interface{}, containerLen) - } else { - v = make(map[interface{}]interface{}) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 32) + v = make(map[interface{}]interface{}, xlen) changed = true } if containerLen > 0 { @@ -13574,7 +10516,7 @@ func (_ fastpathT) DecMapIntfIntfV(v map[interface{}]interface{}, checkNil bool, var mk interface{} d.decode(&mk) if bv, bok := mk.([]byte); bok { - mk = string(bv) // maps cannot have []byte as key. switch to string. + mk = string(bv) } mv := v[mk] d.decode(&mv) @@ -13585,15 +10527,11 @@ func (_ fastpathT) DecMapIntfIntfV(v map[interface{}]interface{}, checkNil bool, } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } var mk interface{} d.decode(&mk) if bv, bok := mk.([]byte); bok { - mk = string(bv) // maps cannot have []byte as key. switch to string. + mk = string(bv) } - dd.ReadMapKVSeparator() mv := v[mk] d.decode(&mv) @@ -13601,12 +10539,12 @@ func (_ fastpathT) DecMapIntfIntfV(v map[interface{}]interface{}, checkNil bool, v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapIntfStringR(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapIntfStringR(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[interface{}]string) v, changed := fastpathTV.DecMapIntfStringV(*vp, fastpathCheckNilFalse, true, f.d) @@ -13627,7 +10565,7 @@ func (f fastpathT) DecMapIntfStringX(vp *map[interface{}]string, checkNil bool, func (_ fastpathT) DecMapIntfStringV(v map[interface{}]string, checkNil bool, canChange bool, d *Decoder) (_ map[interface{}]string, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -13637,11 +10575,8 @@ func (_ fastpathT) DecMapIntfStringV(v map[interface{}]string, checkNil bool, ca containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[interface{}]string, containerLen) - } else { - v = make(map[interface{}]string) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 32) + v = make(map[interface{}]string, xlen) changed = true } if containerLen > 0 { @@ -13649,7 +10584,7 @@ func (_ fastpathT) DecMapIntfStringV(v map[interface{}]string, checkNil bool, ca var mk interface{} d.decode(&mk) if bv, bok := mk.([]byte); bok { - mk = string(bv) // maps cannot have []byte as key. switch to string. + mk = string(bv) } mv := v[mk] mv = dd.DecodeString() @@ -13659,27 +10594,23 @@ func (_ fastpathT) DecMapIntfStringV(v map[interface{}]string, checkNil bool, ca } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } var mk interface{} d.decode(&mk) if bv, bok := mk.([]byte); bok { - mk = string(bv) // maps cannot have []byte as key. switch to string. + mk = string(bv) } - dd.ReadMapKVSeparator() mv := v[mk] mv = dd.DecodeString() if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapIntfUintR(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapIntfUintR(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[interface{}]uint) v, changed := fastpathTV.DecMapIntfUintV(*vp, fastpathCheckNilFalse, true, f.d) @@ -13700,7 +10631,7 @@ func (f fastpathT) DecMapIntfUintX(vp *map[interface{}]uint, checkNil bool, d *D func (_ fastpathT) DecMapIntfUintV(v map[interface{}]uint, checkNil bool, canChange bool, d *Decoder) (_ map[interface{}]uint, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -13710,11 +10641,8 @@ func (_ fastpathT) DecMapIntfUintV(v map[interface{}]uint, checkNil bool, canCha containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[interface{}]uint, containerLen) - } else { - v = make(map[interface{}]uint) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 24) + v = make(map[interface{}]uint, xlen) changed = true } if containerLen > 0 { @@ -13722,7 +10650,7 @@ func (_ fastpathT) DecMapIntfUintV(v map[interface{}]uint, checkNil bool, canCha var mk interface{} d.decode(&mk) if bv, bok := mk.([]byte); bok { - mk = string(bv) // maps cannot have []byte as key. switch to string. + mk = string(bv) } mv := v[mk] mv = uint(dd.DecodeUint(uintBitsize)) @@ -13732,27 +10660,23 @@ func (_ fastpathT) DecMapIntfUintV(v map[interface{}]uint, checkNil bool, canCha } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } var mk interface{} d.decode(&mk) if bv, bok := mk.([]byte); bok { - mk = string(bv) // maps cannot have []byte as key. switch to string. + mk = string(bv) } - dd.ReadMapKVSeparator() mv := v[mk] mv = uint(dd.DecodeUint(uintBitsize)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapIntfUint8R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapIntfUint8R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[interface{}]uint8) v, changed := fastpathTV.DecMapIntfUint8V(*vp, fastpathCheckNilFalse, true, f.d) @@ -13773,7 +10697,7 @@ func (f fastpathT) DecMapIntfUint8X(vp *map[interface{}]uint8, checkNil bool, d func (_ fastpathT) DecMapIntfUint8V(v map[interface{}]uint8, checkNil bool, canChange bool, d *Decoder) (_ map[interface{}]uint8, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -13783,11 +10707,8 @@ func (_ fastpathT) DecMapIntfUint8V(v map[interface{}]uint8, checkNil bool, canC containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[interface{}]uint8, containerLen) - } else { - v = make(map[interface{}]uint8) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 17) + v = make(map[interface{}]uint8, xlen) changed = true } if containerLen > 0 { @@ -13795,7 +10716,7 @@ func (_ fastpathT) DecMapIntfUint8V(v map[interface{}]uint8, checkNil bool, canC var mk interface{} d.decode(&mk) if bv, bok := mk.([]byte); bok { - mk = string(bv) // maps cannot have []byte as key. switch to string. + mk = string(bv) } mv := v[mk] mv = uint8(dd.DecodeUint(8)) @@ -13805,27 +10726,23 @@ func (_ fastpathT) DecMapIntfUint8V(v map[interface{}]uint8, checkNil bool, canC } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } var mk interface{} d.decode(&mk) if bv, bok := mk.([]byte); bok { - mk = string(bv) // maps cannot have []byte as key. switch to string. + mk = string(bv) } - dd.ReadMapKVSeparator() mv := v[mk] mv = uint8(dd.DecodeUint(8)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapIntfUint16R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapIntfUint16R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[interface{}]uint16) v, changed := fastpathTV.DecMapIntfUint16V(*vp, fastpathCheckNilFalse, true, f.d) @@ -13846,7 +10763,7 @@ func (f fastpathT) DecMapIntfUint16X(vp *map[interface{}]uint16, checkNil bool, func (_ fastpathT) DecMapIntfUint16V(v map[interface{}]uint16, checkNil bool, canChange bool, d *Decoder) (_ map[interface{}]uint16, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -13856,11 +10773,8 @@ func (_ fastpathT) DecMapIntfUint16V(v map[interface{}]uint16, checkNil bool, ca containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[interface{}]uint16, containerLen) - } else { - v = make(map[interface{}]uint16) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 18) + v = make(map[interface{}]uint16, xlen) changed = true } if containerLen > 0 { @@ -13868,7 +10782,7 @@ func (_ fastpathT) DecMapIntfUint16V(v map[interface{}]uint16, checkNil bool, ca var mk interface{} d.decode(&mk) if bv, bok := mk.([]byte); bok { - mk = string(bv) // maps cannot have []byte as key. switch to string. + mk = string(bv) } mv := v[mk] mv = uint16(dd.DecodeUint(16)) @@ -13878,27 +10792,23 @@ func (_ fastpathT) DecMapIntfUint16V(v map[interface{}]uint16, checkNil bool, ca } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } var mk interface{} d.decode(&mk) if bv, bok := mk.([]byte); bok { - mk = string(bv) // maps cannot have []byte as key. switch to string. + mk = string(bv) } - dd.ReadMapKVSeparator() mv := v[mk] mv = uint16(dd.DecodeUint(16)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapIntfUint32R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapIntfUint32R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[interface{}]uint32) v, changed := fastpathTV.DecMapIntfUint32V(*vp, fastpathCheckNilFalse, true, f.d) @@ -13919,7 +10829,7 @@ func (f fastpathT) DecMapIntfUint32X(vp *map[interface{}]uint32, checkNil bool, func (_ fastpathT) DecMapIntfUint32V(v map[interface{}]uint32, checkNil bool, canChange bool, d *Decoder) (_ map[interface{}]uint32, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -13929,11 +10839,8 @@ func (_ fastpathT) DecMapIntfUint32V(v map[interface{}]uint32, checkNil bool, ca containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[interface{}]uint32, containerLen) - } else { - v = make(map[interface{}]uint32) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 20) + v = make(map[interface{}]uint32, xlen) changed = true } if containerLen > 0 { @@ -13941,7 +10848,7 @@ func (_ fastpathT) DecMapIntfUint32V(v map[interface{}]uint32, checkNil bool, ca var mk interface{} d.decode(&mk) if bv, bok := mk.([]byte); bok { - mk = string(bv) // maps cannot have []byte as key. switch to string. + mk = string(bv) } mv := v[mk] mv = uint32(dd.DecodeUint(32)) @@ -13951,27 +10858,23 @@ func (_ fastpathT) DecMapIntfUint32V(v map[interface{}]uint32, checkNil bool, ca } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } var mk interface{} d.decode(&mk) if bv, bok := mk.([]byte); bok { - mk = string(bv) // maps cannot have []byte as key. switch to string. + mk = string(bv) } - dd.ReadMapKVSeparator() mv := v[mk] mv = uint32(dd.DecodeUint(32)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapIntfUint64R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapIntfUint64R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[interface{}]uint64) v, changed := fastpathTV.DecMapIntfUint64V(*vp, fastpathCheckNilFalse, true, f.d) @@ -13992,7 +10895,7 @@ func (f fastpathT) DecMapIntfUint64X(vp *map[interface{}]uint64, checkNil bool, func (_ fastpathT) DecMapIntfUint64V(v map[interface{}]uint64, checkNil bool, canChange bool, d *Decoder) (_ map[interface{}]uint64, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -14002,11 +10905,8 @@ func (_ fastpathT) DecMapIntfUint64V(v map[interface{}]uint64, checkNil bool, ca containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[interface{}]uint64, containerLen) - } else { - v = make(map[interface{}]uint64) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 24) + v = make(map[interface{}]uint64, xlen) changed = true } if containerLen > 0 { @@ -14014,7 +10914,7 @@ func (_ fastpathT) DecMapIntfUint64V(v map[interface{}]uint64, checkNil bool, ca var mk interface{} d.decode(&mk) if bv, bok := mk.([]byte); bok { - mk = string(bv) // maps cannot have []byte as key. switch to string. + mk = string(bv) } mv := v[mk] mv = dd.DecodeUint(64) @@ -14024,27 +10924,23 @@ func (_ fastpathT) DecMapIntfUint64V(v map[interface{}]uint64, checkNil bool, ca } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } var mk interface{} d.decode(&mk) if bv, bok := mk.([]byte); bok { - mk = string(bv) // maps cannot have []byte as key. switch to string. + mk = string(bv) } - dd.ReadMapKVSeparator() mv := v[mk] mv = dd.DecodeUint(64) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapIntfIntR(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapIntfIntR(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[interface{}]int) v, changed := fastpathTV.DecMapIntfIntV(*vp, fastpathCheckNilFalse, true, f.d) @@ -14065,7 +10961,7 @@ func (f fastpathT) DecMapIntfIntX(vp *map[interface{}]int, checkNil bool, d *Dec func (_ fastpathT) DecMapIntfIntV(v map[interface{}]int, checkNil bool, canChange bool, d *Decoder) (_ map[interface{}]int, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -14075,11 +10971,8 @@ func (_ fastpathT) DecMapIntfIntV(v map[interface{}]int, checkNil bool, canChang containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[interface{}]int, containerLen) - } else { - v = make(map[interface{}]int) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 24) + v = make(map[interface{}]int, xlen) changed = true } if containerLen > 0 { @@ -14087,7 +10980,7 @@ func (_ fastpathT) DecMapIntfIntV(v map[interface{}]int, checkNil bool, canChang var mk interface{} d.decode(&mk) if bv, bok := mk.([]byte); bok { - mk = string(bv) // maps cannot have []byte as key. switch to string. + mk = string(bv) } mv := v[mk] mv = int(dd.DecodeInt(intBitsize)) @@ -14097,27 +10990,23 @@ func (_ fastpathT) DecMapIntfIntV(v map[interface{}]int, checkNil bool, canChang } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } var mk interface{} d.decode(&mk) if bv, bok := mk.([]byte); bok { - mk = string(bv) // maps cannot have []byte as key. switch to string. + mk = string(bv) } - dd.ReadMapKVSeparator() mv := v[mk] mv = int(dd.DecodeInt(intBitsize)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapIntfInt8R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapIntfInt8R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[interface{}]int8) v, changed := fastpathTV.DecMapIntfInt8V(*vp, fastpathCheckNilFalse, true, f.d) @@ -14138,7 +11027,7 @@ func (f fastpathT) DecMapIntfInt8X(vp *map[interface{}]int8, checkNil bool, d *D func (_ fastpathT) DecMapIntfInt8V(v map[interface{}]int8, checkNil bool, canChange bool, d *Decoder) (_ map[interface{}]int8, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -14148,11 +11037,8 @@ func (_ fastpathT) DecMapIntfInt8V(v map[interface{}]int8, checkNil bool, canCha containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[interface{}]int8, containerLen) - } else { - v = make(map[interface{}]int8) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 17) + v = make(map[interface{}]int8, xlen) changed = true } if containerLen > 0 { @@ -14160,7 +11046,7 @@ func (_ fastpathT) DecMapIntfInt8V(v map[interface{}]int8, checkNil bool, canCha var mk interface{} d.decode(&mk) if bv, bok := mk.([]byte); bok { - mk = string(bv) // maps cannot have []byte as key. switch to string. + mk = string(bv) } mv := v[mk] mv = int8(dd.DecodeInt(8)) @@ -14170,27 +11056,23 @@ func (_ fastpathT) DecMapIntfInt8V(v map[interface{}]int8, checkNil bool, canCha } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } var mk interface{} d.decode(&mk) if bv, bok := mk.([]byte); bok { - mk = string(bv) // maps cannot have []byte as key. switch to string. + mk = string(bv) } - dd.ReadMapKVSeparator() mv := v[mk] mv = int8(dd.DecodeInt(8)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapIntfInt16R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapIntfInt16R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[interface{}]int16) v, changed := fastpathTV.DecMapIntfInt16V(*vp, fastpathCheckNilFalse, true, f.d) @@ -14211,7 +11093,7 @@ func (f fastpathT) DecMapIntfInt16X(vp *map[interface{}]int16, checkNil bool, d func (_ fastpathT) DecMapIntfInt16V(v map[interface{}]int16, checkNil bool, canChange bool, d *Decoder) (_ map[interface{}]int16, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -14221,11 +11103,8 @@ func (_ fastpathT) DecMapIntfInt16V(v map[interface{}]int16, checkNil bool, canC containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[interface{}]int16, containerLen) - } else { - v = make(map[interface{}]int16) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 18) + v = make(map[interface{}]int16, xlen) changed = true } if containerLen > 0 { @@ -14233,7 +11112,7 @@ func (_ fastpathT) DecMapIntfInt16V(v map[interface{}]int16, checkNil bool, canC var mk interface{} d.decode(&mk) if bv, bok := mk.([]byte); bok { - mk = string(bv) // maps cannot have []byte as key. switch to string. + mk = string(bv) } mv := v[mk] mv = int16(dd.DecodeInt(16)) @@ -14243,27 +11122,23 @@ func (_ fastpathT) DecMapIntfInt16V(v map[interface{}]int16, checkNil bool, canC } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } var mk interface{} d.decode(&mk) if bv, bok := mk.([]byte); bok { - mk = string(bv) // maps cannot have []byte as key. switch to string. + mk = string(bv) } - dd.ReadMapKVSeparator() mv := v[mk] mv = int16(dd.DecodeInt(16)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapIntfInt32R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapIntfInt32R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[interface{}]int32) v, changed := fastpathTV.DecMapIntfInt32V(*vp, fastpathCheckNilFalse, true, f.d) @@ -14284,7 +11159,7 @@ func (f fastpathT) DecMapIntfInt32X(vp *map[interface{}]int32, checkNil bool, d func (_ fastpathT) DecMapIntfInt32V(v map[interface{}]int32, checkNil bool, canChange bool, d *Decoder) (_ map[interface{}]int32, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -14294,11 +11169,8 @@ func (_ fastpathT) DecMapIntfInt32V(v map[interface{}]int32, checkNil bool, canC containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[interface{}]int32, containerLen) - } else { - v = make(map[interface{}]int32) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 20) + v = make(map[interface{}]int32, xlen) changed = true } if containerLen > 0 { @@ -14306,7 +11178,7 @@ func (_ fastpathT) DecMapIntfInt32V(v map[interface{}]int32, checkNil bool, canC var mk interface{} d.decode(&mk) if bv, bok := mk.([]byte); bok { - mk = string(bv) // maps cannot have []byte as key. switch to string. + mk = string(bv) } mv := v[mk] mv = int32(dd.DecodeInt(32)) @@ -14316,27 +11188,23 @@ func (_ fastpathT) DecMapIntfInt32V(v map[interface{}]int32, checkNil bool, canC } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } var mk interface{} d.decode(&mk) if bv, bok := mk.([]byte); bok { - mk = string(bv) // maps cannot have []byte as key. switch to string. + mk = string(bv) } - dd.ReadMapKVSeparator() mv := v[mk] mv = int32(dd.DecodeInt(32)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapIntfInt64R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapIntfInt64R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[interface{}]int64) v, changed := fastpathTV.DecMapIntfInt64V(*vp, fastpathCheckNilFalse, true, f.d) @@ -14357,7 +11225,7 @@ func (f fastpathT) DecMapIntfInt64X(vp *map[interface{}]int64, checkNil bool, d func (_ fastpathT) DecMapIntfInt64V(v map[interface{}]int64, checkNil bool, canChange bool, d *Decoder) (_ map[interface{}]int64, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -14367,11 +11235,8 @@ func (_ fastpathT) DecMapIntfInt64V(v map[interface{}]int64, checkNil bool, canC containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[interface{}]int64, containerLen) - } else { - v = make(map[interface{}]int64) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 24) + v = make(map[interface{}]int64, xlen) changed = true } if containerLen > 0 { @@ -14379,7 +11244,7 @@ func (_ fastpathT) DecMapIntfInt64V(v map[interface{}]int64, checkNil bool, canC var mk interface{} d.decode(&mk) if bv, bok := mk.([]byte); bok { - mk = string(bv) // maps cannot have []byte as key. switch to string. + mk = string(bv) } mv := v[mk] mv = dd.DecodeInt(64) @@ -14389,27 +11254,23 @@ func (_ fastpathT) DecMapIntfInt64V(v map[interface{}]int64, checkNil bool, canC } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } var mk interface{} d.decode(&mk) if bv, bok := mk.([]byte); bok { - mk = string(bv) // maps cannot have []byte as key. switch to string. + mk = string(bv) } - dd.ReadMapKVSeparator() mv := v[mk] mv = dd.DecodeInt(64) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapIntfFloat32R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapIntfFloat32R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[interface{}]float32) v, changed := fastpathTV.DecMapIntfFloat32V(*vp, fastpathCheckNilFalse, true, f.d) @@ -14430,7 +11291,7 @@ func (f fastpathT) DecMapIntfFloat32X(vp *map[interface{}]float32, checkNil bool func (_ fastpathT) DecMapIntfFloat32V(v map[interface{}]float32, checkNil bool, canChange bool, d *Decoder) (_ map[interface{}]float32, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -14440,11 +11301,8 @@ func (_ fastpathT) DecMapIntfFloat32V(v map[interface{}]float32, checkNil bool, containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[interface{}]float32, containerLen) - } else { - v = make(map[interface{}]float32) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 20) + v = make(map[interface{}]float32, xlen) changed = true } if containerLen > 0 { @@ -14452,7 +11310,7 @@ func (_ fastpathT) DecMapIntfFloat32V(v map[interface{}]float32, checkNil bool, var mk interface{} d.decode(&mk) if bv, bok := mk.([]byte); bok { - mk = string(bv) // maps cannot have []byte as key. switch to string. + mk = string(bv) } mv := v[mk] mv = float32(dd.DecodeFloat(true)) @@ -14462,27 +11320,23 @@ func (_ fastpathT) DecMapIntfFloat32V(v map[interface{}]float32, checkNil bool, } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } var mk interface{} d.decode(&mk) if bv, bok := mk.([]byte); bok { - mk = string(bv) // maps cannot have []byte as key. switch to string. + mk = string(bv) } - dd.ReadMapKVSeparator() mv := v[mk] mv = float32(dd.DecodeFloat(true)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapIntfFloat64R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapIntfFloat64R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[interface{}]float64) v, changed := fastpathTV.DecMapIntfFloat64V(*vp, fastpathCheckNilFalse, true, f.d) @@ -14503,7 +11357,7 @@ func (f fastpathT) DecMapIntfFloat64X(vp *map[interface{}]float64, checkNil bool func (_ fastpathT) DecMapIntfFloat64V(v map[interface{}]float64, checkNil bool, canChange bool, d *Decoder) (_ map[interface{}]float64, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -14513,11 +11367,8 @@ func (_ fastpathT) DecMapIntfFloat64V(v map[interface{}]float64, checkNil bool, containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[interface{}]float64, containerLen) - } else { - v = make(map[interface{}]float64) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 24) + v = make(map[interface{}]float64, xlen) changed = true } if containerLen > 0 { @@ -14525,7 +11376,7 @@ func (_ fastpathT) DecMapIntfFloat64V(v map[interface{}]float64, checkNil bool, var mk interface{} d.decode(&mk) if bv, bok := mk.([]byte); bok { - mk = string(bv) // maps cannot have []byte as key. switch to string. + mk = string(bv) } mv := v[mk] mv = dd.DecodeFloat(false) @@ -14535,27 +11386,23 @@ func (_ fastpathT) DecMapIntfFloat64V(v map[interface{}]float64, checkNil bool, } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } var mk interface{} d.decode(&mk) if bv, bok := mk.([]byte); bok { - mk = string(bv) // maps cannot have []byte as key. switch to string. + mk = string(bv) } - dd.ReadMapKVSeparator() mv := v[mk] mv = dd.DecodeFloat(false) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapIntfBoolR(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapIntfBoolR(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[interface{}]bool) v, changed := fastpathTV.DecMapIntfBoolV(*vp, fastpathCheckNilFalse, true, f.d) @@ -14576,7 +11423,7 @@ func (f fastpathT) DecMapIntfBoolX(vp *map[interface{}]bool, checkNil bool, d *D func (_ fastpathT) DecMapIntfBoolV(v map[interface{}]bool, checkNil bool, canChange bool, d *Decoder) (_ map[interface{}]bool, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -14586,11 +11433,8 @@ func (_ fastpathT) DecMapIntfBoolV(v map[interface{}]bool, checkNil bool, canCha containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[interface{}]bool, containerLen) - } else { - v = make(map[interface{}]bool) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 17) + v = make(map[interface{}]bool, xlen) changed = true } if containerLen > 0 { @@ -14598,7 +11442,7 @@ func (_ fastpathT) DecMapIntfBoolV(v map[interface{}]bool, checkNil bool, canCha var mk interface{} d.decode(&mk) if bv, bok := mk.([]byte); bok { - mk = string(bv) // maps cannot have []byte as key. switch to string. + mk = string(bv) } mv := v[mk] mv = dd.DecodeBool() @@ -14608,27 +11452,23 @@ func (_ fastpathT) DecMapIntfBoolV(v map[interface{}]bool, checkNil bool, canCha } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } var mk interface{} d.decode(&mk) if bv, bok := mk.([]byte); bok { - mk = string(bv) // maps cannot have []byte as key. switch to string. + mk = string(bv) } - dd.ReadMapKVSeparator() mv := v[mk] mv = dd.DecodeBool() if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapStringIntfR(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapStringIntfR(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[string]interface{}) v, changed := fastpathTV.DecMapStringIntfV(*vp, fastpathCheckNilFalse, true, f.d) @@ -14649,7 +11489,7 @@ func (f fastpathT) DecMapStringIntfX(vp *map[string]interface{}, checkNil bool, func (_ fastpathT) DecMapStringIntfV(v map[string]interface{}, checkNil bool, canChange bool, d *Decoder) (_ map[string]interface{}, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -14659,11 +11499,8 @@ func (_ fastpathT) DecMapStringIntfV(v map[string]interface{}, checkNil bool, ca containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[string]interface{}, containerLen) - } else { - v = make(map[string]interface{}) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 32) + v = make(map[string]interface{}, xlen) changed = true } if containerLen > 0 { @@ -14678,11 +11515,7 @@ func (_ fastpathT) DecMapStringIntfV(v map[string]interface{}, checkNil bool, ca } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := dd.DecodeString() - dd.ReadMapKVSeparator() mv := v[mk] d.decode(&mv) @@ -14690,12 +11523,12 @@ func (_ fastpathT) DecMapStringIntfV(v map[string]interface{}, checkNil bool, ca v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapStringStringR(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapStringStringR(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[string]string) v, changed := fastpathTV.DecMapStringStringV(*vp, fastpathCheckNilFalse, true, f.d) @@ -14716,7 +11549,7 @@ func (f fastpathT) DecMapStringStringX(vp *map[string]string, checkNil bool, d * func (_ fastpathT) DecMapStringStringV(v map[string]string, checkNil bool, canChange bool, d *Decoder) (_ map[string]string, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -14726,11 +11559,8 @@ func (_ fastpathT) DecMapStringStringV(v map[string]string, checkNil bool, canCh containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[string]string, containerLen) - } else { - v = make(map[string]string) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 32) + v = make(map[string]string, xlen) changed = true } if containerLen > 0 { @@ -14744,23 +11574,19 @@ func (_ fastpathT) DecMapStringStringV(v map[string]string, checkNil bool, canCh } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := dd.DecodeString() - dd.ReadMapKVSeparator() mv := v[mk] mv = dd.DecodeString() if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapStringUintR(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapStringUintR(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[string]uint) v, changed := fastpathTV.DecMapStringUintV(*vp, fastpathCheckNilFalse, true, f.d) @@ -14781,7 +11607,7 @@ func (f fastpathT) DecMapStringUintX(vp *map[string]uint, checkNil bool, d *Deco func (_ fastpathT) DecMapStringUintV(v map[string]uint, checkNil bool, canChange bool, d *Decoder) (_ map[string]uint, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -14791,11 +11617,8 @@ func (_ fastpathT) DecMapStringUintV(v map[string]uint, checkNil bool, canChange containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[string]uint, containerLen) - } else { - v = make(map[string]uint) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 24) + v = make(map[string]uint, xlen) changed = true } if containerLen > 0 { @@ -14809,23 +11632,19 @@ func (_ fastpathT) DecMapStringUintV(v map[string]uint, checkNil bool, canChange } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := dd.DecodeString() - dd.ReadMapKVSeparator() mv := v[mk] mv = uint(dd.DecodeUint(uintBitsize)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapStringUint8R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapStringUint8R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[string]uint8) v, changed := fastpathTV.DecMapStringUint8V(*vp, fastpathCheckNilFalse, true, f.d) @@ -14846,7 +11665,7 @@ func (f fastpathT) DecMapStringUint8X(vp *map[string]uint8, checkNil bool, d *De func (_ fastpathT) DecMapStringUint8V(v map[string]uint8, checkNil bool, canChange bool, d *Decoder) (_ map[string]uint8, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -14856,11 +11675,8 @@ func (_ fastpathT) DecMapStringUint8V(v map[string]uint8, checkNil bool, canChan containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[string]uint8, containerLen) - } else { - v = make(map[string]uint8) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 17) + v = make(map[string]uint8, xlen) changed = true } if containerLen > 0 { @@ -14874,23 +11690,19 @@ func (_ fastpathT) DecMapStringUint8V(v map[string]uint8, checkNil bool, canChan } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := dd.DecodeString() - dd.ReadMapKVSeparator() mv := v[mk] mv = uint8(dd.DecodeUint(8)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapStringUint16R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapStringUint16R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[string]uint16) v, changed := fastpathTV.DecMapStringUint16V(*vp, fastpathCheckNilFalse, true, f.d) @@ -14911,7 +11723,7 @@ func (f fastpathT) DecMapStringUint16X(vp *map[string]uint16, checkNil bool, d * func (_ fastpathT) DecMapStringUint16V(v map[string]uint16, checkNil bool, canChange bool, d *Decoder) (_ map[string]uint16, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -14921,11 +11733,8 @@ func (_ fastpathT) DecMapStringUint16V(v map[string]uint16, checkNil bool, canCh containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[string]uint16, containerLen) - } else { - v = make(map[string]uint16) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 18) + v = make(map[string]uint16, xlen) changed = true } if containerLen > 0 { @@ -14939,23 +11748,19 @@ func (_ fastpathT) DecMapStringUint16V(v map[string]uint16, checkNil bool, canCh } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := dd.DecodeString() - dd.ReadMapKVSeparator() mv := v[mk] mv = uint16(dd.DecodeUint(16)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapStringUint32R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapStringUint32R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[string]uint32) v, changed := fastpathTV.DecMapStringUint32V(*vp, fastpathCheckNilFalse, true, f.d) @@ -14976,7 +11781,7 @@ func (f fastpathT) DecMapStringUint32X(vp *map[string]uint32, checkNil bool, d * func (_ fastpathT) DecMapStringUint32V(v map[string]uint32, checkNil bool, canChange bool, d *Decoder) (_ map[string]uint32, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -14986,11 +11791,8 @@ func (_ fastpathT) DecMapStringUint32V(v map[string]uint32, checkNil bool, canCh containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[string]uint32, containerLen) - } else { - v = make(map[string]uint32) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 20) + v = make(map[string]uint32, xlen) changed = true } if containerLen > 0 { @@ -15004,23 +11806,19 @@ func (_ fastpathT) DecMapStringUint32V(v map[string]uint32, checkNil bool, canCh } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := dd.DecodeString() - dd.ReadMapKVSeparator() mv := v[mk] mv = uint32(dd.DecodeUint(32)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapStringUint64R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapStringUint64R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[string]uint64) v, changed := fastpathTV.DecMapStringUint64V(*vp, fastpathCheckNilFalse, true, f.d) @@ -15041,7 +11839,7 @@ func (f fastpathT) DecMapStringUint64X(vp *map[string]uint64, checkNil bool, d * func (_ fastpathT) DecMapStringUint64V(v map[string]uint64, checkNil bool, canChange bool, d *Decoder) (_ map[string]uint64, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -15051,11 +11849,8 @@ func (_ fastpathT) DecMapStringUint64V(v map[string]uint64, checkNil bool, canCh containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[string]uint64, containerLen) - } else { - v = make(map[string]uint64) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 24) + v = make(map[string]uint64, xlen) changed = true } if containerLen > 0 { @@ -15069,23 +11864,19 @@ func (_ fastpathT) DecMapStringUint64V(v map[string]uint64, checkNil bool, canCh } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := dd.DecodeString() - dd.ReadMapKVSeparator() mv := v[mk] mv = dd.DecodeUint(64) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapStringIntR(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapStringIntR(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[string]int) v, changed := fastpathTV.DecMapStringIntV(*vp, fastpathCheckNilFalse, true, f.d) @@ -15106,7 +11897,7 @@ func (f fastpathT) DecMapStringIntX(vp *map[string]int, checkNil bool, d *Decode func (_ fastpathT) DecMapStringIntV(v map[string]int, checkNil bool, canChange bool, d *Decoder) (_ map[string]int, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -15116,11 +11907,8 @@ func (_ fastpathT) DecMapStringIntV(v map[string]int, checkNil bool, canChange b containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[string]int, containerLen) - } else { - v = make(map[string]int) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 24) + v = make(map[string]int, xlen) changed = true } if containerLen > 0 { @@ -15134,23 +11922,19 @@ func (_ fastpathT) DecMapStringIntV(v map[string]int, checkNil bool, canChange b } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := dd.DecodeString() - dd.ReadMapKVSeparator() mv := v[mk] mv = int(dd.DecodeInt(intBitsize)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapStringInt8R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapStringInt8R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[string]int8) v, changed := fastpathTV.DecMapStringInt8V(*vp, fastpathCheckNilFalse, true, f.d) @@ -15171,7 +11955,7 @@ func (f fastpathT) DecMapStringInt8X(vp *map[string]int8, checkNil bool, d *Deco func (_ fastpathT) DecMapStringInt8V(v map[string]int8, checkNil bool, canChange bool, d *Decoder) (_ map[string]int8, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -15181,11 +11965,8 @@ func (_ fastpathT) DecMapStringInt8V(v map[string]int8, checkNil bool, canChange containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[string]int8, containerLen) - } else { - v = make(map[string]int8) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 17) + v = make(map[string]int8, xlen) changed = true } if containerLen > 0 { @@ -15199,23 +11980,19 @@ func (_ fastpathT) DecMapStringInt8V(v map[string]int8, checkNil bool, canChange } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := dd.DecodeString() - dd.ReadMapKVSeparator() mv := v[mk] mv = int8(dd.DecodeInt(8)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapStringInt16R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapStringInt16R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[string]int16) v, changed := fastpathTV.DecMapStringInt16V(*vp, fastpathCheckNilFalse, true, f.d) @@ -15236,7 +12013,7 @@ func (f fastpathT) DecMapStringInt16X(vp *map[string]int16, checkNil bool, d *De func (_ fastpathT) DecMapStringInt16V(v map[string]int16, checkNil bool, canChange bool, d *Decoder) (_ map[string]int16, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -15246,11 +12023,8 @@ func (_ fastpathT) DecMapStringInt16V(v map[string]int16, checkNil bool, canChan containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[string]int16, containerLen) - } else { - v = make(map[string]int16) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 18) + v = make(map[string]int16, xlen) changed = true } if containerLen > 0 { @@ -15264,23 +12038,19 @@ func (_ fastpathT) DecMapStringInt16V(v map[string]int16, checkNil bool, canChan } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := dd.DecodeString() - dd.ReadMapKVSeparator() mv := v[mk] mv = int16(dd.DecodeInt(16)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapStringInt32R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapStringInt32R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[string]int32) v, changed := fastpathTV.DecMapStringInt32V(*vp, fastpathCheckNilFalse, true, f.d) @@ -15301,7 +12071,7 @@ func (f fastpathT) DecMapStringInt32X(vp *map[string]int32, checkNil bool, d *De func (_ fastpathT) DecMapStringInt32V(v map[string]int32, checkNil bool, canChange bool, d *Decoder) (_ map[string]int32, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -15311,11 +12081,8 @@ func (_ fastpathT) DecMapStringInt32V(v map[string]int32, checkNil bool, canChan containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[string]int32, containerLen) - } else { - v = make(map[string]int32) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 20) + v = make(map[string]int32, xlen) changed = true } if containerLen > 0 { @@ -15329,23 +12096,19 @@ func (_ fastpathT) DecMapStringInt32V(v map[string]int32, checkNil bool, canChan } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := dd.DecodeString() - dd.ReadMapKVSeparator() mv := v[mk] mv = int32(dd.DecodeInt(32)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapStringInt64R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapStringInt64R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[string]int64) v, changed := fastpathTV.DecMapStringInt64V(*vp, fastpathCheckNilFalse, true, f.d) @@ -15366,7 +12129,7 @@ func (f fastpathT) DecMapStringInt64X(vp *map[string]int64, checkNil bool, d *De func (_ fastpathT) DecMapStringInt64V(v map[string]int64, checkNil bool, canChange bool, d *Decoder) (_ map[string]int64, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -15376,11 +12139,8 @@ func (_ fastpathT) DecMapStringInt64V(v map[string]int64, checkNil bool, canChan containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[string]int64, containerLen) - } else { - v = make(map[string]int64) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 24) + v = make(map[string]int64, xlen) changed = true } if containerLen > 0 { @@ -15394,23 +12154,19 @@ func (_ fastpathT) DecMapStringInt64V(v map[string]int64, checkNil bool, canChan } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := dd.DecodeString() - dd.ReadMapKVSeparator() mv := v[mk] mv = dd.DecodeInt(64) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapStringFloat32R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapStringFloat32R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[string]float32) v, changed := fastpathTV.DecMapStringFloat32V(*vp, fastpathCheckNilFalse, true, f.d) @@ -15431,7 +12187,7 @@ func (f fastpathT) DecMapStringFloat32X(vp *map[string]float32, checkNil bool, d func (_ fastpathT) DecMapStringFloat32V(v map[string]float32, checkNil bool, canChange bool, d *Decoder) (_ map[string]float32, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -15441,11 +12197,8 @@ func (_ fastpathT) DecMapStringFloat32V(v map[string]float32, checkNil bool, can containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[string]float32, containerLen) - } else { - v = make(map[string]float32) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 20) + v = make(map[string]float32, xlen) changed = true } if containerLen > 0 { @@ -15459,23 +12212,19 @@ func (_ fastpathT) DecMapStringFloat32V(v map[string]float32, checkNil bool, can } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := dd.DecodeString() - dd.ReadMapKVSeparator() mv := v[mk] mv = float32(dd.DecodeFloat(true)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapStringFloat64R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapStringFloat64R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[string]float64) v, changed := fastpathTV.DecMapStringFloat64V(*vp, fastpathCheckNilFalse, true, f.d) @@ -15496,7 +12245,7 @@ func (f fastpathT) DecMapStringFloat64X(vp *map[string]float64, checkNil bool, d func (_ fastpathT) DecMapStringFloat64V(v map[string]float64, checkNil bool, canChange bool, d *Decoder) (_ map[string]float64, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -15506,11 +12255,8 @@ func (_ fastpathT) DecMapStringFloat64V(v map[string]float64, checkNil bool, can containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[string]float64, containerLen) - } else { - v = make(map[string]float64) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 24) + v = make(map[string]float64, xlen) changed = true } if containerLen > 0 { @@ -15524,23 +12270,19 @@ func (_ fastpathT) DecMapStringFloat64V(v map[string]float64, checkNil bool, can } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := dd.DecodeString() - dd.ReadMapKVSeparator() mv := v[mk] mv = dd.DecodeFloat(false) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapStringBoolR(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapStringBoolR(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[string]bool) v, changed := fastpathTV.DecMapStringBoolV(*vp, fastpathCheckNilFalse, true, f.d) @@ -15561,7 +12303,7 @@ func (f fastpathT) DecMapStringBoolX(vp *map[string]bool, checkNil bool, d *Deco func (_ fastpathT) DecMapStringBoolV(v map[string]bool, checkNil bool, canChange bool, d *Decoder) (_ map[string]bool, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -15571,11 +12313,8 @@ func (_ fastpathT) DecMapStringBoolV(v map[string]bool, checkNil bool, canChange containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[string]bool, containerLen) - } else { - v = make(map[string]bool) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 17) + v = make(map[string]bool, xlen) changed = true } if containerLen > 0 { @@ -15589,23 +12328,19 @@ func (_ fastpathT) DecMapStringBoolV(v map[string]bool, checkNil bool, canChange } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := dd.DecodeString() - dd.ReadMapKVSeparator() mv := v[mk] mv = dd.DecodeBool() if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapFloat32IntfR(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapFloat32IntfR(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[float32]interface{}) v, changed := fastpathTV.DecMapFloat32IntfV(*vp, fastpathCheckNilFalse, true, f.d) @@ -15626,7 +12361,7 @@ func (f fastpathT) DecMapFloat32IntfX(vp *map[float32]interface{}, checkNil bool func (_ fastpathT) DecMapFloat32IntfV(v map[float32]interface{}, checkNil bool, canChange bool, d *Decoder) (_ map[float32]interface{}, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -15636,11 +12371,8 @@ func (_ fastpathT) DecMapFloat32IntfV(v map[float32]interface{}, checkNil bool, containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[float32]interface{}, containerLen) - } else { - v = make(map[float32]interface{}) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 20) + v = make(map[float32]interface{}, xlen) changed = true } if containerLen > 0 { @@ -15655,11 +12387,7 @@ func (_ fastpathT) DecMapFloat32IntfV(v map[float32]interface{}, checkNil bool, } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := float32(dd.DecodeFloat(true)) - dd.ReadMapKVSeparator() mv := v[mk] d.decode(&mv) @@ -15667,12 +12395,12 @@ func (_ fastpathT) DecMapFloat32IntfV(v map[float32]interface{}, checkNil bool, v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapFloat32StringR(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapFloat32StringR(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[float32]string) v, changed := fastpathTV.DecMapFloat32StringV(*vp, fastpathCheckNilFalse, true, f.d) @@ -15693,7 +12421,7 @@ func (f fastpathT) DecMapFloat32StringX(vp *map[float32]string, checkNil bool, d func (_ fastpathT) DecMapFloat32StringV(v map[float32]string, checkNil bool, canChange bool, d *Decoder) (_ map[float32]string, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -15703,11 +12431,8 @@ func (_ fastpathT) DecMapFloat32StringV(v map[float32]string, checkNil bool, can containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[float32]string, containerLen) - } else { - v = make(map[float32]string) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 20) + v = make(map[float32]string, xlen) changed = true } if containerLen > 0 { @@ -15721,23 +12446,19 @@ func (_ fastpathT) DecMapFloat32StringV(v map[float32]string, checkNil bool, can } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := float32(dd.DecodeFloat(true)) - dd.ReadMapKVSeparator() mv := v[mk] mv = dd.DecodeString() if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapFloat32UintR(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapFloat32UintR(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[float32]uint) v, changed := fastpathTV.DecMapFloat32UintV(*vp, fastpathCheckNilFalse, true, f.d) @@ -15758,7 +12479,7 @@ func (f fastpathT) DecMapFloat32UintX(vp *map[float32]uint, checkNil bool, d *De func (_ fastpathT) DecMapFloat32UintV(v map[float32]uint, checkNil bool, canChange bool, d *Decoder) (_ map[float32]uint, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -15768,11 +12489,8 @@ func (_ fastpathT) DecMapFloat32UintV(v map[float32]uint, checkNil bool, canChan containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[float32]uint, containerLen) - } else { - v = make(map[float32]uint) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 12) + v = make(map[float32]uint, xlen) changed = true } if containerLen > 0 { @@ -15786,23 +12504,19 @@ func (_ fastpathT) DecMapFloat32UintV(v map[float32]uint, checkNil bool, canChan } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := float32(dd.DecodeFloat(true)) - dd.ReadMapKVSeparator() mv := v[mk] mv = uint(dd.DecodeUint(uintBitsize)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapFloat32Uint8R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapFloat32Uint8R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[float32]uint8) v, changed := fastpathTV.DecMapFloat32Uint8V(*vp, fastpathCheckNilFalse, true, f.d) @@ -15823,7 +12537,7 @@ func (f fastpathT) DecMapFloat32Uint8X(vp *map[float32]uint8, checkNil bool, d * func (_ fastpathT) DecMapFloat32Uint8V(v map[float32]uint8, checkNil bool, canChange bool, d *Decoder) (_ map[float32]uint8, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -15833,11 +12547,8 @@ func (_ fastpathT) DecMapFloat32Uint8V(v map[float32]uint8, checkNil bool, canCh containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[float32]uint8, containerLen) - } else { - v = make(map[float32]uint8) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 5) + v = make(map[float32]uint8, xlen) changed = true } if containerLen > 0 { @@ -15851,23 +12562,19 @@ func (_ fastpathT) DecMapFloat32Uint8V(v map[float32]uint8, checkNil bool, canCh } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := float32(dd.DecodeFloat(true)) - dd.ReadMapKVSeparator() mv := v[mk] mv = uint8(dd.DecodeUint(8)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapFloat32Uint16R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapFloat32Uint16R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[float32]uint16) v, changed := fastpathTV.DecMapFloat32Uint16V(*vp, fastpathCheckNilFalse, true, f.d) @@ -15888,7 +12595,7 @@ func (f fastpathT) DecMapFloat32Uint16X(vp *map[float32]uint16, checkNil bool, d func (_ fastpathT) DecMapFloat32Uint16V(v map[float32]uint16, checkNil bool, canChange bool, d *Decoder) (_ map[float32]uint16, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -15898,11 +12605,8 @@ func (_ fastpathT) DecMapFloat32Uint16V(v map[float32]uint16, checkNil bool, can containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[float32]uint16, containerLen) - } else { - v = make(map[float32]uint16) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 6) + v = make(map[float32]uint16, xlen) changed = true } if containerLen > 0 { @@ -15916,23 +12620,19 @@ func (_ fastpathT) DecMapFloat32Uint16V(v map[float32]uint16, checkNil bool, can } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := float32(dd.DecodeFloat(true)) - dd.ReadMapKVSeparator() mv := v[mk] mv = uint16(dd.DecodeUint(16)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapFloat32Uint32R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapFloat32Uint32R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[float32]uint32) v, changed := fastpathTV.DecMapFloat32Uint32V(*vp, fastpathCheckNilFalse, true, f.d) @@ -15953,7 +12653,7 @@ func (f fastpathT) DecMapFloat32Uint32X(vp *map[float32]uint32, checkNil bool, d func (_ fastpathT) DecMapFloat32Uint32V(v map[float32]uint32, checkNil bool, canChange bool, d *Decoder) (_ map[float32]uint32, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -15963,11 +12663,8 @@ func (_ fastpathT) DecMapFloat32Uint32V(v map[float32]uint32, checkNil bool, can containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[float32]uint32, containerLen) - } else { - v = make(map[float32]uint32) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 8) + v = make(map[float32]uint32, xlen) changed = true } if containerLen > 0 { @@ -15981,23 +12678,19 @@ func (_ fastpathT) DecMapFloat32Uint32V(v map[float32]uint32, checkNil bool, can } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := float32(dd.DecodeFloat(true)) - dd.ReadMapKVSeparator() mv := v[mk] mv = uint32(dd.DecodeUint(32)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapFloat32Uint64R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapFloat32Uint64R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[float32]uint64) v, changed := fastpathTV.DecMapFloat32Uint64V(*vp, fastpathCheckNilFalse, true, f.d) @@ -16018,7 +12711,7 @@ func (f fastpathT) DecMapFloat32Uint64X(vp *map[float32]uint64, checkNil bool, d func (_ fastpathT) DecMapFloat32Uint64V(v map[float32]uint64, checkNil bool, canChange bool, d *Decoder) (_ map[float32]uint64, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -16028,11 +12721,8 @@ func (_ fastpathT) DecMapFloat32Uint64V(v map[float32]uint64, checkNil bool, can containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[float32]uint64, containerLen) - } else { - v = make(map[float32]uint64) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 12) + v = make(map[float32]uint64, xlen) changed = true } if containerLen > 0 { @@ -16046,23 +12736,19 @@ func (_ fastpathT) DecMapFloat32Uint64V(v map[float32]uint64, checkNil bool, can } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := float32(dd.DecodeFloat(true)) - dd.ReadMapKVSeparator() mv := v[mk] mv = dd.DecodeUint(64) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapFloat32IntR(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapFloat32IntR(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[float32]int) v, changed := fastpathTV.DecMapFloat32IntV(*vp, fastpathCheckNilFalse, true, f.d) @@ -16083,7 +12769,7 @@ func (f fastpathT) DecMapFloat32IntX(vp *map[float32]int, checkNil bool, d *Deco func (_ fastpathT) DecMapFloat32IntV(v map[float32]int, checkNil bool, canChange bool, d *Decoder) (_ map[float32]int, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -16093,11 +12779,8 @@ func (_ fastpathT) DecMapFloat32IntV(v map[float32]int, checkNil bool, canChange containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[float32]int, containerLen) - } else { - v = make(map[float32]int) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 12) + v = make(map[float32]int, xlen) changed = true } if containerLen > 0 { @@ -16111,23 +12794,19 @@ func (_ fastpathT) DecMapFloat32IntV(v map[float32]int, checkNil bool, canChange } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := float32(dd.DecodeFloat(true)) - dd.ReadMapKVSeparator() mv := v[mk] mv = int(dd.DecodeInt(intBitsize)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapFloat32Int8R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapFloat32Int8R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[float32]int8) v, changed := fastpathTV.DecMapFloat32Int8V(*vp, fastpathCheckNilFalse, true, f.d) @@ -16148,7 +12827,7 @@ func (f fastpathT) DecMapFloat32Int8X(vp *map[float32]int8, checkNil bool, d *De func (_ fastpathT) DecMapFloat32Int8V(v map[float32]int8, checkNil bool, canChange bool, d *Decoder) (_ map[float32]int8, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -16158,11 +12837,8 @@ func (_ fastpathT) DecMapFloat32Int8V(v map[float32]int8, checkNil bool, canChan containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[float32]int8, containerLen) - } else { - v = make(map[float32]int8) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 5) + v = make(map[float32]int8, xlen) changed = true } if containerLen > 0 { @@ -16176,23 +12852,19 @@ func (_ fastpathT) DecMapFloat32Int8V(v map[float32]int8, checkNil bool, canChan } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := float32(dd.DecodeFloat(true)) - dd.ReadMapKVSeparator() mv := v[mk] mv = int8(dd.DecodeInt(8)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapFloat32Int16R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapFloat32Int16R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[float32]int16) v, changed := fastpathTV.DecMapFloat32Int16V(*vp, fastpathCheckNilFalse, true, f.d) @@ -16213,7 +12885,7 @@ func (f fastpathT) DecMapFloat32Int16X(vp *map[float32]int16, checkNil bool, d * func (_ fastpathT) DecMapFloat32Int16V(v map[float32]int16, checkNil bool, canChange bool, d *Decoder) (_ map[float32]int16, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -16223,11 +12895,8 @@ func (_ fastpathT) DecMapFloat32Int16V(v map[float32]int16, checkNil bool, canCh containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[float32]int16, containerLen) - } else { - v = make(map[float32]int16) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 6) + v = make(map[float32]int16, xlen) changed = true } if containerLen > 0 { @@ -16241,23 +12910,19 @@ func (_ fastpathT) DecMapFloat32Int16V(v map[float32]int16, checkNil bool, canCh } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := float32(dd.DecodeFloat(true)) - dd.ReadMapKVSeparator() mv := v[mk] mv = int16(dd.DecodeInt(16)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapFloat32Int32R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapFloat32Int32R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[float32]int32) v, changed := fastpathTV.DecMapFloat32Int32V(*vp, fastpathCheckNilFalse, true, f.d) @@ -16278,7 +12943,7 @@ func (f fastpathT) DecMapFloat32Int32X(vp *map[float32]int32, checkNil bool, d * func (_ fastpathT) DecMapFloat32Int32V(v map[float32]int32, checkNil bool, canChange bool, d *Decoder) (_ map[float32]int32, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -16288,11 +12953,8 @@ func (_ fastpathT) DecMapFloat32Int32V(v map[float32]int32, checkNil bool, canCh containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[float32]int32, containerLen) - } else { - v = make(map[float32]int32) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 8) + v = make(map[float32]int32, xlen) changed = true } if containerLen > 0 { @@ -16306,23 +12968,19 @@ func (_ fastpathT) DecMapFloat32Int32V(v map[float32]int32, checkNil bool, canCh } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := float32(dd.DecodeFloat(true)) - dd.ReadMapKVSeparator() mv := v[mk] mv = int32(dd.DecodeInt(32)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapFloat32Int64R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapFloat32Int64R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[float32]int64) v, changed := fastpathTV.DecMapFloat32Int64V(*vp, fastpathCheckNilFalse, true, f.d) @@ -16343,7 +13001,7 @@ func (f fastpathT) DecMapFloat32Int64X(vp *map[float32]int64, checkNil bool, d * func (_ fastpathT) DecMapFloat32Int64V(v map[float32]int64, checkNil bool, canChange bool, d *Decoder) (_ map[float32]int64, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -16353,11 +13011,8 @@ func (_ fastpathT) DecMapFloat32Int64V(v map[float32]int64, checkNil bool, canCh containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[float32]int64, containerLen) - } else { - v = make(map[float32]int64) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 12) + v = make(map[float32]int64, xlen) changed = true } if containerLen > 0 { @@ -16371,23 +13026,19 @@ func (_ fastpathT) DecMapFloat32Int64V(v map[float32]int64, checkNil bool, canCh } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := float32(dd.DecodeFloat(true)) - dd.ReadMapKVSeparator() mv := v[mk] mv = dd.DecodeInt(64) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapFloat32Float32R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapFloat32Float32R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[float32]float32) v, changed := fastpathTV.DecMapFloat32Float32V(*vp, fastpathCheckNilFalse, true, f.d) @@ -16408,7 +13059,7 @@ func (f fastpathT) DecMapFloat32Float32X(vp *map[float32]float32, checkNil bool, func (_ fastpathT) DecMapFloat32Float32V(v map[float32]float32, checkNil bool, canChange bool, d *Decoder) (_ map[float32]float32, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -16418,11 +13069,8 @@ func (_ fastpathT) DecMapFloat32Float32V(v map[float32]float32, checkNil bool, c containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[float32]float32, containerLen) - } else { - v = make(map[float32]float32) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 8) + v = make(map[float32]float32, xlen) changed = true } if containerLen > 0 { @@ -16436,23 +13084,19 @@ func (_ fastpathT) DecMapFloat32Float32V(v map[float32]float32, checkNil bool, c } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := float32(dd.DecodeFloat(true)) - dd.ReadMapKVSeparator() mv := v[mk] mv = float32(dd.DecodeFloat(true)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapFloat32Float64R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapFloat32Float64R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[float32]float64) v, changed := fastpathTV.DecMapFloat32Float64V(*vp, fastpathCheckNilFalse, true, f.d) @@ -16473,7 +13117,7 @@ func (f fastpathT) DecMapFloat32Float64X(vp *map[float32]float64, checkNil bool, func (_ fastpathT) DecMapFloat32Float64V(v map[float32]float64, checkNil bool, canChange bool, d *Decoder) (_ map[float32]float64, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -16483,11 +13127,8 @@ func (_ fastpathT) DecMapFloat32Float64V(v map[float32]float64, checkNil bool, c containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[float32]float64, containerLen) - } else { - v = make(map[float32]float64) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 12) + v = make(map[float32]float64, xlen) changed = true } if containerLen > 0 { @@ -16501,23 +13142,19 @@ func (_ fastpathT) DecMapFloat32Float64V(v map[float32]float64, checkNil bool, c } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := float32(dd.DecodeFloat(true)) - dd.ReadMapKVSeparator() mv := v[mk] mv = dd.DecodeFloat(false) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapFloat32BoolR(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapFloat32BoolR(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[float32]bool) v, changed := fastpathTV.DecMapFloat32BoolV(*vp, fastpathCheckNilFalse, true, f.d) @@ -16538,7 +13175,7 @@ func (f fastpathT) DecMapFloat32BoolX(vp *map[float32]bool, checkNil bool, d *De func (_ fastpathT) DecMapFloat32BoolV(v map[float32]bool, checkNil bool, canChange bool, d *Decoder) (_ map[float32]bool, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -16548,11 +13185,8 @@ func (_ fastpathT) DecMapFloat32BoolV(v map[float32]bool, checkNil bool, canChan containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[float32]bool, containerLen) - } else { - v = make(map[float32]bool) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 5) + v = make(map[float32]bool, xlen) changed = true } if containerLen > 0 { @@ -16566,23 +13200,19 @@ func (_ fastpathT) DecMapFloat32BoolV(v map[float32]bool, checkNil bool, canChan } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := float32(dd.DecodeFloat(true)) - dd.ReadMapKVSeparator() mv := v[mk] mv = dd.DecodeBool() if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapFloat64IntfR(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapFloat64IntfR(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[float64]interface{}) v, changed := fastpathTV.DecMapFloat64IntfV(*vp, fastpathCheckNilFalse, true, f.d) @@ -16603,7 +13233,7 @@ func (f fastpathT) DecMapFloat64IntfX(vp *map[float64]interface{}, checkNil bool func (_ fastpathT) DecMapFloat64IntfV(v map[float64]interface{}, checkNil bool, canChange bool, d *Decoder) (_ map[float64]interface{}, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -16613,11 +13243,8 @@ func (_ fastpathT) DecMapFloat64IntfV(v map[float64]interface{}, checkNil bool, containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[float64]interface{}, containerLen) - } else { - v = make(map[float64]interface{}) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 24) + v = make(map[float64]interface{}, xlen) changed = true } if containerLen > 0 { @@ -16632,11 +13259,7 @@ func (_ fastpathT) DecMapFloat64IntfV(v map[float64]interface{}, checkNil bool, } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := dd.DecodeFloat(false) - dd.ReadMapKVSeparator() mv := v[mk] d.decode(&mv) @@ -16644,12 +13267,12 @@ func (_ fastpathT) DecMapFloat64IntfV(v map[float64]interface{}, checkNil bool, v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapFloat64StringR(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapFloat64StringR(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[float64]string) v, changed := fastpathTV.DecMapFloat64StringV(*vp, fastpathCheckNilFalse, true, f.d) @@ -16670,7 +13293,7 @@ func (f fastpathT) DecMapFloat64StringX(vp *map[float64]string, checkNil bool, d func (_ fastpathT) DecMapFloat64StringV(v map[float64]string, checkNil bool, canChange bool, d *Decoder) (_ map[float64]string, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -16680,11 +13303,8 @@ func (_ fastpathT) DecMapFloat64StringV(v map[float64]string, checkNil bool, can containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[float64]string, containerLen) - } else { - v = make(map[float64]string) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 24) + v = make(map[float64]string, xlen) changed = true } if containerLen > 0 { @@ -16698,23 +13318,19 @@ func (_ fastpathT) DecMapFloat64StringV(v map[float64]string, checkNil bool, can } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := dd.DecodeFloat(false) - dd.ReadMapKVSeparator() mv := v[mk] mv = dd.DecodeString() if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapFloat64UintR(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapFloat64UintR(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[float64]uint) v, changed := fastpathTV.DecMapFloat64UintV(*vp, fastpathCheckNilFalse, true, f.d) @@ -16735,7 +13351,7 @@ func (f fastpathT) DecMapFloat64UintX(vp *map[float64]uint, checkNil bool, d *De func (_ fastpathT) DecMapFloat64UintV(v map[float64]uint, checkNil bool, canChange bool, d *Decoder) (_ map[float64]uint, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -16745,11 +13361,8 @@ func (_ fastpathT) DecMapFloat64UintV(v map[float64]uint, checkNil bool, canChan containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[float64]uint, containerLen) - } else { - v = make(map[float64]uint) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 16) + v = make(map[float64]uint, xlen) changed = true } if containerLen > 0 { @@ -16763,23 +13376,19 @@ func (_ fastpathT) DecMapFloat64UintV(v map[float64]uint, checkNil bool, canChan } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := dd.DecodeFloat(false) - dd.ReadMapKVSeparator() mv := v[mk] mv = uint(dd.DecodeUint(uintBitsize)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapFloat64Uint8R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapFloat64Uint8R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[float64]uint8) v, changed := fastpathTV.DecMapFloat64Uint8V(*vp, fastpathCheckNilFalse, true, f.d) @@ -16800,7 +13409,7 @@ func (f fastpathT) DecMapFloat64Uint8X(vp *map[float64]uint8, checkNil bool, d * func (_ fastpathT) DecMapFloat64Uint8V(v map[float64]uint8, checkNil bool, canChange bool, d *Decoder) (_ map[float64]uint8, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -16810,11 +13419,8 @@ func (_ fastpathT) DecMapFloat64Uint8V(v map[float64]uint8, checkNil bool, canCh containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[float64]uint8, containerLen) - } else { - v = make(map[float64]uint8) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 9) + v = make(map[float64]uint8, xlen) changed = true } if containerLen > 0 { @@ -16828,23 +13434,19 @@ func (_ fastpathT) DecMapFloat64Uint8V(v map[float64]uint8, checkNil bool, canCh } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := dd.DecodeFloat(false) - dd.ReadMapKVSeparator() mv := v[mk] mv = uint8(dd.DecodeUint(8)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapFloat64Uint16R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapFloat64Uint16R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[float64]uint16) v, changed := fastpathTV.DecMapFloat64Uint16V(*vp, fastpathCheckNilFalse, true, f.d) @@ -16865,7 +13467,7 @@ func (f fastpathT) DecMapFloat64Uint16X(vp *map[float64]uint16, checkNil bool, d func (_ fastpathT) DecMapFloat64Uint16V(v map[float64]uint16, checkNil bool, canChange bool, d *Decoder) (_ map[float64]uint16, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -16875,11 +13477,8 @@ func (_ fastpathT) DecMapFloat64Uint16V(v map[float64]uint16, checkNil bool, can containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[float64]uint16, containerLen) - } else { - v = make(map[float64]uint16) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 10) + v = make(map[float64]uint16, xlen) changed = true } if containerLen > 0 { @@ -16893,23 +13492,19 @@ func (_ fastpathT) DecMapFloat64Uint16V(v map[float64]uint16, checkNil bool, can } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := dd.DecodeFloat(false) - dd.ReadMapKVSeparator() mv := v[mk] mv = uint16(dd.DecodeUint(16)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapFloat64Uint32R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapFloat64Uint32R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[float64]uint32) v, changed := fastpathTV.DecMapFloat64Uint32V(*vp, fastpathCheckNilFalse, true, f.d) @@ -16930,7 +13525,7 @@ func (f fastpathT) DecMapFloat64Uint32X(vp *map[float64]uint32, checkNil bool, d func (_ fastpathT) DecMapFloat64Uint32V(v map[float64]uint32, checkNil bool, canChange bool, d *Decoder) (_ map[float64]uint32, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -16940,11 +13535,8 @@ func (_ fastpathT) DecMapFloat64Uint32V(v map[float64]uint32, checkNil bool, can containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[float64]uint32, containerLen) - } else { - v = make(map[float64]uint32) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 12) + v = make(map[float64]uint32, xlen) changed = true } if containerLen > 0 { @@ -16958,23 +13550,19 @@ func (_ fastpathT) DecMapFloat64Uint32V(v map[float64]uint32, checkNil bool, can } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := dd.DecodeFloat(false) - dd.ReadMapKVSeparator() mv := v[mk] mv = uint32(dd.DecodeUint(32)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapFloat64Uint64R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapFloat64Uint64R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[float64]uint64) v, changed := fastpathTV.DecMapFloat64Uint64V(*vp, fastpathCheckNilFalse, true, f.d) @@ -16995,7 +13583,7 @@ func (f fastpathT) DecMapFloat64Uint64X(vp *map[float64]uint64, checkNil bool, d func (_ fastpathT) DecMapFloat64Uint64V(v map[float64]uint64, checkNil bool, canChange bool, d *Decoder) (_ map[float64]uint64, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -17005,11 +13593,8 @@ func (_ fastpathT) DecMapFloat64Uint64V(v map[float64]uint64, checkNil bool, can containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[float64]uint64, containerLen) - } else { - v = make(map[float64]uint64) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 16) + v = make(map[float64]uint64, xlen) changed = true } if containerLen > 0 { @@ -17023,23 +13608,19 @@ func (_ fastpathT) DecMapFloat64Uint64V(v map[float64]uint64, checkNil bool, can } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := dd.DecodeFloat(false) - dd.ReadMapKVSeparator() mv := v[mk] mv = dd.DecodeUint(64) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapFloat64IntR(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapFloat64IntR(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[float64]int) v, changed := fastpathTV.DecMapFloat64IntV(*vp, fastpathCheckNilFalse, true, f.d) @@ -17060,7 +13641,7 @@ func (f fastpathT) DecMapFloat64IntX(vp *map[float64]int, checkNil bool, d *Deco func (_ fastpathT) DecMapFloat64IntV(v map[float64]int, checkNil bool, canChange bool, d *Decoder) (_ map[float64]int, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -17070,11 +13651,8 @@ func (_ fastpathT) DecMapFloat64IntV(v map[float64]int, checkNil bool, canChange containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[float64]int, containerLen) - } else { - v = make(map[float64]int) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 16) + v = make(map[float64]int, xlen) changed = true } if containerLen > 0 { @@ -17088,23 +13666,19 @@ func (_ fastpathT) DecMapFloat64IntV(v map[float64]int, checkNil bool, canChange } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := dd.DecodeFloat(false) - dd.ReadMapKVSeparator() mv := v[mk] mv = int(dd.DecodeInt(intBitsize)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapFloat64Int8R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapFloat64Int8R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[float64]int8) v, changed := fastpathTV.DecMapFloat64Int8V(*vp, fastpathCheckNilFalse, true, f.d) @@ -17125,7 +13699,7 @@ func (f fastpathT) DecMapFloat64Int8X(vp *map[float64]int8, checkNil bool, d *De func (_ fastpathT) DecMapFloat64Int8V(v map[float64]int8, checkNil bool, canChange bool, d *Decoder) (_ map[float64]int8, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -17135,11 +13709,8 @@ func (_ fastpathT) DecMapFloat64Int8V(v map[float64]int8, checkNil bool, canChan containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[float64]int8, containerLen) - } else { - v = make(map[float64]int8) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 9) + v = make(map[float64]int8, xlen) changed = true } if containerLen > 0 { @@ -17153,23 +13724,19 @@ func (_ fastpathT) DecMapFloat64Int8V(v map[float64]int8, checkNil bool, canChan } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := dd.DecodeFloat(false) - dd.ReadMapKVSeparator() mv := v[mk] mv = int8(dd.DecodeInt(8)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapFloat64Int16R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapFloat64Int16R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[float64]int16) v, changed := fastpathTV.DecMapFloat64Int16V(*vp, fastpathCheckNilFalse, true, f.d) @@ -17190,7 +13757,7 @@ func (f fastpathT) DecMapFloat64Int16X(vp *map[float64]int16, checkNil bool, d * func (_ fastpathT) DecMapFloat64Int16V(v map[float64]int16, checkNil bool, canChange bool, d *Decoder) (_ map[float64]int16, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -17200,11 +13767,8 @@ func (_ fastpathT) DecMapFloat64Int16V(v map[float64]int16, checkNil bool, canCh containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[float64]int16, containerLen) - } else { - v = make(map[float64]int16) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 10) + v = make(map[float64]int16, xlen) changed = true } if containerLen > 0 { @@ -17218,23 +13782,19 @@ func (_ fastpathT) DecMapFloat64Int16V(v map[float64]int16, checkNil bool, canCh } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := dd.DecodeFloat(false) - dd.ReadMapKVSeparator() mv := v[mk] mv = int16(dd.DecodeInt(16)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapFloat64Int32R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapFloat64Int32R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[float64]int32) v, changed := fastpathTV.DecMapFloat64Int32V(*vp, fastpathCheckNilFalse, true, f.d) @@ -17255,7 +13815,7 @@ func (f fastpathT) DecMapFloat64Int32X(vp *map[float64]int32, checkNil bool, d * func (_ fastpathT) DecMapFloat64Int32V(v map[float64]int32, checkNil bool, canChange bool, d *Decoder) (_ map[float64]int32, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -17265,11 +13825,8 @@ func (_ fastpathT) DecMapFloat64Int32V(v map[float64]int32, checkNil bool, canCh containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[float64]int32, containerLen) - } else { - v = make(map[float64]int32) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 12) + v = make(map[float64]int32, xlen) changed = true } if containerLen > 0 { @@ -17283,23 +13840,19 @@ func (_ fastpathT) DecMapFloat64Int32V(v map[float64]int32, checkNil bool, canCh } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := dd.DecodeFloat(false) - dd.ReadMapKVSeparator() mv := v[mk] mv = int32(dd.DecodeInt(32)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapFloat64Int64R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapFloat64Int64R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[float64]int64) v, changed := fastpathTV.DecMapFloat64Int64V(*vp, fastpathCheckNilFalse, true, f.d) @@ -17320,7 +13873,7 @@ func (f fastpathT) DecMapFloat64Int64X(vp *map[float64]int64, checkNil bool, d * func (_ fastpathT) DecMapFloat64Int64V(v map[float64]int64, checkNil bool, canChange bool, d *Decoder) (_ map[float64]int64, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -17330,11 +13883,8 @@ func (_ fastpathT) DecMapFloat64Int64V(v map[float64]int64, checkNil bool, canCh containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[float64]int64, containerLen) - } else { - v = make(map[float64]int64) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 16) + v = make(map[float64]int64, xlen) changed = true } if containerLen > 0 { @@ -17348,23 +13898,19 @@ func (_ fastpathT) DecMapFloat64Int64V(v map[float64]int64, checkNil bool, canCh } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := dd.DecodeFloat(false) - dd.ReadMapKVSeparator() mv := v[mk] mv = dd.DecodeInt(64) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapFloat64Float32R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapFloat64Float32R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[float64]float32) v, changed := fastpathTV.DecMapFloat64Float32V(*vp, fastpathCheckNilFalse, true, f.d) @@ -17385,7 +13931,7 @@ func (f fastpathT) DecMapFloat64Float32X(vp *map[float64]float32, checkNil bool, func (_ fastpathT) DecMapFloat64Float32V(v map[float64]float32, checkNil bool, canChange bool, d *Decoder) (_ map[float64]float32, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -17395,11 +13941,8 @@ func (_ fastpathT) DecMapFloat64Float32V(v map[float64]float32, checkNil bool, c containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[float64]float32, containerLen) - } else { - v = make(map[float64]float32) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 12) + v = make(map[float64]float32, xlen) changed = true } if containerLen > 0 { @@ -17413,23 +13956,19 @@ func (_ fastpathT) DecMapFloat64Float32V(v map[float64]float32, checkNil bool, c } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := dd.DecodeFloat(false) - dd.ReadMapKVSeparator() mv := v[mk] mv = float32(dd.DecodeFloat(true)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapFloat64Float64R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapFloat64Float64R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[float64]float64) v, changed := fastpathTV.DecMapFloat64Float64V(*vp, fastpathCheckNilFalse, true, f.d) @@ -17450,7 +13989,7 @@ func (f fastpathT) DecMapFloat64Float64X(vp *map[float64]float64, checkNil bool, func (_ fastpathT) DecMapFloat64Float64V(v map[float64]float64, checkNil bool, canChange bool, d *Decoder) (_ map[float64]float64, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -17460,11 +13999,8 @@ func (_ fastpathT) DecMapFloat64Float64V(v map[float64]float64, checkNil bool, c containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[float64]float64, containerLen) - } else { - v = make(map[float64]float64) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 16) + v = make(map[float64]float64, xlen) changed = true } if containerLen > 0 { @@ -17478,23 +14014,19 @@ func (_ fastpathT) DecMapFloat64Float64V(v map[float64]float64, checkNil bool, c } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := dd.DecodeFloat(false) - dd.ReadMapKVSeparator() mv := v[mk] mv = dd.DecodeFloat(false) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapFloat64BoolR(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapFloat64BoolR(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[float64]bool) v, changed := fastpathTV.DecMapFloat64BoolV(*vp, fastpathCheckNilFalse, true, f.d) @@ -17515,7 +14047,7 @@ func (f fastpathT) DecMapFloat64BoolX(vp *map[float64]bool, checkNil bool, d *De func (_ fastpathT) DecMapFloat64BoolV(v map[float64]bool, checkNil bool, canChange bool, d *Decoder) (_ map[float64]bool, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -17525,11 +14057,8 @@ func (_ fastpathT) DecMapFloat64BoolV(v map[float64]bool, checkNil bool, canChan containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[float64]bool, containerLen) - } else { - v = make(map[float64]bool) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 9) + v = make(map[float64]bool, xlen) changed = true } if containerLen > 0 { @@ -17543,23 +14072,19 @@ func (_ fastpathT) DecMapFloat64BoolV(v map[float64]bool, checkNil bool, canChan } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := dd.DecodeFloat(false) - dd.ReadMapKVSeparator() mv := v[mk] mv = dd.DecodeBool() if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapUintIntfR(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapUintIntfR(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[uint]interface{}) v, changed := fastpathTV.DecMapUintIntfV(*vp, fastpathCheckNilFalse, true, f.d) @@ -17580,7 +14105,7 @@ func (f fastpathT) DecMapUintIntfX(vp *map[uint]interface{}, checkNil bool, d *D func (_ fastpathT) DecMapUintIntfV(v map[uint]interface{}, checkNil bool, canChange bool, d *Decoder) (_ map[uint]interface{}, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -17590,11 +14115,8 @@ func (_ fastpathT) DecMapUintIntfV(v map[uint]interface{}, checkNil bool, canCha containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[uint]interface{}, containerLen) - } else { - v = make(map[uint]interface{}) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 24) + v = make(map[uint]interface{}, xlen) changed = true } if containerLen > 0 { @@ -17609,11 +14131,7 @@ func (_ fastpathT) DecMapUintIntfV(v map[uint]interface{}, checkNil bool, canCha } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := uint(dd.DecodeUint(uintBitsize)) - dd.ReadMapKVSeparator() mv := v[mk] d.decode(&mv) @@ -17621,12 +14139,12 @@ func (_ fastpathT) DecMapUintIntfV(v map[uint]interface{}, checkNil bool, canCha v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapUintStringR(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapUintStringR(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[uint]string) v, changed := fastpathTV.DecMapUintStringV(*vp, fastpathCheckNilFalse, true, f.d) @@ -17647,7 +14165,7 @@ func (f fastpathT) DecMapUintStringX(vp *map[uint]string, checkNil bool, d *Deco func (_ fastpathT) DecMapUintStringV(v map[uint]string, checkNil bool, canChange bool, d *Decoder) (_ map[uint]string, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -17657,11 +14175,8 @@ func (_ fastpathT) DecMapUintStringV(v map[uint]string, checkNil bool, canChange containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[uint]string, containerLen) - } else { - v = make(map[uint]string) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 24) + v = make(map[uint]string, xlen) changed = true } if containerLen > 0 { @@ -17675,23 +14190,19 @@ func (_ fastpathT) DecMapUintStringV(v map[uint]string, checkNil bool, canChange } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := uint(dd.DecodeUint(uintBitsize)) - dd.ReadMapKVSeparator() mv := v[mk] mv = dd.DecodeString() if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapUintUintR(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapUintUintR(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[uint]uint) v, changed := fastpathTV.DecMapUintUintV(*vp, fastpathCheckNilFalse, true, f.d) @@ -17712,7 +14223,7 @@ func (f fastpathT) DecMapUintUintX(vp *map[uint]uint, checkNil bool, d *Decoder) func (_ fastpathT) DecMapUintUintV(v map[uint]uint, checkNil bool, canChange bool, d *Decoder) (_ map[uint]uint, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -17722,11 +14233,8 @@ func (_ fastpathT) DecMapUintUintV(v map[uint]uint, checkNil bool, canChange boo containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[uint]uint, containerLen) - } else { - v = make(map[uint]uint) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 16) + v = make(map[uint]uint, xlen) changed = true } if containerLen > 0 { @@ -17740,23 +14248,19 @@ func (_ fastpathT) DecMapUintUintV(v map[uint]uint, checkNil bool, canChange boo } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := uint(dd.DecodeUint(uintBitsize)) - dd.ReadMapKVSeparator() mv := v[mk] mv = uint(dd.DecodeUint(uintBitsize)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapUintUint8R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapUintUint8R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[uint]uint8) v, changed := fastpathTV.DecMapUintUint8V(*vp, fastpathCheckNilFalse, true, f.d) @@ -17777,7 +14281,7 @@ func (f fastpathT) DecMapUintUint8X(vp *map[uint]uint8, checkNil bool, d *Decode func (_ fastpathT) DecMapUintUint8V(v map[uint]uint8, checkNil bool, canChange bool, d *Decoder) (_ map[uint]uint8, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -17787,11 +14291,8 @@ func (_ fastpathT) DecMapUintUint8V(v map[uint]uint8, checkNil bool, canChange b containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[uint]uint8, containerLen) - } else { - v = make(map[uint]uint8) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 9) + v = make(map[uint]uint8, xlen) changed = true } if containerLen > 0 { @@ -17805,23 +14306,19 @@ func (_ fastpathT) DecMapUintUint8V(v map[uint]uint8, checkNil bool, canChange b } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := uint(dd.DecodeUint(uintBitsize)) - dd.ReadMapKVSeparator() mv := v[mk] mv = uint8(dd.DecodeUint(8)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapUintUint16R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapUintUint16R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[uint]uint16) v, changed := fastpathTV.DecMapUintUint16V(*vp, fastpathCheckNilFalse, true, f.d) @@ -17842,7 +14339,7 @@ func (f fastpathT) DecMapUintUint16X(vp *map[uint]uint16, checkNil bool, d *Deco func (_ fastpathT) DecMapUintUint16V(v map[uint]uint16, checkNil bool, canChange bool, d *Decoder) (_ map[uint]uint16, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -17852,11 +14349,8 @@ func (_ fastpathT) DecMapUintUint16V(v map[uint]uint16, checkNil bool, canChange containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[uint]uint16, containerLen) - } else { - v = make(map[uint]uint16) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 10) + v = make(map[uint]uint16, xlen) changed = true } if containerLen > 0 { @@ -17870,23 +14364,19 @@ func (_ fastpathT) DecMapUintUint16V(v map[uint]uint16, checkNil bool, canChange } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := uint(dd.DecodeUint(uintBitsize)) - dd.ReadMapKVSeparator() mv := v[mk] mv = uint16(dd.DecodeUint(16)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapUintUint32R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapUintUint32R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[uint]uint32) v, changed := fastpathTV.DecMapUintUint32V(*vp, fastpathCheckNilFalse, true, f.d) @@ -17907,7 +14397,7 @@ func (f fastpathT) DecMapUintUint32X(vp *map[uint]uint32, checkNil bool, d *Deco func (_ fastpathT) DecMapUintUint32V(v map[uint]uint32, checkNil bool, canChange bool, d *Decoder) (_ map[uint]uint32, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -17917,11 +14407,8 @@ func (_ fastpathT) DecMapUintUint32V(v map[uint]uint32, checkNil bool, canChange containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[uint]uint32, containerLen) - } else { - v = make(map[uint]uint32) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 12) + v = make(map[uint]uint32, xlen) changed = true } if containerLen > 0 { @@ -17935,23 +14422,19 @@ func (_ fastpathT) DecMapUintUint32V(v map[uint]uint32, checkNil bool, canChange } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := uint(dd.DecodeUint(uintBitsize)) - dd.ReadMapKVSeparator() mv := v[mk] mv = uint32(dd.DecodeUint(32)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapUintUint64R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapUintUint64R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[uint]uint64) v, changed := fastpathTV.DecMapUintUint64V(*vp, fastpathCheckNilFalse, true, f.d) @@ -17972,7 +14455,7 @@ func (f fastpathT) DecMapUintUint64X(vp *map[uint]uint64, checkNil bool, d *Deco func (_ fastpathT) DecMapUintUint64V(v map[uint]uint64, checkNil bool, canChange bool, d *Decoder) (_ map[uint]uint64, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -17982,11 +14465,8 @@ func (_ fastpathT) DecMapUintUint64V(v map[uint]uint64, checkNil bool, canChange containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[uint]uint64, containerLen) - } else { - v = make(map[uint]uint64) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 16) + v = make(map[uint]uint64, xlen) changed = true } if containerLen > 0 { @@ -18000,23 +14480,19 @@ func (_ fastpathT) DecMapUintUint64V(v map[uint]uint64, checkNil bool, canChange } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := uint(dd.DecodeUint(uintBitsize)) - dd.ReadMapKVSeparator() mv := v[mk] mv = dd.DecodeUint(64) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapUintIntR(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapUintIntR(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[uint]int) v, changed := fastpathTV.DecMapUintIntV(*vp, fastpathCheckNilFalse, true, f.d) @@ -18037,7 +14513,7 @@ func (f fastpathT) DecMapUintIntX(vp *map[uint]int, checkNil bool, d *Decoder) { func (_ fastpathT) DecMapUintIntV(v map[uint]int, checkNil bool, canChange bool, d *Decoder) (_ map[uint]int, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -18047,11 +14523,8 @@ func (_ fastpathT) DecMapUintIntV(v map[uint]int, checkNil bool, canChange bool, containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[uint]int, containerLen) - } else { - v = make(map[uint]int) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 16) + v = make(map[uint]int, xlen) changed = true } if containerLen > 0 { @@ -18065,23 +14538,19 @@ func (_ fastpathT) DecMapUintIntV(v map[uint]int, checkNil bool, canChange bool, } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := uint(dd.DecodeUint(uintBitsize)) - dd.ReadMapKVSeparator() mv := v[mk] mv = int(dd.DecodeInt(intBitsize)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapUintInt8R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapUintInt8R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[uint]int8) v, changed := fastpathTV.DecMapUintInt8V(*vp, fastpathCheckNilFalse, true, f.d) @@ -18102,7 +14571,7 @@ func (f fastpathT) DecMapUintInt8X(vp *map[uint]int8, checkNil bool, d *Decoder) func (_ fastpathT) DecMapUintInt8V(v map[uint]int8, checkNil bool, canChange bool, d *Decoder) (_ map[uint]int8, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -18112,11 +14581,8 @@ func (_ fastpathT) DecMapUintInt8V(v map[uint]int8, checkNil bool, canChange boo containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[uint]int8, containerLen) - } else { - v = make(map[uint]int8) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 9) + v = make(map[uint]int8, xlen) changed = true } if containerLen > 0 { @@ -18130,23 +14596,19 @@ func (_ fastpathT) DecMapUintInt8V(v map[uint]int8, checkNil bool, canChange boo } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := uint(dd.DecodeUint(uintBitsize)) - dd.ReadMapKVSeparator() mv := v[mk] mv = int8(dd.DecodeInt(8)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapUintInt16R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapUintInt16R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[uint]int16) v, changed := fastpathTV.DecMapUintInt16V(*vp, fastpathCheckNilFalse, true, f.d) @@ -18167,7 +14629,7 @@ func (f fastpathT) DecMapUintInt16X(vp *map[uint]int16, checkNil bool, d *Decode func (_ fastpathT) DecMapUintInt16V(v map[uint]int16, checkNil bool, canChange bool, d *Decoder) (_ map[uint]int16, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -18177,11 +14639,8 @@ func (_ fastpathT) DecMapUintInt16V(v map[uint]int16, checkNil bool, canChange b containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[uint]int16, containerLen) - } else { - v = make(map[uint]int16) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 10) + v = make(map[uint]int16, xlen) changed = true } if containerLen > 0 { @@ -18195,23 +14654,19 @@ func (_ fastpathT) DecMapUintInt16V(v map[uint]int16, checkNil bool, canChange b } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := uint(dd.DecodeUint(uintBitsize)) - dd.ReadMapKVSeparator() mv := v[mk] mv = int16(dd.DecodeInt(16)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapUintInt32R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapUintInt32R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[uint]int32) v, changed := fastpathTV.DecMapUintInt32V(*vp, fastpathCheckNilFalse, true, f.d) @@ -18232,7 +14687,7 @@ func (f fastpathT) DecMapUintInt32X(vp *map[uint]int32, checkNil bool, d *Decode func (_ fastpathT) DecMapUintInt32V(v map[uint]int32, checkNil bool, canChange bool, d *Decoder) (_ map[uint]int32, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -18242,11 +14697,8 @@ func (_ fastpathT) DecMapUintInt32V(v map[uint]int32, checkNil bool, canChange b containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[uint]int32, containerLen) - } else { - v = make(map[uint]int32) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 12) + v = make(map[uint]int32, xlen) changed = true } if containerLen > 0 { @@ -18260,23 +14712,19 @@ func (_ fastpathT) DecMapUintInt32V(v map[uint]int32, checkNil bool, canChange b } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := uint(dd.DecodeUint(uintBitsize)) - dd.ReadMapKVSeparator() mv := v[mk] mv = int32(dd.DecodeInt(32)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapUintInt64R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapUintInt64R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[uint]int64) v, changed := fastpathTV.DecMapUintInt64V(*vp, fastpathCheckNilFalse, true, f.d) @@ -18297,7 +14745,7 @@ func (f fastpathT) DecMapUintInt64X(vp *map[uint]int64, checkNil bool, d *Decode func (_ fastpathT) DecMapUintInt64V(v map[uint]int64, checkNil bool, canChange bool, d *Decoder) (_ map[uint]int64, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -18307,11 +14755,8 @@ func (_ fastpathT) DecMapUintInt64V(v map[uint]int64, checkNil bool, canChange b containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[uint]int64, containerLen) - } else { - v = make(map[uint]int64) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 16) + v = make(map[uint]int64, xlen) changed = true } if containerLen > 0 { @@ -18325,23 +14770,19 @@ func (_ fastpathT) DecMapUintInt64V(v map[uint]int64, checkNil bool, canChange b } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := uint(dd.DecodeUint(uintBitsize)) - dd.ReadMapKVSeparator() mv := v[mk] mv = dd.DecodeInt(64) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapUintFloat32R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapUintFloat32R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[uint]float32) v, changed := fastpathTV.DecMapUintFloat32V(*vp, fastpathCheckNilFalse, true, f.d) @@ -18362,7 +14803,7 @@ func (f fastpathT) DecMapUintFloat32X(vp *map[uint]float32, checkNil bool, d *De func (_ fastpathT) DecMapUintFloat32V(v map[uint]float32, checkNil bool, canChange bool, d *Decoder) (_ map[uint]float32, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -18372,11 +14813,8 @@ func (_ fastpathT) DecMapUintFloat32V(v map[uint]float32, checkNil bool, canChan containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[uint]float32, containerLen) - } else { - v = make(map[uint]float32) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 12) + v = make(map[uint]float32, xlen) changed = true } if containerLen > 0 { @@ -18390,23 +14828,19 @@ func (_ fastpathT) DecMapUintFloat32V(v map[uint]float32, checkNil bool, canChan } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := uint(dd.DecodeUint(uintBitsize)) - dd.ReadMapKVSeparator() mv := v[mk] mv = float32(dd.DecodeFloat(true)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapUintFloat64R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapUintFloat64R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[uint]float64) v, changed := fastpathTV.DecMapUintFloat64V(*vp, fastpathCheckNilFalse, true, f.d) @@ -18427,7 +14861,7 @@ func (f fastpathT) DecMapUintFloat64X(vp *map[uint]float64, checkNil bool, d *De func (_ fastpathT) DecMapUintFloat64V(v map[uint]float64, checkNil bool, canChange bool, d *Decoder) (_ map[uint]float64, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -18437,11 +14871,8 @@ func (_ fastpathT) DecMapUintFloat64V(v map[uint]float64, checkNil bool, canChan containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[uint]float64, containerLen) - } else { - v = make(map[uint]float64) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 16) + v = make(map[uint]float64, xlen) changed = true } if containerLen > 0 { @@ -18455,23 +14886,19 @@ func (_ fastpathT) DecMapUintFloat64V(v map[uint]float64, checkNil bool, canChan } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := uint(dd.DecodeUint(uintBitsize)) - dd.ReadMapKVSeparator() mv := v[mk] mv = dd.DecodeFloat(false) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapUintBoolR(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapUintBoolR(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[uint]bool) v, changed := fastpathTV.DecMapUintBoolV(*vp, fastpathCheckNilFalse, true, f.d) @@ -18492,7 +14919,7 @@ func (f fastpathT) DecMapUintBoolX(vp *map[uint]bool, checkNil bool, d *Decoder) func (_ fastpathT) DecMapUintBoolV(v map[uint]bool, checkNil bool, canChange bool, d *Decoder) (_ map[uint]bool, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -18502,11 +14929,8 @@ func (_ fastpathT) DecMapUintBoolV(v map[uint]bool, checkNil bool, canChange boo containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[uint]bool, containerLen) - } else { - v = make(map[uint]bool) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 9) + v = make(map[uint]bool, xlen) changed = true } if containerLen > 0 { @@ -18520,23 +14944,19 @@ func (_ fastpathT) DecMapUintBoolV(v map[uint]bool, checkNil bool, canChange boo } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := uint(dd.DecodeUint(uintBitsize)) - dd.ReadMapKVSeparator() mv := v[mk] mv = dd.DecodeBool() if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapUint8IntfR(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapUint8IntfR(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[uint8]interface{}) v, changed := fastpathTV.DecMapUint8IntfV(*vp, fastpathCheckNilFalse, true, f.d) @@ -18557,7 +14977,7 @@ func (f fastpathT) DecMapUint8IntfX(vp *map[uint8]interface{}, checkNil bool, d func (_ fastpathT) DecMapUint8IntfV(v map[uint8]interface{}, checkNil bool, canChange bool, d *Decoder) (_ map[uint8]interface{}, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -18567,11 +14987,8 @@ func (_ fastpathT) DecMapUint8IntfV(v map[uint8]interface{}, checkNil bool, canC containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[uint8]interface{}, containerLen) - } else { - v = make(map[uint8]interface{}) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 17) + v = make(map[uint8]interface{}, xlen) changed = true } if containerLen > 0 { @@ -18586,11 +15003,7 @@ func (_ fastpathT) DecMapUint8IntfV(v map[uint8]interface{}, checkNil bool, canC } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := uint8(dd.DecodeUint(8)) - dd.ReadMapKVSeparator() mv := v[mk] d.decode(&mv) @@ -18598,12 +15011,12 @@ func (_ fastpathT) DecMapUint8IntfV(v map[uint8]interface{}, checkNil bool, canC v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapUint8StringR(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapUint8StringR(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[uint8]string) v, changed := fastpathTV.DecMapUint8StringV(*vp, fastpathCheckNilFalse, true, f.d) @@ -18624,7 +15037,7 @@ func (f fastpathT) DecMapUint8StringX(vp *map[uint8]string, checkNil bool, d *De func (_ fastpathT) DecMapUint8StringV(v map[uint8]string, checkNil bool, canChange bool, d *Decoder) (_ map[uint8]string, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -18634,11 +15047,8 @@ func (_ fastpathT) DecMapUint8StringV(v map[uint8]string, checkNil bool, canChan containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[uint8]string, containerLen) - } else { - v = make(map[uint8]string) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 17) + v = make(map[uint8]string, xlen) changed = true } if containerLen > 0 { @@ -18652,23 +15062,19 @@ func (_ fastpathT) DecMapUint8StringV(v map[uint8]string, checkNil bool, canChan } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := uint8(dd.DecodeUint(8)) - dd.ReadMapKVSeparator() mv := v[mk] mv = dd.DecodeString() if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapUint8UintR(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapUint8UintR(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[uint8]uint) v, changed := fastpathTV.DecMapUint8UintV(*vp, fastpathCheckNilFalse, true, f.d) @@ -18689,7 +15095,7 @@ func (f fastpathT) DecMapUint8UintX(vp *map[uint8]uint, checkNil bool, d *Decode func (_ fastpathT) DecMapUint8UintV(v map[uint8]uint, checkNil bool, canChange bool, d *Decoder) (_ map[uint8]uint, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -18699,11 +15105,8 @@ func (_ fastpathT) DecMapUint8UintV(v map[uint8]uint, checkNil bool, canChange b containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[uint8]uint, containerLen) - } else { - v = make(map[uint8]uint) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 9) + v = make(map[uint8]uint, xlen) changed = true } if containerLen > 0 { @@ -18717,23 +15120,19 @@ func (_ fastpathT) DecMapUint8UintV(v map[uint8]uint, checkNil bool, canChange b } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := uint8(dd.DecodeUint(8)) - dd.ReadMapKVSeparator() mv := v[mk] mv = uint(dd.DecodeUint(uintBitsize)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapUint8Uint8R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapUint8Uint8R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[uint8]uint8) v, changed := fastpathTV.DecMapUint8Uint8V(*vp, fastpathCheckNilFalse, true, f.d) @@ -18754,7 +15153,7 @@ func (f fastpathT) DecMapUint8Uint8X(vp *map[uint8]uint8, checkNil bool, d *Deco func (_ fastpathT) DecMapUint8Uint8V(v map[uint8]uint8, checkNil bool, canChange bool, d *Decoder) (_ map[uint8]uint8, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -18764,11 +15163,8 @@ func (_ fastpathT) DecMapUint8Uint8V(v map[uint8]uint8, checkNil bool, canChange containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[uint8]uint8, containerLen) - } else { - v = make(map[uint8]uint8) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 2) + v = make(map[uint8]uint8, xlen) changed = true } if containerLen > 0 { @@ -18782,23 +15178,19 @@ func (_ fastpathT) DecMapUint8Uint8V(v map[uint8]uint8, checkNil bool, canChange } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := uint8(dd.DecodeUint(8)) - dd.ReadMapKVSeparator() mv := v[mk] mv = uint8(dd.DecodeUint(8)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapUint8Uint16R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapUint8Uint16R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[uint8]uint16) v, changed := fastpathTV.DecMapUint8Uint16V(*vp, fastpathCheckNilFalse, true, f.d) @@ -18819,7 +15211,7 @@ func (f fastpathT) DecMapUint8Uint16X(vp *map[uint8]uint16, checkNil bool, d *De func (_ fastpathT) DecMapUint8Uint16V(v map[uint8]uint16, checkNil bool, canChange bool, d *Decoder) (_ map[uint8]uint16, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -18829,11 +15221,8 @@ func (_ fastpathT) DecMapUint8Uint16V(v map[uint8]uint16, checkNil bool, canChan containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[uint8]uint16, containerLen) - } else { - v = make(map[uint8]uint16) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 3) + v = make(map[uint8]uint16, xlen) changed = true } if containerLen > 0 { @@ -18847,23 +15236,19 @@ func (_ fastpathT) DecMapUint8Uint16V(v map[uint8]uint16, checkNil bool, canChan } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := uint8(dd.DecodeUint(8)) - dd.ReadMapKVSeparator() mv := v[mk] mv = uint16(dd.DecodeUint(16)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapUint8Uint32R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapUint8Uint32R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[uint8]uint32) v, changed := fastpathTV.DecMapUint8Uint32V(*vp, fastpathCheckNilFalse, true, f.d) @@ -18884,7 +15269,7 @@ func (f fastpathT) DecMapUint8Uint32X(vp *map[uint8]uint32, checkNil bool, d *De func (_ fastpathT) DecMapUint8Uint32V(v map[uint8]uint32, checkNil bool, canChange bool, d *Decoder) (_ map[uint8]uint32, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -18894,11 +15279,8 @@ func (_ fastpathT) DecMapUint8Uint32V(v map[uint8]uint32, checkNil bool, canChan containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[uint8]uint32, containerLen) - } else { - v = make(map[uint8]uint32) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 5) + v = make(map[uint8]uint32, xlen) changed = true } if containerLen > 0 { @@ -18912,23 +15294,19 @@ func (_ fastpathT) DecMapUint8Uint32V(v map[uint8]uint32, checkNil bool, canChan } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := uint8(dd.DecodeUint(8)) - dd.ReadMapKVSeparator() mv := v[mk] mv = uint32(dd.DecodeUint(32)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapUint8Uint64R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapUint8Uint64R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[uint8]uint64) v, changed := fastpathTV.DecMapUint8Uint64V(*vp, fastpathCheckNilFalse, true, f.d) @@ -18949,7 +15327,7 @@ func (f fastpathT) DecMapUint8Uint64X(vp *map[uint8]uint64, checkNil bool, d *De func (_ fastpathT) DecMapUint8Uint64V(v map[uint8]uint64, checkNil bool, canChange bool, d *Decoder) (_ map[uint8]uint64, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -18959,11 +15337,8 @@ func (_ fastpathT) DecMapUint8Uint64V(v map[uint8]uint64, checkNil bool, canChan containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[uint8]uint64, containerLen) - } else { - v = make(map[uint8]uint64) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 9) + v = make(map[uint8]uint64, xlen) changed = true } if containerLen > 0 { @@ -18977,23 +15352,19 @@ func (_ fastpathT) DecMapUint8Uint64V(v map[uint8]uint64, checkNil bool, canChan } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := uint8(dd.DecodeUint(8)) - dd.ReadMapKVSeparator() mv := v[mk] mv = dd.DecodeUint(64) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapUint8IntR(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapUint8IntR(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[uint8]int) v, changed := fastpathTV.DecMapUint8IntV(*vp, fastpathCheckNilFalse, true, f.d) @@ -19014,7 +15385,7 @@ func (f fastpathT) DecMapUint8IntX(vp *map[uint8]int, checkNil bool, d *Decoder) func (_ fastpathT) DecMapUint8IntV(v map[uint8]int, checkNil bool, canChange bool, d *Decoder) (_ map[uint8]int, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -19024,11 +15395,8 @@ func (_ fastpathT) DecMapUint8IntV(v map[uint8]int, checkNil bool, canChange boo containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[uint8]int, containerLen) - } else { - v = make(map[uint8]int) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 9) + v = make(map[uint8]int, xlen) changed = true } if containerLen > 0 { @@ -19042,23 +15410,19 @@ func (_ fastpathT) DecMapUint8IntV(v map[uint8]int, checkNil bool, canChange boo } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := uint8(dd.DecodeUint(8)) - dd.ReadMapKVSeparator() mv := v[mk] mv = int(dd.DecodeInt(intBitsize)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapUint8Int8R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapUint8Int8R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[uint8]int8) v, changed := fastpathTV.DecMapUint8Int8V(*vp, fastpathCheckNilFalse, true, f.d) @@ -19079,7 +15443,7 @@ func (f fastpathT) DecMapUint8Int8X(vp *map[uint8]int8, checkNil bool, d *Decode func (_ fastpathT) DecMapUint8Int8V(v map[uint8]int8, checkNil bool, canChange bool, d *Decoder) (_ map[uint8]int8, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -19089,11 +15453,8 @@ func (_ fastpathT) DecMapUint8Int8V(v map[uint8]int8, checkNil bool, canChange b containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[uint8]int8, containerLen) - } else { - v = make(map[uint8]int8) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 2) + v = make(map[uint8]int8, xlen) changed = true } if containerLen > 0 { @@ -19107,23 +15468,19 @@ func (_ fastpathT) DecMapUint8Int8V(v map[uint8]int8, checkNil bool, canChange b } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := uint8(dd.DecodeUint(8)) - dd.ReadMapKVSeparator() mv := v[mk] mv = int8(dd.DecodeInt(8)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapUint8Int16R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapUint8Int16R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[uint8]int16) v, changed := fastpathTV.DecMapUint8Int16V(*vp, fastpathCheckNilFalse, true, f.d) @@ -19144,7 +15501,7 @@ func (f fastpathT) DecMapUint8Int16X(vp *map[uint8]int16, checkNil bool, d *Deco func (_ fastpathT) DecMapUint8Int16V(v map[uint8]int16, checkNil bool, canChange bool, d *Decoder) (_ map[uint8]int16, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -19154,11 +15511,8 @@ func (_ fastpathT) DecMapUint8Int16V(v map[uint8]int16, checkNil bool, canChange containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[uint8]int16, containerLen) - } else { - v = make(map[uint8]int16) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 3) + v = make(map[uint8]int16, xlen) changed = true } if containerLen > 0 { @@ -19172,23 +15526,19 @@ func (_ fastpathT) DecMapUint8Int16V(v map[uint8]int16, checkNil bool, canChange } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := uint8(dd.DecodeUint(8)) - dd.ReadMapKVSeparator() mv := v[mk] mv = int16(dd.DecodeInt(16)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapUint8Int32R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapUint8Int32R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[uint8]int32) v, changed := fastpathTV.DecMapUint8Int32V(*vp, fastpathCheckNilFalse, true, f.d) @@ -19209,7 +15559,7 @@ func (f fastpathT) DecMapUint8Int32X(vp *map[uint8]int32, checkNil bool, d *Deco func (_ fastpathT) DecMapUint8Int32V(v map[uint8]int32, checkNil bool, canChange bool, d *Decoder) (_ map[uint8]int32, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -19219,11 +15569,8 @@ func (_ fastpathT) DecMapUint8Int32V(v map[uint8]int32, checkNil bool, canChange containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[uint8]int32, containerLen) - } else { - v = make(map[uint8]int32) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 5) + v = make(map[uint8]int32, xlen) changed = true } if containerLen > 0 { @@ -19237,23 +15584,19 @@ func (_ fastpathT) DecMapUint8Int32V(v map[uint8]int32, checkNil bool, canChange } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := uint8(dd.DecodeUint(8)) - dd.ReadMapKVSeparator() mv := v[mk] mv = int32(dd.DecodeInt(32)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapUint8Int64R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapUint8Int64R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[uint8]int64) v, changed := fastpathTV.DecMapUint8Int64V(*vp, fastpathCheckNilFalse, true, f.d) @@ -19274,7 +15617,7 @@ func (f fastpathT) DecMapUint8Int64X(vp *map[uint8]int64, checkNil bool, d *Deco func (_ fastpathT) DecMapUint8Int64V(v map[uint8]int64, checkNil bool, canChange bool, d *Decoder) (_ map[uint8]int64, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -19284,11 +15627,8 @@ func (_ fastpathT) DecMapUint8Int64V(v map[uint8]int64, checkNil bool, canChange containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[uint8]int64, containerLen) - } else { - v = make(map[uint8]int64) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 9) + v = make(map[uint8]int64, xlen) changed = true } if containerLen > 0 { @@ -19302,23 +15642,19 @@ func (_ fastpathT) DecMapUint8Int64V(v map[uint8]int64, checkNil bool, canChange } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := uint8(dd.DecodeUint(8)) - dd.ReadMapKVSeparator() mv := v[mk] mv = dd.DecodeInt(64) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapUint8Float32R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapUint8Float32R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[uint8]float32) v, changed := fastpathTV.DecMapUint8Float32V(*vp, fastpathCheckNilFalse, true, f.d) @@ -19339,7 +15675,7 @@ func (f fastpathT) DecMapUint8Float32X(vp *map[uint8]float32, checkNil bool, d * func (_ fastpathT) DecMapUint8Float32V(v map[uint8]float32, checkNil bool, canChange bool, d *Decoder) (_ map[uint8]float32, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -19349,11 +15685,8 @@ func (_ fastpathT) DecMapUint8Float32V(v map[uint8]float32, checkNil bool, canCh containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[uint8]float32, containerLen) - } else { - v = make(map[uint8]float32) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 5) + v = make(map[uint8]float32, xlen) changed = true } if containerLen > 0 { @@ -19367,23 +15700,19 @@ func (_ fastpathT) DecMapUint8Float32V(v map[uint8]float32, checkNil bool, canCh } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := uint8(dd.DecodeUint(8)) - dd.ReadMapKVSeparator() mv := v[mk] mv = float32(dd.DecodeFloat(true)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapUint8Float64R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapUint8Float64R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[uint8]float64) v, changed := fastpathTV.DecMapUint8Float64V(*vp, fastpathCheckNilFalse, true, f.d) @@ -19404,7 +15733,7 @@ func (f fastpathT) DecMapUint8Float64X(vp *map[uint8]float64, checkNil bool, d * func (_ fastpathT) DecMapUint8Float64V(v map[uint8]float64, checkNil bool, canChange bool, d *Decoder) (_ map[uint8]float64, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -19414,11 +15743,8 @@ func (_ fastpathT) DecMapUint8Float64V(v map[uint8]float64, checkNil bool, canCh containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[uint8]float64, containerLen) - } else { - v = make(map[uint8]float64) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 9) + v = make(map[uint8]float64, xlen) changed = true } if containerLen > 0 { @@ -19432,23 +15758,19 @@ func (_ fastpathT) DecMapUint8Float64V(v map[uint8]float64, checkNil bool, canCh } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := uint8(dd.DecodeUint(8)) - dd.ReadMapKVSeparator() mv := v[mk] mv = dd.DecodeFloat(false) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapUint8BoolR(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapUint8BoolR(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[uint8]bool) v, changed := fastpathTV.DecMapUint8BoolV(*vp, fastpathCheckNilFalse, true, f.d) @@ -19469,7 +15791,7 @@ func (f fastpathT) DecMapUint8BoolX(vp *map[uint8]bool, checkNil bool, d *Decode func (_ fastpathT) DecMapUint8BoolV(v map[uint8]bool, checkNil bool, canChange bool, d *Decoder) (_ map[uint8]bool, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -19479,11 +15801,8 @@ func (_ fastpathT) DecMapUint8BoolV(v map[uint8]bool, checkNil bool, canChange b containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[uint8]bool, containerLen) - } else { - v = make(map[uint8]bool) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 2) + v = make(map[uint8]bool, xlen) changed = true } if containerLen > 0 { @@ -19497,23 +15816,19 @@ func (_ fastpathT) DecMapUint8BoolV(v map[uint8]bool, checkNil bool, canChange b } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := uint8(dd.DecodeUint(8)) - dd.ReadMapKVSeparator() mv := v[mk] mv = dd.DecodeBool() if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapUint16IntfR(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapUint16IntfR(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[uint16]interface{}) v, changed := fastpathTV.DecMapUint16IntfV(*vp, fastpathCheckNilFalse, true, f.d) @@ -19534,7 +15849,7 @@ func (f fastpathT) DecMapUint16IntfX(vp *map[uint16]interface{}, checkNil bool, func (_ fastpathT) DecMapUint16IntfV(v map[uint16]interface{}, checkNil bool, canChange bool, d *Decoder) (_ map[uint16]interface{}, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -19544,11 +15859,8 @@ func (_ fastpathT) DecMapUint16IntfV(v map[uint16]interface{}, checkNil bool, ca containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[uint16]interface{}, containerLen) - } else { - v = make(map[uint16]interface{}) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 18) + v = make(map[uint16]interface{}, xlen) changed = true } if containerLen > 0 { @@ -19563,11 +15875,7 @@ func (_ fastpathT) DecMapUint16IntfV(v map[uint16]interface{}, checkNil bool, ca } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := uint16(dd.DecodeUint(16)) - dd.ReadMapKVSeparator() mv := v[mk] d.decode(&mv) @@ -19575,12 +15883,12 @@ func (_ fastpathT) DecMapUint16IntfV(v map[uint16]interface{}, checkNil bool, ca v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapUint16StringR(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapUint16StringR(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[uint16]string) v, changed := fastpathTV.DecMapUint16StringV(*vp, fastpathCheckNilFalse, true, f.d) @@ -19601,7 +15909,7 @@ func (f fastpathT) DecMapUint16StringX(vp *map[uint16]string, checkNil bool, d * func (_ fastpathT) DecMapUint16StringV(v map[uint16]string, checkNil bool, canChange bool, d *Decoder) (_ map[uint16]string, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -19611,11 +15919,8 @@ func (_ fastpathT) DecMapUint16StringV(v map[uint16]string, checkNil bool, canCh containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[uint16]string, containerLen) - } else { - v = make(map[uint16]string) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 18) + v = make(map[uint16]string, xlen) changed = true } if containerLen > 0 { @@ -19629,23 +15934,19 @@ func (_ fastpathT) DecMapUint16StringV(v map[uint16]string, checkNil bool, canCh } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := uint16(dd.DecodeUint(16)) - dd.ReadMapKVSeparator() mv := v[mk] mv = dd.DecodeString() if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapUint16UintR(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapUint16UintR(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[uint16]uint) v, changed := fastpathTV.DecMapUint16UintV(*vp, fastpathCheckNilFalse, true, f.d) @@ -19666,7 +15967,7 @@ func (f fastpathT) DecMapUint16UintX(vp *map[uint16]uint, checkNil bool, d *Deco func (_ fastpathT) DecMapUint16UintV(v map[uint16]uint, checkNil bool, canChange bool, d *Decoder) (_ map[uint16]uint, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -19676,11 +15977,8 @@ func (_ fastpathT) DecMapUint16UintV(v map[uint16]uint, checkNil bool, canChange containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[uint16]uint, containerLen) - } else { - v = make(map[uint16]uint) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 10) + v = make(map[uint16]uint, xlen) changed = true } if containerLen > 0 { @@ -19694,23 +15992,19 @@ func (_ fastpathT) DecMapUint16UintV(v map[uint16]uint, checkNil bool, canChange } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := uint16(dd.DecodeUint(16)) - dd.ReadMapKVSeparator() mv := v[mk] mv = uint(dd.DecodeUint(uintBitsize)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapUint16Uint8R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapUint16Uint8R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[uint16]uint8) v, changed := fastpathTV.DecMapUint16Uint8V(*vp, fastpathCheckNilFalse, true, f.d) @@ -19731,7 +16025,7 @@ func (f fastpathT) DecMapUint16Uint8X(vp *map[uint16]uint8, checkNil bool, d *De func (_ fastpathT) DecMapUint16Uint8V(v map[uint16]uint8, checkNil bool, canChange bool, d *Decoder) (_ map[uint16]uint8, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -19741,11 +16035,8 @@ func (_ fastpathT) DecMapUint16Uint8V(v map[uint16]uint8, checkNil bool, canChan containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[uint16]uint8, containerLen) - } else { - v = make(map[uint16]uint8) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 3) + v = make(map[uint16]uint8, xlen) changed = true } if containerLen > 0 { @@ -19759,23 +16050,19 @@ func (_ fastpathT) DecMapUint16Uint8V(v map[uint16]uint8, checkNil bool, canChan } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := uint16(dd.DecodeUint(16)) - dd.ReadMapKVSeparator() mv := v[mk] mv = uint8(dd.DecodeUint(8)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapUint16Uint16R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapUint16Uint16R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[uint16]uint16) v, changed := fastpathTV.DecMapUint16Uint16V(*vp, fastpathCheckNilFalse, true, f.d) @@ -19796,7 +16083,7 @@ func (f fastpathT) DecMapUint16Uint16X(vp *map[uint16]uint16, checkNil bool, d * func (_ fastpathT) DecMapUint16Uint16V(v map[uint16]uint16, checkNil bool, canChange bool, d *Decoder) (_ map[uint16]uint16, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -19806,11 +16093,8 @@ func (_ fastpathT) DecMapUint16Uint16V(v map[uint16]uint16, checkNil bool, canCh containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[uint16]uint16, containerLen) - } else { - v = make(map[uint16]uint16) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 4) + v = make(map[uint16]uint16, xlen) changed = true } if containerLen > 0 { @@ -19824,23 +16108,19 @@ func (_ fastpathT) DecMapUint16Uint16V(v map[uint16]uint16, checkNil bool, canCh } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := uint16(dd.DecodeUint(16)) - dd.ReadMapKVSeparator() mv := v[mk] mv = uint16(dd.DecodeUint(16)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapUint16Uint32R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapUint16Uint32R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[uint16]uint32) v, changed := fastpathTV.DecMapUint16Uint32V(*vp, fastpathCheckNilFalse, true, f.d) @@ -19861,7 +16141,7 @@ func (f fastpathT) DecMapUint16Uint32X(vp *map[uint16]uint32, checkNil bool, d * func (_ fastpathT) DecMapUint16Uint32V(v map[uint16]uint32, checkNil bool, canChange bool, d *Decoder) (_ map[uint16]uint32, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -19871,11 +16151,8 @@ func (_ fastpathT) DecMapUint16Uint32V(v map[uint16]uint32, checkNil bool, canCh containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[uint16]uint32, containerLen) - } else { - v = make(map[uint16]uint32) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 6) + v = make(map[uint16]uint32, xlen) changed = true } if containerLen > 0 { @@ -19889,23 +16166,19 @@ func (_ fastpathT) DecMapUint16Uint32V(v map[uint16]uint32, checkNil bool, canCh } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := uint16(dd.DecodeUint(16)) - dd.ReadMapKVSeparator() mv := v[mk] mv = uint32(dd.DecodeUint(32)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapUint16Uint64R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapUint16Uint64R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[uint16]uint64) v, changed := fastpathTV.DecMapUint16Uint64V(*vp, fastpathCheckNilFalse, true, f.d) @@ -19926,7 +16199,7 @@ func (f fastpathT) DecMapUint16Uint64X(vp *map[uint16]uint64, checkNil bool, d * func (_ fastpathT) DecMapUint16Uint64V(v map[uint16]uint64, checkNil bool, canChange bool, d *Decoder) (_ map[uint16]uint64, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -19936,11 +16209,8 @@ func (_ fastpathT) DecMapUint16Uint64V(v map[uint16]uint64, checkNil bool, canCh containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[uint16]uint64, containerLen) - } else { - v = make(map[uint16]uint64) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 10) + v = make(map[uint16]uint64, xlen) changed = true } if containerLen > 0 { @@ -19954,23 +16224,19 @@ func (_ fastpathT) DecMapUint16Uint64V(v map[uint16]uint64, checkNil bool, canCh } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := uint16(dd.DecodeUint(16)) - dd.ReadMapKVSeparator() mv := v[mk] mv = dd.DecodeUint(64) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapUint16IntR(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapUint16IntR(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[uint16]int) v, changed := fastpathTV.DecMapUint16IntV(*vp, fastpathCheckNilFalse, true, f.d) @@ -19991,7 +16257,7 @@ func (f fastpathT) DecMapUint16IntX(vp *map[uint16]int, checkNil bool, d *Decode func (_ fastpathT) DecMapUint16IntV(v map[uint16]int, checkNil bool, canChange bool, d *Decoder) (_ map[uint16]int, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -20001,11 +16267,8 @@ func (_ fastpathT) DecMapUint16IntV(v map[uint16]int, checkNil bool, canChange b containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[uint16]int, containerLen) - } else { - v = make(map[uint16]int) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 10) + v = make(map[uint16]int, xlen) changed = true } if containerLen > 0 { @@ -20019,23 +16282,19 @@ func (_ fastpathT) DecMapUint16IntV(v map[uint16]int, checkNil bool, canChange b } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := uint16(dd.DecodeUint(16)) - dd.ReadMapKVSeparator() mv := v[mk] mv = int(dd.DecodeInt(intBitsize)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapUint16Int8R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapUint16Int8R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[uint16]int8) v, changed := fastpathTV.DecMapUint16Int8V(*vp, fastpathCheckNilFalse, true, f.d) @@ -20056,7 +16315,7 @@ func (f fastpathT) DecMapUint16Int8X(vp *map[uint16]int8, checkNil bool, d *Deco func (_ fastpathT) DecMapUint16Int8V(v map[uint16]int8, checkNil bool, canChange bool, d *Decoder) (_ map[uint16]int8, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -20066,11 +16325,8 @@ func (_ fastpathT) DecMapUint16Int8V(v map[uint16]int8, checkNil bool, canChange containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[uint16]int8, containerLen) - } else { - v = make(map[uint16]int8) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 3) + v = make(map[uint16]int8, xlen) changed = true } if containerLen > 0 { @@ -20084,23 +16340,19 @@ func (_ fastpathT) DecMapUint16Int8V(v map[uint16]int8, checkNil bool, canChange } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := uint16(dd.DecodeUint(16)) - dd.ReadMapKVSeparator() mv := v[mk] mv = int8(dd.DecodeInt(8)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapUint16Int16R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapUint16Int16R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[uint16]int16) v, changed := fastpathTV.DecMapUint16Int16V(*vp, fastpathCheckNilFalse, true, f.d) @@ -20121,7 +16373,7 @@ func (f fastpathT) DecMapUint16Int16X(vp *map[uint16]int16, checkNil bool, d *De func (_ fastpathT) DecMapUint16Int16V(v map[uint16]int16, checkNil bool, canChange bool, d *Decoder) (_ map[uint16]int16, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -20131,11 +16383,8 @@ func (_ fastpathT) DecMapUint16Int16V(v map[uint16]int16, checkNil bool, canChan containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[uint16]int16, containerLen) - } else { - v = make(map[uint16]int16) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 4) + v = make(map[uint16]int16, xlen) changed = true } if containerLen > 0 { @@ -20149,23 +16398,19 @@ func (_ fastpathT) DecMapUint16Int16V(v map[uint16]int16, checkNil bool, canChan } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := uint16(dd.DecodeUint(16)) - dd.ReadMapKVSeparator() mv := v[mk] mv = int16(dd.DecodeInt(16)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapUint16Int32R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapUint16Int32R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[uint16]int32) v, changed := fastpathTV.DecMapUint16Int32V(*vp, fastpathCheckNilFalse, true, f.d) @@ -20186,7 +16431,7 @@ func (f fastpathT) DecMapUint16Int32X(vp *map[uint16]int32, checkNil bool, d *De func (_ fastpathT) DecMapUint16Int32V(v map[uint16]int32, checkNil bool, canChange bool, d *Decoder) (_ map[uint16]int32, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -20196,11 +16441,8 @@ func (_ fastpathT) DecMapUint16Int32V(v map[uint16]int32, checkNil bool, canChan containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[uint16]int32, containerLen) - } else { - v = make(map[uint16]int32) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 6) + v = make(map[uint16]int32, xlen) changed = true } if containerLen > 0 { @@ -20214,23 +16456,19 @@ func (_ fastpathT) DecMapUint16Int32V(v map[uint16]int32, checkNil bool, canChan } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := uint16(dd.DecodeUint(16)) - dd.ReadMapKVSeparator() mv := v[mk] mv = int32(dd.DecodeInt(32)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapUint16Int64R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapUint16Int64R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[uint16]int64) v, changed := fastpathTV.DecMapUint16Int64V(*vp, fastpathCheckNilFalse, true, f.d) @@ -20251,7 +16489,7 @@ func (f fastpathT) DecMapUint16Int64X(vp *map[uint16]int64, checkNil bool, d *De func (_ fastpathT) DecMapUint16Int64V(v map[uint16]int64, checkNil bool, canChange bool, d *Decoder) (_ map[uint16]int64, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -20261,11 +16499,8 @@ func (_ fastpathT) DecMapUint16Int64V(v map[uint16]int64, checkNil bool, canChan containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[uint16]int64, containerLen) - } else { - v = make(map[uint16]int64) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 10) + v = make(map[uint16]int64, xlen) changed = true } if containerLen > 0 { @@ -20279,23 +16514,19 @@ func (_ fastpathT) DecMapUint16Int64V(v map[uint16]int64, checkNil bool, canChan } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := uint16(dd.DecodeUint(16)) - dd.ReadMapKVSeparator() mv := v[mk] mv = dd.DecodeInt(64) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapUint16Float32R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapUint16Float32R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[uint16]float32) v, changed := fastpathTV.DecMapUint16Float32V(*vp, fastpathCheckNilFalse, true, f.d) @@ -20316,7 +16547,7 @@ func (f fastpathT) DecMapUint16Float32X(vp *map[uint16]float32, checkNil bool, d func (_ fastpathT) DecMapUint16Float32V(v map[uint16]float32, checkNil bool, canChange bool, d *Decoder) (_ map[uint16]float32, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -20326,11 +16557,8 @@ func (_ fastpathT) DecMapUint16Float32V(v map[uint16]float32, checkNil bool, can containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[uint16]float32, containerLen) - } else { - v = make(map[uint16]float32) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 6) + v = make(map[uint16]float32, xlen) changed = true } if containerLen > 0 { @@ -20344,23 +16572,19 @@ func (_ fastpathT) DecMapUint16Float32V(v map[uint16]float32, checkNil bool, can } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := uint16(dd.DecodeUint(16)) - dd.ReadMapKVSeparator() mv := v[mk] mv = float32(dd.DecodeFloat(true)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapUint16Float64R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapUint16Float64R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[uint16]float64) v, changed := fastpathTV.DecMapUint16Float64V(*vp, fastpathCheckNilFalse, true, f.d) @@ -20381,7 +16605,7 @@ func (f fastpathT) DecMapUint16Float64X(vp *map[uint16]float64, checkNil bool, d func (_ fastpathT) DecMapUint16Float64V(v map[uint16]float64, checkNil bool, canChange bool, d *Decoder) (_ map[uint16]float64, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -20391,11 +16615,8 @@ func (_ fastpathT) DecMapUint16Float64V(v map[uint16]float64, checkNil bool, can containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[uint16]float64, containerLen) - } else { - v = make(map[uint16]float64) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 10) + v = make(map[uint16]float64, xlen) changed = true } if containerLen > 0 { @@ -20409,23 +16630,19 @@ func (_ fastpathT) DecMapUint16Float64V(v map[uint16]float64, checkNil bool, can } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := uint16(dd.DecodeUint(16)) - dd.ReadMapKVSeparator() mv := v[mk] mv = dd.DecodeFloat(false) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapUint16BoolR(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapUint16BoolR(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[uint16]bool) v, changed := fastpathTV.DecMapUint16BoolV(*vp, fastpathCheckNilFalse, true, f.d) @@ -20446,7 +16663,7 @@ func (f fastpathT) DecMapUint16BoolX(vp *map[uint16]bool, checkNil bool, d *Deco func (_ fastpathT) DecMapUint16BoolV(v map[uint16]bool, checkNil bool, canChange bool, d *Decoder) (_ map[uint16]bool, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -20456,11 +16673,8 @@ func (_ fastpathT) DecMapUint16BoolV(v map[uint16]bool, checkNil bool, canChange containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[uint16]bool, containerLen) - } else { - v = make(map[uint16]bool) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 3) + v = make(map[uint16]bool, xlen) changed = true } if containerLen > 0 { @@ -20474,23 +16688,19 @@ func (_ fastpathT) DecMapUint16BoolV(v map[uint16]bool, checkNil bool, canChange } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := uint16(dd.DecodeUint(16)) - dd.ReadMapKVSeparator() mv := v[mk] mv = dd.DecodeBool() if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapUint32IntfR(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapUint32IntfR(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[uint32]interface{}) v, changed := fastpathTV.DecMapUint32IntfV(*vp, fastpathCheckNilFalse, true, f.d) @@ -20511,7 +16721,7 @@ func (f fastpathT) DecMapUint32IntfX(vp *map[uint32]interface{}, checkNil bool, func (_ fastpathT) DecMapUint32IntfV(v map[uint32]interface{}, checkNil bool, canChange bool, d *Decoder) (_ map[uint32]interface{}, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -20521,11 +16731,8 @@ func (_ fastpathT) DecMapUint32IntfV(v map[uint32]interface{}, checkNil bool, ca containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[uint32]interface{}, containerLen) - } else { - v = make(map[uint32]interface{}) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 20) + v = make(map[uint32]interface{}, xlen) changed = true } if containerLen > 0 { @@ -20540,11 +16747,7 @@ func (_ fastpathT) DecMapUint32IntfV(v map[uint32]interface{}, checkNil bool, ca } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := uint32(dd.DecodeUint(32)) - dd.ReadMapKVSeparator() mv := v[mk] d.decode(&mv) @@ -20552,12 +16755,12 @@ func (_ fastpathT) DecMapUint32IntfV(v map[uint32]interface{}, checkNil bool, ca v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapUint32StringR(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapUint32StringR(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[uint32]string) v, changed := fastpathTV.DecMapUint32StringV(*vp, fastpathCheckNilFalse, true, f.d) @@ -20578,7 +16781,7 @@ func (f fastpathT) DecMapUint32StringX(vp *map[uint32]string, checkNil bool, d * func (_ fastpathT) DecMapUint32StringV(v map[uint32]string, checkNil bool, canChange bool, d *Decoder) (_ map[uint32]string, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -20588,11 +16791,8 @@ func (_ fastpathT) DecMapUint32StringV(v map[uint32]string, checkNil bool, canCh containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[uint32]string, containerLen) - } else { - v = make(map[uint32]string) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 20) + v = make(map[uint32]string, xlen) changed = true } if containerLen > 0 { @@ -20606,23 +16806,19 @@ func (_ fastpathT) DecMapUint32StringV(v map[uint32]string, checkNil bool, canCh } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := uint32(dd.DecodeUint(32)) - dd.ReadMapKVSeparator() mv := v[mk] mv = dd.DecodeString() if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapUint32UintR(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapUint32UintR(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[uint32]uint) v, changed := fastpathTV.DecMapUint32UintV(*vp, fastpathCheckNilFalse, true, f.d) @@ -20643,7 +16839,7 @@ func (f fastpathT) DecMapUint32UintX(vp *map[uint32]uint, checkNil bool, d *Deco func (_ fastpathT) DecMapUint32UintV(v map[uint32]uint, checkNil bool, canChange bool, d *Decoder) (_ map[uint32]uint, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -20653,11 +16849,8 @@ func (_ fastpathT) DecMapUint32UintV(v map[uint32]uint, checkNil bool, canChange containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[uint32]uint, containerLen) - } else { - v = make(map[uint32]uint) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 12) + v = make(map[uint32]uint, xlen) changed = true } if containerLen > 0 { @@ -20671,23 +16864,19 @@ func (_ fastpathT) DecMapUint32UintV(v map[uint32]uint, checkNil bool, canChange } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := uint32(dd.DecodeUint(32)) - dd.ReadMapKVSeparator() mv := v[mk] mv = uint(dd.DecodeUint(uintBitsize)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapUint32Uint8R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapUint32Uint8R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[uint32]uint8) v, changed := fastpathTV.DecMapUint32Uint8V(*vp, fastpathCheckNilFalse, true, f.d) @@ -20708,7 +16897,7 @@ func (f fastpathT) DecMapUint32Uint8X(vp *map[uint32]uint8, checkNil bool, d *De func (_ fastpathT) DecMapUint32Uint8V(v map[uint32]uint8, checkNil bool, canChange bool, d *Decoder) (_ map[uint32]uint8, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -20718,11 +16907,8 @@ func (_ fastpathT) DecMapUint32Uint8V(v map[uint32]uint8, checkNil bool, canChan containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[uint32]uint8, containerLen) - } else { - v = make(map[uint32]uint8) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 5) + v = make(map[uint32]uint8, xlen) changed = true } if containerLen > 0 { @@ -20736,23 +16922,19 @@ func (_ fastpathT) DecMapUint32Uint8V(v map[uint32]uint8, checkNil bool, canChan } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := uint32(dd.DecodeUint(32)) - dd.ReadMapKVSeparator() mv := v[mk] mv = uint8(dd.DecodeUint(8)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapUint32Uint16R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapUint32Uint16R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[uint32]uint16) v, changed := fastpathTV.DecMapUint32Uint16V(*vp, fastpathCheckNilFalse, true, f.d) @@ -20773,7 +16955,7 @@ func (f fastpathT) DecMapUint32Uint16X(vp *map[uint32]uint16, checkNil bool, d * func (_ fastpathT) DecMapUint32Uint16V(v map[uint32]uint16, checkNil bool, canChange bool, d *Decoder) (_ map[uint32]uint16, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -20783,11 +16965,8 @@ func (_ fastpathT) DecMapUint32Uint16V(v map[uint32]uint16, checkNil bool, canCh containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[uint32]uint16, containerLen) - } else { - v = make(map[uint32]uint16) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 6) + v = make(map[uint32]uint16, xlen) changed = true } if containerLen > 0 { @@ -20801,23 +16980,19 @@ func (_ fastpathT) DecMapUint32Uint16V(v map[uint32]uint16, checkNil bool, canCh } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := uint32(dd.DecodeUint(32)) - dd.ReadMapKVSeparator() mv := v[mk] mv = uint16(dd.DecodeUint(16)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapUint32Uint32R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapUint32Uint32R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[uint32]uint32) v, changed := fastpathTV.DecMapUint32Uint32V(*vp, fastpathCheckNilFalse, true, f.d) @@ -20838,7 +17013,7 @@ func (f fastpathT) DecMapUint32Uint32X(vp *map[uint32]uint32, checkNil bool, d * func (_ fastpathT) DecMapUint32Uint32V(v map[uint32]uint32, checkNil bool, canChange bool, d *Decoder) (_ map[uint32]uint32, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -20848,11 +17023,8 @@ func (_ fastpathT) DecMapUint32Uint32V(v map[uint32]uint32, checkNil bool, canCh containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[uint32]uint32, containerLen) - } else { - v = make(map[uint32]uint32) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 8) + v = make(map[uint32]uint32, xlen) changed = true } if containerLen > 0 { @@ -20866,23 +17038,19 @@ func (_ fastpathT) DecMapUint32Uint32V(v map[uint32]uint32, checkNil bool, canCh } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := uint32(dd.DecodeUint(32)) - dd.ReadMapKVSeparator() mv := v[mk] mv = uint32(dd.DecodeUint(32)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapUint32Uint64R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapUint32Uint64R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[uint32]uint64) v, changed := fastpathTV.DecMapUint32Uint64V(*vp, fastpathCheckNilFalse, true, f.d) @@ -20903,7 +17071,7 @@ func (f fastpathT) DecMapUint32Uint64X(vp *map[uint32]uint64, checkNil bool, d * func (_ fastpathT) DecMapUint32Uint64V(v map[uint32]uint64, checkNil bool, canChange bool, d *Decoder) (_ map[uint32]uint64, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -20913,11 +17081,8 @@ func (_ fastpathT) DecMapUint32Uint64V(v map[uint32]uint64, checkNil bool, canCh containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[uint32]uint64, containerLen) - } else { - v = make(map[uint32]uint64) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 12) + v = make(map[uint32]uint64, xlen) changed = true } if containerLen > 0 { @@ -20931,23 +17096,19 @@ func (_ fastpathT) DecMapUint32Uint64V(v map[uint32]uint64, checkNil bool, canCh } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := uint32(dd.DecodeUint(32)) - dd.ReadMapKVSeparator() mv := v[mk] mv = dd.DecodeUint(64) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapUint32IntR(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapUint32IntR(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[uint32]int) v, changed := fastpathTV.DecMapUint32IntV(*vp, fastpathCheckNilFalse, true, f.d) @@ -20968,7 +17129,7 @@ func (f fastpathT) DecMapUint32IntX(vp *map[uint32]int, checkNil bool, d *Decode func (_ fastpathT) DecMapUint32IntV(v map[uint32]int, checkNil bool, canChange bool, d *Decoder) (_ map[uint32]int, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -20978,11 +17139,8 @@ func (_ fastpathT) DecMapUint32IntV(v map[uint32]int, checkNil bool, canChange b containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[uint32]int, containerLen) - } else { - v = make(map[uint32]int) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 12) + v = make(map[uint32]int, xlen) changed = true } if containerLen > 0 { @@ -20996,23 +17154,19 @@ func (_ fastpathT) DecMapUint32IntV(v map[uint32]int, checkNil bool, canChange b } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := uint32(dd.DecodeUint(32)) - dd.ReadMapKVSeparator() mv := v[mk] mv = int(dd.DecodeInt(intBitsize)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapUint32Int8R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapUint32Int8R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[uint32]int8) v, changed := fastpathTV.DecMapUint32Int8V(*vp, fastpathCheckNilFalse, true, f.d) @@ -21033,7 +17187,7 @@ func (f fastpathT) DecMapUint32Int8X(vp *map[uint32]int8, checkNil bool, d *Deco func (_ fastpathT) DecMapUint32Int8V(v map[uint32]int8, checkNil bool, canChange bool, d *Decoder) (_ map[uint32]int8, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -21043,11 +17197,8 @@ func (_ fastpathT) DecMapUint32Int8V(v map[uint32]int8, checkNil bool, canChange containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[uint32]int8, containerLen) - } else { - v = make(map[uint32]int8) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 5) + v = make(map[uint32]int8, xlen) changed = true } if containerLen > 0 { @@ -21061,23 +17212,19 @@ func (_ fastpathT) DecMapUint32Int8V(v map[uint32]int8, checkNil bool, canChange } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := uint32(dd.DecodeUint(32)) - dd.ReadMapKVSeparator() mv := v[mk] mv = int8(dd.DecodeInt(8)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapUint32Int16R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapUint32Int16R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[uint32]int16) v, changed := fastpathTV.DecMapUint32Int16V(*vp, fastpathCheckNilFalse, true, f.d) @@ -21098,7 +17245,7 @@ func (f fastpathT) DecMapUint32Int16X(vp *map[uint32]int16, checkNil bool, d *De func (_ fastpathT) DecMapUint32Int16V(v map[uint32]int16, checkNil bool, canChange bool, d *Decoder) (_ map[uint32]int16, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -21108,11 +17255,8 @@ func (_ fastpathT) DecMapUint32Int16V(v map[uint32]int16, checkNil bool, canChan containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[uint32]int16, containerLen) - } else { - v = make(map[uint32]int16) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 6) + v = make(map[uint32]int16, xlen) changed = true } if containerLen > 0 { @@ -21126,23 +17270,19 @@ func (_ fastpathT) DecMapUint32Int16V(v map[uint32]int16, checkNil bool, canChan } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := uint32(dd.DecodeUint(32)) - dd.ReadMapKVSeparator() mv := v[mk] mv = int16(dd.DecodeInt(16)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapUint32Int32R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapUint32Int32R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[uint32]int32) v, changed := fastpathTV.DecMapUint32Int32V(*vp, fastpathCheckNilFalse, true, f.d) @@ -21163,7 +17303,7 @@ func (f fastpathT) DecMapUint32Int32X(vp *map[uint32]int32, checkNil bool, d *De func (_ fastpathT) DecMapUint32Int32V(v map[uint32]int32, checkNil bool, canChange bool, d *Decoder) (_ map[uint32]int32, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -21173,11 +17313,8 @@ func (_ fastpathT) DecMapUint32Int32V(v map[uint32]int32, checkNil bool, canChan containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[uint32]int32, containerLen) - } else { - v = make(map[uint32]int32) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 8) + v = make(map[uint32]int32, xlen) changed = true } if containerLen > 0 { @@ -21191,23 +17328,19 @@ func (_ fastpathT) DecMapUint32Int32V(v map[uint32]int32, checkNil bool, canChan } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := uint32(dd.DecodeUint(32)) - dd.ReadMapKVSeparator() mv := v[mk] mv = int32(dd.DecodeInt(32)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapUint32Int64R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapUint32Int64R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[uint32]int64) v, changed := fastpathTV.DecMapUint32Int64V(*vp, fastpathCheckNilFalse, true, f.d) @@ -21228,7 +17361,7 @@ func (f fastpathT) DecMapUint32Int64X(vp *map[uint32]int64, checkNil bool, d *De func (_ fastpathT) DecMapUint32Int64V(v map[uint32]int64, checkNil bool, canChange bool, d *Decoder) (_ map[uint32]int64, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -21238,11 +17371,8 @@ func (_ fastpathT) DecMapUint32Int64V(v map[uint32]int64, checkNil bool, canChan containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[uint32]int64, containerLen) - } else { - v = make(map[uint32]int64) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 12) + v = make(map[uint32]int64, xlen) changed = true } if containerLen > 0 { @@ -21256,23 +17386,19 @@ func (_ fastpathT) DecMapUint32Int64V(v map[uint32]int64, checkNil bool, canChan } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := uint32(dd.DecodeUint(32)) - dd.ReadMapKVSeparator() mv := v[mk] mv = dd.DecodeInt(64) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapUint32Float32R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapUint32Float32R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[uint32]float32) v, changed := fastpathTV.DecMapUint32Float32V(*vp, fastpathCheckNilFalse, true, f.d) @@ -21293,7 +17419,7 @@ func (f fastpathT) DecMapUint32Float32X(vp *map[uint32]float32, checkNil bool, d func (_ fastpathT) DecMapUint32Float32V(v map[uint32]float32, checkNil bool, canChange bool, d *Decoder) (_ map[uint32]float32, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -21303,11 +17429,8 @@ func (_ fastpathT) DecMapUint32Float32V(v map[uint32]float32, checkNil bool, can containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[uint32]float32, containerLen) - } else { - v = make(map[uint32]float32) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 8) + v = make(map[uint32]float32, xlen) changed = true } if containerLen > 0 { @@ -21321,23 +17444,19 @@ func (_ fastpathT) DecMapUint32Float32V(v map[uint32]float32, checkNil bool, can } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := uint32(dd.DecodeUint(32)) - dd.ReadMapKVSeparator() mv := v[mk] mv = float32(dd.DecodeFloat(true)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapUint32Float64R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapUint32Float64R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[uint32]float64) v, changed := fastpathTV.DecMapUint32Float64V(*vp, fastpathCheckNilFalse, true, f.d) @@ -21358,7 +17477,7 @@ func (f fastpathT) DecMapUint32Float64X(vp *map[uint32]float64, checkNil bool, d func (_ fastpathT) DecMapUint32Float64V(v map[uint32]float64, checkNil bool, canChange bool, d *Decoder) (_ map[uint32]float64, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -21368,11 +17487,8 @@ func (_ fastpathT) DecMapUint32Float64V(v map[uint32]float64, checkNil bool, can containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[uint32]float64, containerLen) - } else { - v = make(map[uint32]float64) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 12) + v = make(map[uint32]float64, xlen) changed = true } if containerLen > 0 { @@ -21386,23 +17502,19 @@ func (_ fastpathT) DecMapUint32Float64V(v map[uint32]float64, checkNil bool, can } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := uint32(dd.DecodeUint(32)) - dd.ReadMapKVSeparator() mv := v[mk] mv = dd.DecodeFloat(false) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapUint32BoolR(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapUint32BoolR(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[uint32]bool) v, changed := fastpathTV.DecMapUint32BoolV(*vp, fastpathCheckNilFalse, true, f.d) @@ -21423,7 +17535,7 @@ func (f fastpathT) DecMapUint32BoolX(vp *map[uint32]bool, checkNil bool, d *Deco func (_ fastpathT) DecMapUint32BoolV(v map[uint32]bool, checkNil bool, canChange bool, d *Decoder) (_ map[uint32]bool, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -21433,11 +17545,8 @@ func (_ fastpathT) DecMapUint32BoolV(v map[uint32]bool, checkNil bool, canChange containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[uint32]bool, containerLen) - } else { - v = make(map[uint32]bool) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 5) + v = make(map[uint32]bool, xlen) changed = true } if containerLen > 0 { @@ -21451,23 +17560,19 @@ func (_ fastpathT) DecMapUint32BoolV(v map[uint32]bool, checkNil bool, canChange } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := uint32(dd.DecodeUint(32)) - dd.ReadMapKVSeparator() mv := v[mk] mv = dd.DecodeBool() if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapUint64IntfR(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapUint64IntfR(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[uint64]interface{}) v, changed := fastpathTV.DecMapUint64IntfV(*vp, fastpathCheckNilFalse, true, f.d) @@ -21488,7 +17593,7 @@ func (f fastpathT) DecMapUint64IntfX(vp *map[uint64]interface{}, checkNil bool, func (_ fastpathT) DecMapUint64IntfV(v map[uint64]interface{}, checkNil bool, canChange bool, d *Decoder) (_ map[uint64]interface{}, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -21498,11 +17603,8 @@ func (_ fastpathT) DecMapUint64IntfV(v map[uint64]interface{}, checkNil bool, ca containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[uint64]interface{}, containerLen) - } else { - v = make(map[uint64]interface{}) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 24) + v = make(map[uint64]interface{}, xlen) changed = true } if containerLen > 0 { @@ -21517,11 +17619,7 @@ func (_ fastpathT) DecMapUint64IntfV(v map[uint64]interface{}, checkNil bool, ca } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := dd.DecodeUint(64) - dd.ReadMapKVSeparator() mv := v[mk] d.decode(&mv) @@ -21529,12 +17627,12 @@ func (_ fastpathT) DecMapUint64IntfV(v map[uint64]interface{}, checkNil bool, ca v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapUint64StringR(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapUint64StringR(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[uint64]string) v, changed := fastpathTV.DecMapUint64StringV(*vp, fastpathCheckNilFalse, true, f.d) @@ -21555,7 +17653,7 @@ func (f fastpathT) DecMapUint64StringX(vp *map[uint64]string, checkNil bool, d * func (_ fastpathT) DecMapUint64StringV(v map[uint64]string, checkNil bool, canChange bool, d *Decoder) (_ map[uint64]string, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -21565,11 +17663,8 @@ func (_ fastpathT) DecMapUint64StringV(v map[uint64]string, checkNil bool, canCh containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[uint64]string, containerLen) - } else { - v = make(map[uint64]string) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 24) + v = make(map[uint64]string, xlen) changed = true } if containerLen > 0 { @@ -21583,23 +17678,19 @@ func (_ fastpathT) DecMapUint64StringV(v map[uint64]string, checkNil bool, canCh } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := dd.DecodeUint(64) - dd.ReadMapKVSeparator() mv := v[mk] mv = dd.DecodeString() if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapUint64UintR(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapUint64UintR(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[uint64]uint) v, changed := fastpathTV.DecMapUint64UintV(*vp, fastpathCheckNilFalse, true, f.d) @@ -21620,7 +17711,7 @@ func (f fastpathT) DecMapUint64UintX(vp *map[uint64]uint, checkNil bool, d *Deco func (_ fastpathT) DecMapUint64UintV(v map[uint64]uint, checkNil bool, canChange bool, d *Decoder) (_ map[uint64]uint, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -21630,11 +17721,8 @@ func (_ fastpathT) DecMapUint64UintV(v map[uint64]uint, checkNil bool, canChange containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[uint64]uint, containerLen) - } else { - v = make(map[uint64]uint) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 16) + v = make(map[uint64]uint, xlen) changed = true } if containerLen > 0 { @@ -21648,23 +17736,19 @@ func (_ fastpathT) DecMapUint64UintV(v map[uint64]uint, checkNil bool, canChange } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := dd.DecodeUint(64) - dd.ReadMapKVSeparator() mv := v[mk] mv = uint(dd.DecodeUint(uintBitsize)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapUint64Uint8R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapUint64Uint8R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[uint64]uint8) v, changed := fastpathTV.DecMapUint64Uint8V(*vp, fastpathCheckNilFalse, true, f.d) @@ -21685,7 +17769,7 @@ func (f fastpathT) DecMapUint64Uint8X(vp *map[uint64]uint8, checkNil bool, d *De func (_ fastpathT) DecMapUint64Uint8V(v map[uint64]uint8, checkNil bool, canChange bool, d *Decoder) (_ map[uint64]uint8, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -21695,11 +17779,8 @@ func (_ fastpathT) DecMapUint64Uint8V(v map[uint64]uint8, checkNil bool, canChan containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[uint64]uint8, containerLen) - } else { - v = make(map[uint64]uint8) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 9) + v = make(map[uint64]uint8, xlen) changed = true } if containerLen > 0 { @@ -21713,23 +17794,19 @@ func (_ fastpathT) DecMapUint64Uint8V(v map[uint64]uint8, checkNil bool, canChan } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := dd.DecodeUint(64) - dd.ReadMapKVSeparator() mv := v[mk] mv = uint8(dd.DecodeUint(8)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapUint64Uint16R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapUint64Uint16R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[uint64]uint16) v, changed := fastpathTV.DecMapUint64Uint16V(*vp, fastpathCheckNilFalse, true, f.d) @@ -21750,7 +17827,7 @@ func (f fastpathT) DecMapUint64Uint16X(vp *map[uint64]uint16, checkNil bool, d * func (_ fastpathT) DecMapUint64Uint16V(v map[uint64]uint16, checkNil bool, canChange bool, d *Decoder) (_ map[uint64]uint16, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -21760,11 +17837,8 @@ func (_ fastpathT) DecMapUint64Uint16V(v map[uint64]uint16, checkNil bool, canCh containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[uint64]uint16, containerLen) - } else { - v = make(map[uint64]uint16) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 10) + v = make(map[uint64]uint16, xlen) changed = true } if containerLen > 0 { @@ -21778,23 +17852,19 @@ func (_ fastpathT) DecMapUint64Uint16V(v map[uint64]uint16, checkNil bool, canCh } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := dd.DecodeUint(64) - dd.ReadMapKVSeparator() mv := v[mk] mv = uint16(dd.DecodeUint(16)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapUint64Uint32R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapUint64Uint32R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[uint64]uint32) v, changed := fastpathTV.DecMapUint64Uint32V(*vp, fastpathCheckNilFalse, true, f.d) @@ -21815,7 +17885,7 @@ func (f fastpathT) DecMapUint64Uint32X(vp *map[uint64]uint32, checkNil bool, d * func (_ fastpathT) DecMapUint64Uint32V(v map[uint64]uint32, checkNil bool, canChange bool, d *Decoder) (_ map[uint64]uint32, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -21825,11 +17895,8 @@ func (_ fastpathT) DecMapUint64Uint32V(v map[uint64]uint32, checkNil bool, canCh containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[uint64]uint32, containerLen) - } else { - v = make(map[uint64]uint32) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 12) + v = make(map[uint64]uint32, xlen) changed = true } if containerLen > 0 { @@ -21843,23 +17910,19 @@ func (_ fastpathT) DecMapUint64Uint32V(v map[uint64]uint32, checkNil bool, canCh } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := dd.DecodeUint(64) - dd.ReadMapKVSeparator() mv := v[mk] mv = uint32(dd.DecodeUint(32)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapUint64Uint64R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapUint64Uint64R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[uint64]uint64) v, changed := fastpathTV.DecMapUint64Uint64V(*vp, fastpathCheckNilFalse, true, f.d) @@ -21880,7 +17943,7 @@ func (f fastpathT) DecMapUint64Uint64X(vp *map[uint64]uint64, checkNil bool, d * func (_ fastpathT) DecMapUint64Uint64V(v map[uint64]uint64, checkNil bool, canChange bool, d *Decoder) (_ map[uint64]uint64, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -21890,11 +17953,8 @@ func (_ fastpathT) DecMapUint64Uint64V(v map[uint64]uint64, checkNil bool, canCh containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[uint64]uint64, containerLen) - } else { - v = make(map[uint64]uint64) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 16) + v = make(map[uint64]uint64, xlen) changed = true } if containerLen > 0 { @@ -21908,23 +17968,19 @@ func (_ fastpathT) DecMapUint64Uint64V(v map[uint64]uint64, checkNil bool, canCh } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := dd.DecodeUint(64) - dd.ReadMapKVSeparator() mv := v[mk] mv = dd.DecodeUint(64) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapUint64IntR(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapUint64IntR(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[uint64]int) v, changed := fastpathTV.DecMapUint64IntV(*vp, fastpathCheckNilFalse, true, f.d) @@ -21945,7 +18001,7 @@ func (f fastpathT) DecMapUint64IntX(vp *map[uint64]int, checkNil bool, d *Decode func (_ fastpathT) DecMapUint64IntV(v map[uint64]int, checkNil bool, canChange bool, d *Decoder) (_ map[uint64]int, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -21955,11 +18011,8 @@ func (_ fastpathT) DecMapUint64IntV(v map[uint64]int, checkNil bool, canChange b containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[uint64]int, containerLen) - } else { - v = make(map[uint64]int) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 16) + v = make(map[uint64]int, xlen) changed = true } if containerLen > 0 { @@ -21973,23 +18026,19 @@ func (_ fastpathT) DecMapUint64IntV(v map[uint64]int, checkNil bool, canChange b } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := dd.DecodeUint(64) - dd.ReadMapKVSeparator() mv := v[mk] mv = int(dd.DecodeInt(intBitsize)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapUint64Int8R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapUint64Int8R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[uint64]int8) v, changed := fastpathTV.DecMapUint64Int8V(*vp, fastpathCheckNilFalse, true, f.d) @@ -22010,7 +18059,7 @@ func (f fastpathT) DecMapUint64Int8X(vp *map[uint64]int8, checkNil bool, d *Deco func (_ fastpathT) DecMapUint64Int8V(v map[uint64]int8, checkNil bool, canChange bool, d *Decoder) (_ map[uint64]int8, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -22020,11 +18069,8 @@ func (_ fastpathT) DecMapUint64Int8V(v map[uint64]int8, checkNil bool, canChange containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[uint64]int8, containerLen) - } else { - v = make(map[uint64]int8) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 9) + v = make(map[uint64]int8, xlen) changed = true } if containerLen > 0 { @@ -22038,23 +18084,19 @@ func (_ fastpathT) DecMapUint64Int8V(v map[uint64]int8, checkNil bool, canChange } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := dd.DecodeUint(64) - dd.ReadMapKVSeparator() mv := v[mk] mv = int8(dd.DecodeInt(8)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapUint64Int16R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapUint64Int16R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[uint64]int16) v, changed := fastpathTV.DecMapUint64Int16V(*vp, fastpathCheckNilFalse, true, f.d) @@ -22075,7 +18117,7 @@ func (f fastpathT) DecMapUint64Int16X(vp *map[uint64]int16, checkNil bool, d *De func (_ fastpathT) DecMapUint64Int16V(v map[uint64]int16, checkNil bool, canChange bool, d *Decoder) (_ map[uint64]int16, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -22085,11 +18127,8 @@ func (_ fastpathT) DecMapUint64Int16V(v map[uint64]int16, checkNil bool, canChan containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[uint64]int16, containerLen) - } else { - v = make(map[uint64]int16) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 10) + v = make(map[uint64]int16, xlen) changed = true } if containerLen > 0 { @@ -22103,23 +18142,19 @@ func (_ fastpathT) DecMapUint64Int16V(v map[uint64]int16, checkNil bool, canChan } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := dd.DecodeUint(64) - dd.ReadMapKVSeparator() mv := v[mk] mv = int16(dd.DecodeInt(16)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapUint64Int32R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapUint64Int32R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[uint64]int32) v, changed := fastpathTV.DecMapUint64Int32V(*vp, fastpathCheckNilFalse, true, f.d) @@ -22140,7 +18175,7 @@ func (f fastpathT) DecMapUint64Int32X(vp *map[uint64]int32, checkNil bool, d *De func (_ fastpathT) DecMapUint64Int32V(v map[uint64]int32, checkNil bool, canChange bool, d *Decoder) (_ map[uint64]int32, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -22150,11 +18185,8 @@ func (_ fastpathT) DecMapUint64Int32V(v map[uint64]int32, checkNil bool, canChan containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[uint64]int32, containerLen) - } else { - v = make(map[uint64]int32) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 12) + v = make(map[uint64]int32, xlen) changed = true } if containerLen > 0 { @@ -22168,23 +18200,19 @@ func (_ fastpathT) DecMapUint64Int32V(v map[uint64]int32, checkNil bool, canChan } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := dd.DecodeUint(64) - dd.ReadMapKVSeparator() mv := v[mk] mv = int32(dd.DecodeInt(32)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapUint64Int64R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapUint64Int64R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[uint64]int64) v, changed := fastpathTV.DecMapUint64Int64V(*vp, fastpathCheckNilFalse, true, f.d) @@ -22205,7 +18233,7 @@ func (f fastpathT) DecMapUint64Int64X(vp *map[uint64]int64, checkNil bool, d *De func (_ fastpathT) DecMapUint64Int64V(v map[uint64]int64, checkNil bool, canChange bool, d *Decoder) (_ map[uint64]int64, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -22215,11 +18243,8 @@ func (_ fastpathT) DecMapUint64Int64V(v map[uint64]int64, checkNil bool, canChan containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[uint64]int64, containerLen) - } else { - v = make(map[uint64]int64) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 16) + v = make(map[uint64]int64, xlen) changed = true } if containerLen > 0 { @@ -22233,23 +18258,19 @@ func (_ fastpathT) DecMapUint64Int64V(v map[uint64]int64, checkNil bool, canChan } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := dd.DecodeUint(64) - dd.ReadMapKVSeparator() mv := v[mk] mv = dd.DecodeInt(64) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapUint64Float32R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapUint64Float32R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[uint64]float32) v, changed := fastpathTV.DecMapUint64Float32V(*vp, fastpathCheckNilFalse, true, f.d) @@ -22270,7 +18291,7 @@ func (f fastpathT) DecMapUint64Float32X(vp *map[uint64]float32, checkNil bool, d func (_ fastpathT) DecMapUint64Float32V(v map[uint64]float32, checkNil bool, canChange bool, d *Decoder) (_ map[uint64]float32, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -22280,11 +18301,8 @@ func (_ fastpathT) DecMapUint64Float32V(v map[uint64]float32, checkNil bool, can containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[uint64]float32, containerLen) - } else { - v = make(map[uint64]float32) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 12) + v = make(map[uint64]float32, xlen) changed = true } if containerLen > 0 { @@ -22298,23 +18316,19 @@ func (_ fastpathT) DecMapUint64Float32V(v map[uint64]float32, checkNil bool, can } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := dd.DecodeUint(64) - dd.ReadMapKVSeparator() mv := v[mk] mv = float32(dd.DecodeFloat(true)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapUint64Float64R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapUint64Float64R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[uint64]float64) v, changed := fastpathTV.DecMapUint64Float64V(*vp, fastpathCheckNilFalse, true, f.d) @@ -22335,7 +18349,7 @@ func (f fastpathT) DecMapUint64Float64X(vp *map[uint64]float64, checkNil bool, d func (_ fastpathT) DecMapUint64Float64V(v map[uint64]float64, checkNil bool, canChange bool, d *Decoder) (_ map[uint64]float64, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -22345,11 +18359,8 @@ func (_ fastpathT) DecMapUint64Float64V(v map[uint64]float64, checkNil bool, can containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[uint64]float64, containerLen) - } else { - v = make(map[uint64]float64) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 16) + v = make(map[uint64]float64, xlen) changed = true } if containerLen > 0 { @@ -22363,23 +18374,19 @@ func (_ fastpathT) DecMapUint64Float64V(v map[uint64]float64, checkNil bool, can } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := dd.DecodeUint(64) - dd.ReadMapKVSeparator() mv := v[mk] mv = dd.DecodeFloat(false) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapUint64BoolR(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapUint64BoolR(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[uint64]bool) v, changed := fastpathTV.DecMapUint64BoolV(*vp, fastpathCheckNilFalse, true, f.d) @@ -22400,7 +18407,7 @@ func (f fastpathT) DecMapUint64BoolX(vp *map[uint64]bool, checkNil bool, d *Deco func (_ fastpathT) DecMapUint64BoolV(v map[uint64]bool, checkNil bool, canChange bool, d *Decoder) (_ map[uint64]bool, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -22410,11 +18417,8 @@ func (_ fastpathT) DecMapUint64BoolV(v map[uint64]bool, checkNil bool, canChange containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[uint64]bool, containerLen) - } else { - v = make(map[uint64]bool) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 9) + v = make(map[uint64]bool, xlen) changed = true } if containerLen > 0 { @@ -22428,23 +18432,19 @@ func (_ fastpathT) DecMapUint64BoolV(v map[uint64]bool, checkNil bool, canChange } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := dd.DecodeUint(64) - dd.ReadMapKVSeparator() mv := v[mk] mv = dd.DecodeBool() if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapIntIntfR(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapIntIntfR(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[int]interface{}) v, changed := fastpathTV.DecMapIntIntfV(*vp, fastpathCheckNilFalse, true, f.d) @@ -22465,7 +18465,7 @@ func (f fastpathT) DecMapIntIntfX(vp *map[int]interface{}, checkNil bool, d *Dec func (_ fastpathT) DecMapIntIntfV(v map[int]interface{}, checkNil bool, canChange bool, d *Decoder) (_ map[int]interface{}, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -22475,11 +18475,8 @@ func (_ fastpathT) DecMapIntIntfV(v map[int]interface{}, checkNil bool, canChang containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[int]interface{}, containerLen) - } else { - v = make(map[int]interface{}) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 24) + v = make(map[int]interface{}, xlen) changed = true } if containerLen > 0 { @@ -22494,11 +18491,7 @@ func (_ fastpathT) DecMapIntIntfV(v map[int]interface{}, checkNil bool, canChang } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := int(dd.DecodeInt(intBitsize)) - dd.ReadMapKVSeparator() mv := v[mk] d.decode(&mv) @@ -22506,12 +18499,12 @@ func (_ fastpathT) DecMapIntIntfV(v map[int]interface{}, checkNil bool, canChang v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapIntStringR(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapIntStringR(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[int]string) v, changed := fastpathTV.DecMapIntStringV(*vp, fastpathCheckNilFalse, true, f.d) @@ -22532,7 +18525,7 @@ func (f fastpathT) DecMapIntStringX(vp *map[int]string, checkNil bool, d *Decode func (_ fastpathT) DecMapIntStringV(v map[int]string, checkNil bool, canChange bool, d *Decoder) (_ map[int]string, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -22542,11 +18535,8 @@ func (_ fastpathT) DecMapIntStringV(v map[int]string, checkNil bool, canChange b containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[int]string, containerLen) - } else { - v = make(map[int]string) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 24) + v = make(map[int]string, xlen) changed = true } if containerLen > 0 { @@ -22560,23 +18550,19 @@ func (_ fastpathT) DecMapIntStringV(v map[int]string, checkNil bool, canChange b } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := int(dd.DecodeInt(intBitsize)) - dd.ReadMapKVSeparator() mv := v[mk] mv = dd.DecodeString() if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapIntUintR(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapIntUintR(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[int]uint) v, changed := fastpathTV.DecMapIntUintV(*vp, fastpathCheckNilFalse, true, f.d) @@ -22597,7 +18583,7 @@ func (f fastpathT) DecMapIntUintX(vp *map[int]uint, checkNil bool, d *Decoder) { func (_ fastpathT) DecMapIntUintV(v map[int]uint, checkNil bool, canChange bool, d *Decoder) (_ map[int]uint, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -22607,11 +18593,8 @@ func (_ fastpathT) DecMapIntUintV(v map[int]uint, checkNil bool, canChange bool, containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[int]uint, containerLen) - } else { - v = make(map[int]uint) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 16) + v = make(map[int]uint, xlen) changed = true } if containerLen > 0 { @@ -22625,23 +18608,19 @@ func (_ fastpathT) DecMapIntUintV(v map[int]uint, checkNil bool, canChange bool, } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := int(dd.DecodeInt(intBitsize)) - dd.ReadMapKVSeparator() mv := v[mk] mv = uint(dd.DecodeUint(uintBitsize)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapIntUint8R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapIntUint8R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[int]uint8) v, changed := fastpathTV.DecMapIntUint8V(*vp, fastpathCheckNilFalse, true, f.d) @@ -22662,7 +18641,7 @@ func (f fastpathT) DecMapIntUint8X(vp *map[int]uint8, checkNil bool, d *Decoder) func (_ fastpathT) DecMapIntUint8V(v map[int]uint8, checkNil bool, canChange bool, d *Decoder) (_ map[int]uint8, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -22672,11 +18651,8 @@ func (_ fastpathT) DecMapIntUint8V(v map[int]uint8, checkNil bool, canChange boo containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[int]uint8, containerLen) - } else { - v = make(map[int]uint8) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 9) + v = make(map[int]uint8, xlen) changed = true } if containerLen > 0 { @@ -22690,23 +18666,19 @@ func (_ fastpathT) DecMapIntUint8V(v map[int]uint8, checkNil bool, canChange boo } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := int(dd.DecodeInt(intBitsize)) - dd.ReadMapKVSeparator() mv := v[mk] mv = uint8(dd.DecodeUint(8)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapIntUint16R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapIntUint16R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[int]uint16) v, changed := fastpathTV.DecMapIntUint16V(*vp, fastpathCheckNilFalse, true, f.d) @@ -22727,7 +18699,7 @@ func (f fastpathT) DecMapIntUint16X(vp *map[int]uint16, checkNil bool, d *Decode func (_ fastpathT) DecMapIntUint16V(v map[int]uint16, checkNil bool, canChange bool, d *Decoder) (_ map[int]uint16, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -22737,11 +18709,8 @@ func (_ fastpathT) DecMapIntUint16V(v map[int]uint16, checkNil bool, canChange b containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[int]uint16, containerLen) - } else { - v = make(map[int]uint16) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 10) + v = make(map[int]uint16, xlen) changed = true } if containerLen > 0 { @@ -22755,23 +18724,19 @@ func (_ fastpathT) DecMapIntUint16V(v map[int]uint16, checkNil bool, canChange b } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := int(dd.DecodeInt(intBitsize)) - dd.ReadMapKVSeparator() mv := v[mk] mv = uint16(dd.DecodeUint(16)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapIntUint32R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapIntUint32R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[int]uint32) v, changed := fastpathTV.DecMapIntUint32V(*vp, fastpathCheckNilFalse, true, f.d) @@ -22792,7 +18757,7 @@ func (f fastpathT) DecMapIntUint32X(vp *map[int]uint32, checkNil bool, d *Decode func (_ fastpathT) DecMapIntUint32V(v map[int]uint32, checkNil bool, canChange bool, d *Decoder) (_ map[int]uint32, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -22802,11 +18767,8 @@ func (_ fastpathT) DecMapIntUint32V(v map[int]uint32, checkNil bool, canChange b containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[int]uint32, containerLen) - } else { - v = make(map[int]uint32) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 12) + v = make(map[int]uint32, xlen) changed = true } if containerLen > 0 { @@ -22820,23 +18782,19 @@ func (_ fastpathT) DecMapIntUint32V(v map[int]uint32, checkNil bool, canChange b } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := int(dd.DecodeInt(intBitsize)) - dd.ReadMapKVSeparator() mv := v[mk] mv = uint32(dd.DecodeUint(32)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapIntUint64R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapIntUint64R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[int]uint64) v, changed := fastpathTV.DecMapIntUint64V(*vp, fastpathCheckNilFalse, true, f.d) @@ -22857,7 +18815,7 @@ func (f fastpathT) DecMapIntUint64X(vp *map[int]uint64, checkNil bool, d *Decode func (_ fastpathT) DecMapIntUint64V(v map[int]uint64, checkNil bool, canChange bool, d *Decoder) (_ map[int]uint64, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -22867,11 +18825,8 @@ func (_ fastpathT) DecMapIntUint64V(v map[int]uint64, checkNil bool, canChange b containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[int]uint64, containerLen) - } else { - v = make(map[int]uint64) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 16) + v = make(map[int]uint64, xlen) changed = true } if containerLen > 0 { @@ -22885,23 +18840,19 @@ func (_ fastpathT) DecMapIntUint64V(v map[int]uint64, checkNil bool, canChange b } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := int(dd.DecodeInt(intBitsize)) - dd.ReadMapKVSeparator() mv := v[mk] mv = dd.DecodeUint(64) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapIntIntR(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapIntIntR(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[int]int) v, changed := fastpathTV.DecMapIntIntV(*vp, fastpathCheckNilFalse, true, f.d) @@ -22922,7 +18873,7 @@ func (f fastpathT) DecMapIntIntX(vp *map[int]int, checkNil bool, d *Decoder) { func (_ fastpathT) DecMapIntIntV(v map[int]int, checkNil bool, canChange bool, d *Decoder) (_ map[int]int, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -22932,11 +18883,8 @@ func (_ fastpathT) DecMapIntIntV(v map[int]int, checkNil bool, canChange bool, containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[int]int, containerLen) - } else { - v = make(map[int]int) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 16) + v = make(map[int]int, xlen) changed = true } if containerLen > 0 { @@ -22950,23 +18898,19 @@ func (_ fastpathT) DecMapIntIntV(v map[int]int, checkNil bool, canChange bool, } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := int(dd.DecodeInt(intBitsize)) - dd.ReadMapKVSeparator() mv := v[mk] mv = int(dd.DecodeInt(intBitsize)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapIntInt8R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapIntInt8R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[int]int8) v, changed := fastpathTV.DecMapIntInt8V(*vp, fastpathCheckNilFalse, true, f.d) @@ -22987,7 +18931,7 @@ func (f fastpathT) DecMapIntInt8X(vp *map[int]int8, checkNil bool, d *Decoder) { func (_ fastpathT) DecMapIntInt8V(v map[int]int8, checkNil bool, canChange bool, d *Decoder) (_ map[int]int8, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -22997,11 +18941,8 @@ func (_ fastpathT) DecMapIntInt8V(v map[int]int8, checkNil bool, canChange bool, containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[int]int8, containerLen) - } else { - v = make(map[int]int8) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 9) + v = make(map[int]int8, xlen) changed = true } if containerLen > 0 { @@ -23015,23 +18956,19 @@ func (_ fastpathT) DecMapIntInt8V(v map[int]int8, checkNil bool, canChange bool, } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := int(dd.DecodeInt(intBitsize)) - dd.ReadMapKVSeparator() mv := v[mk] mv = int8(dd.DecodeInt(8)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapIntInt16R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapIntInt16R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[int]int16) v, changed := fastpathTV.DecMapIntInt16V(*vp, fastpathCheckNilFalse, true, f.d) @@ -23052,7 +18989,7 @@ func (f fastpathT) DecMapIntInt16X(vp *map[int]int16, checkNil bool, d *Decoder) func (_ fastpathT) DecMapIntInt16V(v map[int]int16, checkNil bool, canChange bool, d *Decoder) (_ map[int]int16, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -23062,11 +18999,8 @@ func (_ fastpathT) DecMapIntInt16V(v map[int]int16, checkNil bool, canChange boo containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[int]int16, containerLen) - } else { - v = make(map[int]int16) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 10) + v = make(map[int]int16, xlen) changed = true } if containerLen > 0 { @@ -23080,23 +19014,19 @@ func (_ fastpathT) DecMapIntInt16V(v map[int]int16, checkNil bool, canChange boo } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := int(dd.DecodeInt(intBitsize)) - dd.ReadMapKVSeparator() mv := v[mk] mv = int16(dd.DecodeInt(16)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapIntInt32R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapIntInt32R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[int]int32) v, changed := fastpathTV.DecMapIntInt32V(*vp, fastpathCheckNilFalse, true, f.d) @@ -23117,7 +19047,7 @@ func (f fastpathT) DecMapIntInt32X(vp *map[int]int32, checkNil bool, d *Decoder) func (_ fastpathT) DecMapIntInt32V(v map[int]int32, checkNil bool, canChange bool, d *Decoder) (_ map[int]int32, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -23127,11 +19057,8 @@ func (_ fastpathT) DecMapIntInt32V(v map[int]int32, checkNil bool, canChange boo containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[int]int32, containerLen) - } else { - v = make(map[int]int32) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 12) + v = make(map[int]int32, xlen) changed = true } if containerLen > 0 { @@ -23145,23 +19072,19 @@ func (_ fastpathT) DecMapIntInt32V(v map[int]int32, checkNil bool, canChange boo } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := int(dd.DecodeInt(intBitsize)) - dd.ReadMapKVSeparator() mv := v[mk] mv = int32(dd.DecodeInt(32)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapIntInt64R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapIntInt64R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[int]int64) v, changed := fastpathTV.DecMapIntInt64V(*vp, fastpathCheckNilFalse, true, f.d) @@ -23182,7 +19105,7 @@ func (f fastpathT) DecMapIntInt64X(vp *map[int]int64, checkNil bool, d *Decoder) func (_ fastpathT) DecMapIntInt64V(v map[int]int64, checkNil bool, canChange bool, d *Decoder) (_ map[int]int64, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -23192,11 +19115,8 @@ func (_ fastpathT) DecMapIntInt64V(v map[int]int64, checkNil bool, canChange boo containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[int]int64, containerLen) - } else { - v = make(map[int]int64) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 16) + v = make(map[int]int64, xlen) changed = true } if containerLen > 0 { @@ -23210,23 +19130,19 @@ func (_ fastpathT) DecMapIntInt64V(v map[int]int64, checkNil bool, canChange boo } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := int(dd.DecodeInt(intBitsize)) - dd.ReadMapKVSeparator() mv := v[mk] mv = dd.DecodeInt(64) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapIntFloat32R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapIntFloat32R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[int]float32) v, changed := fastpathTV.DecMapIntFloat32V(*vp, fastpathCheckNilFalse, true, f.d) @@ -23247,7 +19163,7 @@ func (f fastpathT) DecMapIntFloat32X(vp *map[int]float32, checkNil bool, d *Deco func (_ fastpathT) DecMapIntFloat32V(v map[int]float32, checkNil bool, canChange bool, d *Decoder) (_ map[int]float32, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -23257,11 +19173,8 @@ func (_ fastpathT) DecMapIntFloat32V(v map[int]float32, checkNil bool, canChange containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[int]float32, containerLen) - } else { - v = make(map[int]float32) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 12) + v = make(map[int]float32, xlen) changed = true } if containerLen > 0 { @@ -23275,23 +19188,19 @@ func (_ fastpathT) DecMapIntFloat32V(v map[int]float32, checkNil bool, canChange } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := int(dd.DecodeInt(intBitsize)) - dd.ReadMapKVSeparator() mv := v[mk] mv = float32(dd.DecodeFloat(true)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapIntFloat64R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapIntFloat64R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[int]float64) v, changed := fastpathTV.DecMapIntFloat64V(*vp, fastpathCheckNilFalse, true, f.d) @@ -23312,7 +19221,7 @@ func (f fastpathT) DecMapIntFloat64X(vp *map[int]float64, checkNil bool, d *Deco func (_ fastpathT) DecMapIntFloat64V(v map[int]float64, checkNil bool, canChange bool, d *Decoder) (_ map[int]float64, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -23322,11 +19231,8 @@ func (_ fastpathT) DecMapIntFloat64V(v map[int]float64, checkNil bool, canChange containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[int]float64, containerLen) - } else { - v = make(map[int]float64) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 16) + v = make(map[int]float64, xlen) changed = true } if containerLen > 0 { @@ -23340,23 +19246,19 @@ func (_ fastpathT) DecMapIntFloat64V(v map[int]float64, checkNil bool, canChange } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := int(dd.DecodeInt(intBitsize)) - dd.ReadMapKVSeparator() mv := v[mk] mv = dd.DecodeFloat(false) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapIntBoolR(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapIntBoolR(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[int]bool) v, changed := fastpathTV.DecMapIntBoolV(*vp, fastpathCheckNilFalse, true, f.d) @@ -23377,7 +19279,7 @@ func (f fastpathT) DecMapIntBoolX(vp *map[int]bool, checkNil bool, d *Decoder) { func (_ fastpathT) DecMapIntBoolV(v map[int]bool, checkNil bool, canChange bool, d *Decoder) (_ map[int]bool, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -23387,11 +19289,8 @@ func (_ fastpathT) DecMapIntBoolV(v map[int]bool, checkNil bool, canChange bool, containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[int]bool, containerLen) - } else { - v = make(map[int]bool) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 9) + v = make(map[int]bool, xlen) changed = true } if containerLen > 0 { @@ -23405,23 +19304,19 @@ func (_ fastpathT) DecMapIntBoolV(v map[int]bool, checkNil bool, canChange bool, } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := int(dd.DecodeInt(intBitsize)) - dd.ReadMapKVSeparator() mv := v[mk] mv = dd.DecodeBool() if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapInt8IntfR(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapInt8IntfR(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[int8]interface{}) v, changed := fastpathTV.DecMapInt8IntfV(*vp, fastpathCheckNilFalse, true, f.d) @@ -23442,7 +19337,7 @@ func (f fastpathT) DecMapInt8IntfX(vp *map[int8]interface{}, checkNil bool, d *D func (_ fastpathT) DecMapInt8IntfV(v map[int8]interface{}, checkNil bool, canChange bool, d *Decoder) (_ map[int8]interface{}, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -23452,11 +19347,8 @@ func (_ fastpathT) DecMapInt8IntfV(v map[int8]interface{}, checkNil bool, canCha containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[int8]interface{}, containerLen) - } else { - v = make(map[int8]interface{}) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 17) + v = make(map[int8]interface{}, xlen) changed = true } if containerLen > 0 { @@ -23471,11 +19363,7 @@ func (_ fastpathT) DecMapInt8IntfV(v map[int8]interface{}, checkNil bool, canCha } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := int8(dd.DecodeInt(8)) - dd.ReadMapKVSeparator() mv := v[mk] d.decode(&mv) @@ -23483,12 +19371,12 @@ func (_ fastpathT) DecMapInt8IntfV(v map[int8]interface{}, checkNil bool, canCha v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapInt8StringR(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapInt8StringR(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[int8]string) v, changed := fastpathTV.DecMapInt8StringV(*vp, fastpathCheckNilFalse, true, f.d) @@ -23509,7 +19397,7 @@ func (f fastpathT) DecMapInt8StringX(vp *map[int8]string, checkNil bool, d *Deco func (_ fastpathT) DecMapInt8StringV(v map[int8]string, checkNil bool, canChange bool, d *Decoder) (_ map[int8]string, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -23519,11 +19407,8 @@ func (_ fastpathT) DecMapInt8StringV(v map[int8]string, checkNil bool, canChange containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[int8]string, containerLen) - } else { - v = make(map[int8]string) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 17) + v = make(map[int8]string, xlen) changed = true } if containerLen > 0 { @@ -23537,23 +19422,19 @@ func (_ fastpathT) DecMapInt8StringV(v map[int8]string, checkNil bool, canChange } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := int8(dd.DecodeInt(8)) - dd.ReadMapKVSeparator() mv := v[mk] mv = dd.DecodeString() if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapInt8UintR(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapInt8UintR(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[int8]uint) v, changed := fastpathTV.DecMapInt8UintV(*vp, fastpathCheckNilFalse, true, f.d) @@ -23574,7 +19455,7 @@ func (f fastpathT) DecMapInt8UintX(vp *map[int8]uint, checkNil bool, d *Decoder) func (_ fastpathT) DecMapInt8UintV(v map[int8]uint, checkNil bool, canChange bool, d *Decoder) (_ map[int8]uint, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -23584,11 +19465,8 @@ func (_ fastpathT) DecMapInt8UintV(v map[int8]uint, checkNil bool, canChange boo containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[int8]uint, containerLen) - } else { - v = make(map[int8]uint) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 9) + v = make(map[int8]uint, xlen) changed = true } if containerLen > 0 { @@ -23602,23 +19480,19 @@ func (_ fastpathT) DecMapInt8UintV(v map[int8]uint, checkNil bool, canChange boo } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := int8(dd.DecodeInt(8)) - dd.ReadMapKVSeparator() mv := v[mk] mv = uint(dd.DecodeUint(uintBitsize)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapInt8Uint8R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapInt8Uint8R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[int8]uint8) v, changed := fastpathTV.DecMapInt8Uint8V(*vp, fastpathCheckNilFalse, true, f.d) @@ -23639,7 +19513,7 @@ func (f fastpathT) DecMapInt8Uint8X(vp *map[int8]uint8, checkNil bool, d *Decode func (_ fastpathT) DecMapInt8Uint8V(v map[int8]uint8, checkNil bool, canChange bool, d *Decoder) (_ map[int8]uint8, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -23649,11 +19523,8 @@ func (_ fastpathT) DecMapInt8Uint8V(v map[int8]uint8, checkNil bool, canChange b containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[int8]uint8, containerLen) - } else { - v = make(map[int8]uint8) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 2) + v = make(map[int8]uint8, xlen) changed = true } if containerLen > 0 { @@ -23667,23 +19538,19 @@ func (_ fastpathT) DecMapInt8Uint8V(v map[int8]uint8, checkNil bool, canChange b } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := int8(dd.DecodeInt(8)) - dd.ReadMapKVSeparator() mv := v[mk] mv = uint8(dd.DecodeUint(8)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapInt8Uint16R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapInt8Uint16R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[int8]uint16) v, changed := fastpathTV.DecMapInt8Uint16V(*vp, fastpathCheckNilFalse, true, f.d) @@ -23704,7 +19571,7 @@ func (f fastpathT) DecMapInt8Uint16X(vp *map[int8]uint16, checkNil bool, d *Deco func (_ fastpathT) DecMapInt8Uint16V(v map[int8]uint16, checkNil bool, canChange bool, d *Decoder) (_ map[int8]uint16, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -23714,11 +19581,8 @@ func (_ fastpathT) DecMapInt8Uint16V(v map[int8]uint16, checkNil bool, canChange containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[int8]uint16, containerLen) - } else { - v = make(map[int8]uint16) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 3) + v = make(map[int8]uint16, xlen) changed = true } if containerLen > 0 { @@ -23732,23 +19596,19 @@ func (_ fastpathT) DecMapInt8Uint16V(v map[int8]uint16, checkNil bool, canChange } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := int8(dd.DecodeInt(8)) - dd.ReadMapKVSeparator() mv := v[mk] mv = uint16(dd.DecodeUint(16)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapInt8Uint32R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapInt8Uint32R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[int8]uint32) v, changed := fastpathTV.DecMapInt8Uint32V(*vp, fastpathCheckNilFalse, true, f.d) @@ -23769,7 +19629,7 @@ func (f fastpathT) DecMapInt8Uint32X(vp *map[int8]uint32, checkNil bool, d *Deco func (_ fastpathT) DecMapInt8Uint32V(v map[int8]uint32, checkNil bool, canChange bool, d *Decoder) (_ map[int8]uint32, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -23779,11 +19639,8 @@ func (_ fastpathT) DecMapInt8Uint32V(v map[int8]uint32, checkNil bool, canChange containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[int8]uint32, containerLen) - } else { - v = make(map[int8]uint32) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 5) + v = make(map[int8]uint32, xlen) changed = true } if containerLen > 0 { @@ -23797,23 +19654,19 @@ func (_ fastpathT) DecMapInt8Uint32V(v map[int8]uint32, checkNil bool, canChange } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := int8(dd.DecodeInt(8)) - dd.ReadMapKVSeparator() mv := v[mk] mv = uint32(dd.DecodeUint(32)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapInt8Uint64R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapInt8Uint64R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[int8]uint64) v, changed := fastpathTV.DecMapInt8Uint64V(*vp, fastpathCheckNilFalse, true, f.d) @@ -23834,7 +19687,7 @@ func (f fastpathT) DecMapInt8Uint64X(vp *map[int8]uint64, checkNil bool, d *Deco func (_ fastpathT) DecMapInt8Uint64V(v map[int8]uint64, checkNil bool, canChange bool, d *Decoder) (_ map[int8]uint64, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -23844,11 +19697,8 @@ func (_ fastpathT) DecMapInt8Uint64V(v map[int8]uint64, checkNil bool, canChange containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[int8]uint64, containerLen) - } else { - v = make(map[int8]uint64) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 9) + v = make(map[int8]uint64, xlen) changed = true } if containerLen > 0 { @@ -23862,23 +19712,19 @@ func (_ fastpathT) DecMapInt8Uint64V(v map[int8]uint64, checkNil bool, canChange } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := int8(dd.DecodeInt(8)) - dd.ReadMapKVSeparator() mv := v[mk] mv = dd.DecodeUint(64) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapInt8IntR(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapInt8IntR(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[int8]int) v, changed := fastpathTV.DecMapInt8IntV(*vp, fastpathCheckNilFalse, true, f.d) @@ -23899,7 +19745,7 @@ func (f fastpathT) DecMapInt8IntX(vp *map[int8]int, checkNil bool, d *Decoder) { func (_ fastpathT) DecMapInt8IntV(v map[int8]int, checkNil bool, canChange bool, d *Decoder) (_ map[int8]int, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -23909,11 +19755,8 @@ func (_ fastpathT) DecMapInt8IntV(v map[int8]int, checkNil bool, canChange bool, containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[int8]int, containerLen) - } else { - v = make(map[int8]int) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 9) + v = make(map[int8]int, xlen) changed = true } if containerLen > 0 { @@ -23927,23 +19770,19 @@ func (_ fastpathT) DecMapInt8IntV(v map[int8]int, checkNil bool, canChange bool, } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := int8(dd.DecodeInt(8)) - dd.ReadMapKVSeparator() mv := v[mk] mv = int(dd.DecodeInt(intBitsize)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapInt8Int8R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapInt8Int8R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[int8]int8) v, changed := fastpathTV.DecMapInt8Int8V(*vp, fastpathCheckNilFalse, true, f.d) @@ -23964,7 +19803,7 @@ func (f fastpathT) DecMapInt8Int8X(vp *map[int8]int8, checkNil bool, d *Decoder) func (_ fastpathT) DecMapInt8Int8V(v map[int8]int8, checkNil bool, canChange bool, d *Decoder) (_ map[int8]int8, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -23974,11 +19813,8 @@ func (_ fastpathT) DecMapInt8Int8V(v map[int8]int8, checkNil bool, canChange boo containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[int8]int8, containerLen) - } else { - v = make(map[int8]int8) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 2) + v = make(map[int8]int8, xlen) changed = true } if containerLen > 0 { @@ -23992,23 +19828,19 @@ func (_ fastpathT) DecMapInt8Int8V(v map[int8]int8, checkNil bool, canChange boo } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := int8(dd.DecodeInt(8)) - dd.ReadMapKVSeparator() mv := v[mk] mv = int8(dd.DecodeInt(8)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapInt8Int16R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapInt8Int16R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[int8]int16) v, changed := fastpathTV.DecMapInt8Int16V(*vp, fastpathCheckNilFalse, true, f.d) @@ -24029,7 +19861,7 @@ func (f fastpathT) DecMapInt8Int16X(vp *map[int8]int16, checkNil bool, d *Decode func (_ fastpathT) DecMapInt8Int16V(v map[int8]int16, checkNil bool, canChange bool, d *Decoder) (_ map[int8]int16, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -24039,11 +19871,8 @@ func (_ fastpathT) DecMapInt8Int16V(v map[int8]int16, checkNil bool, canChange b containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[int8]int16, containerLen) - } else { - v = make(map[int8]int16) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 3) + v = make(map[int8]int16, xlen) changed = true } if containerLen > 0 { @@ -24057,23 +19886,19 @@ func (_ fastpathT) DecMapInt8Int16V(v map[int8]int16, checkNil bool, canChange b } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := int8(dd.DecodeInt(8)) - dd.ReadMapKVSeparator() mv := v[mk] mv = int16(dd.DecodeInt(16)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapInt8Int32R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapInt8Int32R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[int8]int32) v, changed := fastpathTV.DecMapInt8Int32V(*vp, fastpathCheckNilFalse, true, f.d) @@ -24094,7 +19919,7 @@ func (f fastpathT) DecMapInt8Int32X(vp *map[int8]int32, checkNil bool, d *Decode func (_ fastpathT) DecMapInt8Int32V(v map[int8]int32, checkNil bool, canChange bool, d *Decoder) (_ map[int8]int32, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -24104,11 +19929,8 @@ func (_ fastpathT) DecMapInt8Int32V(v map[int8]int32, checkNil bool, canChange b containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[int8]int32, containerLen) - } else { - v = make(map[int8]int32) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 5) + v = make(map[int8]int32, xlen) changed = true } if containerLen > 0 { @@ -24122,23 +19944,19 @@ func (_ fastpathT) DecMapInt8Int32V(v map[int8]int32, checkNil bool, canChange b } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := int8(dd.DecodeInt(8)) - dd.ReadMapKVSeparator() mv := v[mk] mv = int32(dd.DecodeInt(32)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapInt8Int64R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapInt8Int64R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[int8]int64) v, changed := fastpathTV.DecMapInt8Int64V(*vp, fastpathCheckNilFalse, true, f.d) @@ -24159,7 +19977,7 @@ func (f fastpathT) DecMapInt8Int64X(vp *map[int8]int64, checkNil bool, d *Decode func (_ fastpathT) DecMapInt8Int64V(v map[int8]int64, checkNil bool, canChange bool, d *Decoder) (_ map[int8]int64, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -24169,11 +19987,8 @@ func (_ fastpathT) DecMapInt8Int64V(v map[int8]int64, checkNil bool, canChange b containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[int8]int64, containerLen) - } else { - v = make(map[int8]int64) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 9) + v = make(map[int8]int64, xlen) changed = true } if containerLen > 0 { @@ -24187,23 +20002,19 @@ func (_ fastpathT) DecMapInt8Int64V(v map[int8]int64, checkNil bool, canChange b } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := int8(dd.DecodeInt(8)) - dd.ReadMapKVSeparator() mv := v[mk] mv = dd.DecodeInt(64) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapInt8Float32R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapInt8Float32R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[int8]float32) v, changed := fastpathTV.DecMapInt8Float32V(*vp, fastpathCheckNilFalse, true, f.d) @@ -24224,7 +20035,7 @@ func (f fastpathT) DecMapInt8Float32X(vp *map[int8]float32, checkNil bool, d *De func (_ fastpathT) DecMapInt8Float32V(v map[int8]float32, checkNil bool, canChange bool, d *Decoder) (_ map[int8]float32, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -24234,11 +20045,8 @@ func (_ fastpathT) DecMapInt8Float32V(v map[int8]float32, checkNil bool, canChan containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[int8]float32, containerLen) - } else { - v = make(map[int8]float32) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 5) + v = make(map[int8]float32, xlen) changed = true } if containerLen > 0 { @@ -24252,23 +20060,19 @@ func (_ fastpathT) DecMapInt8Float32V(v map[int8]float32, checkNil bool, canChan } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := int8(dd.DecodeInt(8)) - dd.ReadMapKVSeparator() mv := v[mk] mv = float32(dd.DecodeFloat(true)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapInt8Float64R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapInt8Float64R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[int8]float64) v, changed := fastpathTV.DecMapInt8Float64V(*vp, fastpathCheckNilFalse, true, f.d) @@ -24289,7 +20093,7 @@ func (f fastpathT) DecMapInt8Float64X(vp *map[int8]float64, checkNil bool, d *De func (_ fastpathT) DecMapInt8Float64V(v map[int8]float64, checkNil bool, canChange bool, d *Decoder) (_ map[int8]float64, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -24299,11 +20103,8 @@ func (_ fastpathT) DecMapInt8Float64V(v map[int8]float64, checkNil bool, canChan containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[int8]float64, containerLen) - } else { - v = make(map[int8]float64) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 9) + v = make(map[int8]float64, xlen) changed = true } if containerLen > 0 { @@ -24317,23 +20118,19 @@ func (_ fastpathT) DecMapInt8Float64V(v map[int8]float64, checkNil bool, canChan } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := int8(dd.DecodeInt(8)) - dd.ReadMapKVSeparator() mv := v[mk] mv = dd.DecodeFloat(false) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapInt8BoolR(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapInt8BoolR(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[int8]bool) v, changed := fastpathTV.DecMapInt8BoolV(*vp, fastpathCheckNilFalse, true, f.d) @@ -24354,7 +20151,7 @@ func (f fastpathT) DecMapInt8BoolX(vp *map[int8]bool, checkNil bool, d *Decoder) func (_ fastpathT) DecMapInt8BoolV(v map[int8]bool, checkNil bool, canChange bool, d *Decoder) (_ map[int8]bool, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -24364,11 +20161,8 @@ func (_ fastpathT) DecMapInt8BoolV(v map[int8]bool, checkNil bool, canChange boo containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[int8]bool, containerLen) - } else { - v = make(map[int8]bool) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 2) + v = make(map[int8]bool, xlen) changed = true } if containerLen > 0 { @@ -24382,23 +20176,19 @@ func (_ fastpathT) DecMapInt8BoolV(v map[int8]bool, checkNil bool, canChange boo } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := int8(dd.DecodeInt(8)) - dd.ReadMapKVSeparator() mv := v[mk] mv = dd.DecodeBool() if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapInt16IntfR(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapInt16IntfR(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[int16]interface{}) v, changed := fastpathTV.DecMapInt16IntfV(*vp, fastpathCheckNilFalse, true, f.d) @@ -24419,7 +20209,7 @@ func (f fastpathT) DecMapInt16IntfX(vp *map[int16]interface{}, checkNil bool, d func (_ fastpathT) DecMapInt16IntfV(v map[int16]interface{}, checkNil bool, canChange bool, d *Decoder) (_ map[int16]interface{}, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -24429,11 +20219,8 @@ func (_ fastpathT) DecMapInt16IntfV(v map[int16]interface{}, checkNil bool, canC containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[int16]interface{}, containerLen) - } else { - v = make(map[int16]interface{}) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 18) + v = make(map[int16]interface{}, xlen) changed = true } if containerLen > 0 { @@ -24448,11 +20235,7 @@ func (_ fastpathT) DecMapInt16IntfV(v map[int16]interface{}, checkNil bool, canC } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := int16(dd.DecodeInt(16)) - dd.ReadMapKVSeparator() mv := v[mk] d.decode(&mv) @@ -24460,12 +20243,12 @@ func (_ fastpathT) DecMapInt16IntfV(v map[int16]interface{}, checkNil bool, canC v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapInt16StringR(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapInt16StringR(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[int16]string) v, changed := fastpathTV.DecMapInt16StringV(*vp, fastpathCheckNilFalse, true, f.d) @@ -24486,7 +20269,7 @@ func (f fastpathT) DecMapInt16StringX(vp *map[int16]string, checkNil bool, d *De func (_ fastpathT) DecMapInt16StringV(v map[int16]string, checkNil bool, canChange bool, d *Decoder) (_ map[int16]string, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -24496,11 +20279,8 @@ func (_ fastpathT) DecMapInt16StringV(v map[int16]string, checkNil bool, canChan containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[int16]string, containerLen) - } else { - v = make(map[int16]string) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 18) + v = make(map[int16]string, xlen) changed = true } if containerLen > 0 { @@ -24514,23 +20294,19 @@ func (_ fastpathT) DecMapInt16StringV(v map[int16]string, checkNil bool, canChan } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := int16(dd.DecodeInt(16)) - dd.ReadMapKVSeparator() mv := v[mk] mv = dd.DecodeString() if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapInt16UintR(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapInt16UintR(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[int16]uint) v, changed := fastpathTV.DecMapInt16UintV(*vp, fastpathCheckNilFalse, true, f.d) @@ -24551,7 +20327,7 @@ func (f fastpathT) DecMapInt16UintX(vp *map[int16]uint, checkNil bool, d *Decode func (_ fastpathT) DecMapInt16UintV(v map[int16]uint, checkNil bool, canChange bool, d *Decoder) (_ map[int16]uint, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -24561,11 +20337,8 @@ func (_ fastpathT) DecMapInt16UintV(v map[int16]uint, checkNil bool, canChange b containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[int16]uint, containerLen) - } else { - v = make(map[int16]uint) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 10) + v = make(map[int16]uint, xlen) changed = true } if containerLen > 0 { @@ -24579,23 +20352,19 @@ func (_ fastpathT) DecMapInt16UintV(v map[int16]uint, checkNil bool, canChange b } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := int16(dd.DecodeInt(16)) - dd.ReadMapKVSeparator() mv := v[mk] mv = uint(dd.DecodeUint(uintBitsize)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapInt16Uint8R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapInt16Uint8R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[int16]uint8) v, changed := fastpathTV.DecMapInt16Uint8V(*vp, fastpathCheckNilFalse, true, f.d) @@ -24616,7 +20385,7 @@ func (f fastpathT) DecMapInt16Uint8X(vp *map[int16]uint8, checkNil bool, d *Deco func (_ fastpathT) DecMapInt16Uint8V(v map[int16]uint8, checkNil bool, canChange bool, d *Decoder) (_ map[int16]uint8, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -24626,11 +20395,8 @@ func (_ fastpathT) DecMapInt16Uint8V(v map[int16]uint8, checkNil bool, canChange containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[int16]uint8, containerLen) - } else { - v = make(map[int16]uint8) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 3) + v = make(map[int16]uint8, xlen) changed = true } if containerLen > 0 { @@ -24644,23 +20410,19 @@ func (_ fastpathT) DecMapInt16Uint8V(v map[int16]uint8, checkNil bool, canChange } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := int16(dd.DecodeInt(16)) - dd.ReadMapKVSeparator() mv := v[mk] mv = uint8(dd.DecodeUint(8)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapInt16Uint16R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapInt16Uint16R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[int16]uint16) v, changed := fastpathTV.DecMapInt16Uint16V(*vp, fastpathCheckNilFalse, true, f.d) @@ -24681,7 +20443,7 @@ func (f fastpathT) DecMapInt16Uint16X(vp *map[int16]uint16, checkNil bool, d *De func (_ fastpathT) DecMapInt16Uint16V(v map[int16]uint16, checkNil bool, canChange bool, d *Decoder) (_ map[int16]uint16, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -24691,11 +20453,8 @@ func (_ fastpathT) DecMapInt16Uint16V(v map[int16]uint16, checkNil bool, canChan containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[int16]uint16, containerLen) - } else { - v = make(map[int16]uint16) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 4) + v = make(map[int16]uint16, xlen) changed = true } if containerLen > 0 { @@ -24709,23 +20468,19 @@ func (_ fastpathT) DecMapInt16Uint16V(v map[int16]uint16, checkNil bool, canChan } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := int16(dd.DecodeInt(16)) - dd.ReadMapKVSeparator() mv := v[mk] mv = uint16(dd.DecodeUint(16)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapInt16Uint32R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapInt16Uint32R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[int16]uint32) v, changed := fastpathTV.DecMapInt16Uint32V(*vp, fastpathCheckNilFalse, true, f.d) @@ -24746,7 +20501,7 @@ func (f fastpathT) DecMapInt16Uint32X(vp *map[int16]uint32, checkNil bool, d *De func (_ fastpathT) DecMapInt16Uint32V(v map[int16]uint32, checkNil bool, canChange bool, d *Decoder) (_ map[int16]uint32, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -24756,11 +20511,8 @@ func (_ fastpathT) DecMapInt16Uint32V(v map[int16]uint32, checkNil bool, canChan containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[int16]uint32, containerLen) - } else { - v = make(map[int16]uint32) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 6) + v = make(map[int16]uint32, xlen) changed = true } if containerLen > 0 { @@ -24774,23 +20526,19 @@ func (_ fastpathT) DecMapInt16Uint32V(v map[int16]uint32, checkNil bool, canChan } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := int16(dd.DecodeInt(16)) - dd.ReadMapKVSeparator() mv := v[mk] mv = uint32(dd.DecodeUint(32)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapInt16Uint64R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapInt16Uint64R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[int16]uint64) v, changed := fastpathTV.DecMapInt16Uint64V(*vp, fastpathCheckNilFalse, true, f.d) @@ -24811,7 +20559,7 @@ func (f fastpathT) DecMapInt16Uint64X(vp *map[int16]uint64, checkNil bool, d *De func (_ fastpathT) DecMapInt16Uint64V(v map[int16]uint64, checkNil bool, canChange bool, d *Decoder) (_ map[int16]uint64, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -24821,11 +20569,8 @@ func (_ fastpathT) DecMapInt16Uint64V(v map[int16]uint64, checkNil bool, canChan containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[int16]uint64, containerLen) - } else { - v = make(map[int16]uint64) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 10) + v = make(map[int16]uint64, xlen) changed = true } if containerLen > 0 { @@ -24839,23 +20584,19 @@ func (_ fastpathT) DecMapInt16Uint64V(v map[int16]uint64, checkNil bool, canChan } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := int16(dd.DecodeInt(16)) - dd.ReadMapKVSeparator() mv := v[mk] mv = dd.DecodeUint(64) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapInt16IntR(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapInt16IntR(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[int16]int) v, changed := fastpathTV.DecMapInt16IntV(*vp, fastpathCheckNilFalse, true, f.d) @@ -24876,7 +20617,7 @@ func (f fastpathT) DecMapInt16IntX(vp *map[int16]int, checkNil bool, d *Decoder) func (_ fastpathT) DecMapInt16IntV(v map[int16]int, checkNil bool, canChange bool, d *Decoder) (_ map[int16]int, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -24886,11 +20627,8 @@ func (_ fastpathT) DecMapInt16IntV(v map[int16]int, checkNil bool, canChange boo containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[int16]int, containerLen) - } else { - v = make(map[int16]int) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 10) + v = make(map[int16]int, xlen) changed = true } if containerLen > 0 { @@ -24904,23 +20642,19 @@ func (_ fastpathT) DecMapInt16IntV(v map[int16]int, checkNil bool, canChange boo } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := int16(dd.DecodeInt(16)) - dd.ReadMapKVSeparator() mv := v[mk] mv = int(dd.DecodeInt(intBitsize)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapInt16Int8R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapInt16Int8R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[int16]int8) v, changed := fastpathTV.DecMapInt16Int8V(*vp, fastpathCheckNilFalse, true, f.d) @@ -24941,7 +20675,7 @@ func (f fastpathT) DecMapInt16Int8X(vp *map[int16]int8, checkNil bool, d *Decode func (_ fastpathT) DecMapInt16Int8V(v map[int16]int8, checkNil bool, canChange bool, d *Decoder) (_ map[int16]int8, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -24951,11 +20685,8 @@ func (_ fastpathT) DecMapInt16Int8V(v map[int16]int8, checkNil bool, canChange b containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[int16]int8, containerLen) - } else { - v = make(map[int16]int8) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 3) + v = make(map[int16]int8, xlen) changed = true } if containerLen > 0 { @@ -24969,23 +20700,19 @@ func (_ fastpathT) DecMapInt16Int8V(v map[int16]int8, checkNil bool, canChange b } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := int16(dd.DecodeInt(16)) - dd.ReadMapKVSeparator() mv := v[mk] mv = int8(dd.DecodeInt(8)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapInt16Int16R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapInt16Int16R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[int16]int16) v, changed := fastpathTV.DecMapInt16Int16V(*vp, fastpathCheckNilFalse, true, f.d) @@ -25006,7 +20733,7 @@ func (f fastpathT) DecMapInt16Int16X(vp *map[int16]int16, checkNil bool, d *Deco func (_ fastpathT) DecMapInt16Int16V(v map[int16]int16, checkNil bool, canChange bool, d *Decoder) (_ map[int16]int16, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -25016,11 +20743,8 @@ func (_ fastpathT) DecMapInt16Int16V(v map[int16]int16, checkNil bool, canChange containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[int16]int16, containerLen) - } else { - v = make(map[int16]int16) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 4) + v = make(map[int16]int16, xlen) changed = true } if containerLen > 0 { @@ -25034,23 +20758,19 @@ func (_ fastpathT) DecMapInt16Int16V(v map[int16]int16, checkNil bool, canChange } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := int16(dd.DecodeInt(16)) - dd.ReadMapKVSeparator() mv := v[mk] mv = int16(dd.DecodeInt(16)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapInt16Int32R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapInt16Int32R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[int16]int32) v, changed := fastpathTV.DecMapInt16Int32V(*vp, fastpathCheckNilFalse, true, f.d) @@ -25071,7 +20791,7 @@ func (f fastpathT) DecMapInt16Int32X(vp *map[int16]int32, checkNil bool, d *Deco func (_ fastpathT) DecMapInt16Int32V(v map[int16]int32, checkNil bool, canChange bool, d *Decoder) (_ map[int16]int32, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -25081,11 +20801,8 @@ func (_ fastpathT) DecMapInt16Int32V(v map[int16]int32, checkNil bool, canChange containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[int16]int32, containerLen) - } else { - v = make(map[int16]int32) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 6) + v = make(map[int16]int32, xlen) changed = true } if containerLen > 0 { @@ -25099,23 +20816,19 @@ func (_ fastpathT) DecMapInt16Int32V(v map[int16]int32, checkNil bool, canChange } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := int16(dd.DecodeInt(16)) - dd.ReadMapKVSeparator() mv := v[mk] mv = int32(dd.DecodeInt(32)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapInt16Int64R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapInt16Int64R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[int16]int64) v, changed := fastpathTV.DecMapInt16Int64V(*vp, fastpathCheckNilFalse, true, f.d) @@ -25136,7 +20849,7 @@ func (f fastpathT) DecMapInt16Int64X(vp *map[int16]int64, checkNil bool, d *Deco func (_ fastpathT) DecMapInt16Int64V(v map[int16]int64, checkNil bool, canChange bool, d *Decoder) (_ map[int16]int64, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -25146,11 +20859,8 @@ func (_ fastpathT) DecMapInt16Int64V(v map[int16]int64, checkNil bool, canChange containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[int16]int64, containerLen) - } else { - v = make(map[int16]int64) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 10) + v = make(map[int16]int64, xlen) changed = true } if containerLen > 0 { @@ -25164,23 +20874,19 @@ func (_ fastpathT) DecMapInt16Int64V(v map[int16]int64, checkNil bool, canChange } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := int16(dd.DecodeInt(16)) - dd.ReadMapKVSeparator() mv := v[mk] mv = dd.DecodeInt(64) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapInt16Float32R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapInt16Float32R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[int16]float32) v, changed := fastpathTV.DecMapInt16Float32V(*vp, fastpathCheckNilFalse, true, f.d) @@ -25201,7 +20907,7 @@ func (f fastpathT) DecMapInt16Float32X(vp *map[int16]float32, checkNil bool, d * func (_ fastpathT) DecMapInt16Float32V(v map[int16]float32, checkNil bool, canChange bool, d *Decoder) (_ map[int16]float32, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -25211,11 +20917,8 @@ func (_ fastpathT) DecMapInt16Float32V(v map[int16]float32, checkNil bool, canCh containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[int16]float32, containerLen) - } else { - v = make(map[int16]float32) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 6) + v = make(map[int16]float32, xlen) changed = true } if containerLen > 0 { @@ -25229,23 +20932,19 @@ func (_ fastpathT) DecMapInt16Float32V(v map[int16]float32, checkNil bool, canCh } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := int16(dd.DecodeInt(16)) - dd.ReadMapKVSeparator() mv := v[mk] mv = float32(dd.DecodeFloat(true)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapInt16Float64R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapInt16Float64R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[int16]float64) v, changed := fastpathTV.DecMapInt16Float64V(*vp, fastpathCheckNilFalse, true, f.d) @@ -25266,7 +20965,7 @@ func (f fastpathT) DecMapInt16Float64X(vp *map[int16]float64, checkNil bool, d * func (_ fastpathT) DecMapInt16Float64V(v map[int16]float64, checkNil bool, canChange bool, d *Decoder) (_ map[int16]float64, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -25276,11 +20975,8 @@ func (_ fastpathT) DecMapInt16Float64V(v map[int16]float64, checkNil bool, canCh containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[int16]float64, containerLen) - } else { - v = make(map[int16]float64) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 10) + v = make(map[int16]float64, xlen) changed = true } if containerLen > 0 { @@ -25294,23 +20990,19 @@ func (_ fastpathT) DecMapInt16Float64V(v map[int16]float64, checkNil bool, canCh } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := int16(dd.DecodeInt(16)) - dd.ReadMapKVSeparator() mv := v[mk] mv = dd.DecodeFloat(false) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapInt16BoolR(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapInt16BoolR(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[int16]bool) v, changed := fastpathTV.DecMapInt16BoolV(*vp, fastpathCheckNilFalse, true, f.d) @@ -25331,7 +21023,7 @@ func (f fastpathT) DecMapInt16BoolX(vp *map[int16]bool, checkNil bool, d *Decode func (_ fastpathT) DecMapInt16BoolV(v map[int16]bool, checkNil bool, canChange bool, d *Decoder) (_ map[int16]bool, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -25341,11 +21033,8 @@ func (_ fastpathT) DecMapInt16BoolV(v map[int16]bool, checkNil bool, canChange b containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[int16]bool, containerLen) - } else { - v = make(map[int16]bool) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 3) + v = make(map[int16]bool, xlen) changed = true } if containerLen > 0 { @@ -25359,23 +21048,19 @@ func (_ fastpathT) DecMapInt16BoolV(v map[int16]bool, checkNil bool, canChange b } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := int16(dd.DecodeInt(16)) - dd.ReadMapKVSeparator() mv := v[mk] mv = dd.DecodeBool() if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapInt32IntfR(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapInt32IntfR(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[int32]interface{}) v, changed := fastpathTV.DecMapInt32IntfV(*vp, fastpathCheckNilFalse, true, f.d) @@ -25396,7 +21081,7 @@ func (f fastpathT) DecMapInt32IntfX(vp *map[int32]interface{}, checkNil bool, d func (_ fastpathT) DecMapInt32IntfV(v map[int32]interface{}, checkNil bool, canChange bool, d *Decoder) (_ map[int32]interface{}, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -25406,11 +21091,8 @@ func (_ fastpathT) DecMapInt32IntfV(v map[int32]interface{}, checkNil bool, canC containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[int32]interface{}, containerLen) - } else { - v = make(map[int32]interface{}) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 20) + v = make(map[int32]interface{}, xlen) changed = true } if containerLen > 0 { @@ -25425,11 +21107,7 @@ func (_ fastpathT) DecMapInt32IntfV(v map[int32]interface{}, checkNil bool, canC } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := int32(dd.DecodeInt(32)) - dd.ReadMapKVSeparator() mv := v[mk] d.decode(&mv) @@ -25437,12 +21115,12 @@ func (_ fastpathT) DecMapInt32IntfV(v map[int32]interface{}, checkNil bool, canC v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapInt32StringR(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapInt32StringR(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[int32]string) v, changed := fastpathTV.DecMapInt32StringV(*vp, fastpathCheckNilFalse, true, f.d) @@ -25463,7 +21141,7 @@ func (f fastpathT) DecMapInt32StringX(vp *map[int32]string, checkNil bool, d *De func (_ fastpathT) DecMapInt32StringV(v map[int32]string, checkNil bool, canChange bool, d *Decoder) (_ map[int32]string, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -25473,11 +21151,8 @@ func (_ fastpathT) DecMapInt32StringV(v map[int32]string, checkNil bool, canChan containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[int32]string, containerLen) - } else { - v = make(map[int32]string) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 20) + v = make(map[int32]string, xlen) changed = true } if containerLen > 0 { @@ -25491,23 +21166,19 @@ func (_ fastpathT) DecMapInt32StringV(v map[int32]string, checkNil bool, canChan } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := int32(dd.DecodeInt(32)) - dd.ReadMapKVSeparator() mv := v[mk] mv = dd.DecodeString() if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapInt32UintR(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapInt32UintR(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[int32]uint) v, changed := fastpathTV.DecMapInt32UintV(*vp, fastpathCheckNilFalse, true, f.d) @@ -25528,7 +21199,7 @@ func (f fastpathT) DecMapInt32UintX(vp *map[int32]uint, checkNil bool, d *Decode func (_ fastpathT) DecMapInt32UintV(v map[int32]uint, checkNil bool, canChange bool, d *Decoder) (_ map[int32]uint, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -25538,11 +21209,8 @@ func (_ fastpathT) DecMapInt32UintV(v map[int32]uint, checkNil bool, canChange b containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[int32]uint, containerLen) - } else { - v = make(map[int32]uint) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 12) + v = make(map[int32]uint, xlen) changed = true } if containerLen > 0 { @@ -25556,23 +21224,19 @@ func (_ fastpathT) DecMapInt32UintV(v map[int32]uint, checkNil bool, canChange b } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := int32(dd.DecodeInt(32)) - dd.ReadMapKVSeparator() mv := v[mk] mv = uint(dd.DecodeUint(uintBitsize)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapInt32Uint8R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapInt32Uint8R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[int32]uint8) v, changed := fastpathTV.DecMapInt32Uint8V(*vp, fastpathCheckNilFalse, true, f.d) @@ -25593,7 +21257,7 @@ func (f fastpathT) DecMapInt32Uint8X(vp *map[int32]uint8, checkNil bool, d *Deco func (_ fastpathT) DecMapInt32Uint8V(v map[int32]uint8, checkNil bool, canChange bool, d *Decoder) (_ map[int32]uint8, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -25603,11 +21267,8 @@ func (_ fastpathT) DecMapInt32Uint8V(v map[int32]uint8, checkNil bool, canChange containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[int32]uint8, containerLen) - } else { - v = make(map[int32]uint8) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 5) + v = make(map[int32]uint8, xlen) changed = true } if containerLen > 0 { @@ -25621,23 +21282,19 @@ func (_ fastpathT) DecMapInt32Uint8V(v map[int32]uint8, checkNil bool, canChange } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := int32(dd.DecodeInt(32)) - dd.ReadMapKVSeparator() mv := v[mk] mv = uint8(dd.DecodeUint(8)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapInt32Uint16R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapInt32Uint16R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[int32]uint16) v, changed := fastpathTV.DecMapInt32Uint16V(*vp, fastpathCheckNilFalse, true, f.d) @@ -25658,7 +21315,7 @@ func (f fastpathT) DecMapInt32Uint16X(vp *map[int32]uint16, checkNil bool, d *De func (_ fastpathT) DecMapInt32Uint16V(v map[int32]uint16, checkNil bool, canChange bool, d *Decoder) (_ map[int32]uint16, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -25668,11 +21325,8 @@ func (_ fastpathT) DecMapInt32Uint16V(v map[int32]uint16, checkNil bool, canChan containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[int32]uint16, containerLen) - } else { - v = make(map[int32]uint16) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 6) + v = make(map[int32]uint16, xlen) changed = true } if containerLen > 0 { @@ -25686,23 +21340,19 @@ func (_ fastpathT) DecMapInt32Uint16V(v map[int32]uint16, checkNil bool, canChan } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := int32(dd.DecodeInt(32)) - dd.ReadMapKVSeparator() mv := v[mk] mv = uint16(dd.DecodeUint(16)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapInt32Uint32R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapInt32Uint32R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[int32]uint32) v, changed := fastpathTV.DecMapInt32Uint32V(*vp, fastpathCheckNilFalse, true, f.d) @@ -25723,7 +21373,7 @@ func (f fastpathT) DecMapInt32Uint32X(vp *map[int32]uint32, checkNil bool, d *De func (_ fastpathT) DecMapInt32Uint32V(v map[int32]uint32, checkNil bool, canChange bool, d *Decoder) (_ map[int32]uint32, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -25733,11 +21383,8 @@ func (_ fastpathT) DecMapInt32Uint32V(v map[int32]uint32, checkNil bool, canChan containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[int32]uint32, containerLen) - } else { - v = make(map[int32]uint32) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 8) + v = make(map[int32]uint32, xlen) changed = true } if containerLen > 0 { @@ -25751,23 +21398,19 @@ func (_ fastpathT) DecMapInt32Uint32V(v map[int32]uint32, checkNil bool, canChan } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := int32(dd.DecodeInt(32)) - dd.ReadMapKVSeparator() mv := v[mk] mv = uint32(dd.DecodeUint(32)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapInt32Uint64R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapInt32Uint64R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[int32]uint64) v, changed := fastpathTV.DecMapInt32Uint64V(*vp, fastpathCheckNilFalse, true, f.d) @@ -25788,7 +21431,7 @@ func (f fastpathT) DecMapInt32Uint64X(vp *map[int32]uint64, checkNil bool, d *De func (_ fastpathT) DecMapInt32Uint64V(v map[int32]uint64, checkNil bool, canChange bool, d *Decoder) (_ map[int32]uint64, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -25798,11 +21441,8 @@ func (_ fastpathT) DecMapInt32Uint64V(v map[int32]uint64, checkNil bool, canChan containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[int32]uint64, containerLen) - } else { - v = make(map[int32]uint64) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 12) + v = make(map[int32]uint64, xlen) changed = true } if containerLen > 0 { @@ -25816,23 +21456,19 @@ func (_ fastpathT) DecMapInt32Uint64V(v map[int32]uint64, checkNil bool, canChan } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := int32(dd.DecodeInt(32)) - dd.ReadMapKVSeparator() mv := v[mk] mv = dd.DecodeUint(64) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapInt32IntR(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapInt32IntR(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[int32]int) v, changed := fastpathTV.DecMapInt32IntV(*vp, fastpathCheckNilFalse, true, f.d) @@ -25853,7 +21489,7 @@ func (f fastpathT) DecMapInt32IntX(vp *map[int32]int, checkNil bool, d *Decoder) func (_ fastpathT) DecMapInt32IntV(v map[int32]int, checkNil bool, canChange bool, d *Decoder) (_ map[int32]int, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -25863,11 +21499,8 @@ func (_ fastpathT) DecMapInt32IntV(v map[int32]int, checkNil bool, canChange boo containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[int32]int, containerLen) - } else { - v = make(map[int32]int) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 12) + v = make(map[int32]int, xlen) changed = true } if containerLen > 0 { @@ -25881,23 +21514,19 @@ func (_ fastpathT) DecMapInt32IntV(v map[int32]int, checkNil bool, canChange boo } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := int32(dd.DecodeInt(32)) - dd.ReadMapKVSeparator() mv := v[mk] mv = int(dd.DecodeInt(intBitsize)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapInt32Int8R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapInt32Int8R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[int32]int8) v, changed := fastpathTV.DecMapInt32Int8V(*vp, fastpathCheckNilFalse, true, f.d) @@ -25918,7 +21547,7 @@ func (f fastpathT) DecMapInt32Int8X(vp *map[int32]int8, checkNil bool, d *Decode func (_ fastpathT) DecMapInt32Int8V(v map[int32]int8, checkNil bool, canChange bool, d *Decoder) (_ map[int32]int8, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -25928,11 +21557,8 @@ func (_ fastpathT) DecMapInt32Int8V(v map[int32]int8, checkNil bool, canChange b containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[int32]int8, containerLen) - } else { - v = make(map[int32]int8) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 5) + v = make(map[int32]int8, xlen) changed = true } if containerLen > 0 { @@ -25946,23 +21572,19 @@ func (_ fastpathT) DecMapInt32Int8V(v map[int32]int8, checkNil bool, canChange b } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := int32(dd.DecodeInt(32)) - dd.ReadMapKVSeparator() mv := v[mk] mv = int8(dd.DecodeInt(8)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapInt32Int16R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapInt32Int16R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[int32]int16) v, changed := fastpathTV.DecMapInt32Int16V(*vp, fastpathCheckNilFalse, true, f.d) @@ -25983,7 +21605,7 @@ func (f fastpathT) DecMapInt32Int16X(vp *map[int32]int16, checkNil bool, d *Deco func (_ fastpathT) DecMapInt32Int16V(v map[int32]int16, checkNil bool, canChange bool, d *Decoder) (_ map[int32]int16, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -25993,11 +21615,8 @@ func (_ fastpathT) DecMapInt32Int16V(v map[int32]int16, checkNil bool, canChange containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[int32]int16, containerLen) - } else { - v = make(map[int32]int16) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 6) + v = make(map[int32]int16, xlen) changed = true } if containerLen > 0 { @@ -26011,23 +21630,19 @@ func (_ fastpathT) DecMapInt32Int16V(v map[int32]int16, checkNil bool, canChange } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := int32(dd.DecodeInt(32)) - dd.ReadMapKVSeparator() mv := v[mk] mv = int16(dd.DecodeInt(16)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapInt32Int32R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapInt32Int32R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[int32]int32) v, changed := fastpathTV.DecMapInt32Int32V(*vp, fastpathCheckNilFalse, true, f.d) @@ -26048,7 +21663,7 @@ func (f fastpathT) DecMapInt32Int32X(vp *map[int32]int32, checkNil bool, d *Deco func (_ fastpathT) DecMapInt32Int32V(v map[int32]int32, checkNil bool, canChange bool, d *Decoder) (_ map[int32]int32, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -26058,11 +21673,8 @@ func (_ fastpathT) DecMapInt32Int32V(v map[int32]int32, checkNil bool, canChange containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[int32]int32, containerLen) - } else { - v = make(map[int32]int32) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 8) + v = make(map[int32]int32, xlen) changed = true } if containerLen > 0 { @@ -26076,23 +21688,19 @@ func (_ fastpathT) DecMapInt32Int32V(v map[int32]int32, checkNil bool, canChange } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := int32(dd.DecodeInt(32)) - dd.ReadMapKVSeparator() mv := v[mk] mv = int32(dd.DecodeInt(32)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapInt32Int64R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapInt32Int64R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[int32]int64) v, changed := fastpathTV.DecMapInt32Int64V(*vp, fastpathCheckNilFalse, true, f.d) @@ -26113,7 +21721,7 @@ func (f fastpathT) DecMapInt32Int64X(vp *map[int32]int64, checkNil bool, d *Deco func (_ fastpathT) DecMapInt32Int64V(v map[int32]int64, checkNil bool, canChange bool, d *Decoder) (_ map[int32]int64, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -26123,11 +21731,8 @@ func (_ fastpathT) DecMapInt32Int64V(v map[int32]int64, checkNil bool, canChange containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[int32]int64, containerLen) - } else { - v = make(map[int32]int64) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 12) + v = make(map[int32]int64, xlen) changed = true } if containerLen > 0 { @@ -26141,23 +21746,19 @@ func (_ fastpathT) DecMapInt32Int64V(v map[int32]int64, checkNil bool, canChange } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := int32(dd.DecodeInt(32)) - dd.ReadMapKVSeparator() mv := v[mk] mv = dd.DecodeInt(64) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapInt32Float32R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapInt32Float32R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[int32]float32) v, changed := fastpathTV.DecMapInt32Float32V(*vp, fastpathCheckNilFalse, true, f.d) @@ -26178,7 +21779,7 @@ func (f fastpathT) DecMapInt32Float32X(vp *map[int32]float32, checkNil bool, d * func (_ fastpathT) DecMapInt32Float32V(v map[int32]float32, checkNil bool, canChange bool, d *Decoder) (_ map[int32]float32, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -26188,11 +21789,8 @@ func (_ fastpathT) DecMapInt32Float32V(v map[int32]float32, checkNil bool, canCh containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[int32]float32, containerLen) - } else { - v = make(map[int32]float32) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 8) + v = make(map[int32]float32, xlen) changed = true } if containerLen > 0 { @@ -26206,23 +21804,19 @@ func (_ fastpathT) DecMapInt32Float32V(v map[int32]float32, checkNil bool, canCh } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := int32(dd.DecodeInt(32)) - dd.ReadMapKVSeparator() mv := v[mk] mv = float32(dd.DecodeFloat(true)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapInt32Float64R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapInt32Float64R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[int32]float64) v, changed := fastpathTV.DecMapInt32Float64V(*vp, fastpathCheckNilFalse, true, f.d) @@ -26243,7 +21837,7 @@ func (f fastpathT) DecMapInt32Float64X(vp *map[int32]float64, checkNil bool, d * func (_ fastpathT) DecMapInt32Float64V(v map[int32]float64, checkNil bool, canChange bool, d *Decoder) (_ map[int32]float64, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -26253,11 +21847,8 @@ func (_ fastpathT) DecMapInt32Float64V(v map[int32]float64, checkNil bool, canCh containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[int32]float64, containerLen) - } else { - v = make(map[int32]float64) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 12) + v = make(map[int32]float64, xlen) changed = true } if containerLen > 0 { @@ -26271,23 +21862,19 @@ func (_ fastpathT) DecMapInt32Float64V(v map[int32]float64, checkNil bool, canCh } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := int32(dd.DecodeInt(32)) - dd.ReadMapKVSeparator() mv := v[mk] mv = dd.DecodeFloat(false) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapInt32BoolR(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapInt32BoolR(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[int32]bool) v, changed := fastpathTV.DecMapInt32BoolV(*vp, fastpathCheckNilFalse, true, f.d) @@ -26308,7 +21895,7 @@ func (f fastpathT) DecMapInt32BoolX(vp *map[int32]bool, checkNil bool, d *Decode func (_ fastpathT) DecMapInt32BoolV(v map[int32]bool, checkNil bool, canChange bool, d *Decoder) (_ map[int32]bool, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -26318,11 +21905,8 @@ func (_ fastpathT) DecMapInt32BoolV(v map[int32]bool, checkNil bool, canChange b containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[int32]bool, containerLen) - } else { - v = make(map[int32]bool) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 5) + v = make(map[int32]bool, xlen) changed = true } if containerLen > 0 { @@ -26336,23 +21920,19 @@ func (_ fastpathT) DecMapInt32BoolV(v map[int32]bool, checkNil bool, canChange b } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := int32(dd.DecodeInt(32)) - dd.ReadMapKVSeparator() mv := v[mk] mv = dd.DecodeBool() if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapInt64IntfR(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapInt64IntfR(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[int64]interface{}) v, changed := fastpathTV.DecMapInt64IntfV(*vp, fastpathCheckNilFalse, true, f.d) @@ -26373,7 +21953,7 @@ func (f fastpathT) DecMapInt64IntfX(vp *map[int64]interface{}, checkNil bool, d func (_ fastpathT) DecMapInt64IntfV(v map[int64]interface{}, checkNil bool, canChange bool, d *Decoder) (_ map[int64]interface{}, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -26383,11 +21963,8 @@ func (_ fastpathT) DecMapInt64IntfV(v map[int64]interface{}, checkNil bool, canC containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[int64]interface{}, containerLen) - } else { - v = make(map[int64]interface{}) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 24) + v = make(map[int64]interface{}, xlen) changed = true } if containerLen > 0 { @@ -26402,11 +21979,7 @@ func (_ fastpathT) DecMapInt64IntfV(v map[int64]interface{}, checkNil bool, canC } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := dd.DecodeInt(64) - dd.ReadMapKVSeparator() mv := v[mk] d.decode(&mv) @@ -26414,12 +21987,12 @@ func (_ fastpathT) DecMapInt64IntfV(v map[int64]interface{}, checkNil bool, canC v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapInt64StringR(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapInt64StringR(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[int64]string) v, changed := fastpathTV.DecMapInt64StringV(*vp, fastpathCheckNilFalse, true, f.d) @@ -26440,7 +22013,7 @@ func (f fastpathT) DecMapInt64StringX(vp *map[int64]string, checkNil bool, d *De func (_ fastpathT) DecMapInt64StringV(v map[int64]string, checkNil bool, canChange bool, d *Decoder) (_ map[int64]string, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -26450,11 +22023,8 @@ func (_ fastpathT) DecMapInt64StringV(v map[int64]string, checkNil bool, canChan containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[int64]string, containerLen) - } else { - v = make(map[int64]string) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 24) + v = make(map[int64]string, xlen) changed = true } if containerLen > 0 { @@ -26468,23 +22038,19 @@ func (_ fastpathT) DecMapInt64StringV(v map[int64]string, checkNil bool, canChan } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := dd.DecodeInt(64) - dd.ReadMapKVSeparator() mv := v[mk] mv = dd.DecodeString() if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapInt64UintR(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapInt64UintR(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[int64]uint) v, changed := fastpathTV.DecMapInt64UintV(*vp, fastpathCheckNilFalse, true, f.d) @@ -26505,7 +22071,7 @@ func (f fastpathT) DecMapInt64UintX(vp *map[int64]uint, checkNil bool, d *Decode func (_ fastpathT) DecMapInt64UintV(v map[int64]uint, checkNil bool, canChange bool, d *Decoder) (_ map[int64]uint, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -26515,11 +22081,8 @@ func (_ fastpathT) DecMapInt64UintV(v map[int64]uint, checkNil bool, canChange b containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[int64]uint, containerLen) - } else { - v = make(map[int64]uint) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 16) + v = make(map[int64]uint, xlen) changed = true } if containerLen > 0 { @@ -26533,23 +22096,19 @@ func (_ fastpathT) DecMapInt64UintV(v map[int64]uint, checkNil bool, canChange b } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := dd.DecodeInt(64) - dd.ReadMapKVSeparator() mv := v[mk] mv = uint(dd.DecodeUint(uintBitsize)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapInt64Uint8R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapInt64Uint8R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[int64]uint8) v, changed := fastpathTV.DecMapInt64Uint8V(*vp, fastpathCheckNilFalse, true, f.d) @@ -26570,7 +22129,7 @@ func (f fastpathT) DecMapInt64Uint8X(vp *map[int64]uint8, checkNil bool, d *Deco func (_ fastpathT) DecMapInt64Uint8V(v map[int64]uint8, checkNil bool, canChange bool, d *Decoder) (_ map[int64]uint8, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -26580,11 +22139,8 @@ func (_ fastpathT) DecMapInt64Uint8V(v map[int64]uint8, checkNil bool, canChange containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[int64]uint8, containerLen) - } else { - v = make(map[int64]uint8) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 9) + v = make(map[int64]uint8, xlen) changed = true } if containerLen > 0 { @@ -26598,23 +22154,19 @@ func (_ fastpathT) DecMapInt64Uint8V(v map[int64]uint8, checkNil bool, canChange } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := dd.DecodeInt(64) - dd.ReadMapKVSeparator() mv := v[mk] mv = uint8(dd.DecodeUint(8)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapInt64Uint16R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapInt64Uint16R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[int64]uint16) v, changed := fastpathTV.DecMapInt64Uint16V(*vp, fastpathCheckNilFalse, true, f.d) @@ -26635,7 +22187,7 @@ func (f fastpathT) DecMapInt64Uint16X(vp *map[int64]uint16, checkNil bool, d *De func (_ fastpathT) DecMapInt64Uint16V(v map[int64]uint16, checkNil bool, canChange bool, d *Decoder) (_ map[int64]uint16, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -26645,11 +22197,8 @@ func (_ fastpathT) DecMapInt64Uint16V(v map[int64]uint16, checkNil bool, canChan containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[int64]uint16, containerLen) - } else { - v = make(map[int64]uint16) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 10) + v = make(map[int64]uint16, xlen) changed = true } if containerLen > 0 { @@ -26663,23 +22212,19 @@ func (_ fastpathT) DecMapInt64Uint16V(v map[int64]uint16, checkNil bool, canChan } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := dd.DecodeInt(64) - dd.ReadMapKVSeparator() mv := v[mk] mv = uint16(dd.DecodeUint(16)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapInt64Uint32R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapInt64Uint32R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[int64]uint32) v, changed := fastpathTV.DecMapInt64Uint32V(*vp, fastpathCheckNilFalse, true, f.d) @@ -26700,7 +22245,7 @@ func (f fastpathT) DecMapInt64Uint32X(vp *map[int64]uint32, checkNil bool, d *De func (_ fastpathT) DecMapInt64Uint32V(v map[int64]uint32, checkNil bool, canChange bool, d *Decoder) (_ map[int64]uint32, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -26710,11 +22255,8 @@ func (_ fastpathT) DecMapInt64Uint32V(v map[int64]uint32, checkNil bool, canChan containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[int64]uint32, containerLen) - } else { - v = make(map[int64]uint32) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 12) + v = make(map[int64]uint32, xlen) changed = true } if containerLen > 0 { @@ -26728,23 +22270,19 @@ func (_ fastpathT) DecMapInt64Uint32V(v map[int64]uint32, checkNil bool, canChan } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := dd.DecodeInt(64) - dd.ReadMapKVSeparator() mv := v[mk] mv = uint32(dd.DecodeUint(32)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapInt64Uint64R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapInt64Uint64R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[int64]uint64) v, changed := fastpathTV.DecMapInt64Uint64V(*vp, fastpathCheckNilFalse, true, f.d) @@ -26765,7 +22303,7 @@ func (f fastpathT) DecMapInt64Uint64X(vp *map[int64]uint64, checkNil bool, d *De func (_ fastpathT) DecMapInt64Uint64V(v map[int64]uint64, checkNil bool, canChange bool, d *Decoder) (_ map[int64]uint64, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -26775,11 +22313,8 @@ func (_ fastpathT) DecMapInt64Uint64V(v map[int64]uint64, checkNil bool, canChan containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[int64]uint64, containerLen) - } else { - v = make(map[int64]uint64) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 16) + v = make(map[int64]uint64, xlen) changed = true } if containerLen > 0 { @@ -26793,23 +22328,19 @@ func (_ fastpathT) DecMapInt64Uint64V(v map[int64]uint64, checkNil bool, canChan } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := dd.DecodeInt(64) - dd.ReadMapKVSeparator() mv := v[mk] mv = dd.DecodeUint(64) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapInt64IntR(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapInt64IntR(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[int64]int) v, changed := fastpathTV.DecMapInt64IntV(*vp, fastpathCheckNilFalse, true, f.d) @@ -26830,7 +22361,7 @@ func (f fastpathT) DecMapInt64IntX(vp *map[int64]int, checkNil bool, d *Decoder) func (_ fastpathT) DecMapInt64IntV(v map[int64]int, checkNil bool, canChange bool, d *Decoder) (_ map[int64]int, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -26840,11 +22371,8 @@ func (_ fastpathT) DecMapInt64IntV(v map[int64]int, checkNil bool, canChange boo containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[int64]int, containerLen) - } else { - v = make(map[int64]int) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 16) + v = make(map[int64]int, xlen) changed = true } if containerLen > 0 { @@ -26858,23 +22386,19 @@ func (_ fastpathT) DecMapInt64IntV(v map[int64]int, checkNil bool, canChange boo } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := dd.DecodeInt(64) - dd.ReadMapKVSeparator() mv := v[mk] mv = int(dd.DecodeInt(intBitsize)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapInt64Int8R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapInt64Int8R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[int64]int8) v, changed := fastpathTV.DecMapInt64Int8V(*vp, fastpathCheckNilFalse, true, f.d) @@ -26895,7 +22419,7 @@ func (f fastpathT) DecMapInt64Int8X(vp *map[int64]int8, checkNil bool, d *Decode func (_ fastpathT) DecMapInt64Int8V(v map[int64]int8, checkNil bool, canChange bool, d *Decoder) (_ map[int64]int8, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -26905,11 +22429,8 @@ func (_ fastpathT) DecMapInt64Int8V(v map[int64]int8, checkNil bool, canChange b containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[int64]int8, containerLen) - } else { - v = make(map[int64]int8) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 9) + v = make(map[int64]int8, xlen) changed = true } if containerLen > 0 { @@ -26923,23 +22444,19 @@ func (_ fastpathT) DecMapInt64Int8V(v map[int64]int8, checkNil bool, canChange b } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := dd.DecodeInt(64) - dd.ReadMapKVSeparator() mv := v[mk] mv = int8(dd.DecodeInt(8)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapInt64Int16R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapInt64Int16R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[int64]int16) v, changed := fastpathTV.DecMapInt64Int16V(*vp, fastpathCheckNilFalse, true, f.d) @@ -26960,7 +22477,7 @@ func (f fastpathT) DecMapInt64Int16X(vp *map[int64]int16, checkNil bool, d *Deco func (_ fastpathT) DecMapInt64Int16V(v map[int64]int16, checkNil bool, canChange bool, d *Decoder) (_ map[int64]int16, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -26970,11 +22487,8 @@ func (_ fastpathT) DecMapInt64Int16V(v map[int64]int16, checkNil bool, canChange containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[int64]int16, containerLen) - } else { - v = make(map[int64]int16) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 10) + v = make(map[int64]int16, xlen) changed = true } if containerLen > 0 { @@ -26988,23 +22502,19 @@ func (_ fastpathT) DecMapInt64Int16V(v map[int64]int16, checkNil bool, canChange } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := dd.DecodeInt(64) - dd.ReadMapKVSeparator() mv := v[mk] mv = int16(dd.DecodeInt(16)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapInt64Int32R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapInt64Int32R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[int64]int32) v, changed := fastpathTV.DecMapInt64Int32V(*vp, fastpathCheckNilFalse, true, f.d) @@ -27025,7 +22535,7 @@ func (f fastpathT) DecMapInt64Int32X(vp *map[int64]int32, checkNil bool, d *Deco func (_ fastpathT) DecMapInt64Int32V(v map[int64]int32, checkNil bool, canChange bool, d *Decoder) (_ map[int64]int32, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -27035,11 +22545,8 @@ func (_ fastpathT) DecMapInt64Int32V(v map[int64]int32, checkNil bool, canChange containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[int64]int32, containerLen) - } else { - v = make(map[int64]int32) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 12) + v = make(map[int64]int32, xlen) changed = true } if containerLen > 0 { @@ -27053,23 +22560,19 @@ func (_ fastpathT) DecMapInt64Int32V(v map[int64]int32, checkNil bool, canChange } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := dd.DecodeInt(64) - dd.ReadMapKVSeparator() mv := v[mk] mv = int32(dd.DecodeInt(32)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapInt64Int64R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapInt64Int64R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[int64]int64) v, changed := fastpathTV.DecMapInt64Int64V(*vp, fastpathCheckNilFalse, true, f.d) @@ -27090,7 +22593,7 @@ func (f fastpathT) DecMapInt64Int64X(vp *map[int64]int64, checkNil bool, d *Deco func (_ fastpathT) DecMapInt64Int64V(v map[int64]int64, checkNil bool, canChange bool, d *Decoder) (_ map[int64]int64, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -27100,11 +22603,8 @@ func (_ fastpathT) DecMapInt64Int64V(v map[int64]int64, checkNil bool, canChange containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[int64]int64, containerLen) - } else { - v = make(map[int64]int64) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 16) + v = make(map[int64]int64, xlen) changed = true } if containerLen > 0 { @@ -27118,23 +22618,19 @@ func (_ fastpathT) DecMapInt64Int64V(v map[int64]int64, checkNil bool, canChange } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := dd.DecodeInt(64) - dd.ReadMapKVSeparator() mv := v[mk] mv = dd.DecodeInt(64) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapInt64Float32R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapInt64Float32R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[int64]float32) v, changed := fastpathTV.DecMapInt64Float32V(*vp, fastpathCheckNilFalse, true, f.d) @@ -27155,7 +22651,7 @@ func (f fastpathT) DecMapInt64Float32X(vp *map[int64]float32, checkNil bool, d * func (_ fastpathT) DecMapInt64Float32V(v map[int64]float32, checkNil bool, canChange bool, d *Decoder) (_ map[int64]float32, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -27165,11 +22661,8 @@ func (_ fastpathT) DecMapInt64Float32V(v map[int64]float32, checkNil bool, canCh containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[int64]float32, containerLen) - } else { - v = make(map[int64]float32) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 12) + v = make(map[int64]float32, xlen) changed = true } if containerLen > 0 { @@ -27183,23 +22676,19 @@ func (_ fastpathT) DecMapInt64Float32V(v map[int64]float32, checkNil bool, canCh } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := dd.DecodeInt(64) - dd.ReadMapKVSeparator() mv := v[mk] mv = float32(dd.DecodeFloat(true)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapInt64Float64R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapInt64Float64R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[int64]float64) v, changed := fastpathTV.DecMapInt64Float64V(*vp, fastpathCheckNilFalse, true, f.d) @@ -27220,7 +22709,7 @@ func (f fastpathT) DecMapInt64Float64X(vp *map[int64]float64, checkNil bool, d * func (_ fastpathT) DecMapInt64Float64V(v map[int64]float64, checkNil bool, canChange bool, d *Decoder) (_ map[int64]float64, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -27230,11 +22719,8 @@ func (_ fastpathT) DecMapInt64Float64V(v map[int64]float64, checkNil bool, canCh containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[int64]float64, containerLen) - } else { - v = make(map[int64]float64) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 16) + v = make(map[int64]float64, xlen) changed = true } if containerLen > 0 { @@ -27248,23 +22734,19 @@ func (_ fastpathT) DecMapInt64Float64V(v map[int64]float64, checkNil bool, canCh } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := dd.DecodeInt(64) - dd.ReadMapKVSeparator() mv := v[mk] mv = dd.DecodeFloat(false) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapInt64BoolR(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapInt64BoolR(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[int64]bool) v, changed := fastpathTV.DecMapInt64BoolV(*vp, fastpathCheckNilFalse, true, f.d) @@ -27285,7 +22767,7 @@ func (f fastpathT) DecMapInt64BoolX(vp *map[int64]bool, checkNil bool, d *Decode func (_ fastpathT) DecMapInt64BoolV(v map[int64]bool, checkNil bool, canChange bool, d *Decoder) (_ map[int64]bool, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -27295,11 +22777,8 @@ func (_ fastpathT) DecMapInt64BoolV(v map[int64]bool, checkNil bool, canChange b containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[int64]bool, containerLen) - } else { - v = make(map[int64]bool) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 9) + v = make(map[int64]bool, xlen) changed = true } if containerLen > 0 { @@ -27313,23 +22792,19 @@ func (_ fastpathT) DecMapInt64BoolV(v map[int64]bool, checkNil bool, canChange b } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := dd.DecodeInt(64) - dd.ReadMapKVSeparator() mv := v[mk] mv = dd.DecodeBool() if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapBoolIntfR(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapBoolIntfR(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[bool]interface{}) v, changed := fastpathTV.DecMapBoolIntfV(*vp, fastpathCheckNilFalse, true, f.d) @@ -27350,7 +22825,7 @@ func (f fastpathT) DecMapBoolIntfX(vp *map[bool]interface{}, checkNil bool, d *D func (_ fastpathT) DecMapBoolIntfV(v map[bool]interface{}, checkNil bool, canChange bool, d *Decoder) (_ map[bool]interface{}, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -27360,11 +22835,8 @@ func (_ fastpathT) DecMapBoolIntfV(v map[bool]interface{}, checkNil bool, canCha containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[bool]interface{}, containerLen) - } else { - v = make(map[bool]interface{}) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 17) + v = make(map[bool]interface{}, xlen) changed = true } if containerLen > 0 { @@ -27379,11 +22851,7 @@ func (_ fastpathT) DecMapBoolIntfV(v map[bool]interface{}, checkNil bool, canCha } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := dd.DecodeBool() - dd.ReadMapKVSeparator() mv := v[mk] d.decode(&mv) @@ -27391,12 +22859,12 @@ func (_ fastpathT) DecMapBoolIntfV(v map[bool]interface{}, checkNil bool, canCha v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapBoolStringR(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapBoolStringR(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[bool]string) v, changed := fastpathTV.DecMapBoolStringV(*vp, fastpathCheckNilFalse, true, f.d) @@ -27417,7 +22885,7 @@ func (f fastpathT) DecMapBoolStringX(vp *map[bool]string, checkNil bool, d *Deco func (_ fastpathT) DecMapBoolStringV(v map[bool]string, checkNil bool, canChange bool, d *Decoder) (_ map[bool]string, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -27427,11 +22895,8 @@ func (_ fastpathT) DecMapBoolStringV(v map[bool]string, checkNil bool, canChange containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[bool]string, containerLen) - } else { - v = make(map[bool]string) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 17) + v = make(map[bool]string, xlen) changed = true } if containerLen > 0 { @@ -27445,23 +22910,19 @@ func (_ fastpathT) DecMapBoolStringV(v map[bool]string, checkNil bool, canChange } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := dd.DecodeBool() - dd.ReadMapKVSeparator() mv := v[mk] mv = dd.DecodeString() if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapBoolUintR(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapBoolUintR(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[bool]uint) v, changed := fastpathTV.DecMapBoolUintV(*vp, fastpathCheckNilFalse, true, f.d) @@ -27482,7 +22943,7 @@ func (f fastpathT) DecMapBoolUintX(vp *map[bool]uint, checkNil bool, d *Decoder) func (_ fastpathT) DecMapBoolUintV(v map[bool]uint, checkNil bool, canChange bool, d *Decoder) (_ map[bool]uint, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -27492,11 +22953,8 @@ func (_ fastpathT) DecMapBoolUintV(v map[bool]uint, checkNil bool, canChange boo containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[bool]uint, containerLen) - } else { - v = make(map[bool]uint) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 9) + v = make(map[bool]uint, xlen) changed = true } if containerLen > 0 { @@ -27510,23 +22968,19 @@ func (_ fastpathT) DecMapBoolUintV(v map[bool]uint, checkNil bool, canChange boo } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := dd.DecodeBool() - dd.ReadMapKVSeparator() mv := v[mk] mv = uint(dd.DecodeUint(uintBitsize)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapBoolUint8R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapBoolUint8R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[bool]uint8) v, changed := fastpathTV.DecMapBoolUint8V(*vp, fastpathCheckNilFalse, true, f.d) @@ -27547,7 +23001,7 @@ func (f fastpathT) DecMapBoolUint8X(vp *map[bool]uint8, checkNil bool, d *Decode func (_ fastpathT) DecMapBoolUint8V(v map[bool]uint8, checkNil bool, canChange bool, d *Decoder) (_ map[bool]uint8, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -27557,11 +23011,8 @@ func (_ fastpathT) DecMapBoolUint8V(v map[bool]uint8, checkNil bool, canChange b containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[bool]uint8, containerLen) - } else { - v = make(map[bool]uint8) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 2) + v = make(map[bool]uint8, xlen) changed = true } if containerLen > 0 { @@ -27575,23 +23026,19 @@ func (_ fastpathT) DecMapBoolUint8V(v map[bool]uint8, checkNil bool, canChange b } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := dd.DecodeBool() - dd.ReadMapKVSeparator() mv := v[mk] mv = uint8(dd.DecodeUint(8)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapBoolUint16R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapBoolUint16R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[bool]uint16) v, changed := fastpathTV.DecMapBoolUint16V(*vp, fastpathCheckNilFalse, true, f.d) @@ -27612,7 +23059,7 @@ func (f fastpathT) DecMapBoolUint16X(vp *map[bool]uint16, checkNil bool, d *Deco func (_ fastpathT) DecMapBoolUint16V(v map[bool]uint16, checkNil bool, canChange bool, d *Decoder) (_ map[bool]uint16, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -27622,11 +23069,8 @@ func (_ fastpathT) DecMapBoolUint16V(v map[bool]uint16, checkNil bool, canChange containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[bool]uint16, containerLen) - } else { - v = make(map[bool]uint16) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 3) + v = make(map[bool]uint16, xlen) changed = true } if containerLen > 0 { @@ -27640,23 +23084,19 @@ func (_ fastpathT) DecMapBoolUint16V(v map[bool]uint16, checkNil bool, canChange } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := dd.DecodeBool() - dd.ReadMapKVSeparator() mv := v[mk] mv = uint16(dd.DecodeUint(16)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapBoolUint32R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapBoolUint32R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[bool]uint32) v, changed := fastpathTV.DecMapBoolUint32V(*vp, fastpathCheckNilFalse, true, f.d) @@ -27677,7 +23117,7 @@ func (f fastpathT) DecMapBoolUint32X(vp *map[bool]uint32, checkNil bool, d *Deco func (_ fastpathT) DecMapBoolUint32V(v map[bool]uint32, checkNil bool, canChange bool, d *Decoder) (_ map[bool]uint32, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -27687,11 +23127,8 @@ func (_ fastpathT) DecMapBoolUint32V(v map[bool]uint32, checkNil bool, canChange containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[bool]uint32, containerLen) - } else { - v = make(map[bool]uint32) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 5) + v = make(map[bool]uint32, xlen) changed = true } if containerLen > 0 { @@ -27705,23 +23142,19 @@ func (_ fastpathT) DecMapBoolUint32V(v map[bool]uint32, checkNil bool, canChange } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := dd.DecodeBool() - dd.ReadMapKVSeparator() mv := v[mk] mv = uint32(dd.DecodeUint(32)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapBoolUint64R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapBoolUint64R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[bool]uint64) v, changed := fastpathTV.DecMapBoolUint64V(*vp, fastpathCheckNilFalse, true, f.d) @@ -27742,7 +23175,7 @@ func (f fastpathT) DecMapBoolUint64X(vp *map[bool]uint64, checkNil bool, d *Deco func (_ fastpathT) DecMapBoolUint64V(v map[bool]uint64, checkNil bool, canChange bool, d *Decoder) (_ map[bool]uint64, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -27752,11 +23185,8 @@ func (_ fastpathT) DecMapBoolUint64V(v map[bool]uint64, checkNil bool, canChange containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[bool]uint64, containerLen) - } else { - v = make(map[bool]uint64) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 9) + v = make(map[bool]uint64, xlen) changed = true } if containerLen > 0 { @@ -27770,23 +23200,19 @@ func (_ fastpathT) DecMapBoolUint64V(v map[bool]uint64, checkNil bool, canChange } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := dd.DecodeBool() - dd.ReadMapKVSeparator() mv := v[mk] mv = dd.DecodeUint(64) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapBoolIntR(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapBoolIntR(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[bool]int) v, changed := fastpathTV.DecMapBoolIntV(*vp, fastpathCheckNilFalse, true, f.d) @@ -27807,7 +23233,7 @@ func (f fastpathT) DecMapBoolIntX(vp *map[bool]int, checkNil bool, d *Decoder) { func (_ fastpathT) DecMapBoolIntV(v map[bool]int, checkNil bool, canChange bool, d *Decoder) (_ map[bool]int, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -27817,11 +23243,8 @@ func (_ fastpathT) DecMapBoolIntV(v map[bool]int, checkNil bool, canChange bool, containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[bool]int, containerLen) - } else { - v = make(map[bool]int) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 9) + v = make(map[bool]int, xlen) changed = true } if containerLen > 0 { @@ -27835,23 +23258,19 @@ func (_ fastpathT) DecMapBoolIntV(v map[bool]int, checkNil bool, canChange bool, } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := dd.DecodeBool() - dd.ReadMapKVSeparator() mv := v[mk] mv = int(dd.DecodeInt(intBitsize)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapBoolInt8R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapBoolInt8R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[bool]int8) v, changed := fastpathTV.DecMapBoolInt8V(*vp, fastpathCheckNilFalse, true, f.d) @@ -27872,7 +23291,7 @@ func (f fastpathT) DecMapBoolInt8X(vp *map[bool]int8, checkNil bool, d *Decoder) func (_ fastpathT) DecMapBoolInt8V(v map[bool]int8, checkNil bool, canChange bool, d *Decoder) (_ map[bool]int8, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -27882,11 +23301,8 @@ func (_ fastpathT) DecMapBoolInt8V(v map[bool]int8, checkNil bool, canChange boo containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[bool]int8, containerLen) - } else { - v = make(map[bool]int8) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 2) + v = make(map[bool]int8, xlen) changed = true } if containerLen > 0 { @@ -27900,23 +23316,19 @@ func (_ fastpathT) DecMapBoolInt8V(v map[bool]int8, checkNil bool, canChange boo } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := dd.DecodeBool() - dd.ReadMapKVSeparator() mv := v[mk] mv = int8(dd.DecodeInt(8)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapBoolInt16R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapBoolInt16R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[bool]int16) v, changed := fastpathTV.DecMapBoolInt16V(*vp, fastpathCheckNilFalse, true, f.d) @@ -27937,7 +23349,7 @@ func (f fastpathT) DecMapBoolInt16X(vp *map[bool]int16, checkNil bool, d *Decode func (_ fastpathT) DecMapBoolInt16V(v map[bool]int16, checkNil bool, canChange bool, d *Decoder) (_ map[bool]int16, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -27947,11 +23359,8 @@ func (_ fastpathT) DecMapBoolInt16V(v map[bool]int16, checkNil bool, canChange b containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[bool]int16, containerLen) - } else { - v = make(map[bool]int16) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 3) + v = make(map[bool]int16, xlen) changed = true } if containerLen > 0 { @@ -27965,23 +23374,19 @@ func (_ fastpathT) DecMapBoolInt16V(v map[bool]int16, checkNil bool, canChange b } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := dd.DecodeBool() - dd.ReadMapKVSeparator() mv := v[mk] mv = int16(dd.DecodeInt(16)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapBoolInt32R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapBoolInt32R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[bool]int32) v, changed := fastpathTV.DecMapBoolInt32V(*vp, fastpathCheckNilFalse, true, f.d) @@ -28002,7 +23407,7 @@ func (f fastpathT) DecMapBoolInt32X(vp *map[bool]int32, checkNil bool, d *Decode func (_ fastpathT) DecMapBoolInt32V(v map[bool]int32, checkNil bool, canChange bool, d *Decoder) (_ map[bool]int32, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -28012,11 +23417,8 @@ func (_ fastpathT) DecMapBoolInt32V(v map[bool]int32, checkNil bool, canChange b containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[bool]int32, containerLen) - } else { - v = make(map[bool]int32) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 5) + v = make(map[bool]int32, xlen) changed = true } if containerLen > 0 { @@ -28030,23 +23432,19 @@ func (_ fastpathT) DecMapBoolInt32V(v map[bool]int32, checkNil bool, canChange b } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := dd.DecodeBool() - dd.ReadMapKVSeparator() mv := v[mk] mv = int32(dd.DecodeInt(32)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapBoolInt64R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapBoolInt64R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[bool]int64) v, changed := fastpathTV.DecMapBoolInt64V(*vp, fastpathCheckNilFalse, true, f.d) @@ -28067,7 +23465,7 @@ func (f fastpathT) DecMapBoolInt64X(vp *map[bool]int64, checkNil bool, d *Decode func (_ fastpathT) DecMapBoolInt64V(v map[bool]int64, checkNil bool, canChange bool, d *Decoder) (_ map[bool]int64, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -28077,11 +23475,8 @@ func (_ fastpathT) DecMapBoolInt64V(v map[bool]int64, checkNil bool, canChange b containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[bool]int64, containerLen) - } else { - v = make(map[bool]int64) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 9) + v = make(map[bool]int64, xlen) changed = true } if containerLen > 0 { @@ -28095,23 +23490,19 @@ func (_ fastpathT) DecMapBoolInt64V(v map[bool]int64, checkNil bool, canChange b } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := dd.DecodeBool() - dd.ReadMapKVSeparator() mv := v[mk] mv = dd.DecodeInt(64) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapBoolFloat32R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapBoolFloat32R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[bool]float32) v, changed := fastpathTV.DecMapBoolFloat32V(*vp, fastpathCheckNilFalse, true, f.d) @@ -28132,7 +23523,7 @@ func (f fastpathT) DecMapBoolFloat32X(vp *map[bool]float32, checkNil bool, d *De func (_ fastpathT) DecMapBoolFloat32V(v map[bool]float32, checkNil bool, canChange bool, d *Decoder) (_ map[bool]float32, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -28142,11 +23533,8 @@ func (_ fastpathT) DecMapBoolFloat32V(v map[bool]float32, checkNil bool, canChan containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[bool]float32, containerLen) - } else { - v = make(map[bool]float32) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 5) + v = make(map[bool]float32, xlen) changed = true } if containerLen > 0 { @@ -28160,23 +23548,19 @@ func (_ fastpathT) DecMapBoolFloat32V(v map[bool]float32, checkNil bool, canChan } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := dd.DecodeBool() - dd.ReadMapKVSeparator() mv := v[mk] mv = float32(dd.DecodeFloat(true)) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapBoolFloat64R(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapBoolFloat64R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[bool]float64) v, changed := fastpathTV.DecMapBoolFloat64V(*vp, fastpathCheckNilFalse, true, f.d) @@ -28197,7 +23581,7 @@ func (f fastpathT) DecMapBoolFloat64X(vp *map[bool]float64, checkNil bool, d *De func (_ fastpathT) DecMapBoolFloat64V(v map[bool]float64, checkNil bool, canChange bool, d *Decoder) (_ map[bool]float64, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -28207,11 +23591,8 @@ func (_ fastpathT) DecMapBoolFloat64V(v map[bool]float64, checkNil bool, canChan containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[bool]float64, containerLen) - } else { - v = make(map[bool]float64) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 9) + v = make(map[bool]float64, xlen) changed = true } if containerLen > 0 { @@ -28225,23 +23606,19 @@ func (_ fastpathT) DecMapBoolFloat64V(v map[bool]float64, checkNil bool, canChan } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := dd.DecodeBool() - dd.ReadMapKVSeparator() mv := v[mk] mv = dd.DecodeFloat(false) if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } -func (f decFnInfo) fastpathDecMapBoolBoolR(rv reflect.Value) { +func (f *decFnInfo) fastpathDecMapBoolBoolR(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[bool]bool) v, changed := fastpathTV.DecMapBoolBoolV(*vp, fastpathCheckNilFalse, true, f.d) @@ -28262,7 +23639,7 @@ func (f fastpathT) DecMapBoolBoolX(vp *map[bool]bool, checkNil bool, d *Decoder) func (_ fastpathT) DecMapBoolBoolV(v map[bool]bool, checkNil bool, canChange bool, d *Decoder) (_ map[bool]bool, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -28272,11 +23649,8 @@ func (_ fastpathT) DecMapBoolBoolV(v map[bool]bool, checkNil bool, canChange boo containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[bool]bool, containerLen) - } else { - v = make(map[bool]bool) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 2) + v = make(map[bool]bool, xlen) changed = true } if containerLen > 0 { @@ -28290,18 +23664,14 @@ func (_ fastpathT) DecMapBoolBoolV(v map[bool]bool, checkNil bool, canChange boo } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } mk := dd.DecodeBool() - dd.ReadMapKVSeparator() mv := v[mk] mv = dd.DecodeBool() if v != nil { v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } diff --git a/Godeps/_workspace/src/github.com/ugorji/go/codec/fast-path.go.tmpl b/Godeps/_workspace/src/github.com/ugorji/go/codec/fast-path.go.tmpl index 19138c87ab85..5fecafd21cbf 100644 --- a/Godeps/_workspace/src/github.com/ugorji/go/codec/fast-path.go.tmpl +++ b/Godeps/_workspace/src/github.com/ugorji/go/codec/fast-path.go.tmpl @@ -1,7 +1,7 @@ // //+build ignore // Copyright (c) 2012-2015 Ugorji Nwoke. All rights reserved. -// Use of this source code is governed by a BSD-style license found in the LICENSE file. +// Use of this source code is governed by a MIT license found in the LICENSE file. // ************************************************************ // DO NOT EDIT. @@ -48,8 +48,8 @@ var fastpathTV fastpathT type fastpathE struct { rtid uintptr rt reflect.Type - encfn func(encFnInfo, reflect.Value) - decfn func(decFnInfo, reflect.Value) + encfn func(*encFnInfo, reflect.Value) + decfn func(*decFnInfo, reflect.Value) } type fastpathA [{{ .FastpathLen }}]fastpathE @@ -85,7 +85,7 @@ func init() { return } i := 0 - fn := func(v interface{}, fe func(encFnInfo, reflect.Value), fd func(decFnInfo, reflect.Value)) (f fastpathE) { + fn := func(v interface{}, fe func(*encFnInfo, reflect.Value), fd func(*decFnInfo, reflect.Value)) (f fastpathE) { xrt := reflect.TypeOf(v) xptr := reflect.ValueOf(xrt).Pointer() fastpathAV[i] = fastpathE{xptr, xrt, fe, fd} @@ -93,11 +93,11 @@ func init() { return } - {{range .Values}}{{if not .Primitive}}{{if .Slice }} - fn([]{{ .Elem }}(nil), (encFnInfo).{{ .MethodNamePfx "fastpathEnc" false }}R, (decFnInfo).{{ .MethodNamePfx "fastpathDec" false }}R){{end}}{{end}}{{end}} + {{range .Values}}{{if not .Primitive}}{{if not .MapKey }} + fn([]{{ .Elem }}(nil), (*encFnInfo).{{ .MethodNamePfx "fastpathEnc" false }}R, (*decFnInfo).{{ .MethodNamePfx "fastpathDec" false }}R){{end}}{{end}}{{end}} - {{range .Values}}{{if not .Primitive}}{{if not .Slice }} - fn(map[{{ .MapKey }}]{{ .Elem }}(nil), (encFnInfo).{{ .MethodNamePfx "fastpathEnc" false }}R, (decFnInfo).{{ .MethodNamePfx "fastpathDec" false }}R){{end}}{{end}}{{end}} + {{range .Values}}{{if not .Primitive}}{{if .MapKey }} + fn(map[{{ .MapKey }}]{{ .Elem }}(nil), (*encFnInfo).{{ .MethodNamePfx "fastpathEnc" false }}R, (*decFnInfo).{{ .MethodNamePfx "fastpathDec" false }}R){{end}}{{end}}{{end}} sort.Sort(fastpathAslice(fastpathAV[:])) } @@ -107,10 +107,10 @@ func init() { // -- -- fast path type switch func fastpathEncodeTypeSwitch(iv interface{}, e *Encoder) bool { switch v := iv.(type) { -{{range .Values}}{{if not .Primitive}}{{if .Slice }} +{{range .Values}}{{if not .Primitive}}{{if not .MapKey }} case []{{ .Elem }}:{{else}} case map[{{ .MapKey }}]{{ .Elem }}:{{end}} - fastpathTV.{{ .MethodNamePfx "Enc" false }}V(v, fastpathCheckNilTrue, e){{if .Slice }} + fastpathTV.{{ .MethodNamePfx "Enc" false }}V(v, fastpathCheckNilTrue, e){{if not .MapKey }} case *[]{{ .Elem }}:{{else}} case *map[{{ .MapKey }}]{{ .Elem }}:{{end}} fastpathTV.{{ .MethodNamePfx "Enc" false }}V(*v, fastpathCheckNilTrue, e) @@ -123,7 +123,7 @@ func fastpathEncodeTypeSwitch(iv interface{}, e *Encoder) bool { func fastpathEncodeTypeSwitchSlice(iv interface{}, e *Encoder) bool { switch v := iv.(type) { -{{range .Values}}{{if not .Primitive}}{{if .Slice }} +{{range .Values}}{{if not .Primitive}}{{if not .MapKey }} case []{{ .Elem }}: fastpathTV.{{ .MethodNamePfx "Enc" false }}V(v, fastpathCheckNilTrue, e) case *[]{{ .Elem }}: @@ -137,7 +137,7 @@ func fastpathEncodeTypeSwitchSlice(iv interface{}, e *Encoder) bool { func fastpathEncodeTypeSwitchMap(iv interface{}, e *Encoder) bool { switch v := iv.(type) { -{{range .Values}}{{if not .Primitive}}{{if not .Slice }} +{{range .Values}}{{if not .Primitive}}{{if .MapKey }} case map[{{ .MapKey }}]{{ .Elem }}: fastpathTV.{{ .MethodNamePfx "Enc" false }}V(v, fastpathCheckNilTrue, e) case *map[{{ .MapKey }}]{{ .Elem }}: @@ -150,9 +150,9 @@ func fastpathEncodeTypeSwitchMap(iv interface{}, e *Encoder) bool { } // -- -- fast path functions -{{range .Values}}{{if not .Primitive}}{{if .Slice }} +{{range .Values}}{{if not .Primitive}}{{if not .MapKey }} -func (f encFnInfo) {{ .MethodNamePfx "fastpathEnc" false }}R(rv reflect.Value) { +func (f *encFnInfo) {{ .MethodNamePfx "fastpathEnc" false }}R(rv reflect.Value) { fastpathTV.{{ .MethodNamePfx "Enc" false }}V(rv.Interface().([]{{ .Elem }}), fastpathCheckNilFalse, f.e) } func (_ fastpathT) {{ .MethodNamePfx "Enc" false }}V(v []{{ .Elem }}, checkNil bool, e *Encoder) { @@ -162,26 +162,17 @@ func (_ fastpathT) {{ .MethodNamePfx "Enc" false }}V(v []{{ .Elem }}, checkNil b return } ee.EncodeArrayStart(len(v)) - if e.be { - for _, v2 := range v { - {{ encmd .Elem "v2"}} - } - } else { - for j, v2 := range v { - if j > 0 { - ee.EncodeArrayEntrySeparator() - } - {{ encmd .Elem "v2"}} - } - ee.EncodeArrayEnd() + for _, v2 := range v { + {{ encmd .Elem "v2"}} } + ee.EncodeEnd() } {{end}}{{end}}{{end}} -{{range .Values}}{{if not .Primitive}}{{if not .Slice }} +{{range .Values}}{{if not .Primitive}}{{if .MapKey }} -func (f encFnInfo) {{ .MethodNamePfx "fastpathEnc" false }}R(rv reflect.Value) { +func (f *encFnInfo) {{ .MethodNamePfx "fastpathEnc" false }}R(rv reflect.Value) { fastpathTV.{{ .MethodNamePfx "Enc" false }}V(rv.Interface().(map[{{ .MapKey }}]{{ .Elem }}), fastpathCheckNilFalse, f.e) } func (_ fastpathT) {{ .MethodNamePfx "Enc" false }}V(v map[{{ .MapKey }}]{{ .Elem }}, checkNil bool, e *Encoder) { @@ -192,32 +183,15 @@ func (_ fastpathT) {{ .MethodNamePfx "Enc" false }}V(v map[{{ .MapKey }}]{{ .Ele } ee.EncodeMapStart(len(v)) {{if eq .MapKey "string"}}asSymbols := e.h.AsSymbols&AsSymbolMapStringKeysFlag != 0{{end}} - if e.be { - for k2, v2 := range v { - {{if eq .MapKey "string"}}if asSymbols { - ee.EncodeSymbol(k2) - } else { - ee.EncodeString(c_UTF8, k2) - }{{else}}{{ encmd .MapKey "k2"}}{{end}} - {{ encmd .Elem "v2"}} - } - } else { - j := 0 - for k2, v2 := range v { - if j > 0 { - ee.EncodeMapEntrySeparator() - } - {{if eq .MapKey "string"}}if asSymbols { - ee.EncodeSymbol(k2) - } else { - ee.EncodeString(c_UTF8, k2) - }{{else}}{{ encmd .MapKey "k2"}}{{end}} - ee.EncodeMapKVSeparator() - {{ encmd .Elem "v2"}} - j++ - } - ee.EncodeMapEnd() + for k2, v2 := range v { + {{if eq .MapKey "string"}}if asSymbols { + ee.EncodeSymbol(k2) + } else { + ee.EncodeString(c_UTF8, k2) + }{{else}}{{ encmd .MapKey "k2"}}{{end}} + {{ encmd .Elem "v2"}} } + ee.EncodeEnd() } {{end}}{{end}}{{end}} @@ -227,10 +201,10 @@ func (_ fastpathT) {{ .MethodNamePfx "Enc" false }}V(v map[{{ .MapKey }}]{{ .Ele // -- -- fast path type switch func fastpathDecodeTypeSwitch(iv interface{}, d *Decoder) bool { switch v := iv.(type) { -{{range .Values}}{{if not .Primitive}}{{if .Slice }} +{{range .Values}}{{if not .Primitive}}{{if not .MapKey }} case []{{ .Elem }}:{{else}} case map[{{ .MapKey }}]{{ .Elem }}:{{end}} - fastpathTV.{{ .MethodNamePfx "Dec" false }}V(v, fastpathCheckNilFalse, false, d){{if .Slice }} + fastpathTV.{{ .MethodNamePfx "Dec" false }}V(v, fastpathCheckNilFalse, false, d){{if not .MapKey }} case *[]{{ .Elem }}:{{else}} case *map[{{ .MapKey }}]{{ .Elem }}:{{end}} v2, changed2 := fastpathTV.{{ .MethodNamePfx "Dec" false }}V(*v, fastpathCheckNilFalse, true, d) @@ -245,16 +219,16 @@ func fastpathDecodeTypeSwitch(iv interface{}, d *Decoder) bool { } // -- -- fast path functions -{{range .Values}}{{if not .Primitive}}{{if .Slice }} +{{range .Values}}{{if not .Primitive}}{{if not .MapKey }} {{/* Slices can change if they - did not come from an array - are addressable (from a ptr) - are settable (e.g. contained in an interface{}) */}} -func (f decFnInfo) {{ .MethodNamePfx "fastpathDec" false }}R(rv reflect.Value) { +func (f *decFnInfo) {{ .MethodNamePfx "fastpathDec" false }}R(rv reflect.Value) { array := f.seq == seqTypeArray - if !array && rv.CanAddr() { // CanSet => CanAddr + Exported + if !array && rv.CanAddr() { {{/* // CanSet => CanAddr + Exported */}} vp := rv.Addr().Interface().(*[]{{ .Elem }}) v, changed := fastpathTV.{{ .MethodNamePfx "Dec" false }}V(*vp, fastpathCheckNilFalse, !array, f.d) if changed { @@ -275,7 +249,7 @@ func (f fastpathT) {{ .MethodNamePfx "Dec" false }}X(vp *[]{{ .Elem }}, checkNil func (_ fastpathT) {{ .MethodNamePfx "Dec" false }}V(v []{{ .Elem }}, checkNil bool, canChange bool, d *Decoder) (_ []{{ .Elem }}, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) { dd.TryDecodeAsNil() + {{/* // if dd.isContainerType(valueTypeNil) { dd.TryDecodeAsNil() */}} if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -284,47 +258,59 @@ func (_ fastpathT) {{ .MethodNamePfx "Dec" false }}V(v []{{ .Elem }}, checkNil b } slh, containerLenS := d.decSliceHelperStart() + x2read := containerLenS + var xtrunc bool if canChange && v == nil { - if containerLenS <= 0 { - v = []{{ .Elem }}{} - } else { - v = make([]{{ .Elem }}, containerLenS, containerLenS) + var xlen int + if xlen, xtrunc = decInferLen(containerLenS, d.h.MaxInitLen, {{ .Size }}); xtrunc { + x2read = xlen } + v = make([]{{ .Elem }}, xlen) changed = true - } + } if containerLenS == 0 { if canChange && len(v) != 0 { v = v[:0] changed = true }{{/* - // slh.End() // dd.ReadArrayEnd() + // slh.End() // dd.ReadArrayEnd() */}} return v, changed } - // for j := 0; j < containerLenS; j++ { + {{/* // for j := 0; j < containerLenS; j++ { */}} if containerLenS > 0 { - decLen := containerLenS if containerLenS > cap(v) { - if canChange { - s := make([]{{ .Elem }}, containerLenS, containerLenS) + if canChange { {{/* + // fast-path is for "basic" immutable types, so no need to copy them over + // s := make([]{{ .Elem }}, decInferLen(containerLenS, d.h.MaxInitLen)) // copy(s, v[:cap(v)]) - v = s + // v = s */}} + var xlen int + if xlen, xtrunc = decInferLen(containerLenS, d.h.MaxInitLen, {{ .Size }}); xtrunc { + x2read = xlen + } + v = make([]{{ .Elem }}, xlen) changed = true } else { d.arrayCannotExpand(len(v), containerLenS) - decLen = len(v) + x2read = len(v) } } else if containerLenS != len(v) { v = v[:containerLenS] changed = true } - // all checks done. cannot go past len. + {{/* // all checks done. cannot go past len. */}} j := 0 - for ; j < decLen; j++ { + for ; j < x2read; j++ { {{ if eq .Elem "interface{}" }}d.decode(&v[j]){{ else }}v[j] = {{ decmd .Elem }}{{ end }} } - if !canChange { + if xtrunc { {{/* // means canChange=true, changed=true already. */}} + for ; j < containerLenS; j++ { + v = append(v, {{ zerocmd .Elem }}) + {{ if eq .Elem "interface{}" }}d.decode(&v[j]){{ else }}v[j] = {{ decmd .Elem }}{{ end }} + } + } else if !canChange { for ; j < containerLenS; j++ { d.swallow() } @@ -340,10 +326,7 @@ func (_ fastpathT) {{ .MethodNamePfx "Dec" false }}V(v []{{ .Elem }}, checkNil b d.arrayCannotExpand(len(v), j+1) } } - if j > 0 { - slh.Sep(j) - } - if j < len(v) { // all checks done. cannot go past len. + if j < len(v) { {{/* // all checks done. cannot go past len. */}} {{ if eq .Elem "interface{}" }}d.decode(&v[j]) {{ else }}v[j] = {{ decmd .Elem }}{{ end }} } else { @@ -358,13 +341,13 @@ func (_ fastpathT) {{ .MethodNamePfx "Dec" false }}V(v []{{ .Elem }}, checkNil b {{end}}{{end}}{{end}} -{{range .Values}}{{if not .Primitive}}{{if not .Slice }} +{{range .Values}}{{if not .Primitive}}{{if .MapKey }} {{/* Maps can change if they are - addressable (from a ptr) - settable (e.g. contained in an interface{}) */}} -func (f decFnInfo) {{ .MethodNamePfx "fastpathDec" false }}R(rv reflect.Value) { +func (f *decFnInfo) {{ .MethodNamePfx "fastpathDec" false }}R(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[{{ .MapKey }}]{{ .Elem }}) v, changed := fastpathTV.{{ .MethodNamePfx "Dec" false }}V(*vp, fastpathCheckNilFalse, true, f.d) @@ -385,7 +368,7 @@ func (f fastpathT) {{ .MethodNamePfx "Dec" false }}X(vp *map[{{ .MapKey }}]{{ .E func (_ fastpathT) {{ .MethodNamePfx "Dec" false }}V(v map[{{ .MapKey }}]{{ .Elem }}, checkNil bool, canChange bool, d *Decoder) (_ map[{{ .MapKey }}]{{ .Elem }}, changed bool) { dd := d.d - // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + {{/* // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() */}} if checkNil && dd.TryDecodeAsNil() { if v != nil { changed = true @@ -395,11 +378,8 @@ func (_ fastpathT) {{ .MethodNamePfx "Dec" false }}V(v map[{{ .MapKey }}]{{ .Ele containerLen := dd.ReadMapStart() if canChange && v == nil { - if containerLen > 0 { - v = make(map[{{ .MapKey }}]{{ .Elem }}, containerLen) - } else { - v = make(map[{{ .MapKey }}]{{ .Elem }}) // supports indefinite-length, etc - } + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, {{ .Size }}) + v = make(map[{{ .MapKey }}]{{ .Elem }}, xlen) changed = true } if containerLen > 0 { @@ -407,7 +387,7 @@ func (_ fastpathT) {{ .MethodNamePfx "Dec" false }}V(v map[{{ .MapKey }}]{{ .Ele {{ if eq .MapKey "interface{}" }}var mk interface{} d.decode(&mk) if bv, bok := mk.([]byte); bok { - mk = string(bv) // maps cannot have []byte as key. switch to string. + mk = string(bv) {{/* // maps cannot have []byte as key. switch to string. */}} }{{ else }}mk := {{ decmd .MapKey }}{{ end }} mv := v[mk] {{ if eq .Elem "interface{}" }}d.decode(&mv) @@ -418,15 +398,11 @@ func (_ fastpathT) {{ .MethodNamePfx "Dec" false }}V(v map[{{ .MapKey }}]{{ .Ele } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - if j > 0 { - dd.ReadMapEntrySeparator() - } {{ if eq .MapKey "interface{}" }}var mk interface{} d.decode(&mk) if bv, bok := mk.([]byte); bok { - mk = string(bv) // maps cannot have []byte as key. switch to string. + mk = string(bv) {{/* // maps cannot have []byte as key. switch to string. */}} }{{ else }}mk := {{ decmd .MapKey }}{{ end }} - dd.ReadMapKVSeparator() mv := v[mk] {{ if eq .Elem "interface{}" }}d.decode(&mv) {{ else }}mv = {{ decmd .Elem }}{{ end }} @@ -434,7 +410,7 @@ func (_ fastpathT) {{ .MethodNamePfx "Dec" false }}V(v map[{{ .MapKey }}]{{ .Ele v[mk] = mv } } - dd.ReadMapEnd() + dd.ReadEnd() } return v, changed } diff --git a/Godeps/_workspace/src/github.com/ugorji/go/codec/gen-dec-array.go.tmpl b/Godeps/_workspace/src/github.com/ugorji/go/codec/gen-dec-array.go.tmpl index ffb2cc4f249e..eb31a9a963a6 100644 --- a/Godeps/_workspace/src/github.com/ugorji/go/codec/gen-dec-array.go.tmpl +++ b/Godeps/_workspace/src/github.com/ugorji/go/codec/gen-dec-array.go.tmpl @@ -1,13 +1,17 @@ -{{var "v"}} := *{{ .Varname }} -{{var "h"}}, {{var "l"}} := z.DecSliceHelperStart() +{{var "v"}} := {{ if not isArray}}*{{ end }}{{ .Varname }} +{{var "h"}}, {{var "l"}} := z.DecSliceHelperStart() {{/* // helper, containerLenS */}} + +var {{var "rr"}}, {{var "rl"}} int {{/* // num2read, length of slice/array/chan */}} +var {{var "c"}}, {{var "rt"}} bool {{/* // changed, truncated */}} +_, _, _ = {{var "c"}}, {{var "rt"}}, {{var "rl"}} +{{var "rr"}} = {{var "l"}} +{{/* rl is NOT used. Only used for getting DecInferLen. len(r) used directly in code */}} -var {{var "c"}} bool {{ if not isArray }}if {{var "v"}} == nil { - if {{var "l"}} <= 0 { - {{var "v"}} = make({{ .CTyp }}, 0) - } else { - {{var "v"}} = make({{ .CTyp }}, {{var "l"}}) + if {{var "rl"}}, {{var "rt"}} = z.DecInferLen({{var "l"}}, z.DecBasicHandle().MaxInitLen, {{ .Size }}); {{var "rt"}} { + {{var "rr"}} = {{var "rl"}} } + {{var "v"}} = make({{ .CTyp }}, {{var "rl"}}) {{var "c"}} = true } {{ end }} @@ -23,41 +27,45 @@ if {{var "l"}} == 0 { {{ if isSlice }} {{ $x := printf "%st%s" .TempVar .Rand }}{{ decLineVar $x }} {{var "v"}} <- {{var "t"}} {{ else }} - {{var "n"}} := {{var "l"}} if {{var "l"}} > cap({{var "v"}}) { - {{ if isArray }}r.ReadArrayCannotExpand(len({{var "v"}}), {{var "l"}}) - {{var "n"}} = len({{var "v"}}) - {{ else }}{{ if .Immutable }} + {{ if isArray }}z.DecArrayCannotExpand(len({{var "v"}}), {{var "l"}}) + {{ else }}{{var "rl"}}, {{var "rt"}} = z.DecInferLen({{var "l"}}, z.DecBasicHandle().MaxInitLen, {{ .Size }}) + {{ if .Immutable }} {{var "v2"}} := {{var "v"}} - {{var "v"}} = make([]{{ .Typ }}, {{var "l"}}, {{var "l"}}) + {{var "v"}} = make([]{{ .Typ }}, {{var "rl"}}) if len({{var "v"}}) > 0 { copy({{var "v"}}, {{var "v2"}}[:cap({{var "v2"}})]) } - {{ else }}{{var "v"}} = make([]{{ .Typ }}, {{var "l"}}, {{var "l"}}) + {{ else }}{{var "v"}} = make([]{{ .Typ }}, {{var "rl"}}) {{ end }}{{var "c"}} = true {{ end }} + {{var "rr"}} = len({{var "v"}}) } else if {{var "l"}} != len({{var "v"}}) { - {{var "v"}} = {{var "v"}}[:{{var "l"}}] - {{var "c"}} = true + {{ if isSlice }}{{var "v"}} = {{var "v"}}[:{{var "l"}}] + {{var "c"}} = true {{ end }} } {{var "j"}} := 0 - for ; {{var "j"}} < {{var "n"}} ; {{var "j"}}++ { + for ; {{var "j"}} < {{var "rr"}} ; {{var "j"}}++ { {{ $x := printf "%[1]vv%[2]v[%[1]vj%[2]v]" .TempVar .Rand }}{{ decLineVar $x }} - } {{ if isArray }} - for ; {{var "j"}} < {{var "l"}} ; {{var "j"}}++ { + } + {{ if isArray }}for ; {{var "j"}} < {{var "l"}} ; {{var "j"}}++ { z.DecSwallow() - }{{ end }} - {{ end }}{{/* closing if not chan */}} + } + {{ else }}if {{var "rt"}} { {{/* means that it is mutable and slice */}} + for ; {{var "j"}} < {{var "l"}} ; {{var "j"}}++ { + {{var "v"}} = append({{var "v"}}, {{ zero}}) + {{ $x := printf "%[1]vv%[2]v[%[1]vj%[2]v]" .TempVar .Rand }}{{ decLineVar $x }} + } + } + {{ end }} + {{ end }}{{/* closing 'if not chan' */}} } else { for {{var "j"}} := 0; !r.CheckBreak(); {{var "j"}}++ { if {{var "j"}} >= len({{var "v"}}) { - {{ if isArray }}r.ReadArrayCannotExpand(len({{var "v"}}), {{var "j"}}+1) + {{ if isArray }}z.DecArrayCannotExpand(len({{var "v"}}), {{var "j"}}+1) {{ else if isSlice}}{{var "v"}} = append({{var "v"}}, {{zero}})// var {{var "z"}} {{ .Typ }} {{var "c"}} = true {{ end }} } - if {{var "j"}} > 0 { - {{var "h"}}.Sep({{var "j"}}) - } {{ if isChan}} var {{var "t"}} {{ .Typ }} {{ $x := printf "%st%s" .TempVar .Rand }}{{ decLineVar $x }} @@ -72,6 +80,7 @@ if {{var "l"}} == 0 { {{ if isSlice }} } {{var "h"}}.End() } -if {{var "c"}} { +{{ if not isArray }}if {{var "c"}} { *{{ .Varname }} = {{var "v"}} -} +}{{ end }} + diff --git a/Godeps/_workspace/src/github.com/ugorji/go/codec/gen-dec-map.go.tmpl b/Godeps/_workspace/src/github.com/ugorji/go/codec/gen-dec-map.go.tmpl index 9f8dafa548c1..d1535f4a69b7 100644 --- a/Godeps/_workspace/src/github.com/ugorji/go/codec/gen-dec-map.go.tmpl +++ b/Godeps/_workspace/src/github.com/ugorji/go/codec/gen-dec-map.go.tmpl @@ -1,11 +1,8 @@ {{var "v"}} := *{{ .Varname }} {{var "l"}} := r.ReadMapStart() if {{var "v"}} == nil { - if {{var "l"}} > 0 { - {{var "v"}} = make(map[{{ .KTyp }}]{{ .Typ }}, {{var "l"}}) - } else { - {{var "v"}} = make(map[{{ .KTyp }}]{{ .Typ }}) // supports indefinite-length, etc - } + {{var "rl"}}, _ := z.DecInferLen({{var "l"}}, z.DecBasicHandle().MaxInitLen, {{ .Size }}) + {{var "v"}} = make(map[{{ .KTyp }}]{{ .Typ }}, {{var "rl"}}) *{{ .Varname }} = {{var "v"}} } if {{var "l"}} > 0 { @@ -25,9 +22,6 @@ for {{var "j"}} := 0; {{var "j"}} < {{var "l"}}; {{var "j"}}++ { } } else if {{var "l"}} < 0 { for {{var "j"}} := 0; !r.CheckBreak(); {{var "j"}}++ { - if {{var "j"}} > 0 { - r.ReadMapEntrySeparator() - } var {{var "mk"}} {{ .KTyp }} {{ $x := printf "%vmk%v" .TempVar .Rand }}{{ decLineVarK $x }} {{ if eq .KTyp "interface{}" }}// special case if a byte array. @@ -35,12 +29,11 @@ for {{var "j"}} := 0; !r.CheckBreak(); {{var "j"}}++ { {{var "mk"}} = string({{var "bv"}}) } {{ end }} - r.ReadMapKVSeparator() {{var "mv"}} := {{var "v"}}[{{var "mk"}}] {{ $x := printf "%vmv%v" .TempVar .Rand }}{{ decLineVar $x }} if {{var "v"}} != nil { {{var "v"}}[{{var "mk"}}] = {{var "mv"}} } } -r.ReadMapEnd() +r.ReadEnd() } // else len==0: TODO: Should we clear map entries? diff --git a/Godeps/_workspace/src/github.com/ugorji/go/codec/gen-helper.generated.go b/Godeps/_workspace/src/github.com/ugorji/go/codec/gen-helper.generated.go index 1811a4877c87..9710eca501a0 100644 --- a/Godeps/_workspace/src/github.com/ugorji/go/codec/gen-helper.generated.go +++ b/Godeps/_workspace/src/github.com/ugorji/go/codec/gen-helper.generated.go @@ -1,7 +1,7 @@ // //+build ignore // Copyright (c) 2012-2015 Ugorji Nwoke. All rights reserved. -// Use of this source code is governed by a BSD-style license found in the LICENSE file. +// Use of this source code is governed by a MIT license found in the LICENSE file. // ************************************************************ // DO NOT EDIT. @@ -10,6 +10,11 @@ package codec +import ( + "encoding" + "reflect" +) + // This file is used to generate helper code for codecgen. // The values here i.e. genHelper(En|De)coder are not to be used directly by // library users. They WILL change continously and without notice. @@ -60,6 +65,56 @@ func (f genHelperEncoder) EncFallback(iv interface{}) { f.e.encodeI(iv, false, false) } +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +func (f genHelperEncoder) EncTextMarshal(iv encoding.TextMarshaler) { + bs, fnerr := iv.MarshalText() + f.e.marshal(bs, fnerr, false, c_UTF8) +} + +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +func (f genHelperEncoder) EncJSONMarshal(iv jsonMarshaler) { + bs, fnerr := iv.MarshalJSON() + f.e.marshal(bs, fnerr, true, c_UTF8) +} + +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +func (f genHelperEncoder) EncBinaryMarshal(iv encoding.BinaryMarshaler) { + bs, fnerr := iv.MarshalBinary() + f.e.marshal(bs, fnerr, false, c_RAW) +} + +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +func (f genHelperEncoder) TimeRtidIfBinc() uintptr { + if _, ok := f.e.hh.(*BincHandle); ok { + return timeTypId + } + return 0 +} + +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +func (f genHelperEncoder) IsJSONHandle() bool { + return f.e.js +} + +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +func (f genHelperEncoder) HasExtensions() bool { + return len(f.e.h.extHandle) != 0 +} + +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +func (f genHelperEncoder) EncExt(v interface{}) (r bool) { + rt := reflect.TypeOf(v) + if rt.Kind() == reflect.Ptr { + rt = rt.Elem() + } + rtid := reflect.ValueOf(rt).Pointer() + if xfFn := f.e.h.getExt(rtid); xfFn != nil { + f.e.e.EncodeExt(v, xfFn.tag, xfFn.ext, f.e) + return true + } + return false +} + // FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* func (f genHelperDecoder) DecBasicHandle() *BasicHandle { return f.d.h @@ -100,3 +155,66 @@ func (f genHelperDecoder) DecStructFieldNotFound(index int, name string) { func (f genHelperDecoder) DecArrayCannotExpand(sliceLen, streamLen int) { f.d.arrayCannotExpand(sliceLen, streamLen) } + +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +func (f genHelperDecoder) DecTextUnmarshal(tm encoding.TextUnmarshaler) { + fnerr := tm.UnmarshalText(f.d.d.DecodeBytes(f.d.b[:], true, true)) + if fnerr != nil { + panic(fnerr) + } +} + +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +func (f genHelperDecoder) DecJSONUnmarshal(tm jsonUnmarshaler) { + // bs := f.dd.DecodeBytes(f.d.b[:], true, true) + f.d.r.track() + f.d.swallow() + bs := f.d.r.stopTrack() + // fmt.Printf(">>>>>> CODECGEN JSON: %s\n", bs) + fnerr := tm.UnmarshalJSON(bs) + if fnerr != nil { + panic(fnerr) + } +} + +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +func (f genHelperDecoder) DecBinaryUnmarshal(bm encoding.BinaryUnmarshaler) { + fnerr := bm.UnmarshalBinary(f.d.d.DecodeBytes(nil, false, true)) + if fnerr != nil { + panic(fnerr) + } +} + +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +func (f genHelperDecoder) TimeRtidIfBinc() uintptr { + if _, ok := f.d.hh.(*BincHandle); ok { + return timeTypId + } + return 0 +} + +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +func (f genHelperDecoder) IsJSONHandle() bool { + return f.d.js +} + +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +func (f genHelperDecoder) HasExtensions() bool { + return len(f.d.h.extHandle) != 0 +} + +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +func (f genHelperDecoder) DecExt(v interface{}) (r bool) { + rt := reflect.TypeOf(v).Elem() + rtid := reflect.ValueOf(rt).Pointer() + if xfFn := f.d.h.getExt(rtid); xfFn != nil { + f.d.d.DecodeExt(v, xfFn.tag, xfFn.ext) + return true + } + return false +} + +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +func (f genHelperDecoder) DecInferLen(clen, maxlen, unit int) (rvlen int, truncated bool) { + return decInferLen(clen, maxlen, unit) +} diff --git a/Godeps/_workspace/src/github.com/ugorji/go/codec/gen-helper.go.tmpl b/Godeps/_workspace/src/github.com/ugorji/go/codec/gen-helper.go.tmpl index 50c029975f4b..8bc5061126f2 100644 --- a/Godeps/_workspace/src/github.com/ugorji/go/codec/gen-helper.go.tmpl +++ b/Godeps/_workspace/src/github.com/ugorji/go/codec/gen-helper.go.tmpl @@ -1,7 +1,7 @@ // //+build ignore // Copyright (c) 2012-2015 Ugorji Nwoke. All rights reserved. -// Use of this source code is governed by a BSD-style license found in the LICENSE file. +// Use of this source code is governed by a MIT license found in the LICENSE file. // ************************************************************ // DO NOT EDIT. @@ -10,6 +10,11 @@ package codec +import ( + "encoding" + "reflect" +) + // This file is used to generate helper code for codecgen. // The values here i.e. genHelper(En|De)coder are not to be used directly by // library users. They WILL change continously and without notice. @@ -48,6 +53,7 @@ type genHelperDecoder struct { func (f genHelperEncoder) EncBasicHandle() *BasicHandle { return f.e.h } + // FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* func (f genHelperEncoder) EncBinary() bool { return f.e.be // f.e.hh.isBinaryEncoding() @@ -57,6 +63,49 @@ func (f genHelperEncoder) EncFallback(iv interface{}) { // println(">>>>>>>>> EncFallback") f.e.encodeI(iv, false, false) } +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +func (f genHelperEncoder) EncTextMarshal(iv encoding.TextMarshaler) { + bs, fnerr := iv.MarshalText() + f.e.marshal(bs, fnerr, false, c_UTF8) +} +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +func (f genHelperEncoder) EncJSONMarshal(iv jsonMarshaler) { + bs, fnerr := iv.MarshalJSON() + f.e.marshal(bs, fnerr, true, c_UTF8) +} +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +func (f genHelperEncoder) EncBinaryMarshal(iv encoding.BinaryMarshaler) { + bs, fnerr := iv.MarshalBinary() + f.e.marshal(bs, fnerr, false, c_RAW) +} +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +func (f genHelperEncoder) TimeRtidIfBinc() uintptr { + if _, ok := f.e.hh.(*BincHandle); ok { + return timeTypId + } + return 0 +} +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +func (f genHelperEncoder) IsJSONHandle() bool { + return f.e.js +} +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +func (f genHelperEncoder) HasExtensions() bool { + return len(f.e.h.extHandle) != 0 +} +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +func (f genHelperEncoder) EncExt(v interface{}) (r bool) { + rt := reflect.TypeOf(v) + if rt.Kind() == reflect.Ptr { + rt = rt.Elem() + } + rtid := reflect.ValueOf(rt).Pointer() + if xfFn := f.e.h.getExt(rtid); xfFn != nil { + f.e.e.EncodeExt(v, xfFn.tag, xfFn.ext, f.e) + return true + } + return false +} // FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* func (f genHelperDecoder) DecBasicHandle() *BasicHandle { @@ -91,7 +140,61 @@ func (f genHelperDecoder) DecStructFieldNotFound(index int, name string) { func (f genHelperDecoder) DecArrayCannotExpand(sliceLen, streamLen int) { f.d.arrayCannotExpand(sliceLen, streamLen) } - +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +func (f genHelperDecoder) DecTextUnmarshal(tm encoding.TextUnmarshaler) { + fnerr := tm.UnmarshalText(f.d.d.DecodeBytes(f.d.b[:], true, true)) + if fnerr != nil { + panic(fnerr) + } +} +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +func (f genHelperDecoder) DecJSONUnmarshal(tm jsonUnmarshaler) { + // bs := f.dd.DecodeBytes(f.d.b[:], true, true) + f.d.r.track() + f.d.swallow() + bs := f.d.r.stopTrack() + // fmt.Printf(">>>>>> CODECGEN JSON: %s\n", bs) + fnerr := tm.UnmarshalJSON(bs) + if fnerr != nil { + panic(fnerr) + } +} +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +func (f genHelperDecoder) DecBinaryUnmarshal(bm encoding.BinaryUnmarshaler) { + fnerr := bm.UnmarshalBinary(f.d.d.DecodeBytes(nil, false, true)) + if fnerr != nil { + panic(fnerr) + } +} +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +func (f genHelperDecoder) TimeRtidIfBinc() uintptr { + if _, ok := f.d.hh.(*BincHandle); ok { + return timeTypId + } + return 0 +} +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +func (f genHelperDecoder) IsJSONHandle() bool { + return f.d.js +} +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +func (f genHelperDecoder) HasExtensions() bool { + return len(f.d.h.extHandle) != 0 +} +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +func (f genHelperDecoder) DecExt(v interface{}) (r bool) { + rt := reflect.TypeOf(v).Elem() + rtid := reflect.ValueOf(rt).Pointer() + if xfFn := f.d.h.getExt(rtid); xfFn != nil { + f.d.d.DecodeExt(v, xfFn.tag, xfFn.ext) + return true + } + return false +} +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +func (f genHelperDecoder) DecInferLen(clen, maxlen, unit int) (rvlen int, truncated bool) { + return decInferLen(clen, maxlen, unit) +} {{/* diff --git a/Godeps/_workspace/src/github.com/ugorji/go/codec/gen.generated.go b/Godeps/_workspace/src/github.com/ugorji/go/codec/gen.generated.go index f035401d80e5..9a35f02fae31 100644 --- a/Godeps/_workspace/src/github.com/ugorji/go/codec/gen.generated.go +++ b/Godeps/_workspace/src/github.com/ugorji/go/codec/gen.generated.go @@ -1,5 +1,5 @@ // Copyright (c) 2012-2015 Ugorji Nwoke. All rights reserved. -// Use of this source code is governed by a BSD-style license found in the LICENSE file. +// Use of this source code is governed by a MIT license found in the LICENSE file. package codec @@ -9,11 +9,8 @@ const genDecMapTmpl = ` {{var "v"}} := *{{ .Varname }} {{var "l"}} := r.ReadMapStart() if {{var "v"}} == nil { - if {{var "l"}} > 0 { - {{var "v"}} = make(map[{{ .KTyp }}]{{ .Typ }}, {{var "l"}}) - } else { - {{var "v"}} = make(map[{{ .KTyp }}]{{ .Typ }}) // supports indefinite-length, etc - } + {{var "rl"}}, _ := z.DecInferLen({{var "l"}}, z.DecBasicHandle().MaxInitLen, {{ .Size }}) + {{var "v"}} = make(map[{{ .KTyp }}]{{ .Typ }}, {{var "rl"}}) *{{ .Varname }} = {{var "v"}} } if {{var "l"}} > 0 { @@ -33,9 +30,6 @@ for {{var "j"}} := 0; {{var "j"}} < {{var "l"}}; {{var "j"}}++ { } } else if {{var "l"}} < 0 { for {{var "j"}} := 0; !r.CheckBreak(); {{var "j"}}++ { - if {{var "j"}} > 0 { - r.ReadMapEntrySeparator() - } var {{var "mk"}} {{ .KTyp }} {{ $x := printf "%vmk%v" .TempVar .Rand }}{{ decLineVarK $x }} {{ if eq .KTyp "interface{}" }}// special case if a byte array. @@ -43,28 +37,31 @@ for {{var "j"}} := 0; !r.CheckBreak(); {{var "j"}}++ { {{var "mk"}} = string({{var "bv"}}) } {{ end }} - r.ReadMapKVSeparator() {{var "mv"}} := {{var "v"}}[{{var "mk"}}] {{ $x := printf "%vmv%v" .TempVar .Rand }}{{ decLineVar $x }} if {{var "v"}} != nil { {{var "v"}}[{{var "mk"}}] = {{var "mv"}} } } -r.ReadMapEnd() +r.ReadEnd() } // else len==0: TODO: Should we clear map entries? ` const genDecListTmpl = ` -{{var "v"}} := *{{ .Varname }} -{{var "h"}}, {{var "l"}} := z.DecSliceHelperStart() +{{var "v"}} := {{ if not isArray}}*{{ end }}{{ .Varname }} +{{var "h"}}, {{var "l"}} := z.DecSliceHelperStart() {{/* // helper, containerLenS */}} + +var {{var "rr"}}, {{var "rl"}} int {{/* // num2read, length of slice/array/chan */}} +var {{var "c"}}, {{var "rt"}} bool {{/* // changed, truncated */}} +_, _, _ = {{var "c"}}, {{var "rt"}}, {{var "rl"}} +{{var "rr"}} = {{var "l"}} +{{/* rl is NOT used. Only used for getting DecInferLen. len(r) used directly in code */}} -var {{var "c"}} bool {{ if not isArray }}if {{var "v"}} == nil { - if {{var "l"}} <= 0 { - {{var "v"}} = make({{ .CTyp }}, 0) - } else { - {{var "v"}} = make({{ .CTyp }}, {{var "l"}}) + if {{var "rl"}}, {{var "rt"}} = z.DecInferLen({{var "l"}}, z.DecBasicHandle().MaxInitLen, {{ .Size }}); {{var "rt"}} { + {{var "rr"}} = {{var "rl"}} } + {{var "v"}} = make({{ .CTyp }}, {{var "rl"}}) {{var "c"}} = true } {{ end }} @@ -80,41 +77,45 @@ if {{var "l"}} == 0 { {{ if isSlice }} {{ $x := printf "%st%s" .TempVar .Rand }}{{ decLineVar $x }} {{var "v"}} <- {{var "t"}} {{ else }} - {{var "n"}} := {{var "l"}} if {{var "l"}} > cap({{var "v"}}) { - {{ if isArray }}r.ReadArrayCannotExpand(len({{var "v"}}), {{var "l"}}) - {{var "n"}} = len({{var "v"}}) - {{ else }}{{ if .Immutable }} + {{ if isArray }}z.DecArrayCannotExpand(len({{var "v"}}), {{var "l"}}) + {{ else }}{{var "rl"}}, {{var "rt"}} = z.DecInferLen({{var "l"}}, z.DecBasicHandle().MaxInitLen, {{ .Size }}) + {{ if .Immutable }} {{var "v2"}} := {{var "v"}} - {{var "v"}} = make([]{{ .Typ }}, {{var "l"}}, {{var "l"}}) + {{var "v"}} = make([]{{ .Typ }}, {{var "rl"}}) if len({{var "v"}}) > 0 { copy({{var "v"}}, {{var "v2"}}[:cap({{var "v2"}})]) } - {{ else }}{{var "v"}} = make([]{{ .Typ }}, {{var "l"}}, {{var "l"}}) + {{ else }}{{var "v"}} = make([]{{ .Typ }}, {{var "rl"}}) {{ end }}{{var "c"}} = true {{ end }} + {{var "rr"}} = len({{var "v"}}) } else if {{var "l"}} != len({{var "v"}}) { - {{var "v"}} = {{var "v"}}[:{{var "l"}}] - {{var "c"}} = true + {{ if isSlice }}{{var "v"}} = {{var "v"}}[:{{var "l"}}] + {{var "c"}} = true {{ end }} } {{var "j"}} := 0 - for ; {{var "j"}} < {{var "n"}} ; {{var "j"}}++ { + for ; {{var "j"}} < {{var "rr"}} ; {{var "j"}}++ { {{ $x := printf "%[1]vv%[2]v[%[1]vj%[2]v]" .TempVar .Rand }}{{ decLineVar $x }} - } {{ if isArray }} - for ; {{var "j"}} < {{var "l"}} ; {{var "j"}}++ { + } + {{ if isArray }}for ; {{var "j"}} < {{var "l"}} ; {{var "j"}}++ { z.DecSwallow() - }{{ end }} - {{ end }}{{/* closing if not chan */}} + } + {{ else }}if {{var "rt"}} { {{/* means that it is mutable and slice */}} + for ; {{var "j"}} < {{var "l"}} ; {{var "j"}}++ { + {{var "v"}} = append({{var "v"}}, {{ zero}}) + {{ $x := printf "%[1]vv%[2]v[%[1]vj%[2]v]" .TempVar .Rand }}{{ decLineVar $x }} + } + } + {{ end }} + {{ end }}{{/* closing 'if not chan' */}} } else { for {{var "j"}} := 0; !r.CheckBreak(); {{var "j"}}++ { if {{var "j"}} >= len({{var "v"}}) { - {{ if isArray }}r.ReadArrayCannotExpand(len({{var "v"}}), {{var "j"}}+1) + {{ if isArray }}z.DecArrayCannotExpand(len({{var "v"}}), {{var "j"}}+1) {{ else if isSlice}}{{var "v"}} = append({{var "v"}}, {{zero}})// var {{var "z"}} {{ .Typ }} {{var "c"}} = true {{ end }} } - if {{var "j"}} > 0 { - {{var "h"}}.Sep({{var "j"}}) - } {{ if isChan}} var {{var "t"}} {{ .Typ }} {{ $x := printf "%st%s" .TempVar .Rand }}{{ decLineVar $x }} @@ -129,8 +130,9 @@ if {{var "l"}} == 0 { {{ if isSlice }} } {{var "h"}}.End() } -if {{var "c"}} { +{{ if not isArray }}if {{var "c"}} { *{{ .Varname }} = {{var "v"}} -} +}{{ end }} + ` diff --git a/Godeps/_workspace/src/github.com/ugorji/go/codec/gen.go b/Godeps/_workspace/src/github.com/ugorji/go/codec/gen.go index 618eb5740c4c..762f25cd54a2 100644 --- a/Godeps/_workspace/src/github.com/ugorji/go/codec/gen.go +++ b/Godeps/_workspace/src/github.com/ugorji/go/codec/gen.go @@ -1,5 +1,5 @@ // Copyright (c) 2012-2015 Ugorji Nwoke. All rights reserved. -// Use of this source code is governed by a BSD-style license found in the LICENSE file. +// Use of this source code is governed by a MIT license found in the LICENSE file. package codec @@ -12,8 +12,10 @@ import ( "io" "io/ioutil" "math/rand" + "os" "reflect" "regexp" + "sort" "strconv" "strings" "sync" @@ -22,14 +24,25 @@ import ( ) // --------------------------------------------------- -// codecgen only works in the following: -// - extensions are not supported. Do not make a type a Selfer and an extension. -// - Selfer takes precedence. -// Any type that implements it knows how to encode/decode itself statically. -// Extensions are only known at runtime. -// codecgen only looks at the Kind of the type. +// codecgen supports the full cycle of reflection-based codec: +// - RawExt +// - Builtins +// - Extensions +// - (Binary|Text|JSON)(Unm|M)arshal +// - generic by-kind // -// - the following types are supported: +// This means that, for dynamic things, we MUST use reflection to at least get the reflect.Type. +// In those areas, we try to only do reflection or interface-conversion when NECESSARY: +// - Extensions, only if Extensions are configured. +// +// However, codecgen doesn't support the following: +// - Canonical option. (codecgen IGNORES it currently) +// This is just because it has not been implemented. +// +// During encode/decode, Selfer takes precedence. +// A type implementing Selfer will know how to encode/decode itself statically. +// +// The following field types are supported: // array: [n]T // slice: []T // map: map[K]V @@ -66,11 +79,24 @@ import ( // It was a concious decision to have gen.go always explicitly call EncodeNil or TryDecodeAsNil. // This way, there isn't a function call overhead just to see that we should not enter a block of code. -const GenVersion = 2 // increment this value each time codecgen changes fundamentally. +// GenVersion is the current version of codecgen. +// +// NOTE: Increment this value each time codecgen changes fundamentally. +// Fundamental changes are: +// - helper methods change (signature change, new ones added, some removed, etc) +// - codecgen command line changes +// +// v1: Initial Version +// v2: +// v3: Changes for Kubernetes: +// changes in signature of some unpublished helper methods and codecgen cmdline arguments. +// v4: Removed separator support from (en|de)cDriver, and refactored codec(gen) +const GenVersion = 4 const ( - genCodecPkg = "codec1978" - genTempVarPfx = "yy" + genCodecPkg = "codec1978" + genTempVarPfx = "yy" + genTopLevelVarName = "x" // ignore canBeNil parameter, and always set to true. // This is because nil can appear anywhere, so we should always check. @@ -94,30 +120,39 @@ var ( // genRunner holds some state used during a Gen run. type genRunner struct { w io.Writer // output - c uint64 // ctr used for generating varsfx + c uint64 // counter used for generating varsfx t []reflect.Type // list of types to run selfer on - tc reflect.Type // currently running selfer on this type - te map[uintptr]bool // types for which the encoder has been created - td map[uintptr]bool // types for which the decoder has been created - cp string // codec import path - im map[string]reflect.Type // imports to add + tc reflect.Type // currently running selfer on this type + te map[uintptr]bool // types for which the encoder has been created + td map[uintptr]bool // types for which the decoder has been created + cp string // codec import path + + im map[string]reflect.Type // imports to add + imn map[string]string // package names of imports to add + imc uint64 // counter for import numbers + is map[reflect.Type]struct{} // types seen during import search bp string // base PkgPath, for which we are generating for cpfx string // codec package prefix unsafe bool // is unsafe to be used in generated code? - ts map[reflect.Type]struct{} // types for which enc/dec must be generated - xs string // top level variable/constant suffix - hn string // fn helper type name + tm map[reflect.Type]struct{} // types for which enc/dec must be generated + ts []reflect.Type // types for which enc/dec must be generated - rr *rand.Rand // random generator for file-specific types + xs string // top level variable/constant suffix + hn string // fn helper type name + + ti *TypeInfos + // rr *rand.Rand // random generator for file-specific types } // Gen will write a complete go file containing Selfer implementations for each // type passed. All the types must be in the same package. -func Gen(w io.Writer, buildTags, pkgName string, useUnsafe bool, typ ...reflect.Type) { +// +// Library users: *DO NOT USE IT DIRECTLY. IT WILL CHANGE CONTINOUSLY WITHOUT NOTICE.* +func Gen(w io.Writer, buildTags, pkgName, uid string, useUnsafe bool, ti *TypeInfos, typ ...reflect.Type) { if len(typ) == 0 { return } @@ -128,17 +163,28 @@ func Gen(w io.Writer, buildTags, pkgName string, useUnsafe bool, typ ...reflect. te: make(map[uintptr]bool), td: make(map[uintptr]bool), im: make(map[string]reflect.Type), + imn: make(map[string]string), is: make(map[reflect.Type]struct{}), - ts: make(map[reflect.Type]struct{}), - bp: typ[0].PkgPath(), - rr: rand.New(rand.NewSource(time.Now().UnixNano())), + tm: make(map[reflect.Type]struct{}), + ts: []reflect.Type{}, + bp: genImportPath(typ[0]), + xs: uid, + ti: ti, //TODO: make it configurable + } + if x.ti == nil { + x.ti = defTypeInfos + } + if x.xs == "" { + rr := rand.New(rand.NewSource(time.Now().UnixNano())) + x.xs = strconv.FormatInt(rr.Int63n(9999), 10) } // gather imports first: - x.cp = reflect.TypeOf(x).PkgPath() + x.cp = genImportPath(reflect.TypeOf(x)) + x.imn[x.cp] = genCodecPkg for _, t := range typ { - // fmt.Printf("###########: PkgPath: '%v', Name: '%s'\n", t.PkgPath(), t.Name()) - if t.PkgPath() != x.bp { + // fmt.Printf("###########: PkgPath: '%v', Name: '%s'\n", genImportPath(t), t.Name()) + if genImportPath(t) != x.bp { panic(genAllTypesSamePkgErr) } x.genRefPkgs(t) @@ -162,8 +208,14 @@ func Gen(w io.Writer, buildTags, pkgName string, useUnsafe bool, typ ...reflect. x.cpfx = genCodecPkg + "." x.linef("%s \"%s\"", genCodecPkg, x.cp) } + // use a sorted set of im keys, so that we can get consistent output + imKeys := make([]string, 0, len(x.im)) for k, _ := range x.im { - x.line("\"" + k + "\"") + imKeys = append(imKeys, k) + } + sort.Strings(imKeys) + for _, k := range imKeys { // for k, _ := range x.im { + x.linef("%s \"%s\"", x.imn[k], k) } // add required packages for _, k := range [...]string{"reflect", "unsafe", "runtime", "fmt", "errors"} { @@ -177,13 +229,11 @@ func Gen(w io.Writer, buildTags, pkgName string, useUnsafe bool, typ ...reflect. x.line(")") x.line("") - x.xs = strconv.FormatInt(x.rr.Int63n(9999), 10) - x.line("const (") x.linef("codecSelferC_UTF8%s = %v", x.xs, int64(c_UTF8)) x.linef("codecSelferC_RAW%s = %v", x.xs, int64(c_RAW)) - x.linef("codecSelverValueTypeArray%s = %v", x.xs, int64(valueTypeArray)) - x.linef("codecSelverValueTypeMap%s = %v", x.xs, int64(valueTypeMap)) + x.linef("codecSelferValueTypeArray%s = %v", x.xs, int64(valueTypeArray)) + x.linef("codecSelferValueTypeMap%s = %v", x.xs, int64(valueTypeMap)) x.line(")") x.line("var (") x.line("codecSelferBitsize" + x.xs + " = uint8(reflect.TypeOf(uint(0)).Bits())") @@ -210,8 +260,10 @@ func Gen(w io.Writer, buildTags, pkgName string, useUnsafe bool, typ ...reflect. x.linef("}") x.line("if false { // reference the types, but skip this branch at build/run time") var n int - for _, t := range x.im { - x.linef("var v%v %s", n, t.String()) + // for k, t := range x.im { + for _, k := range imKeys { + t := x.im[k] + x.linef("var v%v %s.%s", n, x.imn[k], t.Name()) n++ } if x.unsafe { @@ -239,16 +291,16 @@ func Gen(w io.Writer, buildTags, pkgName string, useUnsafe bool, typ ...reflect. x.selfer(false) } - for t, _ := range x.ts { + for _, t := range x.ts { rtid := reflect.ValueOf(t).Pointer() // generate enc functions for all these slice/map types. - x.linef("func (x %s) enc%s(v %s, e *%sEncoder) {", x.hn, x.genMethodNameT(t), x.genTypeName(t), x.cpfx) + x.linef("func (x %s) enc%s(v %s%s, e *%sEncoder) {", x.hn, x.genMethodNameT(t), x.arr2str(t, "*"), x.genTypeName(t), x.cpfx) x.genRequiredMethodVars(true) switch t.Kind() { case reflect.Array, reflect.Slice, reflect.Chan: - x.encListFallback("v", rtid, t) + x.encListFallback("v", t) case reflect.Map: - x.encMapFallback("v", rtid, t) + x.encMapFallback("v", t) default: panic(genExpectArrayOrMapErr) } @@ -273,6 +325,19 @@ func Gen(w io.Writer, buildTags, pkgName string, useUnsafe bool, typ ...reflect. x.line("") } +func (x *genRunner) checkForSelfer(t reflect.Type, varname string) bool { + // return varname != genTopLevelVarName && t != x.tc + // the only time we checkForSelfer is if we are not at the TOP of the generated code. + return varname != genTopLevelVarName +} + +func (x *genRunner) arr2str(t reflect.Type, s string) string { + if t.Kind() == reflect.Array { + return s + } + return "" +} + func (x *genRunner) genRequiredMethodVars(encode bool) { x.line("var h " + x.hn) if encode { @@ -287,11 +352,19 @@ func (x *genRunner) genRefPkgs(t reflect.Type) { if _, ok := x.is[t]; ok { return } - // fmt.Printf(">>>>>>: PkgPath: '%v', Name: '%s'\n", t.PkgPath(), t.Name()) + // fmt.Printf(">>>>>>: PkgPath: '%v', Name: '%s'\n", genImportPath(t), t.Name()) x.is[t] = struct{}{} - tpkg, tname := t.PkgPath(), t.Name() + tpkg, tname := genImportPath(t), t.Name() if tpkg != "" && tpkg != x.bp && tpkg != x.cp && tname != "" && tname[0] >= 'A' && tname[0] <= 'Z' { - x.im[tpkg] = t + if _, ok := x.im[tpkg]; !ok { + x.im[tpkg] = t + if idx := strings.LastIndex(tpkg, "/"); idx < 0 { + x.imn[tpkg] = tpkg + } else { + x.imc++ + x.imn[tpkg] = "pkg" + strconv.FormatUint(x.imc, 10) + "_" + tpkg[idx+1:] + } + } } switch t.Kind() { case reflect.Array, reflect.Slice, reflect.Ptr, reflect.Chan: @@ -335,7 +408,65 @@ func (x *genRunner) outf(s string, params ...interface{}) { } func (x *genRunner) genTypeName(t reflect.Type) (n string) { - return genTypeName(t, x.tc) + // defer func() { fmt.Printf(">>>> ####: genTypeName: t: %v, name: '%s'\n", t, n) }() + + // if the type has a PkgPath, which doesn't match the current package, + // then include it. + // We cannot depend on t.String() because it includes current package, + // or t.PkgPath because it includes full import path, + // + var ptrPfx string + for t.Kind() == reflect.Ptr { + ptrPfx += "*" + t = t.Elem() + } + if tn := t.Name(); tn != "" { + return ptrPfx + x.genTypeNamePrim(t) + } + switch t.Kind() { + case reflect.Map: + return ptrPfx + "map[" + x.genTypeName(t.Key()) + "]" + x.genTypeName(t.Elem()) + case reflect.Slice: + return ptrPfx + "[]" + x.genTypeName(t.Elem()) + case reflect.Array: + return ptrPfx + "[" + strconv.FormatInt(int64(t.Len()), 10) + "]" + x.genTypeName(t.Elem()) + case reflect.Chan: + return ptrPfx + t.ChanDir().String() + " " + x.genTypeName(t.Elem()) + default: + if t == intfTyp { + return ptrPfx + "interface{}" + } else { + return ptrPfx + x.genTypeNamePrim(t) + } + } +} + +func (x *genRunner) genTypeNamePrim(t reflect.Type) (n string) { + if t.Name() == "" { + return t.String() + } else if genImportPath(t) == "" || genImportPath(t) == genImportPath(x.tc) { + return t.Name() + } else { + return x.imn[genImportPath(t)] + "." + t.Name() + // return t.String() // best way to get the package name inclusive + } +} + +func (x *genRunner) genZeroValueR(t reflect.Type) string { + // if t is a named type, w + switch t.Kind() { + case reflect.Ptr, reflect.Interface, reflect.Chan, reflect.Func, + reflect.Slice, reflect.Map, reflect.Invalid: + return "nil" + case reflect.Bool: + return "false" + case reflect.String: + return `""` + case reflect.Struct, reflect.Array: + return x.genTypeName(t) + "{}" + default: // all numbers + return "0" + } } func (x *genRunner) genMethodNameT(t reflect.Type) (s string) { @@ -361,16 +492,16 @@ func (x *genRunner) selfer(encode bool) { if encode { x.line(") CodecEncodeSelf(e *" + x.cpfx + "Encoder) {") x.genRequiredMethodVars(true) - // x.enc("x", t) - x.encVar("x", t) + // x.enc(genTopLevelVarName, t) + x.encVar(genTopLevelVarName, t) } else { x.line(") CodecDecodeSelf(d *" + x.cpfx + "Decoder) {") x.genRequiredMethodVars(false) // do not use decVar, as there is no need to check TryDecodeAsNil // or way to elegantly handle that, and also setting it to a // non-nil value doesn't affect the pointer passed. - // x.decVar("x", t, false) - x.dec("x", t0) + // x.decVar(genTopLevelVarName, t, false) + x.dec(genTopLevelVarName, t0) } x.line("}") x.line("") @@ -384,21 +515,21 @@ func (x *genRunner) selfer(encode bool) { x.out(fnSigPfx) x.line(") codecDecodeSelfFromMap(l int, d *" + x.cpfx + "Decoder) {") x.genRequiredMethodVars(false) - x.decStructMap("x", "l", reflect.ValueOf(t0).Pointer(), t0, 0) + x.decStructMap(genTopLevelVarName, "l", reflect.ValueOf(t0).Pointer(), t0, 0) x.line("}") x.line("") } else { x.out(fnSigPfx) x.line(") codecDecodeSelfFromMapLenPrefix(l int, d *" + x.cpfx + "Decoder) {") x.genRequiredMethodVars(false) - x.decStructMap("x", "l", reflect.ValueOf(t0).Pointer(), t0, 1) + x.decStructMap(genTopLevelVarName, "l", reflect.ValueOf(t0).Pointer(), t0, 1) x.line("}") x.line("") x.out(fnSigPfx) x.line(") codecDecodeSelfFromMapCheckBreak(l int, d *" + x.cpfx + "Decoder) {") x.genRequiredMethodVars(false) - x.decStructMap("x", "l", reflect.ValueOf(t0).Pointer(), t0, 2) + x.decStructMap(genTopLevelVarName, "l", reflect.ValueOf(t0).Pointer(), t0, 2) x.line("}") x.line("") } @@ -407,24 +538,31 @@ func (x *genRunner) selfer(encode bool) { x.out(fnSigPfx) x.line(") codecDecodeSelfFromArray(l int, d *" + x.cpfx + "Decoder) {") x.genRequiredMethodVars(false) - x.decStructArray("x", "l", "return", reflect.ValueOf(t0).Pointer(), t0) + x.decStructArray(genTopLevelVarName, "l", "return", reflect.ValueOf(t0).Pointer(), t0) x.line("}") x.line("") } +// used for chan, array, slice, map func (x *genRunner) xtraSM(varname string, encode bool, t reflect.Type) { if encode { - x.linef("h.enc%s(%s(%s), e)", x.genMethodNameT(t), x.genTypeName(t), varname) + x.linef("h.enc%s((%s%s)(%s), e)", x.genMethodNameT(t), x.arr2str(t, "*"), x.genTypeName(t), varname) // x.line("h.enc" + x.genMethodNameT(t) + "(" + x.genTypeName(t) + "(" + varname + "), e)") } else { x.linef("h.dec%s((*%s)(%s), d)", x.genMethodNameT(t), x.genTypeName(t), varname) // x.line("h.dec" + x.genMethodNameT(t) + "((*" + x.genTypeName(t) + ")(" + varname + "), d)") } - x.ts[t] = struct{}{} + if _, ok := x.tm[t]; !ok { + x.tm[t] = struct{}{} + x.ts = append(x.ts, t) + } } +// encVar will encode a variable. +// The parameter, t, is the reflect.Type of the variable itself func (x *genRunner) encVar(varname string, t reflect.Type) { + // fmt.Printf(">>>>>> varname: %s, t: %v\n", varname, t) var checkNil bool switch t.Kind() { case reflect.Ptr, reflect.Interface, reflect.Slice, reflect.Map, reflect.Chan: @@ -435,15 +573,20 @@ func (x *genRunner) encVar(varname string, t reflect.Type) { } switch t.Kind() { case reflect.Ptr: - if t.Elem().Kind() == reflect.Struct { + switch t.Elem().Kind() { + case reflect.Struct, reflect.Array: x.enc(varname, genNonPtr(t)) - } else { + default: i := x.varsfx() x.line(genTempVarPfx + i + " := *" + varname) x.enc(genTempVarPfx+i, genNonPtr(t)) } + case reflect.Struct, reflect.Array: + i := x.varsfx() + x.line(genTempVarPfx + i + " := &" + varname) + x.enc(genTempVarPfx+i, t) default: - x.enc(varname, genNonPtr(t)) + x.enc(varname, t) } if checkNil { @@ -452,47 +595,89 @@ func (x *genRunner) encVar(varname string, t reflect.Type) { } +// enc will encode a variable (varname) of type T, +// except t is of kind reflect.Struct or reflect.Array, wherein varname is of type *T (to prevent copying) func (x *genRunner) enc(varname string, t reflect.Type) { - // varName here must be to a pointer to a struct, or to a value directly. + // varName here must be to a pointer to a struct/array, or to a value directly. rtid := reflect.ValueOf(t).Pointer() // We call CodecEncodeSelf if one of the following are honored: // - the type already implements Selfer, call that // - the type has a Selfer implementation just created, use that // - the type is in the list of the ones we will generate for, but it is not currently being generated - if t.Implements(selferTyp) { - x.line(varname + ".CodecEncodeSelf(e)") - return - } - if t.Kind() == reflect.Struct && reflect.PtrTo(t).Implements(selferTyp) { - x.line(varname + ".CodecEncodeSelf(e)") - return - } - if _, ok := x.te[rtid]; ok { - x.line(varname + ".CodecEncodeSelf(e)") - return + + tptr := reflect.PtrTo(t) + tk := t.Kind() + if x.checkForSelfer(t, varname) { + if t.Implements(selferTyp) || (tptr.Implements(selferTyp) && (tk == reflect.Array || tk == reflect.Struct)) { + x.line(varname + ".CodecEncodeSelf(e)") + return + } + + if _, ok := x.te[rtid]; ok { + x.line(varname + ".CodecEncodeSelf(e)") + return + } } inlist := false for _, t0 := range x.t { if t == t0 { inlist = true - if t != x.tc { + if x.checkForSelfer(t, varname) { x.line(varname + ".CodecEncodeSelf(e)") return } break } } + var rtidAdded bool if t == x.tc { x.te[rtid] = true rtidAdded = true } + // check if + // - type is RawExt + // - the type implements (Text|JSON|Binary)(Unm|M)arshal + mi := x.varsfx() + x.linef("%sm%s := z.EncBinary()", genTempVarPfx, mi) + x.linef("_ = %sm%s", genTempVarPfx, mi) + x.line("if false {") //start if block + defer func() { x.line("}") }() //end if block + + if t == rawExtTyp { + x.linef("} else { r.EncodeRawExt(%v, e)", varname) + return + } + // HACK: Support for Builtins. + // Currently, only Binc supports builtins, and the only builtin type is time.Time. + // Have a method that returns the rtid for time.Time if Handle is Binc. + if t == timeTyp { + vrtid := genTempVarPfx + "m" + x.varsfx() + x.linef("} else if %s := z.TimeRtidIfBinc(); %s != 0 { ", vrtid, vrtid) + x.linef("r.EncodeBuiltin(%s, %s)", vrtid, varname) + } + // only check for extensions if the type is named, and has a packagePath. + if genImportPath(t) != "" && t.Name() != "" { + // first check if extensions are configued, before doing the interface conversion + x.linef("} else if z.HasExtensions() && z.EncExt(%s) {", varname) + } + if t.Implements(binaryMarshalerTyp) || tptr.Implements(binaryMarshalerTyp) { + x.linef("} else if %sm%s { z.EncBinaryMarshal(%v) ", genTempVarPfx, mi, varname) + } + if t.Implements(jsonMarshalerTyp) || tptr.Implements(jsonMarshalerTyp) { + x.linef("} else if !%sm%s && z.IsJSONHandle() { z.EncJSONMarshal(%v) ", genTempVarPfx, mi, varname) + } else if t.Implements(textMarshalerTyp) || tptr.Implements(textMarshalerTyp) { + x.linef("} else if !%sm%s { z.EncTextMarshal(%v) ", genTempVarPfx, mi, varname) + } + + x.line("} else {") + switch t.Kind() { case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: x.line("r.EncodeInt(int64(" + varname + "))") - case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: + case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: x.line("r.EncodeUint(uint64(" + varname + "))") case reflect.Float32: x.line("r.EncodeFloat32(float32(" + varname + "))") @@ -502,9 +687,11 @@ func (x *genRunner) enc(varname string, t reflect.Type) { x.line("r.EncodeBool(bool(" + varname + "))") case reflect.String: x.line("r.EncodeString(codecSelferC_UTF8" + x.xs + ", string(" + varname + "))") - case reflect.Array, reflect.Chan: + case reflect.Chan: x.xtraSM(varname, true, t) // x.encListFallback(varname, rtid, t) + case reflect.Array: + x.xtraSM(varname, true, t) case reflect.Slice: // if nil, call dedicated function // if a []uint8, call dedicated function @@ -515,7 +702,7 @@ func (x *genRunner) enc(varname string, t reflect.Type) { if rtid == uint8SliceTypId { x.line("r.EncodeStringBytes(codecSelferC_RAW" + x.xs + ", []byte(" + varname + "))") } else if fastpathAV.index(rtid) != -1 { - g := genV{Slice: true, Elem: x.genTypeName(t.Elem())} + g := x.newGenV(t) x.line("z.F." + g.MethodNamePfx("Enc", false) + "V(" + varname + ", false, e)") } else { x.xtraSM(varname, true, t) @@ -529,9 +716,7 @@ func (x *genRunner) enc(varname string, t reflect.Type) { // - else call Encoder.encode(XXX) on it. // x.line("if " + varname + " == nil { \nr.EncodeNil()\n } else { ") if fastpathAV.index(rtid) != -1 { - g := genV{Slice: false, - Elem: x.genTypeName(t.Elem()), - MapKey: x.genTypeName(t.Key())} + g := x.newGenV(t) x.line("z.F." + g.MethodNamePfx("Enc", false) + "V(" + varname + ", false, e)") } else { x.xtraSM(varname, true, t) @@ -556,7 +741,7 @@ func (x *genRunner) encZero(t reflect.Type) { switch t.Kind() { case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: x.line("r.EncodeInt(0)") - case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: + case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: x.line("r.EncodeUint(0)") case reflect.Float32: x.line("r.EncodeFloat32(0)") @@ -576,24 +761,22 @@ func (x *genRunner) encStruct(varname string, rtid uintptr, t reflect.Type) { // replicate code in kStruct i.e. for each field, deref type to non-pointer, and call x.enc on it // if t === type currently running selfer on, do for all - ti := getTypeInfo(rtid, t) + ti := x.ti.get(rtid, t) i := x.varsfx() sepVarname := genTempVarPfx + "sep" + i - firstVarname := genTempVarPfx + "first" + i numfieldsvar := genTempVarPfx + "q" + i ti2arrayvar := genTempVarPfx + "r" + i struct2arrvar := genTempVarPfx + "2arr" + i x.line(sepVarname + " := !z.EncBinary()") x.linef("%s := z.EncBasicHandle().StructToArray", struct2arrvar) - x.line("var " + firstVarname + " bool") tisfi := ti.sfip // always use sequence from file. decStruct expects same thing. // due to omitEmpty, we need to calculate the // number of non-empty things we write out first. // This is required as we need to pre-determine the size of the container, // to support length-prefixing. x.linef("var %s [%v]bool", numfieldsvar, len(tisfi)) - x.linef("_, _, _, _ = %s, %s, %s, %s", sepVarname, firstVarname, numfieldsvar, struct2arrvar) + x.linef("_, _, _ = %s, %s, %s", sepVarname, numfieldsvar, struct2arrvar) x.linef("const %s bool = %v", ti2arrayvar, ti.toArray) nn := 0 for j, si := range tisfi { @@ -628,7 +811,7 @@ func (x *genRunner) encStruct(varname string, rtid uintptr, t reflect.Type) { case reflect.Map, reflect.Slice, reflect.Array, reflect.Chan: omitline += "len(" + varname + "." + t2.Name + ") != 0" default: - omitline += varname + "." + t2.Name + " != " + genZeroValueR(t2.Type, x.tc) + omitline += varname + "." + t2.Name + " != " + x.genZeroValueR(t2.Type) } x.linef("%s[%v] = %s", numfieldsvar, j, omitline) } @@ -678,11 +861,6 @@ func (x *genRunner) encStruct(varname string, rtid uintptr, t reflect.Type) { // if the type of the field is a Selfer, or one of the ones x.linef("if %s || %s {", ti2arrayvar, struct2arrvar) // if ti.toArray - if j > 0 { - x.line("if " + sepVarname + " {") - x.line("r.EncodeArrayEntrySeparator()") - x.line("}") - } if labelUsed { x.line("if " + isNilVarName + " { r.EncodeNil() } else { ") } @@ -714,17 +892,8 @@ func (x *genRunner) encStruct(varname string, rtid uintptr, t reflect.Type) { // } // x.line(varname + "." + t2.Name + " != " + genZeroValueR(t2.Type, x.tc) + " {") } - if j == 0 { - x.linef("%s = true", firstVarname) - } else { - x.linef("if %s { r.EncodeMapEntrySeparator() } else { %s = true }", firstVarname, firstVarname) - } - // x.line("r.EncodeString(codecSelferC_UTF8" + x.xs + ", string(\"" + t2.Name + "\"))") x.line("r.EncodeString(codecSelferC_UTF8" + x.xs + ", string(\"" + si.encName + "\"))") - x.line("if " + sepVarname + " {") - x.line("r.EncodeMapKVSeparator()") - x.line("}") if labelUsed { x.line("if " + isNilVarName + " { r.EncodeNil() } else { ") x.encVar(varname+"."+t2.Name, t2.Type) @@ -738,68 +907,35 @@ func (x *genRunner) encStruct(varname string, rtid uintptr, t reflect.Type) { x.linef("} ") // end if/else ti.toArray } x.line("if " + sepVarname + " {") - x.linef("if %s || %s {", ti2arrayvar, struct2arrvar) // if ti.toArray { - x.line("r.EncodeArrayEnd()") - x.linef("} else {") // if not ti.toArray - x.line("r.EncodeMapEnd()") - x.linef("} ") // end if/else ti.toArray + x.line("r.EncodeEnd()") x.line("}") } -func (x *genRunner) encListFallback(varname string, rtid uintptr, t reflect.Type) { +func (x *genRunner) encListFallback(varname string, t reflect.Type) { i := x.varsfx() g := genTempVarPfx x.line("r.EncodeArrayStart(len(" + varname + "))") - x.line(genTempVarPfx + "s" + i + " := !z.EncBinary()") - x.line("if " + genTempVarPfx + "s" + i + " {") - if t.Kind() == reflect.Chan { - x.linef("for %si%s, %si2%s := 0, len(%s); %si%s < %si2%s; %si%s++ {", g, i, g, i, varname, g, i, g, i, g, i) - x.linef("%sv%s := <-%s", g, i, varname) - } else { - x.linef("for %si%s, %sv%s := range %s {", genTempVarPfx, i, genTempVarPfx, i, varname) - } - x.linef("if %si%s > 0 { r.EncodeArrayEntrySeparator() }", genTempVarPfx, i) - x.encVar(genTempVarPfx+"v"+i, t.Elem()) - x.line("}") - x.line("r.EncodeArrayEnd()") - x.line("} else {") if t.Kind() == reflect.Chan { x.linef("for %si%s, %si2%s := 0, len(%s); %si%s < %si2%s; %si%s++ {", g, i, g, i, varname, g, i, g, i, g, i) x.linef("%sv%s := <-%s", g, i, varname) } else { - x.line("for _, " + genTempVarPfx + "v" + i + " := range " + varname + " {") + // x.linef("for %si%s, %sv%s := range %s {", genTempVarPfx, i, genTempVarPfx, i, varname) + x.linef("for _, %sv%s := range %s {", genTempVarPfx, i, varname) } x.encVar(genTempVarPfx+"v"+i, t.Elem()) x.line("}") - x.line("}") + x.line("r.EncodeEnd()") } -func (x *genRunner) encMapFallback(varname string, rtid uintptr, t reflect.Type) { +func (x *genRunner) encMapFallback(varname string, t reflect.Type) { i := x.varsfx() x.line("r.EncodeMapStart(len(" + varname + "))") - x.line(genTempVarPfx + "s" + i + " := !z.EncBinary()") - - x.line(genTempVarPfx + "j" + i + " := 0") - - x.line("if " + genTempVarPfx + "s" + i + " {") - - x.line("for " + genTempVarPfx + "k" + i + ", " + - genTempVarPfx + "v" + i + " := range " + varname + " {") - x.line("if " + genTempVarPfx + "j" + i + " > 0 { r.EncodeMapEntrySeparator() }") - x.encVar(genTempVarPfx+"k"+i, t.Key()) - x.line("r.EncodeMapKVSeparator()") - x.encVar(genTempVarPfx+"v"+i, t.Elem()) - x.line(genTempVarPfx + "j" + i + "++") - x.line("}") - x.line("r.EncodeMapEnd()") - - x.line("} else {") x.linef("for %sk%s, %sv%s := range %s {", genTempVarPfx, i, genTempVarPfx, i, varname) + // x.line("for " + genTempVarPfx + "k" + i + ", " + genTempVarPfx + "v" + i + " := range " + varname + " {") x.encVar(genTempVarPfx+"k"+i, t.Key()) x.encVar(genTempVarPfx+"v"+i, t.Elem()) x.line("}") - - x.line("}") + x.line("r.EncodeEnd()") } func (x *genRunner) decVar(varname string, t reflect.Type, canBeNil bool) { @@ -825,7 +961,7 @@ func (x *genRunner) decVar(varname string, t reflect.Type, canBeNil bool) { if strings.IndexByte(varname, '.') != -1 { x.line(varname + " = nil") } else { - x.line("*" + varname + " = " + genZeroValueR(t.Elem(), x.tc)) + x.line("*" + varname + " = " + x.genZeroValueR(t.Elem())) } // x.line("*" + varname + " = nil") x.line("}") @@ -833,7 +969,7 @@ func (x *genRunner) decVar(varname string, t reflect.Type, canBeNil bool) { } else { // x.line("var " + genTempVarPfx + i + " " + x.genTypeName(t)) // x.line(varname + " = " + genTempVarPfx + i) - x.line(varname + " = " + genZeroValueR(t, x.tc)) + x.line(varname + " = " + x.genZeroValueR(t)) } x.line("} else {") } else { @@ -878,35 +1014,77 @@ func (x *genRunner) decVar(varname string, t reflect.Type, canBeNil bool) { func (x *genRunner) dec(varname string, t reflect.Type) { // assumptions: // - the varname is to a pointer already. No need to take address of it - + // - t is always a baseType T (not a *T, etc). rtid := reflect.ValueOf(t).Pointer() - if t.Implements(selferTyp) || (t.Kind() == reflect.Struct && - reflect.PtrTo(t).Implements(selferTyp)) { - x.line(varname + ".CodecDecodeSelf(d)") - return - } - if _, ok := x.td[rtid]; ok { - x.line(varname + ".CodecDecodeSelf(d)") - return + tptr := reflect.PtrTo(t) + if x.checkForSelfer(t, varname) { + if t.Implements(selferTyp) || tptr.Implements(selferTyp) { + x.line(varname + ".CodecDecodeSelf(d)") + return + } + if _, ok := x.td[rtid]; ok { + x.line(varname + ".CodecDecodeSelf(d)") + return + } } inlist := false for _, t0 := range x.t { if t == t0 { inlist = true - if t != x.tc { + if x.checkForSelfer(t, varname) { x.line(varname + ".CodecDecodeSelf(d)") return } break } } + var rtidAdded bool if t == x.tc { x.td[rtid] = true rtidAdded = true } + // check if + // - type is RawExt + // - the type implements (Text|JSON|Binary)(Unm|M)arshal + mi := x.varsfx() + x.linef("%sm%s := z.DecBinary()", genTempVarPfx, mi) + x.linef("_ = %sm%s", genTempVarPfx, mi) + x.line("if false {") //start if block + defer func() { x.line("}") }() //end if block + + if t == rawExtTyp { + x.linef("} else { r.DecodeExt(%v, 0, nil)", varname) + return + } + + // HACK: Support for Builtins. + // Currently, only Binc supports builtins, and the only builtin type is time.Time. + // Have a method that returns the rtid for time.Time if Handle is Binc. + if t == timeTyp { + vrtid := genTempVarPfx + "m" + x.varsfx() + x.linef("} else if %s := z.TimeRtidIfBinc(); %s != 0 { ", vrtid, vrtid) + x.linef("r.DecodeBuiltin(%s, %s)", vrtid, varname) + } + // only check for extensions if the type is named, and has a packagePath. + if genImportPath(t) != "" && t.Name() != "" { + // first check if extensions are configued, before doing the interface conversion + x.linef("} else if z.HasExtensions() && z.DecExt(%s) {", varname) + } + + if t.Implements(binaryUnmarshalerTyp) || tptr.Implements(binaryUnmarshalerTyp) { + x.linef("} else if %sm%s { z.DecBinaryUnmarshal(%v) ", genTempVarPfx, mi, varname) + } + if t.Implements(jsonUnmarshalerTyp) || tptr.Implements(jsonUnmarshalerTyp) { + x.linef("} else if !%sm%s && z.IsJSONHandle() { z.DecJSONUnmarshal(%v)", genTempVarPfx, mi, varname) + } else if t.Implements(textUnmarshalerTyp) || tptr.Implements(textUnmarshalerTyp) { + x.linef("} else if !%sm%s { z.DecTextUnmarshal(%v)", genTempVarPfx, mi, varname) + } + + x.line("} else {") + // Since these are pointers, we cannot share, and have to use them one by one switch t.Kind() { case reflect.Int: @@ -940,6 +1118,8 @@ func (x *genRunner) dec(varname string, t reflect.Type) { case reflect.Uint64: x.line("*((*uint64)(" + varname + ")) = uint64(r.DecodeUint(64))") //x.line("z.DecUint64((*uint64)(" + varname + "))") + case reflect.Uintptr: + x.line("*((*uintptr)(" + varname + ")) = uintptr(r.DecodeUint(codecSelferBitsize" + x.xs + "))") case reflect.Float32: x.line("*((*float32)(" + varname + ")) = float32(r.DecodeFloat(true))") @@ -966,7 +1146,7 @@ func (x *genRunner) dec(varname string, t reflect.Type) { if rtid == uint8SliceTypId { x.line("*" + varname + " = r.DecodeBytes(*(*[]byte)(" + varname + "), false, false)") } else if fastpathAV.index(rtid) != -1 { - g := genV{Slice: true, Elem: x.genTypeName(t.Elem())} + g := x.newGenV(t) x.line("z.F." + g.MethodNamePfx("Dec", false) + "X(" + varname + ", false, d)") // x.line("z." + g.MethodNamePfx("Dec", false) + "(" + varname + ")") // x.line(g.FastpathName(false) + "(" + varname + ", d)") @@ -980,7 +1160,7 @@ func (x *genRunner) dec(varname string, t reflect.Type) { // - if elements are primitives or Selfers, call dedicated function on each member. // - else call Encoder.encode(XXX) on it. if fastpathAV.index(rtid) != -1 { - g := genV{Slice: false, Elem: x.genTypeName(t.Elem()), MapKey: x.genTypeName(t.Key())} + g := x.newGenV(t) x.line("z.F." + g.MethodNamePfx("Dec", false) + "X(" + varname + ", false, d)") // x.line("z." + g.MethodNamePfx("Dec", false) + "(" + varname + ")") // x.line(g.FastpathName(false) + "(" + varname + ", d)") @@ -1018,10 +1198,10 @@ func (x *genRunner) decTryAssignPrimitive(varname string, t reflect.Type) (tryAs // Consequently, we replace: // case reflect.Uint32: x.line(varname + " = uint32(r.DecodeUint(32))") // with: - // case reflect.Uint32: x.line(varname + " = " + genTypeNamePrimitiveKind(t, x.tc) + "(r.DecodeUint(32))") + // case reflect.Uint32: x.line(varname + " = " + genTypeNamePrim(t, x.tc) + "(r.DecodeUint(32))") xfn := func(t reflect.Type) string { - return genTypeNamePrimitiveKind(t, x.tc) + return x.genTypeNamePrim(t) } switch t.Kind() { case reflect.Int: @@ -1045,6 +1225,8 @@ func (x *genRunner) decTryAssignPrimitive(varname string, t reflect.Type) (tryAs x.linef("%s = %s(r.DecodeUint(32))", varname, xfn(t)) case reflect.Uint64: x.linef("%s = %s(r.DecodeUint(64))", varname, xfn(t)) + case reflect.Uintptr: + x.linef("%s = %s(r.DecodeUint(codecSelferBitsize%s))", varname, xfn(t), x.xs) case reflect.Float32: x.linef("%s = %s(r.DecodeFloat(true))", varname, xfn(t)) @@ -1069,11 +1251,13 @@ func (x *genRunner) decListFallback(varname string, rtid uintptr, t reflect.Type CTyp string Typ string Immutable bool + Size int } telem := t.Elem() - ts := tstruc{genTempVarPfx, x.varsfx(), varname, x.genTypeName(t), x.genTypeName(telem), genIsImmutable(telem)} + ts := tstruc{genTempVarPfx, x.varsfx(), varname, x.genTypeName(t), x.genTypeName(telem), genIsImmutable(telem), int(telem.Size())} funcs := make(template.FuncMap) + funcs["decLineVar"] = func(varname string) string { x.decVar(varname, telem, false) return "" @@ -1086,7 +1270,7 @@ func (x *genRunner) decListFallback(varname string, rtid uintptr, t reflect.Type return ts.TempVar + s + ts.Rand } funcs["zero"] = func() string { - return genZeroValueR(telem, x.tc) + return x.genZeroValueR(telem) } funcs["isArray"] = func() bool { return t.Kind() == reflect.Array @@ -1113,10 +1297,11 @@ func (x *genRunner) decMapFallback(varname string, rtid uintptr, t reflect.Type) Varname string KTyp string Typ string + Size int } telem := t.Elem() tkey := t.Key() - ts := tstruc{genTempVarPfx, x.varsfx(), varname, x.genTypeName(tkey), x.genTypeName(telem)} + ts := tstruc{genTempVarPfx, x.varsfx(), varname, x.genTypeName(tkey), x.genTypeName(telem), int(telem.Size() + tkey.Size())} funcs := make(template.FuncMap) funcs["decLineVarK"] = func(varname string) string { x.decVar(varname, tkey, false) @@ -1148,7 +1333,7 @@ func (x *genRunner) decMapFallback(varname string, rtid uintptr, t reflect.Type) } func (x *genRunner) decStructMapSwitch(kName string, varname string, rtid uintptr, t reflect.Type) { - ti := getTypeInfo(rtid, t) + ti := x.ti.get(rtid, t) tisfi := ti.sfip // always use sequence from file. decStruct expects same thing. x.line("switch (" + kName + ") {") for _, si := range tisfi { @@ -1213,13 +1398,11 @@ func (x *genRunner) decStructMap(varname, lenvarname string, rtid uintptr, t ref x.linef("for %sj%s := 0; %sj%s < %s; %sj%s++ {", tpfx, i, tpfx, i, lenvarname, tpfx, i) case 2: x.linef("for %sj%s := 0; !r.CheckBreak(); %sj%s++ {", tpfx, i, tpfx, i) - x.linef("if %sj%s > 0 { r.ReadMapEntrySeparator() }", tpfx, i) default: // 0, otherwise. x.linef("var %shl%s bool = %s >= 0", tpfx, i, lenvarname) // has length x.linef("for %sj%s := 0; ; %sj%s++ {", tpfx, i, tpfx, i) x.linef("if %shl%s { if %sj%s >= %s { break }", tpfx, i, tpfx, i, lenvarname) - x.linef("} else { if r.CheckBreak() { break }; if %sj%s > 0 { r.ReadMapEntrySeparator() } }", - tpfx, i) + x.line("} else { if r.CheckBreak() { break }; }") } // x.line(kName + " = z.ReadStringAsBytes(" + kName + ")") // x.line(kName + " = z.ReadString()") @@ -1233,35 +1416,28 @@ func (x *genRunner) decStructMap(varname, lenvarname string, rtid uintptr, t ref } else { x.line(kName + " := string(" + kName + "Slc)") } - switch style { - case 1: - case 2: - x.line("r.ReadMapKVSeparator()") - default: - x.linef("if !%shl%s { r.ReadMapKVSeparator() }", tpfx, i) - } x.decStructMapSwitch(kName, varname, rtid, t) x.line("} // end for " + tpfx + "j" + i) switch style { case 1: case 2: - x.line("r.ReadMapEnd()") + x.line("r.ReadEnd()") default: - x.linef("if !%shl%s { r.ReadMapEnd() }", tpfx, i) + x.linef("if !%shl%s { r.ReadEnd() }", tpfx, i) } } func (x *genRunner) decStructArray(varname, lenvarname, breakString string, rtid uintptr, t reflect.Type) { tpfx := genTempVarPfx i := x.varsfx() - ti := getTypeInfo(rtid, t) + ti := x.ti.get(rtid, t) tisfi := ti.sfip // always use sequence from file. decStruct expects same thing. x.linef("var %sj%s int", tpfx, i) x.linef("var %sb%s bool", tpfx, i) // break // x.linef("var %sl%s := r.ReadArrayStart()", tpfx, i) x.linef("var %shl%s bool = %s >= 0", tpfx, i, lenvarname) // has length - for j, si := range tisfi { + for _, si := range tisfi { var t2 reflect.StructField if si.i != -1 { t2 = t.Field(int(si.i)) @@ -1274,10 +1450,7 @@ func (x *genRunner) decStructArray(varname, lenvarname, breakString string, rtid tpfx, i, lenvarname, tpfx, i) // x.line("if " + tpfx + "j" + i + "++; " + tpfx + "j" + // i + " <= " + tpfx + "l" + i + " {") - x.linef("if %sb%s { r.ReadArrayEnd(); %s }", tpfx, i, breakString) - if j > 0 { - x.line("r.ReadArrayEntrySeparator()") - } + x.linef("if %sb%s { r.ReadEnd(); %s }", tpfx, i, breakString) x.decVar(varname+"."+t2.Name, t2.Type, true) // x.line("} // end if " + tpfx + "j" + i + " <= " + tpfx + "l" + i) } @@ -1287,20 +1460,19 @@ func (x *genRunner) decStructArray(varname, lenvarname, breakString string, rtid tpfx, i, tpfx, i, tpfx, i, tpfx, i, lenvarname, tpfx, i) x.linef("if %sb%s { break }", tpfx, i) - x.linef("if %sj%s > 1 { r.ReadArrayEntrySeparator() }", tpfx, i) x.linef(`z.DecStructFieldNotFound(%sj%s - 1, "")`, tpfx, i) x.line("}") - x.line("r.ReadArrayEnd()") + x.line("r.ReadEnd()") } func (x *genRunner) decStruct(varname string, rtid uintptr, t reflect.Type) { // if container is map // x.line("if z.DecContainerIsMap() { ") i := x.varsfx() - x.line("if r.IsContainerType(codecSelverValueTypeMap" + x.xs + ") {") + x.line("if r.IsContainerType(codecSelferValueTypeMap" + x.xs + ") {") x.line(genTempVarPfx + "l" + i + " := r.ReadMapStart()") x.linef("if %sl%s == 0 {", genTempVarPfx, i) - x.line("r.ReadMapEnd()") + x.line("r.ReadEnd()") if genUseOneFunctionForDecStructMap { x.line("} else { ") x.linef("x.codecDecodeSelfFromMap(%sl%s, d)", genTempVarPfx, i) @@ -1314,10 +1486,10 @@ func (x *genRunner) decStruct(varname string, rtid uintptr, t reflect.Type) { // else if container is array // x.line("} else if z.DecContainerIsArray() { ") - x.line("} else if r.IsContainerType(codecSelverValueTypeArray" + x.xs + ") {") + x.line("} else if r.IsContainerType(codecSelferValueTypeArray" + x.xs + ") {") x.line(genTempVarPfx + "l" + i + " := r.ReadArrayStart()") x.linef("if %sl%s == 0 {", genTempVarPfx, i) - x.line("r.ReadArrayEnd()") + x.line("r.ReadEnd()") x.line("} else { ") x.linef("x.codecDecodeSelfFromArray(%sl%s, d)", genTempVarPfx, i) x.line("}") @@ -1331,11 +1503,28 @@ func (x *genRunner) decStruct(varname string, rtid uintptr, t reflect.Type) { // -------- type genV struct { - // genV is either a primitive (Primitive != "") or a slice (Slice = true) or a map. - Slice bool + // genV is either a primitive (Primitive != "") or a map (MapKey != "") or a slice MapKey string Elem string Primitive string + Size int +} + +func (x *genRunner) newGenV(t reflect.Type) (v genV) { + switch t.Kind() { + case reflect.Slice, reflect.Array: + te := t.Elem() + v.Elem = x.genTypeName(te) + v.Size = int(te.Size()) + case reflect.Map: + te, tk := t.Elem(), t.Key() + v.Elem = x.genTypeName(te) + v.MapKey = x.genTypeName(tk) + v.Size = int(te.Size() + tk.Size()) + default: + panic("unexpected type for newGenV. Requires map or slice type") + } + return } func (x *genV) MethodNamePfx(prefix string, prim bool) string { @@ -1346,7 +1535,7 @@ func (x *genV) MethodNamePfx(prefix string, prim bool) string { if prim { name = append(name, genTitleCaseName(x.Primitive)...) } else { - if x.Slice { + if x.MapKey == "" { name = append(name, "Slice"...) } else { name = append(name, "Map"...) @@ -1358,6 +1547,29 @@ func (x *genV) MethodNamePfx(prefix string, prim bool) string { } +var genCheckVendor = os.Getenv("GO15VENDOREXPERIMENT") == "1" + +// genImportPath returns import path of a non-predeclared named typed, or an empty string otherwise. +// +// This handles the misbehaviour that occurs when 1.5-style vendoring is enabled, +// where PkgPath returns the full path, including the vendoring pre-fix that should have been stripped. +// We strip it here. +func genImportPath(t reflect.Type) (s string) { + s = t.PkgPath() + if genCheckVendor { + // HACK: Misbehaviour occurs in go 1.5. May have to re-visit this later. + // if s contains /vendor/ OR startsWith vendor/, then return everything after it. + const vendorStart = "vendor/" + const vendorInline = "/vendor/" + if i := strings.LastIndex(s, vendorInline); i >= 0 { + s = s[i+len(vendorInline):] + } else if strings.HasPrefix(s, vendorStart) { + s = s[len(vendorStart):] + } + } + return +} + func genNonPtr(t reflect.Type) reflect.Type { for t.Kind() == reflect.Ptr { t = t.Elem() @@ -1374,59 +1586,17 @@ func genTitleCaseName(s string) string { } } -func genTypeNamePrimitiveKind(t reflect.Type, tRef reflect.Type) (n string) { - if tRef != nil && t.PkgPath() == tRef.PkgPath() && t.Name() != "" { - return t.Name() - } else { - return t.String() // best way to get the package name inclusive - } -} - -func genTypeName(t reflect.Type, tRef reflect.Type) (n string) { - // defer func() { fmt.Printf(">>>> ####: genTypeName: t: %v, name: '%s'\n", t, n) }() - - // if the type has a PkgPath, which doesn't match the current package, - // then include it. - // We cannot depend on t.String() because it includes current package, - // or t.PkgPath because it includes full import path, - // - var ptrPfx string - for t.Kind() == reflect.Ptr { - ptrPfx += "*" - t = t.Elem() - } - if tn := t.Name(); tn != "" { - return ptrPfx + genTypeNamePrimitiveKind(t, tRef) - } - switch t.Kind() { - case reflect.Map: - return ptrPfx + "map[" + genTypeName(t.Key(), tRef) + "]" + genTypeName(t.Elem(), tRef) - case reflect.Slice: - return ptrPfx + "[]" + genTypeName(t.Elem(), tRef) - case reflect.Array: - return ptrPfx + "[" + strconv.FormatInt(int64(t.Len()), 10) + "]" + genTypeName(t.Elem(), tRef) - case reflect.Chan: - return ptrPfx + t.ChanDir().String() + " " + genTypeName(t.Elem(), tRef) - default: - if t == intfTyp { - return ptrPfx + "interface{}" - } else { - return ptrPfx + genTypeNamePrimitiveKind(t, tRef) - } - } -} - func genMethodNameT(t reflect.Type, tRef reflect.Type) (n string) { var ptrPfx string for t.Kind() == reflect.Ptr { ptrPfx += "Ptrto" t = t.Elem() } + tstr := t.String() if tn := t.Name(); tn != "" { - if tRef != nil && t.PkgPath() == tRef.PkgPath() { + if tRef != nil && genImportPath(t) == genImportPath(tRef) { return ptrPfx + tn } else { - tstr := t.String() if genQNameRegex.MatchString(tstr) { return ptrPfx + strings.Replace(tstr, ".", "_", 1000) } else { @@ -1456,17 +1626,16 @@ func genMethodNameT(t reflect.Type, tRef reflect.Type) (n string) { if t == intfTyp { return ptrPfx + "Interface" } else { - if tRef != nil && t.PkgPath() == tRef.PkgPath() { + if tRef != nil && genImportPath(t) == genImportPath(tRef) { if t.Name() != "" { return ptrPfx + t.Name() } else { - return ptrPfx + genCustomTypeName(t.String()) + return ptrPfx + genCustomTypeName(tstr) } } else { // best way to get the package name inclusive - // return ptrPfx + strings.Replace(t.String(), ".", "_", 1000) - // return ptrPfx + genBase64enc.EncodeToString([]byte(t.String())) - tstr := t.String() + // return ptrPfx + strings.Replace(tstr, ".", "_", 1000) + // return ptrPfx + genBase64enc.EncodeToString([]byte(tstr)) if t.Name() != "" && genQNameRegex.MatchString(tstr) { return ptrPfx + strings.Replace(tstr, ".", "_", 1000) } else { @@ -1494,24 +1663,7 @@ func genCustomTypeName(tstr string) string { } func genIsImmutable(t reflect.Type) (v bool) { - return isMutableKind(t.Kind()) -} - -func genZeroValueR(t reflect.Type, tRef reflect.Type) string { - // if t is a named type, w - switch t.Kind() { - case reflect.Ptr, reflect.Interface, reflect.Chan, reflect.Func, - reflect.Slice, reflect.Map, reflect.Invalid: - return "nil" - case reflect.Bool: - return "false" - case reflect.String: - return `""` - case reflect.Struct, reflect.Array: - return genTypeName(t, tRef) + "{}" - default: // all numbers - return "0" - } + return isImmutableKind(t.Kind()) } type genInternal struct { @@ -1641,23 +1793,42 @@ func genInternalInit() { "float64", "bool", } - mapvaltypes2 := make(map[string]bool) - for _, s := range mapvaltypes { - mapvaltypes2[s] = true - } + wordSizeBytes := int(intBitsize) / 8 + + mapvaltypes2 := map[string]int{ + "interface{}": 2 * wordSizeBytes, + "string": 2 * wordSizeBytes, + "uint": 1 * wordSizeBytes, + "uint8": 1, + "uint16": 2, + "uint32": 4, + "uint64": 8, + "int": 1 * wordSizeBytes, + "int8": 1, + "int16": 2, + "int32": 4, + "int64": 8, + "float32": 4, + "float64": 8, + "bool": 1, + } + // mapvaltypes2 := make(map[string]bool) + // for _, s := range mapvaltypes { + // mapvaltypes2[s] = true + // } var gt genInternal // For each slice or map type, there must be a (symetrical) Encode and Decode fast-path function for _, s := range types { - gt.Values = append(gt.Values, genV{false, "", "", s}) + gt.Values = append(gt.Values, genV{Primitive: s, Size: mapvaltypes2[s]}) if s != "uint8" { // do not generate fast path for slice of bytes. Treat specially already. - gt.Values = append(gt.Values, genV{true, "", s, ""}) + gt.Values = append(gt.Values, genV{Elem: s, Size: mapvaltypes2[s]}) } - if !mapvaltypes2[s] { - gt.Values = append(gt.Values, genV{false, s, s, ""}) + if _, ok := mapvaltypes2[s]; !ok { + gt.Values = append(gt.Values, genV{MapKey: s, Elem: s, Size: 2 * mapvaltypes2[s]}) } for _, ms := range mapvaltypes { - gt.Values = append(gt.Values, genV{false, s, ms, ""}) + gt.Values = append(gt.Values, genV{MapKey: s, Elem: ms, Size: mapvaltypes2[s] + mapvaltypes2[ms]}) } } diff --git a/Godeps/_workspace/src/github.com/ugorji/go/codec/helper.go b/Godeps/_workspace/src/github.com/ugorji/go/codec/helper.go index 945b4c4987cf..9c00ba562d73 100644 --- a/Godeps/_workspace/src/github.com/ugorji/go/codec/helper.go +++ b/Godeps/_workspace/src/github.com/ugorji/go/codec/helper.go @@ -1,5 +1,5 @@ // Copyright (c) 2012-2015 Ugorji Nwoke. All rights reserved. -// Use of this source code is governed by a BSD-style license found in the LICENSE file. +// Use of this source code is governed by a MIT license found in the LICENSE file. package codec @@ -117,6 +117,7 @@ import ( const ( scratchByteArrayLen = 32 + initCollectionCap = 32 // 32 is defensive. 16 is preferred. // Support encoding.(Binary|Text)(Unm|M)arshaler. // This constant flag will enable or disable it. @@ -147,6 +148,12 @@ const ( // if derefForIsEmptyValue, deref pointers and interfaces when checking isEmptyValue derefForIsEmptyValue = false + + // if resetSliceElemToZeroValue, then on decoding a slice, reset the element to a zero value first. + // Only concern is that, if the slice already contained some garbage, we will decode into that garbage. + // The chances of this are slim, so leave this "optimization". + // TODO: should this be true, to ensure that we always decode into a "zero" "empty" value? + resetSliceElemToZeroValue bool = false ) var oneByteArr = [1]byte{0} @@ -186,6 +193,14 @@ const ( type seqType uint8 +// mirror json.Marshaler and json.Unmarshaler here, so we don't import the encoding/json package +type jsonMarshaler interface { + MarshalJSON() ([]byte, error) +} +type jsonUnmarshaler interface { + UnmarshalJSON([]byte) error +} + const ( _ seqType = iota seqTypeArray @@ -197,9 +212,6 @@ var ( bigen = binary.BigEndian structInfoFieldName = "_struct" - cachedTypeInfo = make(map[uintptr]*typeInfo, 64) - cachedTypeInfoMutex sync.RWMutex - // mapStrIntfTyp = reflect.TypeOf(map[string]interface{}(nil)) intfSliceTyp = reflect.TypeOf([]interface{}(nil)) intfTyp = intfSliceTyp.Elem() @@ -217,6 +229,9 @@ var ( textMarshalerTyp = reflect.TypeOf((*encoding.TextMarshaler)(nil)).Elem() textUnmarshalerTyp = reflect.TypeOf((*encoding.TextUnmarshaler)(nil)).Elem() + jsonMarshalerTyp = reflect.TypeOf((*jsonMarshaler)(nil)).Elem() + jsonUnmarshalerTyp = reflect.TypeOf((*jsonUnmarshaler)(nil)).Elem() + selferTyp = reflect.TypeOf((*Selfer)(nil)).Elem() uint8SliceTypId = reflect.ValueOf(uint8SliceTyp).Pointer() @@ -238,6 +253,8 @@ var ( noFieldNameToStructFieldInfoErr = errors.New("no field name passed to parseStructFieldInfo") ) +var defTypeInfos = NewTypeInfos([]string{"codec", "json"}) + // Selfer defines methods by which a value can encode or decode itself. // // Any type which implements Selfer will be able to encode or decode itself. @@ -263,6 +280,11 @@ type MapBySlice interface { // // BasicHandle encapsulates the common options and extension functions. type BasicHandle struct { + // TypeInfos is used to get the type info for any type. + // + // If not configure, the default TypeInfos is used, which uses struct tag keys: codec, json + TypeInfos *TypeInfos + extHandle EncodeOptions DecodeOptions @@ -272,6 +294,13 @@ func (x *BasicHandle) getBasicHandle() *BasicHandle { return x } +func (x *BasicHandle) getTypeInfo(rtid uintptr, rt reflect.Type) (pti *typeInfo) { + if x.TypeInfos != nil { + return x.TypeInfos.get(rtid, rt) + } + return defTypeInfos.get(rtid, rt) +} + // Handle is the interface for a specific encoding format. // // Typically, a Handle is pre-configured before first time use, @@ -298,32 +327,41 @@ type RawExt struct { Value interface{} } -// Ext handles custom (de)serialization of custom types / extensions. -type Ext interface { +// BytesExt handles custom (de)serialization of types to/from []byte. +// It is used by codecs (e.g. binc, msgpack, simple) which do custom serialization of the types. +type BytesExt interface { // WriteExt converts a value to a []byte. - // It is used by codecs (e.g. binc, msgpack, simple) which do custom serialization of the types. WriteExt(v interface{}) []byte // ReadExt updates a value from a []byte. - // It is used by codecs (e.g. binc, msgpack, simple) which do custom serialization of the types. ReadExt(dst interface{}, src []byte) +} +// InterfaceExt handles custom (de)serialization of types to/from another interface{} value. +// The Encoder or Decoder will then handle the further (de)serialization of that known type. +// +// It is used by codecs (e.g. cbor, json) which use the format to do custom serialization of the types. +type InterfaceExt interface { // ConvertExt converts a value into a simpler interface for easy encoding e.g. convert time.Time to int64. - // It is used by codecs (e.g. cbor) which use the format to do custom serialization of the types. ConvertExt(v interface{}) interface{} // UpdateExt updates a value from a simpler interface for easy decoding e.g. convert int64 to time.Time. - // It is used by codecs (e.g. cbor) which use the format to do custom serialization of the types. UpdateExt(dst interface{}, src interface{}) } -// bytesExt is a wrapper implementation to support former AddExt exported method. -type bytesExt struct { +// Ext handles custom (de)serialization of custom types / extensions. +type Ext interface { + BytesExt + InterfaceExt +} + +// addExtWrapper is a wrapper implementation to support former AddExt exported method. +type addExtWrapper struct { encFn func(reflect.Value) ([]byte, error) decFn func(reflect.Value, []byte) error } -func (x bytesExt) WriteExt(v interface{}) []byte { +func (x addExtWrapper) WriteExt(v interface{}) []byte { // fmt.Printf(">>>>>>>>>> WriteExt: %T, %v\n", v, v) bs, err := x.encFn(reflect.ValueOf(v)) if err != nil { @@ -332,21 +370,57 @@ func (x bytesExt) WriteExt(v interface{}) []byte { return bs } -func (x bytesExt) ReadExt(v interface{}, bs []byte) { +func (x addExtWrapper) ReadExt(v interface{}, bs []byte) { // fmt.Printf(">>>>>>>>>> ReadExt: %T, %v\n", v, v) if err := x.decFn(reflect.ValueOf(v), bs); err != nil { panic(err) } } -func (x bytesExt) ConvertExt(v interface{}) interface{} { +func (x addExtWrapper) ConvertExt(v interface{}) interface{} { return x.WriteExt(v) } -func (x bytesExt) UpdateExt(dest interface{}, v interface{}) { +func (x addExtWrapper) UpdateExt(dest interface{}, v interface{}) { x.ReadExt(dest, v.([]byte)) } +type setExtWrapper struct { + b BytesExt + i InterfaceExt +} + +func (x *setExtWrapper) WriteExt(v interface{}) []byte { + if x.b == nil { + panic("BytesExt.WriteExt is not supported") + } + return x.b.WriteExt(v) +} + +func (x *setExtWrapper) ReadExt(v interface{}, bs []byte) { + if x.b == nil { + panic("BytesExt.WriteExt is not supported") + + } + x.b.ReadExt(v, bs) +} + +func (x *setExtWrapper) ConvertExt(v interface{}) interface{} { + if x.i == nil { + panic("InterfaceExt.ConvertExt is not supported") + + } + return x.i.ConvertExt(v) +} + +func (x *setExtWrapper) UpdateExt(dest interface{}, v interface{}) { + if x.i == nil { + panic("InterfaceExxt.UpdateExt is not supported") + + } + x.i.UpdateExt(dest, v) +} + // type errorString string // func (x errorString) Error() string { return string(x) } @@ -401,7 +475,7 @@ type extTypeTagFn struct { type extHandle []*extTypeTagFn -// DEPRECATED: AddExt is deprecated in favor of SetExt. It exists for compatibility only. +// DEPRECATED: Use SetBytesExt or SetInterfaceExt on the Handle instead. // // AddExt registes an encode and decode function for a reflect.Type. // AddExt internally calls SetExt. @@ -413,10 +487,10 @@ func (o *extHandle) AddExt( if encfn == nil || decfn == nil { return o.SetExt(rt, uint64(tag), nil) } - return o.SetExt(rt, uint64(tag), bytesExt{encfn, decfn}) + return o.SetExt(rt, uint64(tag), addExtWrapper{encfn, decfn}) } -// SetExt registers a tag and Ext for a reflect.Type. +// DEPRECATED: Use SetBytesExt or SetInterfaceExt on the Handle instead. // // Note that the type must be a named type, and specifically not // a pointer or Interface. An error is returned if that is not honored. @@ -471,6 +545,10 @@ type structFieldInfo struct { toArray bool // if field is _struct, is the toArray set? } +// func (si *structFieldInfo) isZero() bool { +// return si.encName == "" && len(si.is) == 0 && si.i == 0 && !si.omitEmpty && !si.toArray +// } + // rv returns the field of the struct. // If anonymous, it returns an Invalid func (si *structFieldInfo) field(v reflect.Value, update bool) (rv2 reflect.Value) { @@ -516,9 +594,9 @@ func (si *structFieldInfo) setToZeroValue(v reflect.Value) { } func parseStructFieldInfo(fname string, stag string) *structFieldInfo { - if fname == "" { - panic(noFieldNameToStructFieldInfoErr) - } + // if fname == "" { + // panic(noFieldNameToStructFieldInfoErr) + // } si := structFieldInfo{ encName: fname, } @@ -589,6 +667,11 @@ type typeInfo struct { tmIndir int8 // number of indirections to get to textMarshaler type tunmIndir int8 // number of indirections to get to textUnmarshaler type + jm bool // base type (T or *T) is a jsonMarshaler + junm bool // base type (T or *T) is a jsonUnmarshaler + jmIndir int8 // number of indirections to get to jsonMarshaler type + junmIndir int8 // number of indirections to get to jsonUnmarshaler type + cs bool // base type (T or *T) is a Selfer csIndir int8 // number of indirections to get to Selfer type @@ -623,28 +706,48 @@ func (ti *typeInfo) indexForEncName(name string) int { return -1 } -func getStructTag(t reflect.StructTag) (s string) { +// TypeInfos caches typeInfo for each type on first inspection. +// +// It is configured with a set of tag keys, which are used to get +// configuration for the type. +type TypeInfos struct { + infos map[uintptr]*typeInfo + mu sync.RWMutex + tags []string +} + +// NewTypeInfos creates a TypeInfos given a set of struct tags keys. +// +// This allows users customize the struct tag keys which contain configuration +// of their types. +func NewTypeInfos(tags []string) *TypeInfos { + return &TypeInfos{tags: tags, infos: make(map[uintptr]*typeInfo, 64)} +} + +func (x *TypeInfos) structTag(t reflect.StructTag) (s string) { // check for tags: codec, json, in that order. // this allows seamless support for many configured structs. - s = t.Get("codec") - if s == "" { - s = t.Get("json") + for _, x := range x.tags { + s = t.Get(x) + if s != "" { + return s + } } return } -func getTypeInfo(rtid uintptr, rt reflect.Type) (pti *typeInfo) { +func (x *TypeInfos) get(rtid uintptr, rt reflect.Type) (pti *typeInfo) { var ok bool - cachedTypeInfoMutex.RLock() - pti, ok = cachedTypeInfo[rtid] - cachedTypeInfoMutex.RUnlock() + x.mu.RLock() + pti, ok = x.infos[rtid] + x.mu.RUnlock() if ok { return } - cachedTypeInfoMutex.Lock() - defer cachedTypeInfoMutex.Unlock() - if pti, ok = cachedTypeInfo[rtid]; ok { + x.mu.Lock() + defer x.mu.Unlock() + if pti, ok = x.infos[rtid]; ok { return } @@ -664,6 +767,12 @@ func getTypeInfo(rtid uintptr, rt reflect.Type) (pti *typeInfo) { if ok, indir = implementsIntf(rt, textUnmarshalerTyp); ok { ti.tunm, ti.tunmIndir = true, indir } + if ok, indir = implementsIntf(rt, jsonMarshalerTyp); ok { + ti.jm, ti.jmIndir = true, indir + } + if ok, indir = implementsIntf(rt, jsonUnmarshalerTyp); ok { + ti.junm, ti.junmIndir = true, indir + } if ok, indir = implementsIntf(rt, selferTyp); ok { ti.cs, ti.csIndir = true, indir } @@ -690,11 +799,11 @@ func getTypeInfo(rtid uintptr, rt reflect.Type) (pti *typeInfo) { if rt.Kind() == reflect.Struct { var siInfo *structFieldInfo if f, ok := rt.FieldByName(structInfoFieldName); ok { - siInfo = parseStructFieldInfo(structInfoFieldName, getStructTag(f.Tag)) + siInfo = parseStructFieldInfo(structInfoFieldName, x.structTag(f.Tag)) ti.toArray = siInfo.toArray } sfip := make([]*structFieldInfo, 0, rt.NumField()) - rgetTypeInfo(rt, nil, make(map[string]bool, 16), &sfip, siInfo) + x.rget(rt, nil, make(map[string]bool, 16), &sfip, siInfo) ti.sfip = make([]*structFieldInfo, len(sfip)) ti.sfi = make([]*structFieldInfo, len(sfip)) @@ -703,11 +812,11 @@ func getTypeInfo(rtid uintptr, rt reflect.Type) (pti *typeInfo) { copy(ti.sfi, sfip) } // sfi = sfip - cachedTypeInfo[rtid] = pti + x.infos[rtid] = pti return } -func rgetTypeInfo(rt reflect.Type, indexstack []int, fnameToHastag map[string]bool, +func (x *TypeInfos) rget(rt reflect.Type, indexstack []int, fnameToHastag map[string]bool, sfi *[]*structFieldInfo, siInfo *structFieldInfo, ) { for j := 0; j < rt.NumField(); j++ { @@ -716,15 +825,28 @@ func rgetTypeInfo(rt reflect.Type, indexstack []int, fnameToHastag map[string]bo if tk := f.Type.Kind(); tk == reflect.Func { continue } - stag := getStructTag(f.Tag) + stag := x.structTag(f.Tag) if stag == "-" { continue } if r1, _ := utf8.DecodeRuneInString(f.Name); r1 == utf8.RuneError || !unicode.IsUpper(r1) { continue } - // if anonymous and there is no struct tag and its a struct (or pointer to struct), inline it. - if f.Anonymous && stag == "" { + var si *structFieldInfo + // if anonymous and there is no struct tag (or it's blank) + // and its a struct (or pointer to struct), inline it. + var doInline bool + if f.Anonymous && f.Type.Kind() != reflect.Interface { + doInline = stag == "" + if !doInline { + si = parseStructFieldInfo("", stag) + doInline = si.encName == "" + // doInline = si.isZero() + // fmt.Printf(">>>> doInline for si.isZero: %s: %v\n", f.Name, doInline) + } + } + + if doInline { ft := f.Type for ft.Kind() == reflect.Ptr { ft = ft.Elem() @@ -734,7 +856,7 @@ func rgetTypeInfo(rt reflect.Type, indexstack []int, fnameToHastag map[string]bo copy(indexstack2, indexstack) indexstack2[len(indexstack)] = j // indexstack2 := append(append(make([]int, 0, len(indexstack)+4), indexstack...), j) - rgetTypeInfo(ft, indexstack2, fnameToHastag, sfi, siInfo) + x.rget(ft, indexstack2, fnameToHastag, sfi, siInfo) continue } } @@ -744,7 +866,14 @@ func rgetTypeInfo(rt reflect.Type, indexstack []int, fnameToHastag map[string]bo if _, ok := fnameToHastag[f.Name]; ok { continue } - si := parseStructFieldInfo(f.Name, stag) + if f.Name == "" { + panic(noFieldNameToStructFieldInfoErr) + } + if si == nil { + si = parseStructFieldInfo(f.Name, stag) + } else if si.encName == "" { + si.encName = f.Name + } // si.ikind = int(f.Type.Kind()) if len(indexstack) == 0 { si.i = int16(j) @@ -779,8 +908,9 @@ func panicToErr(err *error) { // panic(fmt.Errorf("%s: "+format, params2...)) // } -func isMutableKind(k reflect.Kind) (v bool) { - return k == reflect.Int || +func isImmutableKind(k reflect.Kind) (v bool) { + return false || + k == reflect.Int || k == reflect.Int8 || k == reflect.Int16 || k == reflect.Int32 || @@ -790,6 +920,7 @@ func isMutableKind(k reflect.Kind) (v bool) { k == reflect.Uint16 || k == reflect.Uint32 || k == reflect.Uint64 || + k == reflect.Uintptr || k == reflect.Float32 || k == reflect.Float64 || k == reflect.Bool || diff --git a/Godeps/_workspace/src/github.com/ugorji/go/codec/helper_internal.go b/Godeps/_workspace/src/github.com/ugorji/go/codec/helper_internal.go index 7d4e9326a25c..dea981fbb7be 100644 --- a/Godeps/_workspace/src/github.com/ugorji/go/codec/helper_internal.go +++ b/Godeps/_workspace/src/github.com/ugorji/go/codec/helper_internal.go @@ -1,5 +1,5 @@ -// Copyright (c) 2012, 2013 Ugorji Nwoke. All rights reserved. -// Use of this source code is governed by a BSD-style license found in the LICENSE file. +// Copyright (c) 2012-2015 Ugorji Nwoke. All rights reserved. +// Use of this source code is governed by a MIT license found in the LICENSE file. package codec @@ -149,3 +149,94 @@ func halfFloatToFloatBits(yy uint16) (d uint32) { m = m << 13 return (s << 31) | (e << 23) | m } + +// GrowCap will return a new capacity for a slice, given the following: +// - oldCap: current capacity +// - unit: in-memory size of an element +// - num: number of elements to add +func growCap(oldCap, unit, num int) (newCap int) { + // appendslice logic (if cap < 1024, *2, else *1.25): + // leads to many copy calls, especially when copying bytes. + // bytes.Buffer model (2*cap + n): much better for bytes. + // smarter way is to take the byte-size of the appended element(type) into account + + // maintain 3 thresholds: + // t1: if cap <= t1, newcap = 2x + // t2: if cap <= t2, newcap = 1.75x + // t3: if cap <= t3, newcap = 1.5x + // else newcap = 1.25x + // + // t1, t2, t3 >= 1024 always. + // i.e. if unit size >= 16, then always do 2x or 1.25x (ie t1, t2, t3 are all same) + // + // With this, appending for bytes increase by: + // 100% up to 4K + // 75% up to 8K + // 50% up to 16K + // 25% beyond that + + // unit can be 0 e.g. for struct{}{}; handle that appropriately + var t1, t2, t3 int // thresholds + if unit <= 1 { + t1, t2, t3 = 4*1024, 8*1024, 16*1024 + } else if unit < 16 { + t3 = 16 / unit * 1024 + t1 = t3 * 1 / 4 + t2 = t3 * 2 / 4 + } else { + t1, t2, t3 = 1024, 1024, 1024 + } + + var x int // temporary variable + + // x is multiplier here: one of 5, 6, 7 or 8; incr of 25%, 50%, 75% or 100% respectively + if oldCap <= t1 { // [0,t1] + x = 8 + } else if oldCap > t3 { // (t3,infinity] + x = 5 + } else if oldCap <= t2 { // (t1,t2] + x = 7 + } else { // (t2,t3] + x = 6 + } + newCap = x * oldCap / 4 + + if num > 0 { + newCap += num + } + + // ensure newCap is a multiple of 64 (if it is > 64) or 16. + if newCap > 64 { + if x = newCap % 64; x != 0 { + x = newCap / 64 + newCap = 64 * (x + 1) + } + } else { + if x = newCap % 16; x != 0 { + x = newCap / 16 + newCap = 16 * (x + 1) + } + } + return +} + +func expandSliceValue(s reflect.Value, num int) reflect.Value { + if num <= 0 { + return s + } + l0 := s.Len() + l1 := l0 + num // new slice length + if l1 < l0 { + panic("ExpandSlice: slice overflow") + } + c0 := s.Cap() + if l1 <= c0 { + return s.Slice(0, l1) + } + st := s.Type() + c1 := growCap(c0, int(st.Elem().Size()), num) + s2 := reflect.MakeSlice(st, l1, c1) + // println("expandslicevalue: cap-old: ", c0, ", cap-new: ", c1, ", len-new: ", l1) + reflect.Copy(s2, s) + return s2 +} diff --git a/Godeps/_workspace/src/github.com/ugorji/go/codec/helper_not_unsafe.go b/Godeps/_workspace/src/github.com/ugorji/go/codec/helper_not_unsafe.go index df0503880f93..7c2ffc0fde6e 100644 --- a/Godeps/_workspace/src/github.com/ugorji/go/codec/helper_not_unsafe.go +++ b/Godeps/_workspace/src/github.com/ugorji/go/codec/helper_not_unsafe.go @@ -1,7 +1,7 @@ //+build !unsafe // Copyright (c) 2012-2015 Ugorji Nwoke. All rights reserved. -// Use of this source code is governed by a BSD-style license found in the LICENSE file. +// Use of this source code is governed by a MIT license found in the LICENSE file. package codec diff --git a/Godeps/_workspace/src/github.com/ugorji/go/codec/helper_test.go b/Godeps/_workspace/src/github.com/ugorji/go/codec/helper_test.go index 8ea6cc5e7234..685c576c4e3c 100644 --- a/Godeps/_workspace/src/github.com/ugorji/go/codec/helper_test.go +++ b/Godeps/_workspace/src/github.com/ugorji/go/codec/helper_test.go @@ -1,5 +1,5 @@ // Copyright (c) 2012-2015 Ugorji Nwoke. All rights reserved. -// Use of this source code is governed by a BSD-style license found in the LICENSE file. +// Use of this source code is governed by a MIT license found in the LICENSE file. package codec diff --git a/Godeps/_workspace/src/github.com/ugorji/go/codec/helper_unsafe.go b/Godeps/_workspace/src/github.com/ugorji/go/codec/helper_unsafe.go index 3526d4452a6b..373b2b1027dc 100644 --- a/Godeps/_workspace/src/github.com/ugorji/go/codec/helper_unsafe.go +++ b/Godeps/_workspace/src/github.com/ugorji/go/codec/helper_unsafe.go @@ -1,7 +1,7 @@ //+build unsafe // Copyright (c) 2012-2015 Ugorji Nwoke. All rights reserved. -// Use of this source code is governed by a BSD-style license found in the LICENSE file. +// Use of this source code is governed by a MIT license found in the LICENSE file. package codec @@ -26,6 +26,9 @@ type unsafeBytes struct { // In unsafe mode, it doesn't incur allocation and copying caused by conversion. // In regular safe mode, it is an allocation and copy. func stringView(v []byte) string { + if len(v) == 0 { + return "" + } x := unsafeString{uintptr(unsafe.Pointer(&v[0])), len(v)} return *(*string)(unsafe.Pointer(&x)) } @@ -34,6 +37,9 @@ func stringView(v []byte) string { // In unsafe mode, it doesn't incur allocation and copying caused by conversion. // In regular safe mode, it is an allocation and copy. func bytesView(v string) []byte { + if len(v) == 0 { + return zeroByteSlice + } x := unsafeBytes{uintptr(unsafe.Pointer(&v)), len(v), len(v)} return *(*[]byte)(unsafe.Pointer(&x)) } diff --git a/Godeps/_workspace/src/github.com/ugorji/go/codec/json.go b/Godeps/_workspace/src/github.com/ugorji/go/codec/json.go index c112a79716c8..59e0bc24a12e 100644 --- a/Godeps/_workspace/src/github.com/ugorji/go/codec/json.go +++ b/Godeps/_workspace/src/github.com/ugorji/go/codec/json.go @@ -1,10 +1,11 @@ // Copyright (c) 2012-2015 Ugorji Nwoke. All rights reserved. -// Use of this source code is governed by a BSD-style license found in the LICENSE file. +// Use of this source code is governed by a MIT license found in the LICENSE file. package codec -// This json support uses base64 encoding for bytes, because you cannot +// By default, this json support uses base64 encoding for bytes, because you cannot // store and read any arbitrary string in json (only unicode). +// However, the user can configre how to encode/decode bytes. // // This library specifically supports UTF-8 for encoding and decoding only. // @@ -27,11 +28,18 @@ package codec // - encode does not beautify. There is no whitespace when encoding. // - rpc calls which take single integer arguments or write single numeric arguments will need care. +// Top-level methods of json(End|Dec)Driver (which are implementations of (en|de)cDriver +// MUST not call one-another. +// They all must call sep(), and sep() MUST NOT be called more than once for each read. +// If sep() is called and read is not done, you MUST call retryRead so separator wouldn't be read/written twice. + import ( "bytes" "encoding/base64" "fmt" + "reflect" "strconv" + "sync" "unicode/utf16" "unicode/utf8" ) @@ -81,20 +89,122 @@ const ( // jsonNumDigitsUint64Largest = 19 ) +// A stack is used to keep track of where we are in the tree. +// This is necessary, as the Handle must know whether to consume or emit a separator. + +type jsonStackElem struct { + st byte // top of stack (either '}' or ']' or 0 for map, array or neither). + sf bool // NOT first time in that container at top of stack + so bool // stack ctr odd + sr bool // value has NOT been read, so do not re-send separator +} + +func (x *jsonStackElem) retryRead() { + if x != nil && !x.sr { + x.sr = true + } +} + +func (x *jsonStackElem) sep() (c byte) { + // do not use switch, so it's a candidate for inlining. + // to inline effectively, this must not be called from within another method. + // v := j.st + if x == nil || x.st == 0 { + return + } + if x.sr { + x.sr = false + return + } + // v == '}' OR ']' + if x.st == '}' { + // put , or : depending on if even or odd respectively + if x.so { + c = ':' + if !x.sf { + x.sf = true + } + } else if x.sf { + c = ',' + } + } else { + if x.sf { + c = ',' + } else { + x.sf = true + } + } + x.so = !x.so + // Note: Anything more, and this function doesn't inline. Keep it tight. + // if x.sr { + // x.sr = false + // } + return +} + +const jsonStackPoolArrayLen = 32 + +// pool used to prevent constant allocation of stacks. +var jsonStackPool = sync.Pool{ + New: func() interface{} { + return new([jsonStackPoolArrayLen]jsonStackElem) + }, +} + +// jsonStack contains the stack for tracking the state of the container (branch). +// The same data structure is used during encode and decode, as it is similar functionality. +type jsonStack struct { + s []jsonStackElem // stack for map or array end tag. map=}, array=] + sc *jsonStackElem // pointer to current (top) element on the stack. + sp *[jsonStackPoolArrayLen]jsonStackElem +} + +func (j *jsonStack) start(c byte) { + if j.s == nil { + // j.s = make([]jsonStackElem, 0, 8) + j.sp = jsonStackPool.Get().(*[jsonStackPoolArrayLen]jsonStackElem) + j.s = j.sp[:0] + } + j.s = append(j.s, jsonStackElem{st: c}) + j.sc = &(j.s[len(j.s)-1]) +} + +func (j *jsonStack) end() { + l := len(j.s) - 1 // length of new stack after pop'ing + if l == 0 { + jsonStackPool.Put(j.sp) + j.s = nil + j.sp = nil + j.sc = nil + } else { + j.s = j.s[:l] + j.sc = &(j.s[l-1]) + } + //j.sc = &(j.s[len(j.s)-1]) +} + type jsonEncDriver struct { e *Encoder w encWriter h *JsonHandle b [64]byte // scratch bs []byte // scratch + se setExtWrapper + s jsonStack noBuiltInTypes } func (e *jsonEncDriver) EncodeNil() { + if c := e.s.sc.sep(); c != 0 { + e.w.writen1(c) + } e.w.writeb(jsonLiterals[9:13]) // null } func (e *jsonEncDriver) EncodeBool(b bool) { + if c := e.s.sc.sep(); c != 0 { + e.w.writen1(c) + } if b { e.w.writeb(jsonLiterals[0:4]) // true } else { @@ -103,78 +213,106 @@ func (e *jsonEncDriver) EncodeBool(b bool) { } func (e *jsonEncDriver) EncodeFloat32(f float32) { + if c := e.s.sc.sep(); c != 0 { + e.w.writen1(c) + } e.w.writeb(strconv.AppendFloat(e.b[:0], float64(f), 'E', -1, 32)) } func (e *jsonEncDriver) EncodeFloat64(f float64) { + if c := e.s.sc.sep(); c != 0 { + e.w.writen1(c) + } // e.w.writestr(strconv.FormatFloat(f, 'E', -1, 64)) e.w.writeb(strconv.AppendFloat(e.b[:0], f, 'E', -1, 64)) } func (e *jsonEncDriver) EncodeInt(v int64) { + if c := e.s.sc.sep(); c != 0 { + e.w.writen1(c) + } e.w.writeb(strconv.AppendInt(e.b[:0], v, 10)) } func (e *jsonEncDriver) EncodeUint(v uint64) { + if c := e.s.sc.sep(); c != 0 { + e.w.writen1(c) + } e.w.writeb(strconv.AppendUint(e.b[:0], v, 10)) } func (e *jsonEncDriver) EncodeExt(rv interface{}, xtag uint64, ext Ext, en *Encoder) { + if c := e.s.sc.sep(); c != 0 { + e.w.writen1(c) + } if v := ext.ConvertExt(rv); v == nil { - e.EncodeNil() + e.w.writeb(jsonLiterals[9:13]) // null // e.EncodeNil() } else { + e.s.sc.retryRead() en.encode(v) } } func (e *jsonEncDriver) EncodeRawExt(re *RawExt, en *Encoder) { + if c := e.s.sc.sep(); c != 0 { + e.w.writen1(c) + } // only encodes re.Value (never re.Data) if re.Value == nil { - e.EncodeNil() + e.w.writeb(jsonLiterals[9:13]) // null // e.EncodeNil() } else { + e.s.sc.retryRead() en.encode(re.Value) } } func (e *jsonEncDriver) EncodeArrayStart(length int) { + if c := e.s.sc.sep(); c != 0 { + e.w.writen1(c) + } + e.s.start(']') e.w.writen1('[') } -func (e *jsonEncDriver) EncodeArrayEntrySeparator() { - e.w.writen1(',') -} - -func (e *jsonEncDriver) EncodeArrayEnd() { - e.w.writen1(']') -} - func (e *jsonEncDriver) EncodeMapStart(length int) { + if c := e.s.sc.sep(); c != 0 { + e.w.writen1(c) + } + e.s.start('}') e.w.writen1('{') } -func (e *jsonEncDriver) EncodeMapEntrySeparator() { - e.w.writen1(',') -} - -func (e *jsonEncDriver) EncodeMapKVSeparator() { - e.w.writen1(':') -} - -func (e *jsonEncDriver) EncodeMapEnd() { - e.w.writen1('}') +func (e *jsonEncDriver) EncodeEnd() { + b := e.s.sc.st + e.s.end() + e.w.writen1(b) } func (e *jsonEncDriver) EncodeString(c charEncoding, v string) { // e.w.writestr(strconv.Quote(v)) + if c := e.s.sc.sep(); c != 0 { + e.w.writen1(c) + } e.quoteStr(v) } func (e *jsonEncDriver) EncodeSymbol(v string) { // e.EncodeString(c_UTF8, v) + if c := e.s.sc.sep(); c != 0 { + e.w.writen1(c) + } e.quoteStr(v) } func (e *jsonEncDriver) EncodeStringBytes(c charEncoding, v []byte) { + // if encoding raw bytes and RawBytesExt is configured, use it to encode + if c == c_RAW && e.se.i != nil { + e.EncodeExt(v, 0, &e.se, e.e) + return + } + if c := e.s.sc.sep(); c != 0 { + e.w.writen1(c) + } if c == c_RAW { slen := base64.StdEncoding.EncodedLen(len(v)) if e.bs == nil { @@ -195,6 +333,13 @@ func (e *jsonEncDriver) EncodeStringBytes(c charEncoding, v []byte) { } } +func (e *jsonEncDriver) EncodeAsis(v []byte) { + if c := e.s.sc.sep(); c != 0 { + e.w.writen1(c) + } + e.w.writeb(v) +} + func (e *jsonEncDriver) quoteStr(s string) { // adapted from std pkg encoding/json const hex = "0123456789abcdef" @@ -356,9 +501,14 @@ type jsonDecDriver struct { ct valueType // container type. one of unset, array or map. bstr [8]byte // scratch used for string \UXXX parsing b [64]byte // scratch + b2 [64]byte wsSkipped bool // whitespace skipped + se setExtWrapper + + s jsonStack + n jsonNum noBuiltInTypes } @@ -402,16 +552,27 @@ func (d *jsonDecDriver) readStrIdx(fromIdx, toIdx uint8) { } func (d *jsonDecDriver) TryDecodeAsNil() bool { - b := d.skipWhitespace(true) + // we mustn't consume the state here, and end up trying to read separator twice. + // Instead, we keep track of the state and restore it if we couldn't decode as nil. + + if c := d.s.sc.sep(); c != 0 { + d.expectChar(c) + } + b := d.skipWhitespace(false) if b == 'n' { - d.readStrIdx(9, 13) // null + d.readStrIdx(10, 13) // ull d.ct = valueTypeNil return true } + d.r.unreadn1() + d.s.sc.retryRead() return false } func (d *jsonDecDriver) DecodeBool() bool { + if c := d.s.sc.sep(); c != 0 { + d.expectChar(c) + } b := d.skipWhitespace(false) if b == 'f' { d.readStrIdx(5, 9) // alse @@ -426,35 +587,35 @@ func (d *jsonDecDriver) DecodeBool() bool { } func (d *jsonDecDriver) ReadMapStart() int { + if c := d.s.sc.sep(); c != 0 { + d.expectChar(c) + } + d.s.start('}') d.expectChar('{') d.ct = valueTypeMap return -1 } func (d *jsonDecDriver) ReadArrayStart() int { + if c := d.s.sc.sep(); c != 0 { + d.expectChar(c) + } + d.s.start(']') d.expectChar('[') d.ct = valueTypeArray return -1 } -func (d *jsonDecDriver) ReadMapEnd() { - d.expectChar('}') -} -func (d *jsonDecDriver) ReadArrayEnd() { - d.expectChar(']') -} -func (d *jsonDecDriver) ReadArrayEntrySeparator() { - d.expectChar(',') -} -func (d *jsonDecDriver) ReadMapEntrySeparator() { - d.expectChar(',') -} -func (d *jsonDecDriver) ReadMapKVSeparator() { - d.expectChar(':') + +func (d *jsonDecDriver) ReadEnd() { + b := d.s.sc.st + d.s.end() + d.expectChar(b) } + func (d *jsonDecDriver) expectChar(c uint8) { b := d.skipWhitespace(false) if b != c { - d.d.errorf("json: expect char %c but got char %c", c, b) + d.d.errorf("json: expect char '%c' but got char '%c'", c, b) return } if jsonTrackSkipWhitespace { @@ -462,6 +623,17 @@ func (d *jsonDecDriver) expectChar(c uint8) { } } +// func (d *jsonDecDriver) maybeChar(c uint8) { +// b := d.skipWhitespace(false) +// if b != c { +// d.r.unreadn1() +// return +// } +// if jsonTrackSkipWhitespace { +// d.wsSkipped = false +// } +// } + func (d *jsonDecDriver) IsContainerType(vt valueType) bool { // check container type by checking the first char if d.ct == valueTypeUnset { @@ -635,6 +807,9 @@ LOOP: } func (d *jsonDecDriver) DecodeInt(bitsize uint8) (i int64) { + if c := d.s.sc.sep(); c != 0 { + d.expectChar(c) + } d.decNum(false) n := &d.n if n.manOverflow { @@ -667,6 +842,9 @@ func (d *jsonDecDriver) DecodeInt(bitsize uint8) (i int64) { } func (d *jsonDecDriver) DecodeUint(bitsize uint8) (u uint64) { + if c := d.s.sc.sep(); c != 0 { + d.expectChar(c) + } d.decNum(false) n := &d.n if n.neg { @@ -698,6 +876,9 @@ func (d *jsonDecDriver) DecodeUint(bitsize uint8) (u uint64) { } func (d *jsonDecDriver) DecodeFloat(chkOverflow32 bool) (f float64) { + if c := d.s.sc.sep(); c != 0 { + d.expectChar(c) + } d.decNum(true) n := &d.n f = n.floatVal() @@ -709,6 +890,10 @@ func (d *jsonDecDriver) DecodeFloat(chkOverflow32 bool) (f float64) { } func (d *jsonDecDriver) DecodeExt(rv interface{}, xtag uint64, ext Ext) (realxtag uint64) { + // No need to call sep here, as d.d.decode() handles it + // if c := d.s.sc.sep(); c != 0 { + // d.expectChar(c) + // } if ext == nil { re := rv.(*RawExt) re.Tag = xtag @@ -722,14 +907,26 @@ func (d *jsonDecDriver) DecodeExt(rv interface{}, xtag uint64, ext Ext) (realxta } func (d *jsonDecDriver) DecodeBytes(bs []byte, isstring, zerocopy bool) (bsOut []byte) { - // zerocopy doesn't matter for json, as the bytes must be parsed. + // if decoding into raw bytes, and the RawBytesExt is configured, use it to decode. + if !isstring && d.se.i != nil { + bsOut = bs + d.DecodeExt(&bsOut, 0, &d.se) + return + } + if c := d.s.sc.sep(); c != 0 { + d.expectChar(c) + } bs0 := d.appendStringAsBytes(d.b[:0]) + // if isstring, then just return the bytes, even if it is using the scratch buffer. + // the bytes will be converted to a string as needed. if isstring { return bs0 } slen := base64.StdEncoding.DecodedLen(len(bs0)) - if cap(bs) >= slen { + if slen <= cap(bs) { bsOut = bs[:slen] + } else if zerocopy && slen <= cap(d.b2) { + bsOut = d.b2[:slen] } else { bsOut = make([]byte, slen) } @@ -745,6 +942,9 @@ func (d *jsonDecDriver) DecodeBytes(bs []byte, isstring, zerocopy bool) (bsOut [ } func (d *jsonDecDriver) DecodeString() (s string) { + if c := d.s.sc.sep(); c != 0 { + d.expectChar(c) + } return string(d.appendStringAsBytes(d.b[:0])) } @@ -816,6 +1016,9 @@ func (d *jsonDecDriver) jsonU4(checkSlashU bool) rune { } func (d *jsonDecDriver) DecodeNaked() (v interface{}, vt valueType, decodeFurther bool) { + if c := d.s.sc.sep(); c != 0 { + d.expectChar(c) + } n := d.skipWhitespace(true) switch n { case 'n': @@ -837,7 +1040,7 @@ func (d *jsonDecDriver) DecodeNaked() (v interface{}, vt valueType, decodeFurthe decodeFurther = true case '"': vt = valueTypeString - v = d.DecodeString() + v = string(d.appendStringAsBytes(d.b[:0])) // same as d.DecodeString(), but skipping sep() call. default: // number d.decNum(true) n := &d.n @@ -878,6 +1081,9 @@ func (d *jsonDecDriver) DecodeNaked() (v interface{}, vt valueType, decodeFurthe } // fmt.Printf("DecodeNaked: Number: %T, %v\n", v, v) } + if decodeFurther { + d.s.sc.retryRead() + } return } @@ -887,7 +1093,8 @@ func (d *jsonDecDriver) DecodeNaked() (v interface{}, vt valueType, decodeFurthe // // Json is comprehensively supported: // - decodes numbers into interface{} as int, uint or float64 -// - encodes and decodes []byte using base64 Std Encoding +// - configurable way to encode/decode []byte . +// by default, encodes and decodes []byte using base64 Std Encoding // - UTF-8 support for encoding and decoding // // It has better performance than the json library in the standard library, @@ -901,19 +1108,29 @@ func (d *jsonDecDriver) DecodeNaked() (v interface{}, vt valueType, decodeFurthe type JsonHandle struct { BasicHandle textEncodingType + // RawBytesExt, if configured, is used to encode and decode raw bytes in a custom way. + // If not configured, raw bytes are encoded to/from base64 text. + RawBytesExt InterfaceExt } func (h *JsonHandle) newEncDriver(e *Encoder) encDriver { - return &jsonEncDriver{e: e, w: e.w, h: h} + hd := jsonEncDriver{e: e, w: e.w, h: h} + hd.se.i = h.RawBytesExt + return &hd } func (h *JsonHandle) newDecDriver(d *Decoder) decDriver { // d := jsonDecDriver{r: r.(*bytesDecReader), h: h} hd := jsonDecDriver{d: d, r: d.r, h: h} + hd.se.i = h.RawBytesExt hd.n.bytes = d.b[:] return &hd } +func (h *JsonHandle) SetInterfaceExt(rt reflect.Type, tag uint64, ext InterfaceExt) (err error) { + return h.SetExt(rt, tag, &setExtWrapper{i: ext}) +} + var jsonEncodeTerminate = []byte{' '} func (h *JsonHandle) rpcEncodeTerminate() []byte { diff --git a/Godeps/_workspace/src/github.com/ugorji/go/codec/msgpack.go b/Godeps/_workspace/src/github.com/ugorji/go/codec/msgpack.go index a5812ba145d7..fd5f3895d81e 100644 --- a/Godeps/_workspace/src/github.com/ugorji/go/codec/msgpack.go +++ b/Godeps/_workspace/src/github.com/ugorji/go/codec/msgpack.go @@ -1,5 +1,5 @@ // Copyright (c) 2012-2015 Ugorji Nwoke. All rights reserved. -// Use of this source code is governed by a BSD-style license found in the LICENSE file. +// Use of this source code is governed by a MIT license found in the LICENSE file. /* MSGPACK @@ -24,6 +24,7 @@ import ( "io" "math" "net/rpc" + "reflect" ) const ( @@ -536,15 +537,11 @@ func (d *msgpackDecDriver) DecodeBytes(bs []byte, isstring, zerocopy bool) (bsOu d.readNextBd() } var clen int - if isstring { - clen = d.readContainerLen(msgpackContainerStr) + // ignore isstring. Expect that the bytes may be found from msgpackContainerStr or msgpackContainerBin + if bd := d.bd; bd == mpBin8 || bd == mpBin16 || bd == mpBin32 { + clen = d.readContainerLen(msgpackContainerBin) } else { - // bytes can be decoded from msgpackContainerStr or msgpackContainerBin - if bd := d.bd; bd == mpBin8 || bd == mpBin16 || bd == mpBin32 { - clen = d.readContainerLen(msgpackContainerBin) - } else { - clen = d.readContainerLen(msgpackContainerStr) - } + clen = d.readContainerLen(msgpackContainerStr) } // println("DecodeBytes: clen: ", clen) d.bdRead = false @@ -617,7 +614,7 @@ func (d *msgpackDecDriver) readContainerLen(ct msgpackContainerType) (clen int) } else if (ct.bFixMin & bd) == ct.bFixMin { clen = int(ct.bFixMin ^ bd) } else { - d.d.errorf("readContainerLen: %s: hex: %x, dec: %d", msgBadDesc, bd, bd) + d.d.errorf("readContainerLen: %s: hex: %x, decimal: %d", msgBadDesc, bd, bd) return } d.bdRead = false @@ -730,6 +727,10 @@ func (h *MsgpackHandle) newDecDriver(d *Decoder) decDriver { return &msgpackDecDriver{d: d, r: d.r, h: h, br: d.bytes} } +func (h *MsgpackHandle) SetBytesExt(rt reflect.Type, tag uint64, ext BytesExt) (err error) { + return h.SetExt(rt, tag, &setExtWrapper{b: ext}) +} + //-------------------------------------------------- type msgpackSpecRpcCodec struct { @@ -781,7 +782,7 @@ func (c *msgpackSpecRpcCodec) ReadRequestBody(body interface{}) error { func (c *msgpackSpecRpcCodec) parseCustomHeader(expectTypeByte byte, msgid *uint64, methodOrError *string) (err error) { - if c.cls { + if c.isClosed() { return io.EOF } diff --git a/Godeps/_workspace/src/github.com/ugorji/go/codec/noop.go b/Godeps/_workspace/src/github.com/ugorji/go/codec/noop.go index 76c01e4d3c8b..ca02c6a7e8f0 100644 --- a/Godeps/_workspace/src/github.com/ugorji/go/codec/noop.go +++ b/Godeps/_workspace/src/github.com/ugorji/go/codec/noop.go @@ -1,5 +1,5 @@ // Copyright (c) 2012-2015 Ugorji Nwoke. All rights reserved. -// Use of this source code is governed by a BSD-style license found in the LICENSE file. +// Use of this source code is governed by a MIT license found in the LICENSE file. package codec @@ -11,6 +11,7 @@ import ( // NoopHandle returns a no-op handle. It basically does nothing. // It is only useful for benchmarking, as it gives an idea of the // overhead from the codec framework. +// // LIBRARY USERS: *** DO NOT USE *** func NoopHandle(slen int) *noopHandle { h := noopHandle{} @@ -40,7 +41,8 @@ type noopDrv struct { i int S []string B [][]byte - mk bool // are we about to read a map key? + mks []bool // stack. if map (true), else if array (false) + mk bool // top of stack. what container are we on? map or array? ct valueType // last request for IsContainerType. cb bool // last response for IsContainerType. rand *rand.Rand @@ -54,21 +56,34 @@ func (h *noopDrv) newDecDriver(_ *Decoder) decDriver { return h } // --- encDriver -func (h *noopDrv) EncodeBuiltin(rt uintptr, v interface{}) {} -func (h *noopDrv) EncodeNil() {} -func (h *noopDrv) EncodeInt(i int64) {} -func (h *noopDrv) EncodeUint(i uint64) {} -func (h *noopDrv) EncodeBool(b bool) {} -func (h *noopDrv) EncodeFloat32(f float32) {} -func (h *noopDrv) EncodeFloat64(f float64) {} -func (h *noopDrv) EncodeRawExt(re *RawExt, e *Encoder) {} -func (h *noopDrv) EncodeArrayStart(length int) {} -func (h *noopDrv) EncodeArrayEnd() {} -func (h *noopDrv) EncodeArrayEntrySeparator() {} -func (h *noopDrv) EncodeMapStart(length int) {} -func (h *noopDrv) EncodeMapEnd() {} -func (h *noopDrv) EncodeMapEntrySeparator() {} -func (h *noopDrv) EncodeMapKVSeparator() {} +// stack functions (for map and array) +func (h *noopDrv) start(b bool) { + // println("start", len(h.mks)+1) + h.mks = append(h.mks, b) + h.mk = b +} +func (h *noopDrv) end() { + // println("end: ", len(h.mks)-1) + h.mks = h.mks[:len(h.mks)-1] + if len(h.mks) > 0 { + h.mk = h.mks[len(h.mks)-1] + } else { + h.mk = false + } +} + +func (h *noopDrv) EncodeBuiltin(rt uintptr, v interface{}) {} +func (h *noopDrv) EncodeNil() {} +func (h *noopDrv) EncodeInt(i int64) {} +func (h *noopDrv) EncodeUint(i uint64) {} +func (h *noopDrv) EncodeBool(b bool) {} +func (h *noopDrv) EncodeFloat32(f float32) {} +func (h *noopDrv) EncodeFloat64(f float64) {} +func (h *noopDrv) EncodeRawExt(re *RawExt, e *Encoder) {} +func (h *noopDrv) EncodeArrayStart(length int) { h.start(true) } +func (h *noopDrv) EncodeMapStart(length int) { h.start(false) } +func (h *noopDrv) EncodeEnd() { h.end() } + func (h *noopDrv) EncodeString(c charEncoding, v string) {} func (h *noopDrv) EncodeSymbol(v string) {} func (h *noopDrv) EncodeStringBytes(c charEncoding, v []byte) {} @@ -90,15 +105,11 @@ func (h *noopDrv) DecodeString() (s string) { return h.S[h.m(8 func (h *noopDrv) DecodeBytes(bs []byte, isstring, zerocopy bool) []byte { return h.B[h.m(len(h.B))] } -func (h *noopDrv) ReadMapEnd() { h.mk = false } -func (h *noopDrv) ReadArrayEnd() {} -func (h *noopDrv) ReadArrayEntrySeparator() {} -func (h *noopDrv) ReadMapEntrySeparator() { h.mk = true } -func (h *noopDrv) ReadMapKVSeparator() { h.mk = false } +func (h *noopDrv) ReadEnd() { h.end() } // toggle map/slice -func (h *noopDrv) ReadMapStart() int { h.mk = true; return h.m(10) } -func (h *noopDrv) ReadArrayStart() int { return h.m(10) } +func (h *noopDrv) ReadMapStart() int { h.start(true); return h.m(10) } +func (h *noopDrv) ReadArrayStart() int { h.start(false); return h.m(10) } func (h *noopDrv) IsContainerType(vt valueType) bool { // return h.m(2) == 0 diff --git a/Godeps/_workspace/src/github.com/ugorji/go/codec/prebuild.sh b/Godeps/_workspace/src/github.com/ugorji/go/codec/prebuild.sh index a10e74bdc416..d548b88cbf60 100644 --- a/Godeps/_workspace/src/github.com/ugorji/go/codec/prebuild.sh +++ b/Godeps/_workspace/src/github.com/ugorji/go/codec/prebuild.sh @@ -54,7 +54,7 @@ _build() { cat > gen.generated.go <>>>>>> TAGS: $ztags" + + OPTIND=1 + while getopts "xurtcinsvg" flag + do + case "x$flag" in + 'xt') printf ">>>>>>> REGULAR : "; go test "-tags=$ztags" "$zverbose" ; sleep 2 ;; + 'xc') printf ">>>>>>> CANONICAL : "; go test "-tags=$ztags" "$zverbose" -tc; sleep 2 ;; + 'xi') printf ">>>>>>> I/O : "; go test "-tags=$ztags" "$zverbose" -ti; sleep 2 ;; + 'xn') printf ">>>>>>> NO_SYMBOLS : "; go test "-tags=$ztags" "$zverbose" -tn; sleep 2 ;; + 'xs') printf ">>>>>>> TO_ARRAY : "; go test "-tags=$ztags" "$zverbose" -ts; sleep 2 ;; + *) ;; + esac + done + shift $((OPTIND-1)) + + OPTIND=1 +} + +# echo ">>>>>>> RUNNING VARIATIONS OF TESTS" +if [[ "x$@" = x ]]; then + # r, x, g, gu + _run "-rtcins" + _run "-xtcins" + _run "-gtcins" + _run "-gutcins" +else + _run "$@" +fi diff --git a/Godeps/_workspace/src/github.com/ugorji/go/codec/time.go b/Godeps/_workspace/src/github.com/ugorji/go/codec/time.go index a6344ed779b4..733fc3fb75a5 100644 --- a/Godeps/_workspace/src/github.com/ugorji/go/codec/time.go +++ b/Godeps/_workspace/src/github.com/ugorji/go/codec/time.go @@ -1,5 +1,5 @@ // Copyright (c) 2012-2015 Ugorji Nwoke. All rights reserved. -// Use of this source code is governed by a BSD-style license found in the LICENSE file. +// Use of this source code is governed by a MIT license found in the LICENSE file. package codec diff --git a/Godeps/_workspace/src/github.com/ugorji/go/codec/values_test.go b/Godeps/_workspace/src/github.com/ugorji/go/codec/values_test.go index a3d1f399b3ec..4ec28e131c84 100644 --- a/Godeps/_workspace/src/github.com/ugorji/go/codec/values_test.go +++ b/Godeps/_workspace/src/github.com/ugorji/go/codec/values_test.go @@ -1,7 +1,7 @@ // // +build testing // Copyright (c) 2012-2015 Ugorji Nwoke. All rights reserved. -// Use of this source code is governed by a BSD-style license found in the LICENSE file. +// Use of this source code is governed by a MIT license found in the LICENSE file. package codec @@ -57,6 +57,11 @@ type TestStruc struct { Iptrslice []*int64 + // TODO: test these separately, specifically for reflection and codecgen. + // Unfortunately, ffjson doesn't support these. Its compilation even fails. + // Ui64array [4]uint64 + // Ui64slicearray [][4]uint64 + AnonInTestStruc //M map[interface{}]interface{} `json:"-",bson:"-"` diff --git a/Godeps/_workspace/src/golang.org/x/crypto/ssh/testdata/doc.go b/Godeps/_workspace/src/golang.org/x/crypto/ssh/testdata/doc.go new file mode 100644 index 000000000000..ae7bd8b89ec7 --- /dev/null +++ b/Godeps/_workspace/src/golang.org/x/crypto/ssh/testdata/doc.go @@ -0,0 +1,8 @@ +// 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. + +// This package contains test data shared between the various subpackages of +// the golang.org/x/crypto/ssh package. Under no circumstance should +// this data be used for production code. +package testdata diff --git a/Godeps/_workspace/src/golang.org/x/crypto/ssh/testdata/keys.go b/Godeps/_workspace/src/golang.org/x/crypto/ssh/testdata/keys.go new file mode 100644 index 000000000000..5ff1c0e0358f --- /dev/null +++ b/Godeps/_workspace/src/golang.org/x/crypto/ssh/testdata/keys.go @@ -0,0 +1,43 @@ +// 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 testdata + +var PEMBytes = map[string][]byte{ + "dsa": []byte(`-----BEGIN DSA PRIVATE KEY----- +MIIBuwIBAAKBgQD6PDSEyXiI9jfNs97WuM46MSDCYlOqWw80ajN16AohtBncs1YB +lHk//dQOvCYOsYaE+gNix2jtoRjwXhDsc25/IqQbU1ahb7mB8/rsaILRGIbA5WH3 +EgFtJmXFovDz3if6F6TzvhFpHgJRmLYVR8cqsezL3hEZOvvs2iH7MorkxwIVAJHD +nD82+lxh2fb4PMsIiaXudAsBAoGAQRf7Q/iaPRn43ZquUhd6WwvirqUj+tkIu6eV +2nZWYmXLlqFQKEy4Tejl7Wkyzr2OSYvbXLzo7TNxLKoWor6ips0phYPPMyXld14r +juhT24CrhOzuLMhDduMDi032wDIZG4Y+K7ElU8Oufn8Sj5Wge8r6ANmmVgmFfynr +FhdYCngCgYEA3ucGJ93/Mx4q4eKRDxcWD3QzWyqpbRVRRV1Vmih9Ha/qC994nJFz +DQIdjxDIT2Rk2AGzMqFEB68Zc3O+Wcsmz5eWWzEwFxaTwOGWTyDqsDRLm3fD+QYj +nOwuxb0Kce+gWI8voWcqC9cyRm09jGzu2Ab3Bhtpg8JJ8L7gS3MRZK4CFEx4UAfY +Fmsr0W6fHB9nhS4/UXM8 +-----END DSA PRIVATE KEY----- +`), + "ecdsa": []byte(`-----BEGIN EC PRIVATE KEY----- +MHcCAQEEINGWx0zo6fhJ/0EAfrPzVFyFC9s18lBt3cRoEDhS3ARooAoGCCqGSM49 +AwEHoUQDQgAEi9Hdw6KvZcWxfg2IDhA7UkpDtzzt6ZqJXSsFdLd+Kx4S3Sx4cVO+ +6/ZOXRnPmNAlLUqjShUsUBBngG0u2fqEqA== +-----END EC PRIVATE KEY----- +`), + "rsa": []byte(`-----BEGIN RSA PRIVATE KEY----- +MIIBOwIBAAJBALdGZxkXDAjsYk10ihwU6Id2KeILz1TAJuoq4tOgDWxEEGeTrcld +r/ZwVaFzjWzxaf6zQIJbfaSEAhqD5yo72+sCAwEAAQJBAK8PEVU23Wj8mV0QjwcJ +tZ4GcTUYQL7cF4+ezTCE9a1NrGnCP2RuQkHEKxuTVrxXt+6OF15/1/fuXnxKjmJC +nxkCIQDaXvPPBi0c7vAxGwNY9726x01/dNbHCE0CBtcotobxpwIhANbbQbh3JHVW +2haQh4fAG5mhesZKAGcxTyv4mQ7uMSQdAiAj+4dzMpJWdSzQ+qGHlHMIBvVHLkqB +y2VdEyF7DPCZewIhAI7GOI/6LDIFOvtPo6Bj2nNmyQ1HU6k/LRtNIXi4c9NJAiAr +rrxx26itVhJmcvoUhOjwuzSlP2bE5VHAvkGB352YBg== +-----END RSA PRIVATE KEY----- +`), + "user": []byte(`-----BEGIN EC PRIVATE KEY----- +MHcCAQEEILYCAeq8f7V4vSSypRw7pxy8yz3V5W4qg8kSC3zJhqpQoAoGCCqGSM49 +AwEHoUQDQgAEYcO2xNKiRUYOLEHM7VYAp57HNyKbOdYtHD83Z4hzNPVC4tM5mdGD +PLL8IEwvYu2wq+lpXfGQnNMbzYf9gspG0w== +-----END EC PRIVATE KEY----- +`), +} diff --git a/Godeps/_workspace/src/golang.org/x/net/html/charset/testdata/HTTP-charset.html b/Godeps/_workspace/src/golang.org/x/net/html/charset/testdata/HTTP-charset.html new file mode 100644 index 000000000000..9915fa0ee4f5 --- /dev/null +++ b/Godeps/_workspace/src/golang.org/x/net/html/charset/testdata/HTTP-charset.html @@ -0,0 +1,48 @@ + + + + HTTP charset + + + + + + + + + + + +

HTTP charset

+ + +
+ + +
 
+ + + + + +
+

The character encoding of a page can be set using the HTTP header charset declaration.

+

The test contains a div with a class name that contains the following sequence of bytes: 0xC3 0xBD 0xC3 0xA4 0xC3 0xA8. These represent different sequences of characters in ISO 8859-15, ISO 8859-1 and UTF-8. The external, UTF-8-encoded stylesheet contains a selector .test div.ÜÀÚ. This matches the sequence of bytes above when they are interpreted as ISO 8859-15. If the class name matches the selector then the test will pass.

The only character encoding declaration for this HTML file is in the HTTP header, which sets the encoding to ISO 8859-15.

+
+
+
HTML5
+

the-input-byte-stream-001
Result summary & related tests
Detailed results for this test
Link to spec

+
Assumptions:
  • The default encoding for the browser you are testing is not set to ISO 8859-15.
  • +
  • The test is read from a server that supports HTTP.
+
+ + + + + + diff --git a/Godeps/_workspace/src/golang.org/x/net/html/charset/testdata/HTTP-vs-UTF-8-BOM.html b/Godeps/_workspace/src/golang.org/x/net/html/charset/testdata/HTTP-vs-UTF-8-BOM.html new file mode 100644 index 000000000000..26e5d8b4ebf6 --- /dev/null +++ b/Godeps/_workspace/src/golang.org/x/net/html/charset/testdata/HTTP-vs-UTF-8-BOM.html @@ -0,0 +1,48 @@ + + + + HTTP vs UTF-8 BOM + + + + + + + + + + + +

HTTP vs UTF-8 BOM

+ + +
+ + +
 
+ + + + + +
+

A character encoding set in the HTTP header has lower precedence than the UTF-8 signature.

+

The HTTP header attempts to set the character encoding to ISO 8859-15. The page starts with a UTF-8 signature.

The test contains a div with a class name that contains the following sequence of bytes: 0xC3 0xBD 0xC3 0xA4 0xC3 0xA8. These represent different sequences of characters in ISO 8859-15, ISO 8859-1 and UTF-8. The external, UTF-8-encoded stylesheet contains a selector .test div.ýäè. This matches the sequence of bytes above when they are interpreted as UTF-8. If the class name matches the selector then the test will pass.

If the test is unsuccessful, the characters  should appear at the top of the page. These represent the bytes that make up the UTF-8 signature when encountered in the ISO 8859-15 encoding.

+
+
+
HTML5
+

the-input-byte-stream-034
Result summary & related tests
Detailed results for this test
Link to spec

+
Assumptions:
  • The default encoding for the browser you are testing is not set to ISO 8859-15.
  • +
  • The test is read from a server that supports HTTP.
+
+ + + + + + diff --git a/Godeps/_workspace/src/golang.org/x/net/html/charset/testdata/HTTP-vs-meta-charset.html b/Godeps/_workspace/src/golang.org/x/net/html/charset/testdata/HTTP-vs-meta-charset.html new file mode 100644 index 000000000000..2f07e95158ea --- /dev/null +++ b/Godeps/_workspace/src/golang.org/x/net/html/charset/testdata/HTTP-vs-meta-charset.html @@ -0,0 +1,49 @@ + + + + HTTP vs meta charset + + + + + + + + + + + +

HTTP vs meta charset

+ + +
+ + +
 
+ + + + + +
+

The HTTP header has a higher precedence than an encoding declaration in a meta charset attribute.

+

The HTTP header attempts to set the character encoding to ISO 8859-15. The page contains an encoding declaration in a meta charset attribute that attempts to set the character encoding to ISO 8859-1.

The test contains a div with a class name that contains the following sequence of bytes: 0xC3 0xBD 0xC3 0xA4 0xC3 0xA8. These represent different sequences of characters in ISO 8859-15, ISO 8859-1 and UTF-8. The external, UTF-8-encoded stylesheet contains a selector .test div.ÜÀÚ. This matches the sequence of bytes above when they are interpreted as ISO 8859-15. If the class name matches the selector then the test will pass.

+
+
+
HTML5
+

the-input-byte-stream-018
Result summary & related tests
Detailed results for this test
Link to spec

+
Assumptions:
  • The default encoding for the browser you are testing is not set to ISO 8859-15.
  • +
  • The test is read from a server that supports HTTP.
+
+ + + + + + diff --git a/Godeps/_workspace/src/golang.org/x/net/html/charset/testdata/HTTP-vs-meta-content.html b/Godeps/_workspace/src/golang.org/x/net/html/charset/testdata/HTTP-vs-meta-content.html new file mode 100644 index 000000000000..6853cddecccb --- /dev/null +++ b/Godeps/_workspace/src/golang.org/x/net/html/charset/testdata/HTTP-vs-meta-content.html @@ -0,0 +1,49 @@ + + + + HTTP vs meta content + + + + + + + + + + + +

HTTP vs meta content

+ + +
+ + +
 
+ + + + + +
+

The HTTP header has a higher precedence than an encoding declaration in a meta content attribute.

+

The HTTP header attempts to set the character encoding to ISO 8859-15. The page contains an encoding declaration in a meta content attribute that attempts to set the character encoding to ISO 8859-1.

The test contains a div with a class name that contains the following sequence of bytes: 0xC3 0xBD 0xC3 0xA4 0xC3 0xA8. These represent different sequences of characters in ISO 8859-15, ISO 8859-1 and UTF-8. The external, UTF-8-encoded stylesheet contains a selector .test div.ÜÀÚ. This matches the sequence of bytes above when they are interpreted as ISO 8859-15. If the class name matches the selector then the test will pass.

+
+
+
HTML5
+

the-input-byte-stream-016
Result summary & related tests
Detailed results for this test
Link to spec

+
Assumptions:
  • The default encoding for the browser you are testing is not set to ISO 8859-15.
  • +
  • The test is read from a server that supports HTTP.
+
+ + + + + + diff --git a/Godeps/_workspace/src/golang.org/x/net/html/charset/testdata/No-encoding-declaration.html b/Godeps/_workspace/src/golang.org/x/net/html/charset/testdata/No-encoding-declaration.html new file mode 100644 index 000000000000..612e26c6c521 --- /dev/null +++ b/Godeps/_workspace/src/golang.org/x/net/html/charset/testdata/No-encoding-declaration.html @@ -0,0 +1,47 @@ + + + + No encoding declaration + + + + + + + + + + + +

No encoding declaration

+ + +
+ + +
 
+ + + + + +
+

A page with no encoding information in HTTP, BOM, XML declaration or meta element will be treated as UTF-8.

+

The test on this page contains a div with a class name that contains the following sequence of bytes: 0xC3 0xBD 0xC3 0xA4 0xC3 0xA8. These represent different sequences of characters in ISO 8859-15, ISO 8859-1 and UTF-8. The external, UTF-8-encoded stylesheet contains a selector .test div.ýäè. This matches the sequence of bytes above when they are interpreted as UTF-8. If the class name matches the selector then the test will pass.

+
+
+
HTML5
+

the-input-byte-stream-015
Result summary & related tests
Detailed results for this test
Link to spec

+
Assumptions:
  • The test is read from a server that supports HTTP.
+
+ + + + + + diff --git a/Godeps/_workspace/src/golang.org/x/net/html/charset/testdata/README b/Godeps/_workspace/src/golang.org/x/net/html/charset/testdata/README new file mode 100644 index 000000000000..38ef0f9f121f --- /dev/null +++ b/Godeps/_workspace/src/golang.org/x/net/html/charset/testdata/README @@ -0,0 +1,9 @@ +These test cases come from +http://www.w3.org/International/tests/repository/html5/the-input-byte-stream/results-basics + +Distributed under both the W3C Test Suite License +(http://www.w3.org/Consortium/Legal/2008/04-testsuite-license) +and the W3C 3-clause BSD License +(http://www.w3.org/Consortium/Legal/2008/03-bsd-license). +To contribute to a W3C Test Suite, see the policies and contribution +forms (http://www.w3.org/2004/10/27-testcases). diff --git a/Godeps/_workspace/src/golang.org/x/net/html/charset/testdata/UTF-16BE-BOM.html b/Godeps/_workspace/src/golang.org/x/net/html/charset/testdata/UTF-16BE-BOM.html new file mode 100644 index 000000000000..3abf7a9343c2 Binary files /dev/null and b/Godeps/_workspace/src/golang.org/x/net/html/charset/testdata/UTF-16BE-BOM.html differ diff --git a/Godeps/_workspace/src/golang.org/x/net/html/charset/testdata/UTF-16LE-BOM.html b/Godeps/_workspace/src/golang.org/x/net/html/charset/testdata/UTF-16LE-BOM.html new file mode 100644 index 000000000000..76254c980c29 Binary files /dev/null and b/Godeps/_workspace/src/golang.org/x/net/html/charset/testdata/UTF-16LE-BOM.html differ diff --git a/Godeps/_workspace/src/golang.org/x/net/html/charset/testdata/UTF-8-BOM-vs-meta-charset.html b/Godeps/_workspace/src/golang.org/x/net/html/charset/testdata/UTF-8-BOM-vs-meta-charset.html new file mode 100644 index 000000000000..83de43338ecb --- /dev/null +++ b/Godeps/_workspace/src/golang.org/x/net/html/charset/testdata/UTF-8-BOM-vs-meta-charset.html @@ -0,0 +1,49 @@ + + + + UTF-8 BOM vs meta charset + + + + + + + + + + + +

UTF-8 BOM vs meta charset

+ + +
+ + +
 
+ + + + + +
+

A page with a UTF-8 BOM will be recognized as UTF-8 even if the meta charset attribute declares a different encoding.

+

The page contains an encoding declaration in a meta charset attribute that attempts to set the character encoding to ISO 8859-15, but the file starts with a UTF-8 signature.

The test contains a div with a class name that contains the following sequence of bytes: 0xC3 0xBD 0xC3 0xA4 0xC3 0xA8. These represent different sequences of characters in ISO 8859-15, ISO 8859-1 and UTF-8. The external, UTF-8-encoded stylesheet contains a selector .test div.ýäè. This matches the sequence of bytes above when they are interpreted as UTF-8. If the class name matches the selector then the test will pass.

+
+
+
HTML5
+

the-input-byte-stream-038
Result summary & related tests
Detailed results for this test
Link to spec

+
Assumptions:
  • The default encoding for the browser you are testing is not set to ISO 8859-15.
  • +
  • The test is read from a server that supports HTTP.
+
+ + + + + + diff --git a/Godeps/_workspace/src/golang.org/x/net/html/charset/testdata/UTF-8-BOM-vs-meta-content.html b/Godeps/_workspace/src/golang.org/x/net/html/charset/testdata/UTF-8-BOM-vs-meta-content.html new file mode 100644 index 000000000000..501aac2d6a5d --- /dev/null +++ b/Godeps/_workspace/src/golang.org/x/net/html/charset/testdata/UTF-8-BOM-vs-meta-content.html @@ -0,0 +1,48 @@ + + + + UTF-8 BOM vs meta content + + + + + + + + + + + +

UTF-8 BOM vs meta content

+ + +
+ + +
 
+ + + + + +
+

A page with a UTF-8 BOM will be recognized as UTF-8 even if the meta content attribute declares a different encoding.

+

The page contains an encoding declaration in a meta content attribute that attempts to set the character encoding to ISO 8859-15, but the file starts with a UTF-8 signature.

The test contains a div with a class name that contains the following sequence of bytes: 0xC3 0xBD 0xC3 0xA4 0xC3 0xA8. These represent different sequences of characters in ISO 8859-15, ISO 8859-1 and UTF-8. The external, UTF-8-encoded stylesheet contains a selector .test div.ýäè. This matches the sequence of bytes above when they are interpreted as UTF-8. If the class name matches the selector then the test will pass.

+
+
+
HTML5
+

the-input-byte-stream-037
Result summary & related tests
Detailed results for this test
Link to spec

+
Assumptions:
  • The default encoding for the browser you are testing is not set to ISO 8859-15.
  • +
  • The test is read from a server that supports HTTP.
+
+ + + + + + diff --git a/Godeps/_workspace/src/golang.org/x/net/html/charset/testdata/meta-charset-attribute.html b/Godeps/_workspace/src/golang.org/x/net/html/charset/testdata/meta-charset-attribute.html new file mode 100644 index 000000000000..2d7d25aba14d --- /dev/null +++ b/Godeps/_workspace/src/golang.org/x/net/html/charset/testdata/meta-charset-attribute.html @@ -0,0 +1,48 @@ + + + + meta charset attribute + + + + + + + + + + + +

meta charset attribute

+ + +
+ + +
 
+ + + + + +
+

The character encoding of the page can be set by a meta element with charset attribute.

+

The only character encoding declaration for this HTML file is in the charset attribute of the meta element, which declares the encoding to be ISO 8859-15.

The test contains a div with a class name that contains the following sequence of bytes: 0xC3 0xBD 0xC3 0xA4 0xC3 0xA8. These represent different sequences of characters in ISO 8859-15, ISO 8859-1 and UTF-8. The external, UTF-8-encoded stylesheet contains a selector .test div.ÜÀÚ. This matches the sequence of bytes above when they are interpreted as ISO 8859-15. If the class name matches the selector then the test will pass.

+
+
+
HTML5
+

the-input-byte-stream-009
Result summary & related tests
Detailed results for this test
Link to spec

+
Assumptions:
  • The default encoding for the browser you are testing is not set to ISO 8859-15.
  • +
  • The test is read from a server that supports HTTP.
+
+ + + + + + diff --git a/Godeps/_workspace/src/golang.org/x/net/html/charset/testdata/meta-content-attribute.html b/Godeps/_workspace/src/golang.org/x/net/html/charset/testdata/meta-content-attribute.html new file mode 100644 index 000000000000..1c3f228e7c99 --- /dev/null +++ b/Godeps/_workspace/src/golang.org/x/net/html/charset/testdata/meta-content-attribute.html @@ -0,0 +1,48 @@ + + + + meta content attribute + + + + + + + + + + + +

meta content attribute

+ + +
+ + +
 
+ + + + + +
+

The character encoding of the page can be set by a meta element with http-equiv and content attributes.

+

The only character encoding declaration for this HTML file is in the content attribute of the meta element, which declares the encoding to be ISO 8859-15.

The test contains a div with a class name that contains the following sequence of bytes: 0xC3 0xBD 0xC3 0xA4 0xC3 0xA8. These represent different sequences of characters in ISO 8859-15, ISO 8859-1 and UTF-8. The external, UTF-8-encoded stylesheet contains a selector .test div.ÜÀÚ. This matches the sequence of bytes above when they are interpreted as ISO 8859-15. If the class name matches the selector then the test will pass.

+
+
+
HTML5
+

the-input-byte-stream-007
Result summary & related tests
Detailed results for this test
Link to spec

+
Assumptions:
  • The default encoding for the browser you are testing is not set to ISO 8859-15.
  • +
  • The test is read from a server that supports HTTP.
+
+ + + + + + diff --git a/Godeps/_workspace/src/golang.org/x/net/html/testdata/go1.html b/Godeps/_workspace/src/golang.org/x/net/html/testdata/go1.html new file mode 100644 index 000000000000..a782cc71d209 --- /dev/null +++ b/Godeps/_workspace/src/golang.org/x/net/html/testdata/go1.html @@ -0,0 +1,2237 @@ + + + + + + Go 1 Release Notes - The Go Programming Language + + + + + + + + + + + + +
+ + +
+

Go 1 Release Notes

+ + + + + + + + + +

Introduction to Go 1

+ +

+Go version 1, Go 1 for short, defines a language and a set of core libraries +that provide a stable foundation for creating reliable products, projects, and +publications. +

+ +

+The driving motivation for Go 1 is stability for its users. People should be able to +write Go programs and expect that they will continue to compile and run without +change, on a time scale of years, including in production environments such as +Google App Engine. Similarly, people should be able to write books about Go, be +able to say which version of Go the book is describing, and have that version +number still be meaningful much later. +

+ +

+Code that compiles in Go 1 should, with few exceptions, continue to compile and +run throughout the lifetime of that version, even as we issue updates and bug +fixes such as Go version 1.1, 1.2, and so on. Other than critical fixes, changes +made to the language and library for subsequent releases of Go 1 may +add functionality but will not break existing Go 1 programs. +The Go 1 compatibility document +explains the compatibility guidelines in more detail. +

+ +

+Go 1 is a representation of Go as it used today, not a wholesale rethinking of +the language. We avoided designing new features and instead focused on cleaning +up problems and inconsistencies and improving portability. There are a number +changes to the Go language and packages that we had considered for some time and +prototyped but not released primarily because they are significant and +backwards-incompatible. Go 1 was an opportunity to get them out, which is +helpful for the long term, but also means that Go 1 introduces incompatibilities +for old programs. Fortunately, the go fix tool can +automate much of the work needed to bring programs up to the Go 1 standard. +

+ +

+This document outlines the major changes in Go 1 that will affect programmers +updating existing code; its reference point is the prior release, r60 (tagged as +r60.3). It also explains how to update code from r60 to run under Go 1. +

+ +

Changes to the language

+ +

Append

+ +

+The append predeclared variadic function makes it easy to grow a slice +by adding elements to the end. +A common use is to add bytes to the end of a byte slice when generating output. +However, append did not provide a way to append a string to a []byte, +which is another common case. +

+ +
    greeting := []byte{}
+    greeting = append(greeting, []byte("hello ")...)
+ +

+By analogy with the similar property of copy, Go 1 +permits a string to be appended (byte-wise) directly to a byte +slice, reducing the friction between strings and byte slices. +The conversion is no longer necessary: +

+ +
    greeting = append(greeting, "world"...)
+ +

+Updating: +This is a new feature, so existing code needs no changes. +

+ +

Close

+ +

+The close predeclared function provides a mechanism +for a sender to signal that no more values will be sent. +It is important to the implementation of for range +loops over channels and is helpful in other situations. +Partly by design and partly because of race conditions that can occur otherwise, +it is intended for use only by the goroutine sending on the channel, +not by the goroutine receiving data. +However, before Go 1 there was no compile-time checking that close +was being used correctly. +

+ +

+To close this gap, at least in part, Go 1 disallows close on receive-only channels. +Attempting to close such a channel is a compile-time error. +

+ +
+    var c chan int
+    var csend chan<- int = c
+    var crecv <-chan int = c
+    close(c)     // legal
+    close(csend) // legal
+    close(crecv) // illegal
+
+ +

+Updating: +Existing code that attempts to close a receive-only channel was +erroneous even before Go 1 and should be fixed. The compiler will +now reject such code. +

+ +

Composite literals

+ +

+In Go 1, a composite literal of array, slice, or map type can elide the +type specification for the elements' initializers if they are of pointer type. +All four of the initializations in this example are legal; the last one was illegal before Go 1. +

+ +
    type Date struct {
+        month string
+        day   int
+    }
+    // Struct values, fully qualified; always legal.
+    holiday1 := []Date{
+        Date{"Feb", 14},
+        Date{"Nov", 11},
+        Date{"Dec", 25},
+    }
+    // Struct values, type name elided; always legal.
+    holiday2 := []Date{
+        {"Feb", 14},
+        {"Nov", 11},
+        {"Dec", 25},
+    }
+    // Pointers, fully qualified, always legal.
+    holiday3 := []*Date{
+        &Date{"Feb", 14},
+        &Date{"Nov", 11},
+        &Date{"Dec", 25},
+    }
+    // Pointers, type name elided; legal in Go 1.
+    holiday4 := []*Date{
+        {"Feb", 14},
+        {"Nov", 11},
+        {"Dec", 25},
+    }
+ +

+Updating: +This change has no effect on existing code, but the command +gofmt -s applied to existing source +will, among other things, elide explicit element types wherever permitted. +

+ + +

Goroutines during init

+ +

+The old language defined that go statements executed during initialization created goroutines but that they did not begin to run until initialization of the entire program was complete. +This introduced clumsiness in many places and, in effect, limited the utility +of the init construct: +if it was possible for another package to use the library during initialization, the library +was forced to avoid goroutines. +This design was done for reasons of simplicity and safety but, +as our confidence in the language grew, it seemed unnecessary. +Running goroutines during initialization is no more complex or unsafe than running them during normal execution. +

+ +

+In Go 1, code that uses goroutines can be called from +init routines and global initialization expressions +without introducing a deadlock. +

+ +
var PackageGlobal int
+
+func init() {
+    c := make(chan int)
+    go initializationFunction(c)
+    PackageGlobal = <-c
+}
+ +

+Updating: +This is a new feature, so existing code needs no changes, +although it's possible that code that depends on goroutines not starting before main will break. +There was no such code in the standard repository. +

+ +

The rune type

+ +

+The language spec allows the int type to be 32 or 64 bits wide, but current implementations set int to 32 bits even on 64-bit platforms. +It would be preferable to have int be 64 bits on 64-bit platforms. +(There are important consequences for indexing large slices.) +However, this change would waste space when processing Unicode characters with +the old language because the int type was also used to hold Unicode code points: each code point would waste an extra 32 bits of storage if int grew from 32 bits to 64. +

+ +

+To make changing to 64-bit int feasible, +Go 1 introduces a new basic type, rune, to represent +individual Unicode code points. +It is an alias for int32, analogous to byte +as an alias for uint8. +

+ +

+Character literals such as 'a', '語', and '\u0345' +now have default type rune, +analogous to 1.0 having default type float64. +A variable initialized to a character constant will therefore +have type rune unless otherwise specified. +

+ +

+Libraries have been updated to use rune rather than int +when appropriate. For instance, the functions unicode.ToLower and +relatives now take and return a rune. +

+ +
    delta := 'δ' // delta has type rune.
+    var DELTA rune
+    DELTA = unicode.ToUpper(delta)
+    epsilon := unicode.ToLower(DELTA + 1)
+    if epsilon != 'δ'+1 {
+        log.Fatal("inconsistent casing for Greek")
+    }
+ +

+Updating: +Most source code will be unaffected by this because the type inference from +:= initializers introduces the new type silently, and it propagates +from there. +Some code may get type errors that a trivial conversion will resolve. +

+ +

The error type

+ +

+Go 1 introduces a new built-in type, error, which has the following definition: +

+ +
+    type error interface {
+        Error() string
+    }
+
+ +

+Since the consequences of this type are all in the package library, +it is discussed below. +

+ +

Deleting from maps

+ +

+In the old language, to delete the entry with key k from map m, one wrote the statement, +

+ +
+    m[k] = value, false
+
+ +

+This syntax was a peculiar special case, the only two-to-one assignment. +It required passing a value (usually ignored) that is evaluated but discarded, +plus a boolean that was nearly always the constant false. +It did the job but was odd and a point of contention. +

+ +

+In Go 1, that syntax has gone; instead there is a new built-in +function, delete. The call +

+ +
    delete(m, k)
+ +

+will delete the map entry retrieved by the expression m[k]. +There is no return value. Deleting a non-existent entry is a no-op. +

+ +

+Updating: +Running go fix will convert expressions of the form m[k] = value, +false into delete(m, k) when it is clear that +the ignored value can be safely discarded from the program and +false refers to the predefined boolean constant. +The fix tool +will flag other uses of the syntax for inspection by the programmer. +

+ +

Iterating in maps

+ +

+The old language specification did not define the order of iteration for maps, +and in practice it differed across hardware platforms. +This caused tests that iterated over maps to be fragile and non-portable, with the +unpleasant property that a test might always pass on one machine but break on another. +

+ +

+In Go 1, the order in which elements are visited when iterating +over a map using a for range statement +is defined to be unpredictable, even if the same loop is run multiple +times with the same map. +Code should not assume that the elements are visited in any particular order. +

+ +

+This change means that code that depends on iteration order is very likely to break early and be fixed long before it becomes a problem. +Just as important, it allows the map implementation to ensure better map balancing even when programs are using range loops to select an element from a map. +

+ +
    m := map[string]int{"Sunday": 0, "Monday": 1}
+    for name, value := range m {
+        // This loop should not assume Sunday will be visited first.
+        f(name, value)
+    }
+ +

+Updating: +This is one change where tools cannot help. Most existing code +will be unaffected, but some programs may break or misbehave; we +recommend manual checking of all range statements over maps to +verify they do not depend on iteration order. There were a few such +examples in the standard repository; they have been fixed. +Note that it was already incorrect to depend on the iteration order, which +was unspecified. This change codifies the unpredictability. +

+ +

Multiple assignment

+ +

+The language specification has long guaranteed that in assignments +the right-hand-side expressions are all evaluated before any left-hand-side expressions are assigned. +To guarantee predictable behavior, +Go 1 refines the specification further. +

+ +

+If the left-hand side of the assignment +statement contains expressions that require evaluation, such as +function calls or array indexing operations, these will all be done +using the usual left-to-right rule before any variables are assigned +their value. Once everything is evaluated, the actual assignments +proceed in left-to-right order. +

+ +

+These examples illustrate the behavior. +

+ +
    sa := []int{1, 2, 3}
+    i := 0
+    i, sa[i] = 1, 2 // sets i = 1, sa[0] = 2
+
+    sb := []int{1, 2, 3}
+    j := 0
+    sb[j], j = 2, 1 // sets sb[0] = 2, j = 1
+
+    sc := []int{1, 2, 3}
+    sc[0], sc[0] = 1, 2 // sets sc[0] = 1, then sc[0] = 2 (so sc[0] = 2 at end)
+ +

+Updating: +This is one change where tools cannot help, but breakage is unlikely. +No code in the standard repository was broken by this change, and code +that depended on the previous unspecified behavior was already incorrect. +

+ +

Returns and shadowed variables

+ +

+A common mistake is to use return (without arguments) after an assignment to a variable that has the same name as a result variable but is not the same variable. +This situation is called shadowing: the result variable has been shadowed by another variable with the same name declared in an inner scope. +

+ +

+In functions with named return values, +the Go 1 compilers disallow return statements without arguments if any of the named return values is shadowed at the point of the return statement. +(It isn't part of the specification, because this is one area we are still exploring; +the situation is analogous to the compilers rejecting functions that do not end with an explicit return statement.) +

+ +

+This function implicitly returns a shadowed return value and will be rejected by the compiler: +

+ +
+    func Bug() (i, j, k int) {
+        for i = 0; i < 5; i++ {
+            for j := 0; j < 5; j++ { // Redeclares j.
+                k += i*j
+                if k > 100 {
+                    return // Rejected: j is shadowed here.
+                }
+            }
+        }
+        return // OK: j is not shadowed here.
+    }
+
+ +

+Updating: +Code that shadows return values in this way will be rejected by the compiler and will need to be fixed by hand. +The few cases that arose in the standard repository were mostly bugs. +

+ +

Copying structs with unexported fields

+ +

+The old language did not allow a package to make a copy of a struct value containing unexported fields belonging to a different package. +There was, however, a required exception for a method receiver; +also, the implementations of copy and append have never honored the restriction. +

+ +

+Go 1 will allow packages to copy struct values containing unexported fields from other packages. +Besides resolving the inconsistency, +this change admits a new kind of API: a package can return an opaque value without resorting to a pointer or interface. +The new implementations of time.Time and +reflect.Value are examples of types taking advantage of this new property. +

+ +

+As an example, if package p includes the definitions, +

+ +
+    type Struct struct {
+        Public int
+        secret int
+    }
+    func NewStruct(a int) Struct {  // Note: not a pointer.
+        return Struct{a, f(a)}
+    }
+    func (s Struct) String() string {
+        return fmt.Sprintf("{%d (secret %d)}", s.Public, s.secret)
+    }
+
+ +

+a package that imports p can assign and copy values of type +p.Struct at will. +Behind the scenes the unexported fields will be assigned and copied just +as if they were exported, +but the client code will never be aware of them. The code +

+ +
+    import "p"
+
+    myStruct := p.NewStruct(23)
+    copyOfMyStruct := myStruct
+    fmt.Println(myStruct, copyOfMyStruct)
+
+ +

+will show that the secret field of the struct has been copied to the new value. +

+ +

+Updating: +This is a new feature, so existing code needs no changes. +

+ +

Equality

+ +

+Before Go 1, the language did not define equality on struct and array values. +This meant, +among other things, that structs and arrays could not be used as map keys. +On the other hand, Go did define equality on function and map values. +Function equality was problematic in the presence of closures +(when are two closures equal?) +while map equality compared pointers, not the maps' content, which was usually +not what the user would want. +

+ +

+Go 1 addressed these issues. +First, structs and arrays can be compared for equality and inequality +(== and !=), +and therefore be used as map keys, +provided they are composed from elements for which equality is also defined, +using element-wise comparison. +

+ +
    type Day struct {
+        long  string
+        short string
+    }
+    Christmas := Day{"Christmas", "XMas"}
+    Thanksgiving := Day{"Thanksgiving", "Turkey"}
+    holiday := map[Day]bool{
+        Christmas:    true,
+        Thanksgiving: true,
+    }
+    fmt.Printf("Christmas is a holiday: %t\n", holiday[Christmas])
+ +

+Second, Go 1 removes the definition of equality for function values, +except for comparison with nil. +Finally, map equality is gone too, also except for comparison with nil. +

+ +

+Note that equality is still undefined for slices, for which the +calculation is in general infeasible. Also note that the ordered +comparison operators (< <= +> >=) are still undefined for +structs and arrays. + +

+Updating: +Struct and array equality is a new feature, so existing code needs no changes. +Existing code that depends on function or map equality will be +rejected by the compiler and will need to be fixed by hand. +Few programs will be affected, but the fix may require some +redesign. +

+ +

The package hierarchy

+ +

+Go 1 addresses many deficiencies in the old standard library and +cleans up a number of packages, making them more internally consistent +and portable. +

+ +

+This section describes how the packages have been rearranged in Go 1. +Some have moved, some have been renamed, some have been deleted. +New packages are described in later sections. +

+ +

The package hierarchy

+ +

+Go 1 has a rearranged package hierarchy that groups related items +into subdirectories. For instance, utf8 and +utf16 now occupy subdirectories of unicode. +Also, some packages have moved into +subrepositories of +code.google.com/p/go +while others have been deleted outright. +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Old pathNew path

asn1 encoding/asn1
csv encoding/csv
gob encoding/gob
json encoding/json
xml encoding/xml

exp/template/html html/template

big math/big
cmath math/cmplx
rand math/rand

http net/http
http/cgi net/http/cgi
http/fcgi net/http/fcgi
http/httptest net/http/httptest
http/pprof net/http/pprof
mail net/mail
rpc net/rpc
rpc/jsonrpc net/rpc/jsonrpc
smtp net/smtp
url net/url

exec os/exec

scanner text/scanner
tabwriter text/tabwriter
template text/template
template/parse text/template/parse

utf8 unicode/utf8
utf16 unicode/utf16
+ +

+Note that the package names for the old cmath and +exp/template/html packages have changed to cmplx +and template. +

+ +

+Updating: +Running go fix will update all imports and package renames for packages that +remain inside the standard repository. Programs that import packages +that are no longer in the standard repository will need to be edited +by hand. +

+ +

The package tree exp

+ +

+Because they are not standardized, the packages under the exp directory will not be available in the +standard Go 1 release distributions, although they will be available in source code form +in the repository for +developers who wish to use them. +

+ +

+Several packages have moved under exp at the time of Go 1's release: +

+ +
    +
  • ebnf
  • +
  • html
  • +
  • go/types
  • +
+ +

+(The EscapeString and UnescapeString types remain +in package html.) +

+ +

+All these packages are available under the same names, with the prefix exp/: exp/ebnf etc. +

+ +

+Also, the utf8.String type has been moved to its own package, exp/utf8string. +

+ +

+Finally, the gotype command now resides in exp/gotype, while +ebnflint is now in exp/ebnflint. +If they are installed, they now reside in $GOROOT/bin/tool. +

+ +

+Updating: +Code that uses packages in exp will need to be updated by hand, +or else compiled from an installation that has exp available. +The go fix tool or the compiler will complain about such uses. +

+ +

The package tree old

+ +

+Because they are deprecated, the packages under the old directory will not be available in the +standard Go 1 release distributions, although they will be available in source code form for +developers who wish to use them. +

+ +

+The packages in their new locations are: +

+ +
    +
  • old/netchan
  • +
  • old/regexp
  • +
  • old/template
  • +
+ +

+Updating: +Code that uses packages now in old will need to be updated by hand, +or else compiled from an installation that has old available. +The go fix tool will warn about such uses. +

+ +

Deleted packages

+ +

+Go 1 deletes several packages outright: +

+ +
    +
  • container/vector
  • +
  • exp/datafmt
  • +
  • go/typechecker
  • +
  • try
  • +
+ +

+and also the command gotry. +

+ +

+Updating: +Code that uses container/vector should be updated to use +slices directly. See +the Go +Language Community Wiki for some suggestions. +Code that uses the other packages (there should be almost zero) will need to be rethought. +

+ +

Packages moving to subrepositories

+ +

+Go 1 has moved a number of packages into other repositories, usually sub-repositories of +the main Go repository. +This table lists the old and new import paths: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OldNew

crypto/bcrypt code.google.com/p/go.crypto/bcrypt
crypto/blowfish code.google.com/p/go.crypto/blowfish
crypto/cast5 code.google.com/p/go.crypto/cast5
crypto/md4 code.google.com/p/go.crypto/md4
crypto/ocsp code.google.com/p/go.crypto/ocsp
crypto/openpgp code.google.com/p/go.crypto/openpgp
crypto/openpgp/armor code.google.com/p/go.crypto/openpgp/armor
crypto/openpgp/elgamal code.google.com/p/go.crypto/openpgp/elgamal
crypto/openpgp/errors code.google.com/p/go.crypto/openpgp/errors
crypto/openpgp/packet code.google.com/p/go.crypto/openpgp/packet
crypto/openpgp/s2k code.google.com/p/go.crypto/openpgp/s2k
crypto/ripemd160 code.google.com/p/go.crypto/ripemd160
crypto/twofish code.google.com/p/go.crypto/twofish
crypto/xtea code.google.com/p/go.crypto/xtea
exp/ssh code.google.com/p/go.crypto/ssh

image/bmp code.google.com/p/go.image/bmp
image/tiff code.google.com/p/go.image/tiff

net/dict code.google.com/p/go.net/dict
net/websocket code.google.com/p/go.net/websocket
exp/spdy code.google.com/p/go.net/spdy

encoding/git85 code.google.com/p/go.codereview/git85
patch code.google.com/p/go.codereview/patch

exp/wingui code.google.com/p/gowingui
+ +

+Updating: +Running go fix will update imports of these packages to use the new import paths. +Installations that depend on these packages will need to install them using +a go get command. +

+ +

Major changes to the library

+ +

+This section describes significant changes to the core libraries, the ones that +affect the most programs. +

+ +

The error type and errors package

+ +

+The placement of os.Error in package os is mostly historical: errors first came up when implementing package os, and they seemed system-related at the time. +Since then it has become clear that errors are more fundamental than the operating system. For example, it would be nice to use Errors in packages that os depends on, like syscall. +Also, having Error in os introduces many dependencies on os that would otherwise not exist. +

+ +

+Go 1 solves these problems by introducing a built-in error interface type and a separate errors package (analogous to bytes and strings) that contains utility functions. +It replaces os.NewError with +errors.New, +giving errors a more central place in the environment. +

+ +

+So the widely-used String method does not cause accidental satisfaction +of the error interface, the error interface uses instead +the name Error for that method: +

+ +
+    type error interface {
+        Error() string
+    }
+
+ +

+The fmt library automatically invokes Error, as it already +does for String, for easy printing of error values. +

+ +
type SyntaxError struct {
+    File    string
+    Line    int
+    Message string
+}
+
+func (se *SyntaxError) Error() string {
+    return fmt.Sprintf("%s:%d: %s", se.File, se.Line, se.Message)
+}
+ +

+All standard packages have been updated to use the new interface; the old os.Error is gone. +

+ +

+A new package, errors, contains the function +

+ +
+func New(text string) error
+
+ +

+to turn a string into an error. It replaces the old os.NewError. +

+ +
    var ErrSyntax = errors.New("syntax error")
+ +

+Updating: +Running go fix will update almost all code affected by the change. +Code that defines error types with a String method will need to be updated +by hand to rename the methods to Error. +

+ +

System call errors

+ +

+The old syscall package, which predated os.Error +(and just about everything else), +returned errors as int values. +In turn, the os package forwarded many of these errors, such +as EINVAL, but using a different set of errors on each platform. +This behavior was unpleasant and unportable. +

+ +

+In Go 1, the +syscall +package instead returns an error for system call errors. +On Unix, the implementation is done by a +syscall.Errno type +that satisfies error and replaces the old os.Errno. +

+ +

+The changes affecting os.EINVAL and relatives are +described elsewhere. + +

+Updating: +Running go fix will update almost all code affected by the change. +Regardless, most code should use the os package +rather than syscall and so will be unaffected. +

+ +

Time

+ +

+Time is always a challenge to support well in a programming language. +The old Go time package had int64 units, no +real type safety, +and no distinction between absolute times and durations. +

+ +

+One of the most sweeping changes in the Go 1 library is therefore a +complete redesign of the +time package. +Instead of an integer number of nanoseconds as an int64, +and a separate *time.Time type to deal with human +units such as hours and years, +there are now two fundamental types: +time.Time +(a value, so the * is gone), which represents a moment in time; +and time.Duration, +which represents an interval. +Both have nanosecond resolution. +A Time can represent any time into the ancient +past and remote future, while a Duration can +span plus or minus only about 290 years. +There are methods on these types, plus a number of helpful +predefined constant durations such as time.Second. +

+ +

+Among the new methods are things like +Time.Add, +which adds a Duration to a Time, and +Time.Sub, +which subtracts two Times to yield a Duration. +

+ +

+The most important semantic change is that the Unix epoch (Jan 1, 1970) is now +relevant only for those functions and methods that mention Unix: +time.Unix +and the Unix +and UnixNano methods +of the Time type. +In particular, +time.Now +returns a time.Time value rather than, in the old +API, an integer nanosecond count since the Unix epoch. +

+ +
// sleepUntil sleeps until the specified time. It returns immediately if it's too late.
+func sleepUntil(wakeup time.Time) {
+    now := time.Now() // A Time.
+    if !wakeup.After(now) {
+        return
+    }
+    delta := wakeup.Sub(now) // A Duration.
+    fmt.Printf("Sleeping for %.3fs\n", delta.Seconds())
+    time.Sleep(delta)
+}
+ +

+The new types, methods, and constants have been propagated through +all the standard packages that use time, such as os and +its representation of file time stamps. +

+ +

+Updating: +The go fix tool will update many uses of the old time package to use the new +types and methods, although it does not replace values such as 1e9 +representing nanoseconds per second. +Also, because of type changes in some of the values that arise, +some of the expressions rewritten by the fix tool may require +further hand editing; in such cases the rewrite will include +the correct function or method for the old functionality, but +may have the wrong type or require further analysis. +

+ +

Minor changes to the library

+ +

+This section describes smaller changes, such as those to less commonly +used packages or that affect +few programs beyond the need to run go fix. +This category includes packages that are new in Go 1. +Collectively they improve portability, regularize behavior, and +make the interfaces more modern and Go-like. +

+ +

The archive/zip package

+ +

+In Go 1, *zip.Writer no +longer has a Write method. Its presence was a mistake. +

+ +

+Updating: +What little code is affected will be caught by the compiler and must be updated by hand. +

+ +

The bufio package

+ +

+In Go 1, bufio.NewReaderSize +and +bufio.NewWriterSize +functions no longer return an error for invalid sizes. +If the argument size is too small or invalid, it is adjusted. +

+ +

+Updating: +Running go fix will update calls that assign the error to _. +Calls that aren't fixed will be caught by the compiler and must be updated by hand. +

+ +

The compress/flate, compress/gzip and compress/zlib packages

+ +

+In Go 1, the NewWriterXxx functions in +compress/flate, +compress/gzip and +compress/zlib +all return (*Writer, error) if they take a compression level, +and *Writer otherwise. Package gzip's +Compressor and Decompressor types have been renamed +to Writer and Reader. Package flate's +WrongValueError type has been removed. +

+ +

+Updating +Running go fix will update old names and calls that assign the error to _. +Calls that aren't fixed will be caught by the compiler and must be updated by hand. +

+ +

The crypto/aes and crypto/des packages

+ +

+In Go 1, the Reset method has been removed. Go does not guarantee +that memory is not copied and therefore this method was misleading. +

+ +

+The cipher-specific types *aes.Cipher, *des.Cipher, +and *des.TripleDESCipher have been removed in favor of +cipher.Block. +

+ +

+Updating: +Remove the calls to Reset. Replace uses of the specific cipher types with +cipher.Block. +

+ +

The crypto/elliptic package

+ +

+In Go 1, elliptic.Curve +has been made an interface to permit alternative implementations. The curve +parameters have been moved to the +elliptic.CurveParams +structure. +

+ +

+Updating: +Existing users of *elliptic.Curve will need to change to +simply elliptic.Curve. Calls to Marshal, +Unmarshal and GenerateKey are now functions +in crypto/elliptic that take an elliptic.Curve +as their first argument. +

+ +

The crypto/hmac package

+ +

+In Go 1, the hash-specific functions, such as hmac.NewMD5, have +been removed from crypto/hmac. Instead, hmac.New takes +a function that returns a hash.Hash, such as md5.New. +

+ +

+Updating: +Running go fix will perform the needed changes. +

+ +

The crypto/x509 package

+ +

+In Go 1, the +CreateCertificate +and +CreateCRL +functions in crypto/x509 have been altered to take an +interface{} where they previously took a *rsa.PublicKey +or *rsa.PrivateKey. This will allow other public key algorithms +to be implemented in the future. +

+ +

+Updating: +No changes will be needed. +

+ +

The encoding/binary package

+ +

+In Go 1, the binary.TotalSize function has been replaced by +Size, +which takes an interface{} argument rather than +a reflect.Value. +

+ +

+Updating: +What little code is affected will be caught by the compiler and must be updated by hand. +

+ +

The encoding/xml package

+ +

+In Go 1, the xml package +has been brought closer in design to the other marshaling packages such +as encoding/gob. +

+ +

+The old Parser type is renamed +Decoder and has a new +Decode method. An +Encoder type was also introduced. +

+ +

+The functions Marshal +and Unmarshal +work with []byte values now. To work with streams, +use the new Encoder +and Decoder types. +

+ +

+When marshaling or unmarshaling values, the format of supported flags in +field tags has changed to be closer to the +json package +(`xml:"name,flag"`). The matching done between field tags, field +names, and the XML attribute and element names is now case-sensitive. +The XMLName field tag, if present, must also match the name +of the XML element being marshaled. +

+ +

+Updating: +Running go fix will update most uses of the package except for some calls to +Unmarshal. Special care must be taken with field tags, +since the fix tool will not update them and if not fixed by hand they will +misbehave silently in some cases. For example, the old +"attr" is now written ",attr" while plain +"attr" remains valid but with a different meaning. +

+ +

The expvar package

+ +

+In Go 1, the RemoveAll function has been removed. +The Iter function and Iter method on *Map have +been replaced by +Do +and +(*Map).Do. +

+ +

+Updating: +Most code using expvar will not need changing. The rare code that used +Iter can be updated to pass a closure to Do to achieve the same effect. +

+ +

The flag package

+ +

+In Go 1, the interface flag.Value has changed slightly. +The Set method now returns an error instead of +a bool to indicate success or failure. +

+ +

+There is also a new kind of flag, Duration, to support argument +values specifying time intervals. +Values for such flags must be given units, just as time.Duration +formats them: 10s, 1h30m, etc. +

+ +
var timeout = flag.Duration("timeout", 30*time.Second, "how long to wait for completion")
+ +

+Updating: +Programs that implement their own flags will need minor manual fixes to update their +Set methods. +The Duration flag is new and affects no existing code. +

+ + +

The go/* packages

+ +

+Several packages under go have slightly revised APIs. +

+ +

+A concrete Mode type was introduced for configuration mode flags +in the packages +go/scanner, +go/parser, +go/printer, and +go/doc. +

+ +

+The modes AllowIllegalChars and InsertSemis have been removed +from the go/scanner package. They were mostly +useful for scanning text other then Go source files. Instead, the +text/scanner package should be used +for that purpose. +

+ +

+The ErrorHandler provided +to the scanner's Init method is +now simply a function rather than an interface. The ErrorVector type has +been removed in favor of the (existing) ErrorList +type, and the ErrorVector methods have been migrated. Instead of embedding +an ErrorVector in a client of the scanner, now a client should maintain +an ErrorList. +

+ +

+The set of parse functions provided by the go/parser +package has been reduced to the primary parse function +ParseFile, and a couple of +convenience functions ParseDir +and ParseExpr. +

+ +

+The go/printer package supports an additional +configuration mode SourcePos; +if set, the printer will emit //line comments such that the generated +output contains the original source code position information. The new type +CommentedNode can be +used to provide comments associated with an arbitrary +ast.Node (until now only +ast.File carried comment information). +

+ +

+The type names of the go/doc package have been +streamlined by removing the Doc suffix: PackageDoc +is now Package, ValueDoc is Value, etc. +Also, all types now consistently have a Name field (or Names, +in the case of type Value) and Type.Factories has become +Type.Funcs. +Instead of calling doc.NewPackageDoc(pkg, importpath), +documentation for a package is created with: +

+ +
+    doc.New(pkg, importpath, mode)
+
+ +

+where the new mode parameter specifies the operation mode: +if set to AllDecls, all declarations +(not just exported ones) are considered. +The function NewFileDoc was removed, and the function +CommentText has become the method +Text of +ast.CommentGroup. +

+ +

+In package go/token, the +token.FileSet method Files +(which originally returned a channel of *token.Files) has been replaced +with the iterator Iterate that +accepts a function argument instead. +

+ +

+In package go/build, the API +has been nearly completely replaced. +The package still computes Go package information +but it does not run the build: the Cmd and Script +types are gone. +(To build code, use the new +go command instead.) +The DirInfo type is now named +Package. +FindTree and ScanDir are replaced by +Import +and +ImportDir. +

+ +

+Updating: +Code that uses packages in go will have to be updated by hand; the +compiler will reject incorrect uses. Templates used in conjunction with any of the +go/doc types may need manual fixes; the renamed fields will lead +to run-time errors. +

+ +

The hash package

+ +

+In Go 1, the definition of hash.Hash includes +a new method, BlockSize. This new method is used primarily in the +cryptographic libraries. +

+ +

+The Sum method of the +hash.Hash interface now takes a +[]byte argument, to which the hash value will be appended. +The previous behavior can be recreated by adding a nil argument to the call. +

+ +

+Updating: +Existing implementations of hash.Hash will need to add a +BlockSize method. Hashes that process the input one byte at +a time can implement BlockSize to return 1. +Running go fix will update calls to the Sum methods of the various +implementations of hash.Hash. +

+ +

+Updating: +Since the package's functionality is new, no updating is necessary. +

+ +

The http package

+ +

+In Go 1 the http package is refactored, +putting some of the utilities into a +httputil subdirectory. +These pieces are only rarely needed by HTTP clients. +The affected items are: +

+ +
    +
  • ClientConn
  • +
  • DumpRequest
  • +
  • DumpRequestOut
  • +
  • DumpResponse
  • +
  • NewChunkedReader
  • +
  • NewChunkedWriter
  • +
  • NewClientConn
  • +
  • NewProxyClientConn
  • +
  • NewServerConn
  • +
  • NewSingleHostReverseProxy
  • +
  • ReverseProxy
  • +
  • ServerConn
  • +
+ +

+The Request.RawURL field has been removed; it was a +historical artifact. +

+ +

+The Handle and HandleFunc +functions, and the similarly-named methods of ServeMux, +now panic if an attempt is made to register the same pattern twice. +

+ +

+Updating: +Running go fix will update the few programs that are affected except for +uses of RawURL, which must be fixed by hand. +

+ +

The image package

+ +

+The image package has had a number of +minor changes, rearrangements and renamings. +

+ +

+Most of the color handling code has been moved into its own package, +image/color. +For the elements that moved, a symmetry arises; for instance, +each pixel of an +image.RGBA +is a +color.RGBA. +

+ +

+The old image/ycbcr package has been folded, with some +renamings, into the +image +and +image/color +packages. +

+ +

+The old image.ColorImage type is still in the image +package but has been renamed +image.Uniform, +while image.Tiled has been removed. +

+ +

+This table lists the renamings. +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OldNew

image.Color color.Color
image.ColorModel color.Model
image.ColorModelFunc color.ModelFunc
image.PalettedColorModel color.Palette

image.RGBAColor color.RGBA
image.RGBA64Color color.RGBA64
image.NRGBAColor color.NRGBA
image.NRGBA64Color color.NRGBA64
image.AlphaColor color.Alpha
image.Alpha16Color color.Alpha16
image.GrayColor color.Gray
image.Gray16Color color.Gray16

image.RGBAColorModel color.RGBAModel
image.RGBA64ColorModel color.RGBA64Model
image.NRGBAColorModel color.NRGBAModel
image.NRGBA64ColorModel color.NRGBA64Model
image.AlphaColorModel color.AlphaModel
image.Alpha16ColorModel color.Alpha16Model
image.GrayColorModel color.GrayModel
image.Gray16ColorModel color.Gray16Model

ycbcr.RGBToYCbCr color.RGBToYCbCr
ycbcr.YCbCrToRGB color.YCbCrToRGB
ycbcr.YCbCrColorModel color.YCbCrModel
ycbcr.YCbCrColor color.YCbCr
ycbcr.YCbCr image.YCbCr

ycbcr.SubsampleRatio444 image.YCbCrSubsampleRatio444
ycbcr.SubsampleRatio422 image.YCbCrSubsampleRatio422
ycbcr.SubsampleRatio420 image.YCbCrSubsampleRatio420

image.ColorImage image.Uniform
+ +

+The image package's New functions +(NewRGBA, +NewRGBA64, etc.) +take an image.Rectangle as an argument +instead of four integers. +

+ +

+Finally, there are new predefined color.Color variables +color.Black, +color.White, +color.Opaque +and +color.Transparent. +

+ +

+Updating: +Running go fix will update almost all code affected by the change. +

+ +

The log/syslog package

+ +

+In Go 1, the syslog.NewLogger +function returns an error as well as a log.Logger. +

+ +

+Updating: +What little code is affected will be caught by the compiler and must be updated by hand. +

+ +

The mime package

+ +

+In Go 1, the FormatMediaType function +of the mime package has been simplified to make it +consistent with +ParseMediaType. +It now takes "text/html" rather than "text" and "html". +

+ +

+Updating: +What little code is affected will be caught by the compiler and must be updated by hand. +

+ +

The net package

+ +

+In Go 1, the various SetTimeout, +SetReadTimeout, and SetWriteTimeout methods +have been replaced with +SetDeadline, +SetReadDeadline, and +SetWriteDeadline, +respectively. Rather than taking a timeout value in nanoseconds that +apply to any activity on the connection, the new methods set an +absolute deadline (as a time.Time value) after which +reads and writes will time out and no longer block. +

+ +

+There are also new functions +net.DialTimeout +to simplify timing out dialing a network address and +net.ListenMulticastUDP +to allow multicast UDP to listen concurrently across multiple listeners. +The net.ListenMulticastUDP function replaces the old +JoinGroup and LeaveGroup methods. +

+ +

+Updating: +Code that uses the old methods will fail to compile and must be updated by hand. +The semantic change makes it difficult for the fix tool to update automatically. +

+ +

The os package

+ +

+The Time function has been removed; callers should use +the Time type from the +time package. +

+ +

+The Exec function has been removed; callers should use +Exec from the syscall package, where available. +

+ +

+The ShellExpand function has been renamed to ExpandEnv. +

+ +

+The NewFile function +now takes a uintptr fd, instead of an int. +The Fd method on files now +also returns a uintptr. +

+ +

+There are no longer error constants such as EINVAL +in the os package, since the set of values varied with +the underlying operating system. There are new portable functions like +IsPermission +to test common error properties, plus a few new error values +with more Go-like names, such as +ErrPermission +and +ErrNoEnv. +

+ +

+The Getenverror function has been removed. To distinguish +between a non-existent environment variable and an empty string, +use os.Environ or +syscall.Getenv. +

+ + +

+The Process.Wait method has +dropped its option argument and the associated constants are gone +from the package. +Also, the function Wait is gone; only the method of +the Process type persists. +

+ +

+The Waitmsg type returned by +Process.Wait +has been replaced with a more portable +ProcessState +type with accessor methods to recover information about the +process. +Because of changes to Wait, the ProcessState +value always describes an exited process. +Portability concerns simplified the interface in other ways, but the values returned by the +ProcessState.Sys and +ProcessState.SysUsage +methods can be type-asserted to underlying system-specific data structures such as +syscall.WaitStatus and +syscall.Rusage on Unix. +

+ +

+Updating: +Running go fix will drop a zero argument to Process.Wait. +All other changes will be caught by the compiler and must be updated by hand. +

+ +

The os.FileInfo type

+ +

+Go 1 redefines the os.FileInfo type, +changing it from a struct to an interface: +

+ +
+    type FileInfo interface {
+        Name() string       // base name of the file
+        Size() int64        // length in bytes
+        Mode() FileMode     // file mode bits
+        ModTime() time.Time // modification time
+        IsDir() bool        // abbreviation for Mode().IsDir()
+        Sys() interface{}   // underlying data source (can return nil)
+    }
+
+ +

+The file mode information has been moved into a subtype called +os.FileMode, +a simple integer type with IsDir, Perm, and String +methods. +

+ +

+The system-specific details of file modes and properties such as (on Unix) +i-number have been removed from FileInfo altogether. +Instead, each operating system's os package provides an +implementation of the FileInfo interface, which +has a Sys method that returns the +system-specific representation of file metadata. +For instance, to discover the i-number of a file on a Unix system, unpack +the FileInfo like this: +

+ +
+    fi, err := os.Stat("hello.go")
+    if err != nil {
+        log.Fatal(err)
+    }
+    // Check that it's a Unix file.
+    unixStat, ok := fi.Sys().(*syscall.Stat_t)
+    if !ok {
+        log.Fatal("hello.go: not a Unix file")
+    }
+    fmt.Printf("file i-number: %d\n", unixStat.Ino)
+
+ +

+Assuming (which is unwise) that "hello.go" is a Unix file, +the i-number expression could be contracted to +

+ +
+    fi.Sys().(*syscall.Stat_t).Ino
+
+ +

+The vast majority of uses of FileInfo need only the methods +of the standard interface. +

+ +

+The os package no longer contains wrappers for the POSIX errors +such as ENOENT. +For the few programs that need to verify particular error conditions, there are +now the boolean functions +IsExist, +IsNotExist +and +IsPermission. +

+ +
    f, err := os.OpenFile(name, os.O_RDWR|os.O_CREATE|os.O_EXCL, 0600)
+    if os.IsExist(err) {
+        log.Printf("%s already exists", name)
+    }
+ +

+Updating: +Running go fix will update code that uses the old equivalent of the current os.FileInfo +and os.FileMode API. +Code that needs system-specific file details will need to be updated by hand. +Code that uses the old POSIX error values from the os package +will fail to compile and will also need to be updated by hand. +

+ +

The os/signal package

+ +

+The os/signal package in Go 1 replaces the +Incoming function, which returned a channel +that received all incoming signals, +with the selective Notify function, which asks +for delivery of specific signals on an existing channel. +

+ +

+Updating: +Code must be updated by hand. +A literal translation of +

+
+c := signal.Incoming()
+
+

+is +

+
+c := make(chan os.Signal)
+signal.Notify(c) // ask for all signals
+
+

+but most code should list the specific signals it wants to handle instead: +

+
+c := make(chan os.Signal)
+signal.Notify(c, syscall.SIGHUP, syscall.SIGQUIT)
+
+ +

The path/filepath package

+ +

+In Go 1, the Walk function of the +path/filepath package +has been changed to take a function value of type +WalkFunc +instead of a Visitor interface value. +WalkFunc unifies the handling of both files and directories. +

+ +
+    type WalkFunc func(path string, info os.FileInfo, err error) error
+
+ +

+The WalkFunc function will be called even for files or directories that could not be opened; +in such cases the error argument will describe the failure. +If a directory's contents are to be skipped, +the function should return the value filepath.SkipDir +

+ +
    markFn := func(path string, info os.FileInfo, err error) error {
+        if path == "pictures" { // Will skip walking of directory pictures and its contents.
+            return filepath.SkipDir
+        }
+        if err != nil {
+            return err
+        }
+        log.Println(path)
+        return nil
+    }
+    err := filepath.Walk(".", markFn)
+    if err != nil {
+        log.Fatal(err)
+    }
+ +

+Updating: +The change simplifies most code but has subtle consequences, so affected programs +will need to be updated by hand. +The compiler will catch code using the old interface. +

+ +

The regexp package

+ +

+The regexp package has been rewritten. +It has the same interface but the specification of the regular expressions +it supports has changed from the old "egrep" form to that of +RE2. +

+ +

+Updating: +Code that uses the package should have its regular expressions checked by hand. +

+ +

The runtime package

+ +

+In Go 1, much of the API exported by package +runtime has been removed in favor of +functionality provided by other packages. +Code using the runtime.Type interface +or its specific concrete type implementations should +now use package reflect. +Code using runtime.Semacquire or runtime.Semrelease +should use channels or the abstractions in package sync. +The runtime.Alloc, runtime.Free, +and runtime.Lookup functions, an unsafe API created for +debugging the memory allocator, have no replacement. +

+ +

+Before, runtime.MemStats was a global variable holding +statistics about memory allocation, and calls to runtime.UpdateMemStats +ensured that it was up to date. +In Go 1, runtime.MemStats is a struct type, and code should use +runtime.ReadMemStats +to obtain the current statistics. +

+ +

+The package adds a new function, +runtime.NumCPU, that returns the number of CPUs available +for parallel execution, as reported by the operating system kernel. +Its value can inform the setting of GOMAXPROCS. +The runtime.Cgocalls and runtime.Goroutines functions +have been renamed to runtime.NumCgoCall and runtime.NumGoroutine. +

+ +

+Updating: +Running go fix will update code for the function renamings. +Other code will need to be updated by hand. +

+ +

The strconv package

+ +

+In Go 1, the +strconv +package has been significantly reworked to make it more Go-like and less C-like, +although Atoi lives on (it's similar to +int(ParseInt(x, 10, 0)), as does +Itoa(x) (FormatInt(int64(x), 10)). +There are also new variants of some of the functions that append to byte slices rather than +return strings, to allow control over allocation. +

+ +

+This table summarizes the renamings; see the +package documentation +for full details. +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Old callNew call

Atob(x) ParseBool(x)

Atof32(x) ParseFloat(x, 32)§
Atof64(x) ParseFloat(x, 64)
AtofN(x, n) ParseFloat(x, n)

Atoi(x) Atoi(x)
Atoi(x) ParseInt(x, 10, 0)§
Atoi64(x) ParseInt(x, 10, 64)

Atoui(x) ParseUint(x, 10, 0)§
Atoui64(x) ParseUint(x, 10, 64)

Btoi64(x, b) ParseInt(x, b, 64)
Btoui64(x, b) ParseUint(x, b, 64)

Btoa(x) FormatBool(x)

Ftoa32(x, f, p) FormatFloat(float64(x), f, p, 32)
Ftoa64(x, f, p) FormatFloat(x, f, p, 64)
FtoaN(x, f, p, n) FormatFloat(x, f, p, n)

Itoa(x) Itoa(x)
Itoa(x) FormatInt(int64(x), 10)
Itoa64(x) FormatInt(x, 10)

Itob(x, b) FormatInt(int64(x), b)
Itob64(x, b) FormatInt(x, b)

Uitoa(x) FormatUint(uint64(x), 10)
Uitoa64(x) FormatUint(x, 10)

Uitob(x, b) FormatUint(uint64(x), b)
Uitob64(x, b) FormatUint(x, b)
+ +

+Updating: +Running go fix will update almost all code affected by the change. +
Atoi persists but Atoui and Atof32 do not, so +they may require +a cast that must be added by hand; the go fix tool will warn about it. +

+ + +

The template packages

+ +

+The template and exp/template/html packages have moved to +text/template and +html/template. +More significant, the interface to these packages has been simplified. +The template language is the same, but the concept of "template set" is gone +and the functions and methods of the packages have changed accordingly, +often by elimination. +

+ +

+Instead of sets, a Template object +may contain multiple named template definitions, +in effect constructing +name spaces for template invocation. +A template can invoke any other template associated with it, but only those +templates associated with it. +The simplest way to associate templates is to parse them together, something +made easier with the new structure of the packages. +

+ +

+Updating: +The imports will be updated by fix tool. +Single-template uses will be otherwise be largely unaffected. +Code that uses multiple templates in concert will need to be updated by hand. +The examples in +the documentation for text/template can provide guidance. +

+ +

The testing package

+ +

+The testing package has a type, B, passed as an argument to benchmark functions. +In Go 1, B has new methods, analogous to those of T, enabling +logging and failure reporting. +

+ +
func BenchmarkSprintf(b *testing.B) {
+    // Verify correctness before running benchmark.
+    b.StopTimer()
+    got := fmt.Sprintf("%x", 23)
+    const expect = "17"
+    if expect != got {
+        b.Fatalf("expected %q; got %q", expect, got)
+    }
+    b.StartTimer()
+    for i := 0; i < b.N; i++ {
+        fmt.Sprintf("%x", 23)
+    }
+}
+ +

+Updating: +Existing code is unaffected, although benchmarks that use println +or panic should be updated to use the new methods. +

+ +

The testing/script package

+ +

+The testing/script package has been deleted. It was a dreg. +

+ +

+Updating: +No code is likely to be affected. +

+ +

The unsafe package

+ +

+In Go 1, the functions +unsafe.Typeof, unsafe.Reflect, +unsafe.Unreflect, unsafe.New, and +unsafe.NewArray have been removed; +they duplicated safer functionality provided by +package reflect. +

+ +

+Updating: +Code using these functions must be rewritten to use +package reflect. +The changes to encoding/gob and the protocol buffer library +may be helpful as examples. +

+ +

The url package

+ +

+In Go 1 several fields from the url.URL type +were removed or replaced. +

+ +

+The String method now +predictably rebuilds an encoded URL string using all of URL's +fields as necessary. The resulting string will also no longer have +passwords escaped. +

+ +

+The Raw field has been removed. In most cases the String +method may be used in its place. +

+ +

+The old RawUserinfo field is replaced by the User +field, of type *net.Userinfo. +Values of this type may be created using the new net.User +and net.UserPassword +functions. The EscapeUserinfo and UnescapeUserinfo +functions are also gone. +

+ +

+The RawAuthority field has been removed. The same information is +available in the Host and User fields. +

+ +

+The RawPath field and the EncodedPath method have +been removed. The path information in rooted URLs (with a slash following the +schema) is now available only in decoded form in the Path field. +Occasionally, the encoded data may be required to obtain information that +was lost in the decoding process. These cases must be handled by accessing +the data the URL was built from. +

+ +

+URLs with non-rooted paths, such as "mailto:dev@golang.org?subject=Hi", +are also handled differently. The OpaquePath boolean field has been +removed and a new Opaque string field introduced to hold the encoded +path for such URLs. In Go 1, the cited URL parses as: +

+ +
+    URL{
+        Scheme: "mailto",
+        Opaque: "dev@golang.org",
+        RawQuery: "subject=Hi",
+    }
+
+ +

+A new RequestURI method was +added to URL. +

+ +

+The ParseWithReference function has been renamed to ParseWithFragment. +

+ +

+Updating: +Code that uses the old fields will fail to compile and must be updated by hand. +The semantic changes make it difficult for the fix tool to update automatically. +

+ +

The go command

+ +

+Go 1 introduces the go command, a tool for fetching, +building, and installing Go packages and commands. The go command +does away with makefiles, instead using Go source code to find dependencies and +determine build conditions. Most existing Go programs will no longer require +makefiles to be built. +

+ +

+See How to Write Go Code for a primer on the +go command and the go command documentation +for the full details. +

+ +

+Updating: +Projects that depend on the Go project's old makefile-based build +infrastructure (Make.pkg, Make.cmd, and so on) should +switch to using the go command for building Go code and, if +necessary, rewrite their makefiles to perform any auxiliary build tasks. +

+ +

The cgo command

+ +

+In Go 1, the cgo command +uses a different _cgo_export.h +file, which is generated for packages containing //export lines. +The _cgo_export.h file now begins with the C preamble comment, +so that exported function definitions can use types defined there. +This has the effect of compiling the preamble multiple times, so a +package using //export must not put function definitions +or variable initializations in the C preamble. +

+ +

Packaged releases

+ +

+One of the most significant changes associated with Go 1 is the availability +of prepackaged, downloadable distributions. +They are available for many combinations of architecture and operating system +(including Windows) and the list will grow. +Installation details are described on the +Getting Started page, while +the distributions themselves are listed on the +downloads page. + + +

+ + + + + + + + diff --git a/Godeps/_workspace/src/golang.org/x/net/html/testdata/webkit/README b/Godeps/_workspace/src/golang.org/x/net/html/testdata/webkit/README new file mode 100644 index 000000000000..9b4c2d8be0a2 --- /dev/null +++ b/Godeps/_workspace/src/golang.org/x/net/html/testdata/webkit/README @@ -0,0 +1,28 @@ +The *.dat files in this directory are copied from The WebKit Open Source +Project, specifically $WEBKITROOT/LayoutTests/html5lib/resources. +WebKit is licensed under a BSD style license. +http://webkit.org/coding/bsd-license.html says: + +Copyright (C) 2009 Apple 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: + +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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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/Godeps/_workspace/src/golang.org/x/net/html/testdata/webkit/adoption01.dat b/Godeps/_workspace/src/golang.org/x/net/html/testdata/webkit/adoption01.dat new file mode 100644 index 000000000000..787e1b01e193 --- /dev/null +++ b/Godeps/_workspace/src/golang.org/x/net/html/testdata/webkit/adoption01.dat @@ -0,0 +1,194 @@ +#data +

+#errors +#document +| +| +| +| +|

+| + +#data +1

23

+#errors +#document +| +| +| +| +| "1" +|

+| +| "2" +| "3" + +#data +1 +#errors +#document +| +| +| +| +| "1" +| +#errors +Line: 1 Col: 7 Unexpected start tag (table). Expected DOCTYPE. +Line: 1 Col: 20 Unexpected end tag (strong) in table context caused voodoo mode. +Line: 1 Col: 20 End tag (strong) violates step 1, paragraph 1 of the adoption agency algorithm. +Line: 1 Col: 24 Unexpected end tag (b) in table context caused voodoo mode. +Line: 1 Col: 24 End tag (b) violates step 1, paragraph 1 of the adoption agency algorithm. +Line: 1 Col: 29 Unexpected end tag (em) in table context caused voodoo mode. +Line: 1 Col: 29 End tag (em) violates step 1, paragraph 1 of the adoption agency algorithm. +Line: 1 Col: 33 Unexpected end tag (i) in table context caused voodoo mode. +Line: 1 Col: 33 End tag (i) violates step 1, paragraph 1 of the adoption agency algorithm. +Line: 1 Col: 37 Unexpected end tag (u) in table context caused voodoo mode. +Line: 1 Col: 37 End tag (u) violates step 1, paragraph 1 of the adoption agency algorithm. +Line: 1 Col: 46 Unexpected end tag (strike) in table context caused voodoo mode. +Line: 1 Col: 46 End tag (strike) violates step 1, paragraph 1 of the adoption agency algorithm. +Line: 1 Col: 50 Unexpected end tag (s) in table context caused voodoo mode. +Line: 1 Col: 50 End tag (s) violates step 1, paragraph 1 of the adoption agency algorithm. +Line: 1 Col: 58 Unexpected end tag (blink) in table context caused voodoo mode. +Line: 1 Col: 58 Unexpected end tag (blink). Ignored. +Line: 1 Col: 63 Unexpected end tag (tt) in table context caused voodoo mode. +Line: 1 Col: 63 End tag (tt) violates step 1, paragraph 1 of the adoption agency algorithm. +Line: 1 Col: 69 Unexpected end tag (pre) in table context caused voodoo mode. +Line: 1 Col: 69 End tag (pre) seen too early. Expected other end tag. +Line: 1 Col: 75 Unexpected end tag (big) in table context caused voodoo mode. +Line: 1 Col: 75 End tag (big) violates step 1, paragraph 1 of the adoption agency algorithm. +Line: 1 Col: 83 Unexpected end tag (small) in table context caused voodoo mode. +Line: 1 Col: 83 End tag (small) violates step 1, paragraph 1 of the adoption agency algorithm. +Line: 1 Col: 90 Unexpected end tag (font) in table context caused voodoo mode. +Line: 1 Col: 90 End tag (font) violates step 1, paragraph 1 of the adoption agency algorithm. +Line: 1 Col: 99 Unexpected end tag (select) in table context caused voodoo mode. +Line: 1 Col: 99 Unexpected end tag (select). Ignored. +Line: 1 Col: 104 Unexpected end tag (h1) in table context caused voodoo mode. +Line: 1 Col: 104 End tag (h1) seen too early. Expected other end tag. +Line: 1 Col: 109 Unexpected end tag (h2) in table context caused voodoo mode. +Line: 1 Col: 109 End tag (h2) seen too early. Expected other end tag. +Line: 1 Col: 114 Unexpected end tag (h3) in table context caused voodoo mode. +Line: 1 Col: 114 End tag (h3) seen too early. Expected other end tag. +Line: 1 Col: 119 Unexpected end tag (h4) in table context caused voodoo mode. +Line: 1 Col: 119 End tag (h4) seen too early. Expected other end tag. +Line: 1 Col: 124 Unexpected end tag (h5) in table context caused voodoo mode. +Line: 1 Col: 124 End tag (h5) seen too early. Expected other end tag. +Line: 1 Col: 129 Unexpected end tag (h6) in table context caused voodoo mode. +Line: 1 Col: 129 End tag (h6) seen too early. Expected other end tag. +Line: 1 Col: 136 Unexpected end tag (body) in the table row phase. Ignored. +Line: 1 Col: 141 Unexpected end tag (br) in table context caused voodoo mode. +Line: 1 Col: 141 Unexpected end tag (br). Treated as br element. +Line: 1 Col: 145 Unexpected end tag (a) in table context caused voodoo mode. +Line: 1 Col: 145 End tag (a) violates step 1, paragraph 1 of the adoption agency algorithm. +Line: 1 Col: 151 Unexpected end tag (img) in table context caused voodoo mode. +Line: 1 Col: 151 This element (img) has no end tag. +Line: 1 Col: 159 Unexpected end tag (title) in table context caused voodoo mode. +Line: 1 Col: 159 Unexpected end tag (title). Ignored. +Line: 1 Col: 166 Unexpected end tag (span) in table context caused voodoo mode. +Line: 1 Col: 166 Unexpected end tag (span). Ignored. +Line: 1 Col: 174 Unexpected end tag (style) in table context caused voodoo mode. +Line: 1 Col: 174 Unexpected end tag (style). Ignored. +Line: 1 Col: 183 Unexpected end tag (script) in table context caused voodoo mode. +Line: 1 Col: 183 Unexpected end tag (script). Ignored. +Line: 1 Col: 196 Unexpected end tag (th). Ignored. +Line: 1 Col: 201 Unexpected end tag (td). Ignored. +Line: 1 Col: 206 Unexpected end tag (tr). Ignored. +Line: 1 Col: 214 This element (frame) has no end tag. +Line: 1 Col: 221 This element (area) has no end tag. +Line: 1 Col: 228 Unexpected end tag (link). Ignored. +Line: 1 Col: 236 This element (param) has no end tag. +Line: 1 Col: 241 This element (hr) has no end tag. +Line: 1 Col: 249 This element (input) has no end tag. +Line: 1 Col: 255 Unexpected end tag (col). Ignored. +Line: 1 Col: 262 Unexpected end tag (base). Ignored. +Line: 1 Col: 269 Unexpected end tag (meta). Ignored. +Line: 1 Col: 280 This element (basefont) has no end tag. +Line: 1 Col: 290 This element (bgsound) has no end tag. +Line: 1 Col: 298 This element (embed) has no end tag. +Line: 1 Col: 307 This element (spacer) has no end tag. +Line: 1 Col: 311 Unexpected end tag (p). Ignored. +Line: 1 Col: 316 End tag (dd) seen too early. Expected other end tag. +Line: 1 Col: 321 End tag (dt) seen too early. Expected other end tag. +Line: 1 Col: 331 Unexpected end tag (caption). Ignored. +Line: 1 Col: 342 Unexpected end tag (colgroup). Ignored. +Line: 1 Col: 350 Unexpected end tag (tbody). Ignored. +Line: 1 Col: 358 Unexpected end tag (tfoot). Ignored. +Line: 1 Col: 366 Unexpected end tag (thead). Ignored. +Line: 1 Col: 376 End tag (address) seen too early. Expected other end tag. +Line: 1 Col: 389 End tag (blockquote) seen too early. Expected other end tag. +Line: 1 Col: 398 End tag (center) seen too early. Expected other end tag. +Line: 1 Col: 404 Unexpected end tag (dir). Ignored. +Line: 1 Col: 410 End tag (div) seen too early. Expected other end tag. +Line: 1 Col: 415 End tag (dl) seen too early. Expected other end tag. +Line: 1 Col: 426 End tag (fieldset) seen too early. Expected other end tag. +Line: 1 Col: 436 End tag (listing) seen too early. Expected other end tag. +Line: 1 Col: 443 End tag (menu) seen too early. Expected other end tag. +Line: 1 Col: 448 End tag (ol) seen too early. Expected other end tag. +Line: 1 Col: 453 End tag (ul) seen too early. Expected other end tag. +Line: 1 Col: 458 End tag (li) seen too early. Expected other end tag. +Line: 1 Col: 465 End tag (nobr) violates step 1, paragraph 1 of the adoption agency algorithm. +Line: 1 Col: 471 This element (wbr) has no end tag. +Line: 1 Col: 487 End tag (button) seen too early. Expected other end tag. +Line: 1 Col: 497 End tag (marquee) seen too early. Expected other end tag. +Line: 1 Col: 506 End tag (object) seen too early. Expected other end tag. +Line: 1 Col: 524 Unexpected end tag (html). Ignored. +Line: 1 Col: 524 Unexpected end tag (frameset). Ignored. +Line: 1 Col: 531 Unexpected end tag (head). Ignored. +Line: 1 Col: 540 Unexpected end tag (iframe). Ignored. +Line: 1 Col: 548 This element (image) has no end tag. +Line: 1 Col: 558 This element (isindex) has no end tag. +Line: 1 Col: 568 Unexpected end tag (noembed). Ignored. +Line: 1 Col: 579 Unexpected end tag (noframes). Ignored. +Line: 1 Col: 590 Unexpected end tag (noscript). Ignored. +Line: 1 Col: 601 Unexpected end tag (optgroup). Ignored. +Line: 1 Col: 610 Unexpected end tag (option). Ignored. +Line: 1 Col: 622 Unexpected end tag (plaintext). Ignored. +Line: 1 Col: 633 Unexpected end tag (textarea). Ignored. +#document +| +| +| +|
+| +| +| +|

+ +#data + +#errors +Line: 1 Col: 10 Unexpected start tag (frameset). Expected DOCTYPE. +Line: 1 Col: 10 Expected closing tag. Unexpected end of file. +#document +| +| +| diff --git a/Godeps/_workspace/src/golang.org/x/net/html/testdata/webkit/tests10.dat b/Godeps/_workspace/src/golang.org/x/net/html/testdata/webkit/tests10.dat new file mode 100644 index 000000000000..4f8df86f208a --- /dev/null +++ b/Godeps/_workspace/src/golang.org/x/net/html/testdata/webkit/tests10.dat @@ -0,0 +1,799 @@ +#data + +#errors +#document +| +| +| +| +| + +#data +a +#errors +29: Bogus comment +#document +| +| +| +| +| +| + +#data + +#errors +#document +| +| +| +| +| + +#data + +#errors +35: Stray “svg” start tag. +42: Stray end tag “svg” +#document +| +| +| +| +| +#errors +43: Stray “svg” start tag. +50: Stray end tag “svg” +#document +| +| +| +| +|

+#errors +34: Start tag “svg” seen in “table”. +41: Stray end tag “svg”. +#document +| +| +| +| +| +| + +#data +
foo
+#errors +34: Start tag “svg” seen in “table”. +46: Stray end tag “g”. +53: Stray end tag “svg”. +#document +| +| +| +| +| +| +| "foo" +| + +#data +
foobar
+#errors +34: Start tag “svg” seen in “table”. +46: Stray end tag “g”. +58: Stray end tag “g”. +65: Stray end tag “svg”. +#document +| +| +| +| +| +| +| "foo" +| +| "bar" +| + +#data +
foobar
+#errors +41: Start tag “svg” seen in “table”. +53: Stray end tag “g”. +65: Stray end tag “g”. +72: Stray end tag “svg”. +#document +| +| +| +| +| +| +| "foo" +| +| "bar" +| +| + +#data +
foobar
+#errors +45: Start tag “svg” seen in “table”. +57: Stray end tag “g”. +69: Stray end tag “g”. +76: Stray end tag “svg”. +#document +| +| +| +| +| +| +| "foo" +| +| "bar" +| +| +| + +#data +
foobar
+#errors +#document +| +| +| +| +| +| +| +|
+| +| +| "foo" +| +| "bar" + +#data +
foobar

baz

+#errors +#document +| +| +| +| +| +| +| +|
+| +| +| "foo" +| +| "bar" +|

+| "baz" + +#data +
foobar

baz

+#errors +#document +| +| +| +| +| +|
+| +| +| "foo" +| +| "bar" +|

+| "baz" + +#data +
foobar

baz

quux +#errors +70: HTML start tag “p” in a foreign namespace context. +81: “table” closed but “caption” was still open. +#document +| +| +| +| +| +|
+| +| +| "foo" +| +| "bar" +|

+| "baz" +|

+| "quux" + +#data +
foobarbaz

quux +#errors +78: “table” closed but “caption” was still open. +78: Unclosed elements on stack. +#document +| +| +| +| +| +|
+| +| +| "foo" +| +| "bar" +| "baz" +|

+| "quux" + +#data +foobar

baz

quux +#errors +44: Start tag “svg” seen in “table”. +56: Stray end tag “g”. +68: Stray end tag “g”. +71: HTML start tag “p” in a foreign namespace context. +71: Start tag “p” seen in “table”. +#document +| +| +| +| +| +| +| "foo" +| +| "bar" +|

+| "baz" +| +| +|

+| "quux" + +#data +

quux +#errors +50: Stray “svg” start tag. +54: Stray “g” start tag. +62: Stray end tag “g” +66: Stray “g” start tag. +74: Stray end tag “g” +77: Stray “p” start tag. +88: “table” end tag with “select” open. +#document +| +| +| +| +| +| +| +|
+|

quux +#errors +36: Start tag “select” seen in “table”. +42: Stray “svg” start tag. +46: Stray “g” start tag. +54: Stray end tag “g” +58: Stray “g” start tag. +66: Stray end tag “g” +69: Stray “p” start tag. +80: “table” end tag with “select” open. +#document +| +| +| +| +| +|

+| "quux" + +#data +foobar

baz +#errors +41: Stray “svg” start tag. +68: HTML start tag “p” in a foreign namespace context. +#document +| +| +| +| +| +| +| "foo" +| +| "bar" +|

+| "baz" + +#data +foobar

baz +#errors +34: Stray “svg” start tag. +61: HTML start tag “p” in a foreign namespace context. +#document +| +| +| +| +| +| +| "foo" +| +| "bar" +|

+| "baz" + +#data +

+#errors +31: Stray “svg” start tag. +35: Stray “g” start tag. +40: Stray end tag “g” +44: Stray “g” start tag. +49: Stray end tag “g” +52: Stray “p” start tag. +58: Stray “span” start tag. +58: End of file seen and there were open elements. +#document +| +| +| +| + +#data +

+#errors +42: Stray “svg” start tag. +46: Stray “g” start tag. +51: Stray end tag “g” +55: Stray “g” start tag. +60: Stray end tag “g” +63: Stray “p” start tag. +69: Stray “span” start tag. +#document +| +| +| +| + +#data + +#errors +#document +| +| +| +| +| xlink:href="foo" +| +| xlink href="foo" + +#data + +#errors +#document +| +| +| +| +| xlink:href="foo" +| xml:lang="en" +| +| +| xlink href="foo" +| xml lang="en" + +#data + +#errors +#document +| +| +| +| +| xlink:href="foo" +| xml:lang="en" +| +| +| xlink href="foo" +| xml lang="en" + +#data +bar +#errors +#document +| +| +| +| +| xlink:href="foo" +| xml:lang="en" +| +| +| xlink href="foo" +| xml lang="en" +| "bar" + +#data + +#errors +#document +| +| +| +| + +#data +

a +#errors +#document +| +| +| +|
+| +| "a" + +#data +
a +#errors +#document +| +| +| +|
+| +| +| "a" + +#data +
+#errors +#document +| +| +| +|
+| +| +| + +#data +
a +#errors +#document +| +| +| +|
+| +| +| +| +| "a" + +#data +

a +#errors +#document +| +| +| +|

+| +| +| +|

+| "a" + +#data +
    a +#errors +40: HTML start tag “ul” in a foreign namespace context. +41: End of file in a foreign namespace context. +#document +| +| +| +| +| +| +|
    +| +|
      +| "a" + +#data +
        a +#errors +35: HTML start tag “ul” in a foreign namespace context. +36: End of file in a foreign namespace context. +#document +| +| +| +| +| +| +| +|
          +| "a" + +#data +

          +#errors +#document +| +| +| +| +|

          +| +| +|

          + +#data +

          +#errors +#document +| +| +| +| +|

          +| +| +|

          + +#data +

          +#errors +#document +| +| +| +|

          +| +| +| +|

          +|

          + +#data +
          +#errors +#document +| +| +| +| +| +|
          +| +|
          +| +| + +#data +
          +#errors +#document +| +| +| +| +| +| +| +|
          +|
          +| + +#data + +#errors +#document +| +| +| +| +| +| + +#data +

+#errors +#document +| +| +| +| +|
+| +| + +#data + +#errors +#document +| +| +| +| +| +| + +#data + +#errors +#document +| +| +| +| +| +| + +#data + +#errors +#document +| +| +| +| +| +| + +#data + +#errors +#document +| +| +| +| +| +| + +#data + +#errors +#document +| +| +| +| +| +| + +#data + +#errors +#document +| +| +| +| +| +| + +#data + +#errors +#document +| +| +| +| +| +| + +#data + +#errors +#document +| +| +| +| +| +| + +#data + +#errors +#document +| +| +| +| +| +| + +#data + +#errors +#document +| +| +| +| +| +| + +#data + +#errors +#document +| +| +| +| +| +| +| + +#data +
+#errors +#document +| +| +| +| +| +| +| +|
+| +| +| +| +| + +#data + +#errors +#document +| +| +| +| +| +| +| +| +| +| +| +| +| +| diff --git a/Godeps/_workspace/src/golang.org/x/net/html/testdata/webkit/tests11.dat b/Godeps/_workspace/src/golang.org/x/net/html/testdata/webkit/tests11.dat new file mode 100644 index 000000000000..638cde479f76 --- /dev/null +++ b/Godeps/_workspace/src/golang.org/x/net/html/testdata/webkit/tests11.dat @@ -0,0 +1,482 @@ +#data + +#errors +#document +| +| +| +| +| +| attributeName="" +| attributeType="" +| baseFrequency="" +| baseProfile="" +| calcMode="" +| clipPathUnits="" +| contentScriptType="" +| contentStyleType="" +| diffuseConstant="" +| edgeMode="" +| externalResourcesRequired="" +| filterRes="" +| filterUnits="" +| glyphRef="" +| gradientTransform="" +| gradientUnits="" +| kernelMatrix="" +| kernelUnitLength="" +| keyPoints="" +| keySplines="" +| keyTimes="" +| lengthAdjust="" +| limitingConeAngle="" +| markerHeight="" +| markerUnits="" +| markerWidth="" +| maskContentUnits="" +| maskUnits="" +| numOctaves="" +| pathLength="" +| patternContentUnits="" +| patternTransform="" +| patternUnits="" +| pointsAtX="" +| pointsAtY="" +| pointsAtZ="" +| preserveAlpha="" +| preserveAspectRatio="" +| primitiveUnits="" +| refX="" +| refY="" +| repeatCount="" +| repeatDur="" +| requiredExtensions="" +| requiredFeatures="" +| specularConstant="" +| specularExponent="" +| spreadMethod="" +| startOffset="" +| stdDeviation="" +| stitchTiles="" +| surfaceScale="" +| systemLanguage="" +| tableValues="" +| targetX="" +| targetY="" +| textLength="" +| viewBox="" +| viewTarget="" +| xChannelSelector="" +| yChannelSelector="" +| zoomAndPan="" + +#data + +#errors +#document +| +| +| +| +| +| attributeName="" +| attributeType="" +| baseFrequency="" +| baseProfile="" +| calcMode="" +| clipPathUnits="" +| contentScriptType="" +| contentStyleType="" +| diffuseConstant="" +| edgeMode="" +| externalResourcesRequired="" +| filterRes="" +| filterUnits="" +| glyphRef="" +| gradientTransform="" +| gradientUnits="" +| kernelMatrix="" +| kernelUnitLength="" +| keyPoints="" +| keySplines="" +| keyTimes="" +| lengthAdjust="" +| limitingConeAngle="" +| markerHeight="" +| markerUnits="" +| markerWidth="" +| maskContentUnits="" +| maskUnits="" +| numOctaves="" +| pathLength="" +| patternContentUnits="" +| patternTransform="" +| patternUnits="" +| pointsAtX="" +| pointsAtY="" +| pointsAtZ="" +| preserveAlpha="" +| preserveAspectRatio="" +| primitiveUnits="" +| refX="" +| refY="" +| repeatCount="" +| repeatDur="" +| requiredExtensions="" +| requiredFeatures="" +| specularConstant="" +| specularExponent="" +| spreadMethod="" +| startOffset="" +| stdDeviation="" +| stitchTiles="" +| surfaceScale="" +| systemLanguage="" +| tableValues="" +| targetX="" +| targetY="" +| textLength="" +| viewBox="" +| viewTarget="" +| xChannelSelector="" +| yChannelSelector="" +| zoomAndPan="" + +#data + +#errors +#document +| +| +| +| +| +| attributeName="" +| attributeType="" +| baseFrequency="" +| baseProfile="" +| calcMode="" +| clipPathUnits="" +| contentScriptType="" +| contentStyleType="" +| diffuseConstant="" +| edgeMode="" +| externalResourcesRequired="" +| filterRes="" +| filterUnits="" +| glyphRef="" +| gradientTransform="" +| gradientUnits="" +| kernelMatrix="" +| kernelUnitLength="" +| keyPoints="" +| keySplines="" +| keyTimes="" +| lengthAdjust="" +| limitingConeAngle="" +| markerHeight="" +| markerUnits="" +| markerWidth="" +| maskContentUnits="" +| maskUnits="" +| numOctaves="" +| pathLength="" +| patternContentUnits="" +| patternTransform="" +| patternUnits="" +| pointsAtX="" +| pointsAtY="" +| pointsAtZ="" +| preserveAlpha="" +| preserveAspectRatio="" +| primitiveUnits="" +| refX="" +| refY="" +| repeatCount="" +| repeatDur="" +| requiredExtensions="" +| requiredFeatures="" +| specularConstant="" +| specularExponent="" +| spreadMethod="" +| startOffset="" +| stdDeviation="" +| stitchTiles="" +| surfaceScale="" +| systemLanguage="" +| tableValues="" +| targetX="" +| targetY="" +| textLength="" +| viewBox="" +| viewTarget="" +| xChannelSelector="" +| yChannelSelector="" +| zoomAndPan="" + +#data + +#errors +#document +| +| +| +| +| +| attributename="" +| attributetype="" +| basefrequency="" +| baseprofile="" +| calcmode="" +| clippathunits="" +| contentscripttype="" +| contentstyletype="" +| diffuseconstant="" +| edgemode="" +| externalresourcesrequired="" +| filterres="" +| filterunits="" +| glyphref="" +| gradienttransform="" +| gradientunits="" +| kernelmatrix="" +| kernelunitlength="" +| keypoints="" +| keysplines="" +| keytimes="" +| lengthadjust="" +| limitingconeangle="" +| markerheight="" +| markerunits="" +| markerwidth="" +| maskcontentunits="" +| maskunits="" +| numoctaves="" +| pathlength="" +| patterncontentunits="" +| patterntransform="" +| patternunits="" +| pointsatx="" +| pointsaty="" +| pointsatz="" +| preservealpha="" +| preserveaspectratio="" +| primitiveunits="" +| refx="" +| refy="" +| repeatcount="" +| repeatdur="" +| requiredextensions="" +| requiredfeatures="" +| specularconstant="" +| specularexponent="" +| spreadmethod="" +| startoffset="" +| stddeviation="" +| stitchtiles="" +| surfacescale="" +| systemlanguage="" +| tablevalues="" +| targetx="" +| targety="" +| textlength="" +| viewbox="" +| viewtarget="" +| xchannelselector="" +| ychannelselector="" +| zoomandpan="" + +#data + +#errors +#document +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| + +#data + +#errors +#document +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| + +#data + +#errors +#document +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| + +#data + +#errors +#document +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| + +#data + +#errors +#document +| +| +| +| +| +| diff --git a/Godeps/_workspace/src/golang.org/x/net/html/testdata/webkit/tests12.dat b/Godeps/_workspace/src/golang.org/x/net/html/testdata/webkit/tests12.dat new file mode 100644 index 000000000000..63107d277b6a --- /dev/null +++ b/Godeps/_workspace/src/golang.org/x/net/html/testdata/webkit/tests12.dat @@ -0,0 +1,62 @@ +#data +

foobazeggs

spam

quuxbar +#errors +#document +| +| +| +| +|

+| "foo" +| +| +| +| "baz" +| +| +| +| +| "eggs" +| +| +|

+| "spam" +| +| +| +|
+| +| +| "quux" +| "bar" + +#data +foobazeggs

spam
quuxbar +#errors +#document +| +| +| +| +| "foo" +| +| +| +| "baz" +| +| +| +| +| "eggs" +| +| +|

+| "spam" +| +| +| +|
+| +| +| "quux" +| "bar" diff --git a/Godeps/_workspace/src/golang.org/x/net/html/testdata/webkit/tests14.dat b/Godeps/_workspace/src/golang.org/x/net/html/testdata/webkit/tests14.dat new file mode 100644 index 000000000000..b8713f88582c --- /dev/null +++ b/Godeps/_workspace/src/golang.org/x/net/html/testdata/webkit/tests14.dat @@ -0,0 +1,74 @@ +#data + +#errors +#document +| +| +| +| +| + +#data + +#errors +#document +| +| +| +| +| +| + +#data + +#errors +15: Unexpected start tag html +#document +| +| +| abc:def="gh" +| +| +| + +#data + +#errors +15: Unexpected start tag html +#document +| +| +| xml:lang="bar" +| +| + +#data + +#errors +#document +| +| +| 123="456" +| +| + +#data + +#errors +#document +| +| +| 123="456" +| 789="012" +| +| + +#data + +#errors +#document +| +| +| +| +| 789="012" diff --git a/Godeps/_workspace/src/golang.org/x/net/html/testdata/webkit/tests15.dat b/Godeps/_workspace/src/golang.org/x/net/html/testdata/webkit/tests15.dat new file mode 100644 index 000000000000..6ce1c0d16632 --- /dev/null +++ b/Godeps/_workspace/src/golang.org/x/net/html/testdata/webkit/tests15.dat @@ -0,0 +1,208 @@ +#data +

X +#errors +Line: 1 Col: 31 Unexpected end tag (p). Ignored. +Line: 1 Col: 36 Expected closing tag. Unexpected end of file. +#document +| +| +| +| +|

+| +| +| +| +| +| +| " " +|

+| "X" + +#data +

+

X +#errors +Line: 1 Col: 3 Unexpected start tag (p). Expected DOCTYPE. +Line: 1 Col: 16 Unexpected end tag (p). Ignored. +Line: 2 Col: 4 Expected closing tag. Unexpected end of file. +#document +| +| +| +|

+| +| +| +| +| +| +| " +" +|

+| "X" + +#data + +#errors +Line: 1 Col: 22 Unexpected end tag (html) after the (implied) root element. +#document +| +| +| +| +| " " + +#data + +#errors +Line: 1 Col: 22 Unexpected end tag (body) after the (implied) root element. +#document +| +| +| +| +| + +#data + +#errors +Line: 1 Col: 6 Unexpected start tag (html). Expected DOCTYPE. +Line: 1 Col: 13 Unexpected end tag (html) after the (implied) root element. +#document +| +| +| +| + +#data +X +#errors +Line: 1 Col: 22 Unexpected end tag (body) after the (implied) root element. +#document +| +| +| +| +| +| "X" + +#data +<!doctype html><table> X<meta></table> +#errors +Line: 1 Col: 24 Unexpected non-space characters in table context caused voodoo mode. +Line: 1 Col: 30 Unexpected start tag (meta) in table context caused voodoo mode. +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| " X" +| <meta> +| <table> + +#data +<!doctype html><table> x</table> +#errors +Line: 1 Col: 24 Unexpected non-space characters in table context caused voodoo mode. +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| " x" +| <table> + +#data +<!doctype html><table> x </table> +#errors +Line: 1 Col: 25 Unexpected non-space characters in table context caused voodoo mode. +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| " x " +| <table> + +#data +<!doctype html><table><tr> x</table> +#errors +Line: 1 Col: 28 Unexpected non-space characters in table context caused voodoo mode. +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| " x" +| <table> +| <tbody> +| <tr> + +#data +<!doctype html><table>X<style> <tr>x </style> </table> +#errors +Line: 1 Col: 23 Unexpected non-space characters in table context caused voodoo mode. +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| "X" +| <table> +| <style> +| " <tr>x " +| " " + +#data +<!doctype html><div><table><a>foo</a> <tr><td>bar</td> </tr></table></div> +#errors +Line: 1 Col: 30 Unexpected start tag (a) in table context caused voodoo mode. +Line: 1 Col: 37 Unexpected end tag (a) in table context caused voodoo mode. +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <div> +| <a> +| "foo" +| <table> +| " " +| <tbody> +| <tr> +| <td> +| "bar" +| " " + +#data +<frame></frame></frame><frameset><frame><frameset><frame></frameset><noframes></frameset><noframes> +#errors +6: Start tag seen without seeing a doctype first. Expected “<!DOCTYPE html>”. +13: Stray start tag “frame”. +21: Stray end tag “frame”. +29: Stray end tag “frame”. +39: “frameset” start tag after “body” already open. +105: End of file seen inside an [R]CDATA element. +105: End of file seen and there were open elements. +XXX: These errors are wrong, please fix me! +#document +| <html> +| <head> +| <frameset> +| <frame> +| <frameset> +| <frame> +| <noframes> +| "</frameset><noframes>" + +#data +<!DOCTYPE html><object></html> +#errors +1: Expected closing tag. Unexpected end of file +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <object> diff --git a/Godeps/_workspace/src/golang.org/x/net/html/testdata/webkit/tests16.dat b/Godeps/_workspace/src/golang.org/x/net/html/testdata/webkit/tests16.dat new file mode 100644 index 000000000000..c8ef66f0e6e1 --- /dev/null +++ b/Godeps/_workspace/src/golang.org/x/net/html/testdata/webkit/tests16.dat @@ -0,0 +1,2299 @@ +#data +<!doctype html><script> +#errors +Line: 1 Col: 23 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| <body> + +#data +<!doctype html><script>a +#errors +Line: 1 Col: 24 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "a" +| <body> + +#data +<!doctype html><script>< +#errors +Line: 1 Col: 24 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "<" +| <body> + +#data +<!doctype html><script></ +#errors +Line: 1 Col: 25 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "</" +| <body> + +#data +<!doctype html><script></S +#errors +Line: 1 Col: 26 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "</S" +| <body> + +#data +<!doctype html><script></SC +#errors +Line: 1 Col: 27 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "</SC" +| <body> + +#data +<!doctype html><script></SCR +#errors +Line: 1 Col: 28 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "</SCR" +| <body> + +#data +<!doctype html><script></SCRI +#errors +Line: 1 Col: 29 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "</SCRI" +| <body> + +#data +<!doctype html><script></SCRIP +#errors +Line: 1 Col: 30 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "</SCRIP" +| <body> + +#data +<!doctype html><script></SCRIPT +#errors +Line: 1 Col: 31 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "</SCRIPT" +| <body> + +#data +<!doctype html><script></SCRIPT +#errors +Line: 1 Col: 32 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| <body> + +#data +<!doctype html><script></s +#errors +Line: 1 Col: 26 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "</s" +| <body> + +#data +<!doctype html><script></sc +#errors +Line: 1 Col: 27 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "</sc" +| <body> + +#data +<!doctype html><script></scr +#errors +Line: 1 Col: 28 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "</scr" +| <body> + +#data +<!doctype html><script></scri +#errors +Line: 1 Col: 29 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "</scri" +| <body> + +#data +<!doctype html><script></scrip +#errors +Line: 1 Col: 30 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "</scrip" +| <body> + +#data +<!doctype html><script></script +#errors +Line: 1 Col: 31 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "</script" +| <body> + +#data +<!doctype html><script></script +#errors +Line: 1 Col: 32 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| <body> + +#data +<!doctype html><script><! +#errors +Line: 1 Col: 25 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "<!" +| <body> + +#data +<!doctype html><script><!a +#errors +Line: 1 Col: 26 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "<!a" +| <body> + +#data +<!doctype html><script><!- +#errors +Line: 1 Col: 26 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "<!-" +| <body> + +#data +<!doctype html><script><!-a +#errors +Line: 1 Col: 27 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "<!-a" +| <body> + +#data +<!doctype html><script><!-- +#errors +Line: 1 Col: 27 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "<!--" +| <body> + +#data +<!doctype html><script><!--a +#errors +Line: 1 Col: 28 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "<!--a" +| <body> + +#data +<!doctype html><script><!--< +#errors +Line: 1 Col: 28 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "<!--<" +| <body> + +#data +<!doctype html><script><!--<a +#errors +Line: 1 Col: 29 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "<!--<a" +| <body> + +#data +<!doctype html><script><!--</ +#errors +Line: 1 Col: 27 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "<!--</" +| <body> + +#data +<!doctype html><script><!--</script +#errors +Line: 1 Col: 35 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "<!--</script" +| <body> + +#data +<!doctype html><script><!--</script +#errors +Line: 1 Col: 36 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "<!--" +| <body> + +#data +<!doctype html><script><!--<s +#errors +Line: 1 Col: 29 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "<!--<s" +| <body> + +#data +<!doctype html><script><!--<script +#errors +Line: 1 Col: 34 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "<!--<script" +| <body> + +#data +<!doctype html><script><!--<script +#errors +Line: 1 Col: 35 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "<!--<script " +| <body> + +#data +<!doctype html><script><!--<script < +#errors +Line: 1 Col: 36 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "<!--<script <" +| <body> + +#data +<!doctype html><script><!--<script <a +#errors +Line: 1 Col: 37 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "<!--<script <a" +| <body> + +#data +<!doctype html><script><!--<script </ +#errors +Line: 1 Col: 37 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "<!--<script </" +| <body> + +#data +<!doctype html><script><!--<script </s +#errors +Line: 1 Col: 38 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "<!--<script </s" +| <body> + +#data +<!doctype html><script><!--<script </script +#errors +Line: 1 Col: 43 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "<!--<script </script" +| <body> + +#data +<!doctype html><script><!--<script </scripta +#errors +Line: 1 Col: 44 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "<!--<script </scripta" +| <body> + +#data +<!doctype html><script><!--<script </script +#errors +Line: 1 Col: 44 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "<!--<script </script " +| <body> + +#data +<!doctype html><script><!--<script </script> +#errors +Line: 1 Col: 44 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "<!--<script </script>" +| <body> + +#data +<!doctype html><script><!--<script </script/ +#errors +Line: 1 Col: 44 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "<!--<script </script/" +| <body> + +#data +<!doctype html><script><!--<script </script < +#errors +Line: 1 Col: 45 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "<!--<script </script <" +| <body> + +#data +<!doctype html><script><!--<script </script <a +#errors +Line: 1 Col: 46 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "<!--<script </script <a" +| <body> + +#data +<!doctype html><script><!--<script </script </ +#errors +Line: 1 Col: 46 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "<!--<script </script </" +| <body> + +#data +<!doctype html><script><!--<script </script </script +#errors +Line: 1 Col: 52 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "<!--<script </script </script" +| <body> + +#data +<!doctype html><script><!--<script </script </script +#errors +Line: 1 Col: 53 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "<!--<script </script " +| <body> + +#data +<!doctype html><script><!--<script </script </script/ +#errors +Line: 1 Col: 53 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "<!--<script </script " +| <body> + +#data +<!doctype html><script><!--<script </script </script> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "<!--<script </script " +| <body> + +#data +<!doctype html><script><!--<script - +#errors +Line: 1 Col: 36 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "<!--<script -" +| <body> + +#data +<!doctype html><script><!--<script -a +#errors +Line: 1 Col: 37 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "<!--<script -a" +| <body> + +#data +<!doctype html><script><!--<script -< +#errors +Line: 1 Col: 37 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "<!--<script -<" +| <body> + +#data +<!doctype html><script><!--<script -- +#errors +Line: 1 Col: 37 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "<!--<script --" +| <body> + +#data +<!doctype html><script><!--<script --a +#errors +Line: 1 Col: 38 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "<!--<script --a" +| <body> + +#data +<!doctype html><script><!--<script --< +#errors +Line: 1 Col: 38 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "<!--<script --<" +| <body> + +#data +<!doctype html><script><!--<script --> +#errors +Line: 1 Col: 38 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "<!--<script -->" +| <body> + +#data +<!doctype html><script><!--<script -->< +#errors +Line: 1 Col: 39 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "<!--<script --><" +| <body> + +#data +<!doctype html><script><!--<script --></ +#errors +Line: 1 Col: 40 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "<!--<script --></" +| <body> + +#data +<!doctype html><script><!--<script --></script +#errors +Line: 1 Col: 46 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "<!--<script --></script" +| <body> + +#data +<!doctype html><script><!--<script --></script +#errors +Line: 1 Col: 47 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "<!--<script -->" +| <body> + +#data +<!doctype html><script><!--<script --></script/ +#errors +Line: 1 Col: 47 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "<!--<script -->" +| <body> + +#data +<!doctype html><script><!--<script --></script> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "<!--<script -->" +| <body> + +#data +<!doctype html><script><!--<script><\/script>--></script> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "<!--<script><\/script>-->" +| <body> + +#data +<!doctype html><script><!--<script></scr'+'ipt>--></script> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "<!--<script></scr'+'ipt>-->" +| <body> + +#data +<!doctype html><script><!--<script></script><script></script></script> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "<!--<script></script><script></script>" +| <body> + +#data +<!doctype html><script><!--<script></script><script></script>--><!--</script> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "<!--<script></script><script></script>--><!--" +| <body> + +#data +<!doctype html><script><!--<script></script><script></script>-- ></script> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "<!--<script></script><script></script>-- >" +| <body> + +#data +<!doctype html><script><!--<script></script><script></script>- -></script> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "<!--<script></script><script></script>- ->" +| <body> + +#data +<!doctype html><script><!--<script></script><script></script>- - ></script> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "<!--<script></script><script></script>- - >" +| <body> + +#data +<!doctype html><script><!--<script></script><script></script>-></script> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "<!--<script></script><script></script>->" +| <body> + +#data +<!doctype html><script><!--<script>--!></script>X +#errors +Line: 1 Col: 49 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "<!--<script>--!></script>X" +| <body> + +#data +<!doctype html><script><!--<scr'+'ipt></script>--></script> +#errors +Line: 1 Col: 59 Unexpected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "<!--<scr'+'ipt>" +| <body> +| "-->" + +#data +<!doctype html><script><!--<script></scr'+'ipt></script>X +#errors +Line: 1 Col: 57 Unexpected end of file. Expected end tag (script). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| "<!--<script></scr'+'ipt></script>X" +| <body> + +#data +<!doctype html><style><!--<style></style>--></style> +#errors +Line: 1 Col: 52 Unexpected end tag (style). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <style> +| "<!--<style>" +| <body> +| "-->" + +#data +<!doctype html><style><!--</style>X +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <style> +| "<!--" +| <body> +| "X" + +#data +<!doctype html><style><!--...</style>...--></style> +#errors +Line: 1 Col: 51 Unexpected end tag (style). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <style> +| "<!--..." +| <body> +| "...-->" + +#data +<!doctype html><style><!--<br><html xmlns:v="urn:schemas-microsoft-com:vml"><!--[if !mso]><style></style>X +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <style> +| "<!--<br><html xmlns:v="urn:schemas-microsoft-com:vml"><!--[if !mso]><style>" +| <body> +| "X" + +#data +<!doctype html><style><!--...<style><!--...--!></style>--></style> +#errors +Line: 1 Col: 66 Unexpected end tag (style). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <style> +| "<!--...<style><!--...--!>" +| <body> +| "-->" + +#data +<!doctype html><style><!--...</style><!-- --><style>@import ...</style> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <style> +| "<!--..." +| <!-- --> +| <style> +| "@import ..." +| <body> + +#data +<!doctype html><style>...<style><!--...</style><!-- --></style> +#errors +Line: 1 Col: 63 Unexpected end tag (style). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <style> +| "...<style><!--..." +| <!-- --> +| <body> + +#data +<!doctype html><style>...<!--[if IE]><style>...</style>X +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <style> +| "...<!--[if IE]><style>..." +| <body> +| "X" + +#data +<!doctype html><title><!--<title>--> +#errors +Line: 1 Col: 52 Unexpected end tag (title). +#document +| +| +| +| +| "<!--<title>" +| <body> +| "-->" + +#data +<!doctype html><title></title> +#errors +#document +| +| +| +| +| "" +| + +#data +foo/title><link></head><body>X +#errors +Line: 1 Col: 52 Unexpected end of file. Expected end tag (title). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <title> +| "foo/title><link></head><body>X" +| <body> + +#data +<!doctype html><noscript><!--<noscript></noscript>--></noscript> +#errors +Line: 1 Col: 64 Unexpected end tag (noscript). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <noscript> +| "<!--<noscript>" +| <body> +| "-->" + +#data +<!doctype html><noscript><!--</noscript>X<noscript>--></noscript> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <noscript> +| "<!--" +| <body> +| "X" +| <noscript> +| "-->" + +#data +<!doctype html><noscript><iframe></noscript>X +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <noscript> +| "<iframe>" +| <body> +| "X" + +#data +<!doctype html><noframes><!--<noframes></noframes>--></noframes> +#errors +Line: 1 Col: 64 Unexpected end tag (noframes). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <noframes> +| "<!--<noframes>" +| <body> +| "-->" + +#data +<!doctype html><noframes><body><script><!--...</script></body></noframes></html> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <noframes> +| "<body><script><!--...</script></body>" +| <body> + +#data +<!doctype html><textarea><!--<textarea></textarea>--></textarea> +#errors +Line: 1 Col: 64 Unexpected end tag (textarea). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <textarea> +| "<!--<textarea>" +| "-->" + +#data +<!doctype html><textarea></textarea></textarea> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <textarea> +| "</textarea>" + +#data +<!doctype html><textarea><</textarea> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <textarea> +| "<" + +#data +<!doctype html><textarea>a<b</textarea> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <textarea> +| "a<b" + +#data +<!doctype html><iframe><!--<iframe></iframe>--></iframe> +#errors +Line: 1 Col: 56 Unexpected end tag (iframe). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <iframe> +| "<!--<iframe>" +| "-->" + +#data +<!doctype html><iframe>...<!--X->...<!--/X->...</iframe> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <iframe> +| "...<!--X->...<!--/X->..." + +#data +<!doctype html><xmp><!--<xmp></xmp>--></xmp> +#errors +Line: 1 Col: 44 Unexpected end tag (xmp). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <xmp> +| "<!--<xmp>" +| "-->" + +#data +<!doctype html><noembed><!--<noembed></noembed>--></noembed> +#errors +Line: 1 Col: 60 Unexpected end tag (noembed). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <noembed> +| "<!--<noembed>" +| "-->" + +#data +<script> +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 8 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| <body> + +#data +<script>a +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 9 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "a" +| <body> + +#data +<script>< +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 9 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "<" +| <body> + +#data +<script></ +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 10 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "</" +| <body> + +#data +<script></S +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 11 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "</S" +| <body> + +#data +<script></SC +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 12 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "</SC" +| <body> + +#data +<script></SCR +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 13 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "</SCR" +| <body> + +#data +<script></SCRI +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 14 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "</SCRI" +| <body> + +#data +<script></SCRIP +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 15 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "</SCRIP" +| <body> + +#data +<script></SCRIPT +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 16 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "</SCRIPT" +| <body> + +#data +<script></SCRIPT +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 17 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| <body> + +#data +<script></s +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 11 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "</s" +| <body> + +#data +<script></sc +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 12 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "</sc" +| <body> + +#data +<script></scr +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 13 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "</scr" +| <body> + +#data +<script></scri +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 14 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "</scri" +| <body> + +#data +<script></scrip +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 15 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "</scrip" +| <body> + +#data +<script></script +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 16 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "</script" +| <body> + +#data +<script></script +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 17 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| <body> + +#data +<script><! +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 10 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "<!" +| <body> + +#data +<script><!a +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 11 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "<!a" +| <body> + +#data +<script><!- +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 11 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "<!-" +| <body> + +#data +<script><!-a +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 12 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "<!-a" +| <body> + +#data +<script><!-- +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 12 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "<!--" +| <body> + +#data +<script><!--a +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 13 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "<!--a" +| <body> + +#data +<script><!--< +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 13 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "<!--<" +| <body> + +#data +<script><!--<a +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 14 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "<!--<a" +| <body> + +#data +<script><!--</ +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 14 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "<!--</" +| <body> + +#data +<script><!--</script +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 20 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "<!--</script" +| <body> + +#data +<script><!--</script +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 21 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "<!--" +| <body> + +#data +<script><!--<s +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 14 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "<!--<s" +| <body> + +#data +<script><!--<script +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 19 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "<!--<script" +| <body> + +#data +<script><!--<script +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 20 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "<!--<script " +| <body> + +#data +<script><!--<script < +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 21 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "<!--<script <" +| <body> + +#data +<script><!--<script <a +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 22 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "<!--<script <a" +| <body> + +#data +<script><!--<script </ +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 22 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "<!--<script </" +| <body> + +#data +<script><!--<script </s +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 23 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "<!--<script </s" +| <body> + +#data +<script><!--<script </script +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 28 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "<!--<script </script" +| <body> + +#data +<script><!--<script </scripta +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 29 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "<!--<script </scripta" +| <body> + +#data +<script><!--<script </script +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 29 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "<!--<script </script " +| <body> + +#data +<script><!--<script </script> +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 29 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "<!--<script </script>" +| <body> + +#data +<script><!--<script </script/ +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 29 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "<!--<script </script/" +| <body> + +#data +<script><!--<script </script < +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 30 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "<!--<script </script <" +| <body> + +#data +<script><!--<script </script <a +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 31 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "<!--<script </script <a" +| <body> + +#data +<script><!--<script </script </ +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 31 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "<!--<script </script </" +| <body> + +#data +<script><!--<script </script </script +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 38 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "<!--<script </script </script" +| <body> + +#data +<script><!--<script </script </script +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 38 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "<!--<script </script " +| <body> + +#data +<script><!--<script </script </script/ +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 38 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "<!--<script </script " +| <body> + +#data +<script><!--<script </script </script> +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +#document +| <html> +| <head> +| <script> +| "<!--<script </script " +| <body> + +#data +<script><!--<script - +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 21 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "<!--<script -" +| <body> + +#data +<script><!--<script -a +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 22 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "<!--<script -a" +| <body> + +#data +<script><!--<script -- +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 22 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "<!--<script --" +| <body> + +#data +<script><!--<script --a +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 23 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "<!--<script --a" +| <body> + +#data +<script><!--<script --> +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 23 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "<!--<script -->" +| <body> + +#data +<script><!--<script -->< +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 24 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "<!--<script --><" +| <body> + +#data +<script><!--<script --></ +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 25 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "<!--<script --></" +| <body> + +#data +<script><!--<script --></script +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 31 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "<!--<script --></script" +| <body> + +#data +<script><!--<script --></script +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 32 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "<!--<script -->" +| <body> + +#data +<script><!--<script --></script/ +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 32 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "<!--<script -->" +| <body> + +#data +<script><!--<script --></script> +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +#document +| <html> +| <head> +| <script> +| "<!--<script -->" +| <body> + +#data +<script><!--<script><\/script>--></script> +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +#document +| <html> +| <head> +| <script> +| "<!--<script><\/script>-->" +| <body> + +#data +<script><!--<script></scr'+'ipt>--></script> +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +#document +| <html> +| <head> +| <script> +| "<!--<script></scr'+'ipt>-->" +| <body> + +#data +<script><!--<script></script><script></script></script> +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +#document +| <html> +| <head> +| <script> +| "<!--<script></script><script></script>" +| <body> + +#data +<script><!--<script></script><script></script>--><!--</script> +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +#document +| <html> +| <head> +| <script> +| "<!--<script></script><script></script>--><!--" +| <body> + +#data +<script><!--<script></script><script></script>-- ></script> +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +#document +| <html> +| <head> +| <script> +| "<!--<script></script><script></script>-- >" +| <body> + +#data +<script><!--<script></script><script></script>- -></script> +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +#document +| <html> +| <head> +| <script> +| "<!--<script></script><script></script>- ->" +| <body> + +#data +<script><!--<script></script><script></script>- - ></script> +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +#document +| <html> +| <head> +| <script> +| "<!--<script></script><script></script>- - >" +| <body> + +#data +<script><!--<script></script><script></script>-></script> +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +#document +| <html> +| <head> +| <script> +| "<!--<script></script><script></script>->" +| <body> + +#data +<script><!--<script>--!></script>X +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 34 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "<!--<script>--!></script>X" +| <body> + +#data +<script><!--<scr'+'ipt></script>--></script> +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 44 Unexpected end tag (script). +#document +| <html> +| <head> +| <script> +| "<!--<scr'+'ipt>" +| <body> +| "-->" + +#data +<script><!--<script></scr'+'ipt></script>X +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 42 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "<!--<script></scr'+'ipt></script>X" +| <body> + +#data +<style><!--<style></style>--></style> +#errors +Line: 1 Col: 7 Unexpected start tag (style). Expected DOCTYPE. +Line: 1 Col: 37 Unexpected end tag (style). +#document +| <html> +| <head> +| <style> +| "<!--<style>" +| <body> +| "-->" + +#data +<style><!--</style>X +#errors +Line: 1 Col: 7 Unexpected start tag (style). Expected DOCTYPE. +#document +| <html> +| <head> +| <style> +| "<!--" +| <body> +| "X" + +#data +<style><!--...</style>...--></style> +#errors +Line: 1 Col: 7 Unexpected start tag (style). Expected DOCTYPE. +Line: 1 Col: 36 Unexpected end tag (style). +#document +| <html> +| <head> +| <style> +| "<!--..." +| <body> +| "...-->" + +#data +<style><!--<br><html xmlns:v="urn:schemas-microsoft-com:vml"><!--[if !mso]><style></style>X +#errors +Line: 1 Col: 7 Unexpected start tag (style). Expected DOCTYPE. +#document +| <html> +| <head> +| <style> +| "<!--<br><html xmlns:v="urn:schemas-microsoft-com:vml"><!--[if !mso]><style>" +| <body> +| "X" + +#data +<style><!--...<style><!--...--!></style>--></style> +#errors +Line: 1 Col: 7 Unexpected start tag (style). Expected DOCTYPE. +Line: 1 Col: 51 Unexpected end tag (style). +#document +| <html> +| <head> +| <style> +| "<!--...<style><!--...--!>" +| <body> +| "-->" + +#data +<style><!--...</style><!-- --><style>@import ...</style> +#errors +Line: 1 Col: 7 Unexpected start tag (style). Expected DOCTYPE. +#document +| <html> +| <head> +| <style> +| "<!--..." +| <!-- --> +| <style> +| "@import ..." +| <body> + +#data +<style>...<style><!--...</style><!-- --></style> +#errors +Line: 1 Col: 7 Unexpected start tag (style). Expected DOCTYPE. +Line: 1 Col: 48 Unexpected end tag (style). +#document +| <html> +| <head> +| <style> +| "...<style><!--..." +| <!-- --> +| <body> + +#data +<style>...<!--[if IE]><style>...</style>X +#errors +Line: 1 Col: 7 Unexpected start tag (style). Expected DOCTYPE. +#document +| <html> +| <head> +| <style> +| "...<!--[if IE]><style>..." +| <body> +| "X" + +#data +<title><!--<title>--> +#errors +Line: 1 Col: 7 Unexpected start tag (title). Expected DOCTYPE. +Line: 1 Col: 37 Unexpected end tag (title). +#document +| +| +| +| "<!--<title>" +| <body> +| "-->" + +#data +<title></title> +#errors +Line: 1 Col: 7 Unexpected start tag (title). Expected DOCTYPE. +#document +| +| +| +| "" +| + +#data +foo/title><link></head><body>X +#errors +Line: 1 Col: 7 Unexpected start tag (title). Expected DOCTYPE. +Line: 1 Col: 37 Unexpected end of file. Expected end tag (title). +#document +| <html> +| <head> +| <title> +| "foo/title><link></head><body>X" +| <body> + +#data +<noscript><!--<noscript></noscript>--></noscript> +#errors +Line: 1 Col: 10 Unexpected start tag (noscript). Expected DOCTYPE. +Line: 1 Col: 49 Unexpected end tag (noscript). +#document +| <html> +| <head> +| <noscript> +| "<!--<noscript>" +| <body> +| "-->" + +#data +<noscript><!--</noscript>X<noscript>--></noscript> +#errors +Line: 1 Col: 10 Unexpected start tag (noscript). Expected DOCTYPE. +#document +| <html> +| <head> +| <noscript> +| "<!--" +| <body> +| "X" +| <noscript> +| "-->" + +#data +<noscript><iframe></noscript>X +#errors +Line: 1 Col: 10 Unexpected start tag (noscript). Expected DOCTYPE. +#document +| <html> +| <head> +| <noscript> +| "<iframe>" +| <body> +| "X" + +#data +<noframes><!--<noframes></noframes>--></noframes> +#errors +Line: 1 Col: 10 Unexpected start tag (noframes). Expected DOCTYPE. +Line: 1 Col: 49 Unexpected end tag (noframes). +#document +| <html> +| <head> +| <noframes> +| "<!--<noframes>" +| <body> +| "-->" + +#data +<noframes><body><script><!--...</script></body></noframes></html> +#errors +Line: 1 Col: 10 Unexpected start tag (noframes). Expected DOCTYPE. +#document +| <html> +| <head> +| <noframes> +| "<body><script><!--...</script></body>" +| <body> + +#data +<textarea><!--<textarea></textarea>--></textarea> +#errors +Line: 1 Col: 10 Unexpected start tag (textarea). Expected DOCTYPE. +Line: 1 Col: 49 Unexpected end tag (textarea). +#document +| <html> +| <head> +| <body> +| <textarea> +| "<!--<textarea>" +| "-->" + +#data +<textarea></textarea></textarea> +#errors +Line: 1 Col: 10 Unexpected start tag (textarea). Expected DOCTYPE. +#document +| <html> +| <head> +| <body> +| <textarea> +| "</textarea>" + +#data +<iframe><!--<iframe></iframe>--></iframe> +#errors +Line: 1 Col: 8 Unexpected start tag (iframe). Expected DOCTYPE. +Line: 1 Col: 41 Unexpected end tag (iframe). +#document +| <html> +| <head> +| <body> +| <iframe> +| "<!--<iframe>" +| "-->" + +#data +<iframe>...<!--X->...<!--/X->...</iframe> +#errors +Line: 1 Col: 8 Unexpected start tag (iframe). Expected DOCTYPE. +#document +| <html> +| <head> +| <body> +| <iframe> +| "...<!--X->...<!--/X->..." + +#data +<xmp><!--<xmp></xmp>--></xmp> +#errors +Line: 1 Col: 5 Unexpected start tag (xmp). Expected DOCTYPE. +Line: 1 Col: 29 Unexpected end tag (xmp). +#document +| <html> +| <head> +| <body> +| <xmp> +| "<!--<xmp>" +| "-->" + +#data +<noembed><!--<noembed></noembed>--></noembed> +#errors +Line: 1 Col: 9 Unexpected start tag (noembed). Expected DOCTYPE. +Line: 1 Col: 45 Unexpected end tag (noembed). +#document +| <html> +| <head> +| <body> +| <noembed> +| "<!--<noembed>" +| "-->" + +#data +<!doctype html><table> + +#errors +Line 2 Col 0 Unexpected end of file. Expected table content. +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <table> +| " +" + +#data +<!doctype html><table><td><span><font></span><span> +#errors +Line 1 Col 26 Unexpected table cell start tag (td) in the table body phase. +Line 1 Col 45 Unexpected end tag (span). +Line 1 Col 51 Expected closing tag. Unexpected end of file. +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <table> +| <tbody> +| <tr> +| <td> +| <span> +| <font> +| <font> +| <span> + +#data +<!doctype html><form><table></form><form></table></form> +#errors +35: Stray end tag “form”. +41: Start tag “form” seen in “table”. +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <form> +| <table> +| <form> diff --git a/Godeps/_workspace/src/golang.org/x/net/html/testdata/webkit/tests17.dat b/Godeps/_workspace/src/golang.org/x/net/html/testdata/webkit/tests17.dat new file mode 100644 index 000000000000..7b555f888ded --- /dev/null +++ b/Godeps/_workspace/src/golang.org/x/net/html/testdata/webkit/tests17.dat @@ -0,0 +1,153 @@ +#data +<!doctype html><table><tbody><select><tr> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <select> +| <table> +| <tbody> +| <tr> + +#data +<!doctype html><table><tr><select><td> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <select> +| <table> +| <tbody> +| <tr> +| <td> + +#data +<!doctype html><table><tr><td><select><td> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <table> +| <tbody> +| <tr> +| <td> +| <select> +| <td> + +#data +<!doctype html><table><tr><th><select><td> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <table> +| <tbody> +| <tr> +| <th> +| <select> +| <td> + +#data +<!doctype html><table><caption><select><tr> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <table> +| <caption> +| <select> +| <tbody> +| <tr> + +#data +<!doctype html><select><tr> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <select> + +#data +<!doctype html><select><td> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <select> + +#data +<!doctype html><select><th> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <select> + +#data +<!doctype html><select><tbody> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <select> + +#data +<!doctype html><select><thead> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <select> + +#data +<!doctype html><select><tfoot> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <select> + +#data +<!doctype html><select><caption> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <select> + +#data +<!doctype html><table><tr></table>a +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <table> +| <tbody> +| <tr> +| "a" diff --git a/Godeps/_workspace/src/golang.org/x/net/html/testdata/webkit/tests18.dat b/Godeps/_workspace/src/golang.org/x/net/html/testdata/webkit/tests18.dat new file mode 100644 index 000000000000..680e1f068a65 --- /dev/null +++ b/Godeps/_workspace/src/golang.org/x/net/html/testdata/webkit/tests18.dat @@ -0,0 +1,269 @@ +#data +<!doctype html><plaintext></plaintext> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <plaintext> +| "</plaintext>" + +#data +<!doctype html><table><plaintext></plaintext> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <plaintext> +| "</plaintext>" +| <table> + +#data +<!doctype html><table><tbody><plaintext></plaintext> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <plaintext> +| "</plaintext>" +| <table> +| <tbody> + +#data +<!doctype html><table><tbody><tr><plaintext></plaintext> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <plaintext> +| "</plaintext>" +| <table> +| <tbody> +| <tr> + +#data +<!doctype html><table><tbody><tr><plaintext></plaintext> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <plaintext> +| "</plaintext>" +| <table> +| <tbody> +| <tr> + +#data +<!doctype html><table><td><plaintext></plaintext> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <table> +| <tbody> +| <tr> +| <td> +| <plaintext> +| "</plaintext>" + +#data +<!doctype html><table><caption><plaintext></plaintext> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <table> +| <caption> +| <plaintext> +| "</plaintext>" + +#data +<!doctype html><table><tr><style></script></style>abc +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| "abc" +| <table> +| <tbody> +| <tr> +| <style> +| "</script>" + +#data +<!doctype html><table><tr><script></style></script>abc +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| "abc" +| <table> +| <tbody> +| <tr> +| <script> +| "</style>" + +#data +<!doctype html><table><caption><style></script></style>abc +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <table> +| <caption> +| <style> +| "</script>" +| "abc" + +#data +<!doctype html><table><td><style></script></style>abc +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <table> +| <tbody> +| <tr> +| <td> +| <style> +| "</script>" +| "abc" + +#data +<!doctype html><select><script></style></script>abc +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <select> +| <script> +| "</style>" +| "abc" + +#data +<!doctype html><table><select><script></style></script>abc +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <select> +| <script> +| "</style>" +| "abc" +| <table> + +#data +<!doctype html><table><tr><select><script></style></script>abc +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <select> +| <script> +| "</style>" +| "abc" +| <table> +| <tbody> +| <tr> + +#data +<!doctype html><frameset></frameset><noframes>abc +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <frameset> +| <noframes> +| "abc" + +#data +<!doctype html><frameset></frameset><noframes>abc</noframes><!--abc--> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <frameset> +| <noframes> +| "abc" +| <!-- abc --> + +#data +<!doctype html><frameset></frameset></html><noframes>abc +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <frameset> +| <noframes> +| "abc" + +#data +<!doctype html><frameset></frameset></html><noframes>abc</noframes><!--abc--> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <frameset> +| <noframes> +| "abc" +| <!-- abc --> + +#data +<!doctype html><table><tr></tbody><tfoot> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <table> +| <tbody> +| <tr> +| <tfoot> + +#data +<!doctype html><table><td><svg></svg>abc<td> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <table> +| <tbody> +| <tr> +| <td> +| <svg svg> +| "abc" +| <td> diff --git a/Godeps/_workspace/src/golang.org/x/net/html/testdata/webkit/tests19.dat b/Godeps/_workspace/src/golang.org/x/net/html/testdata/webkit/tests19.dat new file mode 100644 index 000000000000..0d62f5a5b02b --- /dev/null +++ b/Godeps/_workspace/src/golang.org/x/net/html/testdata/webkit/tests19.dat @@ -0,0 +1,1237 @@ +#data +<!doctype html><math><mn DefinitionUrl="foo"> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <math math> +| <math mn> +| definitionURL="foo" + +#data +<!doctype html><html></p><!--foo--> +#errors +#document +| <!DOCTYPE html> +| <html> +| <!-- foo --> +| <head> +| <body> + +#data +<!doctype html><head></head></p><!--foo--> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <!-- foo --> +| <body> + +#data +<!doctype html><body><p><pre> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <p> +| <pre> + +#data +<!doctype html><body><p><listing> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <p> +| <listing> + +#data +<!doctype html><p><plaintext> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <p> +| <plaintext> + +#data +<!doctype html><p><h1> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <p> +| <h1> + +#data +<!doctype html><form><isindex> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <form> + +#data +<!doctype html><isindex action="POST"> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <form> +| action="POST" +| <hr> +| <label> +| "This is a searchable index. Enter search keywords: " +| <input> +| name="isindex" +| <hr> + +#data +<!doctype html><isindex prompt="this is isindex"> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <form> +| <hr> +| <label> +| "this is isindex" +| <input> +| name="isindex" +| <hr> + +#data +<!doctype html><isindex type="hidden"> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <form> +| <hr> +| <label> +| "This is a searchable index. Enter search keywords: " +| <input> +| name="isindex" +| type="hidden" +| <hr> + +#data +<!doctype html><isindex name="foo"> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <form> +| <hr> +| <label> +| "This is a searchable index. Enter search keywords: " +| <input> +| name="isindex" +| <hr> + +#data +<!doctype html><ruby><p><rp> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <ruby> +| <p> +| <rp> + +#data +<!doctype html><ruby><div><span><rp> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <ruby> +| <div> +| <span> +| <rp> + +#data +<!doctype html><ruby><div><p><rp> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <ruby> +| <div> +| <p> +| <rp> + +#data +<!doctype html><ruby><p><rt> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <ruby> +| <p> +| <rt> + +#data +<!doctype html><ruby><div><span><rt> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <ruby> +| <div> +| <span> +| <rt> + +#data +<!doctype html><ruby><div><p><rt> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <ruby> +| <div> +| <p> +| <rt> + +#data +<!doctype html><math/><foo> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <math math> +| <foo> + +#data +<!doctype html><svg/><foo> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <svg svg> +| <foo> + +#data +<!doctype html><div></body><!--foo--> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <div> +| <!-- foo --> + +#data +<!doctype html><h1><div><h3><span></h1>foo +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <h1> +| <div> +| <h3> +| <span> +| "foo" + +#data +<!doctype html><p></h3>foo +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <p> +| "foo" + +#data +<!doctype html><h3><li>abc</h2>foo +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <h3> +| <li> +| "abc" +| "foo" + +#data +<!doctype html><table>abc<!--foo--> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| "abc" +| <table> +| <!-- foo --> + +#data +<!doctype html><table> <!--foo--> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <table> +| " " +| <!-- foo --> + +#data +<!doctype html><table> b <!--foo--> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| " b " +| <table> +| <!-- foo --> + +#data +<!doctype html><select><option><option> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <select> +| <option> +| <option> + +#data +<!doctype html><select><option></optgroup> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <select> +| <option> + +#data +<!doctype html><select><option></optgroup> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <select> +| <option> + +#data +<!doctype html><p><math><mi><p><h1> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <p> +| <math math> +| <math mi> +| <p> +| <h1> + +#data +<!doctype html><p><math><mo><p><h1> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <p> +| <math math> +| <math mo> +| <p> +| <h1> + +#data +<!doctype html><p><math><mn><p><h1> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <p> +| <math math> +| <math mn> +| <p> +| <h1> + +#data +<!doctype html><p><math><ms><p><h1> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <p> +| <math math> +| <math ms> +| <p> +| <h1> + +#data +<!doctype html><p><math><mtext><p><h1> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <p> +| <math math> +| <math mtext> +| <p> +| <h1> + +#data +<!doctype html><frameset></noframes> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <frameset> + +#data +<!doctype html><html c=d><body></html><html a=b> +#errors +#document +| <!DOCTYPE html> +| <html> +| a="b" +| c="d" +| <head> +| <body> + +#data +<!doctype html><html c=d><frameset></frameset></html><html a=b> +#errors +#document +| <!DOCTYPE html> +| <html> +| a="b" +| c="d" +| <head> +| <frameset> + +#data +<!doctype html><html><frameset></frameset></html><!--foo--> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <frameset> +| <!-- foo --> + +#data +<!doctype html><html><frameset></frameset></html> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <frameset> +| " " + +#data +<!doctype html><html><frameset></frameset></html>abc +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <frameset> + +#data +<!doctype html><html><frameset></frameset></html><p> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <frameset> + +#data +<!doctype html><html><frameset></frameset></html></p> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <frameset> + +#data +<html><frameset></frameset></html><!doctype html> +#errors +#document +| <html> +| <head> +| <frameset> + +#data +<!doctype html><body><frameset> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> + +#data +<!doctype html><p><frameset><frame> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <frameset> +| <frame> + +#data +<!doctype html><p>a<frameset> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <p> +| "a" + +#data +<!doctype html><p> <frameset><frame> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <frameset> +| <frame> + +#data +<!doctype html><pre><frameset> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <pre> + +#data +<!doctype html><listing><frameset> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <listing> + +#data +<!doctype html><li><frameset> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <li> + +#data +<!doctype html><dd><frameset> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <dd> + +#data +<!doctype html><dt><frameset> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <dt> + +#data +<!doctype html><button><frameset> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <button> + +#data +<!doctype html><applet><frameset> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <applet> + +#data +<!doctype html><marquee><frameset> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <marquee> + +#data +<!doctype html><object><frameset> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <object> + +#data +<!doctype html><table><frameset> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <table> + +#data +<!doctype html><area><frameset> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <area> + +#data +<!doctype html><basefont><frameset> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <basefont> +| <frameset> + +#data +<!doctype html><bgsound><frameset> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <bgsound> +| <frameset> + +#data +<!doctype html><br><frameset> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <br> + +#data +<!doctype html><embed><frameset> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <embed> + +#data +<!doctype html><img><frameset> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <img> + +#data +<!doctype html><input><frameset> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <input> + +#data +<!doctype html><keygen><frameset> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <keygen> + +#data +<!doctype html><wbr><frameset> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <wbr> + +#data +<!doctype html><hr><frameset> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <hr> + +#data +<!doctype html><textarea></textarea><frameset> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <textarea> + +#data +<!doctype html><xmp></xmp><frameset> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <xmp> + +#data +<!doctype html><iframe></iframe><frameset> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <iframe> + +#data +<!doctype html><select></select><frameset> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <select> + +#data +<!doctype html><svg></svg><frameset><frame> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <frameset> +| <frame> + +#data +<!doctype html><math></math><frameset><frame> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <frameset> +| <frame> + +#data +<!doctype html><svg><foreignObject><div> <frameset><frame> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <frameset> +| <frame> + +#data +<!doctype html><svg>a</svg><frameset><frame> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <svg svg> +| "a" + +#data +<!doctype html><svg> </svg><frameset><frame> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <frameset> +| <frame> + +#data +<html>aaa<frameset></frameset> +#errors +#document +| <html> +| <head> +| <body> +| "aaa" + +#data +<html> a <frameset></frameset> +#errors +#document +| <html> +| <head> +| <body> +| "a " + +#data +<!doctype html><div><frameset> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <frameset> + +#data +<!doctype html><div><body><frameset> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <div> + +#data +<!doctype html><p><math></p>a +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <p> +| <math math> +| "a" + +#data +<!doctype html><p><math><mn><span></p>a +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <p> +| <math math> +| <math mn> +| <span> +| <p> +| "a" + +#data +<!doctype html><math></html> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <math math> + +#data +<!doctype html><meta charset="ascii"> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <meta> +| charset="ascii" +| <body> + +#data +<!doctype html><meta http-equiv="content-type" content="text/html;charset=ascii"> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <meta> +| content="text/html;charset=ascii" +| http-equiv="content-type" +| <body> + +#data +<!doctype html><head><!--aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa--><meta charset="utf8"> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <!-- aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa --> +| <meta> +| charset="utf8" +| <body> + +#data +<!doctype html><html a=b><head></head><html c=d> +#errors +#document +| <!DOCTYPE html> +| <html> +| a="b" +| c="d" +| <head> +| <body> + +#data +<!doctype html><image/> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <img> + +#data +<!doctype html>a<i>b<table>c<b>d</i>e</b>f +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| "a" +| <i> +| "bc" +| <b> +| "de" +| "f" +| <table> + +#data +<!doctype html><table><i>a<b>b<div>c<a>d</i>e</b>f +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <i> +| "a" +| <b> +| "b" +| <b> +| <div> +| <b> +| <i> +| "c" +| <a> +| "d" +| <a> +| "e" +| <a> +| "f" +| <table> + +#data +<!doctype html><i>a<b>b<div>c<a>d</i>e</b>f +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <i> +| "a" +| <b> +| "b" +| <b> +| <div> +| <b> +| <i> +| "c" +| <a> +| "d" +| <a> +| "e" +| <a> +| "f" + +#data +<!doctype html><table><i>a<b>b<div>c</i> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <i> +| "a" +| <b> +| "b" +| <b> +| <div> +| <i> +| "c" +| <table> + +#data +<!doctype html><table><i>a<b>b<div>c<a>d</i>e</b>f +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <i> +| "a" +| <b> +| "b" +| <b> +| <div> +| <b> +| <i> +| "c" +| <a> +| "d" +| <a> +| "e" +| <a> +| "f" +| <table> + +#data +<!doctype html><table><i>a<div>b<tr>c<b>d</i>e +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <i> +| "a" +| <div> +| "b" +| <i> +| "c" +| <b> +| "d" +| <b> +| "e" +| <table> +| <tbody> +| <tr> + +#data +<!doctype html><table><td><table><i>a<div>b<b>c</i>d +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <table> +| <tbody> +| <tr> +| <td> +| <i> +| "a" +| <div> +| <i> +| "b" +| <b> +| "c" +| <b> +| "d" +| <table> + +#data +<!doctype html><body><bgsound> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <bgsound> + +#data +<!doctype html><body><basefont> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <basefont> + +#data +<!doctype html><a><b></a><basefont> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <a> +| <b> +| <basefont> + +#data +<!doctype html><a><b></a><bgsound> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <a> +| <b> +| <bgsound> + +#data +<!doctype html><figcaption><article></figcaption>a +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <figcaption> +| <article> +| "a" + +#data +<!doctype html><summary><article></summary>a +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <summary> +| <article> +| "a" + +#data +<!doctype html><p><a><plaintext>b +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <p> +| <a> +| <plaintext> +| <a> +| "b" + +#data +<!DOCTYPE html><div>a<a></div>b<p>c</p>d +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <div> +| "a" +| <a> +| <a> +| "b" +| <p> +| "c" +| "d" diff --git a/Godeps/_workspace/src/golang.org/x/net/html/testdata/webkit/tests2.dat b/Godeps/_workspace/src/golang.org/x/net/html/testdata/webkit/tests2.dat new file mode 100644 index 000000000000..60d859221624 --- /dev/null +++ b/Godeps/_workspace/src/golang.org/x/net/html/testdata/webkit/tests2.dat @@ -0,0 +1,763 @@ +#data +<!DOCTYPE html>Test +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| "Test" + +#data +<textarea>test</div>test +#errors +Line: 1 Col: 10 Unexpected start tag (textarea). Expected DOCTYPE. +Line: 1 Col: 24 Expected closing tag. Unexpected end of file. +#document +| <html> +| <head> +| <body> +| <textarea> +| "test</div>test" + +#data +<table><td> +#errors +Line: 1 Col: 7 Unexpected start tag (table). Expected DOCTYPE. +Line: 1 Col: 11 Unexpected table cell start tag (td) in the table body phase. +Line: 1 Col: 11 Expected closing tag. Unexpected end of file. +#document +| <html> +| <head> +| <body> +| <table> +| <tbody> +| <tr> +| <td> + +#data +<table><td>test</tbody></table> +#errors +Line: 1 Col: 7 Unexpected start tag (table). Expected DOCTYPE. +Line: 1 Col: 11 Unexpected table cell start tag (td) in the table body phase. +#document +| <html> +| <head> +| <body> +| <table> +| <tbody> +| <tr> +| <td> +| "test" + +#data +<frame>test +#errors +Line: 1 Col: 7 Unexpected start tag (frame). Expected DOCTYPE. +Line: 1 Col: 7 Unexpected start tag frame. Ignored. +#document +| <html> +| <head> +| <body> +| "test" + +#data +<!DOCTYPE html><frameset>test +#errors +Line: 1 Col: 29 Unepxected characters in the frameset phase. Characters ignored. +Line: 1 Col: 29 Expected closing tag. Unexpected end of file. +#document +| <!DOCTYPE html> +| <html> +| <head> +| <frameset> + +#data +<!DOCTYPE html><frameset><!DOCTYPE html> +#errors +Line: 1 Col: 40 Unexpected DOCTYPE. Ignored. +Line: 1 Col: 40 Expected closing tag. Unexpected end of file. +#document +| <!DOCTYPE html> +| <html> +| <head> +| <frameset> + +#data +<!DOCTYPE html><font><p><b>test</font> +#errors +Line: 1 Col: 38 End tag (font) violates step 1, paragraph 3 of the adoption agency algorithm. +Line: 1 Col: 38 End tag (font) violates step 1, paragraph 3 of the adoption agency algorithm. +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <font> +| <p> +| <font> +| <b> +| "test" + +#data +<!DOCTYPE html><dt><div><dd> +#errors +Line: 1 Col: 28 Missing end tag (div, dt). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <dt> +| <div> +| <dd> + +#data +<script></x +#errors +Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE. +Line: 1 Col: 11 Unexpected end of file. Expected end tag (script). +#document +| <html> +| <head> +| <script> +| "</x" +| <body> + +#data +<table><plaintext><td> +#errors +Line: 1 Col: 7 Unexpected start tag (table). Expected DOCTYPE. +Line: 1 Col: 18 Unexpected start tag (plaintext) in table context caused voodoo mode. +Line: 1 Col: 22 Unexpected end of file. Expected table content. +#document +| <html> +| <head> +| <body> +| <plaintext> +| "<td>" +| <table> + +#data +<plaintext></plaintext> +#errors +Line: 1 Col: 11 Unexpected start tag (plaintext). Expected DOCTYPE. +Line: 1 Col: 23 Expected closing tag. Unexpected end of file. +#document +| <html> +| <head> +| <body> +| <plaintext> +| "</plaintext>" + +#data +<!DOCTYPE html><table><tr>TEST +#errors +Line: 1 Col: 30 Unexpected non-space characters in table context caused voodoo mode. +Line: 1 Col: 30 Unexpected end of file. Expected table content. +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| "TEST" +| <table> +| <tbody> +| <tr> + +#data +<!DOCTYPE html><body t1=1><body t2=2><body t3=3 t4=4> +#errors +Line: 1 Col: 37 Unexpected start tag (body). +Line: 1 Col: 53 Unexpected start tag (body). +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| t1="1" +| t2="2" +| t3="3" +| t4="4" + +#data +</b test +#errors +Line: 1 Col: 8 Unexpected end of file in attribute name. +Line: 1 Col: 8 End tag contains unexpected attributes. +Line: 1 Col: 8 Unexpected end tag (b). Expected DOCTYPE. +Line: 1 Col: 8 Unexpected end tag (b) after the (implied) root element. +#document +| <html> +| <head> +| <body> + +#data +<!DOCTYPE html></b test<b &=&>X +#errors +Line: 1 Col: 32 Named entity didn't end with ';'. +Line: 1 Col: 33 End tag contains unexpected attributes. +Line: 1 Col: 33 Unexpected end tag (b) after the (implied) root element. +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| "X" + +#data +<!doctypehtml><scrIPt type=text/x-foobar;baz>X</SCRipt +#errors +Line: 1 Col: 9 No space after literal string 'DOCTYPE'. +Line: 1 Col: 54 Unexpected end of file in the tag name. +#document +| <!DOCTYPE html> +| <html> +| <head> +| <script> +| type="text/x-foobar;baz" +| "X</SCRipt" +| <body> + +#data +& +#errors +Line: 1 Col: 1 Unexpected non-space characters. Expected DOCTYPE. +#document +| <html> +| <head> +| <body> +| "&" + +#data +&# +#errors +Line: 1 Col: 1 Numeric entity expected. Got end of file instead. +Line: 1 Col: 1 Unexpected non-space characters. Expected DOCTYPE. +#document +| <html> +| <head> +| <body> +| "&#" + +#data +&#X +#errors +Line: 1 Col: 3 Numeric entity expected but none found. +Line: 1 Col: 3 Unexpected non-space characters. Expected DOCTYPE. +#document +| <html> +| <head> +| <body> +| "&#X" + +#data +&#x +#errors +Line: 1 Col: 3 Numeric entity expected but none found. +Line: 1 Col: 3 Unexpected non-space characters. Expected DOCTYPE. +#document +| <html> +| <head> +| <body> +| "&#x" + +#data +- +#errors +Line: 1 Col: 4 Numeric entity didn't end with ';'. +Line: 1 Col: 4 Unexpected non-space characters. Expected DOCTYPE. +#document +| <html> +| <head> +| <body> +| "-" + +#data +&x-test +#errors +Line: 1 Col: 1 Named entity expected. Got none. +Line: 1 Col: 1 Unexpected non-space characters. Expected DOCTYPE. +#document +| <html> +| <head> +| <body> +| "&x-test" + +#data +<!doctypehtml><p><li> +#errors +Line: 1 Col: 9 No space after literal string 'DOCTYPE'. +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <p> +| <li> + +#data +<!doctypehtml><p><dt> +#errors +Line: 1 Col: 9 No space after literal string 'DOCTYPE'. +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <p> +| <dt> + +#data +<!doctypehtml><p><dd> +#errors +Line: 1 Col: 9 No space after literal string 'DOCTYPE'. +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <p> +| <dd> + +#data +<!doctypehtml><p><form> +#errors +Line: 1 Col: 9 No space after literal string 'DOCTYPE'. +Line: 1 Col: 23 Expected closing tag. Unexpected end of file. +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <p> +| <form> + +#data +<!DOCTYPE html><p></P>X +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <p> +| "X" + +#data +& +#errors +Line: 1 Col: 4 Named entity didn't end with ';'. +Line: 1 Col: 4 Unexpected non-space characters. Expected DOCTYPE. +#document +| <html> +| <head> +| <body> +| "&" + +#data +&AMp; +#errors +Line: 1 Col: 1 Named entity expected. Got none. +Line: 1 Col: 1 Unexpected non-space characters. Expected DOCTYPE. +#document +| <html> +| <head> +| <body> +| "&AMp;" + +#data +<!DOCTYPE html><html><head></head><body><thisISasillyTESTelementNameToMakeSureCrazyTagNamesArePARSEDcorrectLY> +#errors +Line: 1 Col: 110 Expected closing tag. Unexpected end of file. +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <thisisasillytestelementnametomakesurecrazytagnamesareparsedcorrectly> + +#data +<!DOCTYPE html>X</body>X +#errors +Line: 1 Col: 24 Unexpected non-space characters in the after body phase. +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| "XX" + +#data +<!DOCTYPE html><!-- X +#errors +Line: 1 Col: 21 Unexpected end of file in comment. +#document +| <!DOCTYPE html> +| <!-- X --> +| <html> +| <head> +| <body> + +#data +<!DOCTYPE html><table><caption>test TEST</caption><td>test +#errors +Line: 1 Col: 54 Unexpected table cell start tag (td) in the table body phase. +Line: 1 Col: 58 Expected closing tag. Unexpected end of file. +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <table> +| <caption> +| "test TEST" +| <tbody> +| <tr> +| <td> +| "test" + +#data +<!DOCTYPE html><select><option><optgroup> +#errors +Line: 1 Col: 41 Expected closing tag. Unexpected end of file. +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <select> +| <option> +| <optgroup> + +#data +<!DOCTYPE html><select><optgroup><option></optgroup><option><select><option> +#errors +Line: 1 Col: 68 Unexpected select start tag in the select phase treated as select end tag. +Line: 1 Col: 76 Expected closing tag. Unexpected end of file. +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <select> +| <optgroup> +| <option> +| <option> +| <option> + +#data +<!DOCTYPE html><select><optgroup><option><optgroup> +#errors +Line: 1 Col: 51 Expected closing tag. Unexpected end of file. +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <select> +| <optgroup> +| <option> +| <optgroup> + +#data +<!DOCTYPE html><datalist><option>foo</datalist>bar +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <datalist> +| <option> +| "foo" +| "bar" + +#data +<!DOCTYPE html><font><input><input></font> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <font> +| <input> +| <input> + +#data +<!DOCTYPE html><!-- XXX - XXX --> +#errors +#document +| <!DOCTYPE html> +| <!-- XXX - XXX --> +| <html> +| <head> +| <body> + +#data +<!DOCTYPE html><!-- XXX - XXX +#errors +Line: 1 Col: 29 Unexpected end of file in comment (-) +#document +| <!DOCTYPE html> +| <!-- XXX - XXX --> +| <html> +| <head> +| <body> + +#data +<!DOCTYPE html><!-- XXX - XXX - XXX --> +#errors +#document +| <!DOCTYPE html> +| <!-- XXX - XXX - XXX --> +| <html> +| <head> +| <body> + +#data +<isindex test=x name=x> +#errors +Line: 1 Col: 23 Unexpected start tag (isindex). Expected DOCTYPE. +Line: 1 Col: 23 Unexpected start tag isindex. Don't use it! +#document +| <html> +| <head> +| <body> +| <form> +| <hr> +| <label> +| "This is a searchable index. Enter search keywords: " +| <input> +| name="isindex" +| test="x" +| <hr> + +#data +test +test +#errors +Line: 2 Col: 4 Unexpected non-space characters. Expected DOCTYPE. +#document +| <html> +| <head> +| <body> +| "test +test" + +#data +<!DOCTYPE html><body><title>test</body> +#errors +#document +| +| +| +| +| +| "test</body>" + +#data +<!DOCTYPE html><body><title>X +#errors +#document +| +| +| +| +| +| "X" +| <meta> +| name="z" +| <link> +| rel="foo" +| <style> +| " +x { content:"</style" } " + +#data +<!DOCTYPE html><select><optgroup></optgroup></select> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> +| <select> +| <optgroup> + +#data + + +#errors +Line: 2 Col: 1 Unexpected End of file. Expected DOCTYPE. +#document +| <html> +| <head> +| <body> + +#data +<!DOCTYPE html> <html> +#errors +#document +| <!DOCTYPE html> +| <html> +| <head> +| <body> + +#data +<!DOCTYPE html><script> +</script> <title>x +#errors +#document +| +| +| +| +#errors +Line: 1 Col: 6 Unexpected start tag (head). Expected DOCTYPE. +Line: 1 Col: 21 Unexpected start tag (script) that can be in head. Moved. +#document +| +| +| +#errors +Line: 1 Col: 6 Unexpected start tag (head). Expected DOCTYPE. +Line: 1 Col: 28 Unexpected start tag (style) that can be in head. Moved. +#document +| +| +| +#errors +Line: 1 Col: 6 Unexpected start tag (head). Expected DOCTYPE. +#document +| +| +| +| +| "x" +| x +#errors +Line: 1 Col: 7 Unexpected start tag (style). Expected DOCTYPE. +Line: 1 Col: 22 Unexpected end of file. Expected end tag (style). +#document +| +| +| --> x +#errors +Line: 1 Col: 7 Unexpected start tag (style). Expected DOCTYPE. +#document +| +| +| x +#errors +Line: 1 Col: 7 Unexpected start tag (style). Expected DOCTYPE. +#document +| +| +| x +#errors +Line: 1 Col: 7 Unexpected start tag (style). Expected DOCTYPE. +#document +| +| +| x +#errors +Line: 1 Col: 7 Unexpected start tag (style). Expected DOCTYPE. +#document +| +| +|

+#errors +#document +| +| +| +| +| +| ddd +#errors +#document +| +| +| +#errors +#document +| +| +| +| +|
  • +| +| - - - -
  • ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameDescriptionRequiredSchemaDefault

    kind

    kind of object, in CamelCase; cannot be updated; see http://kubernetes.io/v1.0/docs/devel/api-conventions.html#types-kinds

    false

    string

    apiVersion

    version of the schema the object should have; see http://kubernetes.io/v1.0/docs/devel/api-conventions.html#resources

    false

    string

    metadata

    standard object metadata; see http://kubernetes.io/v1.0/docs/devel/api-conventions.html#metadata

    false

    v1.ObjectMeta

    spec

    specification of a node; http://kubernetes.io/v1.0/docs/devel/api-conventions.html#spec-and-status

    false

    v1.NodeSpec

    status

    most recently observed status of the node; populated by the system, read-only; http://kubernetes.io/v1.0/docs/devel/api-conventions.html#spec-and-status

    false

    v1.NodeStatus

    - - -

    -

    v1.PersistentVolumeClaimList

    - ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameDescriptionRequiredSchemaDefault

    kind

    kind of object, in CamelCase; cannot be updated; see http://kubernetes.io/v1.0/docs/devel/api-conventions.html#types-kinds

    false

    string

    apiVersion

    version of the schema the object should have; see http://kubernetes.io/v1.0/docs/devel/api-conventions.html#resources

    false

    string

    metadata

    standard list metadata; see http://kubernetes.io/v1.0/docs/devel/api-conventions.html#types-kinds

    false

    v1.ListMeta

    items

    a list of persistent volume claims; see http://kubernetes.io/v1.0/docs/user-guide/persistent-volumes.html#persistentvolumeclaims

    false

    v1.PersistentVolumeClaim array

    - -
    -
    -

    v1.ObjectFieldSelector

    - ------- - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameDescriptionRequiredSchemaDefault

    apiVersion

    version of the schema that fieldPath is written in terms of; defaults to v1

    false

    string

    fieldPath

    path of the field to select in the specified API version

    true

    string

    - -
    -
    -

    v1.SELinuxOptions

    - ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameDescriptionRequiredSchemaDefault

    user

    the user label to apply to the container; see http://kubernetes.io/v1.0/docs/user-guide/labels.html

    false

    string

    role

    the role label to apply to the container; see http://kubernetes.io/v1.0/docs/user-guide/labels.html

    false

    string

    type

    the type label to apply to the container; see http://kubernetes.io/v1.0/docs/user-guide/labels.html

    false

    string

    level

    the level label to apply to the container; see http://kubernetes.io/v1.0/docs/user-guide/labels.html

    false

    string

    - -
    -
    -

    v1.ContainerStateRunning

    - ------- - - - - - - - - - - - - - - - - - - -
    NameDescriptionRequiredSchemaDefault

    startedAt

    time at which the container was last (re-)started

    false

    string

    - -
    -
    -

    v1.VolumeMount

    - ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameDescriptionRequiredSchemaDefault

    name

    name of the volume to mount

    true

    string

    readOnly

    mounted read-only if true, read-write otherwise (false or unspecified)

    false

    boolean

    false

    mountPath

    path within the container at which the volume should be mounted

    true

    string

    - -
    -
    -

    v1.PersistentVolumeClaimSpec

    - ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameDescriptionRequiredSchemaDefault

    accessModes

    the desired access modes the volume should have; see http://kubernetes.io/v1.0/docs/user-guide/persistent-volumes.html#access-modes-1

    false

    v1.PersistentVolumeAccessMode array

    resources

    the desired resources the volume should have; see http://kubernetes.io/v1.0/docs/user-guide/persistent-volumes.html#resources

    false

    v1.ResourceRequirements

    volumeName

    the binding reference to the persistent volume backing this claim

    false

    string

    - -
    -
    -

    v1.GCEPersistentDiskVolumeSource

    - ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameDescriptionRequiredSchemaDefault

    pdName

    unique name of the PD resource in GCE; see http://kubernetes.io/v1.0/docs/user-guide/volumes.html#gcepersistentdisk

    true

    string

    fsType

    file system type to mount, such as ext4, xfs, ntfs; see http://kubernetes.io/v1.0/docs/user-guide/volumes.html#gcepersistentdisk

    true

    string

    partition

    partition on the disk to mount (e.g., 1 for /dev/sda1); if omitted the plain device name (e.g., /dev/sda) will be mounted; see http://kubernetes.io/v1.0/docs/user-guide/volumes.html#gcepersistentdisk

    false

    integer (int32)

    readOnly

    read-only if true, read-write otherwise (false or unspecified); see http://kubernetes.io/v1.0/docs/user-guide/volumes.html#gcepersistentdisk

    false

    boolean

    false

    - -
    -
    -

    v1.NamespaceStatus

    - ------- - - - - - - - - - - - - - - - - - - -
    NameDescriptionRequiredSchemaDefault

    phase

    phase is the current lifecycle phase of the namespace; see http://kubernetes.io/v1.0/docs/design/namespaces.html#phases

    false

    string

    - -
    -
    -

    v1.ResourceQuotaSpec

    - ------- - - - - - - - - - - - - - - - - - - -
    NameDescriptionRequiredSchemaDefault

    hard

    hard is the set of desired hard limits for each named resource; see http://kubernetes.io/v1.0/docs/design/admission_control_resource_quota.html#admissioncontrol-plugin-resourcequota

    false

    any

    - -
    -
    -

    v1.NamespaceSpec

    - ------- - - - - - - - - - - - - - - - - - - -
    NameDescriptionRequiredSchemaDefault

    finalizers

    an opaque list of values that must be empty to permanently remove object from storage; see http://kubernetes.io/v1.0/docs/design/namespaces.html#finalizers

    false

    v1.FinalizerName array

    - -
    -
    -

    v1.PersistentVolume

    - ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameDescriptionRequiredSchemaDefault

    kind

    kind of object, in CamelCase; cannot be updated; see http://kubernetes.io/v1.0/docs/devel/api-conventions.html#types-kinds

    false

    string

    apiVersion

    version of the schema the object should have; see http://kubernetes.io/v1.0/docs/devel/api-conventions.html#resources

    false

    string

    metadata

    standard object metadata; see http://kubernetes.io/v1.0/docs/devel/api-conventions.html#metadata

    false

    v1.ObjectMeta

    spec

    specification of a persistent volume as provisioned by an administrator; see http://kubernetes.io/v1.0/docs/user-guide/persistent-volumes.html#persistent-volumes

    false

    v1.PersistentVolumeSpec

    status

    current status of a persistent volume; populated by the system, read-only; see http://kubernetes.io/v1.0/docs/user-guide/persistent-volumes.html#persistent-volumes

    false

    v1.PersistentVolumeStatus

    - -
    -
    -

    v1.PersistentVolumeStatus

    - ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameDescriptionRequiredSchemaDefault

    phase

    the current phase of a persistent volume; see http://kubernetes.io/v1.0/docs/user-guide/persistent-volumes.html#phase

    false

    string

    message

    human-readable message indicating details about why the volume is in this state

    false

    string

    reason

    (brief) reason the volume is not is not available

    false

    string

    - -
    -
    -

    v1.EndpointsList

    - ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameDescriptionRequiredSchemaDefault

    kind

    kind of object, in CamelCase; cannot be updated; see http://kubernetes.io/v1.0/docs/devel/api-conventions.html#types-kinds

    false

    string

    apiVersion

    version of the schema the object should have; see http://kubernetes.io/v1.0/docs/devel/api-conventions.html#resources

    false

    string

    metadata

    standard list metadata; see http://kubernetes.io/v1.0/docs/devel/api-conventions.html#metadata

    false

    v1.ListMeta

    items

    list of endpoints

    true

    v1.Endpoints array

    - -
    -
    -

    v1.GitRepoVolumeSource

    - ------- - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameDescriptionRequiredSchemaDefault

    repository

    repository URL

    true

    string

    revision

    commit hash for the specified revision

    true

    string

    - -
    -
    -

    v1.Capabilities

    - ------- - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameDescriptionRequiredSchemaDefault

    add

    added capabilities

    false

    v1.Capability array

    drop

    droped capabilities

    false

    v1.Capability array

    - -
    -
    -

    v1.NodeCondition

    - ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameDescriptionRequiredSchemaDefault

    type

    type of node condition, currently only Ready

    true

    string

    status

    status of the condition, one of True, False, Unknown

    true

    string

    lastHeartbeatTime

    last time we got an update on a given condition

    false

    string

    lastTransitionTime

    last time the condition transit from one status to another

    false

    string

    reason

    (brief) reason for the condition’s last transition

    false

    string

    message

    human readable message indicating details about last transition

    false

    string

    - -
    -
    -

    v1.PodTemplateList

    - ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameDescriptionRequiredSchemaDefault

    kind

    kind of object, in CamelCase; cannot be updated; see http://kubernetes.io/v1.0/docs/devel/api-conventions.html#types-kinds

    false

    string

    apiVersion

    version of the schema the object should have; see http://kubernetes.io/v1.0/docs/devel/api-conventions.html#resources

    false

    string

    metadata

    standard list metadata; see http://kubernetes.io/v1.0/docs/devel/api-conventions.html#metadata

    false

    v1.ListMeta

    items

    list of pod templates

    true

    v1.PodTemplate array

    - -
    -
    -

    v1.LocalObjectReference

    - ------- - - - - - - - - - - - - - - - - - - -
    NameDescriptionRequiredSchemaDefault

    name

    name of the referent; see http://kubernetes.io/v1.0/docs/user-guide/identifiers.html#names

    false

    string

    - -
    -
    -

    v1.ResourceQuotaStatus

    - ------- - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameDescriptionRequiredSchemaDefault

    hard

    hard is the set of enforced hard limits for each named resource; see http://kubernetes.io/v1.0/docs/design/admission_control_resource_quota.html#admissioncontrol-plugin-resourcequota

    false

    any

    used

    used is the current observed total usage of the resource in the namespace

    false

    any

    - -
    -
    -

    v1.ExecAction

    - ------- - - - - - - - - - - - - - - - - - - -
    NameDescriptionRequiredSchemaDefault

    command

    command line to execute inside the container; working directory for the command is root (/) in the container’s file system; the command is exec’d, not run inside a shell; exit status of 0 is treated as live/healthy and non-zero is unhealthy

    false

    string array

    - -
    -
    -

    v1.ObjectMeta

    - ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameDescriptionRequiredSchemaDefault

    name

    string that identifies an object. Must be unique within a namespace; cannot be updated; see http://kubernetes.io/v1.0/docs/user-guide/identifiers.html#names

    false

    string

    generateName

    an optional prefix to use to generate a unique name; has the same validation rules as name; optional, and is applied only name if is not specified; see http://kubernetes.io/v1.0/docs/devel/api-conventions.html#idempotency

    false

    string

    namespace

    namespace of the object; must be a DNS_LABEL; cannot be updated; see http://kubernetes.io/v1.0/docs/user-guide/namespaces.html

    false

    string

    selfLink

    URL for the object; populated by the system, read-only

    false

    string

    uid

    unique UUID across space and time; populated by the system; read-only; see http://kubernetes.io/v1.0/docs/user-guide/identifiers.html#uids

    false

    string

    resourceVersion

    string that identifies the internal version of this object that can be used by clients to determine when objects have changed; populated by the system, read-only; value must be treated as opaque by clients and passed unmodified back to the server: http://kubernetes.io/v1.0/docs/devel/api-conventions.html#concurrency-control-and-consistency

    false

    string

    generation

    a sequence number representing a specific generation of the desired state; populated by the system; read-only

    false

    integer (int64)

    creationTimestamp

    RFC 3339 date and time at which the object was created; populated by the system, read-only; null for lists; see http://kubernetes.io/v1.0/docs/devel/api-conventions.html#metadata

    false

    string

    deletionTimestamp

    RFC 3339 date and time at which the object will be deleted; populated by the system when a graceful deletion is requested, read-only; if not set, graceful deletion of the object has not been requested; see http://kubernetes.io/v1.0/docs/devel/api-conventions.html#metadata

    false

    string

    labels

    map of string keys and values that can be used to organize and categorize objects; may match selectors of replication controllers and services; see http://kubernetes.io/v1.0/docs/user-guide/labels.html

    false

    any

    annotations

    map of string keys and values that can be used by external tooling to store and retrieve arbitrary metadata about objects; see http://kubernetes.io/v1.0/docs/user-guide/annotations.html

    false

    any

    - -
    -
    -

    api.Patch

    - -
    -
    -

    v1.LimitRangeSpec

    - ------- - - - - - - - - - - - - - - - - - - -
    NameDescriptionRequiredSchemaDefault

    limits

    limits is the list of LimitRangeItem objects that are enforced

    true

    v1.LimitRangeItem array

    - -
    -
    -

    v1.ISCSIVolumeSource

    - ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameDescriptionRequiredSchemaDefault

    targetPortal

    iSCSI target portal

    true

    string

    iqn

    iSCSI Qualified Name

    true

    string

    lun

    iscsi target lun number

    true

    integer (int32)

    fsType

    file system type to mount, such as ext4, xfs, ntfs

    true

    string

    readOnly

    read-only if true, read-write otherwise (false or unspecified)

    false

    boolean

    false

    - -
    -
    -

    v1.EmptyDirVolumeSource

    - ------- - - - - - - - - - - - - - - - - - - -
    NameDescriptionRequiredSchemaDefault

    medium

    type of storage used to back the volume; must be an empty string (default) or Memory; see http://kubernetes.io/v1.0/docs/user-guide/volumes.html#emptydir

    false

    string

    - -
    -
    -

    v1.NodeList

    - ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameDescriptionRequiredSchemaDefault

    kind

    kind of object, in CamelCase; cannot be updated; see http://kubernetes.io/v1.0/docs/devel/api-conventions.html#types-kinds

    false

    string

    apiVersion

    version of the schema the object should have; see http://kubernetes.io/v1.0/docs/devel/api-conventions.html#resources

    false

    string

    metadata

    standard list metadata; see http://kubernetes.io/v1.0/docs/devel/api-conventions.html#metadata

    false

    v1.ListMeta

    items

    list of nodes

    true

    v1.Node array

    - -
    -
    -

    v1.PersistentVolumeClaim

    - ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameDescriptionRequiredSchemaDefault

    kind

    kind of object, in CamelCase; cannot be updated; see http://kubernetes.io/v1.0/docs/devel/api-conventions.html#types-kinds

    false

    string

    apiVersion

    version of the schema the object should have; see http://kubernetes.io/v1.0/docs/devel/api-conventions.html#resources

    false

    string

    metadata

    standard object metadata; see http://kubernetes.io/v1.0/docs/devel/api-conventions.html#metadata

    false

    v1.ObjectMeta

    spec

    the desired characteristics of a volume; see http://kubernetes.io/v1.0/docs/user-guide/persistent-volumes.html#persistentvolumeclaims

    false

    v1.PersistentVolumeClaimSpec

    status

    the current status of a persistent volume claim; read-only; see http://kubernetes.io/v1.0/docs/user-guide/persistent-volumes.html#persistentvolumeclaims

    false

    v1.PersistentVolumeClaimStatus

    - -
    -
    -

    v1.NamespaceList

    - ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameDescriptionRequiredSchemaDefault

    kind

    kind of object, in CamelCase; cannot be updated; see http://kubernetes.io/v1.0/docs/devel/api-conventions.html#types-kinds

    false

    string

    apiVersion

    version of the schema the object should have; see http://kubernetes.io/v1.0/docs/devel/api-conventions.html#resources

    false

    string

    metadata

    standard list metadata; see http://kubernetes.io/v1.0/docs/devel/api-conventions.html#metadata

    false

    v1.ListMeta

    items

    items is the list of Namespace objects in the list; see http://kubernetes.io/v1.0/docs/user-guide/namespaces.html

    true

    v1.Namespace array

    - -
    -
    -

    v1.ServiceAccount

    - ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameDescriptionRequiredSchemaDefault

    kind

    kind of object, in CamelCase; cannot be updated; see http://kubernetes.io/v1.0/docs/devel/api-conventions.html#types-kinds

    false

    string

    apiVersion

    version of the schema the object should have; see http://kubernetes.io/v1.0/docs/devel/api-conventions.html#resources

    false

    string

    metadata

    standard object metadata; see http://kubernetes.io/v1.0/docs/devel/api-conventions.html#metadata

    false

    v1.ObjectMeta

    secrets

    list of secrets that can be used by pods running as this service account; see http://kubernetes.io/v1.0/docs/user-guide/secrets.html

    false

    v1.ObjectReference array

    imagePullSecrets

    list of references to secrets in the same namespace available for pulling container images; see http://kubernetes.io/v1.0/docs/user-guide/secrets.html#manually-specifying-an-imagepullsecret

    false

    v1.LocalObjectReference array

    - -
    -
    -

    v1.NodeAddress

    - ------- - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameDescriptionRequiredSchemaDefault

    type

    node address type, one of Hostname, ExternalIP or InternalIP

    true

    string

    address

    the node address

    true

    string

    - -
    -
    -

    v1.Namespace

    - ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameDescriptionRequiredSchemaDefault

    kind

    kind of object, in CamelCase; cannot be updated; see http://kubernetes.io/v1.0/docs/devel/api-conventions.html#types-kinds

    false

    string

    apiVersion

    version of the schema the object should have; see http://kubernetes.io/v1.0/docs/devel/api-conventions.html#resources

    false

    string

    metadata

    standard object metadata; see http://kubernetes.io/v1.0/docs/devel/api-conventions.html#metadata

    false

    v1.ObjectMeta

    spec

    spec defines the behavior of the Namespace; http://kubernetes.io/v1.0/docs/devel/api-conventions.html#spec-and-status

    false

    v1.NamespaceSpec

    status

    status describes the current status of a Namespace; http://kubernetes.io/v1.0/docs/devel/api-conventions.html#spec-and-status

    false

    v1.NamespaceStatus

    - -
    -
    -

    v1.ListMeta

    - ------- - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameDescriptionRequiredSchemaDefault

    selfLink

    URL for the object; populated by the system, read-only

    false

    string

    resourceVersion

    string that identifies the internal version of this object that can be used by clients to determine when objects have changed; populated by the system, read-only; value must be treated as opaque by clients and passed unmodified back to the server: http://kubernetes.io/v1.0/docs/devel/api-conventions.html#concurrency-control-and-consistency

    false

    string

    - -
    -
    -

    v1.PersistentVolumeClaimVolumeSource

    - ------- - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameDescriptionRequiredSchemaDefault

    claimName

    the name of the claim in the same namespace to be mounted as a volume; see http://kubernetes.io/v1.0/docs/user-guide/persistent-volumes.html#persistentvolumeclaims

    true

    string

    readOnly

    mount volume as read-only when true; default false

    false

    boolean

    false

    - -
    -
    -

    v1.PersistentVolumeClaimStatus

    - ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameDescriptionRequiredSchemaDefault

    phase

    the current phase of the claim

    false

    string

    accessModes

    the actual access modes the volume has; see http://kubernetes.io/v1.0/docs/user-guide/persistent-volumes.html#access-modes-1

    false

    v1.PersistentVolumeAccessMode array

    capacity

    the actual resources the volume has

    false

    any

    - -
    -
    -

    v1.ResourceQuotaList

    - ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameDescriptionRequiredSchemaDefault

    kind

    kind of object, in CamelCase; cannot be updated; see http://kubernetes.io/v1.0/docs/devel/api-conventions.html#types-kinds

    false

    string

    apiVersion

    version of the schema the object should have; see http://kubernetes.io/v1.0/docs/devel/api-conventions.html#resources

    false

    string

    metadata

    standard list metadata; see http://kubernetes.io/v1.0/docs/devel/api-conventions.html#metadata

    false

    v1.ListMeta

    items

    items is a list of ResourceQuota objects; see http://kubernetes.io/v1.0/docs/design/admission_control_resource_quota.html#admissioncontrol-plugin-resourcequota

    true

    v1.ResourceQuota array

    - -
    -
    -

    v1.EndpointSubset

    - ------- - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameDescriptionRequiredSchemaDefault

    addresses

    IP addresses which offer the related ports

    false

    v1.EndpointAddress array

    ports

    port numbers available on the related IP addresses

    false

    v1.EndpointPort array

    - -
    -
    -

    v1.SecretVolumeSource

    - ------- - - - - - - - - - - - - - - - - - - -
    NameDescriptionRequiredSchemaDefault

    secretName

    secretName is the name of a secret in the pod’s namespace; see http://kubernetes.io/v1.0/docs/user-guide/volumes.html#secrets

    true

    string

    - -
    -
    -

    v1.EnvVarSource

    - ------- - - - - - - - - - - - - - - - - - - -
    NameDescriptionRequiredSchemaDefault

    fieldRef

    selects a field of the pod; only name and namespace are supported

    true

    v1.ObjectFieldSelector

    - -
    -
    -

    v1.LoadBalancerIngress

    - ------- - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameDescriptionRequiredSchemaDefault

    ip

    IP address of ingress point

    false

    string

    hostname

    hostname of ingress point

    false

    string

    - -
    -
    -

    v1.Service

    - ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameDescriptionRequiredSchemaDefault

    kind

    kind of object, in CamelCase; cannot be updated; see http://kubernetes.io/v1.0/docs/devel/api-conventions.html#types-kinds

    false

    string

    apiVersion

    version of the schema the object should have; see http://kubernetes.io/v1.0/docs/devel/api-conventions.html#resources

    false

    string

    metadata

    standard object metadata; see http://kubernetes.io/v1.0/docs/devel/api-conventions.html#metadata

    false

    v1.ObjectMeta

    spec

    specification of the desired behavior of the service; http://kubernetes.io/v1.0/docs/devel/api-conventions.html#spec-and-status

    false

    v1.ServiceSpec

    status

    most recently observed status of the service; populated by the system, read-only; http://kubernetes.io/v1.0/docs/devel/api-conventions.html#spec-and-status

    false

    v1.ServiceStatus

    - -
    -
    -

    v1.ServiceAccountList

    - ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameDescriptionRequiredSchemaDefault

    kind

    kind of object, in CamelCase; cannot be updated; see http://kubernetes.io/v1.0/docs/devel/api-conventions.html#types-kinds

    false

    string

    apiVersion

    version of the schema the object should have; see http://kubernetes.io/v1.0/docs/devel/api-conventions.html#resources

    false

    string

    metadata

    standard list metadata; see http://kubernetes.io/v1.0/docs/devel/api-conventions.html#metadata

    false

    v1.ListMeta

    items

    list of ServiceAccounts; see http://kubernetes.io/v1.0/docs/design/service_accounts.html#service-accounts

    true

    v1.ServiceAccount array

    - -
    -
    -

    v1.LimitRangeList

    - ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameDescriptionRequiredSchemaDefault

    kind

    kind of object, in CamelCase; cannot be updated; see http://kubernetes.io/v1.0/docs/devel/api-conventions.html#types-kinds

    false

    string

    apiVersion

    version of the schema the object should have; see http://kubernetes.io/v1.0/docs/devel/api-conventions.html#resources

    false

    string

    metadata

    standard list metadata; see http://kubernetes.io/v1.0/docs/devel/api-conventions.html#metadata

    false

    v1.ListMeta

    items

    items is a list of LimitRange objects; see http://kubernetes.io/v1.0/docs/design/admission_control_limit_range.html

    true

    v1.LimitRange array

    - -
    -
    -

    v1.Endpoints

    - ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameDescriptionRequiredSchemaDefault

    kind

    kind of object, in CamelCase; cannot be updated; see http://kubernetes.io/v1.0/docs/devel/api-conventions.html#types-kinds

    false

    string

    apiVersion

    version of the schema the object should have; see http://kubernetes.io/v1.0/docs/devel/api-conventions.html#resources

    false

    string

    metadata

    standard object metadata; see http://kubernetes.io/v1.0/docs/devel/api-conventions.html#metadata

    false

    v1.ObjectMeta

    subsets

    sets of addresses and ports that comprise a service

    true

    v1.EndpointSubset array

    - -
    -
    -

    v1.DeleteOptions

    - ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameDescriptionRequiredSchemaDefault

    kind

    kind of object, in CamelCase; cannot be updated; see http://kubernetes.io/v1.0/docs/devel/api-conventions.html#types-kinds

    false

    string

    apiVersion

    version of the schema the object should have; see http://kubernetes.io/v1.0/docs/devel/api-conventions.html#resources

    false

    string

    gracePeriodSeconds

    the duration in seconds to wait before deleting this object; defaults to a per object value if not specified; zero means delete immediately

    true

    integer (int64)

    - -
    -
    -

    v1.Volume

    - ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameDescriptionRequiredSchemaDefault

    name

    volume name; must be a DNS_LABEL and unique within the pod; see http://kubernetes.io/v1.0/docs/user-guide/identifiers.html#names

    true

    string

    hostPath

    pre-existing host file or directory; generally for privileged system daemons or other agents tied to the host; see http://kubernetes.io/v1.0/docs/user-guide/volumes.html#hostpath

    false

    v1.HostPathVolumeSource

    emptyDir

    temporary directory that shares a pod’s lifetime; see http://kubernetes.io/v1.0/docs/user-guide/volumes.html#emptydir

    false

    v1.EmptyDirVolumeSource

    gcePersistentDisk

    GCE disk resource attached to the host machine on demand; see http://kubernetes.io/v1.0/docs/user-guide/volumes.html#gcepersistentdisk

    false

    v1.GCEPersistentDiskVolumeSource

    awsElasticBlockStore

    AWS disk resource attached to the host machine on demand; see http://kubernetes.io/v1.0/docs/user-guide/volumes.html#awselasticblockstore

    false

    v1.AWSElasticBlockStoreVolumeSource

    gitRepo

    git repository at a particular revision

    false

    v1.GitRepoVolumeSource

    secret

    secret to populate volume; see http://kubernetes.io/v1.0/docs/user-guide/volumes.html#secrets

    false

    v1.SecretVolumeSource

    nfs

    NFS volume that will be mounted in the host machine; see http://kubernetes.io/v1.0/docs/user-guide/volumes.html#nfs

    false

    v1.NFSVolumeSource

    iscsi

    iSCSI disk attached to host machine on demand; see http://kubernetes.io/v1.0/examples/iscsi/README.html

    false

    v1.ISCSIVolumeSource

    glusterfs

    Glusterfs volume that will be mounted on the host machine; see http://kubernetes.io/v1.0/examples/glusterfs/README.html

    false

    v1.GlusterfsVolumeSource

    persistentVolumeClaim

    a reference to a PersistentVolumeClaim in the same namespace; see http://kubernetes.io/v1.0/docs/user-guide/persistent-volumes.html#persistentvolumeclaims

    false

    v1.PersistentVolumeClaimVolumeSource

    rbd

    rados block volume that will be mounted on the host machine; see http://kubernetes.io/v1.0/examples/rbd/README.html

    false

    v1.RBDVolumeSource

    - -
    -
    -

    v1.Probe

    - ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameDescriptionRequiredSchemaDefault

    exec

    exec-based handler

    false

    v1.ExecAction

    httpGet

    HTTP-based handler

    false

    v1.HTTPGetAction

    tcpSocket

    TCP-based handler; TCP hooks not yet supported

    false

    v1.TCPSocketAction

    initialDelaySeconds

    number of seconds after the container has started before liveness probes are initiated; see http://kubernetes.io/v1.0/docs/user-guide/pod-states.html#container-probes

    false

    integer (int64)

    timeoutSeconds

    number of seconds after which liveness probes timeout; defaults to 1 second; see http://kubernetes.io/v1.0/docs/user-guide/pod-states.html#container-probes

    false

    integer (int64)

    - -
    -
    -

    v1.Capability

    - -
    -
    -

    v1.ReplicationController

    - ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameDescriptionRequiredSchemaDefault

    kind

    kind of object, in CamelCase; cannot be updated; see http://kubernetes.io/v1.0/docs/devel/api-conventions.html#types-kinds

    false

    string

    apiVersion

    version of the schema the object should have; see http://kubernetes.io/v1.0/docs/devel/api-conventions.html#resources

    false

    string

    metadata

    standard object metadata; see http://kubernetes.io/v1.0/docs/devel/api-conventions.html#metadata

    false

    v1.ObjectMeta

    spec

    specification of the desired behavior of the replication controller; http://kubernetes.io/v1.0/docs/devel/api-conventions.html#spec-and-status

    false

    v1.ReplicationControllerSpec

    status

    most recently observed status of the replication controller; populated by the system, read-only; http://kubernetes.io/v1.0/docs/devel/api-conventions.html#spec-and-status

    false

    v1.ReplicationControllerStatus

    - -
    -
    -

    v1.LimitRange

    - ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameDescriptionRequiredSchemaDefault

    kind

    kind of object, in CamelCase; cannot be updated; see http://kubernetes.io/v1.0/docs/devel/api-conventions.html#types-kinds

    false

    string

    apiVersion

    version of the schema the object should have; see http://kubernetes.io/v1.0/docs/devel/api-conventions.html#resources

    false

    string

    metadata

    standard object metadata; see http://kubernetes.io/v1.0/docs/devel/api-conventions.html#metadata

    false

    v1.ObjectMeta

    spec

    spec defines the limits enforced; http://kubernetes.io/v1.0/docs/devel/api-conventions.html#spec-and-status

    false

    v1.LimitRangeSpec

    - -
    -
    -

    v1.PodStatus

    - ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameDescriptionRequiredSchemaDefault

    phase

    current condition of the pod; see http://kubernetes.io/v1.0/docs/user-guide/pod-states.html#pod-phase

    false

    string

    conditions

    current service state of pod; see http://kubernetes.io/v1.0/docs/user-guide/pod-states.html#pod-conditions

    false

    v1.PodCondition array

    message

    human readable message indicating details about why the pod is in this condition

    false

    string

    reason

    (brief-CamelCase) reason indicating details about why the pod is in this condition

    false

    string

    hostIP

    IP address of the host to which the pod is assigned; empty if not yet scheduled

    false

    string

    podIP

    IP address allocated to the pod; routable at least within the cluster; empty if not yet allocated

    false

    string

    startTime

    RFC 3339 date and time at which the object was acknowledged by the Kubelet. This is before the Kubelet pulled the container image(s) for the pod.

    false

    string

    containerStatuses

    list of container statuses; see http://kubernetes.io/v1.0/docs/user-guide/pod-states.html#container-statuses

    false

    v1.ContainerStatus array

    - -
    -
    -

    v1.PodSpec

    - ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameDescriptionRequiredSchemaDefault

    volumes

    list of volumes that can be mounted by containers belonging to the pod; see http://kubernetes.io/v1.0/docs/user-guide/volumes.html

    false

    v1.Volume array

    containers

    list of containers belonging to the pod; cannot be updated; containers cannot currently be added or removed; there must be at least one container in a Pod; see http://kubernetes.io/v1.0/docs/user-guide/containers.html

    true

    v1.Container array

    restartPolicy

    restart policy for all containers within the pod; one of Always, OnFailure, Never; defaults to Always; see http://kubernetes.io/v1.0/docs/user-guide/pod-states.html#restartpolicy

    false

    string

    terminationGracePeriodSeconds

    optional duration in seconds the pod needs to terminate gracefully; may be decreased in delete request; value must be non-negative integer; the value zero indicates delete immediately; if this value is not set, the default grace period will be used instead; the grace period is the duration in seconds after the processes running in the pod are sent a termination signal and the time when the processes are forcibly halted with a kill signal; set this value longer than the expected cleanup time for your process

    false

    integer (int64)

    activeDeadlineSeconds

    false

    integer (int64)

    dnsPolicy

    DNS policy for containers within the pod; one of ClusterFirst or Default

    false

    string

    nodeSelector

    selector which must match a node’s labels for the pod to be scheduled on that node; see http://kubernetes.io/v1.0/docs/user-guide/node-selection/README.html

    false

    any

    serviceAccountName

    name of the ServiceAccount to use to run this pod; see http://kubernetes.io/v1.0/docs/design/service_accounts.html

    false

    string

    nodeName

    node requested for this pod

    false

    string

    hostNetwork

    host networking requested for this pod

    false

    boolean

    false

    imagePullSecrets

    list of references to secrets in the same namespace available for pulling the container images; see http://kubernetes.io/v1.0/docs/user-guide/images.html#specifying-imagepullsecrets-on-a-pod

    false

    v1.LocalObjectReference array

    - -
    -
    -

    v1.ContainerPort

    - ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameDescriptionRequiredSchemaDefault

    name

    name for the port that can be referred to by services; must be an IANA_SVC_NAME and unique within the pod

    false

    string

    hostPort

    number of port to expose on the host; most containers do not need this

    false

    integer (int32)

    containerPort

    number of port to expose on the pod’s IP address

    true

    integer (int32)

    protocol

    protocol for port; must be UDP or TCP; TCP if unspecified

    false

    string

    hostIP

    host IP to bind the port to

    false

    string

    - -
    -
    -

    v1.EventList

    - ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameDescriptionRequiredSchemaDefault

    kind

    kind of object, in CamelCase; cannot be updated; see http://kubernetes.io/v1.0/docs/devel/api-conventions.html#types-kinds

    false

    string

    apiVersion

    version of the schema the object should have; see http://kubernetes.io/v1.0/docs/devel/api-conventions.html#resources

    false

    string

    metadata

    standard list metadata; see http://kubernetes.io/v1.0/docs/devel/api-conventions.html#metadata

    false

    v1.ListMeta

    items

    list of events

    true

    v1.Event array

    - -
    -
    -

    v1.ResourceQuota

    - ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameDescriptionRequiredSchemaDefault

    kind

    kind of object, in CamelCase; cannot be updated; see http://kubernetes.io/v1.0/docs/devel/api-conventions.html#types-kinds

    false

    string

    apiVersion

    version of the schema the object should have; see http://kubernetes.io/v1.0/docs/devel/api-conventions.html#resources

    false

    string

    metadata

    standard object metadata; see http://kubernetes.io/v1.0/docs/devel/api-conventions.html#metadata

    false

    v1.ObjectMeta

    spec

    spec defines the desired quota; http://kubernetes.io/v1.0/docs/devel/api-conventions.html#spec-and-status

    false

    v1.ResourceQuotaSpec

    status

    status defines the actual enforced quota and current usage; http://kubernetes.io/v1.0/docs/devel/api-conventions.html#spec-and-status

    false

    v1.ResourceQuotaStatus

    - -
    -
    -

    v1.Lifecycle

    - ------- - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameDescriptionRequiredSchemaDefault

    postStart

    called immediately after a container is started; if the handler fails, the container is terminated and restarted according to its restart policy; other management of the container blocks until the hook completes; see http://kubernetes.io/v1.0/docs/user-guide/container-environment.html#hook-details

    false

    v1.Handler

    preStop

    called before a container is terminated; the container is terminated after the handler completes; other management of the container blocks until the hook completes; see http://kubernetes.io/v1.0/docs/user-guide/container-environment.html#hook-details

    false

    v1.Handler

    - -
    -
    -

    v1.NodeStatus

    - ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameDescriptionRequiredSchemaDefault

    capacity

    compute resource capacity of the node; see http://kubernetes.io/v1.0/docs/user-guide/compute-resources.html

    false

    any

    phase

    most recently observed lifecycle phase of the node; see http://kubernetes.io/v1.0/docs/admin/node.html#node-phase

    false

    string

    conditions

    list of node conditions observed; see http://kubernetes.io/v1.0/docs/admin/node.html#node-condition

    false

    v1.NodeCondition array

    addresses

    list of addresses reachable to the node; see http://kubernetes.io/v1.0/docs/admin/node.html#node-addresses

    false

    v1.NodeAddress array

    nodeInfo

    set of ids/uuids to uniquely identify the node; see http://kubernetes.io/v1.0/docs/admin/node.html#node-info

    false

    v1.NodeSystemInfo

    - -
    -
    -

    v1.GlusterfsVolumeSource

    - ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameDescriptionRequiredSchemaDefault

    endpoints

    gluster hosts endpoints name; see http://kubernetes.io/v1.0/examples/glusterfs/README.html#create-a-pod

    true

    string

    path

    path to gluster volume; see http://kubernetes.io/v1.0/examples/glusterfs/README.html#create-a-pod

    true

    string

    readOnly

    glusterfs volume to be mounted with read-only permissions; see http://kubernetes.io/v1.0/examples/glusterfs/README.html#create-a-pod

    false

    boolean

    false

    - -
    -
    -

    v1.Handler

    - ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameDescriptionRequiredSchemaDefault

    exec

    exec-based handler

    false

    v1.ExecAction

    httpGet

    HTTP-based handler

    false

    v1.HTTPGetAction

    tcpSocket

    TCP-based handler; TCP hooks not yet supported

    false

    v1.TCPSocketAction

    - -
    -
    -

    v1.ReplicationControllerSpec

    - ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameDescriptionRequiredSchemaDefault

    replicas

    number of replicas desired; defaults to 1; see http://kubernetes.io/v1.0/docs/user-guide/replication-controller.html#what-is-a-replication-controller

    false

    integer (int32)

    selector

    label keys and values that must match in order to be controlled by this replication controller, if empty defaulted to labels on Pod template; see http://kubernetes.io/v1.0/docs/user-guide/labels.html#label-selectors

    false

    any

    template

    object that describes the pod that will be created if insufficient replicas are detected; takes precendence over templateRef; see http://kubernetes.io/v1.0/docs/user-guide/replication-controller.html#pod-template

    false

    v1.PodTemplateSpec

    - -
    -
    -

    v1.EventSource

    - ------- - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameDescriptionRequiredSchemaDefault

    component

    component that generated the event

    false

    string

    host

    name of the host where the event is generated

    false

    string

    - -
    -
    -

    v1.StatusCause

    - ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameDescriptionRequiredSchemaDefault

    reason

    machine-readable description of the cause of the error; if this value is empty there is no information available

    false

    string

    message

    human-readable description of the cause of the error; this field may be presented as-is to a reader

    false

    string

    field

    field of the resource that has caused this error, as named by its JSON serialization; may include dot and postfix notation for nested attributes; arrays are zero-indexed; fields may appear more than once in an array of causes due to fields having multiple errors

    false

    string

    - -
    -
    -

    v1.PodCondition

    - ------- - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameDescriptionRequiredSchemaDefault

    type

    kind of the condition, currently only Ready; see http://kubernetes.io/v1.0/docs/user-guide/pod-states.html#pod-conditions

    true

    string

    status

    status of the condition, one of True, False, Unknown; see http://kubernetes.io/v1.0/docs/user-guide/pod-states.html#pod-conditions

    true

    string

    - -
    -
    -

    v1.RBDVolumeSource

    - ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameDescriptionRequiredSchemaDefault

    monitors

    a collection of Ceph monitors; see http://kubernetes.io/v1.0/examples/rbd/README.html#how-to-use-it

    true

    string array

    image

    rados image name; see http://kubernetes.io/v1.0/examples/rbd/README.html#how-to-use-it

    true

    string

    fsType

    file system type to mount, such as ext4, xfs, ntfs; see http://kubernetes.io/v1.0/examples/rbd/README.html#how-to-use-it

    false

    string

    pool

    rados pool name; default is rbd; optional; see http://kubernetes.io/v1.0/examples/rbd/README.html#how-to-use-it

    true

    string

    user

    rados user name; default is admin; optional; see http://kubernetes.io/v1.0/examples/rbd/README.html#how-to-use-it

    true

    string

    keyring

    keyring is the path to key ring for rados user; default is /etc/ceph/keyring; optional; see http://kubernetes.io/v1.0/examples/rbd/README.html#how-to-use-it

    true

    string

    secretRef

    name of a secret to authenticate the RBD user; if provided overrides keyring; optional; see http://kubernetes.io/v1.0/examples/rbd/README.html#how-to-use-it

    true

    v1.LocalObjectReference

    readOnly

    rbd volume to be mounted with read-only permissions; see http://kubernetes.io/v1.0/examples/rbd/README.html#how-to-use-it

    false

    boolean

    false

    - -
    -
    -

    v1.Status

    - ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameDescriptionRequiredSchemaDefault

    kind

    kind of object, in CamelCase; cannot be updated; see http://kubernetes.io/v1.0/docs/devel/api-conventions.html#types-kinds

    false

    string

    apiVersion

    version of the schema the object should have; see http://kubernetes.io/v1.0/docs/devel/api-conventions.html#resources

    false

    string

    metadata

    standard list metadata; see http://kubernetes.io/v1.0/docs/devel/api-conventions.html#metadata

    false

    v1.ListMeta

    status

    status of the operation; either Success, or Failure; see http://kubernetes.io/v1.0/docs/devel/api-conventions.html#spec-and-status

    false

    string

    message

    human-readable description of the status of this operation

    false

    string

    reason

    machine-readable description of why this operation is in the Failure status; if this value is empty there is no information available; a reason clarifies an HTTP status code but does not override it

    false

    string

    details

    extended data associated with the reason; each reason may define its own extended details; this field is optional and the data returned is not guaranteed to conform to any schema except that defined by the reason type

    false

    v1.StatusDetails

    code

    suggested HTTP return code for this status; 0 if not set

    false

    integer (int32)

    - -
    -
    -

    v1.PodTemplate

    - ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameDescriptionRequiredSchemaDefault

    kind

    kind of object, in CamelCase; cannot be updated; see http://kubernetes.io/v1.0/docs/devel/api-conventions.html#types-kinds

    false

    string

    apiVersion

    version of the schema the object should have; see http://kubernetes.io/v1.0/docs/devel/api-conventions.html#resources

    false

    string

    metadata

    standard object metadata; see http://kubernetes.io/v1.0/docs/devel/api-conventions.html#metadata

    false

    v1.ObjectMeta

    template

    the template of the desired behavior of the pod; http://kubernetes.io/v1.0/docs/devel/api-conventions.html#spec-and-status

    false

    v1.PodTemplateSpec

    - -
    -
    -

    v1.ServiceStatus

    - ------- - - - - - - - - - - - - - - - - - - -
    NameDescriptionRequiredSchemaDefault

    loadBalancer

    status of load-balancer

    false

    v1.LoadBalancerStatus

    - -
    -
    -

    v1.NFSVolumeSource

    - ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameDescriptionRequiredSchemaDefault

    server

    the hostname or IP address of the NFS server; see http://kubernetes.io/v1.0/docs/user-guide/volumes.html#nfs

    true

    string

    path

    the path that is exported by the NFS server; see http://kubernetes.io/v1.0/docs/user-guide/volumes.html#nfs

    true

    string

    readOnly

    forces the NFS export to be mounted with read-only permissions; see http://kubernetes.io/v1.0/docs/user-guide/volumes.html#nfs

    false

    boolean

    false

    - -
    -
    -

    v1.EndpointPort

    - ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameDescriptionRequiredSchemaDefault

    name

    name of this port

    false

    string

    port

    port number of the endpoint

    true

    integer (int32)

    protocol

    protocol for this port; must be UDP or TCP; TCP if unspecified

    false

    string

    - -
    -
    -

    v1.TCPSocketAction

    - ------- - - - - - - - - - - - - - - - - - - -
    NameDescriptionRequiredSchemaDefault

    port

    number of name of the port to access on the container; number must be in the range 1 to 65535; name must be an IANA_SVC_NAME

    true

    string

    - -
    -
    -

    v1.HTTPGetAction

    - ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameDescriptionRequiredSchemaDefault

    path

    path to access on the HTTP server

    false

    string

    port

    number or name of the port to access on the container; number must be in the range 1 to 65535; name must be an IANA_SVC_NAME

    true

    string

    host

    hostname to connect to; defaults to pod IP

    false

    string

    scheme

    scheme to connect with, must be HTTP or HTTPS, defaults to HTTP

    false

    string

    - -
    -
    -

    v1.StatusDetails

    - ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameDescriptionRequiredSchemaDefault

    name

    the name attribute of the resource associated with the status StatusReason (when there is a single name which can be described)

    false

    string

    kind

    the kind attribute of the resource associated with the status StatusReason; on some operations may differ from the requested resource Kind; see http://kubernetes.io/v1.0/docs/devel/api-conventions.html#types-kinds

    false

    string

    causes

    the Causes array includes more details associated with the StatusReason failure; not all StatusReasons may provide detailed causes

    false

    v1.StatusCause array

    retryAfterSeconds

    the number of seconds before the client should attempt to retry this operation

    false

    integer (int32)

    - -
    -
    -

    v1.LoadBalancerStatus

    - ------- - - - - - - - - - - - - - - - - - - -
    NameDescriptionRequiredSchemaDefault

    ingress

    load-balancer ingress points

    false

    v1.LoadBalancerIngress array

    - -
    -
    -

    v1.SecretList

    - ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameDescriptionRequiredSchemaDefault

    kind

    kind of object, in CamelCase; cannot be updated; see http://kubernetes.io/v1.0/docs/devel/api-conventions.html#types-kinds

    false

    string

    apiVersion

    version of the schema the object should have; see http://kubernetes.io/v1.0/docs/devel/api-conventions.html#resources

    false

    string

    metadata

    standard list metadata; see http://kubernetes.io/v1.0/docs/devel/api-conventions.html#metadata

    false

    v1.ListMeta

    items

    items is a list of secret objects; see http://kubernetes.io/v1.0/docs/user-guide/secrets.html

    true

    v1.Secret array

    - -
    -
    -

    v1.Container

    - ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameDescriptionRequiredSchemaDefault

    name

    name of the container; must be a DNS_LABEL and unique within the pod; cannot be updated

    true

    string

    image

    Docker image name; see http://kubernetes.io/v1.0/docs/user-guide/images.html

    false

    string

    command

    entrypoint array; not executed within a shell; the docker image’s entrypoint is used if this is not provided; cannot be updated; variable references $(VAR_NAME) are expanded using the container’s environment variables; if a variable cannot be resolved, the reference in the input string will be unchanged; the $(VAR_NAME) syntax can be escaped with a double , ie: (VAR_NAME) ; escaped references will never be expanded, regardless of whether the variable exists or not; see http://kubernetes.io/v1.0/docs/user-guide/containers.html#containers-and-commands

    false

    string array

    args

    command array; the docker image’s .html is used if this is not provided; arguments to the entrypoint; cannot be updated; variable references $(VAR_NAME) are expanded using the container’s environment variables; if a variable cannot be resolved, the reference in the input string will be unchanged; the $(VAR_NAME) syntax can be escaped with a double , ie: (VAR_NAME) ; escaped references will never be expanded, regardless of whether the variable exists or not; see http://kubernetes.io/v1.0/docs/user-guide/containers.html#containers-and-commands

    false

    string array

    workingDir

    container’s working directory; defaults to image’s default; cannot be updated

    false

    string

    ports

    list of ports to expose from the container; cannot be updated

    false

    v1.ContainerPort array

    env

    list of environment variables to set in the container; cannot be updated

    false

    v1.EnvVar array

    resources

    Compute Resources required by this container; cannot be updated; see http://kubernetes.io/v1.0/docs/user-guide/compute-resources.html

    false

    v1.ResourceRequirements

    volumeMounts

    pod volumes to mount into the container’s filesyste; cannot be updated

    false

    v1.VolumeMount array

    livenessProbe

    periodic probe of container liveness; container will be restarted if the probe fails; cannot be updated; see http://kubernetes.io/v1.0/docs/user-guide/pod-states.html#container-probes

    false

    v1.Probe

    readinessProbe

    periodic probe of container service readiness; container will be removed from service endpoints if the probe fails; cannot be updated; see http://kubernetes.io/v1.0/docs/user-guide/pod-states.html#container-probes

    false

    v1.Probe

    lifecycle

    actions that the management system should take in response to container lifecycle events; cannot be updated

    false

    v1.Lifecycle

    terminationMessagePath

    path at which the file to which the container’s termination message will be written is mounted into the container’s filesystem; message written is intended to be brief final status, such as an assertion failure message; defaults to /dev/termination-log; cannot be updated

    false

    string

    imagePullPolicy

    image pull policy; one of Always, Never, IfNotPresent; defaults to Always if :latest tag is specified, or IfNotPresent otherwise; cannot be updated; see http://kubernetes.io/v1.0/docs/user-guide/images.html#updating-images

    false

    string

    securityContext

    security options the pod should run with; see http://kubernetes.io/v1.0/docs/design/security_context.html

    false

    v1.SecurityContext

    - -
    -
    -

    v1.PersistentVolumeSpec

    - ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameDescriptionRequiredSchemaDefault

    capacity

    a description of the persistent volume’s resources and capacityr; see http://kubernetes.io/v1.0/docs/user-guide/persistent-volumes.html#capacity

    false

    any

    gcePersistentDisk

    GCE disk resource provisioned by an admin; see http://kubernetes.io/v1.0/docs/user-guide/volumes.html#gcepersistentdisk

    false

    v1.GCEPersistentDiskVolumeSource

    awsElasticBlockStore

    AWS disk resource provisioned by an admin; see http://kubernetes.io/v1.0/docs/user-guide/volumes.html#awselasticblockstore

    false

    v1.AWSElasticBlockStoreVolumeSource

    hostPath

    a HostPath provisioned by a developer or tester; for develment use only; see http://kubernetes.io/v1.0/docs/user-guide/volumes.html#hostpath

    false

    v1.HostPathVolumeSource

    glusterfs

    Glusterfs volume resource provisioned by an admin; see http://kubernetes.io/v1.0/examples/glusterfs/README.html

    false

    v1.GlusterfsVolumeSource

    nfs

    NFS volume resource provisioned by an admin; see http://kubernetes.io/v1.0/docs/user-guide/volumes.html#nfs

    false

    v1.NFSVolumeSource

    rbd

    rados block volume that will be mounted on the host machine; see http://kubernetes.io/v1.0/examples/rbd/README.html

    false

    v1.RBDVolumeSource

    iscsi

    an iSCSI disk resource provisioned by an admin

    false

    v1.ISCSIVolumeSource

    accessModes

    all ways the volume can be mounted; see http://kubernetes.io/v1.0/docs/user-guide/persistent-volumes.html#access-modes

    false

    v1.PersistentVolumeAccessMode array

    claimRef

    when bound, a reference to the bound claim; see http://kubernetes.io/v1.0/docs/user-guide/persistent-volumes.html#binding

    false

    v1.ObjectReference

    persistentVolumeReclaimPolicy

    what happens to a volume when released from its claim; Valid options are Retain (default) and Recycle. Recyling must be supported by the volume plugin underlying this persistent volume. See http://kubernetes.io/v1.0/docs/user-guide/persistent-volumes.html#recycling-policy

    false

    string

    - -
    -
    -

    v1.ReplicationControllerStatus

    - ------- - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameDescriptionRequiredSchemaDefault

    replicas

    most recently oberved number of replicas; see http://kubernetes.io/v1.0/docs/user-guide/replication-controller.html#what-is-a-replication-controller

    true

    integer (int32)

    observedGeneration

    reflects the generation of the most recently observed replication controller

    false

    integer (int64)

    - -
    -
    -

    v1.FinalizerName

    - -
    -
    -

    v1.ServicePort

    - ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameDescriptionRequiredSchemaDefault

    name

    the name of this port; optional if only one port is defined

    false

    string

    protocol

    the protocol used by this port; must be UDP or TCP; TCP if unspecified

    false

    string

    port

    the port number that is exposed

    true

    integer (int32)

    targetPort

    number or name of the port to access on the pods targeted by the service; defaults to the service port; number must be in the range 1 to 65535; name must be an IANA_SVC_NAME; see http://kubernetes.io/v1.0/docs/user-guide/services.html#defining-a-service

    false

    string

    nodePort

    the port on each node on which this service is exposed when type=NodePort or LoadBalancer; usually assigned by the system; if specified, it will be allocated to the service if unused or else creation of the service will fail; see http://kubernetes.io/v1.0/docs/user-guide/services.html#type—nodeport

    true

    integer (int32)

    - -
    -
    -

    v1.ComponentCondition

    - ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameDescriptionRequiredSchemaDefault

    type

    type of component condition, currently only Healthy

    true

    string

    status

    current status of this component condition, one of True, False, Unknown

    true

    string

    message

    health check message received from the component

    false

    string

    error

    error code from health check attempt (if any)

    false

    string

    - -
    -
    -

    v1.ComponentStatusList

    - ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameDescriptionRequiredSchemaDefault

    kind

    kind of object, in CamelCase; cannot be updated; see http://kubernetes.io/v1.0/docs/devel/api-conventions.html#types-kinds

    false

    string

    apiVersion

    version of the schema the object should have; see http://kubernetes.io/v1.0/docs/devel/api-conventions.html#resources

    false

    string

    metadata

    standard list metadata; see http://kubernetes.io/v1.0/docs/devel/api-conventions.html#metadata

    false

    v1.ListMeta

    items

    list of component status objects

    true

    v1.ComponentStatus array

    - -
    -
    -

    v1.HostPathVolumeSource

    - ------- - - - - - - - - - - - - - - - - - - -
    NameDescriptionRequiredSchemaDefault

    path

    path of the directory on the host; see http://kubernetes.io/v1.0/docs/user-guide/volumes.html#hostpath

    true

    string

    - -
    -
    -

    json.WatchEvent

    - ------- - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameDescriptionRequiredSchemaDefault

    type

    the type of watch event; may be ADDED, MODIFIED, DELETED, or ERROR

    false

    string

    object

    the object being watched; will match the type of the resource endpoint or be a Status object if the type is ERROR

    false

    string

    - -
    -
    -

    v1.Binding

    - ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameDescriptionRequiredSchemaDefault

    kind

    kind of object, in CamelCase; cannot be updated; see http://kubernetes.io/v1.0/docs/devel/api-conventions.html#types-kinds

    false

    string

    apiVersion

    version of the schema the object should have; see http://kubernetes.io/v1.0/docs/devel/api-conventions.html#resources

    false

    string

    metadata

    standard object metadata; see http://kubernetes.io/v1.0/docs/devel/api-conventions.html#metadata

    false

    v1.ObjectMeta

    target

    an object to bind to

    true

    v1.ObjectReference

    - -
    -
    -

    v1.ContainerStateTerminated

    - ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameDescriptionRequiredSchemaDefault

    exitCode

    exit status from the last termination of the container

    true

    integer (int32)

    signal

    signal from the last termination of the container

    false

    integer (int32)

    reason

    (brief) reason from the last termination of the container

    false

    string

    message

    message regarding the last termination of the container

    false

    string

    startedAt

    time at which previous execution of the container started

    false

    string

    finishedAt

    time at which the container last terminated

    false

    string

    containerID

    container’s ID in the format docker://<container_id>

    false

    string

    - -
    -
    -

    v1.SecurityContext

    - ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameDescriptionRequiredSchemaDefault

    capabilities

    the linux capabilites that should be added or removed; see http://kubernetes.io/v1.0/docs/design/security_context.html#security-context

    false

    v1.Capabilities

    privileged

    run the container in privileged mode; see http://kubernetes.io/v1.0/docs/design/security_context.html#security-context

    false

    boolean

    false

    seLinuxOptions

    options that control the SELinux labels applied; see http://kubernetes.io/v1.0/docs/design/security_context.html#security-context

    false

    v1.SELinuxOptions

    runAsUser

    the user id that runs the first process in the container; see http://kubernetes.io/v1.0/docs/design/security_context.html#security-context

    false

    integer (int64)

    - -
    -
    -

    v1.ContainerState

    - ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameDescriptionRequiredSchemaDefault

    waiting

    details about a waiting container

    false

    v1.ContainerStateWaiting

    running

    details about a running container

    false

    v1.ContainerStateRunning

    terminated

    details about a terminated container

    false

    v1.ContainerStateTerminated

    - -
    -
    -

    v1.AWSElasticBlockStoreVolumeSource

    - ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameDescriptionRequiredSchemaDefault

    volumeID

    unique id of the PD resource in AWS; see http://kubernetes.io/v1.0/docs/user-guide/volumes.html#awselasticblockstore

    true

    string

    fsType

    file system type to mount, such as ext4, xfs, ntfs; see http://kubernetes.io/v1.0/docs/user-guide/volumes.html#awselasticblockstore

    true

    string

    partition

    partition on the disk to mount (e.g., 1 for /dev/sda1); if omitted the plain device name (e.g., /dev/sda) will be mounted; see http://kubernetes.io/v1.0/docs/user-guide/volumes.html#awselasticblockstore

    false

    integer (int32)

    readOnly

    read-only if true, read-write otherwise (false or unspecified); see http://kubernetes.io/v1.0/docs/user-guide/volumes.html#awselasticblockstore

    false

    boolean

    false

    - -
    -
    -

    v1.ContainerStatus

    - ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameDescriptionRequiredSchemaDefault

    name

    name of the container; must be a DNS_LABEL and unique within the pod; cannot be updated

    true

    string

    state

    details about the container’s current condition

    false

    v1.ContainerState

    lastState

    details about the container’s last termination condition

    false

    v1.ContainerState

    ready

    specifies whether the container has passed its readiness probe

    true

    boolean

    false

    restartCount

    the number of times the container has been restarted, currently based on the number of dead containers that have not yet been removed

    true

    integer (int32)

    image

    image of the container; see http://kubernetes.io/v1.0/docs/user-guide/images.html

    true

    string

    imageID

    ID of the container’s image

    true

    string

    containerID

    container’s ID in the format docker://<container_id>; see http://kubernetes.io/v1.0/docs/user-guide/container-environment.html#container-information

    false

    string

    - -
    -
    -

    v1.ReplicationControllerList

    - ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameDescriptionRequiredSchemaDefault

    kind

    kind of object, in CamelCase; cannot be updated; see http://kubernetes.io/v1.0/docs/devel/api-conventions.html#types-kinds

    false

    string

    apiVersion

    version of the schema the object should have; see http://kubernetes.io/v1.0/docs/devel/api-conventions.html#resources

    false

    string

    metadata

    standard list metadata; see http://kubernetes.io/v1.0/docs/devel/api-conventions.html#metadata

    false

    v1.ListMeta

    items

    list of replication controllers; see http://kubernetes.io/v1.0/docs/user-guide/replication-controller.html

    true

    v1.ReplicationController array

    - -
    -
    -

    v1.Secret

    - ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameDescriptionRequiredSchemaDefault

    kind

    kind of object, in CamelCase; cannot be updated; see http://kubernetes.io/v1.0/docs/devel/api-conventions.html#types-kinds

    false

    string

    apiVersion

    version of the schema the object should have; see http://kubernetes.io/v1.0/docs/devel/api-conventions.html#resources

    false

    string

    metadata

    standard object metadata; see http://kubernetes.io/v1.0/docs/devel/api-conventions.html#metadata

    false

    v1.ObjectMeta

    data

    data contains the secret data. Each key must be a valid DNS_SUBDOMAIN or leading dot followed by valid DNS_SUBDOMAIN. Each value must be a base64 encoded string as described in https://tools.ietf.org/html/rfc4648#section-4

    false

    any

    type

    type facilitates programmatic handling of secret data

    false

    string

    - -
    -
    -

    v1.Event

    - ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameDescriptionRequiredSchemaDefault

    kind

    kind of object, in CamelCase; cannot be updated; see http://kubernetes.io/v1.0/docs/devel/api-conventions.html#types-kinds

    false

    string

    apiVersion

    version of the schema the object should have; see http://kubernetes.io/v1.0/docs/devel/api-conventions.html#resources

    false

    string

    metadata

    standard object metadata; see http://kubernetes.io/v1.0/docs/devel/api-conventions.html#metadata

    true

    v1.ObjectMeta

    involvedObject

    object this event is about

    true

    v1.ObjectReference

    reason

    short, machine understandable string that gives the reason for the transition into the object’s current status

    false

    string

    message

    human-readable description of the status of this operation

    false

    string

    source

    component reporting this event

    false

    v1.EventSource

    firstTimestamp

    the time at which the event was first recorded

    false

    string

    lastTimestamp

    the time at which the most recent occurance of this event was recorded

    false

    string

    count

    the number of times this event has occurred

    false

    integer (int32)

    - -
    -
    -

    v1.EnvVar

    - ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameDescriptionRequiredSchemaDefault

    name

    name of the environment variable; must be a C_IDENTIFIER

    true

    string

    value

    value of the environment variable; defaults to empty string; variable references $(VAR_NAME) are expanded using the previously defined environment varibles in the container and any service environment variables; if a variable cannot be resolved, the reference in the input string will be unchanged; the $(VAR_NAME) syntax can be escaped with a double , ie: (VAR_NAME) ; escaped references will never be expanded, regardless of whether the variable exists or not

    false

    string

    valueFrom

    source for the environment variable’s value; cannot be used if value is not empty

    false

    v1.EnvVarSource

    - -
    -
    -

    v1.ResourceRequirements

    - ------- - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameDescriptionRequiredSchemaDefault

    limits

    Maximum amount of compute resources allowed; see http://kubernetes.io/v1.0/docs/design/resources.html#resource-specifications

    false

    any

    requests

    Minimum amount of resources requested; requests are honored only for persistent volumes as of now; see http://kubernetes.io/v1.0/docs/design/resources.html#resource-specifications

    false

    any

    - -
    -
    -

    v1.PersistentVolumeAccessMode

    - -
    -
    -

    v1.ComponentStatus

    - ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameDescriptionRequiredSchemaDefault

    kind

    kind of object, in CamelCase; cannot be updated; see http://kubernetes.io/v1.0/docs/devel/api-conventions.html#types-kinds

    false

    string

    apiVersion

    version of the schema the object should have; see http://kubernetes.io/v1.0/docs/devel/api-conventions.html#resources

    false

    string

    metadata

    standard object metadata; see http://kubernetes.io/v1.0/docs/devel/api-conventions.html#metadata

    false

    v1.ObjectMeta

    conditions

    list of component conditions observed

    false

    v1.ComponentCondition array

    - -
    -
    -

    v1.LimitRangeItem

    - ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameDescriptionRequiredSchemaDefault

    type

    type of resource that this limit applies to

    false

    string

    max

    max usage constraints on this kind by resource name

    false

    any

    min

    min usage constraints on this kind by resource name

    false

    any

    default

    default values on this kind by resource name if omitted

    false

    any

    - -
    -
    -

    v1.PodTemplateSpec

    - ------- - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameDescriptionRequiredSchemaDefault

    metadata

    standard object metadata; see http://kubernetes.io/v1.0/docs/devel/api-conventions.html#metadata

    false

    v1.ObjectMeta

    spec

    specification of the desired behavior of the pod; http://kubernetes.io/v1.0/docs/devel/api-conventions.html#spec-and-status

    false

    v1.PodSpec

    - -
    -
    -

    v1.PodList

    - ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameDescriptionRequiredSchemaDefault

    kind

    kind of object, in CamelCase; cannot be updated; see http://kubernetes.io/v1.0/docs/devel/api-conventions.html#types-kinds

    false

    string

    apiVersion

    version of the schema the object should have; see http://kubernetes.io/v1.0/docs/devel/api-conventions.html#resources

    false

    string

    metadata

    standard list metadata; see http://kubernetes.io/v1.0/docs/devel/api-conventions.html#types-kinds

    false

    v1.ListMeta

    items

    list of pods; see http://kubernetes.io/v1.0/docs/user-guide/pods.html

    true

    v1.Pod array

    - -
    -
    -

    v1.ServiceList

    - ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameDescriptionRequiredSchemaDefault

    kind

    kind of object, in CamelCase; cannot be updated; see http://kubernetes.io/v1.0/docs/devel/api-conventions.html#types-kinds

    false

    string

    apiVersion

    version of the schema the object should have; see http://kubernetes.io/v1.0/docs/devel/api-conventions.html#resources

    false

    string

    metadata

    standard list metadata; see http://kubernetes.io/v1.0/docs/devel/api-conventions.html#metadata

    false

    v1.ListMeta

    items

    list of services

    true

    v1.Service array

    - -
    -
    -

    v1.PersistentVolumeList

    - ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameDescriptionRequiredSchemaDefault

    kind

    kind of object, in CamelCase; cannot be updated; see http://kubernetes.io/v1.0/docs/devel/api-conventions.html#types-kinds

    false

    string

    apiVersion

    version of the schema the object should have; see http://kubernetes.io/v1.0/docs/devel/api-conventions.html#resources

    false

    string

    metadata

    standard list metadata; see http://kubernetes.io/v1.0/docs/devel/api-conventions.html#types-kinds

    false

    v1.ListMeta

    items

    list of persistent volumes; see http://kubernetes.io/v1.0/docs/user-guide/persistent-volumes.html

    false

    v1.PersistentVolume array

    - -
    -
    -

    v1.ObjectReference

    - ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameDescriptionRequiredSchemaDefault

    kind

    kind of the referent; see http://kubernetes.io/v1.0/docs/devel/api-conventions.html#types-kinds

    false

    string

    namespace

    namespace of the referent; see http://kubernetes.io/v1.0/docs/user-guide/namespaces.html

    false

    string

    name

    name of the referent; see http://kubernetes.io/v1.0/docs/user-guide/identifiers.html#names

    false

    string

    uid

    uid of the referent; see http://kubernetes.io/v1.0/docs/user-guide/identifiers.html#uids

    false

    string

    apiVersion

    API version of the referent

    false

    string

    resourceVersion

    specific resourceVersion to which this reference is made, if any: http://kubernetes.io/v1.0/docs/devel/api-conventions.html#concurrency-control-and-consistency

    false

    string

    fieldPath

    if referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]

    false

    string

    - -
    -
    -

    v1.ContainerStateWaiting

    - ------- - - - - - - - - - - - - - - - - - - -
    NameDescriptionRequiredSchemaDefault

    reason

    (brief) reason the container is not yet running, such as pulling its image

    false

    string

    - -
    -
    -

    v1.NodeSystemInfo

    - ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameDescriptionRequiredSchemaDefault

    machineID

    machine-id reported by the node

    true

    string

    systemUUID

    system-uuid reported by the node

    true

    string

    bootID

    boot id is the boot-id reported by the node

    true

    string

    kernelVersion

    Kernel version reported by the node from uname -r (e.g. 3.16.0-0.bpo.4-.html64)

    true

    string

    osImage

    OS image used reported by the node from /etc/os-release (e.g. Debian GNU/Linux 7 (wheezy))

    true

    string

    containerRuntimeVersion

    Container runtime version reported by the node through runtime remote API (e.g. docker://1.5.0)

    true

    string

    kubeletVersion

    Kubelet version reported by the node

    true

    string

    kubeProxyVersion

    Kube-proxy version reported by the node

    true

    string

    - -
    -
    -

    v1.ServiceSpec

    - ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameDescriptionRequiredSchemaDefault

    ports

    ports exposed by the service; see http://kubernetes.io/v1.0/docs/user-guide/services.html#virtual-ips-and-service-proxies

    true

    v1.ServicePort array

    selector

    label keys and values that must match in order to receive traffic for this service; if empty, all pods are selected, if not specified, endpoints must be manually specified; see http://kubernetes.io/v1.0/docs/user-guide/services.html#overview

    false

    any

    clusterIP

    IP address of the service; usually assigned by the system; if specified, it will be allocated to the service if unused or else creation of the service will fail; cannot be updated; None can be specified for a headless service when proxying is not required; see http://kubernetes.io/v1.0/docs/user-guide/services.html#virtual-ips-and-service-proxies

    false

    string

    type

    type of this service; must be ClusterIP, NodePort, or LoadBalancer; defaults to ClusterIP; see http://kubernetes.io/v1.0/docs/user-guide/services.html#external-services

    false

    string

    deprecatedPublicIPs

    deprecated. externally visible IPs (e.g. load balancers) that should be proxied to this service

    false

    string array

    sessionAffinity

    enable client IP based session affinity; must be ClientIP or None; defaults to None; see http://kubernetes.io/v1.0/docs/user-guide/services.html#virtual-ips-and-service-proxies

    false

    string

    - -
    -
    -

    v1.Pod

    - ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameDescriptionRequiredSchemaDefault

    kind

    kind of object, in CamelCase; cannot be updated; see http://kubernetes.io/v1.0/docs/devel/api-conventions.html#types-kinds

    false

    string

    apiVersion

    version of the schema the object should have; see http://kubernetes.io/v1.0/docs/devel/api-conventions.html#resources

    false

    string

    metadata

    standard object metadata; see http://kubernetes.io/v1.0/docs/devel/api-conventions.html#metadata

    false

    v1.ObjectMeta

    spec

    specification of the desired behavior of the pod; http://kubernetes.io/v1.0/docs/devel/api-conventions.html#spec-and-status

    false

    v1.PodSpec

    status

    most recently observed status of the pod; populated by the system, read-only; http://kubernetes.io/v1.0/docs/devel/api-conventions.html#spec-and-status

    false

    v1.PodStatus

    - -
    -
    -

    v1.NodeSpec

    - ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameDescriptionRequiredSchemaDefault

    podCIDR

    pod IP range assigned to the node

    false

    string

    externalID

    deprecated. External ID assigned to the node by some machine database (e.g. a cloud provider). Defaults to node name when empty.

    false

    string

    providerID

    ID of the node assigned by the cloud provider in the format: <ProviderName>://<ProviderSpecificNodeID>

    false

    string

    unschedulable

    disable pod scheduling on the node; see http://kubernetes.io/v1.0/docs/admin/node.html#manual-node-administration

    false

    boolean

    false

    - -
    -
    -

    v1.EndpointAddress

    - ------- - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameDescriptionRequiredSchemaDefault

    ip

    IP address of the endpoint

    true

    string

    targetRef

    reference to object providing the endpoint

    false

    v1.ObjectReference

    - -
    -
    -

    any

    -
    -

    Represents an untyped JSON map - see the description of the field for more info about the structure of this object.

    -
    -
    - - - - - - \ No newline at end of file diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/api-reference/definitions.md b/Godeps/_workspace/src/k8s.io/kubernetes/docs/api-reference/definitions.md deleted file mode 100644 index da32a9b795e2..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/api-reference/definitions.md +++ /dev/null @@ -1,39 +0,0 @@ - - - - -WARNING -WARNING -WARNING -WARNING -WARNING - -

    PLEASE NOTE: This document applies to the HEAD of the source tree

    - -If you are using a released version of Kubernetes, you should -refer to the docs that go with that version. - - -The latest 1.0.x release of this document can be found -[here](http://releases.k8s.io/release-1.0/docs/api-reference/definitions.md). - -Documentation for other releases can be found at -[releases.k8s.io](http://releases.k8s.io). - --- - - - - - -{% include definitions.html %} - - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/api-reference/definitions.md?pixel)]() - diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/api-reference/operations.html b/Godeps/_workspace/src/k8s.io/kubernetes/docs/api-reference/operations.html deleted file mode 100644 index 191972c603aa..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/api-reference/operations.html +++ /dev/null @@ -1,23842 +0,0 @@ - - - - - - -Paths - - - - -
    -
    -

    Paths

    -
    -
    -

    create a Binding

    -
    -
    -
    POST /api/v1/bindings
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    BodyParameter

    body

    true

    v1.Binding

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.Binding

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    list objects of kind ComponentStatus

    -
    -
    -
    GET /api/v1/componentstatuses
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    QueryParameter

    labelSelector

    a selector to restrict the list of returned objects by their labels; defaults to everything

    false

    string

    QueryParameter

    fieldSelector

    a selector to restrict the list of returned objects by their fields; defaults to everything

    false

    string

    QueryParameter

    watch

    watch for changes to the described resources and return them as a stream of add, update, and remove notifications; specify resourceVersion

    false

    boolean

    QueryParameter

    resourceVersion

    when specified with a watch call, shows changes that occur after that particular version of a resource; defaults to changes from the beginning of history

    false

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.ComponentStatusList

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    list or watch objects of kind Endpoints

    -
    -
    -
    GET /api/v1/endpoints
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    QueryParameter

    labelSelector

    a selector to restrict the list of returned objects by their labels; defaults to everything

    false

    string

    QueryParameter

    fieldSelector

    a selector to restrict the list of returned objects by their fields; defaults to everything

    false

    string

    QueryParameter

    watch

    watch for changes to the described resources and return them as a stream of add, update, and remove notifications; specify resourceVersion

    false

    boolean

    QueryParameter

    resourceVersion

    when specified with a watch call, shows changes that occur after that particular version of a resource; defaults to changes from the beginning of history

    false

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.EndpointsList

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    create a Endpoints

    -
    -
    -
    POST /api/v1/endpoints
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    BodyParameter

    body

    true

    v1.Endpoints

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.Endpoints

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    list or watch objects of kind Event

    -
    -
    -
    GET /api/v1/events
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    QueryParameter

    labelSelector

    a selector to restrict the list of returned objects by their labels; defaults to everything

    false

    string

    QueryParameter

    fieldSelector

    a selector to restrict the list of returned objects by their fields; defaults to everything

    false

    string

    QueryParameter

    watch

    watch for changes to the described resources and return them as a stream of add, update, and remove notifications; specify resourceVersion

    false

    boolean

    QueryParameter

    resourceVersion

    when specified with a watch call, shows changes that occur after that particular version of a resource; defaults to changes from the beginning of history

    false

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.EventList

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    create a Event

    -
    -
    -
    POST /api/v1/events
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    BodyParameter

    body

    true

    v1.Event

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.Event

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    list or watch objects of kind LimitRange

    -
    -
    -
    GET /api/v1/limitranges
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    QueryParameter

    labelSelector

    a selector to restrict the list of returned objects by their labels; defaults to everything

    false

    string

    QueryParameter

    fieldSelector

    a selector to restrict the list of returned objects by their fields; defaults to everything

    false

    string

    QueryParameter

    watch

    watch for changes to the described resources and return them as a stream of add, update, and remove notifications; specify resourceVersion

    false

    boolean

    QueryParameter

    resourceVersion

    when specified with a watch call, shows changes that occur after that particular version of a resource; defaults to changes from the beginning of history

    false

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.LimitRangeList

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    create a LimitRange

    -
    -
    -
    POST /api/v1/limitranges
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    BodyParameter

    body

    true

    v1.LimitRange

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.LimitRange

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    list or watch objects of kind Namespace

    -
    -
    -
    GET /api/v1/namespaces
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    QueryParameter

    labelSelector

    a selector to restrict the list of returned objects by their labels; defaults to everything

    false

    string

    QueryParameter

    fieldSelector

    a selector to restrict the list of returned objects by their fields; defaults to everything

    false

    string

    QueryParameter

    watch

    watch for changes to the described resources and return them as a stream of add, update, and remove notifications; specify resourceVersion

    false

    boolean

    QueryParameter

    resourceVersion

    when specified with a watch call, shows changes that occur after that particular version of a resource; defaults to changes from the beginning of history

    false

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.NamespaceList

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    create a Namespace

    -
    -
    -
    POST /api/v1/namespaces
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    BodyParameter

    body

    true

    v1.Namespace

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.Namespace

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    create a Binding

    -
    -
    -
    POST /api/v1/namespaces/{namespace}/bindings
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    BodyParameter

    body

    true

    v1.Binding

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.Binding

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    list objects of kind ComponentStatus

    -
    -
    -
    GET /api/v1/namespaces/{namespace}/componentstatuses
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    QueryParameter

    labelSelector

    a selector to restrict the list of returned objects by their labels; defaults to everything

    false

    string

    QueryParameter

    fieldSelector

    a selector to restrict the list of returned objects by their fields; defaults to everything

    false

    string

    QueryParameter

    watch

    watch for changes to the described resources and return them as a stream of add, update, and remove notifications; specify resourceVersion

    false

    boolean

    QueryParameter

    resourceVersion

    when specified with a watch call, shows changes that occur after that particular version of a resource; defaults to changes from the beginning of history

    false

    string

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.ComponentStatusList

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    read the specified ComponentStatus

    -
    -
    -
    GET /api/v1/namespaces/{namespace}/componentstatuses/{name}
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    PathParameter

    name

    name of the ComponentStatus

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.ComponentStatus

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    list or watch objects of kind Endpoints

    -
    -
    -
    GET /api/v1/namespaces/{namespace}/endpoints
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    QueryParameter

    labelSelector

    a selector to restrict the list of returned objects by their labels; defaults to everything

    false

    string

    QueryParameter

    fieldSelector

    a selector to restrict the list of returned objects by their fields; defaults to everything

    false

    string

    QueryParameter

    watch

    watch for changes to the described resources and return them as a stream of add, update, and remove notifications; specify resourceVersion

    false

    boolean

    QueryParameter

    resourceVersion

    when specified with a watch call, shows changes that occur after that particular version of a resource; defaults to changes from the beginning of history

    false

    string

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.EndpointsList

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    create a Endpoints

    -
    -
    -
    POST /api/v1/namespaces/{namespace}/endpoints
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    BodyParameter

    body

    true

    v1.Endpoints

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.Endpoints

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    read the specified Endpoints

    -
    -
    -
    GET /api/v1/namespaces/{namespace}/endpoints/{name}
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    PathParameter

    name

    name of the Endpoints

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.Endpoints

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    replace the specified Endpoints

    -
    -
    -
    PUT /api/v1/namespaces/{namespace}/endpoints/{name}
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    BodyParameter

    body

    true

    v1.Endpoints

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    PathParameter

    name

    name of the Endpoints

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.Endpoints

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    delete a Endpoints

    -
    -
    -
    DELETE /api/v1/namespaces/{namespace}/endpoints/{name}
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    BodyParameter

    body

    true

    v1.DeleteOptions

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    PathParameter

    name

    name of the Endpoints

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.Status

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    partially update the specified Endpoints

    -
    -
    -
    PATCH /api/v1/namespaces/{namespace}/endpoints/{name}
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    BodyParameter

    body

    true

    api.Patch

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    PathParameter

    name

    name of the Endpoints

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.Endpoints

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      application/json-patch+json

      -
    • -
    • -

      application/merge-patch+json

      -
    • -
    • -

      application/strategic-merge-patch+json

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    list or watch objects of kind Event

    -
    -
    -
    GET /api/v1/namespaces/{namespace}/events
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    QueryParameter

    labelSelector

    a selector to restrict the list of returned objects by their labels; defaults to everything

    false

    string

    QueryParameter

    fieldSelector

    a selector to restrict the list of returned objects by their fields; defaults to everything

    false

    string

    QueryParameter

    watch

    watch for changes to the described resources and return them as a stream of add, update, and remove notifications; specify resourceVersion

    false

    boolean

    QueryParameter

    resourceVersion

    when specified with a watch call, shows changes that occur after that particular version of a resource; defaults to changes from the beginning of history

    false

    string

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.EventList

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    create a Event

    -
    -
    -
    POST /api/v1/namespaces/{namespace}/events
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    BodyParameter

    body

    true

    v1.Event

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.Event

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    read the specified Event

    -
    -
    -
    GET /api/v1/namespaces/{namespace}/events/{name}
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    PathParameter

    name

    name of the Event

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.Event

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    replace the specified Event

    -
    -
    -
    PUT /api/v1/namespaces/{namespace}/events/{name}
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    BodyParameter

    body

    true

    v1.Event

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    PathParameter

    name

    name of the Event

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.Event

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    delete a Event

    -
    -
    -
    DELETE /api/v1/namespaces/{namespace}/events/{name}
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    PathParameter

    name

    name of the Event

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.Status

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    partially update the specified Event

    -
    -
    -
    PATCH /api/v1/namespaces/{namespace}/events/{name}
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    BodyParameter

    body

    true

    api.Patch

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    PathParameter

    name

    name of the Event

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.Event

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      application/json-patch+json

      -
    • -
    • -

      application/merge-patch+json

      -
    • -
    • -

      application/strategic-merge-patch+json

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    list or watch objects of kind LimitRange

    -
    -
    -
    GET /api/v1/namespaces/{namespace}/limitranges
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    QueryParameter

    labelSelector

    a selector to restrict the list of returned objects by their labels; defaults to everything

    false

    string

    QueryParameter

    fieldSelector

    a selector to restrict the list of returned objects by their fields; defaults to everything

    false

    string

    QueryParameter

    watch

    watch for changes to the described resources and return them as a stream of add, update, and remove notifications; specify resourceVersion

    false

    boolean

    QueryParameter

    resourceVersion

    when specified with a watch call, shows changes that occur after that particular version of a resource; defaults to changes from the beginning of history

    false

    string

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.LimitRangeList

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    create a LimitRange

    -
    -
    -
    POST /api/v1/namespaces/{namespace}/limitranges
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    BodyParameter

    body

    true

    v1.LimitRange

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.LimitRange

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    read the specified LimitRange

    -
    -
    -
    GET /api/v1/namespaces/{namespace}/limitranges/{name}
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    PathParameter

    name

    name of the LimitRange

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.LimitRange

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    replace the specified LimitRange

    -
    -
    -
    PUT /api/v1/namespaces/{namespace}/limitranges/{name}
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    BodyParameter

    body

    true

    v1.LimitRange

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    PathParameter

    name

    name of the LimitRange

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.LimitRange

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    delete a LimitRange

    -
    -
    -
    DELETE /api/v1/namespaces/{namespace}/limitranges/{name}
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    PathParameter

    name

    name of the LimitRange

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.Status

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    partially update the specified LimitRange

    -
    -
    -
    PATCH /api/v1/namespaces/{namespace}/limitranges/{name}
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    BodyParameter

    body

    true

    api.Patch

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    PathParameter

    name

    name of the LimitRange

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.LimitRange

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      application/json-patch+json

      -
    • -
    • -

      application/merge-patch+json

      -
    • -
    • -

      application/strategic-merge-patch+json

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    list or watch objects of kind PersistentVolumeClaim

    -
    -
    -
    GET /api/v1/namespaces/{namespace}/persistentvolumeclaims
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    QueryParameter

    labelSelector

    a selector to restrict the list of returned objects by their labels; defaults to everything

    false

    string

    QueryParameter

    fieldSelector

    a selector to restrict the list of returned objects by their fields; defaults to everything

    false

    string

    QueryParameter

    watch

    watch for changes to the described resources and return them as a stream of add, update, and remove notifications; specify resourceVersion

    false

    boolean

    QueryParameter

    resourceVersion

    when specified with a watch call, shows changes that occur after that particular version of a resource; defaults to changes from the beginning of history

    false

    string

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.PersistentVolumeClaimList

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    create a PersistentVolumeClaim

    -
    -
    -
    POST /api/v1/namespaces/{namespace}/persistentvolumeclaims
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    BodyParameter

    body

    true

    v1.PersistentVolumeClaim

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.PersistentVolumeClaim

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    read the specified PersistentVolumeClaim

    -
    -
    -
    GET /api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    PathParameter

    name

    name of the PersistentVolumeClaim

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.PersistentVolumeClaim

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    replace the specified PersistentVolumeClaim

    -
    -
    -
    PUT /api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    BodyParameter

    body

    true

    v1.PersistentVolumeClaim

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    PathParameter

    name

    name of the PersistentVolumeClaim

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.PersistentVolumeClaim

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    delete a PersistentVolumeClaim

    -
    -
    -
    DELETE /api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    BodyParameter

    body

    true

    v1.DeleteOptions

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    PathParameter

    name

    name of the PersistentVolumeClaim

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.Status

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    partially update the specified PersistentVolumeClaim

    -
    -
    -
    PATCH /api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    BodyParameter

    body

    true

    api.Patch

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    PathParameter

    name

    name of the PersistentVolumeClaim

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.PersistentVolumeClaim

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      application/json-patch+json

      -
    • -
    • -

      application/merge-patch+json

      -
    • -
    • -

      application/strategic-merge-patch+json

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    replace status of the specified PersistentVolumeClaim

    -
    -
    -
    PUT /api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}/status
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    BodyParameter

    body

    true

    v1.PersistentVolumeClaim

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    PathParameter

    name

    name of the PersistentVolumeClaim

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.PersistentVolumeClaim

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    list or watch objects of kind Pod

    -
    -
    -
    GET /api/v1/namespaces/{namespace}/pods
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    QueryParameter

    labelSelector

    a selector to restrict the list of returned objects by their labels; defaults to everything

    false

    string

    QueryParameter

    fieldSelector

    a selector to restrict the list of returned objects by their fields; defaults to everything

    false

    string

    QueryParameter

    watch

    watch for changes to the described resources and return them as a stream of add, update, and remove notifications; specify resourceVersion

    false

    boolean

    QueryParameter

    resourceVersion

    when specified with a watch call, shows changes that occur after that particular version of a resource; defaults to changes from the beginning of history

    false

    string

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.PodList

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    create a Pod

    -
    -
    -
    POST /api/v1/namespaces/{namespace}/pods
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    BodyParameter

    body

    true

    v1.Pod

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.Pod

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    read the specified Pod

    -
    -
    -
    GET /api/v1/namespaces/{namespace}/pods/{name}
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    PathParameter

    name

    name of the Pod

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.Pod

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    replace the specified Pod

    -
    -
    -
    PUT /api/v1/namespaces/{namespace}/pods/{name}
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    BodyParameter

    body

    true

    v1.Pod

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    PathParameter

    name

    name of the Pod

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.Pod

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    delete a Pod

    -
    -
    -
    DELETE /api/v1/namespaces/{namespace}/pods/{name}
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    BodyParameter

    body

    true

    v1.DeleteOptions

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    PathParameter

    name

    name of the Pod

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.Status

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    partially update the specified Pod

    -
    -
    -
    PATCH /api/v1/namespaces/{namespace}/pods/{name}
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    BodyParameter

    body

    true

    api.Patch

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    PathParameter

    name

    name of the Pod

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.Pod

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      application/json-patch+json

      -
    • -
    • -

      application/merge-patch+json

      -
    • -
    • -

      application/strategic-merge-patch+json

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    create binding of a Binding

    -
    -
    -
    POST /api/v1/namespaces/{namespace}/pods/{name}/binding
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    BodyParameter

    body

    true

    v1.Binding

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    PathParameter

    name

    name of the Binding

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.Binding

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    connect GET requests to exec of Pod

    -
    -
    -
    GET /api/v1/namespaces/{namespace}/pods/{name}/exec
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    PathParameter

    name

    name of the Pod

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    default

    success

    string

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    connect POST requests to exec of Pod

    -
    -
    -
    POST /api/v1/namespaces/{namespace}/pods/{name}/exec
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    PathParameter

    name

    name of the Pod

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    default

    success

    string

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    read log of the specified Pod

    -
    -
    -
    GET /api/v1/namespaces/{namespace}/pods/{name}/log
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    PathParameter

    name

    name of the Pod

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.Pod

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    connect GET requests to portforward of Pod

    -
    -
    -
    GET /api/v1/namespaces/{namespace}/pods/{name}/portforward
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    PathParameter

    name

    name of the Pod

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    default

    success

    string

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    connect POST requests to portforward of Pod

    -
    -
    -
    POST /api/v1/namespaces/{namespace}/pods/{name}/portforward
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    PathParameter

    name

    name of the Pod

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    default

    success

    string

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    connect GET requests to proxy of Pod

    -
    -
    -
    GET /api/v1/namespaces/{namespace}/pods/{name}/proxy
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    PathParameter

    name

    name of the Pod

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    default

    success

    string

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    connect PUT requests to proxy of Pod

    -
    -
    -
    PUT /api/v1/namespaces/{namespace}/pods/{name}/proxy
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    PathParameter

    name

    name of the Pod

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    default

    success

    string

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    connect DELETE requests to proxy of Pod

    -
    -
    -
    DELETE /api/v1/namespaces/{namespace}/pods/{name}/proxy
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    PathParameter

    name

    name of the Pod

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    default

    success

    string

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    connect POST requests to proxy of Pod

    -
    -
    -
    POST /api/v1/namespaces/{namespace}/pods/{name}/proxy
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    PathParameter

    name

    name of the Pod

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    default

    success

    string

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    connect GET requests to proxy of Pod

    -
    -
    -
    GET /api/v1/namespaces/{namespace}/pods/{name}/proxy/{path:*}
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    PathParameter

    name

    name of the Pod

    true

    string

    PathParameter

    path:*

    path to the resource

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    default

    success

    string

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    connect PUT requests to proxy of Pod

    -
    -
    -
    PUT /api/v1/namespaces/{namespace}/pods/{name}/proxy/{path:*}
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    PathParameter

    name

    name of the Pod

    true

    string

    PathParameter

    path:*

    path to the resource

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    default

    success

    string

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    connect DELETE requests to proxy of Pod

    -
    -
    -
    DELETE /api/v1/namespaces/{namespace}/pods/{name}/proxy/{path:*}
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    PathParameter

    name

    name of the Pod

    true

    string

    PathParameter

    path:*

    path to the resource

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    default

    success

    string

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    connect POST requests to proxy of Pod

    -
    -
    -
    POST /api/v1/namespaces/{namespace}/pods/{name}/proxy/{path:*}
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    PathParameter

    name

    name of the Pod

    true

    string

    PathParameter

    path:*

    path to the resource

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    default

    success

    string

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    replace status of the specified Pod

    -
    -
    -
    PUT /api/v1/namespaces/{namespace}/pods/{name}/status
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    BodyParameter

    body

    true

    v1.Pod

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    PathParameter

    name

    name of the Pod

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.Pod

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    list or watch objects of kind PodTemplate

    -
    -
    -
    GET /api/v1/namespaces/{namespace}/podtemplates
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    QueryParameter

    labelSelector

    a selector to restrict the list of returned objects by their labels; defaults to everything

    false

    string

    QueryParameter

    fieldSelector

    a selector to restrict the list of returned objects by their fields; defaults to everything

    false

    string

    QueryParameter

    watch

    watch for changes to the described resources and return them as a stream of add, update, and remove notifications; specify resourceVersion

    false

    boolean

    QueryParameter

    resourceVersion

    when specified with a watch call, shows changes that occur after that particular version of a resource; defaults to changes from the beginning of history

    false

    string

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.PodTemplateList

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    create a PodTemplate

    -
    -
    -
    POST /api/v1/namespaces/{namespace}/podtemplates
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    BodyParameter

    body

    true

    v1.PodTemplate

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.PodTemplate

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    read the specified PodTemplate

    -
    -
    -
    GET /api/v1/namespaces/{namespace}/podtemplates/{name}
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    PathParameter

    name

    name of the PodTemplate

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.PodTemplate

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    replace the specified PodTemplate

    -
    -
    -
    PUT /api/v1/namespaces/{namespace}/podtemplates/{name}
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    BodyParameter

    body

    true

    v1.PodTemplate

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    PathParameter

    name

    name of the PodTemplate

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.PodTemplate

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    delete a PodTemplate

    -
    -
    -
    DELETE /api/v1/namespaces/{namespace}/podtemplates/{name}
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    BodyParameter

    body

    true

    v1.DeleteOptions

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    PathParameter

    name

    name of the PodTemplate

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.Status

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    partially update the specified PodTemplate

    -
    -
    -
    PATCH /api/v1/namespaces/{namespace}/podtemplates/{name}
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    BodyParameter

    body

    true

    api.Patch

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    PathParameter

    name

    name of the PodTemplate

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.PodTemplate

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      application/json-patch+json

      -
    • -
    • -

      application/merge-patch+json

      -
    • -
    • -

      application/strategic-merge-patch+json

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    list or watch objects of kind ReplicationController

    -
    -
    -
    GET /api/v1/namespaces/{namespace}/replicationcontrollers
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    QueryParameter

    labelSelector

    a selector to restrict the list of returned objects by their labels; defaults to everything

    false

    string

    QueryParameter

    fieldSelector

    a selector to restrict the list of returned objects by their fields; defaults to everything

    false

    string

    QueryParameter

    watch

    watch for changes to the described resources and return them as a stream of add, update, and remove notifications; specify resourceVersion

    false

    boolean

    QueryParameter

    resourceVersion

    when specified with a watch call, shows changes that occur after that particular version of a resource; defaults to changes from the beginning of history

    false

    string

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.ReplicationControllerList

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    create a ReplicationController

    -
    -
    -
    POST /api/v1/namespaces/{namespace}/replicationcontrollers
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    BodyParameter

    body

    true

    v1.ReplicationController

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.ReplicationController

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    read the specified ReplicationController

    -
    -
    -
    GET /api/v1/namespaces/{namespace}/replicationcontrollers/{name}
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    PathParameter

    name

    name of the ReplicationController

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.ReplicationController

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    replace the specified ReplicationController

    -
    -
    -
    PUT /api/v1/namespaces/{namespace}/replicationcontrollers/{name}
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    BodyParameter

    body

    true

    v1.ReplicationController

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    PathParameter

    name

    name of the ReplicationController

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.ReplicationController

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    delete a ReplicationController

    -
    -
    -
    DELETE /api/v1/namespaces/{namespace}/replicationcontrollers/{name}
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    BodyParameter

    body

    true

    v1.DeleteOptions

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    PathParameter

    name

    name of the ReplicationController

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.Status

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    partially update the specified ReplicationController

    -
    -
    -
    PATCH /api/v1/namespaces/{namespace}/replicationcontrollers/{name}
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    BodyParameter

    body

    true

    api.Patch

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    PathParameter

    name

    name of the ReplicationController

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.ReplicationController

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      application/json-patch+json

      -
    • -
    • -

      application/merge-patch+json

      -
    • -
    • -

      application/strategic-merge-patch+json

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    list or watch objects of kind ResourceQuota

    -
    -
    -
    GET /api/v1/namespaces/{namespace}/resourcequotas
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    QueryParameter

    labelSelector

    a selector to restrict the list of returned objects by their labels; defaults to everything

    false

    string

    QueryParameter

    fieldSelector

    a selector to restrict the list of returned objects by their fields; defaults to everything

    false

    string

    QueryParameter

    watch

    watch for changes to the described resources and return them as a stream of add, update, and remove notifications; specify resourceVersion

    false

    boolean

    QueryParameter

    resourceVersion

    when specified with a watch call, shows changes that occur after that particular version of a resource; defaults to changes from the beginning of history

    false

    string

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.ResourceQuotaList

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    create a ResourceQuota

    -
    -
    -
    POST /api/v1/namespaces/{namespace}/resourcequotas
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    BodyParameter

    body

    true

    v1.ResourceQuota

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.ResourceQuota

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    read the specified ResourceQuota

    -
    -
    -
    GET /api/v1/namespaces/{namespace}/resourcequotas/{name}
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    PathParameter

    name

    name of the ResourceQuota

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.ResourceQuota

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    replace the specified ResourceQuota

    -
    -
    -
    PUT /api/v1/namespaces/{namespace}/resourcequotas/{name}
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    BodyParameter

    body

    true

    v1.ResourceQuota

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    PathParameter

    name

    name of the ResourceQuota

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.ResourceQuota

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    delete a ResourceQuota

    -
    -
    -
    DELETE /api/v1/namespaces/{namespace}/resourcequotas/{name}
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    BodyParameter

    body

    true

    v1.DeleteOptions

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    PathParameter

    name

    name of the ResourceQuota

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.Status

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    partially update the specified ResourceQuota

    -
    -
    -
    PATCH /api/v1/namespaces/{namespace}/resourcequotas/{name}
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    BodyParameter

    body

    true

    api.Patch

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    PathParameter

    name

    name of the ResourceQuota

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.ResourceQuota

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      application/json-patch+json

      -
    • -
    • -

      application/merge-patch+json

      -
    • -
    • -

      application/strategic-merge-patch+json

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    replace status of the specified ResourceQuota

    -
    -
    -
    PUT /api/v1/namespaces/{namespace}/resourcequotas/{name}/status
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    BodyParameter

    body

    true

    v1.ResourceQuota

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    PathParameter

    name

    name of the ResourceQuota

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.ResourceQuota

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    list or watch objects of kind Secret

    -
    -
    -
    GET /api/v1/namespaces/{namespace}/secrets
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    QueryParameter

    labelSelector

    a selector to restrict the list of returned objects by their labels; defaults to everything

    false

    string

    QueryParameter

    fieldSelector

    a selector to restrict the list of returned objects by their fields; defaults to everything

    false

    string

    QueryParameter

    watch

    watch for changes to the described resources and return them as a stream of add, update, and remove notifications; specify resourceVersion

    false

    boolean

    QueryParameter

    resourceVersion

    when specified with a watch call, shows changes that occur after that particular version of a resource; defaults to changes from the beginning of history

    false

    string

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.SecretList

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    create a Secret

    -
    -
    -
    POST /api/v1/namespaces/{namespace}/secrets
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    BodyParameter

    body

    true

    v1.Secret

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.Secret

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    read the specified Secret

    -
    -
    -
    GET /api/v1/namespaces/{namespace}/secrets/{name}
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    PathParameter

    name

    name of the Secret

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.Secret

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    replace the specified Secret

    -
    -
    -
    PUT /api/v1/namespaces/{namespace}/secrets/{name}
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    BodyParameter

    body

    true

    v1.Secret

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    PathParameter

    name

    name of the Secret

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.Secret

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    delete a Secret

    -
    -
    -
    DELETE /api/v1/namespaces/{namespace}/secrets/{name}
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    BodyParameter

    body

    true

    v1.DeleteOptions

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    PathParameter

    name

    name of the Secret

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.Status

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    partially update the specified Secret

    -
    -
    -
    PATCH /api/v1/namespaces/{namespace}/secrets/{name}
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    BodyParameter

    body

    true

    api.Patch

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    PathParameter

    name

    name of the Secret

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.Secret

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      application/json-patch+json

      -
    • -
    • -

      application/merge-patch+json

      -
    • -
    • -

      application/strategic-merge-patch+json

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    list or watch objects of kind ServiceAccount

    -
    -
    -
    GET /api/v1/namespaces/{namespace}/serviceaccounts
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    QueryParameter

    labelSelector

    a selector to restrict the list of returned objects by their labels; defaults to everything

    false

    string

    QueryParameter

    fieldSelector

    a selector to restrict the list of returned objects by their fields; defaults to everything

    false

    string

    QueryParameter

    watch

    watch for changes to the described resources and return them as a stream of add, update, and remove notifications; specify resourceVersion

    false

    boolean

    QueryParameter

    resourceVersion

    when specified with a watch call, shows changes that occur after that particular version of a resource; defaults to changes from the beginning of history

    false

    string

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.ServiceAccountList

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    create a ServiceAccount

    -
    -
    -
    POST /api/v1/namespaces/{namespace}/serviceaccounts
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    BodyParameter

    body

    true

    v1.ServiceAccount

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.ServiceAccount

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    read the specified ServiceAccount

    -
    -
    -
    GET /api/v1/namespaces/{namespace}/serviceaccounts/{name}
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    PathParameter

    name

    name of the ServiceAccount

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.ServiceAccount

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    replace the specified ServiceAccount

    -
    -
    -
    PUT /api/v1/namespaces/{namespace}/serviceaccounts/{name}
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    BodyParameter

    body

    true

    v1.ServiceAccount

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    PathParameter

    name

    name of the ServiceAccount

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.ServiceAccount

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    delete a ServiceAccount

    -
    -
    -
    DELETE /api/v1/namespaces/{namespace}/serviceaccounts/{name}
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    BodyParameter

    body

    true

    v1.DeleteOptions

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    PathParameter

    name

    name of the ServiceAccount

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.Status

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    partially update the specified ServiceAccount

    -
    -
    -
    PATCH /api/v1/namespaces/{namespace}/serviceaccounts/{name}
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    BodyParameter

    body

    true

    api.Patch

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    PathParameter

    name

    name of the ServiceAccount

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.ServiceAccount

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      application/json-patch+json

      -
    • -
    • -

      application/merge-patch+json

      -
    • -
    • -

      application/strategic-merge-patch+json

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    list or watch objects of kind Service

    -
    -
    -
    GET /api/v1/namespaces/{namespace}/services
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    QueryParameter

    labelSelector

    a selector to restrict the list of returned objects by their labels; defaults to everything

    false

    string

    QueryParameter

    fieldSelector

    a selector to restrict the list of returned objects by their fields; defaults to everything

    false

    string

    QueryParameter

    watch

    watch for changes to the described resources and return them as a stream of add, update, and remove notifications; specify resourceVersion

    false

    boolean

    QueryParameter

    resourceVersion

    when specified with a watch call, shows changes that occur after that particular version of a resource; defaults to changes from the beginning of history

    false

    string

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.ServiceList

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    create a Service

    -
    -
    -
    POST /api/v1/namespaces/{namespace}/services
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    BodyParameter

    body

    true

    v1.Service

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.Service

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    read the specified Service

    -
    -
    -
    GET /api/v1/namespaces/{namespace}/services/{name}
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    PathParameter

    name

    name of the Service

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.Service

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    replace the specified Service

    -
    -
    -
    PUT /api/v1/namespaces/{namespace}/services/{name}
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    BodyParameter

    body

    true

    v1.Service

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    PathParameter

    name

    name of the Service

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.Service

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    delete a Service

    -
    -
    -
    DELETE /api/v1/namespaces/{namespace}/services/{name}
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    PathParameter

    name

    name of the Service

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.Status

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    partially update the specified Service

    -
    -
    -
    PATCH /api/v1/namespaces/{namespace}/services/{name}
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    BodyParameter

    body

    true

    api.Patch

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    PathParameter

    name

    name of the Service

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.Service

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      application/json-patch+json

      -
    • -
    • -

      application/merge-patch+json

      -
    • -
    • -

      application/strategic-merge-patch+json

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    read the specified Namespace

    -
    -
    -
    GET /api/v1/namespaces/{name}
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    PathParameter

    name

    name of the Namespace

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.Namespace

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    replace the specified Namespace

    -
    -
    -
    PUT /api/v1/namespaces/{name}
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    BodyParameter

    body

    true

    v1.Namespace

    PathParameter

    name

    name of the Namespace

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.Namespace

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    delete a Namespace

    -
    -
    -
    DELETE /api/v1/namespaces/{name}
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    BodyParameter

    body

    true

    v1.DeleteOptions

    PathParameter

    name

    name of the Namespace

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.Status

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    partially update the specified Namespace

    -
    -
    -
    PATCH /api/v1/namespaces/{name}
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    BodyParameter

    body

    true

    api.Patch

    PathParameter

    name

    name of the Namespace

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.Namespace

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      application/json-patch+json

      -
    • -
    • -

      application/merge-patch+json

      -
    • -
    • -

      application/strategic-merge-patch+json

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    replace finalize of the specified Namespace

    -
    -
    -
    PUT /api/v1/namespaces/{name}/finalize
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    BodyParameter

    body

    true

    v1.Namespace

    PathParameter

    name

    name of the Namespace

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.Namespace

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    replace status of the specified Namespace

    -
    -
    -
    PUT /api/v1/namespaces/{name}/status
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    BodyParameter

    body

    true

    v1.Namespace

    PathParameter

    name

    name of the Namespace

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.Namespace

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    list or watch objects of kind Node

    -
    -
    -
    GET /api/v1/nodes
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    QueryParameter

    labelSelector

    a selector to restrict the list of returned objects by their labels; defaults to everything

    false

    string

    QueryParameter

    fieldSelector

    a selector to restrict the list of returned objects by their fields; defaults to everything

    false

    string

    QueryParameter

    watch

    watch for changes to the described resources and return them as a stream of add, update, and remove notifications; specify resourceVersion

    false

    boolean

    QueryParameter

    resourceVersion

    when specified with a watch call, shows changes that occur after that particular version of a resource; defaults to changes from the beginning of history

    false

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.NodeList

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    create a Node

    -
    -
    -
    POST /api/v1/nodes
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    BodyParameter

    body

    true

    v1.Node

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.Node

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    read the specified Node

    -
    -
    -
    GET /api/v1/nodes/{name}
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    PathParameter

    name

    name of the Node

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.Node

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    replace the specified Node

    -
    -
    -
    PUT /api/v1/nodes/{name}
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    BodyParameter

    body

    true

    v1.Node

    PathParameter

    name

    name of the Node

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.Node

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    delete a Node

    -
    -
    -
    DELETE /api/v1/nodes/{name}
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    BodyParameter

    body

    true

    v1.DeleteOptions

    PathParameter

    name

    name of the Node

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.Status

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    partially update the specified Node

    -
    -
    -
    PATCH /api/v1/nodes/{name}
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    BodyParameter

    body

    true

    api.Patch

    PathParameter

    name

    name of the Node

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.Node

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      application/json-patch+json

      -
    • -
    • -

      application/merge-patch+json

      -
    • -
    • -

      application/strategic-merge-patch+json

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    replace status of the specified Node

    -
    -
    -
    PUT /api/v1/nodes/{name}/status
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    BodyParameter

    body

    true

    v1.Node

    PathParameter

    name

    name of the Node

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.Node

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    list or watch objects of kind PersistentVolumeClaim

    -
    -
    -
    GET /api/v1/persistentvolumeclaims
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    QueryParameter

    labelSelector

    a selector to restrict the list of returned objects by their labels; defaults to everything

    false

    string

    QueryParameter

    fieldSelector

    a selector to restrict the list of returned objects by their fields; defaults to everything

    false

    string

    QueryParameter

    watch

    watch for changes to the described resources and return them as a stream of add, update, and remove notifications; specify resourceVersion

    false

    boolean

    QueryParameter

    resourceVersion

    when specified with a watch call, shows changes that occur after that particular version of a resource; defaults to changes from the beginning of history

    false

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.PersistentVolumeClaimList

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    create a PersistentVolumeClaim

    -
    -
    -
    POST /api/v1/persistentvolumeclaims
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    BodyParameter

    body

    true

    v1.PersistentVolumeClaim

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.PersistentVolumeClaim

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    list or watch objects of kind PersistentVolume

    -
    -
    -
    GET /api/v1/persistentvolumes
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    QueryParameter

    labelSelector

    a selector to restrict the list of returned objects by their labels; defaults to everything

    false

    string

    QueryParameter

    fieldSelector

    a selector to restrict the list of returned objects by their fields; defaults to everything

    false

    string

    QueryParameter

    watch

    watch for changes to the described resources and return them as a stream of add, update, and remove notifications; specify resourceVersion

    false

    boolean

    QueryParameter

    resourceVersion

    when specified with a watch call, shows changes that occur after that particular version of a resource; defaults to changes from the beginning of history

    false

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.PersistentVolumeList

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    create a PersistentVolume

    -
    -
    -
    POST /api/v1/persistentvolumes
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    BodyParameter

    body

    true

    v1.PersistentVolume

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.PersistentVolume

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    read the specified PersistentVolume

    -
    -
    -
    GET /api/v1/persistentvolumes/{name}
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    PathParameter

    name

    name of the PersistentVolume

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.PersistentVolume

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    replace the specified PersistentVolume

    -
    -
    -
    PUT /api/v1/persistentvolumes/{name}
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    BodyParameter

    body

    true

    v1.PersistentVolume

    PathParameter

    name

    name of the PersistentVolume

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.PersistentVolume

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    delete a PersistentVolume

    -
    -
    -
    DELETE /api/v1/persistentvolumes/{name}
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    BodyParameter

    body

    true

    v1.DeleteOptions

    PathParameter

    name

    name of the PersistentVolume

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.Status

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    partially update the specified PersistentVolume

    -
    -
    -
    PATCH /api/v1/persistentvolumes/{name}
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    BodyParameter

    body

    true

    api.Patch

    PathParameter

    name

    name of the PersistentVolume

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.PersistentVolume

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      application/json-patch+json

      -
    • -
    • -

      application/merge-patch+json

      -
    • -
    • -

      application/strategic-merge-patch+json

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    replace status of the specified PersistentVolume

    -
    -
    -
    PUT /api/v1/persistentvolumes/{name}/status
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    BodyParameter

    body

    true

    v1.PersistentVolume

    PathParameter

    name

    name of the PersistentVolume

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.PersistentVolume

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    list or watch objects of kind Pod

    -
    -
    -
    GET /api/v1/pods
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    QueryParameter

    labelSelector

    a selector to restrict the list of returned objects by their labels; defaults to everything

    false

    string

    QueryParameter

    fieldSelector

    a selector to restrict the list of returned objects by their fields; defaults to everything

    false

    string

    QueryParameter

    watch

    watch for changes to the described resources and return them as a stream of add, update, and remove notifications; specify resourceVersion

    false

    boolean

    QueryParameter

    resourceVersion

    when specified with a watch call, shows changes that occur after that particular version of a resource; defaults to changes from the beginning of history

    false

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.PodList

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    create a Pod

    -
    -
    -
    POST /api/v1/pods
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    BodyParameter

    body

    true

    v1.Pod

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.Pod

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    list or watch objects of kind PodTemplate

    -
    -
    -
    GET /api/v1/podtemplates
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    QueryParameter

    labelSelector

    a selector to restrict the list of returned objects by their labels; defaults to everything

    false

    string

    QueryParameter

    fieldSelector

    a selector to restrict the list of returned objects by their fields; defaults to everything

    false

    string

    QueryParameter

    watch

    watch for changes to the described resources and return them as a stream of add, update, and remove notifications; specify resourceVersion

    false

    boolean

    QueryParameter

    resourceVersion

    when specified with a watch call, shows changes that occur after that particular version of a resource; defaults to changes from the beginning of history

    false

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.PodTemplateList

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    create a PodTemplate

    -
    -
    -
    POST /api/v1/podtemplates
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    BodyParameter

    body

    true

    v1.PodTemplate

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.PodTemplate

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    proxy GET requests to Pod

    -
    -
    -
    GET /api/v1/proxy/namespaces/{namespace}/pods/{name}
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    PathParameter

    name

    name of the Pod

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    default

    success

    string

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    proxy PUT requests to Pod

    -
    -
    -
    PUT /api/v1/proxy/namespaces/{namespace}/pods/{name}
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    PathParameter

    name

    name of the Pod

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    default

    success

    string

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    proxy DELETE requests to Pod

    -
    -
    -
    DELETE /api/v1/proxy/namespaces/{namespace}/pods/{name}
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    PathParameter

    name

    name of the Pod

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    default

    success

    string

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    proxy POST requests to Pod

    -
    -
    -
    POST /api/v1/proxy/namespaces/{namespace}/pods/{name}
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    PathParameter

    name

    name of the Pod

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    default

    success

    string

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    proxy GET requests to Pod

    -
    -
    -
    GET /api/v1/proxy/namespaces/{namespace}/pods/{name}/{path:*}
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    PathParameter

    name

    name of the Pod

    true

    string

    PathParameter

    path:*

    path to the resource

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    default

    success

    string

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    proxy PUT requests to Pod

    -
    -
    -
    PUT /api/v1/proxy/namespaces/{namespace}/pods/{name}/{path:*}
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    PathParameter

    name

    name of the Pod

    true

    string

    PathParameter

    path:*

    path to the resource

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    default

    success

    string

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    proxy DELETE requests to Pod

    -
    -
    -
    DELETE /api/v1/proxy/namespaces/{namespace}/pods/{name}/{path:*}
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    PathParameter

    name

    name of the Pod

    true

    string

    PathParameter

    path:*

    path to the resource

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    default

    success

    string

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    proxy POST requests to Pod

    -
    -
    -
    POST /api/v1/proxy/namespaces/{namespace}/pods/{name}/{path:*}
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    PathParameter

    name

    name of the Pod

    true

    string

    PathParameter

    path:*

    path to the resource

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    default

    success

    string

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    proxy GET requests to Service

    -
    -
    -
    GET /api/v1/proxy/namespaces/{namespace}/services/{name}
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    PathParameter

    name

    name of the Service

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    default

    success

    string

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    proxy PUT requests to Service

    -
    -
    -
    PUT /api/v1/proxy/namespaces/{namespace}/services/{name}
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    PathParameter

    name

    name of the Service

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    default

    success

    string

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    proxy DELETE requests to Service

    -
    -
    -
    DELETE /api/v1/proxy/namespaces/{namespace}/services/{name}
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    PathParameter

    name

    name of the Service

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    default

    success

    string

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    proxy POST requests to Service

    -
    -
    -
    POST /api/v1/proxy/namespaces/{namespace}/services/{name}
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    PathParameter

    name

    name of the Service

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    default

    success

    string

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    proxy GET requests to Service

    -
    -
    -
    GET /api/v1/proxy/namespaces/{namespace}/services/{name}/{path:*}
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    PathParameter

    name

    name of the Service

    true

    string

    PathParameter

    path:*

    path to the resource

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    default

    success

    string

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    proxy PUT requests to Service

    -
    -
    -
    PUT /api/v1/proxy/namespaces/{namespace}/services/{name}/{path:*}
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    PathParameter

    name

    name of the Service

    true

    string

    PathParameter

    path:*

    path to the resource

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    default

    success

    string

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    proxy DELETE requests to Service

    -
    -
    -
    DELETE /api/v1/proxy/namespaces/{namespace}/services/{name}/{path:*}
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    PathParameter

    name

    name of the Service

    true

    string

    PathParameter

    path:*

    path to the resource

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    default

    success

    string

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    proxy POST requests to Service

    -
    -
    -
    POST /api/v1/proxy/namespaces/{namespace}/services/{name}/{path:*}
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    PathParameter

    name

    name of the Service

    true

    string

    PathParameter

    path:*

    path to the resource

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    default

    success

    string

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    proxy GET requests to Node

    -
    -
    -
    GET /api/v1/proxy/nodes/{name}
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    PathParameter

    name

    name of the Node

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    default

    success

    string

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    proxy PUT requests to Node

    -
    -
    -
    PUT /api/v1/proxy/nodes/{name}
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    PathParameter

    name

    name of the Node

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    default

    success

    string

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    proxy DELETE requests to Node

    -
    -
    -
    DELETE /api/v1/proxy/nodes/{name}
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    PathParameter

    name

    name of the Node

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    default

    success

    string

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    proxy POST requests to Node

    -
    -
    -
    POST /api/v1/proxy/nodes/{name}
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    PathParameter

    name

    name of the Node

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    default

    success

    string

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    proxy GET requests to Node

    -
    -
    -
    GET /api/v1/proxy/nodes/{name}/{path:*}
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    PathParameter

    name

    name of the Node

    true

    string

    PathParameter

    path:*

    path to the resource

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    default

    success

    string

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    proxy PUT requests to Node

    -
    -
    -
    PUT /api/v1/proxy/nodes/{name}/{path:*}
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    PathParameter

    name

    name of the Node

    true

    string

    PathParameter

    path:*

    path to the resource

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    default

    success

    string

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    proxy DELETE requests to Node

    -
    -
    -
    DELETE /api/v1/proxy/nodes/{name}/{path:*}
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    PathParameter

    name

    name of the Node

    true

    string

    PathParameter

    path:*

    path to the resource

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    default

    success

    string

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    proxy POST requests to Node

    -
    -
    -
    POST /api/v1/proxy/nodes/{name}/{path:*}
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    PathParameter

    name

    name of the Node

    true

    string

    PathParameter

    path:*

    path to the resource

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    default

    success

    string

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    list or watch objects of kind ReplicationController

    -
    -
    -
    GET /api/v1/replicationcontrollers
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    QueryParameter

    labelSelector

    a selector to restrict the list of returned objects by their labels; defaults to everything

    false

    string

    QueryParameter

    fieldSelector

    a selector to restrict the list of returned objects by their fields; defaults to everything

    false

    string

    QueryParameter

    watch

    watch for changes to the described resources and return them as a stream of add, update, and remove notifications; specify resourceVersion

    false

    boolean

    QueryParameter

    resourceVersion

    when specified with a watch call, shows changes that occur after that particular version of a resource; defaults to changes from the beginning of history

    false

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.ReplicationControllerList

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    create a ReplicationController

    -
    -
    -
    POST /api/v1/replicationcontrollers
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    BodyParameter

    body

    true

    v1.ReplicationController

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.ReplicationController

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    list or watch objects of kind ResourceQuota

    -
    -
    -
    GET /api/v1/resourcequotas
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    QueryParameter

    labelSelector

    a selector to restrict the list of returned objects by their labels; defaults to everything

    false

    string

    QueryParameter

    fieldSelector

    a selector to restrict the list of returned objects by their fields; defaults to everything

    false

    string

    QueryParameter

    watch

    watch for changes to the described resources and return them as a stream of add, update, and remove notifications; specify resourceVersion

    false

    boolean

    QueryParameter

    resourceVersion

    when specified with a watch call, shows changes that occur after that particular version of a resource; defaults to changes from the beginning of history

    false

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.ResourceQuotaList

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    create a ResourceQuota

    -
    -
    -
    POST /api/v1/resourcequotas
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    BodyParameter

    body

    true

    v1.ResourceQuota

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.ResourceQuota

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    list or watch objects of kind Secret

    -
    -
    -
    GET /api/v1/secrets
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    QueryParameter

    labelSelector

    a selector to restrict the list of returned objects by their labels; defaults to everything

    false

    string

    QueryParameter

    fieldSelector

    a selector to restrict the list of returned objects by their fields; defaults to everything

    false

    string

    QueryParameter

    watch

    watch for changes to the described resources and return them as a stream of add, update, and remove notifications; specify resourceVersion

    false

    boolean

    QueryParameter

    resourceVersion

    when specified with a watch call, shows changes that occur after that particular version of a resource; defaults to changes from the beginning of history

    false

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.SecretList

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    create a Secret

    -
    -
    -
    POST /api/v1/secrets
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    BodyParameter

    body

    true

    v1.Secret

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.Secret

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    list or watch objects of kind ServiceAccount

    -
    -
    -
    GET /api/v1/serviceaccounts
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    QueryParameter

    labelSelector

    a selector to restrict the list of returned objects by their labels; defaults to everything

    false

    string

    QueryParameter

    fieldSelector

    a selector to restrict the list of returned objects by their fields; defaults to everything

    false

    string

    QueryParameter

    watch

    watch for changes to the described resources and return them as a stream of add, update, and remove notifications; specify resourceVersion

    false

    boolean

    QueryParameter

    resourceVersion

    when specified with a watch call, shows changes that occur after that particular version of a resource; defaults to changes from the beginning of history

    false

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.ServiceAccountList

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    create a ServiceAccount

    -
    -
    -
    POST /api/v1/serviceaccounts
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    BodyParameter

    body

    true

    v1.ServiceAccount

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.ServiceAccount

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    list or watch objects of kind Service

    -
    -
    -
    GET /api/v1/services
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    QueryParameter

    labelSelector

    a selector to restrict the list of returned objects by their labels; defaults to everything

    false

    string

    QueryParameter

    fieldSelector

    a selector to restrict the list of returned objects by their fields; defaults to everything

    false

    string

    QueryParameter

    watch

    watch for changes to the described resources and return them as a stream of add, update, and remove notifications; specify resourceVersion

    false

    boolean

    QueryParameter

    resourceVersion

    when specified with a watch call, shows changes that occur after that particular version of a resource; defaults to changes from the beginning of history

    false

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.ServiceList

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    create a Service

    -
    -
    -
    POST /api/v1/services
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    BodyParameter

    body

    true

    v1.Service

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    v1.Service

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    watch individual changes to a list of Endpoints

    -
    -
    -
    GET /api/v1/watch/endpoints
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    QueryParameter

    labelSelector

    a selector to restrict the list of returned objects by their labels; defaults to everything

    false

    string

    QueryParameter

    fieldSelector

    a selector to restrict the list of returned objects by their fields; defaults to everything

    false

    string

    QueryParameter

    watch

    watch for changes to the described resources and return them as a stream of add, update, and remove notifications; specify resourceVersion

    false

    boolean

    QueryParameter

    resourceVersion

    when specified with a watch call, shows changes that occur after that particular version of a resource; defaults to changes from the beginning of history

    false

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    json.WatchEvent

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    watch individual changes to a list of Event

    -
    -
    -
    GET /api/v1/watch/events
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    QueryParameter

    labelSelector

    a selector to restrict the list of returned objects by their labels; defaults to everything

    false

    string

    QueryParameter

    fieldSelector

    a selector to restrict the list of returned objects by their fields; defaults to everything

    false

    string

    QueryParameter

    watch

    watch for changes to the described resources and return them as a stream of add, update, and remove notifications; specify resourceVersion

    false

    boolean

    QueryParameter

    resourceVersion

    when specified with a watch call, shows changes that occur after that particular version of a resource; defaults to changes from the beginning of history

    false

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    json.WatchEvent

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    watch individual changes to a list of LimitRange

    -
    -
    -
    GET /api/v1/watch/limitranges
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    QueryParameter

    labelSelector

    a selector to restrict the list of returned objects by their labels; defaults to everything

    false

    string

    QueryParameter

    fieldSelector

    a selector to restrict the list of returned objects by their fields; defaults to everything

    false

    string

    QueryParameter

    watch

    watch for changes to the described resources and return them as a stream of add, update, and remove notifications; specify resourceVersion

    false

    boolean

    QueryParameter

    resourceVersion

    when specified with a watch call, shows changes that occur after that particular version of a resource; defaults to changes from the beginning of history

    false

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    json.WatchEvent

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    watch individual changes to a list of Namespace

    -
    -
    -
    GET /api/v1/watch/namespaces
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    QueryParameter

    labelSelector

    a selector to restrict the list of returned objects by their labels; defaults to everything

    false

    string

    QueryParameter

    fieldSelector

    a selector to restrict the list of returned objects by their fields; defaults to everything

    false

    string

    QueryParameter

    watch

    watch for changes to the described resources and return them as a stream of add, update, and remove notifications; specify resourceVersion

    false

    boolean

    QueryParameter

    resourceVersion

    when specified with a watch call, shows changes that occur after that particular version of a resource; defaults to changes from the beginning of history

    false

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    json.WatchEvent

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    watch individual changes to a list of Endpoints

    -
    -
    -
    GET /api/v1/watch/namespaces/{namespace}/endpoints
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    QueryParameter

    labelSelector

    a selector to restrict the list of returned objects by their labels; defaults to everything

    false

    string

    QueryParameter

    fieldSelector

    a selector to restrict the list of returned objects by their fields; defaults to everything

    false

    string

    QueryParameter

    watch

    watch for changes to the described resources and return them as a stream of add, update, and remove notifications; specify resourceVersion

    false

    boolean

    QueryParameter

    resourceVersion

    when specified with a watch call, shows changes that occur after that particular version of a resource; defaults to changes from the beginning of history

    false

    string

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    json.WatchEvent

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    watch changes to an object of kind Endpoints

    -
    -
    -
    GET /api/v1/watch/namespaces/{namespace}/endpoints/{name}
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    QueryParameter

    labelSelector

    a selector to restrict the list of returned objects by their labels; defaults to everything

    false

    string

    QueryParameter

    fieldSelector

    a selector to restrict the list of returned objects by their fields; defaults to everything

    false

    string

    QueryParameter

    watch

    watch for changes to the described resources and return them as a stream of add, update, and remove notifications; specify resourceVersion

    false

    boolean

    QueryParameter

    resourceVersion

    when specified with a watch call, shows changes that occur after that particular version of a resource; defaults to changes from the beginning of history

    false

    string

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    PathParameter

    name

    name of the Endpoints

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    json.WatchEvent

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    watch individual changes to a list of Event

    -
    -
    -
    GET /api/v1/watch/namespaces/{namespace}/events
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    QueryParameter

    labelSelector

    a selector to restrict the list of returned objects by their labels; defaults to everything

    false

    string

    QueryParameter

    fieldSelector

    a selector to restrict the list of returned objects by their fields; defaults to everything

    false

    string

    QueryParameter

    watch

    watch for changes to the described resources and return them as a stream of add, update, and remove notifications; specify resourceVersion

    false

    boolean

    QueryParameter

    resourceVersion

    when specified with a watch call, shows changes that occur after that particular version of a resource; defaults to changes from the beginning of history

    false

    string

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    json.WatchEvent

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    watch changes to an object of kind Event

    -
    -
    -
    GET /api/v1/watch/namespaces/{namespace}/events/{name}
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    QueryParameter

    labelSelector

    a selector to restrict the list of returned objects by their labels; defaults to everything

    false

    string

    QueryParameter

    fieldSelector

    a selector to restrict the list of returned objects by their fields; defaults to everything

    false

    string

    QueryParameter

    watch

    watch for changes to the described resources and return them as a stream of add, update, and remove notifications; specify resourceVersion

    false

    boolean

    QueryParameter

    resourceVersion

    when specified with a watch call, shows changes that occur after that particular version of a resource; defaults to changes from the beginning of history

    false

    string

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    PathParameter

    name

    name of the Event

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    json.WatchEvent

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    watch individual changes to a list of LimitRange

    -
    -
    -
    GET /api/v1/watch/namespaces/{namespace}/limitranges
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    QueryParameter

    labelSelector

    a selector to restrict the list of returned objects by their labels; defaults to everything

    false

    string

    QueryParameter

    fieldSelector

    a selector to restrict the list of returned objects by their fields; defaults to everything

    false

    string

    QueryParameter

    watch

    watch for changes to the described resources and return them as a stream of add, update, and remove notifications; specify resourceVersion

    false

    boolean

    QueryParameter

    resourceVersion

    when specified with a watch call, shows changes that occur after that particular version of a resource; defaults to changes from the beginning of history

    false

    string

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    json.WatchEvent

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    watch changes to an object of kind LimitRange

    -
    -
    -
    GET /api/v1/watch/namespaces/{namespace}/limitranges/{name}
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    QueryParameter

    labelSelector

    a selector to restrict the list of returned objects by their labels; defaults to everything

    false

    string

    QueryParameter

    fieldSelector

    a selector to restrict the list of returned objects by their fields; defaults to everything

    false

    string

    QueryParameter

    watch

    watch for changes to the described resources and return them as a stream of add, update, and remove notifications; specify resourceVersion

    false

    boolean

    QueryParameter

    resourceVersion

    when specified with a watch call, shows changes that occur after that particular version of a resource; defaults to changes from the beginning of history

    false

    string

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    PathParameter

    name

    name of the LimitRange

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    json.WatchEvent

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    watch individual changes to a list of PersistentVolumeClaim

    -
    -
    -
    GET /api/v1/watch/namespaces/{namespace}/persistentvolumeclaims
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    QueryParameter

    labelSelector

    a selector to restrict the list of returned objects by their labels; defaults to everything

    false

    string

    QueryParameter

    fieldSelector

    a selector to restrict the list of returned objects by their fields; defaults to everything

    false

    string

    QueryParameter

    watch

    watch for changes to the described resources and return them as a stream of add, update, and remove notifications; specify resourceVersion

    false

    boolean

    QueryParameter

    resourceVersion

    when specified with a watch call, shows changes that occur after that particular version of a resource; defaults to changes from the beginning of history

    false

    string

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    json.WatchEvent

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    watch changes to an object of kind PersistentVolumeClaim

    -
    -
    -
    GET /api/v1/watch/namespaces/{namespace}/persistentvolumeclaims/{name}
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    QueryParameter

    labelSelector

    a selector to restrict the list of returned objects by their labels; defaults to everything

    false

    string

    QueryParameter

    fieldSelector

    a selector to restrict the list of returned objects by their fields; defaults to everything

    false

    string

    QueryParameter

    watch

    watch for changes to the described resources and return them as a stream of add, update, and remove notifications; specify resourceVersion

    false

    boolean

    QueryParameter

    resourceVersion

    when specified with a watch call, shows changes that occur after that particular version of a resource; defaults to changes from the beginning of history

    false

    string

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    PathParameter

    name

    name of the PersistentVolumeClaim

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    json.WatchEvent

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    watch individual changes to a list of Pod

    -
    -
    -
    GET /api/v1/watch/namespaces/{namespace}/pods
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    QueryParameter

    labelSelector

    a selector to restrict the list of returned objects by their labels; defaults to everything

    false

    string

    QueryParameter

    fieldSelector

    a selector to restrict the list of returned objects by their fields; defaults to everything

    false

    string

    QueryParameter

    watch

    watch for changes to the described resources and return them as a stream of add, update, and remove notifications; specify resourceVersion

    false

    boolean

    QueryParameter

    resourceVersion

    when specified with a watch call, shows changes that occur after that particular version of a resource; defaults to changes from the beginning of history

    false

    string

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    json.WatchEvent

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    watch changes to an object of kind Pod

    -
    -
    -
    GET /api/v1/watch/namespaces/{namespace}/pods/{name}
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    QueryParameter

    labelSelector

    a selector to restrict the list of returned objects by their labels; defaults to everything

    false

    string

    QueryParameter

    fieldSelector

    a selector to restrict the list of returned objects by their fields; defaults to everything

    false

    string

    QueryParameter

    watch

    watch for changes to the described resources and return them as a stream of add, update, and remove notifications; specify resourceVersion

    false

    boolean

    QueryParameter

    resourceVersion

    when specified with a watch call, shows changes that occur after that particular version of a resource; defaults to changes from the beginning of history

    false

    string

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    PathParameter

    name

    name of the Pod

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    json.WatchEvent

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    watch individual changes to a list of PodTemplate

    -
    -
    -
    GET /api/v1/watch/namespaces/{namespace}/podtemplates
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    QueryParameter

    labelSelector

    a selector to restrict the list of returned objects by their labels; defaults to everything

    false

    string

    QueryParameter

    fieldSelector

    a selector to restrict the list of returned objects by their fields; defaults to everything

    false

    string

    QueryParameter

    watch

    watch for changes to the described resources and return them as a stream of add, update, and remove notifications; specify resourceVersion

    false

    boolean

    QueryParameter

    resourceVersion

    when specified with a watch call, shows changes that occur after that particular version of a resource; defaults to changes from the beginning of history

    false

    string

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    json.WatchEvent

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    watch changes to an object of kind PodTemplate

    -
    -
    -
    GET /api/v1/watch/namespaces/{namespace}/podtemplates/{name}
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    QueryParameter

    labelSelector

    a selector to restrict the list of returned objects by their labels; defaults to everything

    false

    string

    QueryParameter

    fieldSelector

    a selector to restrict the list of returned objects by their fields; defaults to everything

    false

    string

    QueryParameter

    watch

    watch for changes to the described resources and return them as a stream of add, update, and remove notifications; specify resourceVersion

    false

    boolean

    QueryParameter

    resourceVersion

    when specified with a watch call, shows changes that occur after that particular version of a resource; defaults to changes from the beginning of history

    false

    string

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    PathParameter

    name

    name of the PodTemplate

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    json.WatchEvent

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    watch individual changes to a list of ReplicationController

    -
    -
    -
    GET /api/v1/watch/namespaces/{namespace}/replicationcontrollers
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    QueryParameter

    labelSelector

    a selector to restrict the list of returned objects by their labels; defaults to everything

    false

    string

    QueryParameter

    fieldSelector

    a selector to restrict the list of returned objects by their fields; defaults to everything

    false

    string

    QueryParameter

    watch

    watch for changes to the described resources and return them as a stream of add, update, and remove notifications; specify resourceVersion

    false

    boolean

    QueryParameter

    resourceVersion

    when specified with a watch call, shows changes that occur after that particular version of a resource; defaults to changes from the beginning of history

    false

    string

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    json.WatchEvent

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    watch changes to an object of kind ReplicationController

    -
    -
    -
    GET /api/v1/watch/namespaces/{namespace}/replicationcontrollers/{name}
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    QueryParameter

    labelSelector

    a selector to restrict the list of returned objects by their labels; defaults to everything

    false

    string

    QueryParameter

    fieldSelector

    a selector to restrict the list of returned objects by their fields; defaults to everything

    false

    string

    QueryParameter

    watch

    watch for changes to the described resources and return them as a stream of add, update, and remove notifications; specify resourceVersion

    false

    boolean

    QueryParameter

    resourceVersion

    when specified with a watch call, shows changes that occur after that particular version of a resource; defaults to changes from the beginning of history

    false

    string

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    PathParameter

    name

    name of the ReplicationController

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    json.WatchEvent

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    watch individual changes to a list of ResourceQuota

    -
    -
    -
    GET /api/v1/watch/namespaces/{namespace}/resourcequotas
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    QueryParameter

    labelSelector

    a selector to restrict the list of returned objects by their labels; defaults to everything

    false

    string

    QueryParameter

    fieldSelector

    a selector to restrict the list of returned objects by their fields; defaults to everything

    false

    string

    QueryParameter

    watch

    watch for changes to the described resources and return them as a stream of add, update, and remove notifications; specify resourceVersion

    false

    boolean

    QueryParameter

    resourceVersion

    when specified with a watch call, shows changes that occur after that particular version of a resource; defaults to changes from the beginning of history

    false

    string

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    json.WatchEvent

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    watch changes to an object of kind ResourceQuota

    -
    -
    -
    GET /api/v1/watch/namespaces/{namespace}/resourcequotas/{name}
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    QueryParameter

    labelSelector

    a selector to restrict the list of returned objects by their labels; defaults to everything

    false

    string

    QueryParameter

    fieldSelector

    a selector to restrict the list of returned objects by their fields; defaults to everything

    false

    string

    QueryParameter

    watch

    watch for changes to the described resources and return them as a stream of add, update, and remove notifications; specify resourceVersion

    false

    boolean

    QueryParameter

    resourceVersion

    when specified with a watch call, shows changes that occur after that particular version of a resource; defaults to changes from the beginning of history

    false

    string

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    PathParameter

    name

    name of the ResourceQuota

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    json.WatchEvent

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    watch individual changes to a list of Secret

    -
    -
    -
    GET /api/v1/watch/namespaces/{namespace}/secrets
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    QueryParameter

    labelSelector

    a selector to restrict the list of returned objects by their labels; defaults to everything

    false

    string

    QueryParameter

    fieldSelector

    a selector to restrict the list of returned objects by their fields; defaults to everything

    false

    string

    QueryParameter

    watch

    watch for changes to the described resources and return them as a stream of add, update, and remove notifications; specify resourceVersion

    false

    boolean

    QueryParameter

    resourceVersion

    when specified with a watch call, shows changes that occur after that particular version of a resource; defaults to changes from the beginning of history

    false

    string

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    json.WatchEvent

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    watch changes to an object of kind Secret

    -
    -
    -
    GET /api/v1/watch/namespaces/{namespace}/secrets/{name}
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    QueryParameter

    labelSelector

    a selector to restrict the list of returned objects by their labels; defaults to everything

    false

    string

    QueryParameter

    fieldSelector

    a selector to restrict the list of returned objects by their fields; defaults to everything

    false

    string

    QueryParameter

    watch

    watch for changes to the described resources and return them as a stream of add, update, and remove notifications; specify resourceVersion

    false

    boolean

    QueryParameter

    resourceVersion

    when specified with a watch call, shows changes that occur after that particular version of a resource; defaults to changes from the beginning of history

    false

    string

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    PathParameter

    name

    name of the Secret

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    json.WatchEvent

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    watch individual changes to a list of ServiceAccount

    -
    -
    -
    GET /api/v1/watch/namespaces/{namespace}/serviceaccounts
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    QueryParameter

    labelSelector

    a selector to restrict the list of returned objects by their labels; defaults to everything

    false

    string

    QueryParameter

    fieldSelector

    a selector to restrict the list of returned objects by their fields; defaults to everything

    false

    string

    QueryParameter

    watch

    watch for changes to the described resources and return them as a stream of add, update, and remove notifications; specify resourceVersion

    false

    boolean

    QueryParameter

    resourceVersion

    when specified with a watch call, shows changes that occur after that particular version of a resource; defaults to changes from the beginning of history

    false

    string

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    json.WatchEvent

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    watch changes to an object of kind ServiceAccount

    -
    -
    -
    GET /api/v1/watch/namespaces/{namespace}/serviceaccounts/{name}
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    QueryParameter

    labelSelector

    a selector to restrict the list of returned objects by their labels; defaults to everything

    false

    string

    QueryParameter

    fieldSelector

    a selector to restrict the list of returned objects by their fields; defaults to everything

    false

    string

    QueryParameter

    watch

    watch for changes to the described resources and return them as a stream of add, update, and remove notifications; specify resourceVersion

    false

    boolean

    QueryParameter

    resourceVersion

    when specified with a watch call, shows changes that occur after that particular version of a resource; defaults to changes from the beginning of history

    false

    string

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    PathParameter

    name

    name of the ServiceAccount

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    json.WatchEvent

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    watch individual changes to a list of Service

    -
    -
    -
    GET /api/v1/watch/namespaces/{namespace}/services
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    QueryParameter

    labelSelector

    a selector to restrict the list of returned objects by their labels; defaults to everything

    false

    string

    QueryParameter

    fieldSelector

    a selector to restrict the list of returned objects by their fields; defaults to everything

    false

    string

    QueryParameter

    watch

    watch for changes to the described resources and return them as a stream of add, update, and remove notifications; specify resourceVersion

    false

    boolean

    QueryParameter

    resourceVersion

    when specified with a watch call, shows changes that occur after that particular version of a resource; defaults to changes from the beginning of history

    false

    string

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    json.WatchEvent

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    watch changes to an object of kind Service

    -
    -
    -
    GET /api/v1/watch/namespaces/{namespace}/services/{name}
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    QueryParameter

    labelSelector

    a selector to restrict the list of returned objects by their labels; defaults to everything

    false

    string

    QueryParameter

    fieldSelector

    a selector to restrict the list of returned objects by their fields; defaults to everything

    false

    string

    QueryParameter

    watch

    watch for changes to the described resources and return them as a stream of add, update, and remove notifications; specify resourceVersion

    false

    boolean

    QueryParameter

    resourceVersion

    when specified with a watch call, shows changes that occur after that particular version of a resource; defaults to changes from the beginning of history

    false

    string

    PathParameter

    namespace

    object name and auth scope, such as for teams and projects

    true

    string

    PathParameter

    name

    name of the Service

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    json.WatchEvent

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    watch changes to an object of kind Namespace

    -
    -
    -
    GET /api/v1/watch/namespaces/{name}
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    QueryParameter

    labelSelector

    a selector to restrict the list of returned objects by their labels; defaults to everything

    false

    string

    QueryParameter

    fieldSelector

    a selector to restrict the list of returned objects by their fields; defaults to everything

    false

    string

    QueryParameter

    watch

    watch for changes to the described resources and return them as a stream of add, update, and remove notifications; specify resourceVersion

    false

    boolean

    QueryParameter

    resourceVersion

    when specified with a watch call, shows changes that occur after that particular version of a resource; defaults to changes from the beginning of history

    false

    string

    PathParameter

    name

    name of the Namespace

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    json.WatchEvent

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    watch individual changes to a list of Node

    -
    -
    -
    GET /api/v1/watch/nodes
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    QueryParameter

    labelSelector

    a selector to restrict the list of returned objects by their labels; defaults to everything

    false

    string

    QueryParameter

    fieldSelector

    a selector to restrict the list of returned objects by their fields; defaults to everything

    false

    string

    QueryParameter

    watch

    watch for changes to the described resources and return them as a stream of add, update, and remove notifications; specify resourceVersion

    false

    boolean

    QueryParameter

    resourceVersion

    when specified with a watch call, shows changes that occur after that particular version of a resource; defaults to changes from the beginning of history

    false

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    json.WatchEvent

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    watch changes to an object of kind Node

    -
    -
    -
    GET /api/v1/watch/nodes/{name}
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    QueryParameter

    labelSelector

    a selector to restrict the list of returned objects by their labels; defaults to everything

    false

    string

    QueryParameter

    fieldSelector

    a selector to restrict the list of returned objects by their fields; defaults to everything

    false

    string

    QueryParameter

    watch

    watch for changes to the described resources and return them as a stream of add, update, and remove notifications; specify resourceVersion

    false

    boolean

    QueryParameter

    resourceVersion

    when specified with a watch call, shows changes that occur after that particular version of a resource; defaults to changes from the beginning of history

    false

    string

    PathParameter

    name

    name of the Node

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    json.WatchEvent

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    watch individual changes to a list of PersistentVolumeClaim

    -
    -
    -
    GET /api/v1/watch/persistentvolumeclaims
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    QueryParameter

    labelSelector

    a selector to restrict the list of returned objects by their labels; defaults to everything

    false

    string

    QueryParameter

    fieldSelector

    a selector to restrict the list of returned objects by their fields; defaults to everything

    false

    string

    QueryParameter

    watch

    watch for changes to the described resources and return them as a stream of add, update, and remove notifications; specify resourceVersion

    false

    boolean

    QueryParameter

    resourceVersion

    when specified with a watch call, shows changes that occur after that particular version of a resource; defaults to changes from the beginning of history

    false

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    json.WatchEvent

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    watch individual changes to a list of PersistentVolume

    -
    -
    -
    GET /api/v1/watch/persistentvolumes
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    QueryParameter

    labelSelector

    a selector to restrict the list of returned objects by their labels; defaults to everything

    false

    string

    QueryParameter

    fieldSelector

    a selector to restrict the list of returned objects by their fields; defaults to everything

    false

    string

    QueryParameter

    watch

    watch for changes to the described resources and return them as a stream of add, update, and remove notifications; specify resourceVersion

    false

    boolean

    QueryParameter

    resourceVersion

    when specified with a watch call, shows changes that occur after that particular version of a resource; defaults to changes from the beginning of history

    false

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    json.WatchEvent

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    watch changes to an object of kind PersistentVolume

    -
    -
    -
    GET /api/v1/watch/persistentvolumes/{name}
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    QueryParameter

    labelSelector

    a selector to restrict the list of returned objects by their labels; defaults to everything

    false

    string

    QueryParameter

    fieldSelector

    a selector to restrict the list of returned objects by their fields; defaults to everything

    false

    string

    QueryParameter

    watch

    watch for changes to the described resources and return them as a stream of add, update, and remove notifications; specify resourceVersion

    false

    boolean

    QueryParameter

    resourceVersion

    when specified with a watch call, shows changes that occur after that particular version of a resource; defaults to changes from the beginning of history

    false

    string

    PathParameter

    name

    name of the PersistentVolume

    true

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    json.WatchEvent

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    watch individual changes to a list of Pod

    -
    -
    -
    GET /api/v1/watch/pods
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    QueryParameter

    labelSelector

    a selector to restrict the list of returned objects by their labels; defaults to everything

    false

    string

    QueryParameter

    fieldSelector

    a selector to restrict the list of returned objects by their fields; defaults to everything

    false

    string

    QueryParameter

    watch

    watch for changes to the described resources and return them as a stream of add, update, and remove notifications; specify resourceVersion

    false

    boolean

    QueryParameter

    resourceVersion

    when specified with a watch call, shows changes that occur after that particular version of a resource; defaults to changes from the beginning of history

    false

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    json.WatchEvent

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    watch individual changes to a list of PodTemplate

    -
    -
    -
    GET /api/v1/watch/podtemplates
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    QueryParameter

    labelSelector

    a selector to restrict the list of returned objects by their labels; defaults to everything

    false

    string

    QueryParameter

    fieldSelector

    a selector to restrict the list of returned objects by their fields; defaults to everything

    false

    string

    QueryParameter

    watch

    watch for changes to the described resources and return them as a stream of add, update, and remove notifications; specify resourceVersion

    false

    boolean

    QueryParameter

    resourceVersion

    when specified with a watch call, shows changes that occur after that particular version of a resource; defaults to changes from the beginning of history

    false

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    json.WatchEvent

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    watch individual changes to a list of ReplicationController

    -
    -
    -
    GET /api/v1/watch/replicationcontrollers
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    QueryParameter

    labelSelector

    a selector to restrict the list of returned objects by their labels; defaults to everything

    false

    string

    QueryParameter

    fieldSelector

    a selector to restrict the list of returned objects by their fields; defaults to everything

    false

    string

    QueryParameter

    watch

    watch for changes to the described resources and return them as a stream of add, update, and remove notifications; specify resourceVersion

    false

    boolean

    QueryParameter

    resourceVersion

    when specified with a watch call, shows changes that occur after that particular version of a resource; defaults to changes from the beginning of history

    false

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    json.WatchEvent

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    watch individual changes to a list of ResourceQuota

    -
    -
    -
    GET /api/v1/watch/resourcequotas
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    QueryParameter

    labelSelector

    a selector to restrict the list of returned objects by their labels; defaults to everything

    false

    string

    QueryParameter

    fieldSelector

    a selector to restrict the list of returned objects by their fields; defaults to everything

    false

    string

    QueryParameter

    watch

    watch for changes to the described resources and return them as a stream of add, update, and remove notifications; specify resourceVersion

    false

    boolean

    QueryParameter

    resourceVersion

    when specified with a watch call, shows changes that occur after that particular version of a resource; defaults to changes from the beginning of history

    false

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    json.WatchEvent

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    watch individual changes to a list of Secret

    -
    -
    -
    GET /api/v1/watch/secrets
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    QueryParameter

    labelSelector

    a selector to restrict the list of returned objects by their labels; defaults to everything

    false

    string

    QueryParameter

    fieldSelector

    a selector to restrict the list of returned objects by their fields; defaults to everything

    false

    string

    QueryParameter

    watch

    watch for changes to the described resources and return them as a stream of add, update, and remove notifications; specify resourceVersion

    false

    boolean

    QueryParameter

    resourceVersion

    when specified with a watch call, shows changes that occur after that particular version of a resource; defaults to changes from the beginning of history

    false

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    json.WatchEvent

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    watch individual changes to a list of ServiceAccount

    -
    -
    -
    GET /api/v1/watch/serviceaccounts
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    QueryParameter

    labelSelector

    a selector to restrict the list of returned objects by their labels; defaults to everything

    false

    string

    QueryParameter

    fieldSelector

    a selector to restrict the list of returned objects by their fields; defaults to everything

    false

    string

    QueryParameter

    watch

    watch for changes to the described resources and return them as a stream of add, update, and remove notifications; specify resourceVersion

    false

    boolean

    QueryParameter

    resourceVersion

    when specified with a watch call, shows changes that occur after that particular version of a resource; defaults to changes from the beginning of history

    false

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    json.WatchEvent

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -

    watch individual changes to a list of Service

    -
    -
    -
    GET /api/v1/watch/services
    -
    -
    -
    -

    Parameters

    - -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescriptionRequiredSchemaDefault

    QueryParameter

    pretty

    If true, then the output is pretty printed.

    false

    string

    QueryParameter

    labelSelector

    a selector to restrict the list of returned objects by their labels; defaults to everything

    false

    string

    QueryParameter

    fieldSelector

    a selector to restrict the list of returned objects by their fields; defaults to everything

    false

    string

    QueryParameter

    watch

    watch for changes to the described resources and return them as a stream of add, update, and remove notifications; specify resourceVersion

    false

    boolean

    QueryParameter

    resourceVersion

    when specified with a watch call, shows changes that occur after that particular version of a resource; defaults to changes from the beginning of history

    false

    string

    - -
    -
    -

    Responses

    - ----- - - - - - - - - - - - - - - -
    HTTP CodeDescriptionSchema

    200

    success

    json.WatchEvent

    - -
    -
    -

    Consumes

    -
    -
      -
    • -

      /

      -
    • -
    -
    -
    -
    -

    Produces

    -
    -
      -
    • -

      application/json

      -
    • -
    -
    -
    -
    -

    Tags

    -
    -
      -
    • -

      apiv1

      -
    • -
    -
    -
    -
    -
    -
    -
    - - - \ No newline at end of file diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/api-reference/operations.md b/Godeps/_workspace/src/k8s.io/kubernetes/docs/api-reference/operations.md deleted file mode 100644 index f1b4d27abbe5..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/api-reference/operations.md +++ /dev/null @@ -1,39 +0,0 @@ - - - - -WARNING -WARNING -WARNING -WARNING -WARNING - -

    PLEASE NOTE: This document applies to the HEAD of the source tree

    - -If you are using a released version of Kubernetes, you should -refer to the docs that go with that version. - - -The latest 1.0.x release of this document can be found -[here](http://releases.k8s.io/release-1.0/docs/api-reference/operations.md). - -Documentation for other releases can be found at -[releases.k8s.io](http://releases.k8s.io). - --- - - - - - -{% include operations.html %} - - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/api-reference/operations.md?pixel)]() - diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/api.md b/Godeps/_workspace/src/k8s.io/kubernetes/docs/api.md deleted file mode 100644 index 55aaa3e86e97..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/api.md +++ /dev/null @@ -1,110 +0,0 @@ - - - - -WARNING -WARNING -WARNING -WARNING -WARNING - -

    PLEASE NOTE: This document applies to the HEAD of the source tree

    - -If you are using a released version of Kubernetes, you should -refer to the docs that go with that version. - - -The latest 1.0.x release of this document can be found -[here](http://releases.k8s.io/release-1.0/docs/api.md). - -Documentation for other releases can be found at -[releases.k8s.io](http://releases.k8s.io). - --- - - - - - -# The Kubernetes API - -Primary system and API concepts are documented in the [User guide](user-guide/README.md). - -Overall API conventions are described in the [API conventions doc](devel/api-conventions.md). - -Complete API details are documented via [Swagger](http://swagger.io/). The Kubernetes apiserver (aka "master") exports an API that can be used to retrieve the [Swagger spec](https://github.com/swagger-api/swagger-spec/tree/master/schemas/v1.2) for the Kubernetes API, by default at `/swaggerapi`, and a UI you can use to browse the API documentation at `/swagger-ui`. We also periodically update a [statically generated UI](http://kubernetes.io/third_party/swagger-ui/). - -Remote access to the API is discussed in the [access doc](admin/accessing-the-api.md). - -The Kubernetes API also serves as the foundation for the declarative configuration schema for the system. The [Kubectl](user-guide/kubectl/kubectl.md) command-line tool can be used to create, update, delete, and get API objects. - -Kubernetes also stores its serialized state (currently in [etcd](https://coreos.com/docs/distributed-configuration/getting-started-with-etcd/)) in terms of the API resources. - -Kubernetes itself is decomposed into multiple components, which interact through its API. - -## API changes - -In our experience, any system that is successful needs to grow and change as new use cases emerge or existing ones change. Therefore, we expect the Kubernetes API to continuously change and grow. However, we intend to not break compatibility with existing clients, for an extended period of time. In general, new API resources and new resource fields can be expected to be added frequently. Elimination of resources or fields will require following a deprecation process. The precise deprecation policy for eliminating features is TBD, but once we reach our 1.0 milestone, there will be a specific policy. - -What constitutes a compatible change and how to change the API are detailed by the [API change document](devel/api_changes.md). - -## API versioning - -To make it easier to eliminate fields or restructure resource representations, Kubernetes supports multiple API versions, each at a different API path prefix, such as `/api/v1beta3`. These are simply different interfaces to read and/or modify the same underlying resources. In general, all API resources are accessible via all API versions, though there may be some cases in the future where that is not true. - -We chose to version at the API level rather than at the resource or field level to ensure that the API presents a clear, consistent view of system resources and behavior, and to enable controlling access to end-of-lifed and/or experimental APIs. - -The [API and release versioning proposal](design/versioning.md) describes the current thinking on the API version evolution process. - -## v1beta1, v1beta2, and v1beta3 are deprecated; please move to v1 ASAP - -As of June 4, 2015, the Kubernetes v1 API has been enabled by default. The v1beta1 and v1beta2 APIs were deleted on June 1, 2015. v1beta3 is planned to be deleted on July 6, 2015. - -### v1 conversion tips (from v1beta3) - -We're working to convert all documentation and examples to v1. A simple [API conversion tool](admin/cluster-management.md#switching-your-config-files-to-a-new-api-version) has been written to simplify the translation process. Use `kubectl create --validate` in order to validate your json or yaml against our Swagger spec. - -Changes to services are the most significant difference between v1beta3 and v1. - -* The `service.spec.portalIP` property is renamed to `service.spec.clusterIP`. -* The `service.spec.createExternalLoadBalancer` property is removed. Specify `service.spec.type: "LoadBalancer"` to create an external load balancer instead. -* The `service.spec.publicIPs` property is deprecated and now called `service.spec.deprecatedPublicIPs`. This property will be removed entirely when v1beta3 is removed. The vast majority of users of this field were using it to expose services on ports on the node. Those users should specify `service.spec.type: "NodePort"` instead. Read [External Services](user-guide/services.md#external-services) for more info. If this is not sufficient for your use case, please file an issue or contact @thockin. - -Some other difference between v1beta3 and v1: - -* The `pod.spec.containers[*].privileged` and `pod.spec.containers[*].capabilities` properties are now nested under the `pod.spec.containers[*].securityContext` property. See [Security Contexts](user-guide/security-context.md). -* The `pod.spec.host` property is renamed to `pod.spec.nodeName`. -* The `endpoints.subsets[*].addresses.IP` property is renamed to `endpoints.subsets[*].addresses.ip`. -* The `pod.status.containerStatuses[*].state.termination` and `pod.status.containerStatuses[*].lastState.termination` properties are renamed to `pod.status.containerStatuses[*].state.terminated` and `pod.status.containerStatuses[*].lastState.terminated` respectively. -* The `pod.status.Condition` property is renamed to `pod.status.conditions`. -* The `status.details.id` property is renamed to `status.details.name`. - -### v1beta3 conversion tips (from v1beta1/2) - -Some important differences between v1beta1/2 and v1beta3: - -* The resource `id` is now called `name`. -* `name`, `labels`, `annotations`, and other metadata are now nested in a map called `metadata` -* `desiredState` is now called `spec`, and `currentState` is now called `status` -* `/minions` has been moved to `/nodes`, and the resource has kind `Node` -* The namespace is required (for all namespaced resources) and has moved from a URL parameter to the path: `/api/v1beta3/namespaces/{namespace}/{resource_collection}/{resource_name}`. If you were not using a namespace before, use `default` here. -* The names of all resource collections are now lower cased - instead of `replicationControllers`, use `replicationcontrollers`. -* To watch for changes to a resource, open an HTTP or Websocket connection to the collection query and provide the `?watch=true` query parameter along with the desired `resourceVersion` parameter to watch from. -* The `labels` query parameter has been renamed to `labelSelector`. -* The `fields` query parameter has been renamed to `fieldSelector`. -* The container `entrypoint` has been renamed to `command`, and `command` has been renamed to `args`. -* Container, volume, and node resources are expressed as nested maps (e.g., `resources{cpu:1}`) rather than as individual fields, and resource values support [scaling suffixes](user-guide/compute-resources.md#specifying-resource-quantities) rather than fixed scales (e.g., milli-cores). -* Restart policy is represented simply as a string (e.g., `"Always"`) rather than as a nested map (`always{}`). -* Pull policies changed from `PullAlways`, `PullNever`, and `PullIfNotPresent` to `Always`, `Never`, and `IfNotPresent`. -* The volume `source` is inlined into `volume` rather than nested. -* Host volumes have been changed from `hostDir` to `hostPath` to better reflect that they can be files or directories. - - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/api.md?pixel)]() - diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/design/README.md b/Godeps/_workspace/src/k8s.io/kubernetes/docs/design/README.md deleted file mode 100644 index 72d2c662afc8..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/design/README.md +++ /dev/null @@ -1,55 +0,0 @@ - - - - -WARNING -WARNING -WARNING -WARNING -WARNING - -

    PLEASE NOTE: This document applies to the HEAD of the source tree

    - -If you are using a released version of Kubernetes, you should -refer to the docs that go with that version. - - -The latest 1.0.x release of this document can be found -[here](http://releases.k8s.io/release-1.0/docs/design/README.md). - -Documentation for other releases can be found at -[releases.k8s.io](http://releases.k8s.io). - --- - - - - - -# Kubernetes Design Overview - -Kubernetes is a system for managing containerized applications across multiple hosts, providing basic mechanisms for deployment, maintenance, and scaling of applications. - -Kubernetes establishes robust declarative primitives for maintaining the desired state requested by the user. We see these primitives as the main value added by Kubernetes. Self-healing mechanisms, such as auto-restarting, re-scheduling, and replicating containers require active controllers, not just imperative orchestration. - -Kubernetes is primarily targeted at applications composed of multiple containers, such as elastic, distributed micro-services. It is also designed to facilitate migration of non-containerized application stacks to Kubernetes. It therefore includes abstractions for grouping containers in both loosely coupled and tightly coupled formations, and provides ways for containers to find and communicate with each other in relatively familiar ways. - -Kubernetes enables users to ask a cluster to run a set of containers. The system automatically chooses hosts to run those containers on. While Kubernetes's scheduler is currently very simple, we expect it to grow in sophistication over time. Scheduling is a policy-rich, topology-aware, workload-specific function that significantly impacts availability, performance, and capacity. The scheduler needs to take into account individual and collective resource requirements, quality of service requirements, hardware/software/policy constraints, affinity and anti-affinity specifications, data locality, inter-workload interference, deadlines, and so on. Workload-specific requirements will be exposed through the API as necessary. - -Kubernetes is intended to run on a number of cloud providers, as well as on physical hosts. - -A single Kubernetes cluster is not intended to span multiple availability zones. Instead, we recommend building a higher-level layer to replicate complete deployments of highly available applications across multiple zones (see [the multi-cluster doc](../admin/multi-cluster.md) and [cluster federation proposal](../proposals/federation.md) for more details). - -Finally, Kubernetes aspires to be an extensible, pluggable, building-block OSS platform and toolkit. Therefore, architecturally, we want Kubernetes to be built as a collection of pluggable components and layers, with the ability to use alternative schedulers, controllers, storage systems, and distribution mechanisms, and we're evolving its current code in that direction. Furthermore, we want others to be able to extend Kubernetes functionality, such as with higher-level PaaS functionality or multi-cluster layers, without modification of core Kubernetes source. Therefore, its API isn't just (or even necessarily mainly) targeted at end users, but at tool and extension developers. Its APIs are intended to serve as the foundation for an open ecosystem of tools, automation systems, and higher-level API layers. Consequently, there are no "internal" inter-component APIs. All APIs are visible and available, including the APIs used by the scheduler, the node controller, the replication-controller manager, Kubelet's API, etc. There's no glass to break -- in order to handle more complex use cases, one can just access the lower-level APIs in a fully transparent, composable manner. - -For more about the Kubernetes architecture, see [architecture](architecture.md). - - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/design/README.md?pixel)]() - diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/design/access.md b/Godeps/_workspace/src/k8s.io/kubernetes/docs/design/access.md deleted file mode 100644 index e2f1d66c1f03..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/design/access.md +++ /dev/null @@ -1,294 +0,0 @@ - - - - -WARNING -WARNING -WARNING -WARNING -WARNING - -

    PLEASE NOTE: This document applies to the HEAD of the source tree

    - -If you are using a released version of Kubernetes, you should -refer to the docs that go with that version. - - -The latest 1.0.x release of this document can be found -[here](http://releases.k8s.io/release-1.0/docs/design/access.md). - -Documentation for other releases can be found at -[releases.k8s.io](http://releases.k8s.io). - --- - - - - - -# K8s Identity and Access Management Sketch - -This document suggests a direction for identity and access management in the Kubernetes system. - - -## Background - -High level goals are: - - Have a plan for how identity, authentication, and authorization will fit in to the API. - - Have a plan for partitioning resources within a cluster between independent organizational units. - - Ease integration with existing enterprise and hosted scenarios. - -### Actors - -Each of these can act as normal users or attackers. - - External Users: People who are accessing applications running on K8s (e.g. a web site served by webserver running in a container on K8s), but who do not have K8s API access. - - K8s Users : People who access the K8s API (e.g. create K8s API objects like Pods) - - K8s Project Admins: People who manage access for some K8s Users - - K8s Cluster Admins: People who control the machines, networks, or binaries that make up a K8s cluster. - - K8s Admin means K8s Cluster Admins and K8s Project Admins taken together. - -### Threats - -Both intentional attacks and accidental use of privilege are concerns. - -For both cases it may be useful to think about these categories differently: - - Application Path - attack by sending network messages from the internet to the IP/port of any application running on K8s. May exploit weakness in application or misconfiguration of K8s. - - K8s API Path - attack by sending network messages to any K8s API endpoint. - - Insider Path - attack on K8s system components. Attacker may have privileged access to networks, machines or K8s software and data. Software errors in K8s system components and administrator error are some types of threat in this category. - -This document is primarily concerned with K8s API paths, and secondarily with Internal paths. The Application path also needs to be secure, but is not the focus of this document. - -### Assets to protect - -External User assets: - - Personal information like private messages, or images uploaded by External Users - - web server logs - -K8s User assets: - - External User assets of each K8s User - - things private to the K8s app, like: - - credentials for accessing other services (docker private repos, storage services, facebook, etc) - - SSL certificates for web servers - - proprietary data and code - -K8s Cluster assets: - - Assets of each K8s User - - Machine Certificates or secrets. - - The value of K8s cluster computing resources (cpu, memory, etc). - -This document is primarily about protecting K8s User assets and K8s cluster assets from other K8s Users and K8s Project and Cluster Admins. - -### Usage environments - -Cluster in Small organization: - - K8s Admins may be the same people as K8s Users. - - few K8s Admins. - - prefer ease of use to fine-grained access control/precise accounting, etc. - - Product requirement that it be easy for potential K8s Cluster Admin to try out setting up a simple cluster. - -Cluster in Large organization: - - K8s Admins typically distinct people from K8s Users. May need to divide K8s Cluster Admin access by roles. - - K8s Users need to be protected from each other. - - Auditing of K8s User and K8s Admin actions important. - - flexible accurate usage accounting and resource controls important. - - Lots of automated access to APIs. - - Need to integrate with existing enterprise directory, authentication, accounting, auditing, and security policy infrastructure. - -Org-run cluster: - - organization that runs K8s master components is same as the org that runs apps on K8s. - - Nodes may be on-premises VMs or physical machines; Cloud VMs; or a mix. - -Hosted cluster: - - Offering K8s API as a service, or offering a Paas or Saas built on K8s - - May already offer web services, and need to integrate with existing customer account concept, and existing authentication, accounting, auditing, and security policy infrastructure. - - May want to leverage K8s User accounts and accounting to manage their User accounts (not a priority to support this use case.) - - Precise and accurate accounting of resources needed. Resource controls needed for hard limits (Users given limited slice of data) and soft limits (Users can grow up to some limit and then be expanded). - -K8s ecosystem services: - - There may be companies that want to offer their existing services (Build, CI, A/B-test, release automation, etc) for use with K8s. There should be some story for this case. - -Pods configs should be largely portable between Org-run and hosted configurations. - - -# Design - -Related discussion: -- https://k8s.io/kubernetes/issues/442 -- https://k8s.io/kubernetes/issues/443 - -This doc describes two security profiles: - - Simple profile: like single-user mode. Make it easy to evaluate K8s without lots of configuring accounts and policies. Protects from unauthorized users, but does not partition authorized users. - - Enterprise profile: Provide mechanisms needed for large numbers of users. Defense in depth. Should integrate with existing enterprise security infrastructure. - -K8s distribution should include templates of config, and documentation, for simple and enterprise profiles. System should be flexible enough for knowledgeable users to create intermediate profiles, but K8s developers should only reason about those two Profiles, not a matrix. - -Features in this doc are divided into "Initial Feature", and "Improvements". Initial features would be candidates for version 1.00. - -## Identity - -### userAccount - -K8s will have a `userAccount` API object. -- `userAccount` has a UID which is immutable. This is used to associate users with objects and to record actions in audit logs. -- `userAccount` has a name which is a string and human readable and unique among userAccounts. It is used to refer to users in Policies, to ensure that the Policies are human readable. It can be changed only when there are no Policy objects or other objects which refer to that name. An email address is a suggested format for this field. -- `userAccount` is not related to the unix username of processes in Pods created by that userAccount. -- `userAccount` API objects can have labels - -The system may associate one or more Authentication Methods with a -`userAccount` (but they are not formally part of the userAccount object.) -In a simple deployment, the authentication method for a -user might be an authentication token which is verified by a K8s server. In a -more complex deployment, the authentication might be delegated to -another system which is trusted by the K8s API to authenticate users, but where -the authentication details are unknown to K8s. - -Initial Features: -- there is no superuser `userAccount` -- `userAccount` objects are statically populated in the K8s API store by reading a config file. Only a K8s Cluster Admin can do this. -- `userAccount` can have a default `namespace`. If API call does not specify a `namespace`, the default `namespace` for that caller is assumed. -- `userAccount` is global. A single human with access to multiple namespaces is recommended to only have one userAccount. - -Improvements: -- Make `userAccount` part of a separate API group from core K8s objects like `pod`. Facilitates plugging in alternate Access Management. - -Simple Profile: - - single `userAccount`, used by all K8s Users and Project Admins. One access token shared by all. - -Enterprise Profile: - - every human user has own `userAccount`. - - `userAccount`s have labels that indicate both membership in groups, and ability to act in certain roles. - - each service using the API has own `userAccount` too. (e.g. `scheduler`, `repcontroller`) - - automated jobs to denormalize the ldap group info into the local system list of users into the K8s userAccount file. - -### Unix accounts - -A `userAccount` is not a Unix user account. The fact that a pod is started by a `userAccount` does not mean that the processes in that pod's containers run as a Unix user with a corresponding name or identity. - -Initially: -- The unix accounts available in a container, and used by the processes running in a container are those that are provided by the combination of the base operating system and the Docker manifest. -- Kubernetes doesn't enforce any relation between `userAccount` and unix accounts. - -Improvements: -- Kubelet allocates disjoint blocks of root-namespace uids for each container. This may provide some defense-in-depth against container escapes. (https://github.com/docker/docker/pull/4572) -- requires docker to integrate user namespace support, and deciding what getpwnam() does for these uids. -- any features that help users avoid use of privileged containers (https://k8s.io/kubernetes/issues/391) - -### Namespaces - -K8s will have a have a `namespace` API object. It is similar to a Google Compute Engine `project`. It provides a namespace for objects created by a group of people co-operating together, preventing name collisions with non-cooperating groups. It also serves as a reference point for authorization policies. - -Namespaces are described in [namespaces.md](namespaces.md). - -In the Enterprise Profile: - - a `userAccount` may have permission to access several `namespace`s. - -In the Simple Profile: - - There is a single `namespace` used by the single user. - -Namespaces versus userAccount vs Labels: -- `userAccount`s are intended for audit logging (both name and UID should be logged), and to define who has access to `namespace`s. -- `labels` (see [docs/user-guide/labels.md](../../docs/user-guide/labels.md)) should be used to distinguish pods, users, and other objects that cooperate towards a common goal but are different in some way, such as version, or responsibilities. -- `namespace`s prevent name collisions between uncoordinated groups of people, and provide a place to attach common policies for co-operating groups of people. - - -## Authentication - -Goals for K8s authentication: -- Include a built-in authentication system with no configuration required to use in single-user mode, and little configuration required to add several user accounts, and no https proxy required. -- Allow for authentication to be handled by a system external to Kubernetes, to allow integration with existing to enterprise authorization systems. The Kubernetes namespace itself should avoid taking contributions of multiple authorization schemes. Instead, a trusted proxy in front of the apiserver can be used to authenticate users. - - For organizations whose security requirements only allow FIPS compliant implementations (e.g. apache) for authentication. - - So the proxy can terminate SSL, and isolate the CA-signed certificate from less trusted, higher-touch APIserver. - - For organizations that already have existing SaaS web services (e.g. storage, VMs) and want a common authentication portal. -- Avoid mixing authentication and authorization, so that authorization policies be centrally managed, and to allow changes in authentication methods without affecting authorization code. - -Initially: -- Tokens used to authenticate a user. -- Long lived tokens identify a particular `userAccount`. -- Administrator utility generates tokens at cluster setup. -- OAuth2.0 Bearer tokens protocol, http://tools.ietf.org/html/rfc6750 -- No scopes for tokens. Authorization happens in the API server -- Tokens dynamically generated by apiserver to identify pods which are making API calls. -- Tokens checked in a module of the APIserver. -- Authentication in apiserver can be disabled by flag, to allow testing without authorization enabled, and to allow use of an authenticating proxy. In this mode, a query parameter or header added by the proxy will identify the caller. - -Improvements: -- Refresh of tokens. -- SSH keys to access inside containers. - -To be considered for subsequent versions: -- Fuller use of OAuth (http://tools.ietf.org/html/rfc6749) -- Scoped tokens. -- Tokens that are bound to the channel between the client and the api server - - http://www.ietf.org/proceedings/90/slides/slides-90-uta-0.pdf - - http://www.browserauth.net - - -## Authorization - -K8s authorization should: -- Allow for a range of maturity levels, from single-user for those test driving the system, to integration with existing to enterprise authorization systems. -- Allow for centralized management of users and policies. In some organizations, this will mean that the definition of users and access policies needs to reside on a system other than k8s and encompass other web services (such as a storage service). -- Allow processes running in K8s Pods to take on identity, and to allow narrow scoping of permissions for those identities in order to limit damage from software faults. -- Have Authorization Policies exposed as API objects so that a single config file can create or delete Pods, Replication Controllers, Services, and the identities and policies for those Pods and Replication Controllers. -- Be separate as much as practical from Authentication, to allow Authentication methods to change over time and space, without impacting Authorization policies. - -K8s will implement a relatively simple -[Attribute-Based Access Control](http://en.wikipedia.org/wiki/Attribute_Based_Access_Control) model. -The model will be described in more detail in a forthcoming document. The model will -- Be less complex than XACML -- Be easily recognizable to those familiar with Amazon IAM Policies. -- Have a subset/aliases/defaults which allow it to be used in a way comfortable to those users more familiar with Role-Based Access Control. - -Authorization policy is set by creating a set of Policy objects. - -The API Server will be the Enforcement Point for Policy. For each API call that it receives, it will construct the Attributes needed to evaluate the policy (what user is making the call, what resource they are accessing, what they are trying to do that resource, etc) and pass those attributes to a Decision Point. The Decision Point code evaluates the Attributes against all the Policies and allows or denies the API call. The system will be modular enough that the Decision Point code can either be linked into the APIserver binary, or be another service that the apiserver calls for each Decision (with appropriate time-limited caching as needed for performance). - -Policy objects may be applicable only to a single namespace or to all namespaces; K8s Project Admins would be able to create those as needed. Other Policy objects may be applicable to all namespaces; a K8s Cluster Admin might create those in order to authorize a new type of controller to be used by all namespaces, or to make a K8s User into a K8s Project Admin.) - - -## Accounting - -The API should have a `quota` concept (see https://k8s.io/kubernetes/issues/442). A quota object relates a namespace (and optionally a label selector) to a maximum quantity of resources that may be used (see [resources design doc](resources.md)). - -Initially: -- a `quota` object is immutable. -- for hosted K8s systems that do billing, Project is recommended level for billing accounts. -- Every object that consumes resources should have a `namespace` so that Resource usage stats are roll-up-able to `namespace`. -- K8s Cluster Admin sets quota objects by writing a config file. - -Improvements: -- allow one namespace to charge the quota for one or more other namespaces. This would be controlled by a policy which allows changing a billing_namespace= label on an object. -- allow quota to be set by namespace owners for (namespace x label) combinations (e.g. let "webserver" namespace use 100 cores, but to prevent accidents, don't allow "webserver" namespace and "instance=test" use more than 10 cores. -- tools to help write consistent quota config files based on number of nodes, historical namespace usages, QoS needs, etc. -- way for K8s Cluster Admin to incrementally adjust Quota objects. - -Simple profile: - - a single `namespace` with infinite resource limits. - -Enterprise profile: - - multiple namespaces each with their own limits. - -Issues: -- need for locking or "eventual consistency" when multiple apiserver goroutines are accessing the object store and handling pod creations. - - -## Audit Logging - -API actions can be logged. - -Initial implementation: -- All API calls logged to nginx logs. - -Improvements: -- API server does logging instead. -- Policies to drop logging for high rate trusted API calls, or by users performing audit or other sensitive functions. - - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/design/access.md?pixel)]() - diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/design/admission_control.md b/Godeps/_workspace/src/k8s.io/kubernetes/docs/design/admission_control.md deleted file mode 100644 index 77e8b398a7da..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/design/admission_control.md +++ /dev/null @@ -1,117 +0,0 @@ - - - - -WARNING -WARNING -WARNING -WARNING -WARNING - -

    PLEASE NOTE: This document applies to the HEAD of the source tree

    - -If you are using a released version of Kubernetes, you should -refer to the docs that go with that version. - - -The latest 1.0.x release of this document can be found -[here](http://releases.k8s.io/release-1.0/docs/design/admission_control.md). - -Documentation for other releases can be found at -[releases.k8s.io](http://releases.k8s.io). - --- - - - - - -# Kubernetes Proposal - Admission Control - -**Related PR:** - -| Topic | Link | -| ----- | ---- | -| Separate validation from RESTStorage | https://k8s.io/kubernetes/issues/2977 | - -## Background - -High level goals: - -* Enable an easy-to-use mechanism to provide admission control to cluster -* Enable a provider to support multiple admission control strategies or author their own -* Ensure any rejected request can propagate errors back to the caller with why the request failed - -Authorization via policy is focused on answering if a user is authorized to perform an action. - -Admission Control is focused on if the system will accept an authorized action. - -Kubernetes may choose to dismiss an authorized action based on any number of admission control strategies. - -This proposal documents the basic design, and describes how any number of admission control plug-ins could be injected. - -Implementation of specific admission control strategies are handled in separate documents. - -## kube-apiserver - -The kube-apiserver takes the following OPTIONAL arguments to enable admission control - -| Option | Behavior | -| ------ | -------- | -| admission_control | Comma-delimited, ordered list of admission control choices to invoke prior to modifying or deleting an object. | -| admission_control_config_file | File with admission control configuration parameters to boot-strap plug-in. | - -An **AdmissionControl** plug-in is an implementation of the following interface: - -```go -package admission - -// Attributes is an interface used by a plug-in to make an admission decision on a individual request. -type Attributes interface { - GetNamespace() string - GetKind() string - GetOperation() string - GetObject() runtime.Object -} - -// Interface is an abstract, pluggable interface for Admission Control decisions. -type Interface interface { - // Admit makes an admission decision based on the request attributes - // An error is returned if it denies the request. - Admit(a Attributes) (err error) -} -``` - -A **plug-in** must be compiled with the binary, and is registered as an available option by providing a name, and implementation -of admission.Interface. - -```go -func init() { - admission.RegisterPlugin("AlwaysDeny", func(client client.Interface, config io.Reader) (admission.Interface, error) { return NewAlwaysDeny(), nil }) -} -``` - -Invocation of admission control is handled by the **APIServer** and not individual **RESTStorage** implementations. - -This design assumes that **Issue 297** is adopted, and as a consequence, the general framework of the APIServer request/response flow -will ensure the following: - -1. Incoming request -2. Authenticate user -3. Authorize user -4. If operation=create|update, then validate(object) -5. If operation=create|update|delete, then admission.Admit(requestAttributes) - a. invoke each admission.Interface object in sequence -6. Object is persisted - -If at any step, there is an error, the request is canceled. - - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/design/admission_control.md?pixel)]() - diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/design/admission_control_limit_range.md b/Godeps/_workspace/src/k8s.io/kubernetes/docs/design/admission_control_limit_range.md deleted file mode 100644 index b1baf1f0f346..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/design/admission_control_limit_range.md +++ /dev/null @@ -1,174 +0,0 @@ - - - - -WARNING -WARNING -WARNING -WARNING -WARNING - -

    PLEASE NOTE: This document applies to the HEAD of the source tree

    - -If you are using a released version of Kubernetes, you should -refer to the docs that go with that version. - - -The latest 1.0.x release of this document can be found -[here](http://releases.k8s.io/release-1.0/docs/design/admission_control_limit_range.md). - -Documentation for other releases can be found at -[releases.k8s.io](http://releases.k8s.io). - --- - - - - - -# Admission control plugin: LimitRanger - -## Background - -This document proposes a system for enforcing min/max limits per resource as part of admission control. - -## Model Changes - -A new resource, **LimitRange**, is introduced to enumerate min/max limits for a resource type scoped to a -Kubernetes namespace. - -```go -const ( - // Limit that applies to all pods in a namespace - LimitTypePod string = "Pod" - // Limit that applies to all containers in a namespace - LimitTypeContainer string = "Container" -) - -// LimitRangeItem defines a min/max usage limit for any resource that matches on kind -type LimitRangeItem struct { - // Type of resource that this limit applies to - Type string `json:"type,omitempty"` - // Max usage constraints on this kind by resource name - Max ResourceList `json:"max,omitempty"` - // Min usage constraints on this kind by resource name - Min ResourceList `json:"min,omitempty"` - // Default usage constraints on this kind by resource name - Default ResourceList `json:"default,omitempty"` -} - -// LimitRangeSpec defines a min/max usage limit for resources that match on kind -type LimitRangeSpec struct { - // Limits is the list of LimitRangeItem objects that are enforced - Limits []LimitRangeItem `json:"limits"` -} - -// LimitRange sets resource usage limits for each kind of resource in a Namespace -type LimitRange struct { - TypeMeta `json:",inline"` - ObjectMeta `json:"metadata,omitempty"` - - // Spec defines the limits enforced - Spec LimitRangeSpec `json:"spec,omitempty"` -} - -// LimitRangeList is a list of LimitRange items. -type LimitRangeList struct { - TypeMeta `json:",inline"` - ListMeta `json:"metadata,omitempty"` - - // Items is a list of LimitRange objects - Items []LimitRange `json:"items"` -} -``` - -## AdmissionControl plugin: LimitRanger - -The **LimitRanger** plug-in introspects all incoming admission requests. - -It makes decisions by evaluating the incoming object against all defined **LimitRange** objects in the request context namespace. - -The following min/max limits are imposed: - -**Type: Container** - -| ResourceName | Description | -| ------------ | ----------- | -| cpu | Min/Max amount of cpu per container | -| memory | Min/Max amount of memory per container | - -**Type: Pod** - -| ResourceName | Description | -| ------------ | ----------- | -| cpu | Min/Max amount of cpu per pod | -| memory | Min/Max amount of memory per pod | - -If a resource specifies a default value, it may get applied on the incoming resource. For example, if a default -value is provided for container cpu, it is set on the incoming container if and only if the incoming container -does not specify a resource requirements limit field. - -If a resource specifies a min value, it may get applied on the incoming resource. For example, if a min -value is provided for container cpu, it is set on the incoming container if and only if the incoming container does -not specify a resource requirements requests field. - -If the incoming object would cause a violation of the enumerated constraints, the request is denied with a set of -messages explaining what constraints were the source of the denial. - -If a constraint is not enumerated by a **LimitRange** it is not tracked. - -## kube-apiserver - -The server is updated to be aware of **LimitRange** objects. - -The constraints are only enforced if the kube-apiserver is started as follows: - -```console -$ kube-apiserver -admission_control=LimitRanger -``` - -## kubectl - -kubectl is modified to support the **LimitRange** resource. - -`kubectl describe` provides a human-readable output of limits. - -For example, - -```console -$ kubectl namespace myspace -$ kubectl create -f docs/user-guide/limitrange/limits.yaml -$ kubectl get limits -NAME -limits -$ kubectl describe limits limits -Name: limits -Type Resource Min Max Default ----- -------- --- --- --- -Pod memory 1Mi 1Gi - -Pod cpu 250m 2 - -Container memory 1Mi 1Gi 1Mi -Container cpu 250m 250m 250m -``` - -## Future Enhancements: Define limits for a particular pod or container. - -In the current proposal, the **LimitRangeItem** matches purely on **LimitRangeItem.Type** - -It is expected we will want to define limits for particular pods or containers by name/uid and label/field selector. - -To make a **LimitRangeItem** more restrictive, we will intend to add these additional restrictions at a future point in time. - -## Example - -See the [example of Limit Range](../user-guide/limitrange/) for more information. - - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/design/admission_control_limit_range.md?pixel)]() - diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/design/admission_control_resource_quota.md b/Godeps/_workspace/src/k8s.io/kubernetes/docs/design/admission_control_resource_quota.md deleted file mode 100644 index 136603d2c368..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/design/admission_control_resource_quota.md +++ /dev/null @@ -1,194 +0,0 @@ - - - - -WARNING -WARNING -WARNING -WARNING -WARNING - -

    PLEASE NOTE: This document applies to the HEAD of the source tree

    - -If you are using a released version of Kubernetes, you should -refer to the docs that go with that version. - - -The latest 1.0.x release of this document can be found -[here](http://releases.k8s.io/release-1.0/docs/design/admission_control_resource_quota.md). - -Documentation for other releases can be found at -[releases.k8s.io](http://releases.k8s.io). - --- - - - - - -# Admission control plugin: ResourceQuota - -## Background - -This document proposes a system for enforcing hard resource usage limits per namespace as part of admission control. - -## Model Changes - -A new resource, **ResourceQuota**, is introduced to enumerate hard resource limits in a Kubernetes namespace. - -A new resource, **ResourceQuotaUsage**, is introduced to support atomic updates of a **ResourceQuota** status. - -```go -// The following identify resource constants for Kubernetes object types -const ( - // Pods, number - ResourcePods ResourceName = "pods" - // Services, number - ResourceServices ResourceName = "services" - // ReplicationControllers, number - ResourceReplicationControllers ResourceName = "replicationcontrollers" - // ResourceQuotas, number - ResourceQuotas ResourceName = "resourcequotas" -) - -// ResourceQuotaSpec defines the desired hard limits to enforce for Quota -type ResourceQuotaSpec struct { - // Hard is the set of desired hard limits for each named resource - Hard ResourceList `json:"hard,omitempty"` -} - -// ResourceQuotaStatus defines the enforced hard limits and observed use -type ResourceQuotaStatus struct { - // Hard is the set of enforced hard limits for each named resource - Hard ResourceList `json:"hard,omitempty"` - // Used is the current observed total usage of the resource in the namespace - Used ResourceList `json:"used,omitempty"` -} - -// ResourceQuota sets aggregate quota restrictions enforced per namespace -type ResourceQuota struct { - TypeMeta `json:",inline"` - ObjectMeta `json:"metadata,omitempty"` - - // Spec defines the desired quota - Spec ResourceQuotaSpec `json:"spec,omitempty"` - - // Status defines the actual enforced quota and its current usage - Status ResourceQuotaStatus `json:"status,omitempty"` -} - -// ResourceQuotaUsage captures system observed quota status per namespace -// It is used to enforce atomic updates of a backing ResourceQuota.Status field in storage -type ResourceQuotaUsage struct { - TypeMeta `json:",inline"` - ObjectMeta `json:"metadata,omitempty"` - - // Status defines the actual enforced quota and its current usage - Status ResourceQuotaStatus `json:"status,omitempty"` -} - -// ResourceQuotaList is a list of ResourceQuota items -type ResourceQuotaList struct { - TypeMeta `json:",inline"` - ListMeta `json:"metadata,omitempty"` - - // Items is a list of ResourceQuota objects - Items []ResourceQuota `json:"items"` -} -``` - -## AdmissionControl plugin: ResourceQuota - -The **ResourceQuota** plug-in introspects all incoming admission requests. - -It makes decisions by evaluating the incoming object against all defined **ResourceQuota.Status.Hard** resource limits in the request -namespace. If acceptance of the resource would cause the total usage of a named resource to exceed its hard limit, the request is denied. - -The following resource limits are imposed as part of core Kubernetes at the namespace level: - -| ResourceName | Description | -| ------------ | ----------- | -| cpu | Total cpu usage | -| memory | Total memory usage | -| pods | Total number of pods | -| services | Total number of services | -| replicationcontrollers | Total number of replication controllers | -| resourcequotas | Total number of resource quotas | - -Any resource that is not part of core Kubernetes must follow the resource naming convention prescribed by Kubernetes. - -This means the resource must have a fully-qualified name (i.e. mycompany.org/shinynewresource) - -If the incoming request does not cause the total usage to exceed any of the enumerated hard resource limits, the plug-in will post a -**ResourceQuotaUsage** document to the server to atomically update the observed usage based on the previously read -**ResourceQuota.ResourceVersion**. This keeps incremental usage atomically consistent, but does introduce a bottleneck (intentionally) -into the system. - -To optimize system performance, it is encouraged that all resource quotas are tracked on the same **ResourceQuota** document. As a result, -its encouraged to actually impose a cap on the total number of individual quotas that are tracked in the **Namespace** to 1 by explicitly -capping it in **ResourceQuota** document. - -## kube-apiserver - -The server is updated to be aware of **ResourceQuota** objects. - -The quota is only enforced if the kube-apiserver is started as follows: - -```console -$ kube-apiserver -admission_control=ResourceQuota -``` - -## kube-controller-manager - -A new controller is defined that runs a synch loop to calculate quota usage across the namespace. - -**ResourceQuota** usage is only calculated if a namespace has a **ResourceQuota** object. - -If the observed usage is different than the recorded usage, the controller sends a **ResourceQuotaUsage** resource -to the server to atomically update. - -The synchronization loop frequency will control how quickly DELETE actions are recorded in the system and usage is ticked down. - -To optimize the synchronization loop, this controller will WATCH on Pod resources to track DELETE events, and in response, recalculate -usage. This is because a Pod deletion will have the most impact on observed cpu and memory usage in the system, and we anticipate -this being the resource most closely running at the prescribed quota limits. - -## kubectl - -kubectl is modified to support the **ResourceQuota** resource. - -`kubectl describe` provides a human-readable output of quota. - -For example, - -```console -$ kubectl namespace myspace -$ kubectl create -f docs/user-guide/resourcequota/quota.yaml -$ kubectl get quota -NAME -quota -$ kubectl describe quota quota -Name: quota -Resource Used Hard --------- ---- ---- -cpu 0m 20 -memory 0 1Gi -pods 5 10 -replicationcontrollers 5 20 -resourcequotas 1 1 -services 3 5 -``` - -## More information - -See [resource quota document](../admin/resource-quota.md) and the [example of Resource Quota](../user-guide/resourcequota/) for more information. - - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/design/admission_control_resource_quota.md?pixel)]() - diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/design/architecture.dia b/Godeps/_workspace/src/k8s.io/kubernetes/docs/design/architecture.dia deleted file mode 100644 index 26e0eed22e6f..000000000000 Binary files a/Godeps/_workspace/src/k8s.io/kubernetes/docs/design/architecture.dia and /dev/null differ diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/design/architecture.md b/Godeps/_workspace/src/k8s.io/kubernetes/docs/design/architecture.md deleted file mode 100644 index ec909acde28b..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/design/architecture.md +++ /dev/null @@ -1,83 +0,0 @@ - - - - -WARNING -WARNING -WARNING -WARNING -WARNING - -

    PLEASE NOTE: This document applies to the HEAD of the source tree

    - -If you are using a released version of Kubernetes, you should -refer to the docs that go with that version. - - -The latest 1.0.x release of this document can be found -[here](http://releases.k8s.io/release-1.0/docs/design/architecture.md). - -Documentation for other releases can be found at -[releases.k8s.io](http://releases.k8s.io). - --- - - - - - -# Kubernetes architecture - -A running Kubernetes cluster contains node agents (kubelet) and master components (APIs, scheduler, etc), on top of a distributed storage solution. This diagram shows our desired eventual state, though we're still working on a few things, like making kubelet itself (all our components, really) run within containers, and making the scheduler 100% pluggable. - -![Architecture Diagram](architecture.png?raw=true "Architecture overview") - -## The Kubernetes Node - -When looking at the architecture of the system, we'll break it down to services that run on the worker node and services that compose the cluster-level control plane. - -The Kubernetes node has the services necessary to run application containers and be managed from the master systems. - -Each node runs Docker, of course. Docker takes care of the details of downloading images and running containers. - -### Kubelet - -The **Kubelet** manages [pods](../user-guide/pods.md) and their containers, their images, their volumes, etc. - -### Kube-Proxy - -Each node also runs a simple network proxy and load balancer (see the [services FAQ](https://k8s.io/kubernetes/wiki/Services-FAQ) for more details). This reflects `services` (see [the services doc](../user-guide/services.md) for more details) as defined in the Kubernetes API on each node and can do simple TCP and UDP stream forwarding (round robin) across a set of backends. - -Service endpoints are currently found via [DNS](../admin/dns.md) or through environment variables (both [Docker-links-compatible](https://docs.docker.com/userguide/dockerlinks/) and Kubernetes {FOO}_SERVICE_HOST and {FOO}_SERVICE_PORT variables are supported). These variables resolve to ports managed by the service proxy. - -## The Kubernetes Control Plane - -The Kubernetes control plane is split into a set of components. Currently they all run on a single _master_ node, but that is expected to change soon in order to support high-availability clusters. These components work together to provide a unified view of the cluster. - -### etcd - -All persistent master state is stored in an instance of `etcd`. This provides a great way to store configuration data reliably. With `watch` support, coordinating components can be notified very quickly of changes. - -### Kubernetes API Server - -The apiserver serves up the [Kubernetes API](../api.md). It is intended to be a CRUD-y server, with most/all business logic implemented in separate components or in plug-ins. It mainly processes REST operations, validates them, and updates the corresponding objects in `etcd` (and eventually other stores). - -### Scheduler - -The scheduler binds unscheduled pods to nodes via the `/binding` API. The scheduler is pluggable, and we expect to support multiple cluster schedulers and even user-provided schedulers in the future. - -### Kubernetes Controller Manager Server - -All other cluster-level functions are currently performed by the Controller Manager. For instance, `Endpoints` objects are created and updated by the endpoints controller, and nodes are discovered, managed, and monitored by the node controller. These could eventually be split into separate components to make them independently pluggable. - -The [`replicationcontroller`](../user-guide/replication-controller.md) is a mechanism that is layered on top of the simple [`pod`](../user-guide/pods.md) API. We eventually plan to port it to a generic plug-in mechanism, once one is implemented. - - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/design/architecture.md?pixel)]() - diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/design/architecture.png b/Godeps/_workspace/src/k8s.io/kubernetes/docs/design/architecture.png deleted file mode 100644 index fa39039aaff0..000000000000 Binary files a/Godeps/_workspace/src/k8s.io/kubernetes/docs/design/architecture.png and /dev/null differ diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/design/architecture.svg b/Godeps/_workspace/src/k8s.io/kubernetes/docs/design/architecture.svg deleted file mode 100644 index 825c0ace8fb2..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/design/architecture.svg +++ /dev/null @@ -1,499 +0,0 @@ - - - - - - - - - - - - - Node - - - - - - kubelet - - - - - - - - - - - container - - - - - - - container - - - - - - - cAdvisor - - - - - - - Pod - - - - - - - - - - - container - - - - - - - container - - - - - - - container - - - - - - - Pod - - - - - - - - - - - - container - - - - - - - container - - - - - - - container - - - - - - - Pod - - - - - - - Proxy - - - - - - - kubectl (user commands) - - - - - - - - - - - - - - - Firewall - - - - - - - Internet - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - replication controller - - - - - - - Scheduler - - - - - - - Scheduler - - - - Master components - Colocated, or spread across machines, - as dictated by cluster size. - - - - - - - - - - - - REST - (pods, services, - rep. controllers) - - - - - - - authorization - authentication - - - - - - - scheduling - actuator - - - - APIs - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - docker - - - - - - - - .. - - - ... - - - - - - - - - - - - - - - - - - - - - - - - Node - - - - - - kubelet - - - - - - - - - - - container - - - - - - - container - - - - - - - cAdvisor - - - - - - - Pod - - - - - - - - - - - container - - - - - - - container - - - - - - - container - - - - - - - Pod - - - - - - - - - - - - container - - - - - - - container - - - - - - - container - - - - - - - Pod - - - - - - - Proxy - - - - - - - - - - - - - - - - - - - docker - - - - - - - - .. - - - ... - - - - - - - - - - - - - - - - - - - - - - - - - - Distributed - Watchable - Storage - - (implemented via etcd) - - - diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/design/clustering.md b/Godeps/_workspace/src/k8s.io/kubernetes/docs/design/clustering.md deleted file mode 100644 index 757c1f0b1109..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/design/clustering.md +++ /dev/null @@ -1,99 +0,0 @@ - - - - -WARNING -WARNING -WARNING -WARNING -WARNING - -

    PLEASE NOTE: This document applies to the HEAD of the source tree

    - -If you are using a released version of Kubernetes, you should -refer to the docs that go with that version. - - -The latest 1.0.x release of this document can be found -[here](http://releases.k8s.io/release-1.0/docs/design/clustering.md). - -Documentation for other releases can be found at -[releases.k8s.io](http://releases.k8s.io). - --- - - - - - -# Clustering in Kubernetes - - -## Overview - -The term "clustering" refers to the process of having all members of the Kubernetes cluster find and trust each other. There are multiple different ways to achieve clustering with different security and usability profiles. This document attempts to lay out the user experiences for clustering that Kubernetes aims to address. - -Once a cluster is established, the following is true: - -1. **Master -> Node** The master needs to know which nodes can take work and what their current status is wrt capacity. - 1. **Location** The master knows the name and location of all of the nodes in the cluster. - * For the purposes of this doc, location and name should be enough information so that the master can open a TCP connection to the Node. Most probably we will make this either an IP address or a DNS name. It is going to be important to be consistent here (master must be able to reach kubelet on that DNS name) so that we can verify certificates appropriately. - 2. **Target AuthN** A way to securely talk to the kubelet on that node. Currently we call out to the kubelet over HTTP. This should be over HTTPS and the master should know what CA to trust for that node. - 3. **Caller AuthN/Z** This would be the master verifying itself (and permissions) when calling the node. Currently, this is only used to collect statistics as authorization isn't critical. This may change in the future though. -2. **Node -> Master** The nodes currently talk to the master to know which pods have been assigned to them and to publish events. - 1. **Location** The nodes must know where the master is at. - 2. **Target AuthN** Since the master is assigning work to the nodes, it is critical that they verify whom they are talking to. - 3. **Caller AuthN/Z** The nodes publish events and so must be authenticated to the master. Ideally this authentication is specific to each node so that authorization can be narrowly scoped. The details of the work to run (including things like environment variables) might be considered sensitive and should be locked down also. - -**Note:** While the description here refers to a singular Master, in the future we should enable multiple Masters operating in an HA mode. While the "Master" is currently the combination of the API Server, Scheduler and Controller Manager, we will restrict ourselves to thinking about the main API and policy engine -- the API Server. - -## Current Implementation - -A central authority (generally the master) is responsible for determining the set of machines which are members of the cluster. Calls to create and remove worker nodes in the cluster are restricted to this single authority, and any other requests to add or remove worker nodes are rejected. (1.i). - -Communication from the master to nodes is currently over HTTP and is not secured or authenticated in any way. (1.ii, 1.iii). - -The location of the master is communicated out of band to the nodes. For GCE, this is done via Salt. Other cluster instructions/scripts use other methods. (2.i) - -Currently most communication from the node to the master is over HTTP. When it is done over HTTPS there is currently no verification of the cert of the master (2.ii). - -Currently, the node/kubelet is authenticated to the master via a token shared across all nodes. This token is distributed out of band (using Salt for GCE) and is optional. If it is not present then the kubelet is unable to publish events to the master. (2.iii) - -Our current mix of out of band communication doesn't meet all of our needs from a security point of view and is difficult to set up and configure. - -## Proposed Solution - -The proposed solution will provide a range of options for setting up and maintaining a secure Kubernetes cluster. We want to both allow for centrally controlled systems (leveraging pre-existing trust and configuration systems) or more ad-hoc automagic systems that are incredibly easy to set up. - -The building blocks of an easier solution: - -* **Move to TLS** We will move to using TLS for all intra-cluster communication. We will explicitly identify the trust chain (the set of trusted CAs) as opposed to trusting the system CAs. We will also use client certificates for all AuthN. -* [optional] **API driven CA** Optionally, we will run a CA in the master that will mint certificates for the nodes/kubelets. There will be pluggable policies that will automatically approve certificate requests here as appropriate. - * **CA approval policy** This is a pluggable policy object that can automatically approve CA signing requests. Stock policies will include `always-reject`, `queue` and `insecure-always-approve`. With `queue` there would be an API for evaluating and accepting/rejecting requests. Cloud providers could implement a policy here that verifies other out of band information and automatically approves/rejects based on other external factors. -* **Scoped Kubelet Accounts** These accounts are per-node and (optionally) give a node permission to register itself. - * To start with, we'd have the kubelets generate a cert/account in the form of `kubelet:`. To start we would then hard code policy such that we give that particular account appropriate permissions. Over time, we can make the policy engine more generic. -* [optional] **Bootstrap API endpoint** This is a helper service hosted outside of the Kubernetes cluster that helps with initial discovery of the master. - -### Static Clustering - -In this sequence diagram there is out of band admin entity that is creating all certificates and distributing them. It is also making sure that the kubelets know where to find the master. This provides for a lot of control but is more difficult to set up as lots of information must be communicated outside of Kubernetes. - -![Static Sequence Diagram](clustering/static.png) - -### Dynamic Clustering - -This diagram dynamic clustering using the bootstrap API endpoint. That API endpoint is used to both find the location of the master and communicate the root CA for the master. - -This flow has the admin manually approving the kubelet signing requests. This is the `queue` policy defined above.This manual intervention could be replaced by code that can verify the signing requests via other means. - -![Dynamic Sequence Diagram](clustering/dynamic.png) - - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/design/clustering.md?pixel)]() - diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/design/clustering/.gitignore b/Godeps/_workspace/src/k8s.io/kubernetes/docs/design/clustering/.gitignore deleted file mode 100644 index 67bcd6cb58a6..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/design/clustering/.gitignore +++ /dev/null @@ -1 +0,0 @@ -DroidSansMono.ttf diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/design/clustering/Dockerfile b/Godeps/_workspace/src/k8s.io/kubernetes/docs/design/clustering/Dockerfile deleted file mode 100644 index 3353419d8434..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/design/clustering/Dockerfile +++ /dev/null @@ -1,12 +0,0 @@ -FROM debian:jessie - -RUN apt-get update -RUN apt-get -qy install python-seqdiag make curl - -WORKDIR /diagrams - -RUN curl -sLo DroidSansMono.ttf https://googlefontdirectory.googlecode.com/hg/apache/droidsansmono/DroidSansMono.ttf - -ADD . /diagrams - -CMD bash -c 'make >/dev/stderr && tar cf - *.png' \ No newline at end of file diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/design/clustering/Makefile b/Godeps/_workspace/src/k8s.io/kubernetes/docs/design/clustering/Makefile deleted file mode 100644 index f6aa53ed442e..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/design/clustering/Makefile +++ /dev/null @@ -1,29 +0,0 @@ -FONT := DroidSansMono.ttf - -PNGS := $(patsubst %.seqdiag,%.png,$(wildcard *.seqdiag)) - -.PHONY: all -all: $(PNGS) - -.PHONY: watch -watch: - fswatch *.seqdiag | xargs -n 1 sh -c "make || true" - -$(FONT): - curl -sLo $@ https://googlefontdirectory.googlecode.com/hg/apache/droidsansmono/$(FONT) - -%.png: %.seqdiag $(FONT) - seqdiag --no-transparency -a -f '$(FONT)' $< - -# Build the stuff via a docker image -.PHONY: docker -docker: - docker build -t clustering-seqdiag . - docker run --rm clustering-seqdiag | tar xvf - - -docker-clean: - docker rmi clustering-seqdiag || true - docker images -q --filter "dangling=true" | xargs docker rmi - -fix-clock-skew: - boot2docker ssh sudo date -u -D "%Y%m%d%H%M.%S" --set "$(shell date -u +%Y%m%d%H%M.%S)" diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/design/clustering/README.md b/Godeps/_workspace/src/k8s.io/kubernetes/docs/design/clustering/README.md deleted file mode 100644 index d02b7d50e2a0..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/design/clustering/README.md +++ /dev/null @@ -1,64 +0,0 @@ - - - - -WARNING -WARNING -WARNING -WARNING -WARNING - -

    PLEASE NOTE: This document applies to the HEAD of the source tree

    - -If you are using a released version of Kubernetes, you should -refer to the docs that go with that version. - - -The latest 1.0.x release of this document can be found -[here](http://releases.k8s.io/release-1.0/docs/design/clustering/README.md). - -Documentation for other releases can be found at -[releases.k8s.io](http://releases.k8s.io). - --- - - - - -This directory contains diagrams for the clustering design doc. - -This depends on the `seqdiag` [utility](http://blockdiag.com/en/seqdiag/index.html). Assuming you have a non-borked python install, this should be installable with - -```sh -pip install seqdiag -``` - -Just call `make` to regenerate the diagrams. - -## Building with Docker - -If you are on a Mac or your pip install is messed up, you can easily build with docker. - -```sh -make docker -``` - -The first run will be slow but things should be fast after that. - -To clean up the docker containers that are created (and other cruft that is left around) you can run `make docker-clean`. - -If you are using boot2docker and get warnings about clock skew (or if things aren't building for some reason) then you can fix that up with `make fix-clock-skew`. - -## Automatically rebuild on file changes - -If you have the fswatch utility installed, you can have it monitor the file system and automatically rebuild when files have changed. Just do a `make watch`. - - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/design/clustering/README.md?pixel)]() - diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/design/clustering/dynamic.png b/Godeps/_workspace/src/k8s.io/kubernetes/docs/design/clustering/dynamic.png deleted file mode 100644 index 92b40fee3628..000000000000 Binary files a/Godeps/_workspace/src/k8s.io/kubernetes/docs/design/clustering/dynamic.png and /dev/null differ diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/design/clustering/dynamic.seqdiag b/Godeps/_workspace/src/k8s.io/kubernetes/docs/design/clustering/dynamic.seqdiag deleted file mode 100644 index 95bb395e8868..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/design/clustering/dynamic.seqdiag +++ /dev/null @@ -1,24 +0,0 @@ -seqdiag { - activation = none; - - - user[label = "Admin User"]; - bootstrap[label = "Bootstrap API\nEndpoint"]; - master; - kubelet[stacked]; - - user -> bootstrap [label="createCluster", return="cluster ID"]; - user <-- bootstrap [label="returns\n- bootstrap-cluster-uri"]; - - user ->> master [label="start\n- bootstrap-cluster-uri"]; - master => bootstrap [label="setMaster\n- master-location\n- master-ca"]; - - user ->> kubelet [label="start\n- bootstrap-cluster-uri"]; - kubelet => bootstrap [label="get-master", return="returns\n- master-location\n- master-ca"]; - kubelet ->> master [label="signCert\n- unsigned-kubelet-cert", return="retuns\n- kubelet-cert"]; - user => master [label="getSignRequests"]; - user => master [label="approveSignRequests"]; - kubelet <<-- master [label="returns\n- kubelet-cert"]; - - kubelet => master [label="register\n- kubelet-location"] -} diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/design/clustering/static.png b/Godeps/_workspace/src/k8s.io/kubernetes/docs/design/clustering/static.png deleted file mode 100644 index bcdeca7e6f56..000000000000 Binary files a/Godeps/_workspace/src/k8s.io/kubernetes/docs/design/clustering/static.png and /dev/null differ diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/design/clustering/static.seqdiag b/Godeps/_workspace/src/k8s.io/kubernetes/docs/design/clustering/static.seqdiag deleted file mode 100644 index bdc54b764e25..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/design/clustering/static.seqdiag +++ /dev/null @@ -1,16 +0,0 @@ -seqdiag { - activation = none; - - admin[label = "Manual Admin"]; - ca[label = "Manual CA"] - master; - kubelet[stacked]; - - admin => ca [label="create\n- master-cert"]; - admin ->> master [label="start\n- ca-root\n- master-cert"]; - - admin => ca [label="create\n- kubelet-cert"]; - admin ->> kubelet [label="start\n- ca-root\n- kubelet-cert\n- master-location"]; - - kubelet => master [label="register\n- kubelet-location"]; -} diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/design/command_execution_port_forwarding.md b/Godeps/_workspace/src/k8s.io/kubernetes/docs/design/command_execution_port_forwarding.md deleted file mode 100644 index fa52d4e5248f..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/design/command_execution_port_forwarding.md +++ /dev/null @@ -1,184 +0,0 @@ - - - - -WARNING -WARNING -WARNING -WARNING -WARNING - -

    PLEASE NOTE: This document applies to the HEAD of the source tree

    - -If you are using a released version of Kubernetes, you should -refer to the docs that go with that version. - - -The latest 1.0.x release of this document can be found -[here](http://releases.k8s.io/release-1.0/docs/design/command_execution_port_forwarding.md). - -Documentation for other releases can be found at -[releases.k8s.io](http://releases.k8s.io). - --- - - - - - -# Container Command Execution & Port Forwarding in Kubernetes - -## Abstract - -This describes an approach for providing support for: - -- executing commands in containers, with stdin/stdout/stderr streams attached -- port forwarding to containers - -## Background - -There are several related issues/PRs: - -- [Support attach](https://k8s.io/kubernetes/issues/1521) -- [Real container ssh](https://k8s.io/kubernetes/issues/1513) -- [Provide easy debug network access to services](https://k8s.io/kubernetes/issues/1863) -- [OpenShift container command execution proposal](https://github.com/openshift/origin/pull/576) - -## Motivation - -Users and administrators are accustomed to being able to access their systems -via SSH to run remote commands, get shell access, and do port forwarding. - -Supporting SSH to containers in Kubernetes is a difficult task. You must -specify a "user" and a hostname to make an SSH connection, and `sshd` requires -real users (resolvable by NSS and PAM). Because a container belongs to a pod, -and the pod belongs to a namespace, you need to specify namespace/pod/container -to uniquely identify the target container. Unfortunately, a -namespace/pod/container is not a real user as far as SSH is concerned. Also, -most Linux systems limit user names to 32 characters, which is unlikely to be -large enough to contain namespace/pod/container. We could devise some scheme to -map each namespace/pod/container to a 32-character user name, adding entries to -`/etc/passwd` (or LDAP, etc.) and keeping those entries fully in sync all the -time. Alternatively, we could write custom NSS and PAM modules that allow the -host to resolve a namespace/pod/container to a user without needing to keep -files or LDAP in sync. - -As an alternative to SSH, we are using a multiplexed streaming protocol that -runs on top of HTTP. There are no requirements about users being real users, -nor is there any limitation on user name length, as the protocol is under our -control. The only downside is that standard tooling that expects to use SSH -won't be able to work with this mechanism, unless adapters can be written. - -## Constraints and Assumptions - -- SSH support is not currently in scope -- CGroup confinement is ultimately desired, but implementing that support is not currently in scope -- SELinux confinement is ultimately desired, but implementing that support is not currently in scope - -## Use Cases - -- As a user of a Kubernetes cluster, I want to run arbitrary commands in a container, attaching my local stdin/stdout/stderr to the container -- As a user of a Kubernetes cluster, I want to be able to connect to local ports on my computer and have them forwarded to ports in the container - -## Process Flow - -### Remote Command Execution Flow - -1. The client connects to the Kubernetes Master to initiate a remote command execution -request -2. The Master proxies the request to the Kubelet where the container lives -3. The Kubelet executes nsenter + the requested command and streams stdin/stdout/stderr back and forth between the client and the container - -### Port Forwarding Flow - -1. The client connects to the Kubernetes Master to initiate a remote command execution -request -2. The Master proxies the request to the Kubelet where the container lives -3. The client listens on each specified local port, awaiting local connections -4. The client connects to one of the local listening ports -4. The client notifies the Kubelet of the new connection -5. The Kubelet executes nsenter + socat and streams data back and forth between the client and the port in the container - - -## Design Considerations - -### Streaming Protocol - -The current multiplexed streaming protocol used is SPDY. This is not the -long-term desire, however. As soon as there is viable support for HTTP/2 in Go, -we will switch to that. - -### Master as First Level Proxy - -Clients should not be allowed to communicate directly with the Kubelet for -security reasons. Therefore, the Master is currently the only suggested entry -point to be used for remote command execution and port forwarding. This is not -necessarily desirable, as it means that all remote command execution and port -forwarding traffic must travel through the Master, potentially impacting other -API requests. - -In the future, it might make more sense to retrieve an authorization token from -the Master, and then use that token to initiate a remote command execution or -port forwarding request with a load balanced proxy service dedicated to this -functionality. This would keep the streaming traffic out of the Master. - -### Kubelet as Backend Proxy - -The kubelet is currently responsible for handling remote command execution and -port forwarding requests. Just like with the Master described above, this means -that all remote command execution and port forwarding streaming traffic must -travel through the Kubelet, which could result in a degraded ability to service -other requests. - -In the future, it might make more sense to use a separate service on the node. - -Alternatively, we could possibly inject a process into the container that only -listens for a single request, expose that process's listening port on the node, -and then issue a redirect to the client such that it would connect to the first -level proxy, which would then proxy directly to the injected process's exposed -port. This would minimize the amount of proxying that takes place. - -### Scalability - -There are at least 2 different ways to execute a command in a container: -`docker exec` and `nsenter`. While `docker exec` might seem like an easier and -more obvious choice, it has some drawbacks. - -#### `docker exec` - -We could expose `docker exec` (i.e. have Docker listen on an exposed TCP port -on the node), but this would require proxying from the edge and securing the -Docker API. `docker exec` calls go through the Docker daemon, meaning that all -stdin/stdout/stderr traffic is proxied through the Daemon, adding an extra hop. -Additionally, you can't isolate 1 malicious `docker exec` call from normal -usage, meaning an attacker could initiate a denial of service or other attack -and take down the Docker daemon, or the node itself. - -We expect remote command execution and port forwarding requests to be long -running and/or high bandwidth operations, and routing all the streaming data -through the Docker daemon feels like a bottleneck we can avoid. - -#### `nsenter` - -The implementation currently uses `nsenter` to run commands in containers, -joining the appropriate container namespaces. `nsenter` runs directly on the -node and is not proxied through any single daemon process. - -### Security - -Authentication and authorization hasn't specifically been tested yet with this -functionality. We need to make sure that users are not allowed to execute -remote commands or do port forwarding to containers they aren't allowed to -access. - -Additional work is required to ensure that multiple command execution or port forwarding connections from different clients are not able to see each other's data. This can most likely be achieved via SELinux labeling and unique process contexts. - - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/design/command_execution_port_forwarding.md?pixel)]() - diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/design/event_compression.md b/Godeps/_workspace/src/k8s.io/kubernetes/docs/design/event_compression.md deleted file mode 100644 index 6d29b9957fc7..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/design/event_compression.md +++ /dev/null @@ -1,121 +0,0 @@ - - - - -WARNING -WARNING -WARNING -WARNING -WARNING - -

    PLEASE NOTE: This document applies to the HEAD of the source tree

    - -If you are using a released version of Kubernetes, you should -refer to the docs that go with that version. - - -The latest 1.0.x release of this document can be found -[here](http://releases.k8s.io/release-1.0/docs/design/event_compression.md). - -Documentation for other releases can be found at -[releases.k8s.io](http://releases.k8s.io). - --- - - - - - -# Kubernetes Event Compression - -This document captures the design of event compression. - - -## Background - -Kubernetes components can get into a state where they generate tons of events which are identical except for the timestamp. For example, when pulling a non-existing image, Kubelet will repeatedly generate `image_not_existing` and `container_is_waiting` events until upstream components correct the image. When this happens, the spam from the repeated events makes the entire event mechanism useless. It also appears to cause memory pressure in etcd (see [#3853](https://k8s.io/kubernetes/issues/3853)). - -## Proposal - -Each binary that generates events (for example, `kubelet`) should keep track of previously generated events so that it can collapse recurring events into a single event instead of creating a new instance for each new event. - -Event compression should be best effort (not guaranteed). Meaning, in the worst case, `n` identical (minus timestamp) events may still result in `n` event entries. - -## Design - -Instead of a single Timestamp, each event object [contains](http://releases.k8s.io/HEAD/pkg/api/types.go#L1111) the following fields: - * `FirstTimestamp util.Time` - * The date/time of the first occurrence of the event. - * `LastTimestamp util.Time` - * The date/time of the most recent occurrence of the event. - * On first occurrence, this is equal to the FirstTimestamp. - * `Count int` - * The number of occurrences of this event between FirstTimestamp and LastTimestamp - * On first occurrence, this is 1. - -Each binary that generates events: - * Maintains a historical record of previously generated events: - * Implemented with ["Least Recently Used Cache"](https://github.com/golang/groupcache/blob/master/lru/lru.go) in [`pkg/client/record/events_cache.go`](../../pkg/client/record/events_cache.go). - * The key in the cache is generated from the event object minus timestamps/count/transient fields, specifically the following events fields are used to construct a unique key for an event: - * `event.Source.Component` - * `event.Source.Host` - * `event.InvolvedObject.Kind` - * `event.InvolvedObject.Namespace` - * `event.InvolvedObject.Name` - * `event.InvolvedObject.UID` - * `event.InvolvedObject.APIVersion` - * `event.Reason` - * `event.Message` - * The LRU cache is capped at 4096 events. That means if a component (e.g. kubelet) runs for a long period of time and generates tons of unique events, the previously generated events cache will not grow unchecked in memory. Instead, after 4096 unique events are generated, the oldest events are evicted from the cache. - * When an event is generated, the previously generated events cache is checked (see [`pkg/client/record/event.go`](http://releases.k8s.io/HEAD/pkg/client/record/event.go)). - * If the key for the new event matches the key for a previously generated event (meaning all of the above fields match between the new event and some previously generated event), then the event is considered to be a duplicate and the existing event entry is updated in etcd: - * The new PUT (update) event API is called to update the existing event entry in etcd with the new last seen timestamp and count. - * The event is also updated in the previously generated events cache with an incremented count, updated last seen timestamp, name, and new resource version (all required to issue a future event update). - * If the key for the new event does not match the key for any previously generated event (meaning none of the above fields match between the new event and any previously generated events), then the event is considered to be new/unique and a new event entry is created in etcd: - * The usual POST/create event API is called to create a new event entry in etcd. - * An entry for the event is also added to the previously generated events cache. - -## Issues/Risks - - * Compression is not guaranteed, because each component keeps track of event history in memory - * An application restart causes event history to be cleared, meaning event history is not preserved across application restarts and compression will not occur across component restarts. - * Because an LRU cache is used to keep track of previously generated events, if too many unique events are generated, old events will be evicted from the cache, so events will only be compressed until they age out of the events cache, at which point any new instance of the event will cause a new entry to be created in etcd. - -## Example - -Sample kubectl output - -```console -FIRSTSEEN LASTSEEN COUNT NAME KIND SUBOBJECT REASON SOURCE MESSAGE -Thu, 12 Feb 2015 01:13:02 +0000 Thu, 12 Feb 2015 01:13:02 +0000 1 kubernetes-minion-4.c.saad-dev-vms.internal Minion starting {kubelet kubernetes-minion-4.c.saad-dev-vms.internal} Starting kubelet. -Thu, 12 Feb 2015 01:13:09 +0000 Thu, 12 Feb 2015 01:13:09 +0000 1 kubernetes-minion-1.c.saad-dev-vms.internal Minion starting {kubelet kubernetes-minion-1.c.saad-dev-vms.internal} Starting kubelet. -Thu, 12 Feb 2015 01:13:09 +0000 Thu, 12 Feb 2015 01:13:09 +0000 1 kubernetes-minion-3.c.saad-dev-vms.internal Minion starting {kubelet kubernetes-minion-3.c.saad-dev-vms.internal} Starting kubelet. -Thu, 12 Feb 2015 01:13:09 +0000 Thu, 12 Feb 2015 01:13:09 +0000 1 kubernetes-minion-2.c.saad-dev-vms.internal Minion starting {kubelet kubernetes-minion-2.c.saad-dev-vms.internal} Starting kubelet. -Thu, 12 Feb 2015 01:13:05 +0000 Thu, 12 Feb 2015 01:13:12 +0000 4 monitoring-influx-grafana-controller-0133o Pod failedScheduling {scheduler } Error scheduling: no minions available to schedule pods -Thu, 12 Feb 2015 01:13:05 +0000 Thu, 12 Feb 2015 01:13:12 +0000 4 elasticsearch-logging-controller-fplln Pod failedScheduling {scheduler } Error scheduling: no minions available to schedule pods -Thu, 12 Feb 2015 01:13:05 +0000 Thu, 12 Feb 2015 01:13:12 +0000 4 kibana-logging-controller-gziey Pod failedScheduling {scheduler } Error scheduling: no minions available to schedule pods -Thu, 12 Feb 2015 01:13:05 +0000 Thu, 12 Feb 2015 01:13:12 +0000 4 skydns-ls6k1 Pod failedScheduling {scheduler } Error scheduling: no minions available to schedule pods -Thu, 12 Feb 2015 01:13:05 +0000 Thu, 12 Feb 2015 01:13:12 +0000 4 monitoring-heapster-controller-oh43e Pod failedScheduling {scheduler } Error scheduling: no minions available to schedule pods -Thu, 12 Feb 2015 01:13:20 +0000 Thu, 12 Feb 2015 01:13:20 +0000 1 kibana-logging-controller-gziey BoundPod implicitly required container POD pulled {kubelet kubernetes-minion-4.c.saad-dev-vms.internal} Successfully pulled image "kubernetes/pause:latest" -Thu, 12 Feb 2015 01:13:20 +0000 Thu, 12 Feb 2015 01:13:20 +0000 1 kibana-logging-controller-gziey Pod scheduled {scheduler } Successfully assigned kibana-logging-controller-gziey to kubernetes-minion-4.c.saad-dev-vms.internal -``` - -This demonstrates what would have been 20 separate entries (indicating scheduling failure) collapsed/compressed down to 5 entries. - -## Related Pull Requests/Issues - - * Issue [#4073](https://k8s.io/kubernetes/issues/4073): Compress duplicate events - * PR [#4157](https://k8s.io/kubernetes/issues/4157): Add "Update Event" to Kubernetes API - * PR [#4206](https://k8s.io/kubernetes/issues/4206): Modify Event struct to allow compressing multiple recurring events in to a single event - * PR [#4306](https://k8s.io/kubernetes/issues/4306): Compress recurring events in to a single event to optimize etcd storage - * PR [#4444](https://k8s.io/kubernetes/pull/4444): Switch events history to use LRU cache instead of map - - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/design/event_compression.md?pixel)]() - diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/design/expansion.md b/Godeps/_workspace/src/k8s.io/kubernetes/docs/design/expansion.md deleted file mode 100644 index 24a07f0d19fe..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/design/expansion.md +++ /dev/null @@ -1,424 +0,0 @@ - - - - -WARNING -WARNING -WARNING -WARNING -WARNING - -

    PLEASE NOTE: This document applies to the HEAD of the source tree

    - -If you are using a released version of Kubernetes, you should -refer to the docs that go with that version. - - -The latest 1.0.x release of this document can be found -[here](http://releases.k8s.io/release-1.0/docs/design/expansion.md). - -Documentation for other releases can be found at -[releases.k8s.io](http://releases.k8s.io). - --- - - - - - -# Variable expansion in pod command, args, and env - -## Abstract - -A proposal for the expansion of environment variables using a simple `$(var)` syntax. - -## Motivation - -It is extremely common for users to need to compose environment variables or pass arguments to -their commands using the values of environment variables. Kubernetes should provide a facility for -the 80% cases in order to decrease coupling and the use of workarounds. - -## Goals - -1. Define the syntax format -2. Define the scoping and ordering of substitutions -3. Define the behavior for unmatched variables -4. Define the behavior for unexpected/malformed input - -## Constraints and Assumptions - -* This design should describe the simplest possible syntax to accomplish the use-cases -* Expansion syntax will not support more complicated shell-like behaviors such as default values - (viz: `$(VARIABLE_NAME:"default")`), inline substitution, etc. - -## Use Cases - -1. As a user, I want to compose new environment variables for a container using a substitution - syntax to reference other variables in the container's environment and service environment - variables -1. As a user, I want to substitute environment variables into a container's command -1. As a user, I want to do the above without requiring the container's image to have a shell -1. As a user, I want to be able to specify a default value for a service variable which may - not exist -1. As a user, I want to see an event associated with the pod if an expansion fails (ie, references - variable names that cannot be expanded) - -### Use Case: Composition of environment variables - -Currently, containers are injected with docker-style environment variables for the services in -their pod's namespace. There are several variables for each service, but users routinely need -to compose URLs based on these variables because there is not a variable for the exact format -they need. Users should be able to build new environment variables with the exact format they need. -Eventually, it should also be possible to turn off the automatic injection of the docker-style -variables into pods and let the users consume the exact information they need via the downward API -and composition. - -#### Expanding expanded variables - -It should be possible to reference an variable which is itself the result of an expansion, if the -referenced variable is declared in the container's environment prior to the one referencing it. -Put another way -- a container's environment is expanded in order, and expanded variables are -available to subsequent expansions. - -### Use Case: Variable expansion in command - -Users frequently need to pass the values of environment variables to a container's command. -Currently, Kubernetes does not perform any expansion of variables. The workaround is to invoke a -shell in the container's command and have the shell perform the substitution, or to write a wrapper -script that sets up the environment and runs the command. This has a number of drawbacks: - -1. Solutions that require a shell are unfriendly to images that do not contain a shell -2. Wrapper scripts make it harder to use images as base images -3. Wrapper scripts increase coupling to Kubernetes - -Users should be able to do the 80% case of variable expansion in command without writing a wrapper -script or adding a shell invocation to their containers' commands. - -### Use Case: Images without shells - -The current workaround for variable expansion in a container's command requires the container's -image to have a shell. This is unfriendly to images that do not contain a shell (`scratch` images, -for example). Users should be able to perform the other use-cases in this design without regard to -the content of their images. - -### Use Case: See an event for incomplete expansions - -It is possible that a container with incorrect variable values or command line may continue to run -for a long period of time, and that the end-user would have no visual or obvious warning of the -incorrect configuration. If the kubelet creates an event when an expansion references a variable -that cannot be expanded, it will help users quickly detect problems with expansions. - -## Design Considerations - -### What features should be supported? - -In order to limit complexity, we want to provide the right amount of functionality so that the 80% -cases can be realized and nothing more. We felt that the essentials boiled down to: - -1. Ability to perform direct expansion of variables in a string -2. Ability to specify default values via a prioritized mapping function but without support for - defaults as a syntax-level feature - -### What should the syntax be? - -The exact syntax for variable expansion has a large impact on how users perceive and relate to the -feature. We considered implementing a very restrictive subset of the shell `${var}` syntax. This -syntax is an attractive option on some level, because many people are familiar with it. However, -this syntax also has a large number of lesser known features such as the ability to provide -default values for unset variables, perform inline substitution, etc. - -In the interest of preventing conflation of the expansion feature in Kubernetes with the shell -feature, we chose a different syntax similar to the one in Makefiles, `$(var)`. We also chose not -to support the bar `$var` format, since it is not required to implement the required use-cases. - -Nested references, ie, variable expansion within variable names, are not supported. - -#### How should unmatched references be treated? - -Ideally, it should be extremely clear when a variable reference couldn't be expanded. We decided -the best experience for unmatched variable references would be to have the entire reference, syntax -included, show up in the output. As an example, if the reference `$(VARIABLE_NAME)` cannot be -expanded, then `$(VARIABLE_NAME)` should be present in the output. - -#### Escaping the operator - -Although the `$(var)` syntax does overlap with the `$(command)` form of command substitution -supported by many shells, because unexpanded variables are present verbatim in the output, we -expect this will not present a problem to many users. If there is a collision between a variable -name and command substitution syntax, the syntax can be escaped with the form `$$(VARIABLE_NAME)`, -which will evaluate to `$(VARIABLE_NAME)` whether `VARIABLE_NAME` can be expanded or not. - -## Design - -This design encompasses the variable expansion syntax and specification and the changes needed to -incorporate the expansion feature into the container's environment and command. - -### Syntax and expansion mechanics - -This section describes the expansion syntax, evaluation of variable values, and how unexpected or -malformed inputs are handled. - -#### Syntax - -The inputs to the expansion feature are: - -1. A utf-8 string (the input string) which may contain variable references -2. A function (the mapping function) that maps the name of a variable to the variable's value, of - type `func(string) string` - -Variable references in the input string are indicated exclusively with the syntax -`$()`. The syntax tokens are: - -- `$`: the operator -- `(`: the reference opener -- `)`: the reference closer - -The operator has no meaning unless accompanied by the reference opener and closer tokens. The -operator can be escaped using `$$`. One literal `$` will be emitted for each `$$` in the input. - -The reference opener and closer characters have no meaning when not part of a variable reference. -If a variable reference is malformed, viz: `$(VARIABLE_NAME` without a closing expression, the -operator and expression opening characters are treated as ordinary characters without special -meanings. - -#### Scope and ordering of substitutions - -The scope in which variable references are expanded is defined by the mapping function. Within the -mapping function, any arbitrary strategy may be used to determine the value of a variable name. -The most basic implementation of a mapping function is to use a `map[string]string` to lookup the -value of a variable. - -In order to support default values for variables like service variables presented by the kubelet, -which may not be bound because the service that provides them does not yet exist, there should be a -mapping function that uses a list of `map[string]string` like: - -```go -func MakeMappingFunc(maps ...map[string]string) func(string) string { - return func(input string) string { - for _, context := range maps { - val, ok := context[input] - if ok { - return val - } - } - - return "" - } -} - -// elsewhere -containerEnv := map[string]string{ - "FOO": "BAR", - "ZOO": "ZAB", - "SERVICE2_HOST": "some-host", -} - -serviceEnv := map[string]string{ - "SERVICE_HOST": "another-host", - "SERVICE_PORT": "8083", -} - -// single-map variation -mapping := MakeMappingFunc(containerEnv) - -// default variables not found in serviceEnv -mappingWithDefaults := MakeMappingFunc(serviceEnv, containerEnv) -``` - -### Implementation changes - -The necessary changes to implement this functionality are: - -1. Add a new interface, `ObjectEventRecorder`, which is like the `EventRecorder` interface, but - scoped to a single object, and a function that returns an `ObjectEventRecorder` given an - `ObjectReference` and an `EventRecorder` -2. Introduce `third_party/golang/expansion` package that provides: - 1. An `Expand(string, func(string) string) string` function - 2. A `MappingFuncFor(ObjectEventRecorder, ...map[string]string) string` function -3. Make the kubelet expand environment correctly -4. Make the kubelet expand command correctly - -#### Event Recording - -In order to provide an event when an expansion references undefined variables, the mapping function -must be able to create an event. In order to facilitate this, we should create a new interface in -the `api/client/record` package which is similar to `EventRecorder`, but scoped to a single object: - -```go -// ObjectEventRecorder knows how to record events about a single object. -type ObjectEventRecorder interface { - // Event constructs an event from the given information and puts it in the queue for sending. - // 'reason' is the reason this event is generated. 'reason' should be short and unique; it will - // be used to automate handling of events, so imagine people writing switch statements to - // handle them. You want to make that easy. - // 'message' is intended to be human readable. - // - // The resulting event will be created in the same namespace as the reference object. - Event(reason, message string) - - // Eventf is just like Event, but with Sprintf for the message field. - Eventf(reason, messageFmt string, args ...interface{}) - - // PastEventf is just like Eventf, but with an option to specify the event's 'timestamp' field. - PastEventf(timestamp util.Time, reason, messageFmt string, args ...interface{}) -} -``` - -There should also be a function that can construct an `ObjectEventRecorder` from a `runtime.Object` -and an `EventRecorder`: - -```go -type objectRecorderImpl struct { - object runtime.Object - recorder EventRecorder -} - -func (r *objectRecorderImpl) Event(reason, message string) { - r.recorder.Event(r.object, reason, message) -} - -func ObjectEventRecorderFor(object runtime.Object, recorder EventRecorder) ObjectEventRecorder { - return &objectRecorderImpl{object, recorder} -} -``` - -#### Expansion package - -The expansion package should provide two methods: - -```go -// MappingFuncFor returns a mapping function for use with Expand that -// implements the expansion semantics defined in the expansion spec; it -// returns the input string wrapped in the expansion syntax if no mapping -// for the input is found. If no expansion is found for a key, an event -// is raised on the given recorder. -func MappingFuncFor(recorder record.ObjectEventRecorder, context ...map[string]string) func(string) string { - // ... -} - -// Expand replaces variable references in the input string according to -// the expansion spec using the given mapping function to resolve the -// values of variables. -func Expand(input string, mapping func(string) string) string { - // ... -} -``` - -#### Kubelet changes - -The Kubelet should be made to correctly expand variables references in a container's environment, -command, and args. Changes will need to be made to: - -1. The `makeEnvironmentVariables` function in the kubelet; this is used by - `GenerateRunContainerOptions`, which is used by both the docker and rkt container runtimes -2. The docker manager `setEntrypointAndCommand` func has to be changed to perform variable - expansion -3. The rkt runtime should be made to support expansion in command and args when support for it is - implemented - -### Examples - -#### Inputs and outputs - -These examples are in the context of the mapping: - -| Name | Value | -|-------------|------------| -| `VAR_A` | `"A"` | -| `VAR_B` | `"B"` | -| `VAR_C` | `"C"` | -| `VAR_REF` | `$(VAR_A)` | -| `VAR_EMPTY` | `""` | - -No other variables are defined. - -| Input | Result | -|--------------------------------|----------------------------| -| `"$(VAR_A)"` | `"A"` | -| `"___$(VAR_B)___"` | `"___B___"` | -| `"___$(VAR_C)"` | `"___C"` | -| `"$(VAR_A)-$(VAR_A)"` | `"A-A"` | -| `"$(VAR_A)-1"` | `"A-1"` | -| `"$(VAR_A)_$(VAR_B)_$(VAR_C)"` | `"A_B_C"` | -| `"$$(VAR_B)_$(VAR_A)"` | `"$(VAR_B)_A"` | -| `"$$(VAR_A)_$$(VAR_B)"` | `"$(VAR_A)_$(VAR_B)"` | -| `"f000-$$VAR_A"` | `"f000-$VAR_A"` | -| `"foo\\$(VAR_C)bar"` | `"foo\Cbar"` | -| `"foo\\\\$(VAR_C)bar"` | `"foo\\Cbar"` | -| `"foo\\\\\\\\$(VAR_A)bar"` | `"foo\\\\Abar"` | -| `"$(VAR_A$(VAR_B))"` | `"$(VAR_A$(VAR_B))"` | -| `"$(VAR_A$(VAR_B)"` | `"$(VAR_A$(VAR_B)"` | -| `"$(VAR_REF)"` | `"$(VAR_A)"` | -| `"%%$(VAR_REF)--$(VAR_REF)%%"` | `"%%$(VAR_A)--$(VAR_A)%%"` | -| `"foo$(VAR_EMPTY)bar"` | `"foobar"` | -| `"foo$(VAR_Awhoops!"` | `"foo$(VAR_Awhoops!"` | -| `"f00__(VAR_A)__"` | `"f00__(VAR_A)__"` | -| `"$?_boo_$!"` | `"$?_boo_$!"` | -| `"$VAR_A"` | `"$VAR_A"` | -| `"$(VAR_DNE)"` | `"$(VAR_DNE)"` | -| `"$$$$$$(BIG_MONEY)"` | `"$$$(BIG_MONEY)"` | -| `"$$$$$$(VAR_A)"` | `"$$$(VAR_A)"` | -| `"$$$$$$$(GOOD_ODDS)"` | `"$$$$(GOOD_ODDS)"` | -| `"$$$$$$$(VAR_A)"` | `"$$$A"` | -| `"$VAR_A)"` | `"$VAR_A)"` | -| `"${VAR_A}"` | `"${VAR_A}"` | -| `"$(VAR_B)_______$(A"` | `"B_______$(A"` | -| `"$(VAR_C)_______$("` | `"C_______$("` | -| `"$(VAR_A)foobarzab$"` | `"Afoobarzab$"` | -| `"foo-\\$(VAR_A"` | `"foo-\$(VAR_A"` | -| `"--$($($($($--"` | `"--$($($($($--"` | -| `"$($($($($--foo$("` | `"$($($($($--foo$("` | -| `"foo0--$($($($("` | `"foo0--$($($($("` | -| `"$(foo$$var)` | `$(foo$$var)` | - -#### In a pod: building a URL - -Notice the `$(var)` syntax. - -```yaml -apiVersion: v1 -kind: Pod -metadata: - name: expansion-pod -spec: - containers: - - name: test-container - image: gcr.io/google_containers/busybox - command: [ "/bin/sh", "-c", "env" ] - env: - - name: PUBLIC_URL - value: "http://$(GITSERVER_SERVICE_HOST):$(GITSERVER_SERVICE_PORT)" - restartPolicy: Never -``` - -#### In a pod: building a URL using downward API - -```yaml -apiVersion: v1 -kind: Pod -metadata: - name: expansion-pod -spec: - containers: - - name: test-container - image: gcr.io/google_containers/busybox - command: [ "/bin/sh", "-c", "env" ] - env: - - name: POD_NAMESPACE - valueFrom: - fieldRef: - fieldPath: "metadata.namespace" - - name: PUBLIC_URL - value: "http://gitserver.$(POD_NAMESPACE):$(SERVICE_PORT)" - restartPolicy: Never -``` - - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/design/expansion.md?pixel)]() - diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/design/identifiers.md b/Godeps/_workspace/src/k8s.io/kubernetes/docs/design/identifiers.md deleted file mode 100644 index 14b5452b14aa..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/design/identifiers.md +++ /dev/null @@ -1,130 +0,0 @@ - - - - -WARNING -WARNING -WARNING -WARNING -WARNING - -

    PLEASE NOTE: This document applies to the HEAD of the source tree

    - -If you are using a released version of Kubernetes, you should -refer to the docs that go with that version. - - -The latest 1.0.x release of this document can be found -[here](http://releases.k8s.io/release-1.0/docs/design/identifiers.md). - -Documentation for other releases can be found at -[releases.k8s.io](http://releases.k8s.io). - --- - - - - - -# Identifiers and Names in Kubernetes - -A summarization of the goals and recommendations for identifiers in Kubernetes. Described in [GitHub issue #199](https://k8s.io/kubernetes/issues/199). - - -## Definitions - -UID -: A non-empty, opaque, system-generated value guaranteed to be unique in time and space; intended to distinguish between historical occurrences of similar entities. - -Name -: A non-empty string guaranteed to be unique within a given scope at a particular time; used in resource URLs; provided by clients at creation time and encouraged to be human friendly; intended to facilitate creation idempotence and space-uniqueness of singleton objects, distinguish distinct entities, and reference particular entities across operations. - -[rfc1035](http://www.ietf.org/rfc/rfc1035.txt)/[rfc1123](http://www.ietf.org/rfc/rfc1123.txt) label (DNS_LABEL) -: An alphanumeric (a-z, and 0-9) string, with a maximum length of 63 characters, with the '-' character allowed anywhere except the first or last character, suitable for use as a hostname or segment in a domain name - -[rfc1035](http://www.ietf.org/rfc/rfc1035.txt)/[rfc1123](http://www.ietf.org/rfc/rfc1123.txt) subdomain (DNS_SUBDOMAIN) -: One or more lowercase rfc1035/rfc1123 labels separated by '.' with a maximum length of 253 characters - -[rfc4122](http://www.ietf.org/rfc/rfc4122.txt) universally unique identifier (UUID) -: A 128 bit generated value that is extremely unlikely to collide across time and space and requires no central coordination - -[rfc6335](https://tools.ietf.org/rfc/rfc6335.txt) port name (IANA_SVC_NAME) -: An alphanumeric (a-z, and 0-9) string, with a maximum length of 15 characters, with the '-' character allowed anywhere except the first or the last character or adjacent to another '-' character, it must contain at least a (a-z) character - -## Objectives for names and UIDs - -1. Uniquely identify (via a UID) an object across space and time - -2. Uniquely name (via a name) an object across space - -3. Provide human-friendly names in API operations and/or configuration files - -4. Allow idempotent creation of API resources (#148) and enforcement of space-uniqueness of singleton objects - -5. Allow DNS names to be automatically generated for some objects - - -## General design - -1. When an object is created via an API, a Name string (a DNS_SUBDOMAIN) must be specified. Name must be non-empty and unique within the apiserver. This enables idempotent and space-unique creation operations. Parts of the system (e.g. replication controller) may join strings (e.g. a base name and a random suffix) to create a unique Name. For situations where generating a name is impractical, some or all objects may support a param to auto-generate a name. Generating random names will defeat idempotency. - * Examples: "guestbook.user", "backend-x4eb1" - -2. When an object is created via an API, a Namespace string (a DNS_SUBDOMAIN? format TBD via #1114) may be specified. Depending on the API receiver, namespaces might be validated (e.g. apiserver might ensure that the namespace actually exists). If a namespace is not specified, one will be assigned by the API receiver. This assignment policy might vary across API receivers (e.g. apiserver might have a default, kubelet might generate something semi-random). - * Example: "api.k8s.example.com" - -3. Upon acceptance of an object via an API, the object is assigned a UID (a UUID). UID must be non-empty and unique across space and time. - * Example: "01234567-89ab-cdef-0123-456789abcdef" - - -## Case study: Scheduling a pod - -Pods can be placed onto a particular node in a number of ways. This case -study demonstrates how the above design can be applied to satisfy the -objectives. - -### A pod scheduled by a user through the apiserver - -1. A user submits a pod with Namespace="" and Name="guestbook" to the apiserver. - -2. The apiserver validates the input. - 1. A default Namespace is assigned. - 2. The pod name must be space-unique within the Namespace. - 3. Each container within the pod has a name which must be space-unique within the pod. - -3. The pod is accepted. - 1. A new UID is assigned. - -4. The pod is bound to a node. - 1. The kubelet on the node is passed the pod's UID, Namespace, and Name. - -5. Kubelet validates the input. - -6. Kubelet runs the pod. - 1. Each container is started up with enough metadata to distinguish the pod from whence it came. - 2. Each attempt to run a container is assigned a UID (a string) that is unique across time. - * This may correspond to Docker's container ID. - -### A pod placed by a config file on the node - -1. A config file is stored on the node, containing a pod with UID="", Namespace="", and Name="cadvisor". - -2. Kubelet validates the input. - 1. Since UID is not provided, kubelet generates one. - 2. Since Namespace is not provided, kubelet generates one. - 1. The generated namespace should be deterministic and cluster-unique for the source, such as a hash of the hostname and file path. - * E.g. Namespace="file-f4231812554558a718a01ca942782d81" - -3. Kubelet runs the pod. - 1. Each container is started up with enough metadata to distinguish the pod from whence it came. - 2. Each attempt to run a container is assigned a UID (a string) that is unique across time. - 1. This may correspond to Docker's container ID. - - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/design/identifiers.md?pixel)]() - diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/design/namespaces.md b/Godeps/_workspace/src/k8s.io/kubernetes/docs/design/namespaces.md deleted file mode 100644 index 596f6f4389e6..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/design/namespaces.md +++ /dev/null @@ -1,373 +0,0 @@ - - - - -WARNING -WARNING -WARNING -WARNING -WARNING - -

    PLEASE NOTE: This document applies to the HEAD of the source tree

    - -If you are using a released version of Kubernetes, you should -refer to the docs that go with that version. - - -The latest 1.0.x release of this document can be found -[here](http://releases.k8s.io/release-1.0/docs/design/namespaces.md). - -Documentation for other releases can be found at -[releases.k8s.io](http://releases.k8s.io). - --- - - - - - -# Namespaces - -## Abstract - -A Namespace is a mechanism to partition resources created by users into -a logically named group. - -## Motivation - -A single cluster should be able to satisfy the needs of multiple user communities. - -Each user community wants to be able to work in isolation from other communities. - -Each user community has its own: - -1. resources (pods, services, replication controllers, etc.) -2. policies (who can or cannot perform actions in their community) -3. constraints (this community is allowed this much quota, etc.) - -A cluster operator may create a Namespace for each unique user community. - -The Namespace provides a unique scope for: - -1. named resources (to avoid basic naming collisions) -2. delegated management authority to trusted users -3. ability to limit community resource consumption - -## Use cases - -1. As a cluster operator, I want to support multiple user communities on a single cluster. -2. As a cluster operator, I want to delegate authority to partitions of the cluster to trusted users - in those communities. -3. As a cluster operator, I want to limit the amount of resources each community can consume in order - to limit the impact to other communities using the cluster. -4. As a cluster user, I want to interact with resources that are pertinent to my user community in - isolation of what other user communities are doing on the cluster. - -## Design - -### Data Model - -A *Namespace* defines a logically named group for multiple *Kind*s of resources. - -```go -type Namespace struct { - TypeMeta `json:",inline"` - ObjectMeta `json:"metadata,omitempty"` - - Spec NamespaceSpec `json:"spec,omitempty"` - Status NamespaceStatus `json:"status,omitempty"` -} -``` - -A *Namespace* name is a DNS compatible label. - -A *Namespace* must exist prior to associating content with it. - -A *Namespace* must not be deleted if there is content associated with it. - -To associate a resource with a *Namespace* the following conditions must be satisfied: - -1. The resource's *Kind* must be registered as having *RESTScopeNamespace* with the server -2. The resource's *TypeMeta.Namespace* field must have a value that references an existing *Namespace* - -The *Name* of a resource associated with a *Namespace* is unique to that *Kind* in that *Namespace*. - -It is intended to be used in resource URLs; provided by clients at creation time, and encouraged to be -human friendly; intended to facilitate idempotent creation, space-uniqueness of singleton objects, -distinguish distinct entities, and reference particular entities across operations. - -### Authorization - -A *Namespace* provides an authorization scope for accessing content associated with the *Namespace*. - -See [Authorization plugins](../admin/authorization.md) - -### Limit Resource Consumption - -A *Namespace* provides a scope to limit resource consumption. - -A *LimitRange* defines min/max constraints on the amount of resources a single entity can consume in -a *Namespace*. - -See [Admission control: Limit Range](admission_control_limit_range.md) - -A *ResourceQuota* tracks aggregate usage of resources in the *Namespace* and allows cluster operators -to define *Hard* resource usage limits that a *Namespace* may consume. - -See [Admission control: Resource Quota](admission_control_resource_quota.md) - -### Finalizers - -Upon creation of a *Namespace*, the creator may provide a list of *Finalizer* objects. - -```go -type FinalizerName string - -// These are internal finalizers to Kubernetes, must be qualified name unless defined here -const ( - FinalizerKubernetes FinalizerName = "kubernetes" -) - -// NamespaceSpec describes the attributes on a Namespace -type NamespaceSpec struct { - // Finalizers is an opaque list of values that must be empty to permanently remove object from storage - Finalizers []FinalizerName -} -``` - -A *FinalizerName* is a qualified name. - -The API Server enforces that a *Namespace* can only be deleted from storage if and only if -it's *Namespace.Spec.Finalizers* is empty. - -A *finalize* operation is the only mechanism to modify the *Namespace.Spec.Finalizers* field post creation. - -Each *Namespace* created has *kubernetes* as an item in its list of initial *Namespace.Spec.Finalizers* -set by default. - -### Phases - -A *Namespace* may exist in the following phases. - -```go -type NamespacePhase string -const( - NamespaceActive NamespacePhase = "Active" - NamespaceTerminating NamespaceTerminating = "Terminating" -) - -type NamespaceStatus struct { - ... - Phase NamespacePhase -} -``` - -A *Namespace* is in the **Active** phase if it does not have a *ObjectMeta.DeletionTimestamp*. - -A *Namespace* is in the **Terminating** phase if it has a *ObjectMeta.DeletionTimestamp*. - -**Active** - -Upon creation, a *Namespace* goes in the *Active* phase. This means that content may be associated with -a namespace, and all normal interactions with the namespace are allowed to occur in the cluster. - -If a DELETE request occurs for a *Namespace*, the *Namespace.ObjectMeta.DeletionTimestamp* is set -to the current server time. A *namespace controller* observes the change, and sets the *Namespace.Status.Phase* -to *Terminating*. - -**Terminating** - -A *namespace controller* watches for *Namespace* objects that have a *Namespace.ObjectMeta.DeletionTimestamp* -value set in order to know when to initiate graceful termination of the *Namespace* associated content that -are known to the cluster. - -The *namespace controller* enumerates each known resource type in that namespace and deletes it one by one. - -Admission control blocks creation of new resources in that namespace in order to prevent a race-condition -where the controller could believe all of a given resource type had been deleted from the namespace, -when in fact some other rogue client agent had created new objects. Using admission control in this -scenario allows each of registry implementations for the individual objects to not need to take into account Namespace life-cycle. - -Once all objects known to the *namespace controller* have been deleted, the *namespace controller* -executes a *finalize* operation on the namespace that removes the *kubernetes* value from -the *Namespace.Spec.Finalizers* list. - -If the *namespace controller* sees a *Namespace* whose *ObjectMeta.DeletionTimestamp* is set, and -whose *Namespace.Spec.Finalizers* list is empty, it will signal the server to permanently remove -the *Namespace* from storage by sending a final DELETE action to the API server. - -### REST API - -To interact with the Namespace API: - -| Action | HTTP Verb | Path | Description | -| ------ | --------- | ---- | ----------- | -| CREATE | POST | /api/{version}/namespaces | Create a namespace | -| LIST | GET | /api/{version}/namespaces | List all namespaces | -| UPDATE | PUT | /api/{version}/namespaces/{namespace} | Update namespace {namespace} | -| DELETE | DELETE | /api/{version}/namespaces/{namespace} | Delete namespace {namespace} | -| FINALIZE | POST | /api/{version}/namespaces/{namespace}/finalize | Finalize namespace {namespace} | -| WATCH | GET | /api/{version}/watch/namespaces | Watch all namespaces | - -This specification reserves the name *finalize* as a sub-resource to namespace. - -As a consequence, it is invalid to have a *resourceType* managed by a namespace whose kind is *finalize*. - -To interact with content associated with a Namespace: - -| Action | HTTP Verb | Path | Description | -| ---- | ---- | ---- | ---- | -| CREATE | POST | /api/{version}/namespaces/{namespace}/{resourceType}/ | Create instance of {resourceType} in namespace {namespace} | -| GET | GET | /api/{version}/namespaces/{namespace}/{resourceType}/{name} | Get instance of {resourceType} in namespace {namespace} with {name} | -| UPDATE | PUT | /api/{version}/namespaces/{namespace}/{resourceType}/{name} | Update instance of {resourceType} in namespace {namespace} with {name} | -| DELETE | DELETE | /api/{version}/namespaces/{namespace}/{resourceType}/{name} | Delete instance of {resourceType} in namespace {namespace} with {name} | -| LIST | GET | /api/{version}/namespaces/{namespace}/{resourceType} | List instances of {resourceType} in namespace {namespace} | -| WATCH | GET | /api/{version}/watch/namespaces/{namespace}/{resourceType} | Watch for changes to a {resourceType} in namespace {namespace} | -| WATCH | GET | /api/{version}/watch/{resourceType} | Watch for changes to a {resourceType} across all namespaces | -| LIST | GET | /api/{version}/list/{resourceType} | List instances of {resourceType} across all namespaces | - -The API server verifies the *Namespace* on resource creation matches the *{namespace}* on the path. - -The API server will associate a resource with a *Namespace* if not populated by the end-user based on the *Namespace* context -of the incoming request. If the *Namespace* of the resource being created, or updated does not match the *Namespace* on the request, -then the API server will reject the request. - -### Storage - -A namespace provides a unique identifier space and therefore must be in the storage path of a resource. - -In etcd, we want to continue to still support efficient WATCH across namespaces. - -Resources that persist content in etcd will have storage paths as follows: - -/{k8s_storage_prefix}/{resourceType}/{resource.Namespace}/{resource.Name} - -This enables consumers to WATCH /registry/{resourceType} for changes across namespace of a particular {resourceType}. - -### Kubelet - -The kubelet will register pod's it sources from a file or http source with a namespace associated with the -*cluster-id* - -### Example: OpenShift Origin managing a Kubernetes Namespace - -In this example, we demonstrate how the design allows for agents built on-top of -Kubernetes that manage their own set of resource types associated with a *Namespace* -to take part in Namespace termination. - -OpenShift creates a Namespace in Kubernetes - -```json -{ - "apiVersion":"v1", - "kind": "Namespace", - "metadata": { - "name": "development", - }, - "spec": { - "finalizers": ["openshift.com/origin", "kubernetes"], - }, - "status": { - "phase": "Active", - }, - "labels": { - "name": "development" - }, -} -``` - -OpenShift then goes and creates a set of resources (pods, services, etc) associated -with the "development" namespace. It also creates its own set of resources in its -own storage associated with the "development" namespace unknown to Kubernetes. - -User deletes the Namespace in Kubernetes, and Namespace now has following state: - -```json -{ - "apiVersion":"v1", - "kind": "Namespace", - "metadata": { - "name": "development", - "deletionTimestamp": "..." - }, - "spec": { - "finalizers": ["openshift.com/origin", "kubernetes"], - }, - "status": { - "phase": "Terminating", - }, - "labels": { - "name": "development" - }, -} -``` - -The Kubernetes *namespace controller* observes the namespace has a *deletionTimestamp* -and begins to terminate all of the content in the namespace that it knows about. Upon -success, it executes a *finalize* action that modifies the *Namespace* by -removing *kubernetes* from the list of finalizers: - -```json -{ - "apiVersion":"v1", - "kind": "Namespace", - "metadata": { - "name": "development", - "deletionTimestamp": "..." - }, - "spec": { - "finalizers": ["openshift.com/origin"], - }, - "status": { - "phase": "Terminating", - }, - "labels": { - "name": "development" - }, -} -``` - -OpenShift Origin has its own *namespace controller* that is observing cluster state, and -it observes the same namespace had a *deletionTimestamp* assigned to it. It too will go -and purge resources from its own storage that it manages associated with that namespace. -Upon completion, it executes a *finalize* action and removes the reference to "openshift.com/origin" -from the list of finalizers. - -This results in the following state: - -```json -{ - "apiVersion":"v1", - "kind": "Namespace", - "metadata": { - "name": "development", - "deletionTimestamp": "..." - }, - "spec": { - "finalizers": [], - }, - "status": { - "phase": "Terminating", - }, - "labels": { - "name": "development" - }, -} -``` - -At this point, the Kubernetes *namespace controller* in its sync loop will see that the namespace -has a deletion timestamp and that its list of finalizers is empty. As a result, it knows all -content associated from that namespace has been purged. It performs a final DELETE action -to remove that Namespace from the storage. - -At this point, all content associated with that Namespace, and the Namespace itself are gone. - - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/design/namespaces.md?pixel)]() - diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/design/networking.md b/Godeps/_workspace/src/k8s.io/kubernetes/docs/design/networking.md deleted file mode 100644 index dfe0f93e2990..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/design/networking.md +++ /dev/null @@ -1,214 +0,0 @@ - - - - -WARNING -WARNING -WARNING -WARNING -WARNING - -

    PLEASE NOTE: This document applies to the HEAD of the source tree

    - -If you are using a released version of Kubernetes, you should -refer to the docs that go with that version. - - -The latest 1.0.x release of this document can be found -[here](http://releases.k8s.io/release-1.0/docs/design/networking.md). - -Documentation for other releases can be found at -[releases.k8s.io](http://releases.k8s.io). - --- - - - - - -# Networking - -There are 4 distinct networking problems to solve: - -1. Highly-coupled container-to-container communications -2. Pod-to-Pod communications -3. Pod-to-Service communications -4. External-to-internal communications - -## Model and motivation - -Kubernetes deviates from the default Docker networking model (though as of -Docker 1.8 their network plugins are getting closer). The goal is for each pod -to have an IP in a flat shared networking namespace that has full communication -with other physical computers and containers across the network. IP-per-pod -creates a clean, backward-compatible model where pods can be treated much like -VMs or physical hosts from the perspectives of port allocation, networking, -naming, service discovery, load balancing, application configuration, and -migration. - -Dynamic port allocation, on the other hand, requires supporting both static -ports (e.g., for externally accessible services) and dynamically allocated -ports, requires partitioning centrally allocated and locally acquired dynamic -ports, complicates scheduling (since ports are a scarce resource), is -inconvenient for users, complicates application configuration, is plagued by -port conflicts and reuse and exhaustion, requires non-standard approaches to -naming (e.g. consul or etcd rather than DNS), requires proxies and/or -redirection for programs using standard naming/addressing mechanisms (e.g. web -browsers), requires watching and cache invalidation for address/port changes -for instances in addition to watching group membership changes, and obstructs -container/pod migration (e.g. using CRIU). NAT introduces additional complexity -by fragmenting the addressing space, which breaks self-registration mechanisms, -among other problems. - -## Container to container - -All containers within a pod behave as if they are on the same host with regard -to networking. They can all reach each other’s ports on localhost. This offers -simplicity (static ports know a priori), security (ports bound to localhost -are visible within the pod but never outside it), and performance. This also -reduces friction for applications moving from the world of uncontainerized apps -on physical or virtual hosts. People running application stacks together on -the same host have already figured out how to make ports not conflict and have -arranged for clients to find them. - -The approach does reduce isolation between containers within a pod — -ports could conflict, and there can be no container-private ports, but these -seem to be relatively minor issues with plausible future workarounds. Besides, -the premise of pods is that containers within a pod share some resources -(volumes, cpu, ram, etc.) and therefore expect and tolerate reduced isolation. -Additionally, the user can control what containers belong to the same pod -whereas, in general, they don't control what pods land together on a host. - -## Pod to pod - -Because every pod gets a "real" (not machine-private) IP address, pods can -communicate without proxies or translations. The pod can use well-known port -numbers and can avoid the use of higher-level service discovery systems like -DNS-SD, Consul, or Etcd. - -When any container calls ioctl(SIOCGIFADDR) (get the address of an interface), -it sees the same IP that any peer container would see them coming from — -each pod has its own IP address that other pods can know. By making IP addresses -and ports the same both inside and outside the pods, we create a NAT-less, flat -address space. Running "ip addr show" should work as expected. This would enable -all existing naming/discovery mechanisms to work out of the box, including -self-registration mechanisms and applications that distribute IP addresses. We -should be optimizing for inter-pod network communication. Within a pod, -containers are more likely to use communication through volumes (e.g., tmpfs) or -IPC. - -This is different from the standard Docker model. In that mode, each container -gets an IP in the 172-dot space and would only see that 172-dot address from -SIOCGIFADDR. If these containers connect to another container the peer would see -the connect coming from a different IP than the container itself knows. In short -— you can never self-register anything from a container, because a -container can not be reached on its private IP. - -An alternative we considered was an additional layer of addressing: pod-centric -IP per container. Each container would have its own local IP address, visible -only within that pod. This would perhaps make it easier for containerized -applications to move from physical/virtual hosts to pods, but would be more -complex to implement (e.g., requiring a bridge per pod, split-horizon/VP DNS) -and to reason about, due to the additional layer of address translation, and -would break self-registration and IP distribution mechanisms. - -Like Docker, ports can still be published to the host node's interface(s), but -the need for this is radically diminished. - -## Implementation - -For the Google Compute Engine cluster configuration scripts, we use [advanced -routing rules](https://developers.google.com/compute/docs/networking#routing) -and ip-forwarding-enabled VMs so that each VM has an extra 256 IP addresses that -get routed to it. This is in addition to the 'main' IP address assigned to the -VM that is NAT-ed for Internet access. The container bridge (called `cbr0` to -differentiate it from `docker0`) is set up outside of Docker proper. - -Example of GCE's advanced routing rules: - -```sh -gcloud compute routes add "${MINION_NAMES[$i]}" \ - --project "${PROJECT}" \ - --destination-range "${MINION_IP_RANGES[$i]}" \ - --network "${NETWORK}" \ - --next-hop-instance "${MINION_NAMES[$i]}" \ - --next-hop-instance-zone "${ZONE}" & -``` - -GCE itself does not know anything about these IPs, though. This means that when -a pod tries to egress beyond GCE's project the packets must be SNAT'ed -(masqueraded) to the VM's IP, which GCE recognizes and allows. - -### Other implementations - -With the primary aim of providing IP-per-pod-model, other implementations exist -to serve the purpose outside of GCE. - - [OpenVSwitch with GRE/VxLAN](../admin/ovs-networking.md) - - [Flannel](https://github.com/coreos/flannel#flannel) - - [L2 networks](http://blog.oddbit.com/2014/08/11/four-ways-to-connect-a-docker/) - ("With Linux Bridge devices" section) - - [Weave](https://github.com/zettio/weave) is yet another way to build an - overlay network, primarily aiming at Docker integration. - - [Calico](https://github.com/Metaswitch/calico) uses BGP to enable real - container IPs. - -## Pod to service - -The [service](../user-guide/services.md) abstraction provides a way to group pods under a -common access policy (e.g. load-balanced). The implementation of this creates a -virtual IP which clients can access and which is transparently proxied to the -pods in a Service. Each node runs a kube-proxy process which programs -`iptables` rules to trap access to service IPs and redirect them to the correct -backends. This provides a highly-available load-balancing solution with low -performance overhead by balancing client traffic from a node on that same node. - -## External to internal - -So far the discussion has been about how to access a pod or service from within -the cluster. Accessing a pod from outside the cluster is a bit more tricky. We -want to offer highly-available, high-performance load balancing to target -Kubernetes Services. Most public cloud providers are simply not flexible enough -yet. - -The way this is generally implemented is to set up external load balancers (e.g. -GCE's ForwardingRules or AWS's ELB) which target all nodes in a cluster. When -traffic arrives at a node it is recognized as being part of a particular Service -and routed to an appropriate backend Pod. This does mean that some traffic will -get double-bounced on the network. Once cloud providers have better offerings -we can take advantage of those. - -## Challenges and future work - -### Docker API - -Right now, docker inspect doesn't show the networking configuration of the -containers, since they derive it from another container. That information should -be exposed somehow. - -### External IP assignment - -We want to be able to assign IP addresses externally from Docker -[#6743](https://github.com/dotcloud/docker/issues/6743) so that we don't need -to statically allocate fixed-size IP ranges to each node, so that IP addresses -can be made stable across pod infra container restarts -([#2801](https://github.com/dotcloud/docker/issues/2801)), and to facilitate -pod migration. Right now, if the pod infra container dies, all the user -containers must be stopped and restarted because the netns of the pod infra -container will change on restart, and any subsequent user container restart -will join that new netns, thereby not being able to see its peers. -Additionally, a change in IP address would encounter DNS caching/TTL problems. -External IP assignment would also simplify DNS support (see below). - -### IPv6 - -IPv6 would be a nice option, also, but we can't depend on it yet. Docker support is in progress: [Docker issue #2974](https://github.com/dotcloud/docker/issues/2974), [Docker issue #6923](https://github.com/dotcloud/docker/issues/6923), [Docker issue #6975](https://github.com/dotcloud/docker/issues/6975). Additionally, direct ipv6 assignment to instances doesn't appear to be supported by major cloud providers (e.g., AWS EC2, GCE) yet. We'd happily take pull requests from people running Kubernetes on bare metal, though. :-) - - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/design/networking.md?pixel)]() - diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/design/persistent-storage.md b/Godeps/_workspace/src/k8s.io/kubernetes/docs/design/persistent-storage.md deleted file mode 100644 index bb2008118a99..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/design/persistent-storage.md +++ /dev/null @@ -1,242 +0,0 @@ - - - - -WARNING -WARNING -WARNING -WARNING -WARNING - -

    PLEASE NOTE: This document applies to the HEAD of the source tree

    - -If you are using a released version of Kubernetes, you should -refer to the docs that go with that version. - - -The latest 1.0.x release of this document can be found -[here](http://releases.k8s.io/release-1.0/docs/design/persistent-storage.md). - -Documentation for other releases can be found at -[releases.k8s.io](http://releases.k8s.io). - --- - - - - - -# Persistent Storage - -This document proposes a model for managing persistent, cluster-scoped storage for applications requiring long lived data. - -### tl;dr - -Two new API kinds: - -A `PersistentVolume` (PV) is a storage resource provisioned by an administrator. It is analogous to a node. See [Persistent Volume Guide](../user-guide/persistent-volumes/) for how to use it. - -A `PersistentVolumeClaim` (PVC) is a user's request for a persistent volume to use in a pod. It is analogous to a pod. - -One new system component: - -`PersistentVolumeClaimBinder` is a singleton running in master that watches all PersistentVolumeClaims in the system and binds them to the closest matching available PersistentVolume. The volume manager watches the API for newly created volumes to manage. - -One new volume: - -`PersistentVolumeClaimVolumeSource` references the user's PVC in the same namespace. This volume finds the bound PV and mounts that volume for the pod. A `PersistentVolumeClaimVolumeSource` is, essentially, a wrapper around another type of volume that is owned by someone else (the system). - -Kubernetes makes no guarantees at runtime that the underlying storage exists or is available. High availability is left to the storage provider. - -### Goals - -* Allow administrators to describe available storage -* Allow pod authors to discover and request persistent volumes to use with pods -* Enforce security through access control lists and securing storage to the same namespace as the pod volume -* Enforce quotas through admission control -* Enforce scheduler rules by resource counting -* Ensure developers can rely on storage being available without being closely bound to a particular disk, server, network, or storage device. - - -#### Describe available storage - -Cluster administrators use the API to manage *PersistentVolumes*. A custom store `NewPersistentVolumeOrderedIndex` will index volumes by access modes and sort by storage capacity. The `PersistentVolumeClaimBinder` watches for new claims for storage and binds them to an available volume by matching the volume's characteristics (AccessModes and storage size) to the user's request. - -PVs are system objects and, thus, have no namespace. - -Many means of dynamic provisioning will be eventually be implemented for various storage types. - - -##### PersistentVolume API - -| Action | HTTP Verb | Path | Description | -| ---- | ---- | ---- | ---- | -| CREATE | POST | /api/{version}/persistentvolumes/ | Create instance of PersistentVolume | -| GET | GET | /api/{version}persistentvolumes/{name} | Get instance of PersistentVolume with {name} | -| UPDATE | PUT | /api/{version}/persistentvolumes/{name} | Update instance of PersistentVolume with {name} | -| DELETE | DELETE | /api/{version}/persistentvolumes/{name} | Delete instance of PersistentVolume with {name} | -| LIST | GET | /api/{version}/persistentvolumes | List instances of PersistentVolume | -| WATCH | GET | /api/{version}/watch/persistentvolumes | Watch for changes to a PersistentVolume | - - -#### Request Storage - -Kubernetes users request persistent storage for their pod by creating a ```PersistentVolumeClaim```. Their request for storage is described by their requirements for resources and mount capabilities. - -Requests for volumes are bound to available volumes by the volume manager, if a suitable match is found. Requests for resources can go unfulfilled. - -Users attach their claim to their pod using a new ```PersistentVolumeClaimVolumeSource``` volume source. - - -##### PersistentVolumeClaim API - - -| Action | HTTP Verb | Path | Description | -| ---- | ---- | ---- | ---- | -| CREATE | POST | /api/{version}/namespaces/{ns}/persistentvolumeclaims/ | Create instance of PersistentVolumeClaim in namespace {ns} | -| GET | GET | /api/{version}/namespaces/{ns}/persistentvolumeclaims/{name} | Get instance of PersistentVolumeClaim in namespace {ns} with {name} | -| UPDATE | PUT | /api/{version}/namespaces/{ns}/persistentvolumeclaims/{name} | Update instance of PersistentVolumeClaim in namespace {ns} with {name} | -| DELETE | DELETE | /api/{version}/namespaces/{ns}/persistentvolumeclaims/{name} | Delete instance of PersistentVolumeClaim in namespace {ns} with {name} | -| LIST | GET | /api/{version}/namespaces/{ns}/persistentvolumeclaims | List instances of PersistentVolumeClaim in namespace {ns} | -| WATCH | GET | /api/{version}/watch/namespaces/{ns}/persistentvolumeclaims | Watch for changes to PersistentVolumeClaim in namespace {ns} | - - - -#### Scheduling constraints - -Scheduling constraints are to be handled similar to pod resource constraints. Pods will need to be annotated or decorated with the number of resources it requires on a node. Similarly, a node will need to list how many it has used or available. - -TBD - - -#### Events - -The implementation of persistent storage will not require events to communicate to the user the state of their claim. The CLI for bound claims contains a reference to the backing persistent volume. This is always present in the API and CLI, making an event to communicate the same unnecessary. - -Events that communicate the state of a mounted volume are left to the volume plugins. - - -### Example - -#### Admin provisions storage - -An administrator provisions storage by posting PVs to the API. Various way to automate this task can be scripted. Dynamic provisioning is a future feature that can maintain levels of PVs. - -```yaml -POST: - -kind: PersistentVolume -apiVersion: v1 -metadata: - name: pv0001 -spec: - capacity: - storage: 10 - persistentDisk: - pdName: "abc123" - fsType: "ext4" -``` - -```console -$ kubectl get pv - -NAME LABELS CAPACITY ACCESSMODES STATUS CLAIM REASON -pv0001 map[] 10737418240 RWO Pending -``` - -#### Users request storage - -A user requests storage by posting a PVC to the API. Their request contains the AccessModes they wish their volume to have and the minimum size needed. - -The user must be within a namespace to create PVCs. - -```yaml -POST: - -kind: PersistentVolumeClaim -apiVersion: v1 -metadata: - name: myclaim-1 -spec: - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 3 -``` - -```console -$ kubectl get pvc - -NAME LABELS STATUS VOLUME -myclaim-1 map[] pending -``` - - -#### Matching and binding - - The ```PersistentVolumeClaimBinder``` attempts to find an available volume that most closely matches the user's request. If one exists, they are bound by putting a reference on the PV to the PVC. Requests can go unfulfilled if a suitable match is not found. - -```console -$ kubectl get pv - -NAME LABELS CAPACITY ACCESSMODES STATUS CLAIM REASON -pv0001 map[] 10737418240 RWO Bound myclaim-1 / f4b3d283-c0ef-11e4-8be4-80e6500a981e - - -kubectl get pvc - -NAME LABELS STATUS VOLUME -myclaim-1 map[] Bound b16e91d6-c0ef-11e4-8be4-80e6500a981e -``` - -#### Claim usage - -The claim holder can use their claim as a volume. The ```PersistentVolumeClaimVolumeSource``` knows to fetch the PV backing the claim and mount its volume for a pod. - -The claim holder owns the claim and its data for as long as the claim exists. The pod using the claim can be deleted, but the claim remains in the user's namespace. It can be used again and again by many pods. - -```yaml -POST: - -kind: Pod -apiVersion: v1 -metadata: - name: mypod -spec: - containers: - - image: nginx - name: myfrontend - volumeMounts: - - mountPath: "/var/www/html" - name: mypd - volumes: - - name: mypd - source: - persistentVolumeClaim: - accessMode: ReadWriteOnce - claimRef: - name: myclaim-1 -``` - -#### Releasing a claim and Recycling a volume - -When a claim holder is finished with their data, they can delete their claim. - -```console -$ kubectl delete pvc myclaim-1 -``` - -The ```PersistentVolumeClaimBinder``` will reconcile this by removing the claim reference from the PV and change the PVs status to 'Released'. - -Admins can script the recycling of released volumes. Future dynamic provisioners will understand how a volume should be recycled. - - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/design/persistent-storage.md?pixel)]() - diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/design/principles.md b/Godeps/_workspace/src/k8s.io/kubernetes/docs/design/principles.md deleted file mode 100644 index 9791858de39a..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/design/principles.md +++ /dev/null @@ -1,93 +0,0 @@ - - - - -WARNING -WARNING -WARNING -WARNING -WARNING - -

    PLEASE NOTE: This document applies to the HEAD of the source tree

    - -If you are using a released version of Kubernetes, you should -refer to the docs that go with that version. - - -The latest 1.0.x release of this document can be found -[here](http://releases.k8s.io/release-1.0/docs/design/principles.md). - -Documentation for other releases can be found at -[releases.k8s.io](http://releases.k8s.io). - --- - - - - - -# Design Principles - -Principles to follow when extending Kubernetes. - -## API - -See also the [API conventions](../devel/api-conventions.md). - -* All APIs should be declarative. -* API objects should be complementary and composable, not opaque wrappers. -* The control plane should be transparent -- there are no hidden internal APIs. -* The cost of API operations should be proportional to the number of objects intentionally operated upon. Therefore, common filtered lookups must be indexed. Beware of patterns of multiple API calls that would incur quadratic behavior. -* Object status must be 100% reconstructable by observation. Any history kept must be just an optimization and not required for correct operation. -* Cluster-wide invariants are difficult to enforce correctly. Try not to add them. If you must have them, don't enforce them atomically in master components, that is contention-prone and doesn't provide a recovery path in the case of a bug allowing the invariant to be violated. Instead, provide a series of checks to reduce the probability of a violation, and make every component involved able to recover from an invariant violation. -* Low-level APIs should be designed for control by higher-level systems. Higher-level APIs should be intent-oriented (think SLOs) rather than implementation-oriented (think control knobs). - -## Control logic - -* Functionality must be *level-based*, meaning the system must operate correctly given the desired state and the current/observed state, regardless of how many intermediate state updates may have been missed. Edge-triggered behavior must be just an optimization. -* Assume an open world: continually verify assumptions and gracefully adapt to external events and/or actors. Example: we allow users to kill pods under control of a replication controller; it just replaces them. -* Do not define comprehensive state machines for objects with behaviors associated with state transitions and/or "assumed" states that cannot be ascertained by observation. -* Don't assume a component's decisions will not be overridden or rejected, nor for the component to always understand why. For example, etcd may reject writes. Kubelet may reject pods. The scheduler may not be able to schedule pods. Retry, but back off and/or make alternative decisions. -* Components should be self-healing. For example, if you must keep some state (e.g., cache) the content needs to be periodically refreshed, so that if an item does get erroneously stored or a deletion event is missed etc, it will be soon fixed, ideally on timescales that are shorter than what will attract attention from humans. -* Component behavior should degrade gracefully. Prioritize actions so that the most important activities can continue to function even when overloaded and/or in states of partial failure. - -## Architecture - -* Only the apiserver should communicate with etcd/store, and not other components (scheduler, kubelet, etc.). -* Compromising a single node shouldn't compromise the cluster. -* Components should continue to do what they were last told in the absence of new instructions (e.g., due to network partition or component outage). -* All components should keep all relevant state in memory all the time. The apiserver should write through to etcd/store, other components should write through to the apiserver, and they should watch for updates made by other clients. -* Watch is preferred over polling. - -## Extensibility - -TODO: pluggability - -## Bootstrapping - -* [Self-hosting](https://k8s.io/kubernetes/issues/246) of all components is a goal. -* Minimize the number of dependencies, particularly those required for steady-state operation. -* Stratify the dependencies that remain via principled layering. -* Break any circular dependencies by converting hard dependencies to soft dependencies. - * Also accept that data from other components from another source, such as local files, which can then be manually populated at bootstrap time and then continuously updated once those other components are available. - * State should be rediscoverable and/or reconstructable. - * Make it easy to run temporary, bootstrap instances of all components in order to create the runtime state needed to run the components in the steady state; use a lock (master election for distributed components, file lock for local components like Kubelet) to coordinate handoff. We call this technique "pivoting". - * Have a solution to restart dead components. For distributed components, replication works well. For local components such as Kubelet, a process manager or even a simple shell loop works. - -## Availability - -TODO - -## General principles - -* [Eric Raymond's 17 UNIX rules](https://en.wikipedia.org/wiki/Unix_philosophy#Eric_Raymond.E2.80.99s_17_Unix_Rules) - - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/design/principles.md?pixel)]() - diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/design/resources.md b/Godeps/_workspace/src/k8s.io/kubernetes/docs/design/resources.md deleted file mode 100644 index 272f036c9054..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/design/resources.md +++ /dev/null @@ -1,268 +0,0 @@ - - - - -WARNING -WARNING -WARNING -WARNING -WARNING - -

    PLEASE NOTE: This document applies to the HEAD of the source tree

    - -If you are using a released version of Kubernetes, you should -refer to the docs that go with that version. - - -The latest 1.0.x release of this document can be found -[here](http://releases.k8s.io/release-1.0/docs/design/resources.md). - -Documentation for other releases can be found at -[releases.k8s.io](http://releases.k8s.io). - --- - - - - -**Note: this is a design doc, which describes features that have not been completely implemented. -User documentation of the current state is [here](../user-guide/compute-resources.md). The tracking issue for -implementation of this model is -[#168](https://k8s.io/kubernetes/issues/168). Currently, only memory and -cpu limits on containers (not pods) are supported. "memory" is in bytes and "cpu" is in -milli-cores.** - -# The Kubernetes resource model - -To do good pod placement, Kubernetes needs to know how big pods are, as well as the sizes of the nodes onto which they are being placed. The definition of "how big" is given by the Kubernetes resource model — the subject of this document. - -The resource model aims to be: -* simple, for common cases; -* extensible, to accommodate future growth; -* regular, with few special cases; and -* precise, to avoid misunderstandings and promote pod portability. - -## The resource model - -A Kubernetes _resource_ is something that can be requested by, allocated to, or consumed by a pod or container. Examples include memory (RAM), CPU, disk-time, and network bandwidth. - -Once resources on a node have been allocated to one pod, they should not be allocated to another until that pod is removed or exits. This means that Kubernetes schedulers should ensure that the sum of the resources allocated (requested and granted) to its pods never exceeds the usable capacity of the node. Testing whether a pod will fit on a node is called _feasibility checking_. - -Note that the resource model currently prohibits over-committing resources; we will want to relax that restriction later. - -### Resource types - -All resources have a _type_ that is identified by their _typename_ (a string, e.g., "memory"). Several resource types are predefined by Kubernetes (a full list is below), although only two will be supported at first: CPU and memory. Users and system administrators can define their own resource types if they wish (e.g., Hadoop slots). - -A fully-qualified resource typename is constructed from a DNS-style _subdomain_, followed by a slash `/`, followed by a name. -* The subdomain must conform to [RFC 1123](http://www.ietf.org/rfc/rfc1123.txt) (e.g., `kubernetes.io`, `example.com`). -* The name must be not more than 63 characters, consisting of upper- or lower-case alphanumeric characters, with the `-`, `_`, and `.` characters allowed anywhere except the first or last character. -* As a shorthand, any resource typename that does not start with a subdomain and a slash will automatically be prefixed with the built-in Kubernetes _namespace_, `kubernetes.io/` in order to fully-qualify it. This namespace is reserved for code in the open source Kubernetes repository; as a result, all user typenames MUST be fully qualified, and cannot be created in this namespace. - -Some example typenames include `memory` (which will be fully-qualified as `kubernetes.io/memory`), and `example.com/Shiny_New-Resource.Type`. - -For future reference, note that some resources, such as CPU and network bandwidth, are _compressible_, which means that their usage can potentially be throttled in a relatively benign manner. All other resources are _incompressible_, which means that any attempt to throttle them is likely to cause grief. This distinction will be important if a Kubernetes implementation supports over-committing of resources. - -### Resource quantities - -Initially, all Kubernetes resource types are _quantitative_, and have an associated _unit_ for quantities of the associated resource (e.g., bytes for memory, bytes per seconds for bandwidth, instances for software licences). The units will always be a resource type's natural base units (e.g., bytes, not MB), to avoid confusion between binary and decimal multipliers and the underlying unit multiplier (e.g., is memory measured in MiB, MB, or GB?). - -Resource quantities can be added and subtracted: for example, a node has a fixed quantity of each resource type that can be allocated to pods/containers; once such an allocation has been made, the allocated resources cannot be made available to other pods/containers without over-committing the resources. - -To make life easier for people, quantities can be represented externally as unadorned integers, or as fixed-point integers with one of these SI suffices (E, P, T, G, M, K, m) or their power-of-two equivalents (Ei, Pi, Ti, Gi, Mi, Ki). For example, the following represent roughly the same value: 128974848, "129e6", "129M" , "123Mi". Small quantities can be represented directly as decimals (e.g., 0.3), or using milli-units (e.g., "300m"). - * "Externally" means in user interfaces, reports, graphs, and in JSON or YAML resource specifications that might be generated or read by people. - * Case is significant: "m" and "M" are not the same, so "k" is not a valid SI suffix. There are no power-of-two equivalents for SI suffixes that represent multipliers less than 1. - * These conventions only apply to resource quantities, not arbitrary values. - -Internally (i.e., everywhere else), Kubernetes will represent resource quantities as integers so it can avoid problems with rounding errors, and will not use strings to represent numeric values. To achieve this, quantities that naturally have fractional parts (e.g., CPU seconds/second) will be scaled to integral numbers of milli-units (e.g., milli-CPUs) as soon as they are read in. Internal APIs, data structures, and protobufs will use these scaled integer units. Raw measurement data such as usage may still need to be tracked and calculated using floating point values, but internally they should be rescaled to avoid some values being in milli-units and some not. - * Note that reading in a resource quantity and writing it out again may change the way its values are represented, and truncate precision (e.g., 1.0001 may become 1.000), so comparison and difference operations (e.g., by an updater) must be done on the internal representations. - * Avoiding milli-units in external representations has advantages for people who will use Kubernetes, but runs the risk of developers forgetting to rescale or accidentally using floating-point representations. That seems like the right choice. We will try to reduce the risk by providing libraries that automatically do the quantization for JSON/YAML inputs. - -### Resource specifications - -Both users and a number of system components, such as schedulers, (horizontal) auto-scalers, (vertical) auto-sizers, load balancers, and worker-pool managers need to reason about resource requirements of workloads, resource capacities of nodes, and resource usage. Kubernetes divides specifications of *desired state*, aka the Spec, and representations of *current state*, aka the Status. Resource requirements and total node capacity fall into the specification category, while resource usage, characterizations derived from usage (e.g., maximum usage, histograms), and other resource demand signals (e.g., CPU load) clearly fall into the status category and are discussed in the Appendix for now. - -Resource requirements for a container or pod should have the following form: - -```yaml -resourceRequirementSpec: [ - request: [ cpu: 2.5, memory: "40Mi" ], - limit: [ cpu: 4.0, memory: "99Mi" ], -] -``` - -Where: -* _request_ [optional]: the amount of resources being requested, or that were requested and have been allocated. Scheduler algorithms will use these quantities to test feasibility (whether a pod will fit onto a node). If a container (or pod) tries to use more resources than its _request_, any associated SLOs are voided — e.g., the program it is running may be throttled (compressible resource types), or the attempt may be denied. If _request_ is omitted for a container, it defaults to _limit_ if that is explicitly specified, otherwise to an implementation-defined value; this will always be 0 for a user-defined resource type. If _request_ is omitted for a pod, it defaults to the sum of the (explicit or implicit) _request_ values for the containers it encloses. - -* _limit_ [optional]: an upper bound or cap on the maximum amount of resources that will be made available to a container or pod; if a container or pod uses more resources than its _limit_, it may be terminated. The _limit_ defaults to "unbounded"; in practice, this probably means the capacity of an enclosing container, pod, or node, but may result in non-deterministic behavior, especially for memory. - -Total capacity for a node should have a similar structure: - -```yaml -resourceCapacitySpec: [ - total: [ cpu: 12, memory: "128Gi" ] -] -``` - -Where: -* _total_: the total allocatable resources of a node. Initially, the resources at a given scope will bound the resources of the sum of inner scopes. - -#### Notes - - * It is an error to specify the same resource type more than once in each list. - - * It is an error for the _request_ or _limit_ values for a pod to be less than the sum of the (explicit or defaulted) values for the containers it encloses. (We may relax this later.) - - * If multiple pods are running on the same node and attempting to use more resources than they have requested, the result is implementation-defined. For example: unallocated or unused resources might be spread equally across claimants, or the assignment might be weighted by the size of the original request, or as a function of limits, or priority, or the phase of the moon, perhaps modulated by the direction of the tide. Thus, although it's not mandatory to provide a _request_, it's probably a good idea. (Note that the _request_ could be filled in by an automated system that is observing actual usage and/or historical data.) - - * Internally, the Kubernetes master can decide the defaulting behavior and the kubelet implementation may expected an absolute specification. For example, if the master decided that "the default is unbounded" it would pass 2^64 to the kubelet. - - - -## Kubernetes-defined resource types - -The following resource types are predefined ("reserved") by Kubernetes in the `kubernetes.io` namespace, and so cannot be used for user-defined resources. Note that the syntax of all resource types in the resource spec is deliberately similar, but some resource types (e.g., CPU) may receive significantly more support than simply tracking quantities in the schedulers and/or the Kubelet. - -### Processor cycles - - * Name: `cpu` (or `kubernetes.io/cpu`) - * Units: Kubernetes Compute Unit seconds/second (i.e., CPU cores normalized to a canonical "Kubernetes CPU") - * Internal representation: milli-KCUs - * Compressible? yes - * Qualities: this is a placeholder for the kind of thing that may be supported in the future — see [#147](https://k8s.io/kubernetes/issues/147) - * [future] `schedulingLatency`: as per lmctfy - * [future] `cpuConversionFactor`: property of a node: the speed of a CPU core on the node's processor divided by the speed of the canonical Kubernetes CPU (a floating point value; default = 1.0). - -To reduce performance portability problems for pods, and to avoid worse-case provisioning behavior, the units of CPU will be normalized to a canonical "Kubernetes Compute Unit" (KCU, pronounced ˈko͝oko͞o), which will roughly be equivalent to a single CPU hyperthreaded core for some recent x86 processor. The normalization may be implementation-defined, although some reasonable defaults will be provided in the open-source Kubernetes code. - -Note that requesting 2 KCU won't guarantee that precisely 2 physical cores will be allocated — control of aspects like this will be handled by resource _qualities_ (a future feature). - - -### Memory - - * Name: `memory` (or `kubernetes.io/memory`) - * Units: bytes - * Compressible? no (at least initially) - -The precise meaning of what "memory" means is implementation dependent, but the basic idea is to rely on the underlying `memcg` mechanisms, support, and definitions. - -Note that most people will want to use power-of-two suffixes (Mi, Gi) for memory quantities -rather than decimal ones: "64MiB" rather than "64MB". - - -## Resource metadata - -A resource type may have an associated read-only ResourceType structure, that contains metadata about the type. For example: - -```yaml -resourceTypes: [ - "kubernetes.io/memory": [ - isCompressible: false, ... - ] - "kubernetes.io/cpu": [ - isCompressible: true, - internalScaleExponent: 3, ... - ] - "kubernetes.io/disk-space": [ ... ] -] -``` - -Kubernetes will provide ResourceType metadata for its predefined types. If no resource metadata can be found for a resource type, Kubernetes will assume that it is a quantified, incompressible resource that is not specified in milli-units, and has no default value. - -The defined properties are as follows: - -| field name | type | contents | -| ---------- | ---- | -------- | -| name | string, required | the typename, as a fully-qualified string (e.g., `kubernetes.io/cpu`) | -| internalScaleExponent | int, default=0 | external values are multiplied by 10 to this power for internal storage (e.g., 3 for milli-units) | -| units | string, required | format: `unit* [per unit+]` (e.g., `second`, `byte per second`). An empty unit field means "dimensionless". | -| isCompressible | bool, default=false | true if the resource type is compressible | -| defaultRequest | string, default=none | in the same format as a user-supplied value | -| _[future]_ quantization | number, default=1 | smallest granularity of allocation: requests may be rounded up to a multiple of this unit; implementation-defined unit (e.g., the page size for RAM). | - - -# Appendix: future extensions - -The following are planned future extensions to the resource model, included here to encourage comments. - -## Usage data - -Because resource usage and related metrics change continuously, need to be tracked over time (i.e., historically), can be characterized in a variety of ways, and are fairly voluminous, we will not include usage in core API objects, such as [Pods](../user-guide/pods.md) and Nodes, but will provide separate APIs for accessing and managing that data. See the Appendix for possible representations of usage data, but the representation we'll use is TBD. - -Singleton values for observed and predicted future usage will rapidly prove inadequate, so we will support the following structure for extended usage information: - -```yaml -resourceStatus: [ - usage: [ cpu: , memory: ], - maxusage: [ cpu: , memory: ], - predicted: [ cpu: , memory: ], -] -``` - -where a `` or `` structure looks like this: - -```yaml -{ - mean: # arithmetic mean - max: # minimum value - min: # maximum value - count: # number of data points - percentiles: [ # map from %iles to values - "10": <10th-percentile-value>, - "50": , - "99": <99th-percentile-value>, - "99.9": <99.9th-percentile-value>, - ... - ] -} -``` - -All parts of this structure are optional, although we strongly encourage including quantities for 50, 90, 95, 99, 99.5, and 99.9 percentiles. _[In practice, it will be important to include additional info such as the length of the time window over which the averages are calculated, the confidence level, and information-quality metrics such as the number of dropped or discarded data points.]_ -and predicted - -## Future resource types - -### _[future] Network bandwidth_ - - * Name: "network-bandwidth" (or `kubernetes.io/network-bandwidth`) - * Units: bytes per second - * Compressible? yes - -### _[future] Network operations_ - - * Name: "network-iops" (or `kubernetes.io/network-iops`) - * Units: operations (messages) per second - * Compressible? yes - -### _[future] Storage space_ - - * Name: "storage-space" (or `kubernetes.io/storage-space`) - * Units: bytes - * Compressible? no - -The amount of secondary storage space available to a container. The main target is local disk drives and SSDs, although this could also be used to qualify remotely-mounted volumes. Specifying whether a resource is a raw disk, an SSD, a disk array, or a file system fronting any of these, is left for future work. - -### _[future] Storage time_ - - * Name: storage-time (or `kubernetes.io/storage-time`) - * Units: seconds per second of disk time - * Internal representation: milli-units - * Compressible? yes - -This is the amount of time a container spends accessing disk, including actuator and transfer time. A standard disk drive provides 1.0 diskTime seconds per second. - -### _[future] Storage operations_ - - * Name: "storage-iops" (or `kubernetes.io/storage-iops`) - * Units: operations per second - * Compressible? yes - - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/design/resources.md?pixel)]() - diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/design/secrets.md b/Godeps/_workspace/src/k8s.io/kubernetes/docs/design/secrets.md deleted file mode 100644 index d3d1226ec7ac..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/design/secrets.md +++ /dev/null @@ -1,613 +0,0 @@ - - - - -WARNING -WARNING -WARNING -WARNING -WARNING - -

    PLEASE NOTE: This document applies to the HEAD of the source tree

    - -If you are using a released version of Kubernetes, you should -refer to the docs that go with that version. - - -The latest 1.0.x release of this document can be found -[here](http://releases.k8s.io/release-1.0/docs/design/secrets.md). - -Documentation for other releases can be found at -[releases.k8s.io](http://releases.k8s.io). - --- - - - - - -## Abstract - -A proposal for the distribution of [secrets](../user-guide/secrets.md) (passwords, keys, etc) to the Kubelet and to -containers inside Kubernetes using a custom [volume](../user-guide/volumes.md#secrets) type. See the [secrets example](../user-guide/secrets/) for more information. - -## Motivation - -Secrets are needed in containers to access internal resources like the Kubernetes master or -external resources such as git repositories, databases, etc. Users may also want behaviors in the -kubelet that depend on secret data (credentials for image pull from a docker registry) associated -with pods. - -Goals of this design: - -1. Describe a secret resource -2. Define the various challenges attendant to managing secrets on the node -3. Define a mechanism for consuming secrets in containers without modification - -## Constraints and Assumptions - -* This design does not prescribe a method for storing secrets; storage of secrets should be - pluggable to accommodate different use-cases -* Encryption of secret data and node security are orthogonal concerns -* It is assumed that node and master are secure and that compromising their security could also - compromise secrets: - * If a node is compromised, the only secrets that could potentially be exposed should be the - secrets belonging to containers scheduled onto it - * If the master is compromised, all secrets in the cluster may be exposed -* Secret rotation is an orthogonal concern, but it should be facilitated by this proposal -* A user who can consume a secret in a container can know the value of the secret; secrets must - be provisioned judiciously - -## Use Cases - -1. As a user, I want to store secret artifacts for my applications and consume them securely in - containers, so that I can keep the configuration for my applications separate from the images - that use them: - 1. As a cluster operator, I want to allow a pod to access the Kubernetes master using a custom - `.kubeconfig` file, so that I can securely reach the master - 2. As a cluster operator, I want to allow a pod to access a Docker registry using credentials - from a `.dockercfg` file, so that containers can push images - 3. As a cluster operator, I want to allow a pod to access a git repository using SSH keys, - so that I can push and fetch to and from the repository -2. As a user, I want to allow containers to consume supplemental information about services such - as username and password which should be kept secret, so that I can share secrets about a - service amongst the containers in my application securely -3. As a user, I want to associate a pod with a `ServiceAccount` that consumes a secret and have - the kubelet implement some reserved behaviors based on the types of secrets the service account - consumes: - 1. Use credentials for a docker registry to pull the pod's docker image - 2. Present Kubernetes auth token to the pod or transparently decorate traffic between the pod - and master service -4. As a user, I want to be able to indicate that a secret expires and for that secret's value to - be rotated once it expires, so that the system can help me follow good practices - -### Use-Case: Configuration artifacts - -Many configuration files contain secrets intermixed with other configuration information. For -example, a user's application may contain a properties file than contains database credentials, -SaaS API tokens, etc. Users should be able to consume configuration artifacts in their containers -and be able to control the path on the container's filesystems where the artifact will be -presented. - -### Use-Case: Metadata about services - -Most pieces of information about how to use a service are secrets. For example, a service that -provides a MySQL database needs to provide the username, password, and database name to consumers -so that they can authenticate and use the correct database. Containers in pods consuming the MySQL -service would also consume the secrets associated with the MySQL service. - -### Use-Case: Secrets associated with service accounts - -[Service Accounts](service_accounts.md) are proposed as a -mechanism to decouple capabilities and security contexts from individual human users. A -`ServiceAccount` contains references to some number of secrets. A `Pod` can specify that it is -associated with a `ServiceAccount`. Secrets should have a `Type` field to allow the Kubelet and -other system components to take action based on the secret's type. - -#### Example: service account consumes auth token secret - -As an example, the service account proposal discusses service accounts consuming secrets which -contain Kubernetes auth tokens. When a Kubelet starts a pod associated with a service account -which consumes this type of secret, the Kubelet may take a number of actions: - -1. Expose the secret in a `.kubernetes_auth` file in a well-known location in the container's - file system -2. Configure that node's `kube-proxy` to decorate HTTP requests from that pod to the - `kubernetes-master` service with the auth token, e. g. by adding a header to the request - (see the [LOAS Daemon](https://k8s.io/kubernetes/issues/2209) proposal) - -#### Example: service account consumes docker registry credentials - -Another example use case is where a pod is associated with a secret containing docker registry -credentials. The Kubelet could use these credentials for the docker pull to retrieve the image. - -### Use-Case: Secret expiry and rotation - -Rotation is considered a good practice for many types of secret data. It should be possible to -express that a secret has an expiry date; this would make it possible to implement a system -component that could regenerate expired secrets. As an example, consider a component that rotates -expired secrets. The rotator could periodically regenerate the values for expired secrets of -common types and update their expiry dates. - -## Deferral: Consuming secrets as environment variables - -Some images will expect to receive configuration items as environment variables instead of files. -We should consider what the best way to allow this is; there are a few different options: - -1. Force the user to adapt files into environment variables. Users can store secrets that need to - be presented as environment variables in a format that is easy to consume from a shell: - - $ cat /etc/secrets/my-secret.txt - export MY_SECRET_ENV=MY_SECRET_VALUE - - The user could `source` the file at `/etc/secrets/my-secret` prior to executing the command for - the image either inline in the command or in an init script, - -2. Give secrets an attribute that allows users to express the intent that the platform should - generate the above syntax in the file used to present a secret. The user could consume these - files in the same manner as the above option. - -3. Give secrets attributes that allow the user to express that the secret should be presented to - the container as an environment variable. The container's environment would contain the - desired values and the software in the container could use them without accommodation the - command or setup script. - -For our initial work, we will treat all secrets as files to narrow the problem space. There will -be a future proposal that handles exposing secrets as environment variables. - -## Flow analysis of secret data with respect to the API server - -There are two fundamentally different use-cases for access to secrets: - -1. CRUD operations on secrets by their owners -2. Read-only access to the secrets needed for a particular node by the kubelet - -### Use-Case: CRUD operations by owners - -In use cases for CRUD operations, the user experience for secrets should be no different than for -other API resources. - -#### Data store backing the REST API - -The data store backing the REST API should be pluggable because different cluster operators will -have different preferences for the central store of secret data. Some possibilities for storage: - -1. An etcd collection alongside the storage for other API resources -2. A collocated [HSM](http://en.wikipedia.org/wiki/Hardware_security_module) -3. A secrets server like [Vault](https://www.vaultproject.io/) or [Keywhiz](https://square.github.io/keywhiz/) -4. An external datastore such as an external etcd, RDBMS, etc. - -#### Size limit for secrets - -There should be a size limit for secrets in order to: - -1. Prevent DOS attacks against the API server -2. Allow kubelet implementations that prevent secret data from touching the node's filesystem - -The size limit should satisfy the following conditions: - -1. Large enough to store common artifact types (encryption keypairs, certificates, small - configuration files) -2. Small enough to avoid large impact on node resource consumption (storage, RAM for tmpfs, etc) - -To begin discussion, we propose an initial value for this size limit of **1MB**. - -#### Other limitations on secrets - -Defining a policy for limitations on how a secret may be referenced by another API resource and how -constraints should be applied throughout the cluster is tricky due to the number of variables -involved: - -1. Should there be a maximum number of secrets a pod can reference via a volume? -2. Should there be a maximum number of secrets a service account can reference? -3. Should there be a total maximum number of secrets a pod can reference via its own spec and its - associated service account? -4. Should there be a total size limit on the amount of secret data consumed by a pod? -5. How will cluster operators want to be able to configure these limits? -6. How will these limits impact API server validations? -7. How will these limits affect scheduling? - -For now, we will not implement validations around these limits. Cluster operators will decide how -much node storage is allocated to secrets. It will be the operator's responsibility to ensure that -the allocated storage is sufficient for the workload scheduled onto a node. - -For now, kubelets will only attach secrets to api-sourced pods, and not file- or http-sourced -ones. Doing so would: - - confuse the secrets admission controller in the case of mirror pods. - - create an apiserver-liveness dependency -- avoiding this dependency is a main reason to use non-api-source pods. - -### Use-Case: Kubelet read of secrets for node - -The use-case where the kubelet reads secrets has several additional requirements: - -1. Kubelets should only be able to receive secret data which is required by pods scheduled onto - the kubelet's node -2. Kubelets should have read-only access to secret data -3. Secret data should not be transmitted over the wire insecurely -4. Kubelets must ensure pods do not have access to each other's secrets - -#### Read of secret data by the Kubelet - -The Kubelet should only be allowed to read secrets which are consumed by pods scheduled onto that -Kubelet's node and their associated service accounts. Authorization of the Kubelet to read this -data would be delegated to an authorization plugin and associated policy rule. - -#### Secret data on the node: data at rest - -Consideration must be given to whether secret data should be allowed to be at rest on the node: - -1. If secret data is not allowed to be at rest, the size of secret data becomes another draw on - the node's RAM - should it affect scheduling? -2. If secret data is allowed to be at rest, should it be encrypted? - 1. If so, how should be this be done? - 2. If not, what threats exist? What types of secret are appropriate to store this way? - -For the sake of limiting complexity, we propose that initially secret data should not be allowed -to be at rest on a node; secret data should be stored on a node-level tmpfs filesystem. This -filesystem can be subdivided into directories for use by the kubelet and by the volume plugin. - -#### Secret data on the node: resource consumption - -The Kubelet will be responsible for creating the per-node tmpfs file system for secret storage. -It is hard to make a prescriptive declaration about how much storage is appropriate to reserve for -secrets because different installations will vary widely in available resources, desired pod to -node density, overcommit policy, and other operation dimensions. That being the case, we propose -for simplicity that the amount of secret storage be controlled by a new parameter to the kubelet -with a default value of **64MB**. It is the cluster operator's responsibility to handle choosing -the right storage size for their installation and configuring their Kubelets correctly. - -Configuring each Kubelet is not the ideal story for operator experience; it is more intuitive that -the cluster-wide storage size be readable from a central configuration store like the one proposed -in [#1553](https://k8s.io/kubernetes/issues/1553). When such a store -exists, the Kubelet could be modified to read this configuration item from the store. - -When the Kubelet is modified to advertise node resources (as proposed in -[#4441](https://k8s.io/kubernetes/issues/4441)), the capacity calculation -for available memory should factor in the potential size of the node-level tmpfs in order to avoid -memory overcommit on the node. - -#### Secret data on the node: isolation - -Every pod will have a [security context](security_context.md). -Secret data on the node should be isolated according to the security context of the container. The -Kubelet volume plugin API will be changed so that a volume plugin receives the security context of -a volume along with the volume spec. This will allow volume plugins to implement setting the -security context of volumes they manage. - -## Community work - -Several proposals / upstream patches are notable as background for this proposal: - -1. [Docker vault proposal](https://github.com/docker/docker/issues/10310) -2. [Specification for image/container standardization based on volumes](https://github.com/docker/docker/issues/9277) -3. [Kubernetes service account proposal](service_accounts.md) -4. [Secrets proposal for docker (1)](https://github.com/docker/docker/pull/6075) -5. [Secrets proposal for docker (2)](https://github.com/docker/docker/pull/6697) - -## Proposed Design - -We propose a new `Secret` resource which is mounted into containers with a new volume type. Secret -volumes will be handled by a volume plugin that does the actual work of fetching the secret and -storing it. Secrets contain multiple pieces of data that are presented as different files within -the secret volume (example: SSH key pair). - -In order to remove the burden from the end user in specifying every file that a secret consists of, -it should be possible to mount all files provided by a secret with a single `VolumeMount` entry -in the container specification. - -### Secret API Resource - -A new resource for secrets will be added to the API: - -```go -type Secret struct { - TypeMeta - ObjectMeta - - // Data contains the secret data. Each key must be a valid DNS_SUBDOMAIN. - // The serialized form of the secret data is a base64 encoded string, - // representing the arbitrary (possibly non-string) data value here. - Data map[string][]byte `json:"data,omitempty"` - - // Used to facilitate programmatic handling of secret data. - Type SecretType `json:"type,omitempty"` -} - -type SecretType string - -const ( - SecretTypeOpaque SecretType = "Opaque" // Opaque (arbitrary data; default) - SecretTypeKubernetesAuthToken SecretType = "KubernetesAuth" // Kubernetes auth token - SecretTypeDockerRegistryAuth SecretType = "DockerRegistryAuth" // Docker registry auth - // FUTURE: other type values -) - -const MaxSecretSize = 1 * 1024 * 1024 -``` - -A Secret can declare a type in order to provide type information to system components that work -with secrets. The default type is `opaque`, which represents arbitrary user-owned data. - -Secrets are validated against `MaxSecretSize`. The keys in the `Data` field must be valid DNS -subdomains. - -A new REST API and registry interface will be added to accompany the `Secret` resource. The -default implementation of the registry will store `Secret` information in etcd. Future registry -implementations could store the `TypeMeta` and `ObjectMeta` fields in etcd and store the secret -data in another data store entirely, or store the whole object in another data store. - -#### Other validations related to secrets - -Initially there will be no validations for the number of secrets a pod references, or the number of -secrets that can be associated with a service account. These may be added in the future as the -finer points of secrets and resource allocation are fleshed out. - -### Secret Volume Source - -A new `SecretSource` type of volume source will be added to the `VolumeSource` struct in the -API: - -```go -type VolumeSource struct { - // Other fields omitted - - // SecretSource represents a secret that should be presented in a volume - SecretSource *SecretSource `json:"secret"` -} - -type SecretSource struct { - Target ObjectReference -} -``` - -Secret volume sources are validated to ensure that the specified object reference actually points -to an object of type `Secret`. - -In the future, the `SecretSource` will be extended to allow: - -1. Fine-grained control over which pieces of secret data are exposed in the volume -2. The paths and filenames for how secret data are exposed - -### Secret Volume Plugin - -A new Kubelet volume plugin will be added to handle volumes with a secret source. This plugin will -require access to the API server to retrieve secret data and therefore the volume `Host` interface -will have to change to expose a client interface: - -```go -type Host interface { - // Other methods omitted - - // GetKubeClient returns a client interface - GetKubeClient() client.Interface -} -``` - -The secret volume plugin will be responsible for: - -1. Returning a `volume.Builder` implementation from `NewBuilder` that: - 1. Retrieves the secret data for the volume from the API server - 2. Places the secret data onto the container's filesystem - 3. Sets the correct security attributes for the volume based on the pod's `SecurityContext` -2. Returning a `volume.Cleaner` implementation from `NewClear` that cleans the volume from the - container's filesystem - -### Kubelet: Node-level secret storage - -The Kubelet must be modified to accept a new parameter for the secret storage size and to create -a tmpfs file system of that size to store secret data. Rough accounting of specific changes: - -1. The Kubelet should have a new field added called `secretStorageSize`; units are megabytes -2. `NewMainKubelet` should accept a value for secret storage size -3. The Kubelet server should have a new flag added for secret storage size -4. The Kubelet's `setupDataDirs` method should be changed to create the secret storage - -### Kubelet: New behaviors for secrets associated with service accounts - -For use-cases where the Kubelet's behavior is affected by the secrets associated with a pod's -`ServiceAccount`, the Kubelet will need to be changed. For example, if secrets of type -`docker-reg-auth` affect how the pod's images are pulled, the Kubelet will need to be changed -to accommodate this. Subsequent proposals can address this on a type-by-type basis. - -## Examples - -For clarity, let's examine some detailed examples of some common use-cases in terms of the -suggested changes. All of these examples are assumed to be created in a namespace called -`example`. - -### Use-Case: Pod with ssh keys - -To create a pod that uses an ssh key stored as a secret, we first need to create a secret: - -```json -{ - "kind": "Secret", - "apiVersion": "v1", - "metadata": { - "name": "ssh-key-secret" - }, - "data": { - "id-rsa": "dmFsdWUtMg0KDQo=", - "id-rsa.pub": "dmFsdWUtMQ0K" - } -} -``` - -**Note:** The serialized JSON and YAML values of secret data are encoded as -base64 strings. Newlines are not valid within these strings and must be -omitted. - -Now we can create a pod which references the secret with the ssh key and consumes it in a volume: - -```json -{ - "kind": "Pod", - "apiVersion": "v1", - "metadata": { - "name": "secret-test-pod", - "labels": { - "name": "secret-test" - } - }, - "spec": { - "volumes": [ - { - "name": "secret-volume", - "secret": { - "secretName": "ssh-key-secret" - } - } - ], - "containers": [ - { - "name": "ssh-test-container", - "image": "mySshImage", - "volumeMounts": [ - { - "name": "secret-volume", - "readOnly": true, - "mountPath": "/etc/secret-volume" - } - ] - } - ] - } -} -``` - -When the container's command runs, the pieces of the key will be available in: - - /etc/secret-volume/id-rsa.pub - /etc/secret-volume/id-rsa - -The container is then free to use the secret data to establish an ssh connection. - -### Use-Case: Pods with pod / test credentials - -This example illustrates a pod which consumes a secret containing prod -credentials and another pod which consumes a secret with test environment -credentials. - -The secrets: - -```json -{ - "apiVersion": "v1", - "kind": "List", - "items": - [{ - "kind": "Secret", - "apiVersion": "v1", - "metadata": { - "name": "prod-db-secret" - }, - "data": { - "password": "dmFsdWUtMg0KDQo=", - "username": "dmFsdWUtMQ0K" - } - }, - { - "kind": "Secret", - "apiVersion": "v1", - "metadata": { - "name": "test-db-secret" - }, - "data": { - "password": "dmFsdWUtMg0KDQo=", - "username": "dmFsdWUtMQ0K" - } - }] -} -``` - -The pods: - -```json -{ - "apiVersion": "v1", - "kind": "List", - "items": - [{ - "kind": "Pod", - "apiVersion": "v1", - "metadata": { - "name": "prod-db-client-pod", - "labels": { - "name": "prod-db-client" - } - }, - "spec": { - "volumes": [ - { - "name": "secret-volume", - "secret": { - "secretName": "prod-db-secret" - } - } - ], - "containers": [ - { - "name": "db-client-container", - "image": "myClientImage", - "volumeMounts": [ - { - "name": "secret-volume", - "readOnly": true, - "mountPath": "/etc/secret-volume" - } - ] - } - ] - } - }, - { - "kind": "Pod", - "apiVersion": "v1", - "metadata": { - "name": "test-db-client-pod", - "labels": { - "name": "test-db-client" - } - }, - "spec": { - "volumes": [ - { - "name": "secret-volume", - "secret": { - "secretName": "test-db-secret" - } - } - ], - "containers": [ - { - "name": "db-client-container", - "image": "myClientImage", - "volumeMounts": [ - { - "name": "secret-volume", - "readOnly": true, - "mountPath": "/etc/secret-volume" - } - ] - } - ] - } - }] -} -``` - -The specs for the two pods differ only in the value of the object referred to by the secret volume -source. Both containers will have the following files present on their filesystems: - - /etc/secret-volume/username - /etc/secret-volume/password - - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/design/secrets.md?pixel)]() - diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/design/security.md b/Godeps/_workspace/src/k8s.io/kubernetes/docs/design/security.md deleted file mode 100644 index daf5c9e53c44..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/design/security.md +++ /dev/null @@ -1,155 +0,0 @@ - - - - -WARNING -WARNING -WARNING -WARNING -WARNING - -

    PLEASE NOTE: This document applies to the HEAD of the source tree

    - -If you are using a released version of Kubernetes, you should -refer to the docs that go with that version. - - -The latest 1.0.x release of this document can be found -[here](http://releases.k8s.io/release-1.0/docs/design/security.md). - -Documentation for other releases can be found at -[releases.k8s.io](http://releases.k8s.io). - --- - - - - - -# Security in Kubernetes - -Kubernetes should define a reasonable set of security best practices that allows processes to be isolated from each other, from the cluster infrastructure, and which preserves important boundaries between those who manage the cluster, and those who use the cluster. - -While Kubernetes today is not primarily a multi-tenant system, the long term evolution of Kubernetes will increasingly rely on proper boundaries between users and administrators. The code running on the cluster must be appropriately isolated and secured to prevent malicious parties from affecting the entire cluster. - - -## High Level Goals - -1. Ensure a clear isolation between the container and the underlying host it runs on -2. Limit the ability of the container to negatively impact the infrastructure or other containers -3. [Principle of Least Privilege](http://en.wikipedia.org/wiki/Principle_of_least_privilege) - ensure components are only authorized to perform the actions they need, and limit the scope of a compromise by limiting the capabilities of individual components -4. Reduce the number of systems that have to be hardened and secured by defining clear boundaries between components -5. Allow users of the system to be cleanly separated from administrators -6. Allow administrative functions to be delegated to users where necessary -7. Allow applications to be run on the cluster that have "secret" data (keys, certs, passwords) which is properly abstracted from "public" data. - - -## Use cases - -### Roles - -We define "user" as a unique identity accessing the Kubernetes API server, which may be a human or an automated process. Human users fall into the following categories: - -1. k8s admin - administers a Kubernetes cluster and has access to the underlying components of the system -2. k8s project administrator - administrates the security of a small subset of the cluster -3. k8s developer - launches pods on a Kubernetes cluster and consumes cluster resources - -Automated process users fall into the following categories: - -1. k8s container user - a user that processes running inside a container (on the cluster) can use to access other cluster resources independent of the human users attached to a project -2. k8s infrastructure user - the user that Kubernetes infrastructure components use to perform cluster functions with clearly defined roles - - -### Description of roles - -* Developers: - * write pod specs. - * making some of their own images, and using some "community" docker images - * know which pods need to talk to which other pods - * decide which pods should share files with other pods, and which should not. - * reason about application level security, such as containing the effects of a local-file-read exploit in a webserver pod. - * do not often reason about operating system or organizational security. - * are not necessarily comfortable reasoning about the security properties of a system at the level of detail of Linux Capabilities, SELinux, AppArmor, etc. - -* Project Admins: - * allocate identity and roles within a namespace - * reason about organizational security within a namespace - * don't give a developer permissions that are not needed for role. - * protect files on shared storage from unnecessary cross-team access - * are less focused about application security - -* Administrators: - * are less focused on application security. Focused on operating system security. - * protect the node from bad actors in containers, and properly-configured innocent containers from bad actors in other containers. - * comfortable reasoning about the security properties of a system at the level of detail of Linux Capabilities, SELinux, AppArmor, etc. - * decides who can use which Linux Capabilities, run privileged containers, use hostPath, etc. - * e.g. a team that manages Ceph or a mysql server might be trusted to have raw access to storage devices in some organizations, but teams that develop the applications at higher layers would not. - - -## Proposed Design - -A pod runs in a *security context* under a *service account* that is defined by an administrator or project administrator, and the *secrets* a pod has access to is limited by that *service account*. - - -1. The API should authenticate and authorize user actions [authn and authz](access.md) -2. All infrastructure components (kubelets, kube-proxies, controllers, scheduler) should have an infrastructure user that they can authenticate with and be authorized to perform only the functions they require against the API. -3. Most infrastructure components should use the API as a way of exchanging data and changing the system, and only the API should have access to the underlying data store (etcd) -4. When containers run on the cluster and need to talk to other containers or the API server, they should be identified and authorized clearly as an autonomous process via a [service account](service_accounts.md) - 1. If the user who started a long-lived process is removed from access to the cluster, the process should be able to continue without interruption - 2. If the user who started processes are removed from the cluster, administrators may wish to terminate their processes in bulk - 3. When containers run with a service account, the user that created / triggered the service account behavior must be associated with the container's action -5. When container processes run on the cluster, they should run in a [security context](security_context.md) that isolates those processes via Linux user security, user namespaces, and permissions. - 1. Administrators should be able to configure the cluster to automatically confine all container processes as a non-root, randomly assigned UID - 2. Administrators should be able to ensure that container processes within the same namespace are all assigned the same unix user UID - 3. Administrators should be able to limit which developers and project administrators have access to higher privilege actions - 4. Project administrators should be able to run pods within a namespace under different security contexts, and developers must be able to specify which of the available security contexts they may use - 5. Developers should be able to run their own images or images from the community and expect those images to run correctly - 6. Developers may need to ensure their images work within higher security requirements specified by administrators - 7. When available, Linux kernel user namespaces can be used to ensure 5.2 and 5.4 are met. - 8. When application developers want to share filesystem data via distributed filesystems, the Unix user ids on those filesystems must be consistent across different container processes -6. Developers should be able to define [secrets](secrets.md) that are automatically added to the containers when pods are run - 1. Secrets are files injected into the container whose values should not be displayed within a pod. Examples: - 1. An SSH private key for git cloning remote data - 2. A client certificate for accessing a remote system - 3. A private key and certificate for a web server - 4. A .kubeconfig file with embedded cert / token data for accessing the Kubernetes master - 5. A .dockercfg file for pulling images from a protected registry - 2. Developers should be able to define the pod spec so that a secret lands in a specific location - 3. Project administrators should be able to limit developers within a namespace from viewing or modifying secrets (anyone who can launch an arbitrary pod can view secrets) - 4. Secrets are generally not copied from one namespace to another when a developer's application definitions are copied - - -### Related design discussion - -* [Authorization and authentication](access.md) -* [Secret distribution via files](https://k8s.io/kubernetes/pull/2030) -* [Docker secrets](https://github.com/docker/docker/pull/6697) -* [Docker vault](https://github.com/docker/docker/issues/10310) -* [Service Accounts:](service_accounts.md) -* [Secret volumes](https://k8s.io/kubernetes/pull/4126) - -## Specific Design Points - -### TODO: authorization, authentication - -### Isolate the data store from the nodes and supporting infrastructure - -Access to the central data store (etcd) in Kubernetes allows an attacker to run arbitrary containers on hosts, to gain access to any protected information stored in either volumes or in pods (such as access tokens or shared secrets provided as environment variables), to intercept and redirect traffic from running services by inserting middlemen, or to simply delete the entire history of the custer. - -As a general principle, access to the central data store should be restricted to the components that need full control over the system and which can apply appropriate authorization and authentication of change requests. In the future, etcd may offer granular access control, but that granularity will require an administrator to understand the schema of the data to properly apply security. An administrator must be able to properly secure Kubernetes at a policy level, rather than at an implementation level, and schema changes over time should not risk unintended security leaks. - -Both the Kubelet and Kube Proxy need information related to their specific roles - for the Kubelet, the set of pods it should be running, and for the Proxy, the set of services and endpoints to load balance. The Kubelet also needs to provide information about running pods and historical termination data. The access pattern for both Kubelet and Proxy to load their configuration is an efficient "wait for changes" request over HTTP. It should be possible to limit the Kubelet and Proxy to only access the information they need to perform their roles and no more. - -The controller manager for Replication Controllers and other future controllers act on behalf of a user via delegation to perform automated maintenance on Kubernetes resources. Their ability to access or modify resource state should be strictly limited to their intended duties and they should be prevented from accessing information not pertinent to their role. For example, a replication controller needs only to create a copy of a known pod configuration, to determine the running state of an existing pod, or to delete an existing pod that it created - it does not need to know the contents or current state of a pod, nor have access to any data in the pods attached volumes. - -The Kubernetes pod scheduler is responsible for reading data from the pod to fit it onto a node in the cluster. At a minimum, it needs access to view the ID of a pod (to craft the binding), its current state, any resource information necessary to identify placement, and other data relevant to concerns like anti-affinity, zone or region preference, or custom logic. It does not need the ability to modify pods or see other resources, only to create bindings. It should not need the ability to delete bindings unless the scheduler takes control of relocating components on failed hosts (which could be implemented by a separate component that can delete bindings but not create them). The scheduler may need read access to user or project-container information to determine preferential location (underspecified at this time). - - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/design/security.md?pixel)]() - diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/design/security_context.md b/Godeps/_workspace/src/k8s.io/kubernetes/docs/design/security_context.md deleted file mode 100644 index 6ee426c5d5af..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/design/security_context.md +++ /dev/null @@ -1,200 +0,0 @@ - - - - -WARNING -WARNING -WARNING -WARNING -WARNING - -

    PLEASE NOTE: This document applies to the HEAD of the source tree

    - -If you are using a released version of Kubernetes, you should -refer to the docs that go with that version. - - -The latest 1.0.x release of this document can be found -[here](http://releases.k8s.io/release-1.0/docs/design/security_context.md). - -Documentation for other releases can be found at -[releases.k8s.io](http://releases.k8s.io). - --- - - - - - -# Security Contexts - -## Abstract - -A security context is a set of constraints that are applied to a container in order to achieve the following goals (from [security design](security.md)): - -1. Ensure a clear isolation between container and the underlying host it runs on -2. Limit the ability of the container to negatively impact the infrastructure or other containers - -## Background - -The problem of securing containers in Kubernetes has come up [before](https://k8s.io/kubernetes/issues/398) and the potential problems with container security are [well known](http://opensource.com/business/14/7/docker-security-selinux). Although it is not possible to completely isolate Docker containers from their hosts, new features like [user namespaces](https://github.com/docker/libcontainer/pull/304) make it possible to greatly reduce the attack surface. - -## Motivation - -### Container isolation - -In order to improve container isolation from host and other containers running on the host, containers should only be -granted the access they need to perform their work. To this end it should be possible to take advantage of Docker -features such as the ability to [add or remove capabilities](https://docs.docker.com/reference/run/#runtime-privilege-linux-capabilities-and-lxc-configuration) and [assign MCS labels](https://docs.docker.com/reference/run/#security-configuration) -to the container process. - -Support for user namespaces has recently been [merged](https://github.com/docker/libcontainer/pull/304) into Docker's libcontainer project and should soon surface in Docker itself. It will make it possible to assign a range of unprivileged uids and gids from the host to each container, improving the isolation between host and container and between containers. - -### External integration with shared storage - -In order to support external integration with shared storage, processes running in a Kubernetes cluster -should be able to be uniquely identified by their Unix UID, such that a chain of ownership can be established. -Processes in pods will need to have consistent UID/GID/SELinux category labels in order to access shared disks. - -## Constraints and Assumptions - -* It is out of the scope of this document to prescribe a specific set - of constraints to isolate containers from their host. Different use cases need different - settings. -* The concept of a security context should not be tied to a particular security mechanism or platform - (ie. SELinux, AppArmor) -* Applying a different security context to a scope (namespace or pod) requires a solution such as the one proposed for - [service accounts](service_accounts.md). - -## Use Cases - -In order of increasing complexity, following are example use cases that would -be addressed with security contexts: - -1. Kubernetes is used to run a single cloud application. In order to protect - nodes from containers: - * All containers run as a single non-root user - * Privileged containers are disabled - * All containers run with a particular MCS label - * Kernel capabilities like CHOWN and MKNOD are removed from containers - -2. Just like case #1, except that I have more than one application running on - the Kubernetes cluster. - * Each application is run in its own namespace to avoid name collisions - * For each application a different uid and MCS label is used - -3. Kubernetes is used as the base for a PAAS with - multiple projects, each project represented by a namespace. - * Each namespace is associated with a range of uids/gids on the node that - are mapped to uids/gids on containers using linux user namespaces. - * Certain pods in each namespace have special privileges to perform system - actions such as talking back to the server for deployment, run docker - builds, etc. - * External NFS storage is assigned to each namespace and permissions set - using the range of uids/gids assigned to that namespace. - -## Proposed Design - -### Overview - -A *security context* consists of a set of constraints that determine how a container -is secured before getting created and run. A security context resides on the container and represents the runtime parameters that will -be used to create and run the container via container APIs. A *security context provider* is passed to the Kubelet so it can have a chance -to mutate Docker API calls in order to apply the security context. - -It is recommended that this design be implemented in two phases: - -1. Implement the security context provider extension point in the Kubelet - so that a default security context can be applied on container run and creation. -2. Implement a security context structure that is part of a service account. The - default context provider can then be used to apply a security context based - on the service account associated with the pod. - -### Security Context Provider - -The Kubelet will have an interface that points to a `SecurityContextProvider`. The `SecurityContextProvider` is invoked before creating and running a given container: - -```go -type SecurityContextProvider interface { - // ModifyContainerConfig is called before the Docker createContainer call. - // The security context provider can make changes to the Config with which - // the container is created. - // An error is returned if it's not possible to secure the container as - // requested with a security context. - ModifyContainerConfig(pod *api.Pod, container *api.Container, config *docker.Config) - - // ModifyHostConfig is called before the Docker runContainer call. - // The security context provider can make changes to the HostConfig, affecting - // security options, whether the container is privileged, volume binds, etc. - // An error is returned if it's not possible to secure the container as requested - // with a security context. - ModifyHostConfig(pod *api.Pod, container *api.Container, hostConfig *docker.HostConfig) -} -``` - -If the value of the SecurityContextProvider field on the Kubelet is nil, the kubelet will create and run the container as it does today. - -### Security Context - -A security context resides on the container and represents the runtime parameters that will -be used to create and run the container via container APIs. Following is an example of an initial implementation: - -```go -type type Container struct { - ... other fields omitted ... - // Optional: SecurityContext defines the security options the pod should be run with - SecurityContext *SecurityContext -} - -// SecurityContext holds security configuration that will be applied to a container. SecurityContext -// contains duplication of some existing fields from the Container resource. These duplicate fields -// will be populated based on the Container configuration if they are not set. Defining them on -// both the Container AND the SecurityContext will result in an error. -type SecurityContext struct { - // Capabilities are the capabilities to add/drop when running the container - Capabilities *Capabilities - - // Run the container in privileged mode - Privileged *bool - - // SELinuxOptions are the labels to be applied to the container - // and volumes - SELinuxOptions *SELinuxOptions - - // RunAsUser is the UID to run the entrypoint of the container process. - RunAsUser *int64 -} - -// SELinuxOptions are the labels to be applied to the container. -type SELinuxOptions struct { - // SELinux user label - User string - - // SELinux role label - Role string - - // SELinux type label - Type string - - // SELinux level label. - Level string -} -``` - -### Admission - -It is up to an admission plugin to determine if the security context is acceptable or not. At the -time of writing, the admission control plugin for security contexts will only allow a context that -has defined capabilities or privileged. Contexts that attempt to define a UID or SELinux options -will be denied by default. In the future the admission plugin will base this decision upon -configurable policies that reside within the [service account](https://k8s.io/kubernetes/pull/2297). - - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/design/security_context.md?pixel)]() - diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/design/service_accounts.md b/Godeps/_workspace/src/k8s.io/kubernetes/docs/design/service_accounts.md deleted file mode 100644 index 8e63e0454b58..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/design/service_accounts.md +++ /dev/null @@ -1,205 +0,0 @@ - - - - -WARNING -WARNING -WARNING -WARNING -WARNING - -

    PLEASE NOTE: This document applies to the HEAD of the source tree

    - -If you are using a released version of Kubernetes, you should -refer to the docs that go with that version. - - -The latest 1.0.x release of this document can be found -[here](http://releases.k8s.io/release-1.0/docs/design/service_accounts.md). - -Documentation for other releases can be found at -[releases.k8s.io](http://releases.k8s.io). - --- - - - - - -# Service Accounts - -## Motivation - -Processes in Pods may need to call the Kubernetes API. For example: - - scheduler - - replication controller - - node controller - - a map-reduce type framework which has a controller that then tries to make a dynamically determined number of workers and watch them - - continuous build and push system - - monitoring system - -They also may interact with services other than the Kubernetes API, such as: - - an image repository, such as docker -- both when the images are pulled to start the containers, and for writing - images in the case of pods that generate images. - - accessing other cloud services, such as blob storage, in the context of a large, integrated, cloud offering (hosted - or private). - - accessing files in an NFS volume attached to the pod - -## Design Overview - -A service account binds together several things: - - a *name*, understood by users, and perhaps by peripheral systems, for an identity - - a *principal* that can be authenticated and [authorized](../admin/authorization.md) - - a [security context](security_context.md), which defines the Linux Capabilities, User IDs, Groups IDs, and other - capabilities and controls on interaction with the file system and OS. - - a set of [secrets](secrets.md), which a container may use to - access various networked resources. - -## Design Discussion - -A new object Kind is added: - -```go -type ServiceAccount struct { - TypeMeta `json:",inline" yaml:",inline"` - ObjectMeta `json:"metadata,omitempty" yaml:"metadata,omitempty"` - - username string - securityContext ObjectReference // (reference to a securityContext object) - secrets []ObjectReference // (references to secret objects -} -``` - -The name ServiceAccount is chosen because it is widely used already (e.g. by Kerberos and LDAP) -to refer to this type of account. Note that it has no relation to Kubernetes Service objects. - -The ServiceAccount object does not include any information that could not be defined separately: - - username can be defined however users are defined. - - securityContext and secrets are only referenced and are created using the REST API. - -The purpose of the serviceAccount object is twofold: - - to bind usernames to securityContexts and secrets, so that the username can be used to refer succinctly - in contexts where explicitly naming securityContexts and secrets would be inconvenient - - to provide an interface to simplify allocation of new securityContexts and secrets. -These features are explained later. - -### Names - -From the standpoint of the Kubernetes API, a `user` is any principal which can authenticate to Kubernetes API. -This includes a human running `kubectl` on her desktop and a container in a Pod on a Node making API calls. - -There is already a notion of a username in Kubernetes, which is populated into a request context after authentication. -However, there is no API object representing a user. While this may evolve, it is expected that in mature installations, -the canonical storage of user identifiers will be handled by a system external to Kubernetes. - -Kubernetes does not dictate how to divide up the space of user identifier strings. User names can be -simple Unix-style short usernames, (e.g. `alice`), or may be qualified to allow for federated identity ( -`alice@example.com` vs `alice@example.org`.) Naming convention may distinguish service accounts from user -accounts (e.g. `alice@example.com` vs `build-service-account-a3b7f0@foo-namespace.service-accounts.example.com`), -but Kubernetes does not require this. - -Kubernetes also does not require that there be a distinction between human and Pod users. It will be possible -to setup a cluster where Alice the human talks to the Kubernetes API as username `alice` and starts pods that -also talk to the API as user `alice` and write files to NFS as user `alice`. But, this is not recommended. - -Instead, it is recommended that Pods and Humans have distinct identities, and reference implementations will -make this distinction. - -The distinction is useful for a number of reasons: - - the requirements for humans and automated processes are different: - - Humans need a wide range of capabilities to do their daily activities. Automated processes often have more narrowly-defined activities. - - Humans may better tolerate the exceptional conditions created by expiration of a token. Remembering to handle - this in a program is more annoying. So, either long-lasting credentials or automated rotation of credentials is - needed. - - A Human typically keeps credentials on a machine that is not part of the cluster and so not subject to automatic - management. A VM with a role/service-account can have its credentials automatically managed. - - the identity of a Pod cannot in general be mapped to a single human. - - If policy allows, it may be created by one human, and then updated by another, and another, until its behavior cannot be attributed to a single human. - -**TODO**: consider getting rid of separate serviceAccount object and just rolling its parts into the SecurityContext or -Pod Object. - -The `secrets` field is a list of references to /secret objects that an process started as that service account should -have access to be able to assert that role. - -The secrets are not inline with the serviceAccount object. This way, most or all users can have permission to `GET /serviceAccounts` so they can remind themselves -what serviceAccounts are available for use. - -Nothing will prevent creation of a serviceAccount with two secrets of type `SecretTypeKubernetesAuth`, or secrets of two -different types. Kubelet and client libraries will have some behavior, TBD, to handle the case of multiple secrets of a -given type (pick first or provide all and try each in order, etc). - -When a serviceAccount and a matching secret exist, then a `User.Info` for the serviceAccount and a `BearerToken` from the secret -are added to the map of tokens used by the authentication process in the apiserver, and similarly for other types. (We -might have some types that do not do anything on apiserver but just get pushed to the kubelet.) - -### Pods - -The `PodSpec` is extended to have a `Pods.Spec.ServiceAccountUsername` field. If this is unset, then a -default value is chosen. If it is set, then the corresponding value of `Pods.Spec.SecurityContext` is set by the -Service Account Finalizer (see below). - -TBD: how policy limits which users can make pods with which service accounts. - -### Authorization - -Kubernetes API Authorization Policies refer to users. Pods created with a `Pods.Spec.ServiceAccountUsername` typically -get a `Secret` which allows them to authenticate to the Kubernetes APIserver as a particular user. So any -policy that is desired can be applied to them. - -A higher level workflow is needed to coordinate creation of serviceAccounts, secrets and relevant policy objects. -Users are free to extend Kubernetes to put this business logic wherever is convenient for them, though the -Service Account Finalizer is one place where this can happen (see below). - -### Kubelet - -The kubelet will treat as "not ready to run" (needing a finalizer to act on it) any Pod which has an empty -SecurityContext. - -The kubelet will set a default, restrictive, security context for any pods created from non-Apiserver config -sources (http, file). - -Kubelet watches apiserver for secrets which are needed by pods bound to it. - -**TODO**: how to only let kubelet see secrets it needs to know. - -### The service account finalizer - -There are several ways to use Pods with SecurityContexts and Secrets. - -One way is to explicitly specify the securityContext and all secrets of a Pod when the pod is initially created, -like this: - -**TODO**: example of pod with explicit refs. - -Another way is with the *Service Account Finalizer*, a plugin process which is optional, and which handles -business logic around service accounts. - -The Service Account Finalizer watches Pods, Namespaces, and ServiceAccount definitions. - -First, if it finds pods which have a `Pod.Spec.ServiceAccountUsername` but no `Pod.Spec.SecurityContext` set, -then it copies in the referenced securityContext and secrets references for the corresponding `serviceAccount`. - -Second, if ServiceAccount definitions change, it may take some actions. -**TODO**: decide what actions it takes when a serviceAccount definition changes. Does it stop pods, or just -allow someone to list ones that are out of spec? In general, people may want to customize this? - -Third, if a new namespace is created, it may create a new serviceAccount for that namespace. This may include -a new username (e.g. `NAMESPACE-default-service-account@serviceaccounts.$CLUSTERID.kubernetes.io`), a new -securityContext, a newly generated secret to authenticate that serviceAccount to the Kubernetes API, and default -policies for that service account. -**TODO**: more concrete example. What are typical default permissions for default service account (e.g. readonly access -to services in the same namespace and read-write access to events in that namespace?) - -Finally, it may provide an interface to automate creation of new serviceAccounts. In that case, the user may want -to GET serviceAccounts to see what has been created. - - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/design/service_accounts.md?pixel)]() - diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/design/simple-rolling-update.md b/Godeps/_workspace/src/k8s.io/kubernetes/docs/design/simple-rolling-update.md deleted file mode 100644 index 720f4cbf4e5b..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/design/simple-rolling-update.md +++ /dev/null @@ -1,137 +0,0 @@ - - - - -WARNING -WARNING -WARNING -WARNING -WARNING - -

    PLEASE NOTE: This document applies to the HEAD of the source tree

    - -If you are using a released version of Kubernetes, you should -refer to the docs that go with that version. - - -The latest 1.0.x release of this document can be found -[here](http://releases.k8s.io/release-1.0/docs/design/simple-rolling-update.md). - -Documentation for other releases can be found at -[releases.k8s.io](http://releases.k8s.io). - --- - - - - - -## Simple rolling update - -This is a lightweight design document for simple [rolling update](../user-guide/kubectl/kubectl_rolling-update.md) in `kubectl`. - -Complete execution flow can be found [here](#execution-details). See the [example of rolling update](../user-guide/update-demo/) for more information. - -### Lightweight rollout - -Assume that we have a current replication controller named `foo` and it is running image `image:v1` - -`kubectl rolling-update foo [foo-v2] --image=myimage:v2` - -If the user doesn't specify a name for the 'next' replication controller, then the 'next' replication controller is renamed to -the name of the original replication controller. - -Obviously there is a race here, where if you kill the client between delete foo, and creating the new version of 'foo' you might be surprised about what is there, but I think that's ok. -See [Recovery](#recovery) below - -If the user does specify a name for the 'next' replication controller, then the 'next' replication controller is retained with its existing name, -and the old 'foo' replication controller is deleted. For the purposes of the rollout, we add a unique-ifying label `kubernetes.io/deployment` to both the `foo` and `foo-next` replication controllers. -The value of that label is the hash of the complete JSON representation of the`foo-next` or`foo` replication controller. The name of this label can be overridden by the user with the `--deployment-label-key` flag. - -#### Recovery - -If a rollout fails or is terminated in the middle, it is important that the user be able to resume the roll out. -To facilitate recovery in the case of a crash of the updating process itself, we add the following annotations to each replication controller in the `kubernetes.io/` annotation namespace: - * `desired-replicas` The desired number of replicas for this replication controller (either N or zero) - * `update-partner` A pointer to the replication controller resource that is the other half of this update (syntax `` the namespace is assumed to be identical to the namespace of this replication controller.) - -Recovery is achieved by issuing the same command again: - -```sh -kubectl rolling-update foo [foo-v2] --image=myimage:v2 -``` - -Whenever the rolling update command executes, the kubectl client looks for replication controllers called `foo` and `foo-next`, if they exist, an attempt is -made to roll `foo` to `foo-next`. If `foo-next` does not exist, then it is created, and the rollout is a new rollout. If `foo` doesn't exist, then -it is assumed that the rollout is nearly completed, and `foo-next` is renamed to `foo`. Details of the execution flow are given below. - - -### Aborting a rollout - -Abort is assumed to want to reverse a rollout in progress. - -`kubectl rolling-update foo [foo-v2] --rollback` - -This is really just semantic sugar for: - -`kubectl rolling-update foo-v2 foo` - -With the added detail that it moves the `desired-replicas` annotation from `foo-v2` to `foo` - - -### Execution Details - -For the purposes of this example, assume that we are rolling from `foo` to `foo-next` where the only change is an image update from `v1` to `v2` - -If the user doesn't specify a `foo-next` name, then it is either discovered from the `update-partner` annotation on `foo`. If that annotation doesn't exist, -then `foo-next` is synthesized using the pattern `-` - -#### Initialization - - * If `foo` and `foo-next` do not exist: - * Exit, and indicate an error to the user, that the specified controller doesn't exist. - * If `foo` exists, but `foo-next` does not: - * Create `foo-next` populate it with the `v2` image, set `desired-replicas` to `foo.Spec.Replicas` - * Goto Rollout - * If `foo-next` exists, but `foo` does not: - * Assume that we are in the rename phase. - * Goto Rename - * If both `foo` and `foo-next` exist: - * Assume that we are in a partial rollout - * If `foo-next` is missing the `desired-replicas` annotation - * Populate the `desired-replicas` annotation to `foo-next` using the current size of `foo` - * Goto Rollout - -#### Rollout - - * While size of `foo-next` < `desired-replicas` annotation on `foo-next` - * increase size of `foo-next` - * if size of `foo` > 0 - decrease size of `foo` - * Goto Rename - -#### Rename - - * delete `foo` - * create `foo` that is identical to `foo-next` - * delete `foo-next` - -#### Abort - - * If `foo-next` doesn't exist - * Exit and indicate to the user that they may want to simply do a new rollout with the old version - * If `foo` doesn't exist - * Exit and indicate not found to the user - * Otherwise, `foo-next` and `foo` both exist - * Set `desired-replicas` annotation on `foo` to match the annotation on `foo-next` - * Goto Rollout with `foo` and `foo-next` trading places. - - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/design/simple-rolling-update.md?pixel)]() - diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/design/versioning.md b/Godeps/_workspace/src/k8s.io/kubernetes/docs/design/versioning.md deleted file mode 100644 index 9009dc59c096..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/design/versioning.md +++ /dev/null @@ -1,82 +0,0 @@ - - - - -WARNING -WARNING -WARNING -WARNING -WARNING - -

    PLEASE NOTE: This document applies to the HEAD of the source tree

    - -If you are using a released version of Kubernetes, you should -refer to the docs that go with that version. - - -The latest 1.0.x release of this document can be found -[here](http://releases.k8s.io/release-1.0/docs/design/versioning.md). - -Documentation for other releases can be found at -[releases.k8s.io](http://releases.k8s.io). - --- - - - - - -# Kubernetes API and Release Versioning - -Legend: - -* **Kube <major>.<minor>.<patch>** refers to the version of Kubernetes that is released. This versions all components: apiserver, kubelet, kubectl, etc. -* **API vX[betaY]** refers to the version of the HTTP API. - -## Release Timeline - -### Minor version scheme and timeline - -* Kube 1.0.0, 1.0.1 -- DONE! -* Kube 1.0.X (X>1): Standard operating procedure. We patch the release-1.0 branch as needed and increment the patch number. -* Kube 1.1.0-alpha.X: Released roughly every two weeks by cutting from HEAD. No cherrypick releases. If there is a critical bugfix, a new release from HEAD can be created ahead of schedule. (This applies to the beta releases as well.) -* Kube 1.1.0-beta.X: When HEAD is feature-complete, we go into code freeze 2 weeks prior to the desired 1.1.0 date and only merge PRs essential to 1.1. Releases continue to be cut from HEAD until we're essentially done. -* Kube 1.1.0: Final release. Should occur between 3 and 4 months after 1.0. - -### Major version timeline - -There is no mandated timeline for major versions. They only occur when we need to start the clock on deprecating features. A given major version should be the latest major version for at least one year from its original release date. - -## Release versions as related to API versions - -Here is an example major release cycle: - -* **Kube 1.0 should have API v1 without v1beta\* API versions** - * The last version of Kube before 1.0 (e.g. 0.14 or whatever it is) will have the stable v1 API. This enables you to migrate all your objects off of the beta API versions of the API and allows us to remove those beta API versions in Kube 1.0 with no effect. There will be tooling to help you detect and migrate any v1beta\* data versions or calls to v1 before you do the upgrade. -* **Kube 1.x may have API v2beta*** - * The first incarnation of a new (backwards-incompatible) API in HEAD is v2beta1. By default this will be unregistered in apiserver, so it can change freely. Once it is available by default in apiserver (which may not happen for several minor releases), it cannot change ever again because we serialize objects in versioned form, and we always need to be able to deserialize any objects that are saved in etcd, even between alpha versions. If further changes to v2beta1 need to be made, v2beta2 is created, and so on, in subsequent 1.x versions. -* **Kube 1.y (where y is the last version of the 1.x series) must have final API v2** - * Before Kube 2.0 is cut, API v2 must be released in 1.x. This enables two things: (1) users can upgrade to API v2 when running Kube 1.x and then switch over to Kube 2.x transparently, and (2) in the Kube 2.0 release itself we can cleanup and remove all API v2beta\* versions because no one should have v2beta\* objects left in their database. As mentioned above, tooling will exist to make sure there are no calls or references to a given API version anywhere inside someone's kube installation before someone upgrades. - * Kube 2.0 must include the v1 API, but Kube 3.0 must include the v2 API only. It *may* include the v1 API as well if the burden is not high - this will be determined on a per-major-version basis. - -## Rationale for API v2 being complete before v2.0's release - -It may seem a bit strange to complete the v2 API before v2.0 is released, but *adding* a v2 API is not a breaking change. *Removing* the v2beta\* APIs *is* a breaking change, which is what necessitates the major version bump. There are other ways to do this, but having the major release be the fresh start of that release's API without the baggage of its beta versions seems most intuitive out of the available options. - -# Upgrades - -* Users can upgrade from any Kube 1.x release to any other Kube 1.x release as a rolling upgrade across their cluster. (Rolling upgrade means being able to upgrade the master first, then one node at a time. See #4855 for details.) -* No hard breaking changes over version boundaries. - * For example, if a user is at Kube 1.x, we may require them to upgrade to Kube 1.x+y before upgrading to Kube 2.x. In others words, an upgrade across major versions (e.g. Kube 1.x to Kube 2.x) should effectively be a no-op and as graceful as an upgrade from Kube 1.x to Kube 1.x+1. But you can require someone to go from 1.x to 1.x+y before they go to 2.x. - -There is a separate question of how to track the capabilities of a kubelet to facilitate rolling upgrades. That is not addressed here. - - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/design/versioning.md?pixel)]() - diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/devel/README.md b/Godeps/_workspace/src/k8s.io/kubernetes/docs/devel/README.md deleted file mode 100644 index 267bca238ac9..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/devel/README.md +++ /dev/null @@ -1,110 +0,0 @@ - - - - -WARNING -WARNING -WARNING -WARNING -WARNING - -

    PLEASE NOTE: This document applies to the HEAD of the source tree

    - -If you are using a released version of Kubernetes, you should -refer to the docs that go with that version. - - -The latest 1.0.x release of this document can be found -[here](http://releases.k8s.io/release-1.0/docs/devel/README.md). - -Documentation for other releases can be found at -[releases.k8s.io](http://releases.k8s.io). - --- - - - - - -# Kubernetes Developer Guide - -The developer guide is for anyone wanting to either write code which directly accesses the -Kubernetes API, or to contribute directly to the Kubernetes project. -It assumes some familiarity with concepts in the [User Guide](../user-guide/README.md) and the [Cluster Admin -Guide](../admin/README.md). - - -## The process of developing and contributing code to the Kubernetes project - -* **On Collaborative Development** ([collab.md](collab.md)): Info on pull requests and code reviews. - -* **GitHub Issues** ([issues.md](issues.md)): How incoming issues are reviewed and prioritized. - -* **Pull Request Process** ([pull-requests.md](pull-requests.md)): When and why pull requests are closed. - -* **Faster PR reviews** ([faster_reviews.md](faster_reviews.md)): How to get faster PR reviews. - -* **Getting Recent Builds** ([getting-builds.md](getting-builds.md)): How to get recent builds including the latest builds that pass CI. - - -## Setting up your dev environment, coding, and debugging - -* **Development Guide** ([development.md](development.md)): Setting up your development environment. - -* **Hunting flaky tests** ([flaky-tests.md](flaky-tests.md)): We have a goal of 99.9% flake free tests. - Here's how to run your tests many times. - -* **Logging Conventions** ([logging.md](logging.md)]: Glog levels. - -* **Profiling Kubernetes** ([profiling.md](profiling.md)): How to plug in go pprof profiler to Kubernetes. - -* **Instrumenting Kubernetes with a new metric** - ([instrumentation.md](instrumentation.md)): How to add a new metrics to the - Kubernetes code base. - -* **Coding Conventions** ([coding-conventions.md](coding-conventions.md)): - Coding style advice for contributors. - - -## Developing against the Kubernetes API - -* API objects are explained at [http://kubernetes.io/third_party/swagger-ui/](http://kubernetes.io/third_party/swagger-ui/). - -* **Annotations** ([docs/user-guide/annotations.md](../user-guide/annotations.md)): are for attaching arbitrary non-identifying metadata to objects. - Programs that automate Kubernetes objects may use annotations to store small amounts of their state. - -* **API Conventions** ([api-conventions.md](api-conventions.md)): - Defining the verbs and resources used in the Kubernetes API. - -* **API Client Libraries** ([client-libraries.md](client-libraries.md)): - A list of existing client libraries, both supported and user-contributed. - - -## Writing plugins - -* **Authentication Plugins** ([docs/admin/authentication.md](../admin/authentication.md)): - The current and planned states of authentication tokens. - -* **Authorization Plugins** ([docs/admin/authorization.md](../admin/authorization.md)): - Authorization applies to all HTTP requests on the main apiserver port. - This doc explains the available authorization implementations. - -* **Admission Control Plugins** ([admission_control](../design/admission_control.md)) - - -## Building releases - -* **Making release notes** ([making-release-notes.md](making-release-notes.md)): Generating release nodes for a new release. - -* **Releasing Kubernetes** ([releasing.md](releasing.md)): How to create a Kubernetes release (as in version) - and how the version information gets embedded into the built binaries. - - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/devel/README.md?pixel)]() - diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/devel/api-conventions.md b/Godeps/_workspace/src/k8s.io/kubernetes/docs/devel/api-conventions.md deleted file mode 100644 index f2558cbb02c1..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/devel/api-conventions.md +++ /dev/null @@ -1,654 +0,0 @@ - - - - -WARNING -WARNING -WARNING -WARNING -WARNING - -

    PLEASE NOTE: This document applies to the HEAD of the source tree

    - -If you are using a released version of Kubernetes, you should -refer to the docs that go with that version. - - -The latest 1.0.x release of this document can be found -[here](http://releases.k8s.io/release-1.0/docs/devel/api-conventions.md). - -Documentation for other releases can be found at -[releases.k8s.io](http://releases.k8s.io). - --- - - - - -API Conventions -=============== - -Updated: 4/16/2015 - -*This document is oriented at users who want a deeper understanding of the Kubernetes -API structure, and developers wanting to extend the Kubernetes API. An introduction to -using resources with kubectl can be found in (working_with_resources.md).* - -**Table of Contents** - - - - [Types (Kinds)](#types-kinds) - - [Resources](#resources) - - [Objects](#objects) - - [Metadata](#metadata) - - [Spec and Status](#spec-and-status) - - [Typical status properties](#typical-status-properties) - - [References to related objects](#references-to-related-objects) - - [Lists of named subobjects preferred over maps](#lists-of-named-subobjects-preferred-over-maps) - - [Constants](#constants) - - [Lists and Simple kinds](#lists-and-simple-kinds) - - [Differing Representations](#differing-representations) - - [Verbs on Resources](#verbs-on-resources) - - [PATCH operations](#patch-operations) - - [Strategic Merge Patch](#strategic-merge-patch) - - [List Operations](#list-operations) - - [Map Operations](#map-operations) - - [Idempotency](#idempotency) - - [Defaulting](#defaulting) - - [Late Initialization](#late-initialization) - - [Concurrency Control and Consistency](#concurrency-control-and-consistency) - - [Serialization Format](#serialization-format) - - [Units](#units) - - [Selecting Fields](#selecting-fields) - - [HTTP Status codes](#http-status-codes) - - [Success codes](#success-codes) - - [Error codes](#error-codes) - - [Response Status Kind](#response-status-kind) - - [Events](#events) - - - -The conventions of the [Kubernetes API](../api.md) (and related APIs in the ecosystem) are intended to ease client development and ensure that configuration mechanisms can be implemented that work across a diverse set of use cases consistently. - -The general style of the Kubernetes API is RESTful - clients create, update, delete, or retrieve a description of an object via the standard HTTP verbs (POST, PUT, DELETE, and GET) - and those APIs preferentially accept and return JSON. Kubernetes also exposes additional endpoints for non-standard verbs and allows alternative content types. All of the JSON accepted and returned by the server has a schema, identified by the "kind" and "apiVersion" fields. Where relevant HTTP header fields exist, they should mirror the content of JSON fields, but the information should not be represented only in the HTTP header. - -The following terms are defined: - -* **Kind** the name of a particular object schema (e.g. the "Cat" and "Dog" kinds would have different attributes and properties) -* **Resource** a representation of a system entity, sent or retrieved as JSON via HTTP to the server. Resources are exposed via: - * Collections - a list of resources of the same type, which may be queryable - * Elements - an individual resource, addressable via a URL - -Each resource typically accepts and returns data of a single kind. A kind may be accepted or returned by multiple resources that reflect specific use cases. For instance, the kind "pod" is exposed as a "pods" resource that allows end users to create, update, and delete pods, while a separate "pod status" resource (that acts on "pod" kind) allows automated processes to update a subset of the fields in that resource. A "restart" resource might be exposed for a number of different resources to allow the same action to have different results for each object. - -Resource collections should be all lowercase and plural, whereas kinds are CamelCase and singular. - - -## Types (Kinds) - -Kinds are grouped into three categories: - -1. **Objects** represent a persistent entity in the system. - - Creating an API object is a record of intent - once created, the system will work to ensure that resource exists. All API objects have common metadata. - - An object may have multiple resources that clients can use to perform specific actions that create, update, delete, or get. - - Examples: `Pods`, `ReplicationControllers`, `Services`, `Namespaces`, `Nodes` - -2. **Lists** are collections of **resources** of one (usually) or more (occasionally) kinds. - - Lists have a limited set of common metadata. All lists use the "items" field to contain the array of objects they return. - - Most objects defined in the system should have an endpoint that returns the full set of resources, as well as zero or more endpoints that return subsets of the full list. Some objects may be singletons (the current user, the system defaults) and may not have lists. - - In addition, all lists that return objects with labels should support label filtering (see [docs/user-guide/labels.md](../user-guide/labels.md), and most lists should support filtering by fields. - - Examples: PodLists, ServiceLists, NodeLists - - TODO: Describe field filtering below or in a separate doc. - -3. **Simple** kinds are used for specific actions on objects and for non-persistent entities. - - Given their limited scope, they have the same set of limited common metadata as lists. - - The "size" action may accept a simple resource that has only a single field as input (the number of things). The "status" kind is returned when errors occur and is not persisted in the system. - - Examples: Binding, Status - -The standard REST verbs (defined below) MUST return singular JSON objects. Some API endpoints may deviate from the strict REST pattern and return resources that are not singular JSON objects, such as streams of JSON objects or unstructured text log data. - -The term "kind" is reserved for these "top-level" API types. The term "type" should be used for distinguishing sub-categories within objects or subobjects. - -### Resources - -All JSON objects returned by an API MUST have the following fields: - -* kind: a string that identifies the schema this object should have -* apiVersion: a string that identifies the version of the schema the object should have - -These fields are required for proper decoding of the object. They may be populated by the server by default from the specified URL path, but the client likely needs to know the values in order to construct the URL path. - -### Objects - -#### Metadata - -Every object kind MUST have the following metadata in a nested object field called "metadata": - -* namespace: a namespace is a DNS compatible subdomain that objects are subdivided into. The default namespace is 'default'. See [docs/user-guide/namespaces.md](../user-guide/namespaces.md) for more. -* name: a string that uniquely identifies this object within the current namespace (see [docs/user-guide/identifiers.md](../user-guide/identifiers.md)). This value is used in the path when retrieving an individual object. -* uid: a unique in time and space value (typically an RFC 4122 generated identifier, see [docs/user-guide/identifiers.md](../user-guide/identifiers.md)) used to distinguish between objects with the same name that have been deleted and recreated - -Every object SHOULD have the following metadata in a nested object field called "metadata": - -* resourceVersion: a string that identifies the internal version of this object that can be used by clients to determine when objects have changed. This value MUST be treated as opaque by clients and passed unmodified back to the server. Clients should not assume that the resource version has meaning across namespaces, different kinds of resources, or different servers. (see [concurrency control](#concurrency-control-and-consistency), below, for more details) -* creationTimestamp: a string representing an RFC 3339 date of the date and time an object was created -* deletionTimestamp: a string representing an RFC 3339 date of the date and time after which this resource will be deleted. This field is set by the server when a graceful deletion is requested by the user, and is not directly settable by a client. The resource will be deleted (no longer visible from resource lists, and not reachable by name) after the time in this field. Once set, this value may not be unset or be set further into the future, although it may be shortened or the resource may be deleted prior to this time. -* labels: a map of string keys and values that can be used to organize and categorize objects (see [docs/user-guide/labels.md](../user-guide/labels.md)) -* annotations: a map of string keys and values that can be used by external tooling to store and retrieve arbitrary metadata about this object (see [docs/user-guide/annotations.md](../user-guide/annotations.md)) - -Labels are intended for organizational purposes by end users (select the pods that match this label query). Annotations enable third-party automation and tooling to decorate objects with additional metadata for their own use. - -#### Spec and Status - -By convention, the Kubernetes API makes a distinction between the specification of the desired state of an object (a nested object field called "spec") and the status of the object at the current time (a nested object field called "status"). The specification is a complete description of the desired state, including configuration settings provided by the user, [default values](#defaulting) expanded by the system, and properties initialized or otherwise changed after creation by other ecosystem components (e.g., schedulers, auto-scalers), and is persisted in stable storage with the API object. If the specification is deleted, the object will be purged from the system. The status summarizes the current state of the object in the system, and is usually persisted with the object by an automated processes but may be generated on the fly. At some cost and perhaps some temporary degradation in behavior, the status could be reconstructed by observation if it were lost. - -When a new version of an object is POSTed or PUT, the "spec" is updated and available immediately. Over time the system will work to bring the "status" into line with the "spec". The system will drive toward the most recent "spec" regardless of previous versions of that stanza. In other words, if a value is changed from 2 to 5 in one PUT and then back down to 3 in another PUT the system is not required to 'touch base' at 5 before changing the "status" to 3. In other words, the system's behavior is *level-based* rather than *edge-based*. This enables robust behavior in the presence of missed intermediate state changes. - -The Kubernetes API also serves as the foundation for the declarative configuration schema for the system. In order to facilitate level-based operation and expression of declarative configuration, fields in the specification should have declarative rather than imperative names and semantics -- they represent the desired state, not actions intended to yield the desired state. - -The PUT and POST verbs on objects will ignore the "status" values. A `/status` subresource is provided to enable system components to update statuses of resources they manage. - -Otherwise, PUT expects the whole object to be specified. Therefore, if a field is omitted it is assumed that the client wants to clear that field's value. The PUT verb does not accept partial updates. Modification of just part of an object may be achieved by GETting the resource, modifying part of the spec, labels, or annotations, and then PUTting it back. See [concurrency control](#concurrency-control-and-consistency), below, regarding read-modify-write consistency when using this pattern. Some objects may expose alternative resource representations that allow mutation of the status, or performing custom actions on the object. - -All objects that represent a physical resource whose state may vary from the user's desired intent SHOULD have a "spec" and a "status". Objects whose state cannot vary from the user's desired intent MAY have only "spec", and MAY rename "spec" to a more appropriate name. - -Objects that contain both spec and status should not contain additional top-level fields other than the standard metadata fields. - -##### Typical status properties - -* **phase**: The phase is a simple, high-level summary of the phase of the lifecycle of an object. The phase should progress monotonically. Typical phase values are `Pending` (not yet fully physically realized), `Running` or `Active` (fully realized and active, but not necessarily operating correctly), and `Terminated` (no longer active), but may vary slightly for different types of objects. New phase values should not be added to existing objects in the future. Like other status fields, it must be possible to ascertain the lifecycle phase by observation. Additional details regarding the current phase may be contained in other fields. -* **conditions**: Conditions represent orthogonal observations of an object's current state. Objects may report multiple conditions, and new types of conditions may be added in the future. Condition status values may be `True`, `False`, or `Unknown`. Unlike the phase, conditions are not expected to be monotonic -- their values may change back and forth. A typical condition type is `Ready`, which indicates the object was believed to be fully operational at the time it was last probed. Conditions may carry additional information, such as the last probe time or last transition time. - -TODO(@vishh): Reason and Message. - -Phases and conditions are observations and not, themselves, state machines, nor do we define comprehensive state machines for objects with behaviors associated with state transitions. The system is level-based and should assume an Open World. Additionally, new observations and details about these observations may be added over time. - -In order to preserve extensibility, in the future, we intend to explicitly convey properties that users and components care about rather than requiring those properties to be inferred from observations. - -Note that historical information status (e.g., last transition time, failure counts) is only provided at best effort, and is not guaranteed to not be lost. - -Status information that may be large (especially unbounded in size, such as lists of references to other objects -- see below) and/or rapidly changing, such as [resource usage](../design/resources.md#usage-data), should be put into separate objects, with possibly a reference from the original object. This helps to ensure that GETs and watch remain reasonably efficient for the majority of clients, which may not need that data. - -#### References to related objects - -References to loosely coupled sets of objects, such as [pods](../user-guide/pods.md) overseen by a [replication controller](../user-guide/replication-controller.md), are usually best referred to using a [label selector](../user-guide/labels.md). In order to ensure that GETs of individual objects remain bounded in time and space, these sets may be queried via separate API queries, but will not be expanded in the referring object's status. - -References to specific objects, especially specific resource versions and/or specific fields of those objects, are specified using the `ObjectReference` type. Unlike partial URLs, the ObjectReference type facilitates flexible defaulting of fields from the referring object or other contextual information. - -References in the status of the referee to the referrer may be permitted, when the references are one-to-one and do not need to be frequently updated, particularly in an edge-based manner. - -#### Lists of named subobjects preferred over maps - -Discussed in [#2004](https://k8s.io/kubernetes/issues/2004) and elsewhere. There are no maps of subobjects in any API objects. Instead, the convention is to use a list of subobjects containing name fields. - -For example: - -```yaml -ports: - - name: www - containerPort: 80 -``` - -vs. - -```yaml -ports: - www: - containerPort: 80 -``` - -This rule maintains the invariant that all JSON/YAML keys are fields in API objects. The only exceptions are pure maps in the API (currently, labels, selectors, and annotations), as opposed to sets of subobjects. - -#### Constants - -Some fields will have a list of allowed values (enumerations). These values will be strings, and they will be in CamelCase, with an initial uppercase letter. Examples: "ClusterFirst", "Pending", "ClientIP". - -### Lists and Simple kinds - -Every list or simple kind SHOULD have the following metadata in a nested object field called "metadata": - -* resourceVersion: a string that identifies the common version of the objects returned by in a list. This value MUST be treated as opaque by clients and passed unmodified back to the server. A resource version is only valid within a single namespace on a single kind of resource. - -Every simple kind returned by the server, and any simple kind sent to the server that must support idempotency or optimistic concurrency should return this value.Since simple resources are often used as input alternate actions that modify objects, the resource version of the simple resource should correspond to the resource version of the object. - - -## Differing Representations - -An API may represent a single entity in different ways for different clients, or transform an object after certain transitions in the system occur. In these cases, one request object may have two representations available as different resources, or different kinds. - -An example is a Service, which represents the intent of the user to group a set of pods with common behavior on common ports. When Kubernetes detects a pod matches the service selector, the IP address and port of the pod are added to an Endpoints resource for that Service. The Endpoints resource exists only if the Service exists, but exposes only the IPs and ports of the selected pods. The full service is represented by two distinct resources - under the original Service resource the user created, as well as in the Endpoints resource. - -As another example, a "pod status" resource may accept a PUT with the "pod" kind, with different rules about what fields may be changed. - -Future versions of Kubernetes may allow alternative encodings of objects beyond JSON. - - -## Verbs on Resources - -API resources should use the traditional REST pattern: - -* GET /<resourceNamePlural> - Retrieve a list of type <resourceName>, e.g. GET /pods returns a list of Pods. -* POST /<resourceNamePlural> - Create a new resource from the JSON object provided by the client. -* GET /<resourceNamePlural>/<name> - Retrieves a single resource with the given name, e.g. GET /pods/first returns a Pod named 'first'. Should be constant time, and the resource should be bounded in size. -* DELETE /<resourceNamePlural>/<name> - Delete the single resource with the given name. DeleteOptions may specify gracePeriodSeconds, the optional duration in seconds before the object should be deleted. Individual kinds may declare fields which provide a default grace period, and different kinds may have differing kind-wide default grace periods. A user provided grace period overrides a default grace period, including the zero grace period ("now"). -* PUT /<resourceNamePlural>/<name> - Update or create the resource with the given name with the JSON object provided by the client. -* PATCH /<resourceNamePlural>/<name> - Selectively modify the specified fields of the resource. See more information [below](#patch). - -Kubernetes by convention exposes additional verbs as new root endpoints with singular names. Examples: - -* GET /watch/<resourceNamePlural> - Receive a stream of JSON objects corresponding to changes made to any resource of the given kind over time. -* GET /watch/<resourceNamePlural>/<name> - Receive a stream of JSON objects corresponding to changes made to the named resource of the given kind over time. - -These are verbs which change the fundamental type of data returned (watch returns a stream of JSON instead of a single JSON object). Support of additional verbs is not required for all object types. - -Two additional verbs `redirect` and `proxy` provide access to cluster resources as described in [docs/user-guide/accessing-the-cluster.md](../user-guide/accessing-the-cluster.md). - -When resources wish to expose alternative actions that are closely coupled to a single resource, they should do so using new sub-resources. An example is allowing automated processes to update the "status" field of a Pod. The `/pods` endpoint only allows updates to "metadata" and "spec", since those reflect end-user intent. An automated process should be able to modify status for users to see by sending an updated Pod kind to the server to the "/pods/<name>/status" endpoint - the alternate endpoint allows different rules to be applied to the update, and access to be appropriately restricted. Likewise, some actions like "stop" or "scale" are best represented as REST sub-resources that are POSTed to. The POST action may require a simple kind to be provided if the action requires parameters, or function without a request body. - -TODO: more documentation of Watch - -### PATCH operations - -The API supports three different PATCH operations, determined by their corresponding Content-Type header: - -* JSON Patch, `Content-Type: application/json-patch+json` - * As defined in [RFC6902](https://tools.ietf.org/html/rfc6902), a JSON Patch is a sequence of operations that are executed on the resource, e.g. `{"op": "add", "path": "/a/b/c", "value": [ "foo", "bar" ]}`. For more details on how to use JSON Patch, see the RFC. -* Merge Patch, `Content-Type: application/merge-json-patch+json` - * As defined in [RFC7386](https://tools.ietf.org/html/rfc7386), a Merge Patch is essentially a partial representation of the resource. The submitted JSON is "merged" with the current resource to create a new one, then the new one is saved. For more details on how to use Merge Patch, see the RFC. -* Strategic Merge Patch, `Content-Type: application/strategic-merge-patch+json` - * Strategic Merge Patch is a custom implementation of Merge Patch. For a detailed explanation of how it works and why it needed to be introduced, see below. - -#### Strategic Merge Patch - -In the standard JSON merge patch, JSON objects are always merged but lists are always replaced. Often that isn't what we want. Let's say we start with the following Pod: - -```yaml -spec: - containers: - - name: nginx - image: nginx-1.0 -``` - -...and we POST that to the server (as JSON). Then let's say we want to *add* a container to this Pod. - -```yaml -PATCH /api/v1/namespaces/default/pods/pod-name -spec: - containers: - - name: log-tailer - image: log-tailer-1.0 -``` - -If we were to use standard Merge Patch, the entire container list would be replaced with the single log-tailer container. However, our intent is for the container lists to merge together based on the `name` field. - -To solve this problem, Strategic Merge Patch uses metadata attached to the API objects to determine what lists should be merged and which ones should not. Currently the metadata is available as struct tags on the API objects themselves, but will become available to clients as Swagger annotations in the future. In the above example, the `patchStrategy` metadata for the `containers` field would be `merge` and the `patchMergeKey` would be `name`. - -Note: If the patch results in merging two lists of scalars, the scalars are first deduplicated and then merged. - -Strategic Merge Patch also supports special operations as listed below. - -### List Operations - -To override the container list to be strictly replaced, regardless of the default: - -```yaml -containers: - - name: nginx - image: nginx-1.0 - - $patch: replace # any further $patch operations nested in this list will be ignored -``` - -To delete an element of a list that should be merged: - -```yaml -containers: - - name: nginx - image: nginx-1.0 - - $patch: delete - name: log-tailer # merge key and value goes here -``` - -### Map Operations - -To indicate that a map should not be merged and instead should be taken literally: - -```yaml -$patch: replace # recursive and applies to all fields of the map it's in -containers: -- name: nginx - image: nginx-1.0 -``` - -To delete a field of a map: - -```yaml -name: nginx -image: nginx-1.0 -labels: - live: null # set the value of the map key to null -``` - - -## Idempotency - -All compatible Kubernetes APIs MUST support "name idempotency" and respond with an HTTP status code 409 when a request is made to POST an object that has the same name as an existing object in the system. See [docs/user-guide/identifiers.md](../user-guide/identifiers.md) for details. - -Names generated by the system may be requested using `metadata.generateName`. GenerateName indicates that the name should be made unique by the server prior to persisting it. A non-empty value for the field indicates the name will be made unique (and the name returned to the client will be different than the name passed). The value of this field will be combined with a unique suffix on the server if the Name field has not been provided. The provided value must be valid within the rules for Name, and may be truncated by the length of the suffix required to make the value unique on the server. If this field is specified, and Name is not present, the server will NOT return a 409 if the generated name exists - instead, it will either return 201 Created or 504 with Reason `ServerTimeout` indicating a unique name could not be found in the time allotted, and the client should retry (optionally after the time indicated in the Retry-After header). - -## Defaulting - -Default resource values are API version-specific, and they are applied during -the conversion from API-versioned declarative configuration to internal objects -representing the desired state (`Spec`) of the resource. Subsequent GETs of the -resource will include the default values explicitly. - -Incorporating the default values into the `Spec` ensures that `Spec` depicts the -full desired state so that it is easier for the system to determine how to -achieve the state, and for the user to know what to anticipate. - -API version-specific default values are set by the API server. - -## Late Initialization - -Late initialization is when resource fields are set by a system controller -after an object is created/updated. - -For example, the scheduler sets the `pod.spec.nodeName` field after the pod is created. - -Late-initializers should only make the following types of modifications: - - Setting previously unset fields - - Adding keys to maps - - Adding values to arrays which have mergeable semantics (`patchStrategy:"merge"` attribute in - the type definition). - -These conventions: - 1. allow a user (with sufficient privilege) to override any system-default behaviors by setting - the fields that would otherwise have been defaulted. - 1. enables updates from users to be merged with changes made during late initialization, using - strategic merge patch, as opposed to clobbering the change. - 1. allow the component which does the late-initialization to use strategic merge patch, which - facilitates composition and concurrency of such components. - -Although the apiserver Admission Control stage acts prior to object creation, -Admission Control plugins should follow the Late Initialization conventions -too, to allow their implementation to be later moved to a 'controller', or to client libraries. - -## Concurrency Control and Consistency - -Kubernetes leverages the concept of *resource versions* to achieve optimistic concurrency. All Kubernetes resources have a "resourceVersion" field as part of their metadata. This resourceVersion is a string that identifies the internal version of an object that can be used by clients to determine when objects have changed. When a record is about to be updated, it's version is checked against a pre-saved value, and if it doesn't match, the update fails with a StatusConflict (HTTP status code 409). - -The resourceVersion is changed by the server every time an object is modified. If resourceVersion is included with the PUT operation the system will verify that there have not been other successful mutations to the resource during a read/modify/write cycle, by verifying that the current value of resourceVersion matches the specified value. - -The resourceVersion is currently backed by [etcd's modifiedIndex](https://coreos.com/docs/distributed-configuration/etcd-api/). However, it's important to note that the application should *not* rely on the implementation details of the versioning system maintained by Kubernetes. We may change the implementation of resourceVersion in the future, such as to change it to a timestamp or per-object counter. - -The only way for a client to know the expected value of resourceVersion is to have received it from the server in response to a prior operation, typically a GET. This value MUST be treated as opaque by clients and passed unmodified back to the server. Clients should not assume that the resource version has meaning across namespaces, different kinds of resources, or different servers. Currently, the value of resourceVersion is set to match etcd's sequencer. You could think of it as a logical clock the API server can use to order requests. However, we expect the implementation of resourceVersion to change in the future, such as in the case we shard the state by kind and/or namespace, or port to another storage system. - -In the case of a conflict, the correct client action at this point is to GET the resource again, apply the changes afresh, and try submitting again. This mechanism can be used to prevent races like the following: - -``` -Client #1 Client #2 -GET Foo GET Foo -Set Foo.Bar = "one" Set Foo.Baz = "two" -PUT Foo PUT Foo -``` - -When these sequences occur in parallel, either the change to Foo.Bar or the change to Foo.Baz can be lost. - -On the other hand, when specifying the resourceVersion, one of the PUTs will fail, since whichever write succeeds changes the resourceVersion for Foo. - -resourceVersion may be used as a precondition for other operations (e.g., GET, DELETE) in the future, such as for read-after-write consistency in the presence of caching. - -"Watch" operations specify resourceVersion using a query parameter. It is used to specify the point at which to begin watching the specified resources. This may be used to ensure that no mutations are missed between a GET of a resource (or list of resources) and a subsequent Watch, even if the current version of the resource is more recent. This is currently the main reason that list operations (GET on a collection) return resourceVersion. - - -## Serialization Format - -APIs may return alternative representations of any resource in response to an Accept header or under alternative endpoints, but the default serialization for input and output of API responses MUST be JSON. - -All dates should be serialized as RFC3339 strings. - - -## Units - -Units must either be explicit in the field name (e.g., `timeoutSeconds`), or must be specified as part of the value (e.g., `resource.Quantity`). Which approach is preferred is TBD. - - -## Selecting Fields - -Some APIs may need to identify which field in a JSON object is invalid, or to reference a value to extract from a separate resource. The current recommendation is to use standard JavaScript syntax for accessing that field, assuming the JSON object was transformed into a JavaScript object. - -Examples: - -* Find the field "current" in the object "state" in the second item in the array "fields": `fields[0].state.current` - -TODO: Plugins, extensions, nested kinds, headers - - -## HTTP Status codes - -The server will respond with HTTP status codes that match the HTTP spec. See the section below for a breakdown of the types of status codes the server will send. - -The following HTTP status codes may be returned by the API. - -#### Success codes - -* `200 StatusOK` - * Indicates that the request completed successfully. -* `201 StatusCreated` - * Indicates that the request to create kind completed successfully. -* `204 StatusNoContent` - * Indicates that the request completed successfully, and the response contains no body. - * Returned in response to HTTP OPTIONS requests. - -#### Error codes - -* `307 StatusTemporaryRedirect` - * Indicates that the address for the requested resource has changed. - * Suggested client recovery behavior - * Follow the redirect. -* `400 StatusBadRequest` - * Indicates the requested is invalid. - * Suggested client recovery behavior: - * Do not retry. Fix the request. -* `401 StatusUnauthorized` - * Indicates that the server can be reached and understood the request, but refuses to take any further action, because the client must provide authorization. If the client has provided authorization, the server is indicating the provided authorization is unsuitable or invalid. - * Suggested client recovery behavior - * If the user has not supplied authorization information, prompt them for the appropriate credentials - * If the user has supplied authorization information, inform them their credentials were rejected and optionally prompt them again. -* `403 StatusForbidden` - * Indicates that the server can be reached and understood the request, but refuses to take any further action, because it is configured to deny access for some reason to the requested resource by the client. - * Suggested client recovery behavior - * Do not retry. Fix the request. -* `404 StatusNotFound` - * Indicates that the requested resource does not exist. - * Suggested client recovery behavior - * Do not retry. Fix the request. -* `405 StatusMethodNotAllowed` - * Indicates that the action the client attempted to perform on the resource was not supported by the code. - * Suggested client recovery behavior - * Do not retry. Fix the request. -* `409 StatusConflict` - * Indicates that either the resource the client attempted to create already exists or the requested update operation cannot be completed due to a conflict. - * Suggested client recovery behavior - * * If creating a new resource - * * Either change the identifier and try again, or GET and compare the fields in the pre-existing object and issue a PUT/update to modify the existing object. - * * If updating an existing resource: - * See `Conflict` from the `status` response section below on how to retrieve more information about the nature of the conflict. - * GET and compare the fields in the pre-existing object, merge changes (if still valid according to preconditions), and retry with the updated request (including `ResourceVersion`). -* `422 StatusUnprocessableEntity` - * Indicates that the requested create or update operation cannot be completed due to invalid data provided as part of the request. - * Suggested client recovery behavior - * Do not retry. Fix the request. -* `429 StatusTooManyRequests` - * Indicates that the either the client rate limit has been exceeded or the server has received more requests then it can process. - * Suggested client recovery behavior: - * Read the `Retry-After` HTTP header from the response, and wait at least that long before retrying. -* `500 StatusInternalServerError` - * Indicates that the server can be reached and understood the request, but either an unexpected internal error occurred and the outcome of the call is unknown, or the server cannot complete the action in a reasonable time (this maybe due to temporary server load or a transient communication issue with another server). - * Suggested client recovery behavior: - * Retry with exponential backoff. -* `503 StatusServiceUnavailable` - * Indicates that required service is unavailable. - * Suggested client recovery behavior: - * Retry with exponential backoff. -* `504 StatusServerTimeout` - * Indicates that the request could not be completed within the given time. Clients can get this response ONLY when they specified a timeout param in the request. - * Suggested client recovery behavior: - * Increase the value of the timeout param and retry with exponential backoff - -## Response Status Kind - -Kubernetes will always return the `Status` kind from any API endpoint when an error occurs. -Clients SHOULD handle these types of objects when appropriate. - -A `Status` kind will be returned by the API in two cases: - * When an operation is not successful (i.e. when the server would return a non 2xx HTTP status code). - * When a HTTP `DELETE` call is successful. - -The status object is encoded as JSON and provided as the body of the response. The status object contains fields for humans and machine consumers of the API to get more detailed information for the cause of the failure. The information in the status object supplements, but does not override, the HTTP status code's meaning. When fields in the status object have the same meaning as generally defined HTTP headers and that header is returned with the response, the header should be considered as having higher priority. - -**Example:** - -```console -$ curl -v -k -H "Authorization: Bearer WhCDvq4VPpYhrcfmF6ei7V9qlbqTubUc" https://10.240.122.184:443/api/v1/namespaces/default/pods/grafana - -> GET /api/v1/namespaces/default/pods/grafana HTTP/1.1 -> User-Agent: curl/7.26.0 -> Host: 10.240.122.184 -> Accept: */* -> Authorization: Bearer WhCDvq4VPpYhrcfmF6ei7V9qlbqTubUc -> - -< HTTP/1.1 404 Not Found -< Content-Type: application/json -< Date: Wed, 20 May 2015 18:10:42 GMT -< Content-Length: 232 -< -{ - "kind": "Status", - "apiVersion": "v1", - "metadata": {}, - "status": "Failure", - "message": "pods \"grafana\" not found", - "reason": "NotFound", - "details": { - "name": "grafana", - "kind": "pods" - }, - "code": 404 -} -``` - -`status` field contains one of two possible values: -* `Success` -* `Failure` - -`message` may contain human-readable description of the error - -`reason` may contain a machine-readable description of why this operation is in the `Failure` status. If this value is empty there is no information available. The `reason` clarifies an HTTP status code but does not override it. - -`details` may contain extended data associated with the reason. Each reason may define its own extended details. This field is optional and the data returned is not guaranteed to conform to any schema except that defined by the reason type. - -Possible values for the `reason` and `details` fields: -* `BadRequest` - * Indicates that the request itself was invalid, because the request doesn't make any sense, for example deleting a read-only object. - * This is different than `status reason` `Invalid` above which indicates that the API call could possibly succeed, but the data was invalid. - * API calls that return BadRequest can never succeed. - * Http status code: `400 StatusBadRequest` -* `Unauthorized` - * Indicates that the server can be reached and understood the request, but refuses to take any further action without the client providing appropriate authorization. If the client has provided authorization, this error indicates the provided credentials are insufficient or invalid. - * Details (optional): - * `kind string` - * The kind attribute of the unauthorized resource (on some operations may differ from the requested resource). - * `name string` - * The identifier of the unauthorized resource. - * HTTP status code: `401 StatusUnauthorized` -* `Forbidden` - * Indicates that the server can be reached and understood the request, but refuses to take any further action, because it is configured to deny access for some reason to the requested resource by the client. - * Details (optional): - * `kind string` - * The kind attribute of the forbidden resource (on some operations may differ from the requested resource). - * `name string` - * The identifier of the forbidden resource. - * HTTP status code: `403 StatusForbidden` -* `NotFound` - * Indicates that one or more resources required for this operation could not be found. - * Details (optional): - * `kind string` - * The kind attribute of the missing resource (on some operations may differ from the requested resource). - * `name string` - * The identifier of the missing resource. - * HTTP status code: `404 StatusNotFound` -* `AlreadyExists` - * Indicates that the resource you are creating already exists. - * Details (optional): - * `kind string` - * The kind attribute of the conflicting resource. - * `name string` - * The identifier of the conflicting resource. - * HTTP status code: `409 StatusConflict` -* `Conflict` - * Indicates that the requested update operation cannot be completed due to a conflict. The client may need to alter the request. Each resource may define custom details that indicate the nature of the conflict. - * HTTP status code: `409 StatusConflict` -* `Invalid` - * Indicates that the requested create or update operation cannot be completed due to invalid data provided as part of the request. - * Details (optional): - * `kind string` - * the kind attribute of the invalid resource - * `name string` - * the identifier of the invalid resource - * `causes` - * One or more `StatusCause` entries indicating the data in the provided resource that was invalid. The `reason`, `message`, and `field` attributes will be set. - * HTTP status code: `422 StatusUnprocessableEntity` -* `Timeout` - * Indicates that the request could not be completed within the given time. Clients may receive this response if the server has decided to rate limit the client, or if the server is overloaded and cannot process the request at this time. - * Http status code: `429 TooManyRequests` - * The server should set the `Retry-After` HTTP header and return `retryAfterSeconds` in the details field of the object. A value of `0` is the default. -* `ServerTimeout` - * Indicates that the server can be reached and understood the request, but cannot complete the action in a reasonable time. This maybe due to temporary server load or a transient communication issue with another server. - * Details (optional): - * `kind string` - * The kind attribute of the resource being acted on. - * `name string` - * The operation that is being attempted. - * The server should set the `Retry-After` HTTP header and return `retryAfterSeconds` in the details field of the object. A value of `0` is the default. - * Http status code: `504 StatusServerTimeout` -* `MethodNotAllowed` - * Indicates that the action the client attempted to perform on the resource was not supported by the code. - * For instance, attempting to delete a resource that can only be created. - * API calls that return MethodNotAllowed can never succeed. - * Http status code: `405 StatusMethodNotAllowed` -* `InternalError` - * Indicates that an internal error occurred, it is unexpected and the outcome of the call is unknown. - * Details (optional): - * `causes` - * The original error. - * Http status code: `500 StatusInternalServerError` - -`code` may contain the suggested HTTP return code for this status. - - -## Events - -TODO: Document events (refer to another doc for details) - - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/devel/api-conventions.md?pixel)]() - diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/devel/api_changes.md b/Godeps/_workspace/src/k8s.io/kubernetes/docs/devel/api_changes.md deleted file mode 100644 index 687af00af506..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/devel/api_changes.md +++ /dev/null @@ -1,382 +0,0 @@ - - - - -WARNING -WARNING -WARNING -WARNING -WARNING - -

    PLEASE NOTE: This document applies to the HEAD of the source tree

    - -If you are using a released version of Kubernetes, you should -refer to the docs that go with that version. - - -The latest 1.0.x release of this document can be found -[here](http://releases.k8s.io/release-1.0/docs/devel/api_changes.md). - -Documentation for other releases can be found at -[releases.k8s.io](http://releases.k8s.io). - --- - - - - - -# So you want to change the API? - -The Kubernetes API has two major components - the internal structures and -the versioned APIs. The versioned APIs are intended to be stable, while the -internal structures are implemented to best reflect the needs of the Kubernetes -code itself. - -What this means for API changes is that you have to be somewhat thoughtful in -how you approach changes, and that you have to touch a number of pieces to make -a complete change. This document aims to guide you through the process, though -not all API changes will need all of these steps. - -## Operational overview - -It is important to have a high level understanding of the API system used in -Kubernetes in order to navigate the rest of this document. - -As mentioned above, the internal representation of an API object is decoupled -from any one API version. This provides a lot of freedom to evolve the code, -but it requires robust infrastructure to convert between representations. There -are multiple steps in processing an API operation - even something as simple as -a GET involves a great deal of machinery. - -The conversion process is logically a "star" with the internal form at the -center. Every versioned API can be converted to the internal form (and -vice-versa), but versioned APIs do not convert to other versioned APIs directly. -This sounds like a heavy process, but in reality we do not intend to keep more -than a small number of versions alive at once. While all of the Kubernetes code -operates on the internal structures, they are always converted to a versioned -form before being written to storage (disk or etcd) or being sent over a wire. -Clients should consume and operate on the versioned APIs exclusively. - -To demonstrate the general process, here is a (hypothetical) example: - - 1. A user POSTs a `Pod` object to `/api/v7beta1/...` - 2. The JSON is unmarshalled into a `v7beta1.Pod` structure - 3. Default values are applied to the `v7beta1.Pod` - 4. The `v7beta1.Pod` is converted to an `api.Pod` structure - 5. The `api.Pod` is validated, and any errors are returned to the user - 6. The `api.Pod` is converted to a `v6.Pod` (because v6 is the latest stable - version) - 7. The `v6.Pod` is marshalled into JSON and written to etcd - -Now that we have the `Pod` object stored, a user can GET that object in any -supported api version. For example: - - 1. A user GETs the `Pod` from `/api/v5/...` - 2. The JSON is read from etcd and unmarshalled into a `v6.Pod` structure - 3. Default values are applied to the `v6.Pod` - 4. The `v6.Pod` is converted to an `api.Pod` structure - 5. The `api.Pod` is converted to a `v5.Pod` structure - 6. The `v5.Pod` is marshalled into JSON and sent to the user - -The implication of this process is that API changes must be done carefully and -backward-compatibly. - -## On compatibility - -Before talking about how to make API changes, it is worthwhile to clarify what -we mean by API compatibility. An API change is considered backward-compatible -if it: - * adds new functionality that is not required for correct behavior - * does not change existing semantics - * does not change existing defaults - -Put another way: - -1. Any API call (e.g. a structure POSTed to a REST endpoint) that worked before - your change must work the same after your change. -2. Any API call that uses your change must not cause problems (e.g. crash or - degrade behavior) when issued against servers that do not include your change. -3. It must be possible to round-trip your change (convert to different API - versions and back) with no loss of information. - -If your change does not meet these criteria, it is not considered strictly -compatible. There are times when this might be OK, but mostly we want changes -that meet this definition. If you think you need to break compatibility, you -should talk to the Kubernetes team first. - -Let's consider some examples. In a hypothetical API (assume we're at version -v6), the `Frobber` struct looks something like this: - -```go -// API v6. -type Frobber struct { - Height int `json:"height"` - Param string `json:"param"` -} -``` - -You want to add a new `Width` field. It is generally safe to add new fields -without changing the API version, so you can simply change it to: - -```go -// Still API v6. -type Frobber struct { - Height int `json:"height"` - Width int `json:"width"` - Param string `json:"param"` -} -``` - -The onus is on you to define a sane default value for `Width` such that rule #1 -above is true - API calls and stored objects that used to work must continue to -work. - -For your next change you want to allow multiple `Param` values. You can not -simply change `Param string` to `Params []string` (without creating a whole new -API version) - that fails rules #1 and #2. You can instead do something like: - -```go -// Still API v6, but kind of clumsy. -type Frobber struct { - Height int `json:"height"` - Width int `json:"width"` - Param string `json:"param"` // the first param - ExtraParams []string `json:"params"` // additional params -} -``` - -Now you can satisfy the rules: API calls that provide the old style `Param` -will still work, while servers that don't understand `ExtraParams` can ignore -it. This is somewhat unsatisfying as an API, but it is strictly compatible. - -Part of the reason for versioning APIs and for using internal structs that are -distinct from any one version is to handle growth like this. The internal -representation can be implemented as: - -```go -// Internal, soon to be v7beta1. -type Frobber struct { - Height int - Width int - Params []string -} -``` - -The code that converts to/from versioned APIs can decode this into the somewhat -uglier (but compatible!) structures. Eventually, a new API version, let's call -it v7beta1, will be forked and it can use the clean internal structure. - -We've seen how to satisfy rules #1 and #2. Rule #3 means that you can not -extend one versioned API without also extending the others. For example, an -API call might POST an object in API v7beta1 format, which uses the cleaner -`Params` field, but the API server might store that object in trusty old v6 -form (since v7beta1 is "beta"). When the user reads the object back in the -v7beta1 API it would be unacceptable to have lost all but `Params[0]`. This -means that, even though it is ugly, a compatible change must be made to the v6 -API. - -As another interesting example, enumerated values provide a unique challenge. -Adding a new value to an enumerated set is *not* a compatible change. Clients -which assume they know how to handle all possible values of a given field will -not be able to handle the new values. However, removing value from an -enumerated set *can* be a compatible change, if handled properly (treat the -removed value as deprecated but allowed). - -## Changing versioned APIs - -For most changes, you will probably find it easiest to change the versioned -APIs first. This forces you to think about how to make your change in a -compatible way. Rather than doing each step in every version, it's usually -easier to do each versioned API one at a time, or to do all of one version -before starting "all the rest". - -### Edit types.go - -The struct definitions for each API are in `pkg/api//types.go`. Edit -those files to reflect the change you want to make. Note that all non-online -fields in versioned APIs must have description tags - these are used to generate -documentation. - -### Edit defaults.go - -If your change includes new fields for which you will need default values, you -need to add cases to `pkg/api//defaults.go`. Of course, since you -have added code, you have to add a test: `pkg/api//defaults_test.go`. - -Do use pointers to scalars when you need to distinguish between an unset value -and an automatic zero value. For example, -`PodSpec.TerminationGracePeriodSeconds` is defined as `*int64` the go type -definition. A zero value means 0 seconds, and a nil value asks the system to -pick a default. - -Don't forget to run the tests! - -### Edit conversion.go - -Given that you have not yet changed the internal structs, this might feel -premature, and that's because it is. You don't yet have anything to convert to -or from. We will revisit this in the "internal" section. If you're doing this -all in a different order (i.e. you started with the internal structs), then you -should jump to that topic below. In the very rare case that you are making an -incompatible change you might or might not want to do this now, but you will -have to do more later. The files you want are -`pkg/api//conversion.go` and `pkg/api//conversion_test.go`. - -## Changing the internal structures - -Now it is time to change the internal structs so your versioned changes can be -used. - -### Edit types.go - -Similar to the versioned APIs, the definitions for the internal structs are in -`pkg/api/types.go`. Edit those files to reflect the change you want to make. -Keep in mind that the internal structs must be able to express *all* of the -versioned APIs. - -## Edit validation.go - -Most changes made to the internal structs need some form of input validation. -Validation is currently done on internal objects in -`pkg/api/validation/validation.go`. This validation is the one of the first -opportunities we have to make a great user experience - good error messages and -thorough validation help ensure that users are giving you what you expect and, -when they don't, that they know why and how to fix it. Think hard about the -contents of `string` fields, the bounds of `int` fields and the -requiredness/optionalness of fields. - -Of course, code needs tests - `pkg/api/validation/validation_test.go`. - -## Edit version conversions - -At this point you have both the versioned API changes and the internal -structure changes done. If there are any notable differences - field names, -types, structural change in particular - you must add some logic to convert -versioned APIs to and from the internal representation. If you see errors from -the `serialization_test`, it may indicate the need for explicit conversions. - -Performance of conversions very heavily influence performance of apiserver. -Thus, we are auto-generating conversion functions that are much more efficient -than the generic ones (which are based on reflections and thus are highly -inefficient). - -The conversion code resides with each versioned API. There are two files: - - `pkg/api//conversion.go` containing manually written conversion - functions - - `pkg/api//conversion_generated.go` containing auto-generated - conversion functions - -Since auto-generated conversion functions are using manually written ones, -those manually written should be named with a defined convention, i.e. a function -converting type X in pkg a to type Y in pkg b, should be named: -`convert_a_X_To_b_Y`. - -Also note that you can (and for efficiency reasons should) use auto-generated -conversion functions when writing your conversion functions. - -Once all the necessary manually written conversions are added, you need to -regenerate auto-generated ones. To regenerate them: - - run - -```sh -hack/update-generated-conversions.sh -``` - -If running the above script is impossible due to compile errors, the easiest -workaround is to comment out the code causing errors and let the script to -regenerate it. If the auto-generated conversion methods are not used by the -manually-written ones, it's fine to just remove the whole file and let the -generator to create it from scratch. - -Unsurprisingly, adding manually written conversion also requires you to add tests to -`pkg/api//conversion_test.go`. - -## Update the fuzzer - -Part of our testing regimen for APIs is to "fuzz" (fill with random values) API -objects and then convert them to and from the different API versions. This is -a great way of exposing places where you lost information or made bad -assumptions. If you have added any fields which need very careful formatting -(the test does not run validation) or if you have made assumptions such as -"this slice will always have at least 1 element", you may get an error or even -a panic from the `serialization_test`. If so, look at the diff it produces (or -the backtrace in case of a panic) and figure out what you forgot. Encode that -into the fuzzer's custom fuzz functions. Hint: if you added defaults for a field, -that field will need to have a custom fuzz function that ensures that the field is -fuzzed to a non-empty value. - -The fuzzer can be found in `pkg/api/testing/fuzzer.go`. - -## Update the semantic comparisons - -VERY VERY rarely is this needed, but when it hits, it hurts. In some rare -cases we end up with objects (e.g. resource quantities) that have morally -equivalent values with different bitwise representations (e.g. value 10 with a -base-2 formatter is the same as value 0 with a base-10 formatter). The only way -Go knows how to do deep-equality is through field-by-field bitwise comparisons. -This is a problem for us. - -The first thing you should do is try not to do that. If you really can't avoid -this, I'd like to introduce you to our semantic DeepEqual routine. It supports -custom overrides for specific types - you can find that in `pkg/api/helpers.go`. - -There's one other time when you might have to touch this: unexported fields. -You see, while Go's `reflect` package is allowed to touch unexported fields, us -mere mortals are not - this includes semantic DeepEqual. Fortunately, most of -our API objects are "dumb structs" all the way down - all fields are exported -(start with a capital letter) and there are no unexported fields. But sometimes -you want to include an object in our API that does have unexported fields -somewhere in it (for example, `time.Time` has unexported fields). If this hits -you, you may have to touch the semantic DeepEqual customization functions. - -## Implement your change - -Now you have the API all changed - go implement whatever it is that you're -doing! - -## Write end-to-end tests - -This is, sadly, still sort of painful. Talk to us and we'll try to help you -figure out the best way to make sure your cool feature keeps working forever. - -## Examples and docs - -At last, your change is done, all unit tests pass, e2e passes, you're done, -right? Actually, no. You just changed the API. If you are touching an -existing facet of the API, you have to try *really* hard to make sure that -*all* the examples and docs are updated. There's no easy way to do this, due -in part to JSON and YAML silently dropping unknown fields. You're clever - -you'll figure it out. Put `grep` or `ack` to good use. - -If you added functionality, you should consider documenting it and/or writing -an example to illustrate your change. - -Make sure you update the swagger API spec by running: - -```sh -hack/update-swagger-spec.sh -``` - -The API spec changes should be in a commit separate from your other changes. - -## Incompatible API changes - -If your change is going to be backward incompatible or might be a breaking change for API -consumers, please send an announcement to `kubernetes-dev@googlegroups.com` before -the change gets in. If you are unsure, ask. Also make sure that the change gets documented in -`CHANGELOG.md` for the next release. - -## Adding new REST objects - -TODO(smarterclayton): write this. - - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/devel/api_changes.md?pixel)]() - diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/devel/cherry-picks.md b/Godeps/_workspace/src/k8s.io/kubernetes/docs/devel/cherry-picks.md deleted file mode 100644 index b589d56c4f8e..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/devel/cherry-picks.md +++ /dev/null @@ -1,70 +0,0 @@ - - - - -WARNING -WARNING -WARNING -WARNING -WARNING - -

    PLEASE NOTE: This document applies to the HEAD of the source tree

    - -If you are using a released version of Kubernetes, you should -refer to the docs that go with that version. - - -The latest 1.0.x release of this document can be found -[here](http://releases.k8s.io/release-1.0/docs/devel/cherry-picks.md). - -Documentation for other releases can be found at -[releases.k8s.io](http://releases.k8s.io). - --- - - - - - -# Overview - -This document explains cherry picks are managed on release branches within the -Kubernetes projects. - -## Propose a Cherry Pick - -Any contributor can propose a cherry pick of any pull request, like so: - -```sh -hack/cherry_pick_pull.sh upstream/release-3.14 98765 -``` - -This will walk you through the steps to propose an automated cherry pick of pull - #98765 for remote branch `upstream/release-3.14`. - -## Cherry Pick Review - -Cherry pick pull requests are reviewed differently than normal pull requests. In -particular, they may be self-merged by the release branch owner without fanfare, -in the case the release branch owner knows the cherry pick was already -requested - this should not be the norm, but it may happen. - -[Contributor License Agreements](http://releases.k8s.io/HEAD/CONTRIBUTING.md) is considered implicit -for all code within cherry-pick pull requests, ***unless there is a large -conflict***. - -## Searching for Cherry Picks - -Now that we've structured cherry picks as PRs, searching for all cherry-picks -against a release is a GitHub query: For example, -[this query is all of the v0.21.x cherry-picks](https://k8s.io/kubernetes/pulls?utf8=%E2%9C%93&q=is%3Apr+%22automated+cherry+pick%22+base%3Arelease-0.21) - - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/devel/cherry-picks.md?pixel)]() - diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/devel/cli-roadmap.md b/Godeps/_workspace/src/k8s.io/kubernetes/docs/devel/cli-roadmap.md deleted file mode 100644 index 8eb59e3b1f46..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/devel/cli-roadmap.md +++ /dev/null @@ -1,44 +0,0 @@ - - - - -WARNING -WARNING -WARNING -WARNING -WARNING - -

    PLEASE NOTE: This document applies to the HEAD of the source tree

    - -If you are using a released version of Kubernetes, you should -refer to the docs that go with that version. - - -The latest 1.0.x release of this document can be found -[here](http://releases.k8s.io/release-1.0/docs/devel/cli-roadmap.md). - -Documentation for other releases can be found at -[releases.k8s.io](http://releases.k8s.io). - --- - - - - - -# Kubernetes CLI/Configuration Roadmap - -See github issues with the following labels: -* [area/app-config-deployment](https://k8s.io/kubernetes/labels/area/app-config-deployment) -* [component/CLI](https://k8s.io/kubernetes/labels/component/CLI) -* [component/client](https://k8s.io/kubernetes/labels/component/client) - - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/devel/cli-roadmap.md?pixel)]() - diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/devel/client-libraries.md b/Godeps/_workspace/src/k8s.io/kubernetes/docs/devel/client-libraries.md deleted file mode 100644 index 9e41688cf27d..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/devel/client-libraries.md +++ /dev/null @@ -1,56 +0,0 @@ - - - - -WARNING -WARNING -WARNING -WARNING -WARNING - -

    PLEASE NOTE: This document applies to the HEAD of the source tree

    - -If you are using a released version of Kubernetes, you should -refer to the docs that go with that version. - - -The latest 1.0.x release of this document can be found -[here](http://releases.k8s.io/release-1.0/docs/devel/client-libraries.md). - -Documentation for other releases can be found at -[releases.k8s.io](http://releases.k8s.io). - --- - - - - - -## Kubernetes API client libraries - -### Supported - - * [Go](http://releases.k8s.io/HEAD/pkg/client/) - -### User Contributed - -*Note: Libraries provided by outside parties are supported by their authors, not the core Kubernetes team* - - * [Java (OSGI)](https://bitbucket.org/amdatulabs/amdatu-kubernetes) - * [Java (Fabric8)](https://github.com/fabric8io/fabric8/tree/master/components/kubernetes-api) - * [Ruby](https://github.com/Ch00k/kuber) - * [Ruby](https://github.com/abonas/kubeclient) - * [PHP](https://github.com/devstub/kubernetes-api-php-client) - * [PHP](https://github.com/maclof/kubernetes-client) - * [Node.js](https://github.com/tenxcloud/node-kubernetes-client) - * [Perl](https://metacpan.org/pod/Net::Kubernetes) - - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/devel/client-libraries.md?pixel)]() - diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/devel/coding-conventions.md b/Godeps/_workspace/src/k8s.io/kubernetes/docs/devel/coding-conventions.md deleted file mode 100644 index ac3d353f4a2c..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/devel/coding-conventions.md +++ /dev/null @@ -1,43 +0,0 @@ - - - - -WARNING -WARNING -WARNING -WARNING -WARNING - -

    PLEASE NOTE: This document applies to the HEAD of the source tree

    - -If you are using a released version of Kubernetes, you should -refer to the docs that go with that version. - - -The latest 1.0.x release of this document can be found -[here](http://releases.k8s.io/release-1.0/docs/devel/coding-conventions.md). - -Documentation for other releases can be found at -[releases.k8s.io](http://releases.k8s.io). - --- - - - - -Coding style advice for contributors - - Bash - - https://google-styleguide.googlecode.com/svn/trunk/shell.xml - - Go - - https://github.com/golang/go/wiki/CodeReviewComments - - https://gist.github.com/lavalamp/4bd23295a9f32706a48f - - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/devel/coding-conventions.md?pixel)]() - diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/devel/collab.md b/Godeps/_workspace/src/k8s.io/kubernetes/docs/devel/collab.md deleted file mode 100644 index 624b3bcbb168..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/devel/collab.md +++ /dev/null @@ -1,78 +0,0 @@ - - - - -WARNING -WARNING -WARNING -WARNING -WARNING - -

    PLEASE NOTE: This document applies to the HEAD of the source tree

    - -If you are using a released version of Kubernetes, you should -refer to the docs that go with that version. - - -The latest 1.0.x release of this document can be found -[here](http://releases.k8s.io/release-1.0/docs/devel/collab.md). - -Documentation for other releases can be found at -[releases.k8s.io](http://releases.k8s.io). - --- - - - - - -# On Collaborative Development - -Kubernetes is open source, but many of the people working on it do so as their day job. In order to avoid forcing people to be "at work" effectively 24/7, we want to establish some semi-formal protocols around development. Hopefully these rules make things go more smoothly. If you find that this is not the case, please complain loudly. - -## Patches welcome - -First and foremost: as a potential contributor, your changes and ideas are welcome at any hour of the day or night, weekdays, weekends, and holidays. Please do not ever hesitate to ask a question or send a PR. - -## Code reviews - -All changes must be code reviewed. For non-maintainers this is obvious, since you can't commit anyway. But even for maintainers, we want all changes to get at least one review, preferably (for non-trivial changes obligatorily) from someone who knows the areas the change touches. For non-trivial changes we may want two reviewers. The primary reviewer will make this decision and nominate a second reviewer, if needed. Except for trivial changes, PRs should not be committed until relevant parties (e.g. owners of the subsystem affected by the PR) have had a reasonable chance to look at PR in their local business hours. - -Most PRs will find reviewers organically. If a maintainer intends to be the primary reviewer of a PR they should set themselves as the assignee on GitHub and say so in a reply to the PR. Only the primary reviewer of a change should actually do the merge, except in rare cases (e.g. they are unavailable in a reasonable timeframe). - -If a PR has gone 2 work days without an owner emerging, please poke the PR thread and ask for a reviewer to be assigned. - -Except for rare cases, such as trivial changes (e.g. typos, comments) or emergencies (e.g. broken builds), maintainers should not merge their own changes. - -Expect reviewers to request that you avoid [common go style mistakes](https://github.com/golang/go/wiki/CodeReviewComments) in your PRs. - -## Assigned reviews - -Maintainers can assign reviews to other maintainers, when appropriate. The assignee becomes the shepherd for that PR and is responsible for merging the PR once they are satisfied with it or else closing it. The assignee might request reviews from non-maintainers. - -## Merge hours - -Maintainers will do merges of appropriately reviewed-and-approved changes during their local "business hours" (typically 7:00 am Monday to 5:00 pm (17:00h) Friday). PRs that arrive over the weekend or on holidays will only be merged if there is a very good reason for it and if the code review requirements have been met. Concretely this means that nobody should merge changes immediately before going to bed for the night. - -There may be discussion an even approvals granted outside of the above hours, but merges will generally be deferred. - -If a PR is considered complex or controversial, the merge of that PR should be delayed to give all interested parties in all timezones the opportunity to provide feedback. Concretely, this means that such PRs should be held for 24 -hours before merging. Of course "complex" and "controversial" are left to the judgment of the people involved, but we trust that part of being a committer is the judgment required to evaluate such things honestly, and not be -motivated by your desire (or your cube-mate's desire) to get their code merged. Also see "Holds" below, any reviewer can issue a "hold" to indicate that the PR is in fact complicated or complex and deserves further review. - -PRs that are incorrectly judged to be merge-able, may be reverted and subject to re-review, if subsequent reviewers believe that they in fact are controversial or complex. - - -## Holds - -Any maintainer or core contributor who wants to review a PR but does not have time immediately may put a hold on a PR simply by saying so on the PR discussion and offering an ETA measured in single-digit days at most. Any PR that has a hold shall not be merged until the person who requested the hold acks the review, withdraws their hold, or is overruled by a preponderance of maintainers. - - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/devel/collab.md?pixel)]() - diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/devel/developer-guides/vagrant.md b/Godeps/_workspace/src/k8s.io/kubernetes/docs/devel/developer-guides/vagrant.md deleted file mode 100644 index f451d755b3c7..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/devel/developer-guides/vagrant.md +++ /dev/null @@ -1,382 +0,0 @@ - - - - -WARNING -WARNING -WARNING -WARNING -WARNING - -

    PLEASE NOTE: This document applies to the HEAD of the source tree

    - -If you are using a released version of Kubernetes, you should -refer to the docs that go with that version. - - -The latest 1.0.x release of this document can be found -[here](http://releases.k8s.io/release-1.0/docs/devel/developer-guides/vagrant.md). - -Documentation for other releases can be found at -[releases.k8s.io](http://releases.k8s.io). - --- - - - - - -## Getting started with Vagrant - -Running kubernetes with Vagrant (and VirtualBox) is an easy way to run/test/develop on your local machine (Linux, Mac OS X). - -### Prerequisites - -1. Install latest version >= 1.6.2 of vagrant from http://www.vagrantup.com/downloads.html -2. Install one of: - 1. The latest version of Virtual Box from https://www.virtualbox.org/wiki/Downloads - 2. [VMWare Fusion](https://www.vmware.com/products/fusion/) version 5 or greater as well as the appropriate [Vagrant VMWare Fusion provider](https://www.vagrantup.com/vmware) - 3. [VMWare Workstation](https://www.vmware.com/products/workstation/) version 9 or greater as well as the [Vagrant VMWare Workstation provider](https://www.vagrantup.com/vmware) - 4. [Parallels Desktop](https://www.parallels.com/products/desktop/) version 9 or greater as well as the [Vagrant Parallels provider](https://parallels.github.io/vagrant-parallels/) -3. Get or build a [binary release](../../../docs/getting-started-guides/binary_release.md) - -### Setup - -By default, the Vagrant setup will create a single master VM (called kubernetes-master) and one node (called kubernetes-minion-1). Each VM will take 1 GB, so make sure you have at least 2GB to 4GB of free memory (plus appropriate free disk space). To start your local cluster, open a shell and run: - -```sh -cd kubernetes - -export KUBERNETES_PROVIDER=vagrant -./cluster/kube-up.sh -``` - -The `KUBERNETES_PROVIDER` environment variable tells all of the various cluster management scripts which variant to use. If you forget to set this, the assumption is you are running on Google Compute Engine. - -If you installed more than one Vagrant provider, Kubernetes will usually pick the appropriate one. However, you can override which one Kubernetes will use by setting the [`VAGRANT_DEFAULT_PROVIDER`](https://docs.vagrantup.com/v2/providers/default.html) environment variable: - -```sh -export VAGRANT_DEFAULT_PROVIDER=parallels -export KUBERNETES_PROVIDER=vagrant -./cluster/kube-up.sh -``` - -Vagrant will provision each machine in the cluster with all the necessary components to run Kubernetes. The initial setup can take a few minutes to complete on each machine. - -By default, each VM in the cluster is running Fedora, and all of the Kubernetes services are installed into systemd. - -To access the master or any node: - -```sh -vagrant ssh master -vagrant ssh minion-1 -``` - -If you are running more than one nodes, you can access the others by: - -```sh -vagrant ssh minion-2 -vagrant ssh minion-3 -``` - -To view the service status and/or logs on the kubernetes-master: - -```console -$ vagrant ssh master -[vagrant@kubernetes-master ~] $ sudo systemctl status kube-apiserver -[vagrant@kubernetes-master ~] $ sudo journalctl -r -u kube-apiserver - -[vagrant@kubernetes-master ~] $ sudo systemctl status kube-controller-manager -[vagrant@kubernetes-master ~] $ sudo journalctl -r -u kube-controller-manager - -[vagrant@kubernetes-master ~] $ sudo systemctl status etcd -[vagrant@kubernetes-master ~] $ sudo systemctl status nginx -``` - -To view the services on any of the nodes: - -```console -$ vagrant ssh minion-1 -[vagrant@kubernetes-minion-1] $ sudo systemctl status docker -[vagrant@kubernetes-minion-1] $ sudo journalctl -r -u docker -[vagrant@kubernetes-minion-1] $ sudo systemctl status kubelet -[vagrant@kubernetes-minion-1] $ sudo journalctl -r -u kubelet -``` - -### Interacting with your Kubernetes cluster with Vagrant. - -With your Kubernetes cluster up, you can manage the nodes in your cluster with the regular Vagrant commands. - -To push updates to new Kubernetes code after making source changes: - -```sh -./cluster/kube-push.sh -``` - -To stop and then restart the cluster: - -```sh -vagrant halt -./cluster/kube-up.sh -``` - -To destroy the cluster: - -```sh -vagrant destroy -``` - -Once your Vagrant machines are up and provisioned, the first thing to do is to check that you can use the `kubectl.sh` script. - -You may need to build the binaries first, you can do this with `make` - -```console -$ ./cluster/kubectl.sh get nodes - -NAME LABELS STATUS -kubernetes-minion-0whl kubernetes.io/hostname=kubernetes-minion-0whl Ready -kubernetes-minion-4jdf kubernetes.io/hostname=kubernetes-minion-4jdf Ready -kubernetes-minion-epbe kubernetes.io/hostname=kubernetes-minion-epbe Ready -``` - -### Interacting with your Kubernetes cluster with the `kube-*` scripts. - -Alternatively to using the vagrant commands, you can also use the `cluster/kube-*.sh` scripts to interact with the vagrant based provider just like any other hosting platform for kubernetes. - -All of these commands assume you have set `KUBERNETES_PROVIDER` appropriately: - -```sh -export KUBERNETES_PROVIDER=vagrant -``` - -Bring up a vagrant cluster - -```sh -./cluster/kube-up.sh -``` - -Destroy the vagrant cluster - -```sh -./cluster/kube-down.sh -``` - -Update the vagrant cluster after you make changes (only works when building your own releases locally): - -```sh -./cluster/kube-push.sh -``` - -Interact with the cluster - -```sh -./cluster/kubectl.sh -``` - -### Authenticating with your master - -When using the vagrant provider in Kubernetes, the `cluster/kubectl.sh` script will cache your credentials in a `~/.kubernetes_vagrant_auth` file so you will not be prompted for them in the future. - -```console -$ cat ~/.kubernetes_vagrant_auth -{ "User": "vagrant", - "Password": "vagrant" - "CAFile": "/home/k8s_user/.kubernetes.vagrant.ca.crt", - "CertFile": "/home/k8s_user/.kubecfg.vagrant.crt", - "KeyFile": "/home/k8s_user/.kubecfg.vagrant.key" -} -``` - -You should now be set to use the `cluster/kubectl.sh` script. For example try to list the nodes that you have started with: - -```sh -./cluster/kubectl.sh get nodes -``` - -### Running containers - -Your cluster is running, you can list the nodes in your cluster: - -```console -$ ./cluster/kubectl.sh get nodes - -NAME LABELS STATUS -kubernetes-minion-0whl kubernetes.io/hostname=kubernetes-minion-0whl Ready -kubernetes-minion-4jdf kubernetes.io/hostname=kubernetes-minion-4jdf Ready -kubernetes-minion-epbe kubernetes.io/hostname=kubernetes-minion-epbe Ready -``` - -Now start running some containers! - -You can now use any of the cluster/kube-*.sh commands to interact with your VM machines. -Before starting a container there will be no pods, services and replication controllers. - -```console -$ cluster/kubectl.sh get pods -NAME READY STATUS RESTARTS AGE - -$ cluster/kubectl.sh get services -NAME LABELS SELECTOR IP(S) PORT(S) - -$ cluster/kubectl.sh get rc -CONTROLLER CONTAINER(S) IMAGE(S) SELECTOR REPLICAS -``` - -Start a container running nginx with a replication controller and three replicas - -```console -$ cluster/kubectl.sh run my-nginx --image=nginx --replicas=3 --port=80 -CONTROLLER CONTAINER(S) IMAGE(S) SELECTOR REPLICAS -my-nginx my-nginx nginx run=my-nginx 3 -``` - -When listing the pods, you will see that three containers have been started and are in Waiting state: - -```console -$ cluster/kubectl.sh get pods -NAME READY STATUS RESTARTS AGE -my-nginx-389da 1/1 Waiting 0 33s -my-nginx-kqdjk 1/1 Waiting 0 33s -my-nginx-nyj3x 1/1 Waiting 0 33s -``` - -You need to wait for the provisioning to complete, you can monitor the minions by doing: - -```console -$ sudo salt '*minion-1' cmd.run 'docker images' -kubernetes-minion-1: - REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE - 96864a7d2df3 26 hours ago 204.4 MB - kubernetes/pause latest 6c4579af347b 8 weeks ago 239.8 kB -``` - -Once the docker image for nginx has been downloaded, the container will start and you can list it: - -```console -$ sudo salt '*minion-1' cmd.run 'docker ps' -kubernetes-minion-1: - CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES - dbe79bf6e25b nginx:latest "nginx" 21 seconds ago Up 19 seconds k8s--mynginx.8c5b8a3a--7813c8bd_-_3ffe_-_11e4_-_9036_-_0800279696e1.etcd--7813c8bd_-_3ffe_-_11e4_-_9036_-_0800279696e1--fcfa837f - fa0e29c94501 kubernetes/pause:latest "/pause" 8 minutes ago Up 8 minutes 0.0.0.0:8080->80/tcp k8s--net.a90e7ce4--7813c8bd_-_3ffe_-_11e4_-_9036_-_0800279696e1.etcd--7813c8bd_-_3ffe_-_11e4_-_9036_-_0800279696e1--baf5b21b -``` - -Going back to listing the pods, services and replicationcontrollers, you now have: - -```console -$ cluster/kubectl.sh get pods -NAME READY STATUS RESTARTS AGE -my-nginx-389da 1/1 Running 0 33s -my-nginx-kqdjk 1/1 Running 0 33s -my-nginx-nyj3x 1/1 Running 0 33s - -$ cluster/kubectl.sh get services -NAME LABELS SELECTOR IP(S) PORT(S) - -$ cluster/kubectl.sh get rc -NAME IMAGE(S) SELECTOR REPLICAS -my-nginx nginx run=my-nginx 3 -``` - -We did not start any services, hence there are none listed. But we see three replicas displayed properly. -Check the [guestbook](../../../examples/guestbook/README.md) application to learn how to create a service. -You can already play with scaling the replicas with: - -```console -$ ./cluster/kubectl.sh scale rc my-nginx --replicas=2 -$ ./cluster/kubectl.sh get pods -NAME READY STATUS RESTARTS AGE -my-nginx-kqdjk 1/1 Running 0 13m -my-nginx-nyj3x 1/1 Running 0 13m -``` - -Congratulations! - -### Testing - -The following will run all of the end-to-end testing scenarios assuming you set your environment in `cluster/kube-env.sh`: - -```sh -NUM_MINIONS=3 hack/e2e-test.sh -``` - -### Troubleshooting - -#### I keep downloading the same (large) box all the time! - -By default the Vagrantfile will download the box from S3. You can change this (and cache the box locally) by providing a name and an alternate URL when calling `kube-up.sh` - -```sh -export KUBERNETES_BOX_NAME=choose_your_own_name_for_your_kuber_box -export KUBERNETES_BOX_URL=path_of_your_kuber_box -export KUBERNETES_PROVIDER=vagrant -./cluster/kube-up.sh -``` - -#### I just created the cluster, but I am getting authorization errors! - -You probably have an incorrect ~/.kubernetes_vagrant_auth file for the cluster you are attempting to contact. - -```sh -rm ~/.kubernetes_vagrant_auth -``` - -After using kubectl.sh make sure that the correct credentials are set: - -```console -$ cat ~/.kubernetes_vagrant_auth -{ - "User": "vagrant", - "Password": "vagrant" -} -``` - -#### I just created the cluster, but I do not see my container running! - -If this is your first time creating the cluster, the kubelet on each node schedules a number of docker pull requests to fetch prerequisite images. This can take some time and as a result may delay your initial pod getting provisioned. - -#### I changed Kubernetes code, but it's not running! - -Are you sure there was no build error? After running `$ vagrant provision`, scroll up and ensure that each Salt state was completed successfully on each box in the cluster. -It's very likely you see a build error due to an error in your source files! - -#### I have brought Vagrant up but the nodes won't validate! - -Are you sure you built a release first? Did you install `net-tools`? For more clues, login to one of the nodes (`vagrant ssh minion-1`) and inspect the salt minion log (`sudo cat /var/log/salt/minion`). - -#### I want to change the number of nodes! - -You can control the number of nodes that are instantiated via the environment variable `NUM_MINIONS` on your host machine. If you plan to work with replicas, we strongly encourage you to work with enough nodes to satisfy your largest intended replica size. If you do not plan to work with replicas, you can save some system resources by running with a single node. You do this, by setting `NUM_MINIONS` to 1 like so: - -```sh -export NUM_MINIONS=1 -``` - -#### I want my VMs to have more memory! - -You can control the memory allotted to virtual machines with the `KUBERNETES_MEMORY` environment variable. -Just set it to the number of megabytes you would like the machines to have. For example: - -```sh -export KUBERNETES_MEMORY=2048 -``` - -If you need more granular control, you can set the amount of memory for the master and nodes independently. For example: - -```sh -export KUBERNETES_MASTER_MEMORY=1536 -export KUBERNETES_MINION_MEMORY=2048 -``` - -#### I ran vagrant suspend and nothing works! - -`vagrant suspend` seems to mess up the network. It's not supported at this time. - - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/devel/developer-guides/vagrant.md?pixel)]() - diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/devel/development.md b/Godeps/_workspace/src/k8s.io/kubernetes/docs/devel/development.md deleted file mode 100644 index 7049590fe3ca..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/devel/development.md +++ /dev/null @@ -1,353 +0,0 @@ - - - - -WARNING -WARNING -WARNING -WARNING -WARNING - -

    PLEASE NOTE: This document applies to the HEAD of the source tree

    - -If you are using a released version of Kubernetes, you should -refer to the docs that go with that version. - - -The latest 1.0.x release of this document can be found -[here](http://releases.k8s.io/release-1.0/docs/devel/development.md). - -Documentation for other releases can be found at -[releases.k8s.io](http://releases.k8s.io). - --- - - - - - -# Development Guide - -# Releases and Official Builds - -Official releases are built in Docker containers. Details are [here](http://releases.k8s.io/HEAD/build/README.md). You can do simple builds and development with just a local Docker installation. If want to build go locally outside of docker, please continue below. - -## Go development environment - -Kubernetes is written in [Go](http://golang.org) programming language. If you haven't set up Go development environment, please follow [this instruction](http://golang.org/doc/code.html) to install go tool and set up GOPATH. Ensure your version of Go is at least 1.3. - -## Git Setup - -Below, we outline one of the more common git workflows that core developers use. Other git workflows are also valid. - -### Visual overview - -![Git workflow](git_workflow.png) - -### Fork the main repository - -1. Go to https://k8s.io/kubernetes -2. Click the "Fork" button (at the top right) - -### Clone your fork - -The commands below require that you have $GOPATH set ([$GOPATH docs](https://golang.org/doc/code.html#GOPATH)). We highly recommend you put Kubernetes' code into your GOPATH. Note: the commands below will not work if there is more than one directory in your `$GOPATH`. - -```sh -mkdir -p $GOPATH/src/github.com/GoogleCloudPlatform/ -cd $GOPATH/src/github.com/GoogleCloudPlatform/ -# Replace "$YOUR_GITHUB_USERNAME" below with your github username -git clone https://github.com/$YOUR_GITHUB_USERNAME/kubernetes.git -cd kubernetes -git remote add upstream 'https://k8s.io/kubernetes.git' -``` - -### Create a branch and make changes - -```sh -git checkout -b myfeature -# Make your code changes -``` - -### Keeping your development fork in sync - -```sh -git fetch upstream -git rebase upstream/master -``` - -Note: If you have write access to the main repository at k8s.io/kubernetes, you should modify your git configuration so that you can't accidentally push to upstream: - -```sh -git remote set-url --push upstream no_push -``` - -### Commiting changes to your fork - -```sh -git commit -git push -f origin myfeature -``` - -### Creating a pull request - -1. Visit http://github.com/$YOUR_GITHUB_USERNAME/kubernetes -2. Click the "Compare and pull request" button next to your "myfeature" branch. - -### When to retain commits and when to squash - -Upon merge, all git commits should represent meaningful milestones or units of -work. Use commits to add clarity to the development and review process. - -Before merging a PR, squash any "fix review feedback", "typo", and "rebased" -sorts of commits. It is not imperative that every commit in a PR compile and -pass tests independently, but it is worth striving for. For mass automated -fixups (e.g. automated doc formatting), use one or more commits for the -changes to tooling and a final commit to apply the fixup en masse. This makes -reviews much easier. - -## godep and dependency management - -Kubernetes uses [godep](https://github.com/tools/godep) to manage dependencies. It is not strictly required for building Kubernetes but it is required when managing dependencies under the Godeps/ tree, and is required by a number of the build and test scripts. Please make sure that ``godep`` is installed and in your ``$PATH``. - -### Installing godep - -There are many ways to build and host go binaries. Here is an easy way to get utilities like `godep` installed: - -1) Ensure that [mercurial](http://mercurial.selenic.com/wiki/Download) is installed on your system. (some of godep's dependencies use the mercurial -source control system). Use `apt-get install mercurial` or `yum install mercurial` on Linux, or [brew.sh](http://brew.sh) on OS X, or download -directly from mercurial. - -2) Create a new GOPATH for your tools and install godep: - -```sh -export GOPATH=$HOME/go-tools -mkdir -p $GOPATH -go get github.com/tools/godep -``` - -3) Add $GOPATH/bin to your path. Typically you'd add this to your ~/.profile: - -```sh -export GOPATH=$HOME/go-tools -export PATH=$PATH:$GOPATH/bin -``` - -### Using godep - -Here's a quick walkthrough of one way to use godeps to add or update a Kubernetes dependency into Godeps/_workspace. For more details, please see the instructions in [godep's documentation](https://github.com/tools/godep). - -1) Devote a directory to this endeavor: - -```sh -export KPATH=$HOME/code/kubernetes -mkdir -p $KPATH/src/k8s.io/kubernetes -cd $KPATH/src/k8s.io/kubernetes -git clone https://path/to/your/fork . -# Or copy your existing local repo here. IMPORTANT: making a symlink doesn't work. -``` - -2) Set up your GOPATH. - -```sh -# Option A: this will let your builds see packages that exist elsewhere on your system. -export GOPATH=$KPATH:$GOPATH -# Option B: This will *not* let your local builds see packages that exist elsewhere on your system. -export GOPATH=$KPATH -# Option B is recommended if you're going to mess with the dependencies. -``` - -3) Populate your new GOPATH. - -```sh -cd $KPATH/src/k8s.io/kubernetes -godep restore -``` - -4) Next, you can either add a new dependency or update an existing one. - -```sh -# To add a new dependency, do: -cd $KPATH/src/k8s.io/kubernetes -go get path/to/dependency -# Change code in Kubernetes to use the dependency. -godep save ./... - -# To update an existing dependency, do: -cd $KPATH/src/k8s.io/kubernetes -go get -u path/to/dependency -# Change code in Kubernetes accordingly if necessary. -godep update path/to/dependency -``` - -5) Before sending your PR, it's a good idea to sanity check that your Godeps.json file is ok by re-restoring: `godep restore` - -It is sometimes expedient to manually fix the /Godeps/godeps.json file to minimize the changes. - -Please send dependency updates in separate commits within your PR, for easier reviewing. - -## Hooks - -Before committing any changes, please link/copy these hooks into your .git -directory. This will keep you from accidentally committing non-gofmt'd go code. - -```sh -cd kubernetes/.git/hooks/ -ln -s ../../hooks/pre-commit . -``` - -## Unit tests - -```sh -cd kubernetes -hack/test-go.sh -``` - -Alternatively, you could also run: - -```sh -cd kubernetes -godep go test ./... -``` - -If you only want to run unit tests in one package, you could run ``godep go test`` under the package directory. For example, the following commands will run all unit tests in package kubelet: - -```console -$ cd kubernetes # step into the kubernetes directory. -$ cd pkg/kubelet -$ godep go test -# some output from unit tests -PASS -ok k8s.io/kubernetes/pkg/kubelet 0.317s -``` - -## Coverage - -Currently, collecting coverage is only supported for the Go unit tests. - -To run all unit tests and generate an HTML coverage report, run the following: - -```sh -cd kubernetes -KUBE_COVER=y hack/test-go.sh -``` - -At the end of the run, an the HTML report will be generated with the path printed to stdout. - -To run tests and collect coverage in only one package, pass its relative path under the `kubernetes` directory as an argument, for example: - -```sh -cd kubernetes -KUBE_COVER=y hack/test-go.sh pkg/kubectl -``` - -Multiple arguments can be passed, in which case the coverage results will be combined for all tests run. - -Coverage results for the project can also be viewed on [Coveralls](https://coveralls.io/r/GoogleCloudPlatform/kubernetes), and are continuously updated as commits are merged. Additionally, all pull requests which spawn a Travis build will report unit test coverage results to Coveralls. - -## Integration tests - -You need an [etcd](https://github.com/coreos/etcd/releases/tag/v2.0.0) in your path, please make sure it is installed and in your ``$PATH``. - -```sh -cd kubernetes -hack/test-integration.sh -``` - -## End-to-End tests - -You can run an end-to-end test which will bring up a master and two nodes, perform some tests, and then tear everything down. Make sure you have followed the getting started steps for your chosen cloud platform (which might involve changing the `KUBERNETES_PROVIDER` environment variable to something other than "gce". - -```sh -cd kubernetes -hack/e2e-test.sh -``` - -Pressing control-C should result in an orderly shutdown but if something goes wrong and you still have some VMs running you can force a cleanup with this command: - -```sh -go run hack/e2e.go --down -``` - -### Flag options - -See the flag definitions in `hack/e2e.go` for more options, such as reusing an existing cluster, here is an overview: - -```sh -# Build binaries for testing -go run hack/e2e.go --build - -# Create a fresh cluster. Deletes a cluster first, if it exists -go run hack/e2e.go --up - -# Create a fresh cluster at a specific release version. -go run hack/e2e.go --up --version=0.7.0 - -# Test if a cluster is up. -go run hack/e2e.go --isup - -# Push code to an existing cluster -go run hack/e2e.go --push - -# Push to an existing cluster, or bring up a cluster if it's down. -go run hack/e2e.go --pushup - -# Run all tests -go run hack/e2e.go --test - -# Run tests matching the regex "Pods.*env" -go run hack/e2e.go -v -test --test_args="--ginkgo.focus=Pods.*env" - -# Alternately, if you have the e2e cluster up and no desire to see the event stream, you can run ginkgo-e2e.sh directly: -hack/ginkgo-e2e.sh --ginkgo.focus=Pods.*env -``` - -### Combining flags - -```sh -# Flags can be combined, and their actions will take place in this order: -# -build, -push|-up|-pushup, -test|-tests=..., -down -# e.g.: -go run hack/e2e.go -build -pushup -test -down - -# -v (verbose) can be added if you want streaming output instead of only -# seeing the output of failed commands. - -# -ctl can be used to quickly call kubectl against your e2e cluster. Useful for -# cleaning up after a failed test or viewing logs. Use -v to avoid suppressing -# kubectl output. -go run hack/e2e.go -v -ctl='get events' -go run hack/e2e.go -v -ctl='delete pod foobar' -``` - -## Conformance testing - -End-to-end testing, as described above, is for [development -distributions](writing-a-getting-started-guide.md). A conformance test is used on -a [versioned distro](writing-a-getting-started-guide.md). - -The conformance test runs a subset of the e2e-tests against a manually-created cluster. It does not -require support for up/push/down and other operations. To run a conformance test, you need to know the -IP of the master for your cluster and the authorization arguments to use. The conformance test is -intended to run against a cluster at a specific binary release of Kubernetes. -See [conformance-test.sh](http://releases.k8s.io/HEAD/hack/conformance-test.sh). - -## Testing out flaky tests - -[Instructions here](flaky-tests.md) - -## Regenerating the CLI documentation - -```sh -hack/run-gendocs.sh -``` - - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/devel/development.md?pixel)]() - diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/devel/faster_reviews.md b/Godeps/_workspace/src/k8s.io/kubernetes/docs/devel/faster_reviews.md deleted file mode 100644 index d28e9b55447c..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/devel/faster_reviews.md +++ /dev/null @@ -1,214 +0,0 @@ - - - - -WARNING -WARNING -WARNING -WARNING -WARNING - -

    PLEASE NOTE: This document applies to the HEAD of the source tree

    - -If you are using a released version of Kubernetes, you should -refer to the docs that go with that version. - - -The latest 1.0.x release of this document can be found -[here](http://releases.k8s.io/release-1.0/docs/devel/faster_reviews.md). - -Documentation for other releases can be found at -[releases.k8s.io](http://releases.k8s.io). - --- - - - - - -# How to get faster PR reviews - -Most of what is written here is not at all specific to Kubernetes, but it bears -being written down in the hope that it will occasionally remind people of "best -practices" around code reviews. - -You've just had a brilliant idea on how to make Kubernetes better. Let's call -that idea "FeatureX". Feature X is not even that complicated. You have a -pretty good idea of how to implement it. You jump in and implement it, fixing a -bunch of stuff along the way. You send your PR - this is awesome! And it sits. -And sits. A week goes by and nobody reviews it. Finally someone offers a few -comments, which you fix up and wait for more review. And you wait. Another -week or two goes by. This is horrible. - -What went wrong? One particular problem that comes up frequently is this - your -PR is too big to review. You've touched 39 files and have 8657 insertions. -When your would-be reviewers pull up the diffs they run away - this PR is going -to take 4 hours to review and they don't have 4 hours right now. They'll get to it -later, just as soon as they have more free time (ha!). - -Let's talk about how to avoid this. - -## 1. Don't build a cathedral in one PR - -Are you sure FeatureX is something the Kubernetes team wants or will accept, or -that it is implemented to fit with other changes in flight? Are you willing to -bet a few days or weeks of work on it? If you have any doubt at all about the -usefulness of your feature or the design - make a proposal doc or a sketch PR -or both. Write or code up just enough to express the idea and the design and -why you made those choices, then get feedback on this. Now, when we ask you to -change a bunch of facets of the design, you don't have to re-write it all. - -## 2. Smaller diffs are exponentially better - -Small PRs get reviewed faster and are more likely to be correct than big ones. -Let's face it - attention wanes over time. If your PR takes 60 minutes to -review, I almost guarantee that the reviewer's eye for details is not as keen in -the last 30 minutes as it was in the first. This leads to multiple rounds of -review when one might have sufficed. In some cases the review is delayed in its -entirety by the need for a large contiguous block of time to sit and read your -code. - -Whenever possible, break up your PRs into multiple commits. Making a series of -discrete commits is a powerful way to express the evolution of an idea or the -different ideas that make up a single feature. There's a balance to be struck, -obviously. If your commits are too small they become more cumbersome to deal -with. Strive to group logically distinct ideas into commits. - -For example, if you found that FeatureX needed some "prefactoring" to fit in, -make a commit that JUST does that prefactoring. Then make a new commit for -FeatureX. Don't lump unrelated things together just because you didn't think -about prefactoring. If you need to, fork a new branch, do the prefactoring -there and send a PR for that. If you can explain why you are doing seemingly -no-op work ("it makes the FeatureX change easier, I promise") we'll probably be -OK with it. - -Obviously, a PR with 25 commits is still very cumbersome to review, so use -common sense. - -## 3. Multiple small PRs are often better than multiple commits - -If you can extract whole ideas from your PR and send those as PRs of their own, -you can avoid the painful problem of continually rebasing. Kubernetes is a -fast-moving codebase - lock in your changes ASAP, and make merges be someone -else's problem. - -Obviously, we want every PR to be useful on its own, so you'll have to use -common sense in deciding what can be a PR vs what should be a commit in a larger -PR. Rule of thumb - if this commit or set of commits is directly related to -FeatureX and nothing else, it should probably be part of the FeatureX PR. If -you can plausibly imagine someone finding value in this commit outside of -FeatureX, try it as a PR. - -Don't worry about flooding us with PRs. We'd rather have 100 small, obvious PRs -than 10 unreviewable monoliths. - -## 4. Don't rename, reformat, comment, etc in the same PR - -Often, as you are implementing FeatureX, you find things that are just wrong. -Bad comments, poorly named functions, bad structure, weak type-safety. You -should absolutely fix those things (or at least file issues, please) - but not -in this PR. See the above points - break unrelated changes out into different -PRs or commits. Otherwise your diff will have WAY too many changes, and your -reviewer won't see the forest because of all the trees. - -## 5. Comments matter - -Read up on GoDoc - follow those general rules. If you're writing code and you -think there is any possible chance that someone might not understand why you did -something (or that you won't remember what you yourself did), comment it. If -you think there's something pretty obvious that we could follow up on, add a -TODO. Many code-review comments are about this exact issue. - -## 5. Tests are almost always required - -Nothing is more frustrating than doing a review, only to find that the tests are -inadequate or even entirely absent. Very few PRs can touch code and NOT touch -tests. If you don't know how to test FeatureX - ask! We'll be happy to help -you design things for easy testing or to suggest appropriate test cases. - -## 6. Look for opportunities to generify - -If you find yourself writing something that touches a lot of modules, think hard -about the dependencies you are introducing between packages. Can some of what -you're doing be made more generic and moved up and out of the FeatureX package? -Do you need to use a function or type from an otherwise unrelated package? If -so, promote! We have places specifically for hosting more generic code. - -Likewise if FeatureX is similar in form to FeatureW which was checked in last -month and it happens to exactly duplicate some tricky stuff from FeatureW, -consider prefactoring core logic out and using it in both FeatureW and FeatureX. -But do that in a different commit or PR, please. - -## 7. Fix feedback in a new commit - -Your reviewer has finally sent you some feedback on FeatureX. You make a bunch -of changes and ... what? You could patch those into your commits with git -"squash" or "fixup" logic. But that makes your changes hard to verify. Unless -your whole PR is pretty trivial, you should instead put your fixups into a new -commit and re-push. Your reviewer can then look at that commit on its own - so -much faster to review than starting over. - -We might still ask you to clean up your commits at the very end, for the sake -of a more readable history. - -## 8. KISS, YAGNI, MVP, etc - -Sometimes we need to remind each other of core tenets of software design - Keep -It Simple, You Aren't Gonna Need It, Minimum Viable Product, and so on. Adding -features "because we might need it later" is antithetical to software that -ships. Add the things you need NOW and (ideally) leave room for things you -might need later - but don't implement them now. - -## 9. Push back - -We understand that it is hard to imagine, but sometimes we make mistakes. It's -OK to push back on changes requested during a review. If you have a good reason -for doing something a certain way, you are absolutely allowed to debate the -merits of a requested change. You might be overruled, but you might also -prevail. We're mostly pretty reasonable people. Mostly. - -## 10. I'm still getting stalled - help?! - -So, you've done all that and you still aren't getting any PR love? Here's some -things you can do that might help kick a stalled process along: - - * Make sure that your PR has an assigned reviewer (assignee in GitHub). If - this is not the case, reply to the PR comment stream asking for one to be - assigned. - - * Ping the assignee (@username) on the PR comment stream asking for an - estimate of when they can get to it. - - * Ping the assignee by email (many of us have email addresses that are well - published or are the same as our GitHub handle @google.com or @redhat.com). - -If you think you have fixed all the issues in a round of review, and you haven't -heard back, you should ping the reviewer (assignee) on the comment stream with a -"please take another look" (PTAL) or similar comment indicating you are done and -you think it is ready for re-review. In fact, this is probably a good habit for -all PRs. - -One phenomenon of open-source projects (where anyone can comment on any issue) -is the dog-pile - your PR gets so many comments from so many people it becomes -hard to follow. In this situation you can ask the primary reviewer -(assignee) whether they want you to fork a new PR to clear out all the comments. -Remember: you don't HAVE to fix every issue raised by every person who feels -like commenting, but you should at least answer reasonable comments with an -explanation. - -## Final: Use common sense - -Obviously, none of these points are hard rules. There is no document that can -take the place of common sense and good taste. Use your best judgment, but put -a bit of thought into how your work can be made easier to review. If you do -these things your PRs will flow much more easily. - - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/devel/faster_reviews.md?pixel)]() - diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/devel/flaky-tests.md b/Godeps/_workspace/src/k8s.io/kubernetes/docs/devel/flaky-tests.md deleted file mode 100644 index 36f893834e5a..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/devel/flaky-tests.md +++ /dev/null @@ -1,103 +0,0 @@ - - - - -WARNING -WARNING -WARNING -WARNING -WARNING - -

    PLEASE NOTE: This document applies to the HEAD of the source tree

    - -If you are using a released version of Kubernetes, you should -refer to the docs that go with that version. - - -The latest 1.0.x release of this document can be found -[here](http://releases.k8s.io/release-1.0/docs/devel/flaky-tests.md). - -Documentation for other releases can be found at -[releases.k8s.io](http://releases.k8s.io). - --- - - - - - -# Hunting flaky tests in Kubernetes - -Sometimes unit tests are flaky. This means that due to (usually) race conditions, they will occasionally fail, even though most of the time they pass. - -We have a goal of 99.9% flake free tests. This means that there is only one flake in one thousand runs of a test. - -Running a test 1000 times on your own machine can be tedious and time consuming. Fortunately, there is a better way to achieve this using Kubernetes. - -_Note: these instructions are mildly hacky for now, as we get run once semantics and logging they will get better_ - -There is a testing image `brendanburns/flake` up on the docker hub. We will use this image to test our fix. - -Create a replication controller with the following config: - -```yaml -apiVersion: v1 -kind: ReplicationController -metadata: - name: flakecontroller -spec: - replicas: 24 - template: - metadata: - labels: - name: flake - spec: - containers: - - name: flake - image: brendanburns/flake - env: - - name: TEST_PACKAGE - value: pkg/tools - - name: REPO_SPEC - value: https://k8s.io/kubernetes -``` - -Note that we omit the labels and the selector fields of the replication controller, because they will be populated from the labels field of the pod template by default. - -```sh -kubectl create -f ./controller.yaml -``` - -This will spin up 24 instances of the test. They will run to completion, then exit, and the kubelet will restart them, accumulating more and more runs of the test. -You can examine the recent runs of the test by calling `docker ps -a` and looking for tasks that exited with non-zero exit codes. Unfortunately, docker ps -a only keeps around the exit status of the last 15-20 containers with the same image, so you have to check them frequently. -You can use this script to automate checking for failures, assuming your cluster is running on GCE and has four nodes: - -```sh -echo "" > output.txt -for i in {1..4}; do - echo "Checking kubernetes-minion-${i}" - echo "kubernetes-minion-${i}:" >> output.txt - gcloud compute ssh "kubernetes-minion-${i}" --command="sudo docker ps -a" >> output.txt -done -grep "Exited ([^0])" output.txt -``` - -Eventually you will have sufficient runs for your purposes. At that point you can stop and delete the replication controller by running: - -```sh -kubectl stop replicationcontroller flakecontroller -``` - -If you do a final check for flakes with `docker ps -a`, ignore tasks that exited -1, since that's what happens when you stop the replication controller. - -Happy flake hunting! - - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/devel/flaky-tests.md?pixel)]() - diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/devel/getting-builds.md b/Godeps/_workspace/src/k8s.io/kubernetes/docs/devel/getting-builds.md deleted file mode 100644 index bcb981c44723..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/devel/getting-builds.md +++ /dev/null @@ -1,60 +0,0 @@ - - - - -WARNING -WARNING -WARNING -WARNING -WARNING - -

    PLEASE NOTE: This document applies to the HEAD of the source tree

    - -If you are using a released version of Kubernetes, you should -refer to the docs that go with that version. - - -The latest 1.0.x release of this document can be found -[here](http://releases.k8s.io/release-1.0/docs/devel/getting-builds.md). - -Documentation for other releases can be found at -[releases.k8s.io](http://releases.k8s.io). - --- - - - - - -# Getting Kubernetes Builds - -You can use [hack/get-build.sh](http://releases.k8s.io/HEAD/hack/get-build.sh) to or use as a reference on how to get the most recent builds with curl. With `get-build.sh` you can grab the most recent stable build, the most recent release candidate, or the most recent build to pass our ci and gce e2e tests (essentially a nightly build). - -```console -usage: - ./hack/get-build.sh [stable|release|latest|latest-green] - - stable: latest stable version - release: latest release candidate - latest: latest ci build - latest-green: latest ci build to pass gce e2e -``` - -You can also use the gsutil tool to explore the Google Cloud Storage release bucket. Here are some examples: - -```sh -gsutil cat gs://kubernetes-release/ci/latest.txt # output the latest ci version number -gsutil cat gs://kubernetes-release/ci/latest-green.txt # output the latest ci version number that passed gce e2e -gsutil ls gs://kubernetes-release/ci/v0.20.0-29-g29a55cc/ # list the contents of a ci release -gsutil ls gs://kubernetes-release/release # list all official releases and rcs -``` - - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/devel/getting-builds.md?pixel)]() - diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/devel/git_workflow.png b/Godeps/_workspace/src/k8s.io/kubernetes/docs/devel/git_workflow.png deleted file mode 100644 index e3bd70da02c8..000000000000 Binary files a/Godeps/_workspace/src/k8s.io/kubernetes/docs/devel/git_workflow.png and /dev/null differ diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/devel/instrumentation.md b/Godeps/_workspace/src/k8s.io/kubernetes/docs/devel/instrumentation.md deleted file mode 100644 index ed51ebc05d53..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/devel/instrumentation.md +++ /dev/null @@ -1,70 +0,0 @@ - - - - -WARNING -WARNING -WARNING -WARNING -WARNING - -

    PLEASE NOTE: This document applies to the HEAD of the source tree

    - -If you are using a released version of Kubernetes, you should -refer to the docs that go with that version. - - -The latest 1.0.x release of this document can be found -[here](http://releases.k8s.io/release-1.0/docs/devel/instrumentation.md). - -Documentation for other releases can be found at -[releases.k8s.io](http://releases.k8s.io). - --- - - - - -Instrumenting Kubernetes with a new metric -=================== - -The following is a step-by-step guide for adding a new metric to the Kubernetes code base. - -We use the Prometheus monitoring system's golang client library for instrumenting our code. Once you've picked out a file that you want to add a metric to, you should: - -1. Import "github.com/prometheus/client_golang/prometheus". - -2. Create a top-level var to define the metric. For this, you have to: - 1. Pick the type of metric. Use a Gauge for things you want to set to a particular value, a Counter for things you want to increment, or a Histogram or Summary for histograms/distributions of values (typically for latency). Histograms are better if you're going to aggregate the values across jobs, while summaries are better if you just want the job to give you a useful summary of the values. - 2. Give the metric a name and description. - 3. Pick whether you want to distinguish different categories of things using labels on the metric. If so, add "Vec" to the name of the type of metric you want and add a slice of the label names to the definition. - - https://k8s.io/kubernetes/blob/cd3299307d44665564e1a5c77d0daa0286603ff5/pkg/apiserver/apiserver.go#L53 - https://k8s.io/kubernetes/blob/cd3299307d44665564e1a5c77d0daa0286603ff5/pkg/kubelet/metrics/metrics.go#L31 - -3. Register the metric so that prometheus will know to export it. - - https://k8s.io/kubernetes/blob/cd3299307d44665564e1a5c77d0daa0286603ff5/pkg/kubelet/metrics/metrics.go#L74 - https://k8s.io/kubernetes/blob/cd3299307d44665564e1a5c77d0daa0286603ff5/pkg/apiserver/apiserver.go#L78 - -4. Use the metric by calling the appropriate method for your metric type (Set, Inc/Add, or Observe, respectively for Gauge, Counter, or Histogram/Summary), first calling WithLabelValues if your metric has any labels - - https://k8s.io/kubernetes/blob/3ce7fe8310ff081dbbd3d95490193e1d5250d2c9/pkg/kubelet/kubelet.go#L1384 - https://k8s.io/kubernetes/blob/cd3299307d44665564e1a5c77d0daa0286603ff5/pkg/apiserver/apiserver.go#L87 - - -These are the metric type definitions if you're curious to learn about them or need more information: -https://github.com/prometheus/client_golang/blob/master/prometheus/gauge.go -https://github.com/prometheus/client_golang/blob/master/prometheus/counter.go -https://github.com/prometheus/client_golang/blob/master/prometheus/histogram.go -https://github.com/prometheus/client_golang/blob/master/prometheus/summary.go - - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/devel/instrumentation.md?pixel)]() - diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/devel/issues.md b/Godeps/_workspace/src/k8s.io/kubernetes/docs/devel/issues.md deleted file mode 100644 index a44bbb68aef2..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/devel/issues.md +++ /dev/null @@ -1,56 +0,0 @@ - - - - -WARNING -WARNING -WARNING -WARNING -WARNING - -

    PLEASE NOTE: This document applies to the HEAD of the source tree

    - -If you are using a released version of Kubernetes, you should -refer to the docs that go with that version. - - -The latest 1.0.x release of this document can be found -[here](http://releases.k8s.io/release-1.0/docs/devel/issues.md). - -Documentation for other releases can be found at -[releases.k8s.io](http://releases.k8s.io). - --- - - - - -GitHub Issues for the Kubernetes Project -======================================== - -A list quick overview of how we will review and prioritize incoming issues at https://k8s.io/kubernetes/issues - -Priorities ----------- - -We will use GitHub issue labels for prioritization. The absence of a priority label means the bug has not been reviewed and prioritized yet. - -Definitions ------------ -* P0 - something broken for users, build broken, or critical security issue. Someone must drop everything and work on it. -* P1 - must fix for earliest possible binary release (every two weeks) -* P2 - should be fixed in next major release version -* P3 - default priority for lower importance bugs that we still want to track and plan to fix at some point -* design - priority/design is for issues that are used to track design discussions -* support - priority/support is used for issues tracking user support requests -* untriaged - anything without a priority/X label will be considered untriaged - - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/devel/issues.md?pixel)]() - diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/devel/logging.md b/Godeps/_workspace/src/k8s.io/kubernetes/docs/devel/logging.md deleted file mode 100644 index 3870c4c32ac1..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/devel/logging.md +++ /dev/null @@ -1,63 +0,0 @@ - - - - -WARNING -WARNING -WARNING -WARNING -WARNING - -

    PLEASE NOTE: This document applies to the HEAD of the source tree

    - -If you are using a released version of Kubernetes, you should -refer to the docs that go with that version. - - -The latest 1.0.x release of this document can be found -[here](http://releases.k8s.io/release-1.0/docs/devel/logging.md). - -Documentation for other releases can be found at -[releases.k8s.io](http://releases.k8s.io). - --- - - - - -Logging Conventions -=================== - -The following conventions for the glog levels to use. [glog](http://godoc.org/github.com/golang/glog) is globally preferred to [log](http://golang.org/pkg/log/) for better runtime control. - -* glog.Errorf() - Always an error -* glog.Warningf() - Something unexpected, but probably not an error -* glog.Infof() has multiple levels: - * glog.V(0) - Generally useful for this to ALWAYS be visible to an operator - * Programmer errors - * Logging extra info about a panic - * CLI argument handling - * glog.V(1) - A reasonable default log level if you don't want verbosity. - * Information about config (listening on X, watching Y) - * Errors that repeat frequently that relate to conditions that can be corrected (pod detected as unhealthy) - * glog.V(2) - Useful steady state information about the service and important log messages that may correlate to significant changes in the system. This is the recommended default log level for most systems. - * Logging HTTP requests and their exit code - * System state changing (killing pod) - * Controller state change events (starting pods) - * Scheduler log messages - * glog.V(3) - Extended information about changes - * More info about system state changes - * glog.V(4) - Debug level verbosity (for now) - * Logging in particularly thorny parts of code where you may want to come back later and check it - -As per the comments, the practical default level is V(2). Developers and QE environments may wish to run at V(3) or V(4). If you wish to change the log level, you can pass in `-v=X` where X is the desired maximum level to log. - - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/devel/logging.md?pixel)]() - diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/devel/making-release-notes.md b/Godeps/_workspace/src/k8s.io/kubernetes/docs/devel/making-release-notes.md deleted file mode 100644 index c72a61f84601..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/devel/making-release-notes.md +++ /dev/null @@ -1,77 +0,0 @@ - - - - -WARNING -WARNING -WARNING -WARNING -WARNING - -

    PLEASE NOTE: This document applies to the HEAD of the source tree

    - -If you are using a released version of Kubernetes, you should -refer to the docs that go with that version. - - -The latest 1.0.x release of this document can be found -[here](http://releases.k8s.io/release-1.0/docs/devel/making-release-notes.md). - -Documentation for other releases can be found at -[releases.k8s.io](http://releases.k8s.io). - --- - - - - - -## Making release notes - -This documents the process for making release notes for a release. - -### 1) Note the PR number of the previous release - -Find the most-recent PR that was merged with the previous .0 release. Remember this as $LASTPR. -_TODO_: Figure out a way to record this somewhere to save the next release engineer time. - -Find the most-recent PR that was merged with the current .0 release. Remeber this as $CURRENTPR. - -### 2) Run the release-notes tool - -```bash -${KUBERNETES_ROOT}/build/make-release-notes.sh $LASTPR $CURRENTPR -``` - -### 3) Trim the release notes - -This generates a list of the entire set of PRs merged since the last minor -release. It is likely long and many PRs aren't worth mentioning. If any of the -PRs were cherrypicked into patches on the last minor release, you should exclude -them from the current release's notes. - -Open up `candidate-notes.md` in your favorite editor. - -Remove, regroup, organize to your hearts content. - - -### 4) Update CHANGELOG.md - -With the final markdown all set, cut and paste it to the top of `CHANGELOG.md` - -### 5) Update the Release page - - * Switch to the [releases](https://k8s.io/kubernetes/releases) page. - * Open up the release you are working on. - * Cut and paste the final markdown from above into the release notes - * Press Save. - - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/devel/making-release-notes.md?pixel)]() - diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/devel/profiling.md b/Godeps/_workspace/src/k8s.io/kubernetes/docs/devel/profiling.md deleted file mode 100644 index f563ce0a4752..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/devel/profiling.md +++ /dev/null @@ -1,79 +0,0 @@ - - - - -WARNING -WARNING -WARNING -WARNING -WARNING - -

    PLEASE NOTE: This document applies to the HEAD of the source tree

    - -If you are using a released version of Kubernetes, you should -refer to the docs that go with that version. - - -The latest 1.0.x release of this document can be found -[here](http://releases.k8s.io/release-1.0/docs/devel/profiling.md). - -Documentation for other releases can be found at -[releases.k8s.io](http://releases.k8s.io). - --- - - - - - -# Profiling Kubernetes - -This document explain how to plug in profiler and how to profile Kubernetes services. - -## Profiling library - -Go comes with inbuilt 'net/http/pprof' profiling library and profiling web service. The way service works is binding debug/pprof/ subtree on a running webserver to the profiler. Reading from subpages of debug/pprof returns pprof-formatted profiles of the running binary. The output can be processed offline by the tool of choice, or used as an input to handy 'go tool pprof', which can graphically represent the result. - -## Adding profiling to services to APIserver. - -TL;DR: Add lines: - -```go -m.mux.HandleFunc("/debug/pprof/", pprof.Index) -m.mux.HandleFunc("/debug/pprof/profile", pprof.Profile) -m.mux.HandleFunc("/debug/pprof/symbol", pprof.Symbol) -``` - -to the init(c *Config) method in 'pkg/master/master.go' and import 'net/http/pprof' package. - -In most use cases to use profiler service it's enough to do 'import _ net/http/pprof', which automatically registers a handler in the default http.Server. Slight inconvenience is that APIserver uses default server for intra-cluster communication, so plugging profiler to it is not really useful. In 'pkg/master/server/server.go' more servers are created and started as separate goroutines. The one that is usually serving external traffic is secureServer. The handler for this traffic is defined in 'pkg/master/master.go' and stored in Handler variable. It is created from HTTP multiplexer, so the only thing that needs to be done is adding profiler handler functions to this multiplexer. This is exactly what lines after TL;DR do. - -## Connecting to the profiler - -Even when running profiler I found not really straightforward to use 'go tool pprof' with it. The problem is that at least for dev purposes certificates generated for APIserver are not signed by anyone trusted and because secureServer serves only secure traffic it isn't straightforward to connect to the service. The best workaround I found is by creating an ssh tunnel from the kubernetes_master open unsecured port to some external server, and use this server as a proxy. To save everyone looking for correct ssh flags, it is done by running: - -```sh -ssh kubernetes_master -L:localhost:8080 -``` - -or analogous one for you Cloud provider. Afterwards you can e.g. run - -```sh -go tool pprof http://localhost:/debug/pprof/profile -``` - -to get 30 sec. CPU profile. - -## Contention profiling - -To enable contention profiling you need to add line `rt.SetBlockProfileRate(1)` in addition to `m.mux.HandleFunc(...)` added before (`rt` stands for `runtime` in `master.go`). This enables 'debug/pprof/block' subpage, which can be used as an input to `go tool pprof`. - - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/devel/profiling.md?pixel)]() - diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/devel/pull-requests.md b/Godeps/_workspace/src/k8s.io/kubernetes/docs/devel/pull-requests.md deleted file mode 100644 index 7cebaf482b34..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/devel/pull-requests.md +++ /dev/null @@ -1,66 +0,0 @@ - - - - -WARNING -WARNING -WARNING -WARNING -WARNING - -

    PLEASE NOTE: This document applies to the HEAD of the source tree

    - -If you are using a released version of Kubernetes, you should -refer to the docs that go with that version. - - -The latest 1.0.x release of this document can be found -[here](http://releases.k8s.io/release-1.0/docs/devel/pull-requests.md). - -Documentation for other releases can be found at -[releases.k8s.io](http://releases.k8s.io). - --- - - - - -Pull Request Process -==================== - -An overview of how we will manage old or out-of-date pull requests. - -Process -------- - -We will close any pull requests older than two weeks. - -Exceptions can be made for PRs that have active review comments, or that are awaiting other dependent PRs. Closed pull requests are easy to recreate, and little work is lost by closing a pull request that subsequently needs to be reopened. - -We want to limit the total number of PRs in flight to: -* Maintain a clean project -* Remove old PRs that would be difficult to rebase as the underlying code has changed over time -* Encourage code velocity - -RC to v1.0 Pull Requests ------------------------- - -Between the first RC build (~6/22) and v1.0, we will adopt a higher bar for PR merges. For v1.0 to be a stable release, we need to ensure that any fixes going in are very well tested and have a low risk of breaking anything. Refactors and complex changes will be rejected in favor of more strategic and smaller workarounds. - -These PRs require: -* A risk assessment by the code author in the PR. This should outline which parts of the code are being touched, the risk of regression, and complexity of the code. -* Two LGTMs from experienced reviewers. - -Once those requirements are met, they will be labeled [ok-to-merge](https://k8s.io/kubernetes/pulls?utf8=%E2%9C%93&q=is%3Aopen+is%3Apr+label%3Aok-to-merge) and can be merged. - -These restrictions will be relaxed after v1.0 is released. - - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/devel/pull-requests.md?pixel)]() - diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/devel/releasing.dot b/Godeps/_workspace/src/k8s.io/kubernetes/docs/devel/releasing.dot deleted file mode 100644 index fe8124c36da7..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/devel/releasing.dot +++ /dev/null @@ -1,113 +0,0 @@ -// Build it with: -// $ dot -Tsvg releasing.dot >releasing.svg - -digraph tagged_release { - size = "5,5" - // Arrows go up. - rankdir = BT - subgraph left { - // Group the left nodes together. - ci012abc -> pr101 -> ci345cde -> pr102 - style = invis - } - subgraph right { - // Group the right nodes together. - version_commit -> dev_commit - style = invis - } - { // Align the version commit and the info about it. - rank = same - // Align them with pr101 - pr101 - version_commit - // release_info shows the change in the commit. - release_info - } - { // Align the dev commit and the info about it. - rank = same - // Align them with 345cde - ci345cde - dev_commit - dev_info - } - // Join the nodes from subgraph left. - pr99 -> ci012abc - pr102 -> pr100 - // Do the version node. - pr99 -> version_commit - dev_commit -> pr100 - tag -> version_commit - pr99 [ - label = "Merge PR #99" - shape = box - fillcolor = "#ccccff" - style = "filled" - fontname = "Helvetica Neue, Helvetica, Segoe UI, Arial, freesans, sans-serif" - ]; - ci012abc [ - label = "012abc" - shape = circle - fillcolor = "#ffffcc" - style = "filled" - fontname = "Consolas, Liberation Mono, Menlo, Courier, monospace" - ]; - pr101 [ - label = "Merge PR #101" - shape = box - fillcolor = "#ccccff" - style = "filled" - fontname = "Helvetica Neue, Helvetica, Segoe UI, Arial, freesans, sans-serif" - ]; - ci345cde [ - label = "345cde" - shape = circle - fillcolor = "#ffffcc" - style = "filled" - fontname = "Consolas, Liberation Mono, Menlo, Courier, monospace" - ]; - pr102 [ - label = "Merge PR #102" - shape = box - fillcolor = "#ccccff" - style = "filled" - fontname = "Helvetica Neue, Helvetica, Segoe UI, Arial, freesans, sans-serif" - ]; - version_commit [ - label = "678fed" - shape = circle - fillcolor = "#ccffcc" - style = "filled" - fontname = "Consolas, Liberation Mono, Menlo, Courier, monospace" - ]; - dev_commit [ - label = "456dcb" - shape = circle - fillcolor = "#ffffcc" - style = "filled" - fontname = "Consolas, Liberation Mono, Menlo, Courier, monospace" - ]; - pr100 [ - label = "Merge PR #100" - shape = box - fillcolor = "#ccccff" - style = "filled" - fontname = "Helvetica Neue, Helvetica, Segoe UI, Arial, freesans, sans-serif" - ]; - release_info [ - label = "pkg/version/base.go:\ngitVersion = \"v0.5\";" - shape = none - fontname = "Helvetica Neue, Helvetica, Segoe UI, Arial, freesans, sans-serif" - ]; - dev_info [ - label = "pkg/version/base.go:\ngitVersion = \"v0.5-dev\";" - shape = none - fontname = "Helvetica Neue, Helvetica, Segoe UI, Arial, freesans, sans-serif" - ]; - tag [ - label = "$ git tag -a v0.5" - fillcolor = "#ffcccc" - style = "filled" - fontname = "Helvetica Neue, Helvetica, Segoe UI, Arial, freesans, sans-serif" - ]; -} - diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/devel/releasing.md b/Godeps/_workspace/src/k8s.io/kubernetes/docs/devel/releasing.md deleted file mode 100644 index 9950e6e4f05f..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/devel/releasing.md +++ /dev/null @@ -1,343 +0,0 @@ - - - - -WARNING -WARNING -WARNING -WARNING -WARNING - -

    PLEASE NOTE: This document applies to the HEAD of the source tree

    - -If you are using a released version of Kubernetes, you should -refer to the docs that go with that version. - - -The latest 1.0.x release of this document can be found -[here](http://releases.k8s.io/release-1.0/docs/devel/releasing.md). - -Documentation for other releases can be found at -[releases.k8s.io](http://releases.k8s.io). - --- - - - - - -# Releasing Kubernetes - -This document explains how to cut a release, and the theory behind it. If you -just want to cut a release and move on with your life, you can stop reading -after the first section. - -## How to cut a Kubernetes release - -Regardless of whether you are cutting a major or minor version, cutting a -release breaks down into four pieces: - -1. Selecting release components. -1. Tagging and merging the release in Git. -1. Building and pushing the binaries. -1. Writing release notes. - -You should progress in this strict order. - -### Building a New Major/Minor Version (`vX.Y.0`) - -#### Selecting Release Components - -When cutting a major/minor release, your first job is to find the branch -point. We cut `vX.Y.0` releases directly from `master`, which is also the -branch that we have most continuous validation on. Go first to [the main GCE -Jenkins end-to-end job](http://go/k8s-test/job/kubernetes-e2e-gce) and next to [the -Critical Builds page](http://go/k8s-test/view/Critical%20Builds) and hopefully find a -recent Git hash that looks stable across at least `kubernetes-e2e-gce` and -`kubernetes-e2e-gke-ci`. First glance through builds and look for nice solid -rows of green builds, and then check temporally with the other Critical Builds -to make sure they're solid around then as well. Once you find some greens, you -can find the Git hash for a build by looking at the "Console Log", then look for -`githash=`. You should see a line line: - -```console -+ githash=v0.20.2-322-g974377b -``` - -Because Jenkins builds frequently, if you're looking between jobs -(e.g. `kubernetes-e2e-gke-ci` and `kubernetes-e2e-gce`), there may be no single -`githash` that's been run on both jobs. In that case, take the a green -`kubernetes-e2e-gce` build (but please check that it corresponds to a temporally -similar build that's green on `kubernetes-e2e-gke-ci`). Lastly, if you're having -trouble understanding why the GKE continuous integration clusters are failing -and you're trying to cut a release, don't hesitate to contact the GKE -oncall. - -Before proceeding to the next step: - -```sh -export BRANCHPOINT=v0.20.2-322-g974377b -``` - -Where `v0.20.2-322-g974377b` is the git hash you decided on. This will become -our (retroactive) branch point. - -#### Branching, Tagging and Merging - -Do the following: - -1. `export VER=x.y` (e.g. `0.20` for v0.20) -1. cd to the base of the repo -1. `git fetch upstream && git checkout -b release-${VER} ${BRANCHPOINT}` (you did set `${BRANCHPOINT}`, right?) -1. Make sure you don't have any files you care about littering your repo (they - better be checked in or outside the repo, or the next step will delete them). -1. `make clean && git reset --hard HEAD && git clean -xdf` -1. `make` (TBD: you really shouldn't have to do this, but the swagger output step requires it right now) -1. `./build/mark-new-version.sh v${VER}.0` to mark the new release and get further - instructions. This creates a series of commits on the branch you're working - on (`release-${VER}`), including forking our documentation for the release, - the release version commit (which is then tagged), and the post-release - version commit. -1. Follow the instructions given to you by that script. They are canon for the - remainder of the Git process. If you don't understand something in that - process, please ask! - -**TODO**: how to fix tags, etc., if you have to shift the release branchpoint. - -#### Building and Pushing Binaries - -In your git repo (you still have `${VER}` set from above right?): - -1. `git checkout upstream/master && build/build-official-release.sh v${VER}.0` (the `build-official-release.sh` script is version agnostic, so it's best to run it off `master` directly). -1. Follow the instructions given to you by that script. -1. At this point, you've done all the Git bits, you've got all the binary bits pushed, and you've got the template for the release started on GitHub. - -#### Writing Release Notes - -[This helpful guide](making-release-notes.md) describes how to write release -notes for a major/minor release. In the release template on GitHub, leave the -last PR number that the tool finds for the `.0` release, so the next releaser -doesn't have to hunt. - -### Building a New Patch Release (`vX.Y.Z` for `Z > 0`) - -#### Selecting Release Components - -We cut `vX.Y.Z` releases from the `release-vX.Y` branch after all cherry picks -to the branch have been resolved. You should ensure all outstanding cherry picks -have been reviewed and merged and the branch validated on Jenkins (validation -TBD). See the [Cherry Picks](cherry-picks.md) for more information on how to -manage cherry picks prior to cutting the release. - -#### Tagging and Merging - -1. `export VER=x.y` (e.g. `0.20` for v0.20) -1. `export PATCH=Z` where `Z` is the patch level of `vX.Y.Z` -1. cd to the base of the repo -1. `git fetch upstream && git checkout -b upstream/release-${VER}` -1. Make sure you don't have any files you care about littering your repo (they - better be checked in or outside the repo, or the next step will delete them). -1. `make clean && git reset --hard HEAD && git clean -xdf` -1. `make` (TBD: you really shouldn't have to do this, but the swagger output step requires it right now) -1. `./build/mark-new-version.sh v${VER}.${PATCH}` to mark the new release and get further - instructions. This creates a series of commits on the branch you're working - on (`release-${VER}`), including forking our documentation for the release, - the release version commit (which is then tagged), and the post-release - version commit. -1. Follow the instructions given to you by that script. They are canon for the - remainder of the Git process. If you don't understand something in that - process, please ask! When proposing PRs, you can pre-fill the body with - `hack/cherry_pick_list.sh upstream/release-${VER}` to inform people of what - is already on the branch. - -**TODO**: how to fix tags, etc., if the release is changed. - -#### Building and Pushing Binaries - -In your git repo (you still have `${VER}` and `${PATCH}` set from above right?): - -1. `git checkout upstream/master && build/build-official-release.sh - v${VER}.${PATCH}` (the `build-official-release.sh` script is version - agnostic, so it's best to run it off `master` directly). -1. Follow the instructions given to you by that script. At this point, you've - done all the Git bits, you've got all the binary bits pushed, and you've got - the template for the release started on GitHub. - -#### Writing Release Notes - -Run `hack/cherry_pick_list.sh ${VER}.${PATCH}~1` to get the release notes for -the patch release you just created. Feel free to prune anything internal, like -you would for a major release, but typically for patch releases we tend to -include everything in the release notes. - -## Origin of the Sources - -Kubernetes may be built from either a git tree (using `hack/build-go.sh`) or -from a tarball (using either `hack/build-go.sh` or `go install`) or directly by -the Go native build system (using `go get`). - -When building from git, we want to be able to insert specific information about -the build tree at build time. In particular, we want to use the output of `git -describe` to generate the version of Kubernetes and the status of the build -tree (add a `-dirty` prefix if the tree was modified.) - -When building from a tarball or using the Go build system, we will not have -access to the information about the git tree, but we still want to be able to -tell whether this build corresponds to an exact release (e.g. v0.3) or is -between releases (e.g. at some point in development between v0.3 and v0.4). - -## Version Number Format - -In order to account for these use cases, there are some specific formats that -may end up representing the Kubernetes version. Here are a few examples: - -- **v0.5**: This is official version 0.5 and this version will only be used - when building from a clean git tree at the v0.5 git tag, or from a tree - extracted from the tarball corresponding to that specific release. -- **v0.5-15-g0123abcd4567**: This is the `git describe` output and it indicates - that we are 15 commits past the v0.5 release and that the SHA1 of the commit - where the binaries were built was `0123abcd4567`. It is only possible to have - this level of detail in the version information when building from git, not - when building from a tarball. -- **v0.5-15-g0123abcd4567-dirty** or **v0.5-dirty**: The extra `-dirty` prefix - means that the tree had local modifications or untracked files at the time of - the build, so there's no guarantee that the source code matches exactly the - state of the tree at the `0123abcd4567` commit or at the `v0.5` git tag - (resp.) -- **v0.5-dev**: This means we are building from a tarball or using `go get` or, - if we have a git tree, we are using `go install` directly, so it is not - possible to inject the git version into the build information. Additionally, - this is not an official release, so the `-dev` prefix indicates that the - version we are building is after `v0.5` but before `v0.6`. (There is actually - an exception where a commit with `v0.5-dev` is not present on `v0.6`, see - later for details.) - -## Injecting Version into Binaries - -In order to cover the different build cases, we start by providing information -that can be used when using only Go build tools or when we do not have the git -version information available. - -To be able to provide a meaningful version in those cases, we set the contents -of variables in a Go source file that will be used when no overrides are -present. - -We are using `pkg/version/base.go` as the source of versioning in absence of -information from git. Here is a sample of that file's contents: - -```go -var ( - gitVersion string = "v0.4-dev" // version from git, output of $(git describe) - gitCommit string = "" // sha1 from git, output of $(git rev-parse HEAD) -) -``` - -This means a build with `go install` or `go get` or a build from a tarball will -yield binaries that will identify themselves as `v0.4-dev` and will not be able -to provide you with a SHA1. - -To add the extra versioning information when building from git, the -`hack/build-go.sh` script will gather that information (using `git describe` and -`git rev-parse`) and then create a `-ldflags` string to pass to `go install` and -tell the Go linker to override the contents of those variables at build time. It -can, for instance, tell it to override `gitVersion` and set it to -`v0.4-13-g4567bcdef6789-dirty` and set `gitCommit` to `4567bcdef6789...` which -is the complete SHA1 of the (dirty) tree used at build time. - -## Handling Official Versions - -Handling official versions from git is easy, as long as there is an annotated -git tag pointing to a specific version then `git describe` will return that tag -exactly which will match the idea of an official version (e.g. `v0.5`). - -Handling it on tarballs is a bit harder since the exact version string must be -present in `pkg/version/base.go` for it to get embedded into the binaries. But -simply creating a commit with `v0.5` on its own would mean that the commits -coming after it would also get the `v0.5` version when built from tarball or `go -get` while in fact they do not match `v0.5` (the one that was tagged) exactly. - -To handle that case, creating a new release should involve creating two adjacent -commits where the first of them will set the version to `v0.5` and the second -will set it to `v0.5-dev`. In that case, even in the presence of merges, there -will be a single commit where the exact `v0.5` version will be used and all -others around it will either have `v0.4-dev` or `v0.5-dev`. - -The diagram below illustrates it. - -![Diagram of git commits involved in the release](releasing.png) - -After working on `v0.4-dev` and merging PR 99 we decide it is time to release -`v0.5`. So we start a new branch, create one commit to update -`pkg/version/base.go` to include `gitVersion = "v0.5"` and `git commit` it. - -We test it and make sure everything is working as expected. - -Before sending a PR for it, we create a second commit on that same branch, -updating `pkg/version/base.go` to include `gitVersion = "v0.5-dev"`. That will -ensure that further builds (from tarball or `go install`) on that tree will -always include the `-dev` prefix and will not have a `v0.5` version (since they -do not match the official `v0.5` exactly.) - -We then send PR 100 with both commits in it. - -Once the PR is accepted, we can use `git tag -a` to create an annotated tag -*pointing to the one commit* that has `v0.5` in `pkg/version/base.go` and push -it to GitHub. (Unfortunately GitHub tags/releases are not annotated tags, so -this needs to be done from a git client and pushed to GitHub using SSH or -HTTPS.) - -## Parallel Commits - -While we are working on releasing `v0.5`, other development takes place and -other PRs get merged. For instance, in the example above, PRs 101 and 102 get -merged to the master branch before the versioning PR gets merged. - -This is not a problem, it is only slightly inaccurate that checking out the tree -at commit `012abc` or commit `345cde` or at the commit of the merges of PR 101 -or 102 will yield a version of `v0.4-dev` *but* those commits are not present in -`v0.5`. - -In that sense, there is a small window in which commits will get a -`v0.4-dev` or `v0.4-N-gXXX` label and while they're indeed later than `v0.4` -but they are not really before `v0.5` in that `v0.5` does not contain those -commits. - -Unfortunately, there is not much we can do about it. On the other hand, other -projects seem to live with that and it does not really become a large problem. - -As an example, Docker commit a327d9b91edf has a `v1.1.1-N-gXXX` label but it is -not present in Docker `v1.2.0`: - -```console -$ git describe a327d9b91edf -v1.1.1-822-ga327d9b91edf - -$ git log --oneline v1.2.0..a327d9b91edf -a327d9b91edf Fix data space reporting from Kb/Mb to KB/MB - -(Non-empty output here means the commit is not present on v1.2.0.) -``` - -## Release Notes - -No official release should be made final without properly matching release notes. - -There should be made available, per release, a small summary, preamble, of the -major changes, both in terms of feature improvements/bug fixes and notes about -functional feature changes (if any) regarding the previous released version so -that the BOM regarding updating to it gets as obvious and trouble free as possible. - -After this summary, preamble, all the relevant PRs/issues that got in that -version should be listed and linked together with a small summary understandable -by plain mortals (in a perfect world PR/issue's title would be enough but often -it is just too cryptic/geeky/domain-specific that it isn't). - - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/devel/releasing.md?pixel)]() - diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/devel/releasing.png b/Godeps/_workspace/src/k8s.io/kubernetes/docs/devel/releasing.png deleted file mode 100644 index 935628deddc5..000000000000 Binary files a/Godeps/_workspace/src/k8s.io/kubernetes/docs/devel/releasing.png and /dev/null differ diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/devel/releasing.svg b/Godeps/_workspace/src/k8s.io/kubernetes/docs/devel/releasing.svg deleted file mode 100644 index f703e6e2ac96..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/devel/releasing.svg +++ /dev/null @@ -1,113 +0,0 @@ - - - - - - -tagged_release - - -ci012abc - -012abc - - -pr101 - -Merge PR #101 - - -ci012abc->pr101 - - - - -ci345cde - -345cde - - -pr101->ci345cde - - - - -pr102 - -Merge PR #102 - - -ci345cde->pr102 - - - - -pr100 - -Merge PR #100 - - -pr102->pr100 - - - - -version_commit - -678fed - - -dev_commit - -456dcb - - -version_commit->dev_commit - - - - -dev_commit->pr100 - - - - -release_info -pkg/version/base.go: -gitVersion = "v0.5"; - - -dev_info -pkg/version/base.go: -gitVersion = "v0.5-dev"; - - -pr99 - -Merge PR #99 - - -pr99->ci012abc - - - - -pr99->version_commit - - - - -tag - -$ git tag -a v0.5 - - -tag->version_commit - - - - - diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/devel/scheduler.md b/Godeps/_workspace/src/k8s.io/kubernetes/docs/devel/scheduler.md deleted file mode 100644 index b2a137d510d7..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/devel/scheduler.md +++ /dev/null @@ -1,84 +0,0 @@ - - - - -WARNING -WARNING -WARNING -WARNING -WARNING - -

    PLEASE NOTE: This document applies to the HEAD of the source tree

    - -If you are using a released version of Kubernetes, you should -refer to the docs that go with that version. - - -The latest 1.0.x release of this document can be found -[here](http://releases.k8s.io/release-1.0/docs/devel/scheduler.md). - -Documentation for other releases can be found at -[releases.k8s.io](http://releases.k8s.io). - --- - - - - - -# The Kubernetes Scheduler - -The Kubernetes scheduler runs as a process alongside the other master -components such as the API server. Its interface to the API server is to watch -for Pods with an empty PodSpec.NodeName, and for each Pod, it posts a Binding -indicating where the Pod should be scheduled. - -## The scheduling process - -The scheduler tries to find a node for each Pod, one at a time, as it notices -these Pods via watch. There are three steps. First it applies a set of "predicates" that filter out -inappropriate nodes. For example, if the PodSpec specifies resource limits, then the scheduler -will filter out nodes that don't have at least that much resources available (computed -as the capacity of the node minus the sum of the resource limits of the containers that -are already running on the node). Second, it applies a set of "priority functions" -that rank the nodes that weren't filtered out by the predicate check. For example, -it tries to spread Pods across nodes while at the same time favoring the least-loaded -nodes (where "load" here is sum of the resource limits of the containers running on the node, -divided by the node's capacity). -Finally, the node with the highest priority is chosen -(or, if there are multiple such nodes, then one of them is chosen at random). The code -for this main scheduling loop is in the function `Schedule()` in -[plugin/pkg/scheduler/generic_scheduler.go](http://releases.k8s.io/HEAD/plugin/pkg/scheduler/generic_scheduler.go) - -## Scheduler extensibility - -The scheduler is extensible: the cluster administrator can choose which of the pre-defined -scheduling policies to apply, and can add new ones. The built-in predicates and priorities are -defined in [plugin/pkg/scheduler/algorithm/predicates/predicates.go](http://releases.k8s.io/HEAD/plugin/pkg/scheduler/algorithm/predicates/predicates.go) and -[plugin/pkg/scheduler/algorithm/priorities/priorities.go](http://releases.k8s.io/HEAD/plugin/pkg/scheduler/algorithm/priorities/priorities.go), respectively. -The policies that are applied when scheduling can be chosen in one of two ways. Normally, -the policies used are selected by the functions `defaultPredicates()` and `defaultPriorities()` in -[plugin/pkg/scheduler/algorithmprovider/defaults/defaults.go](http://releases.k8s.io/HEAD/plugin/pkg/scheduler/algorithmprovider/defaults/defaults.go). -However, the choice of policies -can be overridden by passing the command-line flag `--policy-config-file` to the scheduler, pointing to a JSON -file specifying which scheduling policies to use. See -[examples/scheduler-policy-config.json](../../examples/scheduler-policy-config.json) for an example -config file. (Note that the config file format is versioned; the API is defined in -[plugin/pkg/scheduler/api](http://releases.k8s.io/HEAD/plugin/pkg/scheduler/api/)). -Thus to add a new scheduling policy, you should modify predicates.go or priorities.go, -and either register the policy in `defaultPredicates()` or `defaultPriorities()`, or use a policy config file. - -## Exploring the code - -If you want to get a global picture of how the scheduler works, you can start in -[plugin/cmd/kube-scheduler/app/server.go](http://releases.k8s.io/HEAD/plugin/cmd/kube-scheduler/app/server.go) - - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/devel/scheduler.md?pixel)]() - diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/devel/scheduler_algorithm.md b/Godeps/_workspace/src/k8s.io/kubernetes/docs/devel/scheduler_algorithm.md deleted file mode 100644 index ab8e69ef8e2a..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/devel/scheduler_algorithm.md +++ /dev/null @@ -1,72 +0,0 @@ - - - - -WARNING -WARNING -WARNING -WARNING -WARNING - -

    PLEASE NOTE: This document applies to the HEAD of the source tree

    - -If you are using a released version of Kubernetes, you should -refer to the docs that go with that version. - - -The latest 1.0.x release of this document can be found -[here](http://releases.k8s.io/release-1.0/docs/devel/scheduler_algorithm.md). - -Documentation for other releases can be found at -[releases.k8s.io](http://releases.k8s.io). - --- - - - - - -# Scheduler Algorithm in Kubernetes - -For each unscheduled Pod, the Kubernetes scheduler tries to find a node across the cluster according to a set of rules. A general introduction to the Kubernetes scheduler can be found at [scheduler.md](scheduler.md). In this document, the algorithm of how to select a node for the Pod is explained. There are two steps before a destination node of a Pod is chosen. The first step is filtering all the nodes and the second is ranking the remaining nodes to find a best fit for the Pod. - -## Filtering the nodes - -The purpose of filtering the nodes is to filter out the nodes that do not meet certain requirements of the Pod. For example, if the free resource on a node (measured by the capacity minus the sum of the resource limits of all the Pods that already run on the node) is less than the Pod's required resource, the node should not be considered in the ranking phase so it is filtered out. Currently, there are several "predicates" implementing different filtering policies, including: - -- `NoDiskConflict`: Evaluate if a pod can fit due to the volumes it requests, and those that are already mounted. -- `PodFitsResources`: Check if the free resource (CPU and Memory) meets the requirement of the Pod. The free resource is measured by the capacity minus the sum of limits of all Pods on the node. -- `PodFitsPorts`: Check if any HostPort required by the Pod is already occupied on the node. -- `PodFitsHost`: Filter out all nodes except the one specified in the PodSpec's NodeName field. -- `PodSelectorMatches`: Check if the labels of the node match the labels specified in the Pod's `nodeSelector` field ([Here](../user-guide/node-selection/) is an example of how to use `nodeSelector` field). -- `CheckNodeLabelPresence`: Check if all the specified labels exist on a node or not, regardless of the value. - -The details of the above predicates can be found in [plugin/pkg/scheduler/algorithm/predicates/predicates.go](http://releases.k8s.io/HEAD/plugin/pkg/scheduler/algorithm/predicates/predicates.go). All predicates mentioned above can be used in combination to perform a sophisticated filtering policy. Kubernetes uses some, but not all, of these predicates by default. You can see which ones are used by default in [plugin/pkg/scheduler/algorithmprovider/defaults/defaults.go](http://releases.k8s.io/HEAD/plugin/pkg/scheduler/algorithmprovider/defaults/defaults.go). - -## Ranking the nodes - -The filtered nodes are considered suitable to host the Pod, and it is often that there are more than one nodes remaining. Kubernetes prioritizes the remaining nodes to find the "best" one for the Pod. The prioritization is performed by a set of priority functions. For each remaining node, a priority function gives a score which scales from 0-10 with 10 representing for "most preferred" and 0 for "least preferred". Each priority function is weighted by a positive number and the final score of each node is calculated by adding up all the weighted scores. For example, suppose there are two priority functions, `priorityFunc1` and `priorityFunc2` with weighting factors `weight1` and `weight2` respectively, the final score of some NodeA is: - - finalScoreNodeA = (weight1 * priorityFunc1) + (weight2 * priorityFunc2) - -After the scores of all nodes are calculated, the node with highest score is chosen as the host of the Pod. If there are more than one nodes with equal highest scores, a random one among them is chosen. - -Currently, Kubernetes scheduler provides some practical priority functions, including: - -- `LeastRequestedPriority`: The node is prioritized based on the fraction of the node that would be free if the new Pod were scheduled onto the node. (In other words, (capacity - sum of limits of all Pods already on the node - limit of Pod that is being scheduled) / capacity). CPU and memory are equally weighted. The node with the highest free fraction is the most preferred. Note that this priority function has the effect of spreading Pods across the nodes with respect to resource consumption. -- `CalculateNodeLabelPriority`: Prefer nodes that have the specified label. -- `BalancedResourceAllocation`: This priority function tries to put the Pod on a node such that the CPU and Memory utilization rate is balanced after the Pod is deployed. -- `CalculateSpreadPriority`: Spread Pods by minimizing the number of Pods belonging to the same service on the same node. -- `CalculateAntiAffinityPriority`: Spread Pods by minimizing the number of Pods belonging to the same service on nodes with the same value for a particular label. - -The details of the above priority functions can be found in [plugin/pkg/scheduler/algorithm/priorities](http://releases.k8s.io/HEAD/plugin/pkg/scheduler/algorithm/priorities/). Kubernetes uses some, but not all, of these priority functions by default. You can see which ones are used by default in [plugin/pkg/scheduler/algorithmprovider/defaults/defaults.go](http://releases.k8s.io/HEAD/plugin/pkg/scheduler/algorithmprovider/defaults/defaults.go). Similar as predicates, you can combine the above priority functions and assign weight factors (positive number) to them as you want (check [scheduler.md](scheduler.md) for how to customize). - - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/devel/scheduler_algorithm.md?pixel)]() - diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/devel/writing-a-getting-started-guide.md b/Godeps/_workspace/src/k8s.io/kubernetes/docs/devel/writing-a-getting-started-guide.md deleted file mode 100644 index 04d0d67f6a98..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/devel/writing-a-getting-started-guide.md +++ /dev/null @@ -1,134 +0,0 @@ - - - - -WARNING -WARNING -WARNING -WARNING -WARNING - -

    PLEASE NOTE: This document applies to the HEAD of the source tree

    - -If you are using a released version of Kubernetes, you should -refer to the docs that go with that version. - - -The latest 1.0.x release of this document can be found -[here](http://releases.k8s.io/release-1.0/docs/devel/writing-a-getting-started-guide.md). - -Documentation for other releases can be found at -[releases.k8s.io](http://releases.k8s.io). - --- - - - - - -# Writing a Getting Started Guide - -This page gives some advice for anyone planning to write or update a Getting Started Guide for Kubernetes. -It also gives some guidelines which reviewers should follow when reviewing a pull request for a -guide. - -A Getting Started Guide is instructions on how to create a Kubernetes cluster on top of a particular -type(s) of infrastructure. Infrastructure includes: the IaaS provider for VMs; -the node OS; inter-node networking; and node Configuration Management system. -A guide refers to scripts, Configuration Management files, and/or binary assets such as RPMs. We call -the combination of all these things needed to run on a particular type of infrastructure a -**distro**. - -[The Matrix](../../docs/getting-started-guides/README.md) lists the distros. If there is already a guide -which is similar to the one you have planned, consider improving that one. - - -Distros fall into two categories: - - **versioned distros** are tested to work with a particular binary release of Kubernetes. These - come in a wide variety, reflecting a wide range of ideas and preferences in how to run a cluster. - - **development distros** are tested work with the latest Kubernetes source code. But, there are - relatively few of these and the bar is much higher for creating one. They must support - fully automated cluster creation, deletion, and upgrade. - -There are different guidelines for each. - -## Versioned Distro Guidelines - -These guidelines say *what* to do. See the Rationale section for *why*. - - Send us a PR. - - Put the instructions in `docs/getting-started-guides/...`. Scripts go there too. This helps devs easily - search for uses of flags by guides. - - We may ask that you host binary assets or large amounts of code in our `contrib` directory or on your - own repo. - - Add or update a row in [The Matrix](../../docs/getting-started-guides/README.md). - - State the binary version of Kubernetes that you tested clearly in your Guide doc. - - Setup a cluster and run the [conformance test](development.md#conformance-testing) against it, and report the - results in your PR. - - Versioned distros should typically not modify or add code in `cluster/`. That is just scripts for developer - distros. - - When a new major or minor release of Kubernetes comes out, we may also release a new - conformance test, and require a new conformance test run to earn a conformance checkmark. - -If you have a cluster partially working, but doing all the above steps seems like too much work, -we still want to hear from you. We suggest you write a blog post or a Gist, and we will link to it on our wiki page. -Just file an issue or chat us on IRC and one of the committers will link to it from the wiki. - -## Development Distro Guidelines - -These guidelines say *what* to do. See the Rationale section for *why*. - - the main reason to add a new development distro is to support a new IaaS provider (VM and - network management). This means implementing a new `pkg/cloudprovider/$IAAS_NAME`. - - Development distros should use Saltstack for Configuration Management. - - development distros need to support automated cluster creation, deletion, upgrading, etc. - This mean writing scripts in `cluster/$IAAS_NAME`. - - all commits to the tip of this repo need to not break any of the development distros - - the author of the change is responsible for making changes necessary on all the cloud-providers if the - change affects any of them, and reverting the change if it breaks any of the CIs. - - a development distro needs to have an organization which owns it. This organization needs to: - - Setting up and maintaining Continuous Integration that runs e2e frequently (multiple times per day) against the - Distro at head, and which notifies all devs of breakage. - - being reasonably available for questions and assisting with - refactoring and feature additions that affect code for their IaaS. - -## Rationale - - - We want people to create Kubernetes clusters with whatever IaaS, Node OS, - configuration management tools, and so on, which they are familiar with. The - guidelines for **versioned distros** are designed for flexibility. - - We want developers to be able to work without understanding all the permutations of - IaaS, NodeOS, and configuration management. The guidelines for **developer distros** are designed - for consistency. - - We want users to have a uniform experience with Kubernetes whenever they follow instructions anywhere - in our Github repository. So, we ask that versioned distros pass a **conformance test** to make sure - really work. - - We want to **limit the number of development distros** for several reasons. Developers should - only have to change a limited number of places to add a new feature. Also, since we will - gate commits on passing CI for all distros, and since end-to-end tests are typically somewhat - flaky, it would be highly likely for there to be false positives and CI backlogs with many CI pipelines. - - We do not require versioned distros to do **CI** for several reasons. It is a steep - learning curve to understand our automated testing scripts. And it is considerable effort - to fully automate setup and teardown of a cluster, which is needed for CI. And, not everyone - has the time and money to run CI. We do not want to - discourage people from writing and sharing guides because of this. - - Versioned distro authors are free to run their own CI and let us know if there is breakage, but we - will not include them as commit hooks -- there cannot be so many commit checks that it is impossible - to pass them all. - - We prefer a single Configuration Management tool for development distros. If there were more - than one, the core developers would have to learn multiple tools and update config in multiple - places. **Saltstack** happens to be the one we picked when we started the project. We - welcome versioned distros that use any tool; there are already examples of - CoreOS Fleet, Ansible, and others. - - You can still run code from head or your own branch - if you use another Configuration Management tool -- you just have to do some manual steps - during testing and deployment. - - - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/devel/writing-a-getting-started-guide.md?pixel)]() - diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/README.md b/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/README.md deleted file mode 100644 index d9c279f6e09a..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/README.md +++ /dev/null @@ -1,198 +0,0 @@ - - - - -WARNING -WARNING -WARNING -WARNING -WARNING - -

    PLEASE NOTE: This document applies to the HEAD of the source tree

    - -If you are using a released version of Kubernetes, you should -refer to the docs that go with that version. - - -The latest 1.0.x release of this document can be found -[here](http://releases.k8s.io/release-1.0/docs/getting-started-guides/README.md). - -Documentation for other releases can be found at -[releases.k8s.io](http://releases.k8s.io). - --- - - - - - -# Creating a Kubernetes Cluster - -Kubernetes can run on a range of platforms, from your laptop, to VMs on a cloud provider, to rack of -bare metal servers. The effort required to set up a cluster varies from running a single command to -crafting your own customized cluster. We'll guide you in picking a solution that fits for your needs. - -## Picking the Right Solution - -If you just want to "kick the tires" on Kubernetes, we recommend the [local Docker-based](docker.md) solution. - -The local Docker-based solution is one of several [Local cluster](#local-machine-solutions) solutions -that are quick to set up, but are limited to running on one machine. - -When you are ready to scale up to more machines and higher availability, a [Hosted](#hosted-solutions) -solution is the easiest to create and maintain. - -[Turn-key cloud solutions](#turn-key-cloud-solutions) require only a few commands to create -and cover a wider range of cloud providers. - -[Custom solutions](#custom-solutions) require more effort to setup but cover and even -they vary from step-by-step instructions to general advice for setting up -a Kubernetes cluster from scratch. - -### Local-machine Solutions - -Local-machine solutions create a single cluster with one or more Kubernetes nodes on a single -physical machine. Setup is completely automated and doesn't require a cloud provider account. -But their size and availability is limited to that of a single machine. - -The local-machine solutions are: - - [Local Docker-based](docker.md) (recommended starting point) - - [Vagrant](vagrant.md) (works on any platform with Vagrant: Linux, MacOS, or Windows.) - - [No-VM local cluster](locally.md) (Linux only) - - -### Hosted Solutions - -[Google Container Engine](https://cloud.google.com/container-engine) offers managed Kubernetes -clusters. - -### Turn-key Cloud Solutions - -These solutions allow you to create Kubernetes clusters on a range of Cloud IaaS providers with only a -few commands, and have active community support. -- [GCE](gce.md) -- [AWS](aws.md) -- [Azure](coreos/azure/README.md) - -### Custom Solutions - -Kubernetes can run on a wide range of Cloud providers and bare-metal environments, and with many -base operating systems. - -If you can find a guide below that matches your needs, use it. It may be a little out of date, but -it will be easier than starting from scratch. If you do want to start from scratch because you -have special requirements or just because you want to understand what is underneath a Kubernetes -cluster, try the [Getting Started from Scratch](scratch.md) guide. - -If you are interested in supporting Kubernetes on a new platform, check out our [advice for -writing a new solution](../../docs/devel/writing-a-getting-started-guide.md). - -#### Cloud - -These solutions are combinations of cloud provider and OS not covered by the above solutions. -- [AWS + coreos](coreos.md) -- [GCE + CoreOS](coreos.md) -- [AWS + Ubuntu](juju.md) -- [Joyent + Ubuntu](juju.md) -- [Rackspace + CoreOS](rackspace.md) - -#### On-Premises VMs - -- [Vagrant](coreos.md) (uses CoreOS and flannel) -- [CloudStack](cloudstack.md) (uses Ansible, CoreOS and flannel) -- [Vmware](vsphere.md) (uses Debian) -- [juju.md](juju.md) (uses Juju, Ubuntu and flannel) -- [Vmware](coreos.md) (uses CoreOS and flannel) -- [libvirt-coreos.md](libvirt-coreos.md) (uses CoreOS) -- [oVirt](ovirt.md) -- [libvirt](fedora/flannel_multi_node_cluster.md) (uses Fedora and flannel) -- [KVM](fedora/flannel_multi_node_cluster.md) (uses Fedora and flannel) - -#### Bare Metal - -- [Offline](coreos/bare_metal_offline.md) (no internet required. Uses CoreOS and Flannel) -- [fedora/fedora_ansible_config.md](fedora/fedora_ansible_config.md) -- [Fedora single node](fedora/fedora_manual_config.md) -- [Fedora multi node](fedora/flannel_multi_node_cluster.md) -- [Centos](centos/centos_manual_config.md) -- [Ubuntu](ubuntu.md) -- [Docker Multi Node](docker-multinode.md) - -#### Integrations - -- [Kubernetes on Mesos](mesos.md) (Uses GCE) - -## Table of Solutions - -Here are all the solutions mentioned above in table form. - -IaaS Provider | Config. Mgmt | OS | Networking | Docs | Conforms | Support Level --------------------- | ------------ | ------ | ---------- | --------------------------------------------- | ---------| ---------------------------- -GKE | | | GCE | [docs](https://cloud.google.com/container-engine) | | Commercial -Vagrant | Saltstack | Fedora | OVS | [docs](vagrant.md) | [✓][2] | Project -GCE | Saltstack | Debian | GCE | [docs](gce.md) | [✓][1] | Project -Azure | CoreOS | CoreOS | Weave | [docs](coreos/azure/README.md) | | Community ([@errordeveloper](https://github.com/errordeveloper), [@squillace](https://github.com/squillace), [@chanezon](https://github.com/chanezon), [@crossorigin](https://github.com/crossorigin)) -Docker Single Node | custom | N/A | local | [docs](docker.md) | | Project (@brendandburns) -Docker Multi Node | Flannel | N/A | local | [docs](docker-multinode.md) | | Project (@brendandburns) -Bare-metal | Ansible | Fedora | flannel | [docs](fedora/fedora_ansible_config.md) | | Project -Bare-metal | custom | Fedora | _none_ | [docs](fedora/fedora_manual_config.md) | | Project -Bare-metal | custom | Fedora | flannel | [docs](fedora/flannel_multi_node_cluster.md) | | Community ([@aveshagarwal](https://github.com/aveshagarwal)) -libvirt | custom | Fedora | flannel | [docs](fedora/flannel_multi_node_cluster.md) | | Community ([@aveshagarwal](https://github.com/aveshagarwal)) -KVM | custom | Fedora | flannel | [docs](fedora/flannel_multi_node_cluster.md) | | Community ([@aveshagarwal](https://github.com/aveshagarwal)) -Mesos/GCE | | | | [docs](mesos.md) | | [Community](https://github.com/mesosphere/kubernetes-mesos) ([@jdef](https://github.com/jdef)) -AWS | CoreOS | CoreOS | flannel | [docs](coreos.md) | | Community -GCE | CoreOS | CoreOS | flannel | [docs](coreos.md) | | Community [@pires](https://github.com/pires) -Vagrant | CoreOS | CoreOS | flannel | [docs](coreos.md) | | Community ( [@pires](https://github.com/pires), [@AntonioMeireles](https://github.com/AntonioMeireles) ) -Bare-metal (Offline) | CoreOS | CoreOS | flannel | [docs](coreos/bare_metal_offline.md) | | Community([@jeffbean](https://github.com/jeffbean)) -CloudStack | Ansible | CoreOS | flannel | [docs](cloudstack.md) | | Community (@runseb) -Vmware | | Debian | OVS | [docs](vsphere.md) | | Community (@pietern) -Bare-metal | custom | CentOS | _none_ | [docs](centos/centos_manual_config.md) | | Community(@coolsvap) -AWS | Juju | Ubuntu | flannel | [docs](juju.md) | | [Community](https://github.com/whitmo/bundle-kubernetes) ( [@whit](https://github.com/whitmo), [@matt](https://github.com/mbruzek), [@chuck](https://github.com/chuckbutler) ) -OpenStack/HPCloud | Juju | Ubuntu | flannel | [docs](juju.md) | | [Community](https://github.com/whitmo/bundle-kubernetes) ( [@whit](https://github.com/whitmo), [@matt](https://github.com/mbruzek), [@chuck](https://github.com/chuckbutler) ) -Joyent | Juju | Ubuntu | flannel | [docs](juju.md) | | [Community](https://github.com/whitmo/bundle-kubernetes) ( [@whit](https://github.com/whitmo), [@matt](https://github.com/mbruzek), [@chuck](https://github.com/chuckbutler) ) -AWS | Saltstack | Ubuntu | OVS | [docs](aws.md) | | Community (@justinsb) -Vmware | CoreOS | CoreOS | flannel | [docs](coreos.md) | | Community (@kelseyhightower) -Azure | Saltstack | Ubuntu | OpenVPN | [docs](azure.md) | | Community -Bare-metal | custom | Ubuntu | calico | [docs](ubuntu-calico.md) | | Community (@djosborne) -Bare-metal | custom | Ubuntu | flannel | [docs](ubuntu.md) | | Community (@resouer @WIZARD-CXY) -Local | | | _none_ | [docs](locally.md) | | Community (@preillyme) -libvirt/KVM | CoreOS | CoreOS | libvirt/KVM | [docs](libvirt-coreos.md) | | Community (@lhuard1A) -oVirt | | | | [docs](ovirt.md) | | Community (@simon3z) -Rackspace | CoreOS | CoreOS | flannel | [docs](rackspace.md) | | Community (@doublerr) -any | any | any | any | [docs](scratch.md) | | Community (@erictune) - - -*Note*: The above table is ordered by version test/used in notes followed by support level. - -Definition of columns: - - **IaaS Provider** is who/what provides the virtual or physical machines (nodes) that Kubernetes runs on. - - **OS** is the base operating system of the nodes. - - **Config. Mgmt** is the configuration management system that helps install and maintain Kubernetes software on the - nodes. - - **Networking** is what implements the [networking model](../../docs/admin/networking.md). Those with networking type - _none_ may not support more than one node, or may support multiple VM nodes only in the same physical node. - - **Conformance** indicates whether a cluster created with this configuration has passed the project's conformance - tests for supporting the API and base features of Kubernetes v1.0.0. - - Support Levels - - **Project**: Kubernetes Committers regularly use this configuration, so it usually works with the latest release - of Kubernetes. - - **Commercial**: A commercial offering with its own support arrangements. - - **Community**: Actively supported by community contributions. May not work with more recent releases of Kubernetes. - - **Inactive**: No active maintainer. Not recommended for first-time Kubernetes users, and may be deleted soon. - - **Notes** is relevant information such as the version of Kubernetes used. - - - -[1]: https://gist.github.com/erictune/4cabc010906afbcc5061 - -[2]: https://gist.github.com/derekwaynecarr/505e56036cdf010bf6b6 - - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/getting-started-guides/README.md?pixel)]() - diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/all-lines.png b/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/all-lines.png deleted file mode 100644 index 7de0438af632..000000000000 Binary files a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/all-lines.png and /dev/null differ diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/aws-coreos.md b/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/aws-coreos.md deleted file mode 100644 index 2b14c2c49bb6..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/aws-coreos.md +++ /dev/null @@ -1,250 +0,0 @@ - - - - -WARNING -WARNING -WARNING -WARNING -WARNING - -

    PLEASE NOTE: This document applies to the HEAD of the source tree

    - -If you are using a released version of Kubernetes, you should -refer to the docs that go with that version. - - -The latest 1.0.x release of this document can be found -[here](http://releases.k8s.io/release-1.0/docs/getting-started-guides/aws-coreos.md). - -Documentation for other releases can be found at -[releases.k8s.io](http://releases.k8s.io). - --- - - - - - -# Getting started on Amazon EC2 with CoreOS - -The example below creates an elastic Kubernetes cluster with a custom number of worker nodes and a master. - -**Warning:** contrary to the [supported procedure](aws.md), the examples below provision Kubernetes with an insecure API server (plain HTTP, -no security tokens, no basic auth). For demonstration purposes only. - -## Highlights - -* Cluster bootstrapping using [cloud-config](https://coreos.com/docs/cluster-management/setup/cloudinit-cloud-config/) -* Cross container networking with [flannel](https://github.com/coreos/flannel#flannel) -* Auto worker registration with [kube-register](https://github.com/kelseyhightower/kube-register#kube-register) -* Kubernetes v0.19.3 [official binaries](https://k8s.io/kubernetes/releases/tag/v0.19.3) - -## Prerequisites - -* [aws CLI](http://aws.amazon.com/cli) -* [CoreOS image for AWS](https://coreos.com/docs/running-coreos/cloud-providers/ec2/) -* [kubectl CLI](aws/kubectl.md) ([installation](aws.md#command-line-administration-tool-kubectl)) - -## Starting a Cluster - -### CloudFormation - -The [cloudformation-template.json](aws/cloudformation-template.json) can be used to bootstrap a Kubernetes cluster with a single command: - -```bash -aws cloudformation create-stack --stack-name kubernetes --region us-west-2 \ ---template-body file://aws/cloudformation-template.json \ ---parameters ParameterKey=KeyPair,ParameterValue= \ - ParameterKey=ClusterSize,ParameterValue= \ - ParameterKey=VpcId,ParameterValue= \ - ParameterKey=SubnetId,ParameterValue= \ - ParameterKey=SubnetAZ,ParameterValue= -``` - -It will take a few minutes for the entire stack to come up. You can monitor the stack progress with the following command: - -```bash -aws cloudformation describe-stack-events --stack-name kubernetes -``` - -Record the Kubernetes Master IP address: - -```bash -aws cloudformation describe-stacks --stack-name kubernetes -``` - -[Skip to kubectl client configuration](#configure-the-kubectl-ssh-tunnel) - -### AWS CLI - -The following commands shall use the latest CoreOS alpha AMI for the `us-west-2` region. For a list of different regions and corresponding AMI IDs see the [CoreOS EC2 cloud provider documentation](https://coreos.com/docs/running-coreos/cloud-providers/ec2/#choosing-a-channel). - -#### Create the Kubernetes Security Group - -```bash -aws ec2 create-security-group --group-name kubernetes --description "Kubernetes Security Group" -aws ec2 authorize-security-group-ingress --group-name kubernetes --protocol tcp --port 22 --cidr 0.0.0.0/0 -aws ec2 authorize-security-group-ingress --group-name kubernetes --protocol tcp --port 80 --cidr 0.0.0.0/0 -aws ec2 authorize-security-group-ingress --group-name kubernetes --source-security-group-name kubernetes -``` - -#### Save the master and node cloud-configs - -* [master.yaml](aws/cloud-configs/master.yaml) -* [node.yaml](aws/cloud-configs/node.yaml) - -#### Launch the master - -*Attention:* replace `` below for a [suitable version of CoreOS image for AWS](https://coreos.com/docs/running-coreos/cloud-providers/ec2/). - -```bash -aws ec2 run-instances --image-id --key-name \ ---region us-west-2 --security-groups kubernetes --instance-type m3.medium \ ---user-data file://master.yaml -``` - -Record the `InstanceId` for the master. - -Gather the public and private IPs for the master node: - -```bash -aws ec2 describe-instances --instance-id -``` - -```json -{ - "Reservations": [ - { - "Instances": [ - { - "PublicDnsName": "ec2-54-68-97-117.us-west-2.compute.amazonaws.com", - "RootDeviceType": "ebs", - "State": { - "Code": 16, - "Name": "running" - }, - "PublicIpAddress": "54.68.97.117", - "PrivateIpAddress": "172.31.9.9", -``` - -#### Update the node.yaml cloud-config - -Edit `node.yaml` and replace all instances of `` with the **private** IP address of the master node. - -### Launch 3 worker nodes - -*Attention:* Replace `` below for a [suitable version of CoreOS image for AWS](https://coreos.com/docs/running-coreos/cloud-providers/ec2/#choosing-a-channel). - -```bash -aws ec2 run-instances --count 3 --image-id --key-name \ ---region us-west-2 --security-groups kubernetes --instance-type m3.medium \ ---user-data file://node.yaml -``` - -### Add additional worker nodes - -*Attention:* replace `` below for a [suitable version of CoreOS image for AWS](https://coreos.com/docs/running-coreos/cloud-providers/ec2/#choosing-a-channel). - -```bash -aws ec2 run-instances --count 1 --image-id --key-name \ ---region us-west-2 --security-groups kubernetes --instance-type m3.medium \ ---user-data file://node.yaml -``` - -### Configure the kubectl SSH tunnel - -This command enables secure communication between the kubectl client and the Kubernetes API. - -```bash -ssh -f -nNT -L 8080:127.0.0.1:8080 core@ -``` - -### Listing worker nodes - -Once the worker instances have fully booted, they will be automatically registered with the Kubernetes API server by the kube-register service running on the master node. It may take a few mins. - -```bash -kubectl get nodes -``` - -## Starting a simple pod - -Create a pod manifest: `pod.json` - -```json -{ - "apiVersion": "v1", - "kind": "Pod", - "metadata": { - "name": "hello", - "labels": { - "name": "hello", - "environment": "testing" - } - }, - "spec": { - "containers": [{ - "name": "hello", - "image": "quay.io/kelseyhightower/hello", - "ports": [{ - "containerPort": 80, - "hostPort": 80 - }] - }] - } -} -``` - -### Create the pod using the kubectl command line tool - -```bash -kubectl create -f ./pod.json -``` - -### Testing - -```bash -kubectl get pods -``` - -Record the **Host** of the pod, which should be the private IP address. - -Gather the public IP address for the worker node. - -```bash -aws ec2 describe-instances --filters 'Name=private-ip-address,Values=' -``` - -```json -{ - "Reservations": [ - { - "Instances": [ - { - "PublicDnsName": "ec2-54-68-97-117.us-west-2.compute.amazonaws.com", - "RootDeviceType": "ebs", - "State": { - "Code": 16, - "Name": "running" - }, - "PublicIpAddress": "54.68.97.117", -``` - -Visit the public IP address in your browser to view the running pod. - -### Delete the pod - -```bash -kubectl delete pods hello -``` - - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/getting-started-guides/aws-coreos.md?pixel)]() - diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/aws.md b/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/aws.md deleted file mode 100644 index 988f9cb9814f..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/aws.md +++ /dev/null @@ -1,144 +0,0 @@ - - - - -WARNING -WARNING -WARNING -WARNING -WARNING - -

    PLEASE NOTE: This document applies to the HEAD of the source tree

    - -If you are using a released version of Kubernetes, you should -refer to the docs that go with that version. - - -The latest 1.0.x release of this document can be found -[here](http://releases.k8s.io/release-1.0/docs/getting-started-guides/aws.md). - -Documentation for other releases can be found at -[releases.k8s.io](http://releases.k8s.io). - --- - - - - -Getting started on AWS EC2 --------------------------- - -**Table of Contents** - -- [Prerequisites](#prerequisites) -- [Cluster turnup](#cluster-turnup) - - [Supported procedure: `get-kube`](#supported-procedure-get-kube) - - [Alternatives](#alternatives) -- [Getting started with your cluster](#getting-started-with-your-cluster) - - [Command line administration tool: `kubectl`](#command-line-administration-tool-kubectl) - - [Examples](#examples) -- [Tearing down the cluster](#tearing-down-the-cluster) -- [Further reading](#further-reading) - -## Prerequisites - -1. You need an AWS account. Visit [http://aws.amazon.com](http://aws.amazon.com) to get started -2. Install and configure [AWS Command Line Interface](http://aws.amazon.com/cli) -3. You need an AWS [instance profile and role](http://docs.aws.amazon.com/IAM/latest/UserGuide/instance-profiles.html) with EC2 full access. - -## Cluster turnup - -### Supported procedure: `get-kube` - -```bash -#Using wget -export KUBERNETES_PROVIDER=aws; wget -q -O - https://get.k8s.io | bash - -#Using cURL -export KUBERNETES_PROVIDER=aws; curl -sS https://get.k8s.io | bash -``` - -NOTE: This script calls [cluster/kube-up.sh](http://releases.k8s.io/HEAD/cluster/kube-up.sh) -which in turn calls [cluster/aws/util.sh](http://releases.k8s.io/HEAD/cluster/aws/util.sh) -using [cluster/aws/config-default.sh](http://releases.k8s.io/HEAD/cluster/aws/config-default.sh). - -This process takes about 5 to 10 minutes. Once the cluster is up, the IP addresses of your master and node(s) will be printed, -as well as information about the default services running in the cluster (monitoring, logging, dns). User credentials and security -tokens are written in `~/.kube/kubeconfig`, they will be necessary to use the CLI or the HTTP Basic Auth. - -By default, the script will provision a new VPC and a 4 node k8s cluster in us-west-2a (Oregon) with `t2.micro` instances running on Ubuntu. -You can override the variables defined in [config-default.sh](http://releases.k8s.io/HEAD/cluster/aws/config-default.sh) to change this behavior as follows: - -```bash -export KUBE_AWS_ZONE=eu-west-1c -export NUM_MINIONS=2 -export MINION_SIZE=m3.medium -export AWS_S3_REGION=eu-west-1 -export AWS_S3_BUCKET=mycompany-kubernetes-artifacts -export INSTANCE_PREFIX=k8s -... -``` - -It will also try to create or reuse a keypair called "kubernetes", and IAM profiles called "kubernetes-master" and "kubernetes-minion". -If these already exist, make sure you want them to be used here. - -NOTE: If using an existing keypair named "kubernetes" then you must set the `AWS_SSH_KEY` key to point to your private key. - -### Alternatives - -A contributed [example](aws-coreos.md) allows you to setup a Kubernetes cluster based on [CoreOS](http://www.coreos.com), either using -AWS CloudFormation or EC2 with user data (cloud-config). - -## Getting started with your cluster - -### Command line administration tool: `kubectl` - -The cluster startup script will leave you with a `kubernetes` directory on your workstation. -Alternately, you can download the latest Kubernetes release from [this page](https://k8s.io/kubernetes/releases). - -Next, add the appropriate binary folder to your `PATH` to access kubectl: - -```bash -# OS X -export PATH=/platforms/darwin/amd64:$PATH - -# Linux -export PATH=/platforms/linux/amd64:$PATH -``` - -An up-to-date documentation page for this tool is available here: [kubectl manual](../../docs/user-guide/kubectl/kubectl.md) - -By default, `kubectl` will use the `kubeconfig` file generated during the cluster startup for authenticating against the API. -For more information, please read [kubeconfig files](../../docs/user-guide/kubeconfig-file.md) - -### Examples - -See [a simple nginx example](../../docs/user-guide/simple-nginx.md) to try out your new cluster. - -The "Guestbook" application is another popular example to get started with Kubernetes: [guestbook example](../../examples/guestbook/) - -For more complete applications, please look in the [examples directory](../../examples/) - -## Tearing down the cluster - -Make sure the environment variables you used to provision your cluster are still exported, then call the following script inside the -`kubernetes` directory: - -```bash -cluster/kube-down.sh -``` - -## Further reading - -Please see the [Kubernetes docs](../../docs/) for more details on administering -and using a Kubernetes cluster. - - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/getting-started-guides/aws.md?pixel)]() - diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/aws/cloud-configs/master.yaml b/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/aws/cloud-configs/master.yaml deleted file mode 100644 index ae5880d86cd3..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/aws/cloud-configs/master.yaml +++ /dev/null @@ -1,177 +0,0 @@ -#cloud-config - -write_files: - - path: /opt/bin/waiter.sh - owner: root - permissions: 0755 - content: | - #! /usr/bin/bash - until curl http://127.0.0.1:2379/v2/machines; do sleep 2; done - -coreos: - etcd2: - name: master - initial-cluster-token: k8s_etcd - initial-cluster: master=http://$private_ipv4:2380 - listen-peer-urls: http://$private_ipv4:2380,http://localhost:2380 - initial-advertise-peer-urls: http://$private_ipv4:2380 - listen-client-urls: http://$private_ipv4:2379,http://localhost:2379 - advertise-client-urls: http://$private_ipv4:2379 - fleet: - etcd_servers: http://localhost:2379 - metadata: k8srole=master - flannel: - etcd_endpoints: http://localhost:2379 - locksmithd: - endpoint: http://localhost:2379 - units: - - name: etcd2.service - command: start - - name: fleet.service - command: start - - name: etcd2-waiter.service - command: start - content: | - [Unit] - Description=etcd waiter - Wants=network-online.target - Wants=etcd2.service - After=etcd2.service - After=network-online.target - Before=flanneld.service fleet.service locksmithd.service - - [Service] - ExecStart=/usr/bin/bash /opt/bin/waiter.sh - RemainAfterExit=true - Type=oneshot - - name: flanneld.service - command: start - drop-ins: - - name: 50-network-config.conf - content: | - [Service] - ExecStartPre=-/usr/bin/etcdctl mk /coreos.com/network/config '{"Network": "10.244.0.0/16", "Backend": {"Type": "vxlan"}}' - - name: docker-cache.service - command: start - content: | - [Unit] - Description=Docker cache proxy - Requires=early-docker.service - After=early-docker.service - Before=early-docker.target - - [Service] - Restart=always - TimeoutStartSec=0 - RestartSec=5 - Environment=TMPDIR=/var/tmp/ - Environment=DOCKER_HOST=unix:///var/run/early-docker.sock - ExecStartPre=-/usr/bin/docker kill docker-registry - ExecStartPre=-/usr/bin/docker rm docker-registry - ExecStartPre=/usr/bin/docker pull quay.io/devops/docker-registry:latest - # GUNICORN_OPTS is an workaround for - # https://github.com/docker/docker-registry/issues/892 - ExecStart=/usr/bin/docker run --rm --net host --name docker-registry \ - -e STANDALONE=false \ - -e GUNICORN_OPTS=[--preload] \ - -e MIRROR_SOURCE=https://registry-1.docker.io \ - -e MIRROR_SOURCE_INDEX=https://index.docker.io \ - -e MIRROR_TAGS_CACHE_TTL=1800 \ - quay.io/devops/docker-registry:latest - - name: docker.service - drop-ins: - - name: 51-docker-mirror.conf - content: | - [Unit] - # making sure that docker-cache is up and that flanneld finished - # startup, otherwise containers won't land in flannel's network... - Requires=docker-cache.service - After=docker-cache.service - - [Service] - Environment=DOCKER_OPTS='--registry-mirror=http://$private_ipv4:5000' - - name: get-kubectl.service - command: start - content: | - [Unit] - Description=Get kubectl client tool - Documentation=https://k8s.io/kubernetes - Requires=network-online.target - After=network-online.target - - [Service] - ExecStart=/usr/bin/wget -N -P /opt/bin https://storage.googleapis.com/kubernetes-release/release/v0.19.3/bin/linux/amd64/kubectl - ExecStart=/usr/bin/chmod +x /opt/bin/kubectl - Type=oneshot - RemainAfterExit=true - - name: kube-apiserver.service - command: start - content: | - [Unit] - Description=Kubernetes API Server - Documentation=https://k8s.io/kubernetes - Requires=etcd2-waiter.service - After=etcd2-waiter.service - - [Service] - ExecStartPre=/usr/bin/wget -N -P /opt/bin https://storage.googleapis.com/kubernetes-release/release/v0.19.3/bin/linux/amd64/kube-apiserver - ExecStartPre=/usr/bin/chmod +x /opt/bin/kube-apiserver - ExecStart=/opt/bin/kube-apiserver \ - --insecure-bind-address=0.0.0.0 \ - --service-cluster-ip-range=10.100.0.0/16 \ - --etcd-servers=http://localhost:2379 - Restart=always - RestartSec=10 - - name: kube-controller-manager.service - command: start - content: | - [Unit] - Description=Kubernetes Controller Manager - Documentation=https://k8s.io/kubernetes - Requires=kube-apiserver.service - After=kube-apiserver.service - - [Service] - ExecStartPre=/usr/bin/wget -N -P /opt/bin https://storage.googleapis.com/kubernetes-release/release/v0.19.3/bin/linux/amd64/kube-controller-manager - ExecStartPre=/usr/bin/chmod +x /opt/bin/kube-controller-manager - ExecStart=/opt/bin/kube-controller-manager \ - --master=127.0.0.1:8080 - Restart=always - RestartSec=10 - - name: kube-scheduler.service - command: start - content: | - [Unit] - Description=Kubernetes Scheduler - Documentation=https://k8s.io/kubernetes - Requires=kube-apiserver.service - After=kube-apiserver.service - - [Service] - ExecStartPre=/usr/bin/wget -N -P /opt/bin https://storage.googleapis.com/kubernetes-release/release/v0.19.3/bin/linux/amd64/kube-scheduler - ExecStartPre=/usr/bin/chmod +x /opt/bin/kube-scheduler - ExecStart=/opt/bin/kube-scheduler \ - --master=127.0.0.1:8080 - Restart=always - RestartSec=10 - - name: kube-register.service - command: start - content: | - [Unit] - Description=Kubernetes Registration Service - Documentation=https://github.com/kelseyhightower/kube-register - Requires=kube-apiserver.service fleet.service - After=kube-apiserver.service fleet.service - - [Service] - ExecStartPre=-/usr/bin/wget -nc -O /opt/bin/kube-register https://github.com/kelseyhightower/kube-register/releases/download/v0.0.4/kube-register-0.0.4-linux-amd64 - ExecStartPre=/usr/bin/chmod +x /opt/bin/kube-register - ExecStart=/opt/bin/kube-register \ - --metadata=k8srole=node \ - --fleet-endpoint=unix:///var/run/fleet.sock \ - --api-endpoint=http://127.0.0.1:8080 - Restart=always - RestartSec=10 - update: - group: alpha - reboot-strategy: off diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/aws/cloud-configs/node.yaml b/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/aws/cloud-configs/node.yaml deleted file mode 100644 index 5554479c631e..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/aws/cloud-configs/node.yaml +++ /dev/null @@ -1,81 +0,0 @@ -#cloud-config - -write_files: - - path: /opt/bin/wupiao - owner: root - permissions: 0755 - content: | - #!/bin/bash - # [w]ait [u]ntil [p]ort [i]s [a]ctually [o]pen - [ -n "$1" ] && [ -n "$2" ] && while ! curl --output /dev/null \ - --silent --head --fail \ - http://${1}:${2}; do sleep 1 && echo -n .; done; - exit $? - -coreos: - etcd2: - listen-client-urls: http://localhost:2379 - advertise-client-urls: http://0.0.0.0:2379 - initial-cluster: master=http://:2380 - proxy: on - fleet: - etcd_servers: http://localhost:2379 - metadata: k8srole=node - flannel: - etcd_endpoints: http://localhost:2379 - locksmithd: - endpoint: http://localhost:2379 - units: - - name: etcd2.service - command: start - - name: fleet.service - command: start - - name: flanneld.service - command: start - - name: docker.service - command: start - drop-ins: - - name: 50-docker-mirror.conf - content: | - [Service] - Environment=DOCKER_OPTS='--registry-mirror=http://:5000' - - name: kubelet.service - command: start - content: | - [Unit] - Description=Kubernetes Kubelet - Documentation=https://k8s.io/kubernetes - Requires=network-online.target - After=network-online.target - - [Service] - ExecStartPre=/usr/bin/wget -N -P /opt/bin https://storage.googleapis.com/kubernetes-release/release/v0.19.3/bin/linux/amd64/kubelet - ExecStartPre=/usr/bin/chmod +x /opt/bin/kubelet - # wait for kubernetes master to be up and ready - ExecStartPre=/opt/bin/wupiao 8080 - ExecStart=/opt/bin/kubelet \ - --api-servers=:8080 \ - --hostname-override=$private_ipv4 - Restart=always - RestartSec=10 - - name: kube-proxy.service - command: start - content: | - [Unit] - Description=Kubernetes Proxy - Documentation=https://k8s.io/kubernetes - Requires=network-online.target - After=network-online.target - - [Service] - ExecStartPre=/usr/bin/wget -N -P /opt/bin https://storage.googleapis.com/kubernetes-release/release/v0.19.3/bin/linux/amd64/kube-proxy - ExecStartPre=/usr/bin/chmod +x /opt/bin/kube-proxy - # wait for kubernetes master to be up and ready - ExecStartPre=/opt/bin/wupiao 8080 - ExecStart=/opt/bin/kube-proxy \ - --master=http://:8080 - Restart=always - RestartSec=10 - update: - group: alpha - reboot-strategy: off diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/aws/cloudformation-template.json b/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/aws/cloudformation-template.json deleted file mode 100644 index d6303adcd561..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/aws/cloudformation-template.json +++ /dev/null @@ -1,421 +0,0 @@ -{ - "AWSTemplateFormatVersion": "2010-09-09", - "Description": "Kubernetes 0.19.3 on EC2 powered by CoreOS 681.2.0 (stable)", - "Mappings": { - "RegionMap": { - "eu-central-1" : { - "AMI" : "ami-eae5ddf7" - }, - "ap-northeast-1" : { - "AMI" : "ami-1a6fca1a" - }, - "us-gov-west-1" : { - "AMI" : "ami-e99fffca" - }, - "sa-east-1" : { - "AMI" : "ami-b1cb49ac" - }, - "ap-southeast-2" : { - "AMI" : "ami-23641e19" - }, - "ap-southeast-1" : { - "AMI" : "ami-da030788" - }, - "us-east-1" : { - "AMI" : "ami-93ea17f8" - }, - "us-west-2" : { - "AMI" : "ami-5d4d486d" - }, - "us-west-1" : { - "AMI" : "ami-c967938d" - }, - "eu-west-1" : { - "AMI" : "ami-5f2f5528" - } - } - }, - "Parameters": { - "InstanceType": { - "Description": "EC2 HVM instance type (m3.medium, etc).", - "Type": "String", - "Default": "m3.medium", - "AllowedValues": [ - "m3.medium", - "m3.large", - "m3.xlarge", - "m3.2xlarge", - "c3.large", - "c3.xlarge", - "c3.2xlarge", - "c3.4xlarge", - "c3.8xlarge", - "cc2.8xlarge", - "cr1.8xlarge", - "hi1.4xlarge", - "hs1.8xlarge", - "i2.xlarge", - "i2.2xlarge", - "i2.4xlarge", - "i2.8xlarge", - "r3.large", - "r3.xlarge", - "r3.2xlarge", - "r3.4xlarge", - "r3.8xlarge", - "t2.micro", - "t2.small", - "t2.medium" - ], - "ConstraintDescription": "Must be a valid EC2 HVM instance type." - }, - "ClusterSize": { - "Description": "Number of nodes in cluster (2-12).", - "Default": "2", - "MinValue": "2", - "MaxValue": "12", - "Type": "Number" - }, - "AllowSSHFrom": { - "Description": "The net block (CIDR) that SSH is available to.", - "Default": "0.0.0.0/0", - "Type": "String" - }, - "KeyPair": { - "Description": "The name of an EC2 Key Pair to allow SSH access to the instance.", - "Type": "AWS::EC2::KeyPair::KeyName" - }, - "VpcId": { - "Description": "The ID of the VPC to launch into.", - "Type": "AWS::EC2::VPC::Id" - }, - "SubnetId": { - "Description": "The ID of the subnet to launch into (that must be within the supplied VPC)", - "Type": "AWS::EC2::Subnet::Id" - }, - "SubnetAZ": { - "Description": "The availability zone of the subnet supplied (for example eu-west-1a)", - "Type": "String" - } - }, - "Conditions": { - "UseEC2Classic": {"Fn::Equals": [{"Ref": "VpcId"}, ""]} - }, - "Resources": { - "KubernetesSecurityGroup": { - "Type": "AWS::EC2::SecurityGroup", - "Properties": { - "VpcId": {"Fn::If": ["UseEC2Classic", {"Ref": "AWS::NoValue"}, {"Ref": "VpcId"}]}, - "GroupDescription": "Kubernetes SecurityGroup", - "SecurityGroupIngress": [ - { - "IpProtocol": "tcp", - "FromPort": "22", - "ToPort": "22", - "CidrIp": {"Ref": "AllowSSHFrom"} - } - ] - } - }, - "KubernetesIngress": { - "Type": "AWS::EC2::SecurityGroupIngress", - "Properties": { - "GroupId": {"Fn::GetAtt": ["KubernetesSecurityGroup", "GroupId"]}, - "IpProtocol": "tcp", - "FromPort": "1", - "ToPort": "65535", - "SourceSecurityGroupId": { - "Fn::GetAtt" : [ "KubernetesSecurityGroup", "GroupId" ] - } - } - }, - "KubernetesIngressUDP": { - "Type": "AWS::EC2::SecurityGroupIngress", - "Properties": { - "GroupId": {"Fn::GetAtt": ["KubernetesSecurityGroup", "GroupId"]}, - "IpProtocol": "udp", - "FromPort": "1", - "ToPort": "65535", - "SourceSecurityGroupId": { - "Fn::GetAtt" : [ "KubernetesSecurityGroup", "GroupId" ] - } - } - }, - "KubernetesMasterInstance": { - "Type": "AWS::EC2::Instance", - "Properties": { - "NetworkInterfaces" : [{ - "GroupSet" : [{"Fn::GetAtt": ["KubernetesSecurityGroup", "GroupId"]}], - "AssociatePublicIpAddress" : "true", - "DeviceIndex" : "0", - "DeleteOnTermination" : "true", - "SubnetId" : {"Fn::If": ["UseEC2Classic", {"Ref": "AWS::NoValue"}, {"Ref": "SubnetId"}]} - }], - "ImageId": {"Fn::FindInMap" : ["RegionMap", {"Ref": "AWS::Region" }, "AMI"]}, - "InstanceType": {"Ref": "InstanceType"}, - "KeyName": {"Ref": "KeyPair"}, - "Tags" : [ - {"Key" : "Name", "Value" : {"Fn::Join" : [ "-", [ {"Ref" : "AWS::StackName"}, "k8s-master" ] ]}}, - {"Key" : "KubernetesRole", "Value" : "node"} - ], - "UserData": { "Fn::Base64": {"Fn::Join" : ["", [ - "#cloud-config\n\n", - "write_files:\n", - "- path: /opt/bin/waiter.sh\n", - " owner: root\n", - " content: |\n", - " #! /usr/bin/bash\n", - " until curl http://127.0.0.1:2379/v2/machines; do sleep 2; done\n", - "coreos:\n", - " etcd2:\n", - " name: master\n", - " initial-cluster-token: k8s_etcd\n", - " initial-cluster: master=http://$private_ipv4:2380\n", - " listen-peer-urls: http://$private_ipv4:2380,http://localhost:2380\n", - " initial-advertise-peer-urls: http://$private_ipv4:2380\n", - " listen-client-urls: http://$private_ipv4:2379,http://localhost:2379\n", - " advertise-client-urls: http://$private_ipv4:2379\n", - " fleet:\n", - " etcd_servers: http://localhost:2379\n", - " metadata: k8srole=master\n", - " flannel:\n", - " etcd_endpoints: http://localhost:2379\n", - " locksmithd:\n", - " endpoint: http://localhost:2379\n", - " units:\n", - " - name: etcd2.service\n", - " command: start\n", - " - name: fleet.service\n", - " command: start\n", - " - name: etcd2-waiter.service\n", - " command: start\n", - " content: |\n", - " [Unit]\n", - " Description=etcd waiter\n", - " Wants=network-online.target\n", - " Wants=etcd2.service\n", - " After=etcd2.service\n", - " After=network-online.target\n", - " Before=flanneld.service fleet.service locksmithd.service\n\n", - " [Service]\n", - " ExecStart=/usr/bin/bash /opt/bin/waiter.sh\n", - " RemainAfterExit=true\n", - " Type=oneshot\n", - " - name: flanneld.service\n", - " command: start\n", - " drop-ins:\n", - " - name: 50-network-config.conf\n", - " content: |\n", - " [Service]\n", - " ExecStartPre=-/usr/bin/etcdctl mk /coreos.com/network/config '{\"Network\": \"10.244.0.0/16\", \"Backend\": {\"Type\": \"vxlan\"}}'\n", - " - name: docker-cache.service\n", - " command: start\n", - " content: |\n", - " [Unit]\n", - " Description=Docker cache proxy\n", - " Requires=early-docker.service\n", - " After=early-docker.service\n", - " Before=early-docker.target\n\n", - " [Service]\n", - " Restart=always\n", - " TimeoutStartSec=0\n", - " RestartSec=5\n", - " Environment=TMPDIR=/var/tmp/\n", - " Environment=DOCKER_HOST=unix:///var/run/early-docker.sock\n", - " ExecStartPre=-/usr/bin/docker kill docker-registry\n", - " ExecStartPre=-/usr/bin/docker rm docker-registry\n", - " ExecStartPre=/usr/bin/docker pull quay.io/devops/docker-registry:latest\n", - " # GUNICORN_OPTS is an workaround for\n", - " # https://github.com/docker/docker-registry/issues/892\n", - " ExecStart=/usr/bin/docker run --rm --net host --name docker-registry \\\n", - " -e STANDALONE=false \\\n", - " -e GUNICORN_OPTS=[--preload] \\\n", - " -e MIRROR_SOURCE=https://registry-1.docker.io \\\n", - " -e MIRROR_SOURCE_INDEX=https://index.docker.io \\\n", - " -e MIRROR_TAGS_CACHE_TTL=1800 \\\n", - " quay.io/devops/docker-registry:latest\n", - " - name: get-kubectl.service\n", - " command: start\n", - " content: |\n", - " [Unit]\n", - " Description=Get kubectl client tool\n", - " Documentation=https://k8s.io/kubernetes\n", - " Requires=network-online.target\n", - " After=network-online.target\n\n", - " [Service]\n", - " ExecStart=/usr/bin/wget -N -P /opt/bin https://storage.googleapis.com/kubernetes-release/release/v0.19.3/bin/linux/amd64/kubectl\n", - " ExecStart=/usr/bin/chmod +x /opt/bin/kubectl\n", - " Type=oneshot\n", - " RemainAfterExit=true\n", - " - name: kube-apiserver.service\n", - " command: start\n", - " content: |\n", - " [Unit]\n", - " Description=Kubernetes API Server\n", - " Documentation=https://k8s.io/kubernetes\n", - " Requires=etcd2-waiter.service\n", - " After=etcd2-waiter.service\n\n", - " [Service]\n", - " ExecStartPre=/usr/bin/wget -N -P /opt/bin https://storage.googleapis.com/kubernetes-release/release/v0.19.3/bin/linux/amd64/kube-apiserver\n", - " ExecStartPre=/usr/bin/chmod +x /opt/bin/kube-apiserver\n", - " ExecStart=/opt/bin/kube-apiserver \\\n", - " --insecure-bind-address=0.0.0.0 \\\n", - " --service-cluster-ip-range=10.100.0.0/16 \\\n", - " --etcd-servers=http://localhost:2379\n", - " Restart=always\n", - " RestartSec=10\n", - " - name: kube-controller-manager.service\n", - " command: start\n", - " content: |\n", - " [Unit]\n", - " Description=Kubernetes Controller Manager\n", - " Documentation=https://k8s.io/kubernetes\n", - " Requires=kube-apiserver.service\n", - " After=kube-apiserver.service\n\n", - " [Service]\n", - " ExecStartPre=/usr/bin/wget -N -P /opt/bin https://storage.googleapis.com/kubernetes-release/release/v0.19.3/bin/linux/amd64/kube-controller-manager\n", - " ExecStartPre=/usr/bin/chmod +x /opt/bin/kube-controller-manager\n", - " ExecStart=/opt/bin/kube-controller-manager \\\n", - " --master=127.0.0.1:8080\n", - " Restart=always\n", - " RestartSec=10\n", - " - name: kube-scheduler.service\n", - " command: start\n", - " content: |\n", - " [Unit]\n", - " Description=Kubernetes Scheduler\n", - " Documentation=https://k8s.io/kubernetes\n", - " Requires=kube-apiserver.service\n", - " After=kube-apiserver.service\n\n", - " [Service]\n", - " ExecStartPre=/usr/bin/wget -N -P /opt/bin https://storage.googleapis.com/kubernetes-release/release/v0.19.3/bin/linux/amd64/kube-scheduler\n", - " ExecStartPre=/usr/bin/chmod +x /opt/bin/kube-scheduler\n", - " ExecStart=/opt/bin/kube-scheduler \\\n", - " --master=127.0.0.1:8080\n", - " Restart=always\n", - " RestartSec=10\n", - " - name: kube-register.service\n", - " command: start\n", - " content: |\n", - " [Unit]\n", - " Description=Kubernetes Registration Service\n", - " Documentation=https://github.com/kelseyhightower/kube-register\n", - " Requires=kube-apiserver.service fleet.service\n", - " After=kube-apiserver.service fleet.service\n\n", - " [Service]\n", - " ExecStartPre=-/usr/bin/wget -nc -O /opt/bin/kube-register https://github.com/kelseyhightower/kube-register/releases/download/v0.0.4/kube-register-0.0.4-linux-amd64\n", - " ExecStartPre=/usr/bin/chmod +x /opt/bin/kube-register\n", - " ExecStart=/opt/bin/kube-register \\\n", - " --metadata=k8srole=node \\\n", - " --fleet-endpoint=unix:///var/run/fleet.sock \\\n", - " --api-endpoint=http://127.0.0.1:8080\n", - " Restart=always\n", - " RestartSec=10\n", - " update:\n", - " group: alpha\n", - " reboot-strategy: off\n" - ]]} - } - } - }, - "KubernetesNodeLaunchConfig": { - "Type": "AWS::AutoScaling::LaunchConfiguration", - "Properties": { - "ImageId": {"Fn::FindInMap" : ["RegionMap", {"Ref": "AWS::Region" }, "AMI" ]}, - "InstanceType": {"Ref": "InstanceType"}, - "KeyName": {"Ref": "KeyPair"}, - "AssociatePublicIpAddress" : "true", - "SecurityGroups": [{"Fn::If": [ - "UseEC2Classic", - {"Ref": "KubernetesSecurityGroup"}, - {"Fn::GetAtt": ["KubernetesSecurityGroup", "GroupId"]}] - }], - "UserData": { "Fn::Base64": {"Fn::Join" : ["", [ - "#cloud-config\n\n", - "coreos:\n", - " etcd2:\n", - " listen-client-urls: http://localhost:2379\n", - " initial-cluster: master=http://", {"Fn::GetAtt" :["KubernetesMasterInstance" , "PrivateIp"]}, ":2380\n", - " proxy: on\n", - " fleet:\n", - " etcd_servers: http://localhost:2379\n", - " metadata: k8srole=node\n", - " flannel:\n", - " etcd_endpoints: http://localhost:2379\n", - " locksmithd:\n", - " endpoint: http://localhost:2379\n", - " units:\n", - " - name: etcd2.service\n", - " command: start\n", - " - name: fleet.service\n", - " command: start\n", - " - name: flanneld.service\n", - " command: start\n", - " - name: docker.service\n", - " command: start\n", - " drop-ins:\n", - " - name: 50-docker-mirror.conf\n", - " content: |\n", - " [Service]\n", - " Environment=DOCKER_OPTS='--registry-mirror=http://", {"Fn::GetAtt" :["KubernetesMasterInstance" , "PrivateIp"]}, ":5000'\n", - " - name: kubelet.service\n", - " command: start\n", - " content: |\n", - " [Unit]\n", - " Description=Kubernetes Kubelet\n", - " Documentation=https://k8s.io/kubernetes\n", - " Requires=network-online.target\n", - " After=network-online.target\n\n", - " [Service]\n", - " ExecStartPre=/usr/bin/wget -N -P /opt/bin https://storage.googleapis.com/kubernetes-release/release/v0.19.3/bin/linux/amd64/kubelet\n", - " ExecStartPre=/usr/bin/chmod +x /opt/bin/kubelet\n", - " ExecStart=/opt/bin/kubelet \\\n", - " --api-servers=", {"Fn::GetAtt" :["KubernetesMasterInstance" , "PrivateIp"]}, ":8080 \\\n", - " --hostname-override=$private_ipv4\n", - " Restart=always\n", - " RestartSec=10\n", - " - name: kube-proxy.service\n", - " command: start\n", - " content: |\n", - " [Unit]\n", - " Description=Kubernetes Proxy\n", - " Documentation=https://k8s.io/kubernetes\n", - " Requires=network-online.target\n", - " After=network-online.target\n\n", - " [Service]\n", - " ExecStartPre=/usr/bin/wget -N -P /opt/bin https://storage.googleapis.com/kubernetes-release/release/v0.19.3/bin/linux/amd64/kube-proxy\n", - " ExecStartPre=/usr/bin/chmod +x /opt/bin/kube-proxy\n", - " ExecStart=/opt/bin/kube-proxy \\\n", - " --master=http://", {"Fn::GetAtt" :["KubernetesMasterInstance" , "PrivateIp"]}, ":8080\n", - " Restart=always\n", - " RestartSec=10\n", - " update:\n", - " group: alpha\n", - " reboot-strategy: off\n" - ]]} - } - } - }, - "KubernetesAutoScalingGroup": { - "Type": "AWS::AutoScaling::AutoScalingGroup", - "Properties": { - "AvailabilityZones": {"Fn::If": ["UseEC2Classic", {"Fn::GetAZs": ""}, [{"Ref": "SubnetAZ"}]]}, - "VPCZoneIdentifier": {"Fn::If": ["UseEC2Classic", {"Ref": "AWS::NoValue"}, [{"Ref": "SubnetId"}]]}, - "LaunchConfigurationName": {"Ref": "KubernetesNodeLaunchConfig"}, - "MinSize": "2", - "MaxSize": "12", - "DesiredCapacity": {"Ref": "ClusterSize"}, - "Tags" : [ - {"Key" : "Name", "Value" : {"Fn::Join" : [ "-", [ {"Ref" : "AWS::StackName"}, "k8s-node" ] ]}, "PropagateAtLaunch" : true}, - {"Key" : "KubernetesRole", "Value" : "node", "PropagateAtLaunch" : true} - ] - } - } - }, - "Outputs": { - "KubernetesMasterPublicIp": { - "Description": "Public Ip of the newly created Kubernetes Master instance", - "Value": {"Fn::GetAtt": ["KubernetesMasterInstance" , "PublicIp"]} - } - } -} diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/aws/kubectl.md b/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/aws/kubectl.md deleted file mode 100644 index a5d6f435b019..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/aws/kubectl.md +++ /dev/null @@ -1,62 +0,0 @@ - - - - -WARNING -WARNING -WARNING -WARNING -WARNING - -

    PLEASE NOTE: This document applies to the HEAD of the source tree

    - -If you are using a released version of Kubernetes, you should -refer to the docs that go with that version. - - -The latest 1.0.x release of this document can be found -[here](http://releases.k8s.io/release-1.0/docs/getting-started-guides/aws/kubectl.md). - -Documentation for other releases can be found at -[releases.k8s.io](http://releases.k8s.io). - --- - - - - - -# Install and configure kubectl - -## Download the kubectl CLI tool - -```bash -### Darwin -wget https://storage.googleapis.com/kubernetes-release/release/v0.19.3/bin/darwin/amd64/kubectl - -### Linux -wget https://storage.googleapis.com/kubernetes-release/release/v0.19.3/bin/linux/amd64/kubectl -``` - -### Copy kubectl to your path - -```bash -chmod +x kubectl -mv kubectl /usr/local/bin/ -``` - -### Create a secure tunnel for API communication - -```bash -ssh -f -nNT -L 8080:127.0.0.1:8080 core@ -``` - - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/getting-started-guides/aws/kubectl.md?pixel)]() - diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/azure.md b/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/azure.md deleted file mode 100644 index 539d923802d5..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/azure.md +++ /dev/null @@ -1,115 +0,0 @@ - - - - -WARNING -WARNING -WARNING -WARNING -WARNING - -

    PLEASE NOTE: This document applies to the HEAD of the source tree

    - -If you are using a released version of Kubernetes, you should -refer to the docs that go with that version. - - -The latest 1.0.x release of this document can be found -[here](http://releases.k8s.io/release-1.0/docs/getting-started-guides/azure.md). - -Documentation for other releases can be found at -[releases.k8s.io](http://releases.k8s.io). - --- - - - - -Getting started on Microsoft Azure ----------------------------------- - -**Table of Contents** - -- [Prerequisites](#prerequisites) -- [Setup](#setup) -- [Getting started with your cluster](#getting-started-with-your-cluster) -- [Tearing down the cluster](#tearing-down-the-cluster) - - -## Prerequisites - -** Azure Prerequisites** - -1. You need an Azure account. Visit http://azure.microsoft.com/ to get started. -2. Install and configure the Azure cross-platform command-line interface. http://azure.microsoft.com/en-us/documentation/articles/xplat-cli/ -3. Make sure you have a default account set in the Azure cli, using `azure account set` - -**Prerequisites for your workstation** - -1. Be running a Linux or Mac OS X. -2. Get or build a [binary release](binary_release.md) -3. If you want to build your own release, you need to have [Docker -installed](https://docs.docker.com/installation/). On Mac OS X you can use -[boot2docker](http://boot2docker.io/). - -## Setup - -### Starting a cluster - -The cluster setup scripts can setup Kubernetes for multiple targets. First modify `cluster/kube-env.sh` to specify azure: - - KUBERNETES_PROVIDER="azure" - -Next, specify an existing virtual network and subnet in `cluster/azure/config-default.sh`: - - AZ_VNET= - AZ_SUBNET= - -You can create a virtual network: - - azure network vnet create --subnet-name= --location "West US" -v - -Now you're ready. - -You can download and install the latest Kubernetes release from [this page](https://k8s.io/kubernetes/releases), then run the `/cluster/kube-up.sh` script to start the cluster: - - cd kubernetes - cluster/kube-up.sh - -The script above will start (by default) a single master VM along with 4 worker VMs. You -can tweak some of these parameters by editing `cluster/azure/config-default.sh`. - -### Adding the Kubernetes command line tools to PATH - -The [kubectl](../../docs/user-guide/kubectl/kubectl.md) tool controls the Kubernetes cluster manager. It lets you inspect your cluster resources, create, delete, and update components, and much more. -You will use it to look at your new cluster and bring up example apps. - -Add the appropriate binary folder to your `PATH` to access kubectl: - - # OS X - export PATH=/platforms/darwin/amd64:$PATH - - # Linux - export PATH=/platforms/linux/amd64:$PATH - -## Getting started with your cluster - -See [a simple nginx example](../user-guide/simple-nginx.md) to try out your new cluster. - -For more complete applications, please look in the [examples directory](../../examples/). - -## Tearing down the cluster - -```sh -cluster/kube-down.sh -``` - - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/getting-started-guides/azure.md?pixel)]() - diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/bigquery-logging.png b/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/bigquery-logging.png deleted file mode 100644 index b7a6f94c288e..000000000000 Binary files a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/bigquery-logging.png and /dev/null differ diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/binary_release.md b/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/binary_release.md deleted file mode 100644 index 589938a08734..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/binary_release.md +++ /dev/null @@ -1,61 +0,0 @@ - - - - -WARNING -WARNING -WARNING -WARNING -WARNING - -

    PLEASE NOTE: This document applies to the HEAD of the source tree

    - -If you are using a released version of Kubernetes, you should -refer to the docs that go with that version. - - -The latest 1.0.x release of this document can be found -[here](http://releases.k8s.io/release-1.0/docs/getting-started-guides/binary_release.md). - -Documentation for other releases can be found at -[releases.k8s.io](http://releases.k8s.io). - --- - - - - - -## Getting a Binary Release - -You can either build a release from sources or download a pre-built release. If you do not plan on developing Kubernetes itself, we suggest a pre-built release. - -### Prebuilt Binary Release - -The list of binary releases is available for download from the [GitHub Kubernetes repo release page](https://k8s.io/kubernetes/releases). - -Download the latest release and unpack this tar file on Linux or OS X, cd to the created `kubernetes/` directory, and then follow the getting started guide for your cloud. - -### Building from source - -Get the Kubernetes source. If you are simply building a release from source there is no need to set up a full golang environment as all building happens in a Docker container. - -Building a release is simple. - -```bash -git clone https://k8s.io/kubernetes.git -cd kubernetes -make release -``` - -For more details on the release process see the [`build/` directory](http://releases.k8s.io/HEAD/build/) - - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/getting-started-guides/binary_release.md?pixel)]() - diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/centos/centos_manual_config.md b/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/centos/centos_manual_config.md deleted file mode 100644 index af6d02c18080..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/centos/centos_manual_config.md +++ /dev/null @@ -1,207 +0,0 @@ - - - - -WARNING -WARNING -WARNING -WARNING -WARNING - -

    PLEASE NOTE: This document applies to the HEAD of the source tree

    - -If you are using a released version of Kubernetes, you should -refer to the docs that go with that version. - - -The latest 1.0.x release of this document can be found -[here](http://releases.k8s.io/release-1.0/docs/getting-started-guides/centos/centos_manual_config.md). - -Documentation for other releases can be found at -[releases.k8s.io](http://releases.k8s.io). - --- - - - - -Getting started on [CentOS](http://centos.org) ----------------------------------------------- - -**Table of Contents** - -- [Prerequisites](#prerequisites) -- [Starting a cluster](#starting-a-cluster) - -## Prerequisites - -You need two machines with CentOS installed on them. - -## Starting a cluster - -This is a getting started guide for CentOS. It is a manual configuration so you understand all the underlying packages / services / ports, etc... - -This guide will only get ONE node working. Multiple nodes requires a functional [networking configuration](../../admin/networking.md) done outside of kubernetes. Although the additional Kubernetes configuration requirements should be obvious. - -The Kubernetes package provides a few services: kube-apiserver, kube-scheduler, kube-controller-manager, kubelet, kube-proxy. These services are managed by systemd and the configuration resides in a central location: /etc/kubernetes. We will break the services up between the hosts. The first host, centos-master, will be the Kubernetes master. This host will run the kube-apiserver, kube-controller-manager, and kube-scheduler. In addition, the master will also run _etcd_. The remaining host, centos-minion will be the node and run kubelet, proxy, cadvisor and docker. - -**System Information:** - -Hosts: - -``` -centos-master = 192.168.121.9 -centos-minion = 192.168.121.65 -``` - -**Prepare the hosts:** - -* Create virt7-testing repo on all hosts - centos-{master,minion} with following information. - -``` -[virt7-testing] -name=virt7-testing -baseurl=http://cbs.centos.org/repos/virt7-testing/x86_64/os/ -gpgcheck=0 -``` - -* Install Kubernetes on all hosts - centos-{master,minion}. This will also pull in etcd, docker, and cadvisor. - -```sh -yum -y install --enablerepo=virt7-testing kubernetes -``` - -* Note * Using etcd-0.4.6-7 (This is temporary update in documentation) - -If you do not get etcd-0.4.6-7 installed with virt7-testing repo, - -In the current virt7-testing repo, the etcd package is updated which causes service failure. To avoid this, - -```sh -yum erase etcd -``` - -It will uninstall the current available etcd package - -```sh -yum install http://cbs.centos.org/kojifiles/packages/etcd/0.4.6/7.el7.centos/x86_64/etcd-0.4.6-7.el7.centos.x86_64.rpm -yum -y install --enablerepo=virt7-testing kubernetes -``` - -* Add master and node to /etc/hosts on all machines (not needed if hostnames already in DNS) - -```sh -echo "192.168.121.9 centos-master -192.168.121.65 centos-minion" >> /etc/hosts -``` - -* Edit /etc/kubernetes/config which will be the same on all hosts to contain: - -```sh -# Comma separated list of nodes in the etcd cluster -KUBE_ETCD_SERVERS="--etcd_servers=http://centos-master:4001" - -# logging to stderr means we get it in the systemd journal -KUBE_LOGTOSTDERR="--logtostderr=true" - -# journal message level, 0 is debug -KUBE_LOG_LEVEL="--v=0" - -# Should this cluster be allowed to run privileged docker containers -KUBE_ALLOW_PRIV="--allow_privileged=false" -``` - -* Disable the firewall on both the master and node, as docker does not play well with other firewall rule managers - -```sh -systemctl disable iptables-services firewalld -systemctl stop iptables-services firewalld -``` - -**Configure the Kubernetes services on the master.** - -* Edit /etc/kubernetes/apiserver to appear as such: - -```sh -# The address on the local server to listen to. -KUBE_API_ADDRESS="--address=0.0.0.0" - -# The port on the local server to listen on. -KUBE_API_PORT="--port=8080" - -# How the replication controller and scheduler find the kube-apiserver -KUBE_MASTER="--master=http://centos-master:8080" - -# Port kubelets listen on -KUBELET_PORT="--kubelet_port=10250" - -# Address range to use for services -KUBE_SERVICE_ADDRESSES="--service-cluster-ip-range=10.254.0.0/16" - -# Add your own! -KUBE_API_ARGS="" -``` - -* Start the appropriate services on master: - -```sh -for SERVICES in etcd kube-apiserver kube-controller-manager kube-scheduler; do - systemctl restart $SERVICES - systemctl enable $SERVICES - systemctl status $SERVICES -done -``` - -**Configure the Kubernetes services on the node.** - -***We need to configure the kubelet and start the kubelet and proxy*** - -* Edit /etc/kubernetes/kubelet to appear as such: - -```sh -# The address for the info server to serve on -KUBELET_ADDRESS="--address=0.0.0.0" - -# The port for the info server to serve on -KUBELET_PORT="--port=10250" - -# You may leave this blank to use the actual hostname -KUBELET_HOSTNAME="--hostname_override=centos-minion" - -# Add your own! -KUBELET_ARGS="" -``` - -* Start the appropriate services on node (centos-minion). - -```sh -for SERVICES in kube-proxy kubelet docker; do - systemctl restart $SERVICES - systemctl enable $SERVICES - systemctl status $SERVICES -done -``` - -*You should be finished!* - -* Check to make sure the cluster can see the node (on centos-master) - -```console -$ kubectl get nodes -NAME LABELS STATUS -centos-minion Ready -``` - -**The cluster should be running! Launch a test pod.** - -You should have a functional cluster, check out [101](../../../docs/user-guide/walkthrough/README.md)! - - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/getting-started-guides/centos/centos_manual_config.md?pixel)]() - diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/cloud-logging-console.png b/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/cloud-logging-console.png deleted file mode 100644 index fae0aecbc53d..000000000000 Binary files a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/cloud-logging-console.png and /dev/null differ diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/cloudstack.md b/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/cloudstack.md deleted file mode 100644 index a08db9866b06..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/cloudstack.md +++ /dev/null @@ -1,121 +0,0 @@ - - - - -WARNING -WARNING -WARNING -WARNING -WARNING - -

    PLEASE NOTE: This document applies to the HEAD of the source tree

    - -If you are using a released version of Kubernetes, you should -refer to the docs that go with that version. - - -The latest 1.0.x release of this document can be found -[here](http://releases.k8s.io/release-1.0/docs/getting-started-guides/cloudstack.md). - -Documentation for other releases can be found at -[releases.k8s.io](http://releases.k8s.io). - --- - - - - -Getting started on [CloudStack](http://cloudstack.apache.org) ------------------------------------------------------------- - -**Table of Contents** - -- [Introduction](#introduction) -- [Prerequisites](#prerequisites) -- [Clone the playbook](#clone-the-playbook) -- [Create a Kubernetes cluster](#create-a-kubernetes-cluster) - -### Introduction - -CloudStack is a software to build public and private clouds based on hardware virtualization principles (traditional IaaS). To deploy Kubernetes on CloudStack there are several possibilities depending on the Cloud being used and what images are made available. [Exoscale](http://exoscale.ch) for instance makes a [CoreOS](http://coreos.com) template available, therefore instructions to deploy Kubernetes on coreOS can be used. CloudStack also has a vagrant plugin available, hence Vagrant could be used to deploy Kubernetes either using the existing shell provisioner or using new Salt based recipes. - -[CoreOS](http://coreos.com) templates for CloudStack are built [nightly](http://stable.release.core-os.net/amd64-usr/current/). CloudStack operators need to [register](http://docs.cloudstack.apache.org/projects/cloudstack-administration/en/latest/templates.html) this template in their cloud before proceeding with these Kubernetes deployment instructions. - -This guide uses an [Ansible playbook](https://github.com/runseb/ansible-kubernetes). -This is a completely automated, a single playbook deploys Kubernetes based on the coreOS [instructions](coreos/coreos_multinode_cluster.md). - - -This [Ansible](http://ansibleworks.com) playbook deploys Kubernetes on a CloudStack based Cloud using CoreOS images. The playbook, creates an ssh key pair, creates a security group and associated rules and finally starts coreOS instances configured via cloud-init. - -### Prerequisites - - $ sudo apt-get install -y python-pip - $ sudo pip install ansible - $ sudo pip install cs - -[_cs_](https://github.com/exoscale/cs) is a python module for the CloudStack API. - -Set your CloudStack endpoint, API keys and HTTP method used. - -You can define them as environment variables: `CLOUDSTACK_ENDPOINT`, `CLOUDSTACK_KEY`, `CLOUDSTACK_SECRET` and `CLOUDSTACK_METHOD`. - -Or create a `~/.cloudstack.ini` file: - - [cloudstack] - endpoint = - key = - secret = - method = post - -We need to use the http POST method to pass the _large_ userdata to the coreOS instances. - -### Clone the playbook - - $ git clone --recursive https://github.com/runseb/ansible-kubernetes.git - $ cd ansible-kubernetes - -The [ansible-cloudstack](https://github.com/resmo/ansible-cloudstack) module is setup in this repository as a submodule, hence the `--recursive`. - -### Create a Kubernetes cluster - -You simply need to run the playbook. - - $ ansible-playbook k8s.yml - -Some variables can be edited in the `k8s.yml` file. - - vars: - ssh_key: k8s - k8s_num_nodes: 2 - k8s_security_group_name: k8s - k8s_node_prefix: k8s2 - k8s_template: Linux CoreOS alpha 435 64-bit 10GB Disk - k8s_instance_type: Tiny - -This will start a Kubernetes master node and a number of compute nodes (by default 2). -The `instance_type` and `template` by default are specific to [exoscale](http://exoscale.ch), edit them to specify your CloudStack cloud specific template and instance type (i.e service offering). - -Check the tasks and templates in `roles/k8s` if you want to modify anything. - -Once the playbook as finished, it will print out the IP of the Kubernetes master: - - TASK: [k8s | debug msg='k8s master IP is {{ k8s_master.default_ip }}'] ******** - -SSH to it using the key that was created and using the _core_ user and you can list the machines in your cluster: - - $ ssh -i ~/.ssh/id_rsa_k8s core@ - $ fleetctl list-machines - MACHINE IP METADATA - a017c422... role=node - ad13bf84... role=master - e9af8293... role=node - - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/getting-started-guides/cloudstack.md?pixel)]() - diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/coreos.md b/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/coreos.md deleted file mode 100644 index d6adb9d4bf35..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/coreos.md +++ /dev/null @@ -1,49 +0,0 @@ - - - - -WARNING -WARNING -WARNING -WARNING -WARNING - -

    PLEASE NOTE: This document applies to the HEAD of the source tree

    - -If you are using a released version of Kubernetes, you should -refer to the docs that go with that version. - - -The latest 1.0.x release of this document can be found -[here](http://releases.k8s.io/release-1.0/docs/getting-started-guides/coreos.md). - -Documentation for other releases can be found at -[releases.k8s.io](http://releases.k8s.io). - --- - - - - - -## Getting started on [CoreOS](http://coreos.com) - -There are multiple guides on running Kubernetes with [CoreOS](http://coreos.com): - -* [Multi-node Cluster](coreos/coreos_multinode_cluster.md) -* [Setup Multi-node Cluster on Google Compute Engine in an easy way](https://github.com/rimusz/coreos-multi-node-k8s-gce/blob/master/README.md) -* [Multi-node cluster using cloud-config and Weave on Vagrant](https://github.com/errordeveloper/weave-demos/blob/master/poseidon/README.md) -* [Multi-node cluster using cloud-config and Vagrant](https://github.com/pires/kubernetes-vagrant-coreos-cluster/blob/master/README.md) -* [Yet another multi-node cluster using cloud-config and Vagrant](https://github.com/AntonioMeireles/kubernetes-vagrant-coreos-cluster/blob/master/README.md) (similar to the one above but with an increased, more *aggressive* focus on features and flexibility) -* [Multi-node cluster with Vagrant and fleet units using a small OS X App](https://github.com/rimusz/coreos-osx-gui-kubernetes-cluster/blob/master/README.md) -* [Resizable multi-node cluster on Azure with Weave](coreos/azure/README.md) - - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/getting-started-guides/coreos.md?pixel)]() - diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/coreos/azure/.gitignore b/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/coreos/azure/.gitignore deleted file mode 100644 index c2658d7d1b31..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/coreos/azure/.gitignore +++ /dev/null @@ -1 +0,0 @@ -node_modules/ diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/coreos/azure/README.md b/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/coreos/azure/README.md deleted file mode 100644 index ac6bafd7ae83..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/coreos/azure/README.md +++ /dev/null @@ -1,269 +0,0 @@ - - - - -WARNING -WARNING -WARNING -WARNING -WARNING - -

    PLEASE NOTE: This document applies to the HEAD of the source tree

    - -If you are using a released version of Kubernetes, you should -refer to the docs that go with that version. - - -The latest 1.0.x release of this document can be found -[here](http://releases.k8s.io/release-1.0/docs/getting-started-guides/coreos/azure/README.md). - -Documentation for other releases can be found at -[releases.k8s.io](http://releases.k8s.io). - --- - - - - -Kubernetes on Azure with CoreOS and [Weave](http://weave.works) ---------------------------------------------------------------- - -**Table of Contents** - -- [Introduction](#introduction) -- [Prerequisites](#prerequisites) -- [Let's go!](#lets-go) -- [Deploying the workload](#deploying-the-workload) -- [Scaling](#scaling) -- [Exposing the app to the outside world](#exposing-the-app-to-the-outside-world) -- [Next steps](#next-steps) -- [Tear down...](#tear-down) - -## Introduction - -In this guide I will demonstrate how to deploy a Kubernetes cluster to Azure cloud. You will be using CoreOS with Weave, which implements simple and secure networking, in a transparent, yet robust way. The purpose of this guide is to provide an out-of-the-box implementation that can ultimately be taken into production with little change. It will demonstrate how to provision a dedicated Kubernetes master and etcd nodes, and show how to scale the cluster with ease. - -### Prerequisites - -1. You need an Azure account. - -## Let's go! - -To get started, you need to checkout the code: - -```sh -git clone https://k8s.io/kubernetes -cd kubernetes/docs/getting-started-guides/coreos/azure/ -``` - -You will need to have [Node.js installed](http://nodejs.org/download/) on you machine. If you have previously used Azure CLI, you should have it already. - -First, you need to install some of the dependencies with - -```sh -npm install -``` - -Now, all you need to do is: - -```sh -./azure-login.js -u -./create-kubernetes-cluster.js -``` - -This script will provision a cluster suitable for production use, where there is a ring of 3 dedicated etcd nodes: 1 kubernetes master and 2 kubernetes nodes. The `kube-00` VM will be the master, your work loads are only to be deployed on the nodes, `kube-01` and `kube-02`. Initially, all VMs are single-core, to ensure a user of the free tier can reproduce it without paying extra. I will show how to add more bigger VMs later. - -![VMs in Azure](initial_cluster.png) - -Once the creation of Azure VMs has finished, you should see the following: - -```console -... -azure_wrapper/info: Saved SSH config, you can use it like so: `ssh -F ./output/kube_1c1496016083b4_ssh_conf ` -azure_wrapper/info: The hosts in this deployment are: - [ 'etcd-00', 'etcd-01', 'etcd-02', 'kube-00', 'kube-01', 'kube-02' ] -azure_wrapper/info: Saved state into `./output/kube_1c1496016083b4_deployment.yml` -``` - -Let's login to the master node like so: - -```sh -ssh -F ./output/kube_1c1496016083b4_ssh_conf kube-00 -``` - -> Note: config file name will be different, make sure to use the one you see. - -Check there are 2 nodes in the cluster: - -```console -core@kube-00 ~ $ kubectl get nodes -NAME LABELS STATUS -kube-01 kubernetes.io/hostname=kube-01 Ready -kube-02 kubernetes.io/hostname=kube-02 Ready -``` - -## Deploying the workload - -Let's follow the Guestbook example now: - -```sh -kubectl create -f ~/guestbook-example -``` - -You need to wait for the pods to get deployed, run the following and wait for `STATUS` to change from `Pending` to `Running`. - -```sh -kubectl get pods --watch -``` - -> Note: the most time it will spend downloading Docker container images on each of the nodes. - -Eventually you should see: - -```console -NAME READY STATUS RESTARTS AGE -frontend-0a9xi 1/1 Running 0 4m -frontend-4wahe 1/1 Running 0 4m -frontend-6l36j 1/1 Running 0 4m -redis-master-talmr 1/1 Running 0 4m -redis-slave-12zfd 1/1 Running 0 4m -redis-slave-3nbce 1/1 Running 0 4m -``` - -## Scaling - -Two single-core nodes are certainly not enough for a production system of today. Let's scale the cluster by adding a couple of bigger nodes. - -You will need to open another terminal window on your machine and go to the same working directory (e.g. `~/Workspace/kubernetes/docs/getting-started-guides/coreos/azure/`). - -First, lets set the size of new VMs: - -```sh -export AZ_VM_SIZE=Large -``` - -Now, run scale script with state file of the previous deployment and number of nodes to add: - -```console -core@kube-00 ~ $ ./scale-kubernetes-cluster.js ./output/kube_1c1496016083b4_deployment.yml 2 -... -azure_wrapper/info: Saved SSH config, you can use it like so: `ssh -F ./output/kube_8f984af944f572_ssh_conf ` -azure_wrapper/info: The hosts in this deployment are: - [ 'etcd-00', - 'etcd-01', - 'etcd-02', - 'kube-00', - 'kube-01', - 'kube-02', - 'kube-03', - 'kube-04' ] -azure_wrapper/info: Saved state into `./output/kube_8f984af944f572_deployment.yml` -``` - -> Note: this step has created new files in `./output`. - -Back on `kube-00`: - -```console -core@kube-00 ~ $ kubectl get nodes -NAME LABELS STATUS -kube-01 kubernetes.io/hostname=kube-01 Ready -kube-02 kubernetes.io/hostname=kube-02 Ready -kube-03 kubernetes.io/hostname=kube-03 Ready -kube-04 kubernetes.io/hostname=kube-04 Ready -``` - -You can see that two more nodes joined happily. Let's scale the number of Guestbook instances now. - -First, double-check how many replication controllers there are: - -```console -core@kube-00 ~ $ kubectl get rc -ONTROLLER CONTAINER(S) IMAGE(S) SELECTOR REPLICAS -frontend php-redis kubernetes/example-guestbook-php-redis:v2 name=frontend 3 -redis-master master redis name=redis-master 1 -redis-slave worker kubernetes/redis-slave:v2 name=redis-slave 2 -``` - -As there are 4 nodes, let's scale proportionally: - -```console -core@kube-00 ~ $ kubectl scale --replicas=4 rc redis-slave ->>>>>>> coreos/azure: Updates for 1.0 -scaled -core@kube-00 ~ $ kubectl scale --replicas=4 rc frontend -scaled -``` - -Check what you have now: - -```console -core@kube-00 ~ $ kubectl get rc -CONTROLLER CONTAINER(S) IMAGE(S) SELECTOR REPLICAS -frontend php-redis kubernetes/example-guestbook-php-redis:v2 name=frontend 4 -redis-master master redis name=redis-master 1 -redis-slave worker kubernetes/redis-slave:v2 name=redis-slave 4 -``` - -You now will have more instances of front-end Guestbook apps and Redis slaves; and, if you look up all pods labeled `name=frontend`, you should see one running on each node. - -```console -core@kube-00 ~/guestbook-example $ kubectl get pods -l name=frontend -NAME READY STATUS RESTARTS AGE -frontend-0a9xi 1/1 Running 0 22m -frontend-4wahe 1/1 Running 0 22m -frontend-6l36j 1/1 Running 0 22m -frontend-z9oxo 1/1 Running 0 41s -``` - -## Exposing the app to the outside world - -There is no native Azure load-ballancer support in Kubernets 1.0, however here is how you can expose the Guestbook app to the Internet. - -``` -./expose_guestbook_app_port.sh ./output/kube_1c1496016083b4_ssh_conf -Guestbook app is on port 31605, will map it to port 80 on kube-00 -info: Executing command vm endpoint create -+ Getting virtual machines -+ Reading network configuration -+ Updating network configuration -info: vm endpoint create command OK -info: Executing command vm endpoint show -+ Getting virtual machines -data: Name : tcp-80-31605 -data: Local port : 31605 -data: Protcol : tcp -data: Virtual IP Address : 137.117.156.164 -data: Direct server return : Disabled -info: vm endpoint show command OK -``` - -You then should be able to access it from anywhere via the Azure virtual IP for `kube-00` displayed above, i.e. `http://137.117.156.164/` in my case. - -## Next steps - -You now have a full-blow cluster running in Azure, congrats! - -You should probably try deploy other [example apps](../../../../examples/) or write your own ;) - -## Tear down... - -If you don't wish care about the Azure bill, you can tear down the cluster. It's easy to redeploy it, as you can see. - -```sh -./destroy-cluster.js ./output/kube_8f984af944f572_deployment.yml -``` - -> Note: make sure to use the _latest state file_, as after scaling there is a new one. - -By the way, with the scripts shown, you can deploy multiple clusters, if you like :) - - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/getting-started-guides/coreos/azure/README.md?pixel)]() - diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/coreos/azure/addons/skydns-rc.yaml b/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/coreos/azure/addons/skydns-rc.yaml deleted file mode 100644 index 00a20f3b4ae6..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/coreos/azure/addons/skydns-rc.yaml +++ /dev/null @@ -1,92 +0,0 @@ -apiVersion: v1 -kind: ReplicationController -metadata: - name: kube-dns-v8 - namespace: kube-system - labels: - k8s-app: kube-dns - version: v8 - kubernetes.io/cluster-service: "true" -spec: - replicas: 3 - selector: - k8s-app: kube-dns - version: v8 - template: - metadata: - labels: - k8s-app: kube-dns - version: v8 - kubernetes.io/cluster-service: "true" - spec: - containers: - - name: etcd - image: gcr.io/google_containers/etcd:2.0.9 - resources: - limits: - cpu: 100m - memory: 50Mi - command: - - /usr/local/bin/etcd - - -data-dir - - /var/etcd/data - - -listen-client-urls - - http://127.0.0.1:2379,http://127.0.0.1:4001 - - -advertise-client-urls - - http://127.0.0.1:2379,http://127.0.0.1:4001 - - -initial-cluster-token - - skydns-etcd - volumeMounts: - - name: etcd-storage - mountPath: /var/etcd/data - - name: kube2sky - image: gcr.io/google_containers/kube2sky:1.11 - resources: - limits: - cpu: 100m - memory: 50Mi - args: - # command = "/kube2sky" - - -domain=kube.local - - -kube_master_url=http://kube-00:8080 - - name: skydns - image: gcr.io/google_containers/skydns:2015-03-11-001 - resources: - limits: - cpu: 100m - memory: 50Mi - args: - # command = "/skydns" - - -machines=http://localhost:4001 - - -addr=0.0.0.0:53 - - -domain=kube.local - ports: - - containerPort: 53 - name: dns - protocol: UDP - - containerPort: 53 - name: dns-tcp - protocol: TCP - livenessProbe: - httpGet: - path: /healthz - port: 8080 - scheme: HTTP - initialDelaySeconds: 30 - timeoutSeconds: 5 - - name: healthz - image: gcr.io/google_containers/exechealthz:1.0 - resources: - limits: - cpu: 10m - memory: 20Mi - args: - - -cmd=nslookup kubernetes.default.svc.kube.local localhost >/dev/null - - -port=8080 - ports: - - containerPort: 8080 - protocol: TCP - volumes: - - name: etcd-storage - emptyDir: {} - dnsPolicy: Default # Don't use cluster DNS. diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/coreos/azure/addons/skydns-svc.yaml b/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/coreos/azure/addons/skydns-svc.yaml deleted file mode 100644 index a0e979c26640..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/coreos/azure/addons/skydns-svc.yaml +++ /dev/null @@ -1,20 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: kube-dns - namespace: kube-system - labels: - k8s-app: kube-dns - kubernetes.io/cluster-service: "true" - kubernetes.io/name: "KubeDNS" -spec: - selector: - k8s-app: kube-dns - clusterIP: 10.1.0.3 - ports: - - name: dns - port: 53 - protocol: UDP - - name: dns-tcp - port: 53 - protocol: TCP diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/coreos/azure/azure-login.js b/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/coreos/azure/azure-login.js deleted file mode 100755 index 624916b2b56a..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/coreos/azure/azure-login.js +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env node - -require('child_process').fork('node_modules/azure-cli/bin/azure', ['login'].concat(process.argv)); diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/coreos/azure/cloud_config_templates/kubernetes-cluster-etcd-node-template.yml b/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/coreos/azure/cloud_config_templates/kubernetes-cluster-etcd-node-template.yml deleted file mode 100644 index cf75025ee1aa..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/coreos/azure/cloud_config_templates/kubernetes-cluster-etcd-node-template.yml +++ /dev/null @@ -1,19 +0,0 @@ -## This file is used as input to deployment script, which ammends it as needed. -## More specifically, we need to add peer hosts for each but the elected peer. - -coreos: - units: - - name: etcd2.service - enable: true - command: start - etcd2: - name: '%H' - initial-cluster-token: 'etcd-cluster' - initial-advertise-peer-urls: 'http://%H:2380' - listen-peer-urls: 'http://%H:2380' - listen-client-urls: 'http://0.0.0.0:2379,http://0.0.0.0:4001' - advertise-client-urls: 'http://%H:2379,http://%H:4001' - initial-cluster-state: 'new' - update: - group: stable - reboot-strategy: off diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/coreos/azure/cloud_config_templates/kubernetes-cluster-main-nodes-template.yml b/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/coreos/azure/cloud_config_templates/kubernetes-cluster-main-nodes-template.yml deleted file mode 100644 index 6955467d4b86..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/coreos/azure/cloud_config_templates/kubernetes-cluster-main-nodes-template.yml +++ /dev/null @@ -1,339 +0,0 @@ -## This file is used as input to deployment script, which ammends it as needed. -## More specifically, we need to add environment files for as many nodes as we -## are going to deploy. - -write_files: - - path: /opt/bin/curl-retry.sh - permissions: '0755' - owner: root - content: | - #!/bin/sh -x - until curl $@ - do sleep 1 - done - -coreos: - update: - group: stable - reboot-strategy: off - units: - - name: systemd-networkd-wait-online.service - drop-ins: - - name: 50-check-github-is-reachable.conf - content: | - [Service] - ExecStart=/bin/sh -x -c \ - 'until curl --silent --fail https://status.github.com/api/status.json | grep -q \"good\"; do sleep 2; done' - - - name: docker.service - drop-ins: - - name: 50-weave-kubernetes.conf - content: | - [Service] - Environment=DOCKER_OPTS='--bridge="weave" -r="false"' - - - name: weave-network.target - enable: true - content: | - [Unit] - Description=Weave Network Setup Complete - Documentation=man:systemd.special(7) - RefuseManualStart=no - After=network-online.target - [Install] - WantedBy=multi-user.target - WantedBy=kubernetes-master.target - WantedBy=kubernetes-node.target - - - name: kubernetes-master.target - enable: true - command: start - content: | - [Unit] - Description=Kubernetes Cluster Master - Documentation=http://kubernetes.io/ - RefuseManualStart=no - After=weave-network.target - Requires=weave-network.target - ConditionHost=kube-00 - Wants=kube-apiserver.service - Wants=kube-scheduler.service - Wants=kube-controller-manager.service - Wants=kube-proxy.service - [Install] - WantedBy=multi-user.target - - - name: kubernetes-node.target - enable: true - command: start - content: | - [Unit] - Description=Kubernetes Cluster Node - Documentation=http://kubernetes.io/ - RefuseManualStart=no - After=weave-network.target - Requires=weave-network.target - ConditionHost=!kube-00 - Wants=kube-proxy.service - Wants=kubelet.service - [Install] - WantedBy=multi-user.target - - - name: 10-weave.network - runtime: false - content: | - [Match] - Type=bridge - Name=weave* - [Network] - - - name: install-weave.service - enable: true - content: | - [Unit] - After=network-online.target - Before=weave.service - Before=weave-helper.service - Before=docker.service - Description=Install Weave - Documentation=http://docs.weave.works/ - Requires=network-online.target - [Service] - Type=oneshot - RemainAfterExit=yes - ExecStartPre=/bin/mkdir -p /opt/bin/ - ExecStartPre=/opt/bin/curl-retry.sh \ - --silent \ - --location \ - https://github.com/weaveworks/weave/releases/download/latest_release/weave \ - --output /opt/bin/weave - ExecStartPre=/opt/bin/curl-retry.sh \ - --silent \ - --location \ - https://raw.github.com/errordeveloper/weave-demos/master/poseidon/weave-helper \ - --output /opt/bin/weave-helper - ExecStartPre=/usr/bin/chmod +x /opt/bin/weave - ExecStartPre=/usr/bin/chmod +x /opt/bin/weave-helper - ExecStart=/bin/echo Weave Installed - [Install] - WantedBy=weave-network.target - WantedBy=weave.service - - - name: weave-helper.service - enable: true - content: | - [Unit] - After=install-weave.service - After=docker.service - Description=Weave Network Router - Documentation=http://docs.weave.works/ - Requires=docker.service - Requires=install-weave.service - [Service] - ExecStart=/opt/bin/weave-helper - Restart=always - [Install] - WantedBy=weave-network.target - - - name: weave.service - enable: true - content: | - [Unit] - After=install-weave.service - After=docker.service - Description=Weave Network Router - Documentation=http://docs.weave.works/ - Requires=docker.service - Requires=install-weave.service - [Service] - TimeoutStartSec=0 - EnvironmentFile=/etc/weave.%H.env - ExecStartPre=/opt/bin/weave setup - ExecStartPre=/opt/bin/weave launch $WEAVE_PEERS - ExecStart=/usr/bin/docker attach weave - Restart=on-failure - Restart=always - ExecStop=/opt/bin/weave stop - [Install] - WantedBy=weave-network.target - - - name: weave-create-bridge.service - enable: true - content: | - [Unit] - After=network.target - After=install-weave.service - Before=weave.service - Before=docker.service - Requires=network.target - Requires=install-weave.service - [Service] - Type=oneshot - EnvironmentFile=/etc/weave.%H.env - ExecStart=/opt/bin/weave --local create-bridge - ExecStart=/usr/bin/ip addr add dev weave $BRIDGE_ADDRESS_CIDR - ExecStart=/usr/bin/ip route add $BREAKOUT_ROUTE dev weave scope link - ExecStart=/usr/bin/ip route add 224.0.0.0/4 dev weave - [Install] - WantedBy=multi-user.target - WantedBy=weave-network.target - - - name: install-kubernetes.service - enable: true - content: | - [Unit] - After=network-online.target - Before=kube-apiserver.service - Before=kube-controller-manager.service - Before=kubelet.service - Before=kube-proxy.service - Description=Download Kubernetes Binaries - Documentation=http://kubernetes.io/ - Requires=network-online.target - [Service] - Environment=KUBE_RELEASE_TARBALL=https://k8s.io/kubernetes/releases/download/v1.0.1/kubernetes.tar.gz - ExecStartPre=/bin/mkdir -p /opt/ - ExecStart=/opt/bin/curl-retry.sh --silent --location $KUBE_RELEASE_TARBALL --output /tmp/kubernetes.tgz - ExecStart=/bin/tar xzvf /tmp/kubernetes.tgz -C /tmp/ - ExecStart=/bin/tar xzvf /tmp/kubernetes/server/kubernetes-server-linux-amd64.tar.gz -C /opt - ExecStartPost=/bin/chmod o+rx -R /opt/kubernetes - ExecStartPost=/bin/ln -s /opt/kubernetes/server/bin/kubectl /opt/bin/ - ExecStartPost=/bin/mv /tmp/kubernetes/examples/guestbook /home/core/guestbook-example - ExecStartPost=/bin/chown core. -R /home/core/guestbook-example - ExecStartPost=/bin/rm -rf /tmp/kubernetes - ExecStartPost=/bin/sed 's/# type: LoadBalancer/type: NodePort/' -i /home/core/guestbook-example/frontend-service.yaml - RemainAfterExit=yes - Type=oneshot - [Install] - WantedBy=kubernetes-master.target - WantedBy=kubernetes-node.target - - - name: kube-apiserver.service - enable: true - content: | - [Unit] - After=install-kubernetes.service - Before=kube-controller-manager.service - Before=kube-scheduler.service - ConditionFileIsExecutable=/opt/kubernetes/server/bin/kube-apiserver - Description=Kubernetes API Server - Documentation=http://kubernetes.io/ - Wants=install-kubernetes.service - ConditionHost=kube-00 - [Service] - ExecStart=/opt/kubernetes/server/bin/kube-apiserver \ - --address=0.0.0.0 \ - --port=8080 \ - $ETCD_SERVERS \ - --service-cluster-ip-range=10.1.0.0/16 \ - --logtostderr=true --v=3 - Restart=always - RestartSec=10 - [Install] - WantedBy=kubernetes-master.target - - - name: kube-scheduler.service - enable: true - content: | - [Unit] - After=kube-apiserver.service - After=install-kubernetes.service - ConditionFileIsExecutable=/opt/kubernetes/server/bin/kube-scheduler - Description=Kubernetes Scheduler - Documentation=http://kubernetes.io/ - Wants=kube-apiserver.service - ConditionHost=kube-00 - [Service] - ExecStart=/opt/kubernetes/server/bin/kube-scheduler \ - --logtostderr=true \ - --master=127.0.0.1:8080 - Restart=always - RestartSec=10 - [Install] - WantedBy=kubernetes-master.target - - - name: kube-controller-manager.service - enable: true - content: | - [Unit] - After=install-kubernetes.service - After=kube-apiserver.service - ConditionFileIsExecutable=/opt/kubernetes/server/bin/kube-controller-manager - Description=Kubernetes Controller Manager - Documentation=http://kubernetes.io/ - Wants=kube-apiserver.service - Wants=install-kubernetes.service - ConditionHost=kube-00 - [Service] - ExecStart=/opt/kubernetes/server/bin/kube-controller-manager \ - --master=127.0.0.1:8080 \ - --logtostderr=true - Restart=always - RestartSec=10 - [Install] - WantedBy=kubernetes-master.target - - - name: kubelet.service - enable: true - content: | - [Unit] - After=install-kubernetes.service - ConditionFileIsExecutable=/opt/kubernetes/server/bin/kubelet - Description=Kubernetes Kubelet - Documentation=http://kubernetes.io/ - Wants=install-kubernetes.service - ConditionHost=!kube-00 - [Service] - ExecStartPre=/bin/mkdir -p /etc/kubernetes/manifests/ - ExecStart=/opt/kubernetes/server/bin/kubelet \ - --address=0.0.0.0 \ - --port=10250 \ - --hostname_override=%H \ - --api_servers=http://kube-00:8080 \ - --logtostderr=true \ - --cluster_dns=10.1.0.3 \ - --cluster_domain=kube.local \ - --config=/etc/kubernetes/manifests/ - Restart=always - RestartSec=10 - [Install] - WantedBy=kubernetes-node.target - - - name: kube-proxy.service - enable: true - content: | - [Unit] - After=install-kubernetes.service - ConditionFileIsExecutable=/opt/kubernetes/server/bin/kube-proxy - Description=Kubernetes Proxy - Documentation=http://kubernetes.io/ - Wants=install-kubernetes.service - [Service] - ExecStart=/opt/kubernetes/server/bin/kube-proxy \ - --master=http://kube-00:8080 \ - --logtostderr=true - Restart=always - RestartSec=10 - [Install] - WantedBy=kubernetes-master.target - WantedBy=kubernetes-node.target - - - name: kube-create-addons.service - enable: true - content: | - [Unit] - After=install-kubernetes.service - ConditionFileIsExecutable=/opt/kubernetes/server/bin/kubectl - ConditionPathIsDirectory=/etc/kubernetes/addons/ - ConditionHost=kube-00 - Description=Kubernetes Addons - Documentation=http://kubernetes.io/ - Wants=install-kubernetes.service - Wants=kube-apiserver.service - [Service] - Type=oneshot - RemainAfterExit=no - ExecStart=/opt/kubernetes/server/bin/kubectl create -f /etc/kubernetes/addons/ - SuccessExitStatus=1 - [Install] - WantedBy=kubernetes-master.target diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/coreos/azure/create-kubernetes-cluster.js b/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/coreos/azure/create-kubernetes-cluster.js deleted file mode 100755 index 70248c596c67..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/coreos/azure/create-kubernetes-cluster.js +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/env node - -var azure = require('./lib/azure_wrapper.js'); -var kube = require('./lib/deployment_logic/kubernetes.js'); - -azure.create_config('kube', { 'etcd': 3, 'kube': 3 }); - -azure.run_task_queue([ - azure.queue_default_network(), - azure.queue_storage_if_needed(), - azure.queue_machines('etcd', 'stable', - kube.create_etcd_cloud_config), - azure.queue_machines('kube', 'stable', - kube.create_node_cloud_config), -]); diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/coreos/azure/destroy-cluster.js b/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/coreos/azure/destroy-cluster.js deleted file mode 100755 index ce441e538a5d..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/coreos/azure/destroy-cluster.js +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env node - -var azure = require('./lib/azure_wrapper.js'); - -azure.destroy_cluster(process.argv[2]); - -console.log('The cluster had been destroyed, you can delete the state file now.'); diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/coreos/azure/expose_guestbook_app_port.sh b/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/coreos/azure/expose_guestbook_app_port.sh deleted file mode 100755 index 65dfaf5d3a96..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/coreos/azure/expose_guestbook_app_port.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash - -# 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. - -set -e - -[ ! -z $1 ] || (echo Usage: $0 ssh_conf; exit 1) - -fe_port=$(ssh -F $1 kube-00 \ - "/opt/bin/kubectl get -o template --template='{{(index .spec.ports 0).nodePort}}' services frontend -L name=frontend" \ -) - -echo "Guestbook app is on port $fe_port, will map it to port 80 on kube-00" - -./node_modules/.bin/azure vm endpoint create kube-00 80 $fe_port - -./node_modules/.bin/azure vm endpoint show kube-00 tcp-80-${fe_port} diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/coreos/azure/external_access.png b/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/coreos/azure/external_access.png deleted file mode 100644 index 6541309b0ac8..000000000000 Binary files a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/coreos/azure/external_access.png and /dev/null differ diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/coreos/azure/initial_cluster.png b/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/coreos/azure/initial_cluster.png deleted file mode 100644 index 99646a3fd06e..000000000000 Binary files a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/coreos/azure/initial_cluster.png and /dev/null differ diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/coreos/azure/lib/azure_wrapper.js b/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/coreos/azure/lib/azure_wrapper.js deleted file mode 100644 index d389efbea224..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/coreos/azure/lib/azure_wrapper.js +++ /dev/null @@ -1,271 +0,0 @@ -var _ = require('underscore'); - -var fs = require('fs'); -var cp = require('child_process'); - -var yaml = require('js-yaml'); - -var openssl = require('openssl-wrapper'); - -var clr = require('colors'); -var inspect = require('util').inspect; - -var util = require('./util.js'); - -var coreos_image_ids = { - 'stable': '2b171e93f07c4903bcad35bda10acf22__CoreOS-Stable-717.3.0', - 'beta': '2b171e93f07c4903bcad35bda10acf22__CoreOS-Beta-723.3.0', // untested - 'alpha': '2b171e93f07c4903bcad35bda10acf22__CoreOS-Alpha-745.1.0' // untested -}; - -var conf = {}; - -var hosts = { - collection: [], - ssh_port_counter: 2200, -}; - -var task_queue = []; - -exports.run_task_queue = function (dummy) { - var tasks = { - todo: task_queue, - done: [], - }; - - var pop_task = function() { - console.log(clr.yellow('azure_wrapper/task:'), clr.grey(inspect(tasks))); - var ret = {}; - ret.current = tasks.todo.shift(); - ret.remaining = tasks.todo.length; - return ret; - }; - - (function iter (task) { - if (task.current === undefined) { - if (conf.destroying === undefined) { - create_ssh_conf(); - save_state(); - } - return; - } else { - if (task.current.length !== 0) { - console.log(clr.yellow('azure_wrapper/exec:'), clr.blue(inspect(task.current))); - cp.fork('node_modules/azure-cli/bin/azure', task.current) - .on('exit', function (code, signal) { - tasks.done.push({ - code: code, - signal: signal, - what: task.current.join(' '), - remaining: task.remaining, - }); - if (code !== 0 && conf.destroying === undefined) { - console.log(clr.red('azure_wrapper/fail: Exiting due to an error.')); - save_state(); - console.log(clr.cyan('azure_wrapper/info: You probably want to destroy and re-run.')); - process.abort(); - } else { - iter(pop_task()); - } - }); - } else { - iter(pop_task()); - } - } - })(pop_task()); -}; - -var save_state = function () { - var file_name = util.join_output_file_path(conf.name, 'deployment.yml'); - try { - conf.hosts = hosts.collection; - fs.writeFileSync(file_name, yaml.safeDump(conf)); - console.log(clr.yellow('azure_wrapper/info: Saved state into `%s`'), file_name); - } catch (e) { - console.log(clr.red(e)); - } -}; - -var load_state = function (file_name) { - try { - conf = yaml.safeLoad(fs.readFileSync(file_name, 'utf8')); - console.log(clr.yellow('azure_wrapper/info: Loaded state from `%s`'), file_name); - return conf; - } catch (e) { - console.log(clr.red(e)); - } -}; - -var create_ssh_key = function (prefix) { - var opts = { - x509: true, - nodes: true, - newkey: 'rsa:2048', - subj: '/O=Weaveworks, Inc./L=London/C=GB/CN=weave.works', - keyout: util.join_output_file_path(prefix, 'ssh.key'), - out: util.join_output_file_path(prefix, 'ssh.pem'), - }; - openssl.exec('req', opts, function (err, buffer) { - if (err) console.log(clr.red(err)); - fs.chmod(opts.keyout, '0600', function (err) { - if (err) console.log(clr.red(err)); - }); - }); - return { - key: opts.keyout, - pem: opts.out, - } -} - -var create_ssh_conf = function () { - var file_name = util.join_output_file_path(conf.name, 'ssh_conf'); - var ssh_conf_head = [ - "Host *", - "\tHostname " + conf.resources['service'] + ".cloudapp.net", - "\tUser core", - "\tCompression yes", - "\tLogLevel FATAL", - "\tStrictHostKeyChecking no", - "\tUserKnownHostsFile /dev/null", - "\tIdentitiesOnly yes", - "\tIdentityFile " + conf.resources['ssh_key']['key'], - "\n", - ]; - - fs.writeFileSync(file_name, ssh_conf_head.concat(_.map(hosts.collection, function (host) { - return _.template("Host <%= name %>\n\tPort <%= port %>\n")(host); - })).join('\n')); - console.log(clr.yellow('azure_wrapper/info:'), clr.green('Saved SSH config, you can use it like so: `ssh -F ', file_name, '`')); - console.log(clr.yellow('azure_wrapper/info:'), clr.green('The hosts in this deployment are:\n'), _.map(hosts.collection, function (host) { return host.name; })); -}; - -var get_location = function () { - if (process.env['AZ_AFFINITY']) { - return '--affinity-group=' + process.env['AZ_AFFINITY']; - } else if (process.env['AZ_LOCATION']) { - return '--location=' + process.env['AZ_LOCATION']; - } else { - return '--location=West Europe'; - } -} -var get_vm_size = function () { - if (process.env['AZ_VM_SIZE']) { - return '--vm-size=' + process.env['AZ_VM_SIZE']; - } else { - return '--vm-size=Small'; - } -} - -exports.queue_default_network = function () { - task_queue.push([ - 'network', 'vnet', 'create', - get_location(), - '--address-space=172.16.0.0', - conf.resources['vnet'], - ]); -} - -exports.queue_storage_if_needed = function() { - if (!process.env['AZURE_STORAGE_ACCOUNT']) { - conf.resources['storage_account'] = util.rand_suffix; - task_queue.push([ - 'storage', 'account', 'create', - '--type=LRS', - get_location(), - conf.resources['storage_account'], - ]); - process.env['AZURE_STORAGE_ACCOUNT'] = conf.resources['storage_account']; - } else { - // Preserve it for resizing, so we don't create a new one by accedent, - // when the environment variable is unset - conf.resources['storage_account'] = process.env['AZURE_STORAGE_ACCOUNT']; - } -}; - -exports.queue_machines = function (name_prefix, coreos_update_channel, cloud_config_creator) { - var x = conf.nodes[name_prefix]; - var vm_create_base_args = [ - 'vm', 'create', - get_location(), - get_vm_size(), - '--connect=' + conf.resources['service'], - '--virtual-network-name=' + conf.resources['vnet'], - '--no-ssh-password', - '--ssh-cert=' + conf.resources['ssh_key']['pem'], - ]; - - var cloud_config = cloud_config_creator(x, conf); - - var next_host = function (n) { - hosts.ssh_port_counter += 1; - var host = { name: util.hostname(n, name_prefix), port: hosts.ssh_port_counter }; - if (cloud_config instanceof Array) { - host.cloud_config_file = cloud_config[n]; - } else { - host.cloud_config_file = cloud_config; - } - hosts.collection.push(host); - return _.map([ - "--vm-name=<%= name %>", - "--ssh=<%= port %>", - "--custom-data=<%= cloud_config_file %>", - ], function (arg) { return _.template(arg)(host); }); - }; - - task_queue = task_queue.concat(_(x).times(function (n) { - if (conf.resizing && n < conf.old_size) { - return []; - } else { - return vm_create_base_args.concat(next_host(n), [ - coreos_image_ids[coreos_update_channel], 'core', - ]); - } - })); -}; - -exports.create_config = function (name, nodes) { - conf = { - name: name, - nodes: nodes, - weave_salt: util.rand_string(), - resources: { - vnet: [name, 'internal-vnet', util.rand_suffix].join('-'), - service: [name, util.rand_suffix].join('-'), - ssh_key: create_ssh_key(name), - } - }; - -}; - -exports.destroy_cluster = function (state_file) { - load_state(state_file); - if (conf.hosts === undefined) { - console.log(clr.red('azure_wrapper/fail: Nothing to delete.')); - process.abort(); - } - - conf.destroying = true; - task_queue = _.map(conf.hosts, function (host) { - return ['vm', 'delete', '--quiet', '--blob-delete', host.name]; - }); - - task_queue.push(['network', 'vnet', 'delete', '--quiet', conf.resources['vnet']]); - task_queue.push(['storage', 'account', 'delete', '--quiet', conf.resources['storage_account']]); - - exports.run_task_queue(); -}; - -exports.load_state_for_resizing = function (state_file, node_type, new_nodes) { - load_state(state_file); - if (conf.hosts === undefined) { - console.log(clr.red('azure_wrapper/fail: Nothing to look at.')); - process.abort(); - } - conf.resizing = true; - conf.old_size = conf.nodes[node_type]; - conf.old_state_file = state_file; - conf.nodes[node_type] += new_nodes; - hosts.collection = conf.hosts; - hosts.ssh_port_counter += conf.hosts.length; - process.env['AZURE_STORAGE_ACCOUNT'] = conf.resources['storage_account']; -} diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/coreos/azure/lib/cloud_config.js b/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/coreos/azure/lib/cloud_config.js deleted file mode 100644 index d08b3f06aecf..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/coreos/azure/lib/cloud_config.js +++ /dev/null @@ -1,58 +0,0 @@ -var _ = require('underscore'); -var fs = require('fs'); -var yaml = require('js-yaml'); -var colors = require('colors/safe'); - -var write_cloud_config_from_object = function (data, output_file) { - try { - fs.writeFileSync(output_file, [ - '#cloud-config', - yaml.safeDump(data), - ].join("\n")); - return output_file; - } catch (e) { - console.log(colors.red(e)); - } -}; - -exports.generate_environment_file_entry_from_object = function (hostname, environ) { - var data = { - hostname: hostname, - environ_array: _.map(environ, function (value, key) { - return [key.toUpperCase(), JSON.stringify(value.toString())].join('='); - }), - }; - - return { - permissions: '0600', - owner: 'root', - content: _.template("<%= environ_array.join('\\n') %>\n")(data), - path: _.template("/etc/weave.<%= hostname %>.env")(data), - }; -}; - -exports.process_template = function (input_file, output_file, processor) { - var data = {}; - try { - data = yaml.safeLoad(fs.readFileSync(input_file, 'utf8')); - } catch (e) { - console.log(colors.red(e)); - } - return write_cloud_config_from_object(processor(_.clone(data)), output_file); -}; - -exports.write_files_from = function (local_dir, remote_dir) { - try { - return _.map(fs.readdirSync(local_dir), function (fn) { - return { - path: [remote_dir, fn].join('/'), - owner: 'root', - permissions: '0640', - encoding: 'base64', - content: fs.readFileSync([local_dir, fn].join('/')).toString('base64'), - }; - }); - } catch (e) { - console.log(colors.red(e)); - } -}; diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/coreos/azure/lib/deployment_logic/kubernetes.js b/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/coreos/azure/lib/deployment_logic/kubernetes.js deleted file mode 100644 index dfeca7eb6285..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/coreos/azure/lib/deployment_logic/kubernetes.js +++ /dev/null @@ -1,77 +0,0 @@ -var _ = require('underscore'); -_.mixin(require('underscore.string').exports()); - -var util = require('../util.js'); -var cloud_config = require('../cloud_config.js'); - - -etcd_initial_cluster_conf_self = function (conf) { - var port = '2380'; - - var data = { - nodes: _(conf.nodes.etcd).times(function (n) { - var host = util.hostname(n, 'etcd'); - return [host, [host, port].join(':')].join('=http://'); - }), - }; - - return { - 'name': 'etcd2.service', - 'drop-ins': [{ - 'name': '50-etcd-initial-cluster.conf', - 'content': _.template("[Service]\nEnvironment=ETCD_INITIAL_CLUSTER=<%= nodes.join(',') %>\n")(data), - }], - }; -}; - -etcd_initial_cluster_conf_kube = function (conf) { - var port = '4001'; - - var data = { - nodes: _(conf.nodes.etcd).times(function (n) { - var host = util.hostname(n, 'etcd'); - return 'http://' + [host, port].join(':'); - }), - }; - - return { - 'name': 'kube-apiserver.service', - 'drop-ins': [{ - 'name': '50-etcd-initial-cluster.conf', - 'content': _.template("[Service]\nEnvironment=ETCD_SERVERS=--etcd_servers=<%= nodes.join(',') %>\n")(data), - }], - }; -}; - -exports.create_etcd_cloud_config = function (node_count, conf) { - var input_file = './cloud_config_templates/kubernetes-cluster-etcd-node-template.yml'; - var output_file = util.join_output_file_path('kubernetes-cluster-etcd-nodes', 'generated.yml'); - - return cloud_config.process_template(input_file, output_file, function(data) { - data.coreos.units.push(etcd_initial_cluster_conf_self(conf)); - return data; - }); -}; - -exports.create_node_cloud_config = function (node_count, conf) { - var elected_node = 0; - - var input_file = './cloud_config_templates/kubernetes-cluster-main-nodes-template.yml'; - var output_file = util.join_output_file_path('kubernetes-cluster-main-nodes', 'generated.yml'); - - var make_node_config = function (n) { - return cloud_config.generate_environment_file_entry_from_object(util.hostname(n, 'kube'), { - weave_password: conf.weave_salt, - weave_peers: n === elected_node ? "" : util.hostname(elected_node, 'kube'), - breakout_route: util.ipv4([10, 2, 0, 0], 16), - bridge_address_cidr: util.ipv4([10, 2, n, 1], 24), - }); - }; - - var write_files_extra = cloud_config.write_files_from('addons', '/etc/kubernetes/addons'); - return cloud_config.process_template(input_file, output_file, function(data) { - data.write_files = data.write_files.concat(_(node_count).times(make_node_config), write_files_extra); - data.coreos.units.push(etcd_initial_cluster_conf_kube(conf)); - return data; - }); -}; diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/coreos/azure/lib/util.js b/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/coreos/azure/lib/util.js deleted file mode 100644 index 2c88b8cff351..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/coreos/azure/lib/util.js +++ /dev/null @@ -1,33 +0,0 @@ -var _ = require('underscore'); -_.mixin(require('underscore.string').exports()); - -exports.ipv4 = function (ocets, prefix) { - return { - ocets: ocets, - prefix: prefix, - toString: function () { - return [ocets.join('.'), prefix].join('/'); - } - } -}; - -exports.hostname = function hostname (n, prefix) { - return _.template("<%= pre %>-<%= seq %>")({ - pre: prefix || 'core', - seq: _.pad(n, 2, '0'), - }); -}; - -exports.rand_string = function () { - var crypto = require('crypto'); - var shasum = crypto.createHash('sha256'); - shasum.update(crypto.randomBytes(256)); - return shasum.digest('hex'); -}; - - -exports.rand_suffix = exports.rand_string().substring(50); - -exports.join_output_file_path = function(prefix, suffix) { - return './output/' + [prefix, exports.rand_suffix, suffix].join('_'); -}; diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/coreos/azure/package.json b/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/coreos/azure/package.json deleted file mode 100644 index 3269b418e0cd..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/coreos/azure/package.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "coreos-azure-weave", - "version": "1.0.0", - "description": "Small utility to bring up a woven CoreOS cluster", - "main": "index.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "author": "Ilya Dmitrichenko ", - "license": "Apache 2.0", - "dependencies": { - "azure-cli": "^0.9.5", - "colors": "^1.0.3", - "js-yaml": "^3.2.5", - "openssl-wrapper": "^0.2.1", - "underscore": "^1.7.0", - "underscore.string": "^3.0.2" - } -} diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/coreos/azure/scale-kubernetes-cluster.js b/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/coreos/azure/scale-kubernetes-cluster.js deleted file mode 100755 index f606898874c0..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/coreos/azure/scale-kubernetes-cluster.js +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env node - -var azure = require('./lib/azure_wrapper.js'); -var kube = require('./lib/deployment_logic/kubernetes.js'); - -azure.load_state_for_resizing(process.argv[2], 'kube', parseInt(process.argv[3] || 1)); - -azure.run_task_queue([ - azure.queue_machines('kube', 'stable', kube.create_node_cloud_config), -]); diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/coreos/bare_metal_offline.md b/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/coreos/bare_metal_offline.md deleted file mode 100644 index fce30d482359..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/coreos/bare_metal_offline.md +++ /dev/null @@ -1,707 +0,0 @@ - - - - -WARNING -WARNING -WARNING -WARNING -WARNING - -

    PLEASE NOTE: This document applies to the HEAD of the source tree

    - -If you are using a released version of Kubernetes, you should -refer to the docs that go with that version. - - -The latest 1.0.x release of this document can be found -[here](http://releases.k8s.io/release-1.0/docs/getting-started-guides/coreos/bare_metal_offline.md). - -Documentation for other releases can be found at -[releases.k8s.io](http://releases.k8s.io). - --- - - - - -Bare Metal CoreOS with Kubernetes (OFFLINE) ------------------------------------------- -Deploy a CoreOS running Kubernetes environment. This particular guild is made to help those in an OFFLINE system, wither for testing a POC before the real deal, or you are restricted to be totally offline for your applications. - -**Table of Contents** - -- [Prerequisites](#prerequisites) -- [High Level Design](#high-level-design) -- [This Guides variables](#this-guides-variables) -- [Setup PXELINUX CentOS](#setup-pxelinux-centos) -- [Adding CoreOS to PXE](#adding-coreos-to-pxe) -- [DHCP configuration](#dhcp-configuration) -- [Kubernetes](#kubernetes) -- [Cloud Configs](#cloud-configs) - - [master.yml](#masteryml) - - [node.yml](#nodeyml) -- [New pxelinux.cfg file](#new-pxelinuxcfg-file) -- [Specify the pxelinux targets](#specify-the-pxelinux-targets) -- [Creating test pod](#creating-test-pod) -- [Helping commands for debugging](#helping-commands-for-debugging) - - -## Prerequisites - -1. Installed *CentOS 6* for PXE server -2. At least two bare metal nodes to work with - -## High Level Design - -1. Manage the tftp directory - * /tftpboot/(coreos)(centos)(RHEL) - * /tftpboot/pxelinux.0/(MAC) -> linked to Linux image config file -2. Update per install the link for pxelinux -3. Update the DHCP config to reflect the host needing deployment -4. Setup nodes to deploy CoreOS creating a etcd cluster. -5. Have no access to the public [etcd discovery tool](https://discovery.etcd.io/). -6. Installing the CoreOS slaves to become Kubernetes nodes. - -## This Guides variables - -| Node Description | MAC | IP | -| :---------------------------- | :---------------: | :---------: | -| CoreOS/etcd/Kubernetes Master | d0:00:67:13:0d:00 | 10.20.30.40 | -| CoreOS Slave 1 | d0:00:67:13:0d:01 | 10.20.30.41 | -| CoreOS Slave 2 | d0:00:67:13:0d:02 | 10.20.30.42 | - - -## Setup PXELINUX CentOS - -To setup CentOS PXELINUX environment there is a complete [guide here](http://docs.fedoraproject.org/en-US/Fedora/7/html/Installation_Guide/ap-pxe-server.html). This section is the abbreviated version. - -1. Install packages needed on CentOS - - sudo yum install tftp-server dhcp syslinux - -2. `vi /etc/xinetd.d/tftp` to enable tftp service and change disable to 'no' - disable = no - -3. Copy over the syslinux images we will need. - - su - - mkdir -p /tftpboot - cd /tftpboot - cp /usr/share/syslinux/pxelinux.0 /tftpboot - cp /usr/share/syslinux/menu.c32 /tftpboot - cp /usr/share/syslinux/memdisk /tftpboot - cp /usr/share/syslinux/mboot.c32 /tftpboot - cp /usr/share/syslinux/chain.c32 /tftpboot - - /sbin/service dhcpd start - /sbin/service xinetd start - /sbin/chkconfig tftp on - -4. Setup default boot menu - - mkdir /tftpboot/pxelinux.cfg - touch /tftpboot/pxelinux.cfg/default - -5. Edit the menu `vi /tftpboot/pxelinux.cfg/default` - - default menu.c32 - prompt 0 - timeout 15 - ONTIMEOUT local - display boot.msg - - MENU TITLE Main Menu - - LABEL local - MENU LABEL Boot local hard drive - LOCALBOOT 0 - -Now you should have a working PXELINUX setup to image CoreOS nodes. You can verify the services by using VirtualBox locally or with bare metal servers. - -## Adding CoreOS to PXE - -This section describes how to setup the CoreOS images to live alongside a pre-existing PXELINUX environment. - -1. Find or create the TFTP root directory that everything will be based off of. - * For this document we will assume `/tftpboot/` is our root directory. -2. Once we know and have our tftp root directory we will create a new directory structure for our CoreOS images. -3. Download the CoreOS PXE files provided by the CoreOS team. - - MY_TFTPROOT_DIR=/tftpboot - mkdir -p $MY_TFTPROOT_DIR/images/coreos/ - cd $MY_TFTPROOT_DIR/images/coreos/ - wget http://stable.release.core-os.net/amd64-usr/current/coreos_production_pxe.vmlinuz - wget http://stable.release.core-os.net/amd64-usr/current/coreos_production_pxe.vmlinuz.sig - wget http://stable.release.core-os.net/amd64-usr/current/coreos_production_pxe_image.cpio.gz - wget http://stable.release.core-os.net/amd64-usr/current/coreos_production_pxe_image.cpio.gz.sig - gpg --verify coreos_production_pxe.vmlinuz.sig - gpg --verify coreos_production_pxe_image.cpio.gz.sig - -4. Edit the menu `vi /tftpboot/pxelinux.cfg/default` again - - default menu.c32 - prompt 0 - timeout 300 - ONTIMEOUT local - display boot.msg - - MENU TITLE Main Menu - - LABEL local - MENU LABEL Boot local hard drive - LOCALBOOT 0 - - MENU BEGIN CoreOS Menu - - LABEL coreos-master - MENU LABEL CoreOS Master - KERNEL images/coreos/coreos_production_pxe.vmlinuz - APPEND initrd=images/coreos/coreos_production_pxe_image.cpio.gz cloud-config-url=http:///pxe-cloud-config-single-master.yml - - LABEL coreos-slave - MENU LABEL CoreOS Slave - KERNEL images/coreos/coreos_production_pxe.vmlinuz - APPEND initrd=images/coreos/coreos_production_pxe_image.cpio.gz cloud-config-url=http:///pxe-cloud-config-slave.yml - MENU END - -This configuration file will now boot from local drive but have the option to PXE image CoreOS. - -## DHCP configuration - -This section covers configuring the DHCP server to hand out our new images. In this case we are assuming that there are other servers that will boot alongside other images. - -1. Add the `filename` to the _host_ or _subnet_ sections. - - filename "/tftpboot/pxelinux.0"; - -2. At this point we want to make pxelinux configuration files that will be the templates for the different CoreOS deployments. - - subnet 10.20.30.0 netmask 255.255.255.0 { - next-server 10.20.30.242; - option broadcast-address 10.20.30.255; - filename ""; - - ... - # http://www.syslinux.org/wiki/index.php/PXELINUX - host core_os_master { - hardware ethernet d0:00:67:13:0d:00; - option routers 10.20.30.1; - fixed-address 10.20.30.40; - option domain-name-servers 10.20.30.242; - filename "/pxelinux.0"; - } - host core_os_slave { - hardware ethernet d0:00:67:13:0d:01; - option routers 10.20.30.1; - fixed-address 10.20.30.41; - option domain-name-servers 10.20.30.242; - filename "/pxelinux.0"; - } - host core_os_slave2 { - hardware ethernet d0:00:67:13:0d:02; - option routers 10.20.30.1; - fixed-address 10.20.30.42; - option domain-name-servers 10.20.30.242; - filename "/pxelinux.0"; - } - ... - } - -We will be specifying the node configuration later in the guide. - -## Kubernetes - -To deploy our configuration we need to create an `etcd` master. To do so we want to pxe CoreOS with a specific cloud-config.yml. There are two options we have here. -1. Is to template the cloud config file and programmatically create new static configs for different cluster setups. -2. Have a service discovery protocol running in our stack to do auto discovery. - -This demo we just make a static single `etcd` server to host our Kubernetes and `etcd` master servers. - -Since we are OFFLINE here most of the helping processes in CoreOS and Kubernetes are then limited. To do our setup we will then have to download and serve up our binaries for Kubernetes in our local environment. - -An easy solution is to host a small web server on the DHCP/TFTP host for all our binaries to make them available to the local CoreOS PXE machines. - -To get this up and running we are going to setup a simple `apache` server to serve our binaries needed to bootstrap Kubernetes. - -This is on the PXE server from the previous section: - - rm /etc/httpd/conf.d/welcome.conf - cd /var/www/html/ - wget -O kube-register https://github.com/kelseyhightower/kube-register/releases/download/v0.0.2/kube-register-0.0.2-linux-amd64 - wget -O setup-network-environment https://github.com/kelseyhightower/setup-network-environment/releases/download/v1.0.0/setup-network-environment - wget https://storage.googleapis.com/kubernetes-release/release/v0.15.0/bin/linux/amd64/kubernetes --no-check-certificate - wget https://storage.googleapis.com/kubernetes-release/release/v0.15.0/bin/linux/amd64/kube-apiserver --no-check-certificate - wget https://storage.googleapis.com/kubernetes-release/release/v0.15.0/bin/linux/amd64/kube-controller-manager --no-check-certificate - wget https://storage.googleapis.com/kubernetes-release/release/v0.15.0/bin/linux/amd64/kube-scheduler --no-check-certificate - wget https://storage.googleapis.com/kubernetes-release/release/v0.15.0/bin/linux/amd64/kubectl --no-check-certificate - wget https://storage.googleapis.com/kubernetes-release/release/v0.15.0/bin/linux/amd64/kubecfg --no-check-certificate - wget https://storage.googleapis.com/kubernetes-release/release/v0.15.0/bin/linux/amd64/kubelet --no-check-certificate - wget https://storage.googleapis.com/kubernetes-release/release/v0.15.0/bin/linux/amd64/kube-proxy --no-check-certificate - wget -O flanneld https://storage.googleapis.com/k8s/flanneld --no-check-certificate - -This sets up our binaries we need to run Kubernetes. This would need to be enhanced to download from the Internet for updates in the future. - -Now for the good stuff! - -## Cloud Configs - -The following config files are tailored for the OFFLINE version of a Kubernetes deployment. - -These are based on the work found here: [master.yml](cloud-configs/master.yaml), [node.yml](cloud-configs/node.yaml) - -To make the setup work, you need to replace a few placeholders: - - - Replace `` with your PXE server ip address (e.g. 10.20.30.242) - - Replace `` with the Kubernetes master ip address (e.g. 10.20.30.40) - - If you run a private docker registry, replace `rdocker.example.com` with your docker registry dns name. - - If you use a proxy, replace `rproxy.example.com` with your proxy server (and port) - - Add your own SSH public key(s) to the cloud config at the end - -### master.yml - -On the PXE server make and fill in the variables `vi /var/www/html/coreos/pxe-cloud-config-master.yml`. - - - #cloud-config - --- - write_files: - - path: /opt/bin/waiter.sh - owner: root - content: | - #! /usr/bin/bash - until curl http://127.0.0.1:4001/v2/machines; do sleep 2; done - - path: /opt/bin/kubernetes-download.sh - owner: root - permissions: 0755 - content: | - #! /usr/bin/bash - /usr/bin/wget -N -P "/opt/bin" "http:///kubectl" - /usr/bin/wget -N -P "/opt/bin" "http:///kubernetes" - /usr/bin/wget -N -P "/opt/bin" "http:///kubecfg" - chmod +x /opt/bin/* - - path: /etc/profile.d/opt-path.sh - owner: root - permissions: 0755 - content: | - #! /usr/bin/bash - PATH=$PATH/opt/bin - coreos: - units: - - name: 10-eno1.network - runtime: true - content: | - [Match] - Name=eno1 - [Network] - DHCP=yes - - name: 20-nodhcp.network - runtime: true - content: | - [Match] - Name=en* - [Network] - DHCP=none - - name: get-kube-tools.service - runtime: true - command: start - content: | - [Service] - ExecStartPre=-/usr/bin/mkdir -p /opt/bin - ExecStart=/opt/bin/kubernetes-download.sh - RemainAfterExit=yes - Type=oneshot - - name: setup-network-environment.service - command: start - content: | - [Unit] - Description=Setup Network Environment - Documentation=https://github.com/kelseyhightower/setup-network-environment - Requires=network-online.target - After=network-online.target - [Service] - ExecStartPre=-/usr/bin/mkdir -p /opt/bin - ExecStartPre=/usr/bin/wget -N -P /opt/bin http:///setup-network-environment - ExecStartPre=/usr/bin/chmod +x /opt/bin/setup-network-environment - ExecStart=/opt/bin/setup-network-environment - RemainAfterExit=yes - Type=oneshot - - name: etcd.service - command: start - content: | - [Unit] - Description=etcd - Requires=setup-network-environment.service - After=setup-network-environment.service - [Service] - EnvironmentFile=/etc/network-environment - User=etcd - PermissionsStartOnly=true - ExecStart=/usr/bin/etcd \ - --name ${DEFAULT_IPV4} \ - --addr ${DEFAULT_IPV4}:4001 \ - --bind-addr 0.0.0.0 \ - --cluster-active-size 1 \ - --data-dir /var/lib/etcd \ - --http-read-timeout 86400 \ - --peer-addr ${DEFAULT_IPV4}:7001 \ - --snapshot true - Restart=always - RestartSec=10s - - name: fleet.socket - command: start - content: | - [Socket] - ListenStream=/var/run/fleet.sock - - name: fleet.service - command: start - content: | - [Unit] - Description=fleet daemon - Wants=etcd.service - After=etcd.service - Wants=fleet.socket - After=fleet.socket - [Service] - Environment="FLEET_ETCD_SERVERS=http://127.0.0.1:4001" - Environment="FLEET_METADATA=role=master" - ExecStart=/usr/bin/fleetd - Restart=always - RestartSec=10s - - name: etcd-waiter.service - command: start - content: | - [Unit] - Description=etcd waiter - Wants=network-online.target - Wants=etcd.service - After=etcd.service - After=network-online.target - Before=flannel.service - Before=setup-network-environment.service - [Service] - ExecStartPre=/usr/bin/chmod +x /opt/bin/waiter.sh - ExecStart=/usr/bin/bash /opt/bin/waiter.sh - RemainAfterExit=true - Type=oneshot - - name: flannel.service - command: start - content: | - [Unit] - Wants=etcd-waiter.service - After=etcd-waiter.service - Requires=etcd.service - After=etcd.service - After=network-online.target - Wants=network-online.target - Description=flannel is an etcd backed overlay network for containers - [Service] - Type=notify - ExecStartPre=-/usr/bin/mkdir -p /opt/bin - ExecStartPre=/usr/bin/wget -N -P /opt/bin http:///flanneld - ExecStartPre=/usr/bin/chmod +x /opt/bin/flanneld - ExecStartPre=-/usr/bin/etcdctl mk /coreos.com/network/config '{"Network":"10.100.0.0/16", "Backend": {"Type": "vxlan"}}' - ExecStart=/opt/bin/flanneld - - name: kube-apiserver.service - command: start - content: | - [Unit] - Description=Kubernetes API Server - Documentation=https://k8s.io/kubernetes - Requires=etcd.service - After=etcd.service - [Service] - ExecStartPre=-/usr/bin/mkdir -p /opt/bin - ExecStartPre=/usr/bin/wget -N -P /opt/bin http:///kube-apiserver - ExecStartPre=/usr/bin/chmod +x /opt/bin/kube-apiserver - ExecStart=/opt/bin/kube-apiserver \ - --address=0.0.0.0 \ - --port=8080 \ - --service-cluster-ip-range=10.100.0.0/16 \ - --etcd_servers=http://127.0.0.1:4001 \ - --logtostderr=true - Restart=always - RestartSec=10 - - name: kube-controller-manager.service - command: start - content: | - [Unit] - Description=Kubernetes Controller Manager - Documentation=https://k8s.io/kubernetes - Requires=kube-apiserver.service - After=kube-apiserver.service - [Service] - ExecStartPre=/usr/bin/wget -N -P /opt/bin http:///kube-controller-manager - ExecStartPre=/usr/bin/chmod +x /opt/bin/kube-controller-manager - ExecStart=/opt/bin/kube-controller-manager \ - --master=127.0.0.1:8080 \ - --logtostderr=true - Restart=always - RestartSec=10 - - name: kube-scheduler.service - command: start - content: | - [Unit] - Description=Kubernetes Scheduler - Documentation=https://k8s.io/kubernetes - Requires=kube-apiserver.service - After=kube-apiserver.service - [Service] - ExecStartPre=/usr/bin/wget -N -P /opt/bin http:///kube-scheduler - ExecStartPre=/usr/bin/chmod +x /opt/bin/kube-scheduler - ExecStart=/opt/bin/kube-scheduler --master=127.0.0.1:8080 - Restart=always - RestartSec=10 - - name: kube-register.service - command: start - content: | - [Unit] - Description=Kubernetes Registration Service - Documentation=https://github.com/kelseyhightower/kube-register - Requires=kube-apiserver.service - After=kube-apiserver.service - Requires=fleet.service - After=fleet.service - [Service] - ExecStartPre=/usr/bin/wget -N -P /opt/bin http:///kube-register - ExecStartPre=/usr/bin/chmod +x /opt/bin/kube-register - ExecStart=/opt/bin/kube-register \ - --metadata=role=node \ - --fleet-endpoint=unix:///var/run/fleet.sock \ - --healthz-port=10248 \ - --api-endpoint=http://127.0.0.1:8080 - Restart=always - RestartSec=10 - update: - group: stable - reboot-strategy: off - ssh_authorized_keys: - - ssh-rsa AAAAB3NzaC1yc2EAAAAD... - - -### node.yml - -On the PXE server make and fill in the variables `vi /var/www/html/coreos/pxe-cloud-config-slave.yml`. - - #cloud-config - --- - write_files: - - path: /etc/default/docker - content: | - DOCKER_EXTRA_OPTS='--insecure-registry="rdocker.example.com:5000"' - coreos: - units: - - name: 10-eno1.network - runtime: true - content: | - [Match] - Name=eno1 - [Network] - DHCP=yes - - name: 20-nodhcp.network - runtime: true - content: | - [Match] - Name=en* - [Network] - DHCP=none - - name: etcd.service - mask: true - - name: docker.service - drop-ins: - - name: 50-insecure-registry.conf - content: | - [Service] - Environment="HTTP_PROXY=http://rproxy.example.com:3128/" "NO_PROXY=localhost,127.0.0.0/8,rdocker.example.com" - - name: fleet.service - command: start - content: | - [Unit] - Description=fleet daemon - Wants=fleet.socket - After=fleet.socket - [Service] - Environment="FLEET_ETCD_SERVERS=http://:4001" - Environment="FLEET_METADATA=role=node" - ExecStart=/usr/bin/fleetd - Restart=always - RestartSec=10s - - name: flannel.service - command: start - content: | - [Unit] - After=network-online.target - Wants=network-online.target - Description=flannel is an etcd backed overlay network for containers - [Service] - Type=notify - ExecStartPre=-/usr/bin/mkdir -p /opt/bin - ExecStartPre=/usr/bin/wget -N -P /opt/bin http:///flanneld - ExecStartPre=/usr/bin/chmod +x /opt/bin/flanneld - ExecStart=/opt/bin/flanneld -etcd-endpoints http://:4001 - - name: docker.service - command: start - content: | - [Unit] - After=flannel.service - Wants=flannel.service - Description=Docker Application Container Engine - Documentation=http://docs.docker.io - [Service] - EnvironmentFile=-/etc/default/docker - EnvironmentFile=/run/flannel/subnet.env - ExecStartPre=/bin/mount --make-rprivate / - ExecStart=/usr/bin/docker -d --bip=${FLANNEL_SUBNET} --mtu=${FLANNEL_MTU} -s=overlay -H fd:// ${DOCKER_EXTRA_OPTS} - [Install] - WantedBy=multi-user.target - - name: setup-network-environment.service - command: start - content: | - [Unit] - Description=Setup Network Environment - Documentation=https://github.com/kelseyhightower/setup-network-environment - Requires=network-online.target - After=network-online.target - [Service] - ExecStartPre=-/usr/bin/mkdir -p /opt/bin - ExecStartPre=/usr/bin/wget -N -P /opt/bin http:///setup-network-environment - ExecStartPre=/usr/bin/chmod +x /opt/bin/setup-network-environment - ExecStart=/opt/bin/setup-network-environment - RemainAfterExit=yes - Type=oneshot - - name: kube-proxy.service - command: start - content: | - [Unit] - Description=Kubernetes Proxy - Documentation=https://k8s.io/kubernetes - Requires=setup-network-environment.service - After=setup-network-environment.service - [Service] - ExecStartPre=/usr/bin/wget -N -P /opt/bin http:///kube-proxy - ExecStartPre=/usr/bin/chmod +x /opt/bin/kube-proxy - ExecStart=/opt/bin/kube-proxy \ - --etcd_servers=http://:4001 \ - --logtostderr=true - Restart=always - RestartSec=10 - - name: kube-kubelet.service - command: start - content: | - [Unit] - Description=Kubernetes Kubelet - Documentation=https://k8s.io/kubernetes - Requires=setup-network-environment.service - After=setup-network-environment.service - [Service] - EnvironmentFile=/etc/network-environment - ExecStartPre=/usr/bin/wget -N -P /opt/bin http:///kubelet - ExecStartPre=/usr/bin/chmod +x /opt/bin/kubelet - ExecStart=/opt/bin/kubelet \ - --address=0.0.0.0 \ - --port=10250 \ - --hostname_override=${DEFAULT_IPV4} \ - --api_servers=:8080 \ - --healthz_bind_address=0.0.0.0 \ - --healthz_port=10248 \ - --logtostderr=true - Restart=always - RestartSec=10 - update: - group: stable - reboot-strategy: off - ssh_authorized_keys: - - ssh-rsa AAAAB3NzaC1yc2EAAAAD... - - -## New pxelinux.cfg file - -Create a pxelinux target file for a _slave_ node: `vi /tftpboot/pxelinux.cfg/coreos-node-slave` - - default coreos - prompt 1 - timeout 15 - - display boot.msg - - label coreos - menu default - kernel images/coreos/coreos_production_pxe.vmlinuz - append initrd=images/coreos/coreos_production_pxe_image.cpio.gz cloud-config-url=http:///coreos/pxe-cloud-config-slave.yml console=tty0 console=ttyS0 coreos.autologin=tty1 coreos.autologin=ttyS0 - -And one for the _master_ node: `vi /tftpboot/pxelinux.cfg/coreos-node-master` - - default coreos - prompt 1 - timeout 15 - - display boot.msg - - label coreos - menu default - kernel images/coreos/coreos_production_pxe.vmlinuz - append initrd=images/coreos/coreos_production_pxe_image.cpio.gz cloud-config-url=http:///coreos/pxe-cloud-config-master.yml console=tty0 console=ttyS0 coreos.autologin=tty1 coreos.autologin=ttyS0 - -## Specify the pxelinux targets - -Now that we have our new targets setup for master and slave we want to configure the specific hosts to those targets. We will do this by using the pxelinux mechanism of setting a specific MAC addresses to a specific pxelinux.cfg file. - -Refer to the MAC address table in the beginning of this guide. Documentation for more details can be found [here](http://www.syslinux.org/wiki/index.php/PXELINUX). - - cd /tftpboot/pxelinux.cfg - ln -s coreos-node-master 01-d0-00-67-13-0d-00 - ln -s coreos-node-slave 01-d0-00-67-13-0d-01 - ln -s coreos-node-slave 01-d0-00-67-13-0d-02 - - -Reboot these servers to get the images PXEd and ready for running containers! - -## Creating test pod - -Now that the CoreOS with Kubernetes installed is up and running lets spin up some Kubernetes pods to demonstrate the system. - -See [a simple nginx example](../../../docs/user-guide/simple-nginx.md) to try out your new cluster. - -For more complete applications, please look in the [examples directory](../../../examples/). - -## Helping commands for debugging - -List all keys in etcd: - - etcdctl ls --recursive - -List fleet machines - - fleetctl list-machines - -Check system status of services on master: - - systemctl status kube-apiserver - systemctl status kube-controller-manager - systemctl status kube-scheduler - systemctl status kube-register - -Check system status of services on a node: - - systemctl status kube-kubelet - systemctl status docker.service - -List Kubernetes - - kubectl get pods - kubectl get nodes - - -Kill all pods: - - for i in `kubectl get pods | awk '{print $1}'`; do kubectl stop pod $i; done - - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/getting-started-guides/coreos/bare_metal_offline.md?pixel)]() - diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/coreos/cloud-configs/master.yaml b/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/coreos/cloud-configs/master.yaml deleted file mode 100644 index 715904a1af52..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/coreos/cloud-configs/master.yaml +++ /dev/null @@ -1,140 +0,0 @@ -#cloud-config - ---- -write-files: - - path: /etc/conf.d/nfs - permissions: '0644' - content: | - OPTS_RPC_MOUNTD="" - - path: /opt/bin/wupiao - permissions: '0755' - content: | - #!/bin/bash - # [w]ait [u]ntil [p]ort [i]s [a]ctually [o]pen - [ -n "$1" ] && \ - until curl -o /dev/null -sIf http://${1}; do \ - sleep 1 && echo .; - done; - exit $? - -hostname: master -coreos: - etcd2: - name: master - listen-client-urls: http://0.0.0.0:2379,http://0.0.0.0:4001 - advertise-client-urls: http://$private_ipv4:2379,http://$private_ipv4:4001 - initial-cluster-token: k8s_etcd - listen-peer-urls: http://$private_ipv4:2380,http://$private_ipv4:7001 - initial-advertise-peer-urls: http://$private_ipv4:2380 - initial-cluster: master=http://$private_ipv4:2380 - initial-cluster-state: new - fleet: - metadata: "role=master" - units: - - name: generate-serviceaccount-key.service - command: start - content: | - [Unit] - Description=Generate service-account key file - - [Service] - ExecStartPre=-/usr/bin/mkdir -p /opt/bin - ExecStart=/bin/openssl genrsa -out /opt/bin/kube-serviceaccount.key 2048 2>/dev/null - RemainAfterExit=yes - Type=oneshot - - name: setup-network-environment.service - command: start - content: | - [Unit] - Description=Setup Network Environment - Documentation=https://github.com/kelseyhightower/setup-network-environment - Requires=network-online.target - After=network-online.target - - [Service] - ExecStartPre=-/usr/bin/mkdir -p /opt/bin - ExecStartPre=/usr/bin/curl -L -o /opt/bin/setup-network-environment -z /opt/bin/setup-network-environment https://github.com/kelseyhightower/setup-network-environment/releases/download/v1.0.0/setup-network-environment - ExecStartPre=/usr/bin/chmod +x /opt/bin/setup-network-environment - ExecStart=/opt/bin/setup-network-environment - RemainAfterExit=yes - Type=oneshot - - name: fleet.service - command: start - - name: flanneld.service - command: start - drop-ins: - - name: 50-network-config.conf - content: | - [Unit] - Requires=etcd2.service - [Service] - ExecStartPre=/usr/bin/etcdctl set /coreos.com/network/config '{"Network":"10.244.0.0/16", "Backend": {"Type": "vxlan"}}' - - name: docker.service - command: start - - name: kube-apiserver.service - command: start - content: | - [Unit] - Description=Kubernetes API Server - Documentation=https://k8s.io/kubernetes - Requires=setup-network-environment.service etcd2.service generate-serviceaccount-key.service - After=setup-network-environment.service etcd2.service generate-serviceaccount-key.service - - [Service] - EnvironmentFile=/etc/network-environment - ExecStartPre=-/usr/bin/mkdir -p /opt/bin - ExecStartPre=/usr/bin/curl -L -o /opt/bin/kube-apiserver -z /opt/bin/kube-apiserver https://storage.googleapis.com/kubernetes-release/release/v1.0.1/bin/linux/amd64/kube-apiserver - ExecStartPre=/usr/bin/chmod +x /opt/bin/kube-apiserver - ExecStartPre=/opt/bin/wupiao 127.0.0.1:2379/v2/machines - ExecStart=/opt/bin/kube-apiserver \ - --service_account_key_file=/opt/bin/kube-serviceaccount.key \ - --service_account_lookup=false \ - --admission_control=NamespaceLifecycle,NamespaceAutoProvision,LimitRanger,SecurityContextDeny,ServiceAccount,ResourceQuota \ - --runtime_config=api/v1 \ - --allow_privileged=true \ - --insecure_bind_address=0.0.0.0 \ - --insecure_port=8080 \ - --kubelet_https=true \ - --secure_port=6443 \ - --service-cluster-ip-range=10.100.0.0/16 \ - --etcd_servers=http://127.0.0.1:2379 \ - --public_address_override=${DEFAULT_IPV4} \ - --logtostderr=true - Restart=always - RestartSec=10 - - name: kube-controller-manager.service - command: start - content: | - [Unit] - Description=Kubernetes Controller Manager - Documentation=https://k8s.io/kubernetes - Requires=kube-apiserver.service - After=kube-apiserver.service - - [Service] - ExecStartPre=/usr/bin/curl -L -o /opt/bin/kube-controller-manager -z /opt/bin/kube-controller-manager https://storage.googleapis.com/kubernetes-release/release/v1.0.1/bin/linux/amd64/kube-controller-manager - ExecStartPre=/usr/bin/chmod +x /opt/bin/kube-controller-manager - ExecStart=/opt/bin/kube-controller-manager \ - --service_account_private_key_file=/opt/bin/kube-serviceaccount.key \ - --master=127.0.0.1:8080 \ - --logtostderr=true - Restart=always - RestartSec=10 - - name: kube-scheduler.service - command: start - content: | - [Unit] - Description=Kubernetes Scheduler - Documentation=https://k8s.io/kubernetes - Requires=kube-apiserver.service - After=kube-apiserver.service - - [Service] - ExecStartPre=/usr/bin/curl -L -o /opt/bin/kube-scheduler -z /opt/bin/kube-scheduler https://storage.googleapis.com/kubernetes-release/release/v1.0.1/bin/linux/amd64/kube-scheduler - ExecStartPre=/usr/bin/chmod +x /opt/bin/kube-scheduler - ExecStart=/opt/bin/kube-scheduler --master=127.0.0.1:8080 - Restart=always - RestartSec=10 - update: - group: alpha - reboot-strategy: off diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/coreos/cloud-configs/node.yaml b/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/coreos/cloud-configs/node.yaml deleted file mode 100644 index 44674c29c281..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/coreos/cloud-configs/node.yaml +++ /dev/null @@ -1,98 +0,0 @@ -#cloud-config -write-files: - - path: /opt/bin/wupiao - permissions: '0755' - content: | - #!/bin/bash - # [w]ait [u]ntil [p]ort [i]s [a]ctually [o]pen - [ -n "$1" ] && [ -n "$2" ] && while ! curl --output /dev/null \ - --silent --head --fail \ - http://${1}:${2}; do sleep 1 && echo -n .; done; - exit $? -coreos: - etcd2: - listen-client-urls: http://0.0.0.0:2379,http://0.0.0.0:4001 - advertise-client-urls: http://0.0.0.0:2379,http://0.0.0.0:4001 - initial-cluster: master=http://:2380 - proxy: on - fleet: - metadata: "role=node" - units: - - name: fleet.service - command: start - - name: flanneld.service - command: start - drop-ins: - - name: 50-network-config.conf - content: | - [Unit] - Requires=etcd2.service - [Service] - ExecStartPre=/usr/bin/etcdctl set /coreos.com/network/config '{"Network":"10.244.0.0/16", "Backend": {"Type": "vxlan"}}' - - name: docker.service - command: start - - name: setup-network-environment.service - command: start - content: | - [Unit] - Description=Setup Network Environment - Documentation=https://github.com/kelseyhightower/setup-network-environment - Requires=network-online.target - After=network-online.target - - [Service] - ExecStartPre=-/usr/bin/mkdir -p /opt/bin - ExecStartPre=/usr/bin/curl -L -o /opt/bin/setup-network-environment -z /opt/bin/setup-network-environment https://github.com/kelseyhightower/setup-network-environment/releases/download/v1.0.0/setup-network-environment - ExecStartPre=/usr/bin/chmod +x /opt/bin/setup-network-environment - ExecStart=/opt/bin/setup-network-environment - RemainAfterExit=yes - Type=oneshot - - name: kube-proxy.service - command: start - content: | - [Unit] - Description=Kubernetes Proxy - Documentation=https://k8s.io/kubernetes - Requires=setup-network-environment.service - After=setup-network-environment.service - - [Service] - ExecStartPre=/usr/bin/curl -L -o /opt/bin/kube-proxy -z /opt/bin/kube-proxy https://storage.googleapis.com/kubernetes-release/release/v1.0.1/bin/linux/amd64/kube-proxy - ExecStartPre=/usr/bin/chmod +x /opt/bin/kube-proxy - # wait for kubernetes master to be up and ready - ExecStartPre=/opt/bin/wupiao 8080 - ExecStart=/opt/bin/kube-proxy \ - --master=:8080 \ - --logtostderr=true - Restart=always - RestartSec=10 - - name: kube-kubelet.service - command: start - content: | - [Unit] - Description=Kubernetes Kubelet - Documentation=https://k8s.io/kubernetes - Requires=setup-network-environment.service - After=setup-network-environment.service - - [Service] - EnvironmentFile=/etc/network-environment - ExecStartPre=/usr/bin/curl -L -o /opt/bin/kubelet -z /opt/bin/kubelet https://storage.googleapis.com/kubernetes-release/release/v1.0.1/bin/linux/amd64/kubelet - ExecStartPre=/usr/bin/chmod +x /opt/bin/kubelet - # wait for kubernetes master to be up and ready - ExecStartPre=/opt/bin/wupiao 8080 - ExecStart=/opt/bin/kubelet \ - --address=0.0.0.0 \ - --port=10250 \ - --hostname_override=${DEFAULT_IPV4} \ - --api_servers=:8080 \ - --allow_privileged=true \ - --logtostderr=true \ - --cadvisor_port=4194 \ - --healthz_bind_address=0.0.0.0 \ - --healthz_port=10248 - Restart=always - RestartSec=10 - update: - group: alpha - reboot-strategy: off diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/coreos/coreos_multinode_cluster.md b/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/coreos/coreos_multinode_cluster.md deleted file mode 100644 index 4aa9fe7650bc..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/coreos/coreos_multinode_cluster.md +++ /dev/null @@ -1,174 +0,0 @@ - - - - -WARNING -WARNING -WARNING -WARNING -WARNING - -

    PLEASE NOTE: This document applies to the HEAD of the source tree

    - -If you are using a released version of Kubernetes, you should -refer to the docs that go with that version. - - -The latest 1.0.x release of this document can be found -[here](http://releases.k8s.io/release-1.0/docs/getting-started-guides/coreos/coreos_multinode_cluster.md). - -Documentation for other releases can be found at -[releases.k8s.io](http://releases.k8s.io). - --- - - - - - -# CoreOS Multinode Cluster - -Use the [master.yaml](cloud-configs/master.yaml) and [node.yaml](cloud-configs/node.yaml) cloud-configs to provision a multi-node Kubernetes cluster. - -> **Attention**: This requires at least CoreOS version **[695.0.0][coreos695]**, which includes `etcd2`. - -[coreos695]: https://coreos.com/releases/#695.0.0 - -## Overview - -* Provision the master node -* Capture the master node private IP address -* Edit node.yaml -* Provision one or more worker nodes - -### AWS - -*Attention:* Replace `` below for a [suitable version of CoreOS image for AWS](https://coreos.com/docs/running-coreos/cloud-providers/ec2/). - -#### Provision the Master - -```sh -aws ec2 create-security-group --group-name kubernetes --description "Kubernetes Security Group" -aws ec2 authorize-security-group-ingress --group-name kubernetes --protocol tcp --port 22 --cidr 0.0.0.0/0 -aws ec2 authorize-security-group-ingress --group-name kubernetes --protocol tcp --port 80 --cidr 0.0.0.0/0 -aws ec2 authorize-security-group-ingress --group-name kubernetes --source-security-group-name kubernetes -``` - -```sh -aws ec2 run-instances \ ---image-id \ ---key-name \ ---region us-west-2 \ ---security-groups kubernetes \ ---instance-type m3.medium \ ---user-data file://master.yaml -``` - -#### Capture the private IP address - -```sh -aws ec2 describe-instances --instance-id -``` - -#### Edit node.yaml - -Edit `node.yaml` and replace all instances of `` with the private IP address of the master node. - -#### Provision worker nodes - -```sh -aws ec2 run-instances \ ---count 1 \ ---image-id \ ---key-name \ ---region us-west-2 \ ---security-groups kubernetes \ ---instance-type m3.medium \ ---user-data file://node.yaml -``` - -### Google Compute Engine (GCE) - -*Attention:* Replace `` below for a [suitable version of CoreOS image for Google Compute Engine](https://coreos.com/docs/running-coreos/cloud-providers/google-compute-engine/). - -#### Provision the Master - -```sh -gcloud compute instances create master \ ---image-project coreos-cloud \ ---image \ ---boot-disk-size 200GB \ ---machine-type n1-standard-1 \ ---zone us-central1-a \ ---metadata-from-file user-data=master.yaml -``` - -#### Capture the private IP address - -```sh -gcloud compute instances list -``` - -#### Edit node.yaml - -Edit `node.yaml` and replace all instances of `` with the private IP address of the master node. - -#### Provision worker nodes - -```sh -gcloud compute instances create node1 \ ---image-project coreos-cloud \ ---image \ ---boot-disk-size 200GB \ ---machine-type n1-standard-1 \ ---zone us-central1-a \ ---metadata-from-file user-data=node.yaml -``` - -#### Establish network connectivity - -Next, setup an ssh tunnel to the master so you can run kubectl from your local host. -In one terminal, run `gcloud compute ssh master --ssh-flag="-L 8080:127.0.0.1:8080"` and in a second -run `gcloud compute ssh master --ssh-flag="-R 8080:127.0.0.1:8080"`. - -### VMware Fusion - -#### Create the master config-drive - -```sh -mkdir -p /tmp/new-drive/openstack/latest/ -cp master.yaml /tmp/new-drive/openstack/latest/user_data -hdiutil makehybrid -iso -joliet -joliet-volume-name "config-2" -joliet -o master.iso /tmp/new-drive -``` - -#### Provision the Master - -Boot the [vmware image](https://coreos.com/docs/running-coreos/platforms/vmware) using `master.iso` as a config drive. - -#### Capture the master private IP address - -#### Edit node.yaml - -Edit `node.yaml` and replace all instances of `` with the private IP address of the master node. - -#### Create the node config-drive - -```sh -mkdir -p /tmp/new-drive/openstack/latest/ -cp node.yaml /tmp/new-drive/openstack/latest/user_data -hdiutil makehybrid -iso -joliet -joliet-volume-name "config-2" -joliet -o node.iso /tmp/new-drive -``` - -#### Provision worker nodes - -Boot one or more the [vmware image](https://coreos.com/docs/running-coreos/platforms/vmware) using `node.iso` as a config drive. - - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/getting-started-guides/coreos/coreos_multinode_cluster.md?pixel)]() - diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/docker-multinode.md b/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/docker-multinode.md deleted file mode 100644 index 60787ac7105e..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/docker-multinode.md +++ /dev/null @@ -1,118 +0,0 @@ - - - - -WARNING -WARNING -WARNING -WARNING -WARNING - -

    PLEASE NOTE: This document applies to the HEAD of the source tree

    - -If you are using a released version of Kubernetes, you should -refer to the docs that go with that version. - - -The latest 1.0.x release of this document can be found -[here](http://releases.k8s.io/release-1.0/docs/getting-started-guides/docker-multinode.md). - -Documentation for other releases can be found at -[releases.k8s.io](http://releases.k8s.io). - --- - - - - -Running Multi-Node Kubernetes Using Docker ------------------------------------------- - -_Note_: -These instructions are somewhat significantly more advanced than the [single node](docker.md) instructions. If you are -interested in just starting to explore Kubernetes, we recommend that you start there. - -_Note_: -There is a [bug](https://github.com/docker/docker/issues/14106) in Docker 1.7.0 that prevents this from working correctly. -Please install Docker 1.6.2 or Docker 1.7.1. - -**Table of Contents** - -- [Prerequisites](#prerequisites) -- [Overview](#overview) - - [Bootstrap Docker](#bootstrap-docker) -- [Master Node](#master-node) -- [Adding a worker node](#adding-a-worker-node) -- [Testing your cluster](#testing-your-cluster) - -## Prerequisites - -1. You need a machine with docker of right version installed. - -## Overview - -This guide will set up a 2-node Kubernetes cluster, consisting of a _master_ node which hosts the API server and orchestrates work -and a _worker_ node which receives work from the master. You can repeat the process of adding worker nodes an arbitrary number of -times to create larger clusters. - -Here's a diagram of what the final result will look like: -![Kubernetes Single Node on Docker](k8s-docker.png) - -### Bootstrap Docker - -This guide also uses a pattern of running two instances of the Docker daemon - 1) A _bootstrap_ Docker instance which is used to start system daemons like `flanneld` and `etcd` - 2) A _main_ Docker instance which is used for the Kubernetes infrastructure and user's scheduled containers - -This pattern is necessary because the `flannel` daemon is responsible for setting up and managing the network that interconnects -all of the Docker containers created by Kubernetes. To achieve this, it must run outside of the _main_ Docker daemon. However, -it is still useful to use containers for deployment and management, so we create a simpler _bootstrap_ daemon to achieve this. - -## Master Node - -The first step in the process is to initialize the master node. - -Clone the Kubernetes repo, and run [master.sh](docker-multinode/master.sh) on the master machine with root: - -```sh -export K8S_VERSION= -cd kubernetes/cluster/docker-multinode -./master.sh -``` - -`Master done!` - -See [here](docker-multinode/master.md) for detailed instructions explaination. - -## Adding a worker node - -Once your master is up and running you can add one or more workers on different machines. - -Clone the Kubernetes repo, and run [worker.sh](docker-multinode/worker.sh) on the worker machine with root: - -```sh -export K8S_VERSION= -export MASTER_IP= -cd kubernetes/cluster/docker-multinode -./worker.sh -``` - -`Worker done!` - -See [here](docker-multinode/worker.md) for detailed instructions explaination. - -## Testing your cluster - -Once your cluster has been created you can [test it out](docker-multinode/testing.md) - -For more complete applications, please look in the [examples directory](../../examples/) - - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/getting-started-guides/docker-multinode.md?pixel)]() - diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/docker-multinode/master.md b/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/docker-multinode/master.md deleted file mode 100644 index 02d1a30e1111..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/docker-multinode/master.md +++ /dev/null @@ -1,204 +0,0 @@ - - - - -WARNING -WARNING -WARNING -WARNING -WARNING - -

    PLEASE NOTE: This document applies to the HEAD of the source tree

    - -If you are using a released version of Kubernetes, you should -refer to the docs that go with that version. - - -The latest 1.0.x release of this document can be found -[here](http://releases.k8s.io/release-1.0/docs/getting-started-guides/docker-multinode/master.md). - -Documentation for other releases can be found at -[releases.k8s.io](http://releases.k8s.io). - --- - - - - - -## Installing a Kubernetes Master Node via Docker - -We'll begin by setting up the master node. For the purposes of illustration, we'll assume that the IP of this machine is `${MASTER_IP}` - -There are two main phases to installing the master: - * [Setting up `flanneld` and `etcd`](#setting-up-flanneld-and-etcd) - * [Starting the Kubernetes master components](#starting-the-kubernetes-master) - - -## Setting up flanneld and etcd - -_Note_: -There is a [bug](https://github.com/docker/docker/issues/14106) in Docker 1.7.0 that prevents this from working correctly. -Please install Docker 1.6.2 or Docker 1.7.1. - -### Setup Docker-Bootstrap - -We're going to use `flannel` to set up networking between Docker daemons. Flannel itself (and etcd on which it relies) will run inside of -Docker containers themselves. To achieve this, we need a separate "bootstrap" instance of the Docker daemon. This daemon will be started with -`--iptables=false` so that it can only run containers with `--net=host`. That's sufficient to bootstrap our system. - -Run: - -```sh -sudo sh -c 'docker -d -H unix:///var/run/docker-bootstrap.sock -p /var/run/docker-bootstrap.pid --iptables=false --ip-masq=false --bridge=none --graph=/var/lib/docker-bootstrap 2> /var/log/docker-bootstrap.log 1> /dev/null &' -``` - -_Important Note_: -If you are running this on a long running system, rather than experimenting, you should run the bootstrap Docker instance under something like SysV init, upstart or systemd so that it is restarted -across reboots and failures. - - -### Startup etcd for flannel and the API server to use - -Run: - -```sh -sudo docker -H unix:///var/run/docker-bootstrap.sock run --net=host -d gcr.io/google_containers/etcd:2.0.12 /usr/local/bin/etcd --addr=127.0.0.1:4001 --bind-addr=0.0.0.0:4001 --data-dir=/var/etcd/data -``` - -Next, you need to set a CIDR range for flannel. This CIDR should be chosen to be non-overlapping with any existing network you are using: - -```sh -sudo docker -H unix:///var/run/docker-bootstrap.sock run --net=host gcr.io/google_containers/etcd:2.0.12 etcdctl set /coreos.com/network/config '{ "Network": "10.1.0.0/16" }' -``` - - -### Set up Flannel on the master node - -Flannel is a network abstraction layer build by CoreOS, we will use it to provide simplified networking between our Pods of containers. - -Flannel re-configures the bridge that Docker uses for networking. As a result we need to stop Docker, reconfigure its networking, and then restart Docker. - -#### Bring down Docker - -To re-configure Docker to use flannel, we need to take docker down, run flannel and then restart Docker. - -Turning down Docker is system dependent, it may be: - -```sh -sudo /etc/init.d/docker stop -``` - -or - -```sh -sudo systemctl stop docker -``` - -or it may be something else. - -#### Run flannel - -Now run flanneld itself: - -```sh -sudo docker -H unix:///var/run/docker-bootstrap.sock run -d --net=host --privileged -v /dev/net:/dev/net quay.io/coreos/flannel:0.5.0 -``` - -The previous command should have printed a really long hash, copy this hash. - -Now get the subnet settings from flannel: - -```sh -sudo docker -H unix:///var/run/docker-bootstrap.sock exec cat /run/flannel/subnet.env -``` - -#### Edit the docker configuration - -You now need to edit the docker configuration to activate new flags. Again, this is system specific. - -This may be in `/etc/default/docker` or `/etc/systemd/service/docker.service` or it may be elsewhere. - -Regardless, you need to add the following to the docker command line: - -```sh ---bip=${FLANNEL_SUBNET} --mtu=${FLANNEL_MTU} -``` - -#### Remove the existing Docker bridge - -Docker creates a bridge named `docker0` by default. You need to remove this: - -```sh -sudo /sbin/ifconfig docker0 down -sudo brctl delbr docker0 -``` - -You may need to install the `bridge-utils` package for the `brctl` binary. - -#### Restart Docker - -Again this is system dependent, it may be: - -```sh -sudo /etc/init.d/docker start -``` - -it may be: - -```sh -systemctl start docker -``` - -## Starting the Kubernetes Master - -Ok, now that your networking is set up, you can startup Kubernetes, this is the same as the single-node case, we will use the "main" instance of the Docker daemon for the Kubernetes components. - -```sh -sudo docker run --net=host --privileged -d -v /sys:/sys:ro -v /var/run/docker.sock:/var/run/docker.sock gcr.io/google_containers/hyperkube:v1.0.1 /hyperkube kubelet --api-servers=http://localhost:8080 --v=2 --insecure-bind-address=0.0.0.0 --enable-server --hostname-override=127.0.0.1 --config=/etc/kubernetes/manifests-multi -``` - -### Also run the service proxy - -```sh -sudo docker run -d --net=host --privileged gcr.io/google_containers/hyperkube:v1.0.1 /hyperkube proxy --master=http://127.0.0.1:8080 --v=2 -``` - -### Test it out - -At this point, you should have a functioning 1-node cluster. Let's test it out! - -Download the kubectl binary -([OS X](http://storage.googleapis.com/kubernetes-release/release/v1.0.1/bin/darwin/amd64/kubectl)) -([linux](http://storage.googleapis.com/kubernetes-release/release/v1.0.1/bin/linux/amd64/kubectl)) - -List the nodes - -```sh -kubectl get nodes -``` - -This should print: - -```console -NAME LABELS STATUS -127.0.0.1 kubernetes.io/hostname=127.0.0.1 Ready -``` - -If the status of the node is `NotReady` or `Unknown` please check that all of the containers you created are successfully running. -If all else fails, ask questions on IRC at [#google-containers](http://webchat.freenode.net/?channels=google-containers). - - -### Next steps - -Move on to [adding one or more workers](worker.md) - - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/getting-started-guides/docker-multinode/master.md?pixel)]() - diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/docker-multinode/master.sh b/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/docker-multinode/master.sh deleted file mode 100755 index bef09d55896a..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/docker-multinode/master.sh +++ /dev/null @@ -1,151 +0,0 @@ -#!/bin/bash - -# 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. - -# A scripts to install k8s worker node. -# Author @wizard_cxy @reouser - -set -e - -# Make sure docker daemon is running -if ( ! ps -ef | grep "/usr/bin/docker" | grep -v 'grep' &> /dev/null ); then - echo "Docker is not running on this machine!" - exit 1 -fi - -# Make sure k8s version env is properly set -if [ -z ${K8S_VERSION} ]; then - echo "Please export K8S_VERSION in your env" - exit 1 -else - echo "k8s version is set to: ${K8S_VERSION}" -fi - - -# Run as root -if [ "$(id -u)" != "0" ]; then - echo >&2 "Please run as root" - exit 1 -fi - -# Check if a command is valid -command_exists() { - command -v "$@" > /dev/null 2>&1 -} - -lsb_dist="" - -# Detect the OS distro, we support ubuntu, debian, mint, centos, fedora dist -detect_lsb() { - case "$(uname -m)" in - *64) - ;; - *) - echo "Error: We currently only support 64-bit platforms." - exit 1 - ;; - esac - - if command_exists lsb_release; then - lsb_dist="$(lsb_release -si)" - fi - if [ -z ${lsb_dist} ] && [ -r /etc/lsb-release ]; then - lsb_dist="$(. /etc/lsb-release && echo "$DISTRIB_ID")" - fi - if [ -z ${lsb_dist} ] && [ -r /etc/debian_version ]; then - lsb_dist='debian' - fi - if [ -z ${lsb_dist} ] && [ -r /etc/fedora-release ]; then - lsb_dist='fedora' - fi - if [ -z ${lsb_dist} ] && [ -r /etc/os-release ]; then - lsb_dist="$(. /etc/os-release && echo "$ID")" - fi - - lsb_dist="$(echo ${lsb_dist} | tr '[:upper:]' '[:lower:]')" -} - - -# Start the bootstrap daemon -bootstrap_daemon() { - sudo -b docker -d -H unix:///var/run/docker-bootstrap.sock -p /var/run/docker-bootstrap.pid --iptables=false --ip-masq=false --bridge=none --graph=/var/lib/docker-bootstrap 2> /var/log/docker-bootstrap.log 1> /dev/null - - sleep 5 -} - -# Start k8s components in containers -DOCKER_CONF="" - -start_k8s(){ - # Start etcd - docker -H unix:///var/run/docker-bootstrap.sock run --restart=always --net=host -d gcr.io/google_containers/etcd:2.0.12 /usr/local/bin/etcd --addr=127.0.0.1:4001 --bind-addr=0.0.0.0:4001 --data-dir=/var/etcd/data - - sleep 5 - # Set flannel net config - docker -H unix:///var/run/docker-bootstrap.sock run --net=host gcr.io/google_containers/etcd:2.0.12 etcdctl set /coreos.com/network/config '{ "Network": "10.1.0.0/16" }' - - # iface may change to a private network interface, eth0 is for default - flannelCID=$(docker -H unix:///var/run/docker-bootstrap.sock run --restart=always -d --net=host --privileged -v /dev/net:/dev/net quay.io/coreos/flannel:0.5.0 /opt/bin/flanneld -iface="eth0") - - sleep 8 - - # Copy flannel env out and source it on the host - docker -H unix:///var/run/docker-bootstrap.sock cp ${flannelCID}:/run/flannel/subnet.env . - source subnet.env - - # Configure docker net settings, then restart it - case "$lsb_dist" in - fedora|centos|amzn) - DOCKER_CONF="/etc/sysconfig/docker" - ;; - ubuntu|debian|linuxmint) - DOCKER_CONF="/etc/default/docker" - ;; - esac - - # Append the docker opts - echo "DOCKER_OPTS=\"\$DOCKER_OPTS --mtu=${FLANNEL_MTU} --bip=${FLANNEL_SUBNET}\"" | sudo tee -a ${DOCKER_CONF} - - - # sleep a little bit - ifconfig docker0 down - - case "$lsb_dist" in - fedora|centos|amzn) - yum install bridge-utils && brctl delbr docker0 && systemctl restart docker - ;; - ubuntu|debian|linuxmint) - apt-get install bridge-utils && brctl delbr docker0 && service docker restart - ;; - esac - - # sleep a little bit - sleep 5 - - # Start kubelet & proxy, then start master components as pods - docker run --net=host --privileged -d -v /sys:/sys:ro -v /var/run/docker.sock:/var/run/docker.sock gcr.io/google_containers/hyperkube:v${K8S_VERSION} /hyperkube kubelet --api-servers=http://localhost:8080 --v=2 --insecure-bind-address=0.0.0.0 --enable-server --hostname-override=127.0.0.1 --config=/etc/kubernetes/manifests-multi - docker run -d --net=host --privileged gcr.io/google_containers/hyperkube:v${K8S_VERSION} /hyperkube proxy --master=http://127.0.0.1:8080 --v=2 -} - -echo "Detecting your OS distro ..." -detect_lsb - -echo "Starting bootstrap docker ..." -bootstrap_daemon - -echo "Starting k8s ..." -start_k8s - -echo "Master done!" diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/docker-multinode/testing.md b/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/docker-multinode/testing.md deleted file mode 100644 index 1f4af152fec0..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/docker-multinode/testing.md +++ /dev/null @@ -1,101 +0,0 @@ - - - - -WARNING -WARNING -WARNING -WARNING -WARNING - -

    PLEASE NOTE: This document applies to the HEAD of the source tree

    - -If you are using a released version of Kubernetes, you should -refer to the docs that go with that version. - - -The latest 1.0.x release of this document can be found -[here](http://releases.k8s.io/release-1.0/docs/getting-started-guides/docker-multinode/testing.md). - -Documentation for other releases can be found at -[releases.k8s.io](http://releases.k8s.io). - --- - - - - - -## Testing your Kubernetes cluster. - -To validate that your node(s) have been added, run: - -```sh -kubectl get nodes -``` - -That should show something like: - -```console -NAME LABELS STATUS -10.240.99.26 kubernetes.io/hostname=10.240.99.26 Ready -127.0.0.1 kubernetes.io/hostname=127.0.0.1 Ready -``` - -If the status of any node is `Unknown` or `NotReady` your cluster is broken, double check that all containers are running properly, and if all else fails, contact us on IRC at -[`#google-containers`](http://webchat.freenode.net/?channels=google-containers) for advice. - -### Run an application - -```sh -kubectl -s http://localhost:8080 run nginx --image=nginx --port=80 -``` - -now run `docker ps` you should see nginx running. You may need to wait a few minutes for the image to get pulled. - -### Expose it as a service - -```sh -kubectl expose rc nginx --port=80 -``` - -This should print: - -```console -NAME LABELS SELECTOR IP PORT(S) -nginx run=nginx 80/TCP -``` - -Hit the webserver: - -```sh -curl -``` - -Note that you will need run this curl command on your boot2docker VM if you are running on OS X. - -### Scaling - -Now try to scale up the nginx you created before: - -```sh -kubectl scale rc nginx --replicas=3 -``` - -And list the pods - -```sh -kubectl get pods -``` - -You should see pods landing on the newly added machine. - - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/getting-started-guides/docker-multinode/testing.md?pixel)]() - diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/docker-multinode/worker.md b/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/docker-multinode/worker.md deleted file mode 100644 index 20eb17f4d493..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/docker-multinode/worker.md +++ /dev/null @@ -1,167 +0,0 @@ - - - - -WARNING -WARNING -WARNING -WARNING -WARNING - -

    PLEASE NOTE: This document applies to the HEAD of the source tree

    - -If you are using a released version of Kubernetes, you should -refer to the docs that go with that version. - - -The latest 1.0.x release of this document can be found -[here](http://releases.k8s.io/release-1.0/docs/getting-started-guides/docker-multinode/worker.md). - -Documentation for other releases can be found at -[releases.k8s.io](http://releases.k8s.io). - --- - - - - - -## Adding a Kubernetes worker node via Docker. - - - -These instructions are very similar to the master set-up above, but they are duplicated for clarity. -You need to repeat these instructions for each node you want to join the cluster. -We will assume that the IP address of this node is `${NODE_IP}` and you have the IP address of the master in `${MASTER_IP}` that you created in the [master instructions](master.md). - -For each worker node, there are three steps: - * [Set up `flanneld` on the worker node](#set-up-flanneld-on-the-worker-node) - * [Start Kubernetes on the worker node](#start-kubernetes-on-the-worker-node) - * [Add the worker to the cluster](#add-the-node-to-the-cluster) - -### Set up Flanneld on the worker node - -As before, the Flannel daemon is going to provide network connectivity. - -_Note_: -There is a [bug](https://github.com/docker/docker/issues/14106) in Docker 1.7.0 that prevents this from working correctly. -Please install Docker 1.6.2 or wait for Docker 1.7.1. - - -#### Set up a bootstrap docker - -As previously, we need a second instance of the Docker daemon running to bootstrap the flannel networking. - -Run: - -```sh -sudo sh -c 'docker -d -H unix:///var/run/docker-bootstrap.sock -p /var/run/docker-bootstrap.pid --iptables=false --ip-masq=false --bridge=none --graph=/var/lib/docker-bootstrap 2> /var/log/docker-bootstrap.log 1> /dev/null &' -``` - -_Important Note_: -If you are running this on a long running system, rather than experimenting, you should run the bootstrap Docker instance under something like SysV init, upstart or systemd so that it is restarted -across reboots and failures. - -#### Bring down Docker - -To re-configure Docker to use flannel, we need to take docker down, run flannel and then restart Docker. - -Turning down Docker is system dependent, it may be: - -```sh -sudo /etc/init.d/docker stop -``` - -or - -```sh -sudo systemctl stop docker -``` - -or it may be something else. - -#### Run flannel - -Now run flanneld itself, this call is slightly different from the above, since we point it at the etcd instance on the master. - -```sh -sudo docker -H unix:///var/run/docker-bootstrap.sock run -d --net=host --privileged -v /dev/net:/dev/net quay.io/coreos/flannel:0.5.0 /opt/bin/flanneld --etcd-endpoints=http://${MASTER_IP}:4001 -``` - -The previous command should have printed a really long hash, copy this hash. - -Now get the subnet settings from flannel: - -```sh -sudo docker -H unix:///var/run/docker-bootstrap.sock exec cat /run/flannel/subnet.env -``` - - -#### Edit the docker configuration - -You now need to edit the docker configuration to activate new flags. Again, this is system specific. - -This may be in `/etc/default/docker` or `/etc/systemd/service/docker.service` or it may be elsewhere. - -Regardless, you need to add the following to the docker command line: - -```sh ---bip=${FLANNEL_SUBNET} --mtu=${FLANNEL_MTU} -``` - -#### Remove the existing Docker bridge - -Docker creates a bridge named `docker0` by default. You need to remove this: - -```sh -sudo /sbin/ifconfig docker0 down -sudo brctl delbr docker0 -``` - -You may need to install the `bridge-utils` package for the `brctl` binary. - -#### Restart Docker - -Again this is system dependent, it may be: - -```sh -sudo /etc/init.d/docker start -``` - -it may be: - -```sh -systemctl start docker -``` - -### Start Kubernetes on the worker node - -#### Run the kubelet - -Again this is similar to the above, but the `--api_servers` now points to the master we set up in the beginning. - -```sh -sudo docker run --net=host --privileged -d -v /sys:/sys:ro -v /var/run/docker.sock:/var/run/docker.sock gcr.io/google_containers/hyperkube:v1.0.1 /hyperkube kubelet --api-servers=http://${MASTER_IP}:8080 --v=2 --insecure-bind-address=0.0.0.0 --enable-server --hostname-override=$(hostname -i) -``` - -#### Run the service proxy - -The service proxy provides load-balancing between groups of containers defined by Kubernetes `Services` - -```sh -sudo docker run -d --net=host --privileged gcr.io/google_containers/hyperkube:v1.0.1 /hyperkube proxy --master=http://${MASTER_IP}:8080 --v=2 -``` - -### Next steps - -Move on to [testing your cluster](testing.md) or [add another node](#adding-a-kubernetes-worker-node-via-docker) - - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/getting-started-guides/docker-multinode/worker.md?pixel)]() - diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/docker-multinode/worker.sh b/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/docker-multinode/worker.sh deleted file mode 100755 index d667147f0b66..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/docker-multinode/worker.sh +++ /dev/null @@ -1,150 +0,0 @@ -#!/bin/bash - -# 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. - -# A scripts to install k8s worker node. -# Author @wizard_cxy @reouser - -set -e - -# Make sure docker daemon is running -if ( ! ps -ef | grep "/usr/bin/docker" | grep -v 'grep' &> /dev/null ); then - echo "Docker is not running on this machine!" - exit 1 -fi - -# Make sure k8s version env is properly set -if [ -z ${K8S_VERSION} ]; then - echo "Please export K8S_VERSION in your env" - exit 1 -else - echo "k8s version is set to: ${K8S_VERSION}" -fi - - -# Run as root -if [ "$(id -u)" != "0" ]; then - echo >&2 "Please run as root" - exit 1 -fi - -# Make sure master ip is properly set -if [ -z ${MASTER_IP} ]; then - echo "Please export MASTER_IP in your env" - exit 1 -else - echo "k8s master is set to: ${MASTER_IP}" -fi - -# Check if a command is valid -command_exists() { - command -v "$@" > /dev/null 2>&1 -} - -lsb_dist="" - -# Detect the OS distro, we support ubuntu, debian, mint, centos, fedora dist -detect_lsb() { - case "$(uname -m)" in - *64) - ;; - *) - echo "Error: We currently only support 64-bit platforms." - exit 1 - ;; - esac - - if command_exists lsb_release; then - lsb_dist="$(lsb_release -si)" - fi - if [ -z ${lsb_dist} ] && [ -r /etc/lsb-release ]; then - lsb_dist="$(. /etc/lsb-release && echo "$DISTRIB_ID")" - fi - if [ -z ${lsb_dist} ] && [ -r /etc/debian_version ]; then - lsb_dist='debian' - fi - if [ -z ${lsb_dist} ] && [ -r /etc/fedora-release ]; then - lsb_dist='fedora' - fi - if [ -z ${lsb_dist} ] && [ -r /etc/os-release ]; then - lsb_dist="$(. /etc/os-release && echo "$ID")" - fi - - lsb_dist="$(echo ${lsb_dist} | tr '[:upper:]' '[:lower:]')" -} - - -# Start the bootstrap daemon -bootstrap_daemon() { - sudo -b docker -d -H unix:///var/run/docker-bootstrap.sock -p /var/run/docker-bootstrap.pid --iptables=false --ip-masq=false --bridge=none --graph=/var/lib/docker-bootstrap 2> /var/log/docker-bootstrap.log 1> /dev/null - - sleep 5 -} - -DOCKER_CONF="" - -# Start k8s components in containers -start_k8s() { - # Start flannel - flannelCID=$(sudo docker -H unix:///var/run/docker-bootstrap.sock run -d --restart=always --net=host --privileged -v /dev/net:/dev/net quay.io/coreos/flannel:0.5.0 /opt/bin/flanneld --etcd-endpoints=http://${MASTER_IP}:4001 -iface="eth0") - - sleep 8 - - # Copy flannel env out and source it on the host - sudo docker -H unix:///var/run/docker-bootstrap.sock cp ${flannelCID}:/run/flannel/subnet.env . - source subnet.env - - # Configure docker net settings, then restart it - case "$lsb_dist" in - fedora|centos|amzn) - DOCKER_CONF="/etc/sysconfig/docker" - ;; - ubuntu|debian|linuxmint) - DOCKER_CONF="/etc/default/docker" - ;; - esac - - echo "DOCKER_OPTS=\"\$DOCKER_OPTS --mtu=${FLANNEL_MTU} --bip=${FLANNEL_SUBNET}\"" | sudo tee -a ${DOCKER_CONF} - - ifconfig docker0 down - - case "$lsb_dist" in - fedora|centos) - yum install bridge-utils && brctl delbr docker0 && systemctl restart docker - ;; - ubuntu|debian|linuxmint) - apt-get install bridge-utils && brctl delbr docker0 && service docker restart - ;; - esac - - # sleep a little bit - sleep 5 - - # Start kubelet & proxy in container - sudo docker run --net=host --privileged -d -v /sys:/sys:ro -v /var/run/docker.sock:/var/run/docker.sock gcr.io/google_containers/hyperkube:v${K8S_VERSION} /hyperkube kubelet --api-servers=http://${MASTER_IP}:8080 --v=2 --insecure-bind-address=0.0.0.0 --enable-server --hostname-override=$(hostname -i) - sudo docker run -d --net=host --privileged gcr.io/google_containers/hyperkube:v${K8S_VERSION} /hyperkube proxy --master=http://${MASTER_IP}:8080 --v=2 - -} - -echo "Detecting your OS distro ..." -detect_lsb - -echo "Starting bootstrap docker ..." -bootstrap_daemon - -echo "Starting k8s ..." -start_k8s - -echo "Worker done!" diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/docker.md b/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/docker.md deleted file mode 100644 index 15828612c03b..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/docker.md +++ /dev/null @@ -1,155 +0,0 @@ - - - - -WARNING -WARNING -WARNING -WARNING -WARNING - -

    PLEASE NOTE: This document applies to the HEAD of the source tree

    - -If you are using a released version of Kubernetes, you should -refer to the docs that go with that version. - - -The latest 1.0.x release of this document can be found -[here](http://releases.k8s.io/release-1.0/docs/getting-started-guides/docker.md). - -Documentation for other releases can be found at -[releases.k8s.io](http://releases.k8s.io). - --- - - - - -Running Kubernetes locally via Docker -------------------------------------- - -**Table of Contents** - -- [Overview](#setting-up-a-cluster) -- [Prerequisites](#prerequisites) -- [Step One: Run etcd](#step-one-run-etcd) -- [Step Two: Run the master](#step-two-run-the-master) -- [Step Three: Run the service proxy](#step-three-run-the-service-proxy) -- [Test it out](#test-it-out) -- [Run an application](#run-an-application) -- [Expose it as a service:](#expose-it-as-a-service) -- [A note on turning down your cluster](#a-note-on-turning-down-your-cluster) - -### Overview - -The following instructions show you how to set up a simple, single node Kubernetes cluster using Docker. - -Here's a diagram of what the final result will look like: -![Kubernetes Single Node on Docker](k8s-singlenode-docker.png) - -### Prerequisites - -1. You need to have docker installed on one machine. - -### Step One: Run etcd - -```sh -docker run --net=host -d gcr.io/google_containers/etcd:2.0.12 /usr/local/bin/etcd --addr=127.0.0.1:4001 --bind-addr=0.0.0.0:4001 --data-dir=/var/etcd/data -``` - -### Step Two: Run the master - -```sh -docker run --net=host --privileged -d -v /sys:/sys:ro -v /var/run/docker.sock:/var/run/docker.sock gcr.io/google_containers/hyperkube:v1.0.1 /hyperkube kubelet --api-servers=http://localhost:8080 --v=2 --insecure-bind-address=0.0.0.0 --enable-server --hostname-override=127.0.0.1 --config=/etc/kubernetes/manifests -``` - -This actually runs the kubelet, which in turn runs a [pod](../user-guide/pods.md) that contains the other master components. - -### Step Three: Run the service proxy - -*Note, this could be combined with master above, but it requires --privileged for iptables manipulation* - -```sh -docker run -d --net=host --privileged gcr.io/google_containers/hyperkube:v1.0.1 /hyperkube proxy --master=http://127.0.0.1:8080 --v=2 -``` - -### Test it out - -At this point you should have a running Kubernetes cluster. You can test this by downloading the kubectl -binary -([OS X](https://storage.googleapis.com/kubernetes-release/release/v1.0.1/bin/darwin/amd64/kubectl)) -([linux](https://storage.googleapis.com/kubernetes-release/release/v1.0.1/bin/linux/amd64/kubectl)) - -*Note:* -On OS/X you will need to set up port forwarding via ssh: - -```sh -boot2docker ssh -L8080:localhost:8080 -``` - -List the nodes in your cluster by running:: - -```sh -kubectl get nodes -``` - -This should print: - -```console -NAME LABELS STATUS -127.0.0.1 Ready -``` - -If you are running different Kubernetes clusters, you may need to specify `-s http://localhost:8080` to select the local cluster. - -### Run an application - -```sh -kubectl -s http://localhost:8080 run nginx --image=nginx --port=80 -``` - -now run `docker ps` you should see nginx running. You may need to wait a few minutes for the image to get pulled. - -### Expose it as a service - -```sh -kubectl expose rc nginx --port=80 -``` - -This should print: - -```console -NAME LABELS SELECTOR IP PORT(S) -nginx run=nginx run=nginx 80/TCP -``` - -If ip-addr is blank run the following command to obtain it. Know issue #10836 - -```sh -kubectl get svc nginx -``` - -Hit the webserver: - -```sh -curl -``` - -Note that you will need run this curl command on your boot2docker VM if you are running on OS X. - -### A note on turning down your cluster - -Many of these containers run under the management of the `kubelet` binary, which attempts to keep containers running, even if they fail. So, in order to turn down -the cluster, you need to first kill the kubelet container, and then any other containers. - -You may use `docker ps -a | awk '{print $1}' | xargs docker kill`, note this removes _all_ containers running under Docker, so use with caution. - - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/getting-started-guides/docker.md?pixel)]() - diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/es-browser.png b/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/es-browser.png deleted file mode 100644 index f556fa8c5619..000000000000 Binary files a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/es-browser.png and /dev/null differ diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/fedora/fedora_ansible_config.md b/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/fedora/fedora_ansible_config.md deleted file mode 100644 index adc9b39a6828..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/fedora/fedora_ansible_config.md +++ /dev/null @@ -1,267 +0,0 @@ - - - - -WARNING -WARNING -WARNING -WARNING -WARNING - -

    PLEASE NOTE: This document applies to the HEAD of the source tree

    - -If you are using a released version of Kubernetes, you should -refer to the docs that go with that version. - - -The latest 1.0.x release of this document can be found -[here](http://releases.k8s.io/release-1.0/docs/getting-started-guides/fedora/fedora_ansible_config.md). - -Documentation for other releases can be found at -[releases.k8s.io](http://releases.k8s.io). - --- - - - - -Configuring Kubernetes on [Fedora](http://fedoraproject.org) via [Ansible](http://www.ansible.com/home) -------------------------------------------------------------------------------------------------------- - -Configuring Kubernetes on Fedora via Ansible offers a simple way to quickly create a clustered environment with little effort. - -**Table of Contents** - -- [Prerequisites](#prerequisites) -- [Architecture of the cluster](#architecture-of-the-cluster) -- [Setting up ansible access to your nodes](#setting-up-ansible-access-to-your-nodes) -- [Setting up the cluster](#setting-up-the-cluster) -- [Testing and using your new cluster](#testing-and-using-your-new-cluster) - -## Prerequisites - -1. Host able to run ansible and able to clone the following repo: [kubernetes](https://k8s.io/kubernetes.git) -2. A Fedora 21+ host to act as cluster master -3. As many Fedora 21+ hosts as you would like, that act as cluster nodes - -The hosts can be virtual or bare metal. Ansible will take care of the rest of the configuration for you - configuring networking, installing packages, handling the firewall, etc. This example will use one master and two nodes. - -## Architecture of the cluster - -A Kubernetes cluster requires etcd, a master, and n nodes, so we will create a cluster with three hosts, for example: - -```console - master,etcd = kube-master.example.com - node1 = kube-node-01.example.com - node2 = kube-node-02.example.com -``` - -**Make sure your local machine has** - - - ansible (must be 1.9.0+) - - git - - python-netaddr - -If not - -```sh -yum install -y ansible git python-netaddr -``` - -**Now clone down the Kubernetes repository** - -```sh -git clone https://k8s.io/kubernetes.git -cd kubernetes/contrib/ansible -``` - -**Tell ansible about each machine and its role in your cluster** - -Get the IP addresses from the master and nodes. Add those to the `~/kubernetes/contrib/ansible/inventory` file on the host running Ansible. - -```console -[masters] -kube-master.example.com - -[etcd] -kube-master.example.com - -[nodes] -kube-node-01.example.com -kube-node-02.example.com -``` - -## Setting up ansible access to your nodes - -If you already are running on a machine which has passwordless ssh access to the kube-master and kube-node-{01,02} nodes, and 'sudo' privileges, simply set the value of `ansible_ssh_user` in `~/kubernetes/contrib/ansible/group_vars/all.yaml` to the username which you use to ssh to the nodes (i.e. `fedora`), and proceed to the next step... - -*Otherwise* setup ssh on the machines like so (you will need to know the root password to all machines in the cluster). - -edit: ~/kubernetes/contrib/ansible/group_vars/all.yml - -```yaml -ansible_ssh_user: root -``` - -**Configuring ssh access to the cluster** - -If you already have ssh access to every machine using ssh public keys you may skip to [setting up the cluster](#setting-up-the-cluster) - -Make sure your local machine (root) has an ssh key pair if not - -```sh -ssh-keygen -``` - -Copy the ssh public key to **all** nodes in the cluster - -```sh -for node in kube-master.example.com kube-node-01.example.com kube-node-02.example.com; do - ssh-copy-id ${node} -done -``` - -## Setting up the cluster - -Although the default value of variables in `~/kubernetes/contrib/ansible/group_vars/all.yml` should be good enough, if not, change them as needed. - -edit: ~/kubernetes/contrib/ansible/group_vars/all.yml - -**Configure access to kubernetes packages** - -Modify `source_type` as below to access kubernetes packages through the package manager. - -```yaml -source_type: packageManager -``` - -**Configure the IP addresses used for services** - -Each Kubernetes service gets its own IP address. These are not real IPs. You need only select a range of IPs which are not in use elsewhere in your environment. - -```yaml -kube_service_addresses: 10.254.0.0/16 -``` - -**Managing flannel** - -Modify `flannel_subnet`, `flannel_prefix` and `flannel_host_prefix` only if defaults are not appropriate for your cluster. - - -**Managing add on services in your cluster** - -Set `cluster_logging` to false or true (default) to disable or enable logging with elasticsearch. - -```yaml -cluster_logging: true -``` - -Turn `cluster_monitoring` to true (default) or false to enable or disable cluster monitoring with heapster and influxdb. - -```yaml -cluster_monitoring: true -``` - -Turn `dns_setup` to true (recommended) or false to enable or disable whole DNS configuration. - -```yaml -dns_setup: true -``` - -**Tell ansible to get to work!** - -This will finally setup your whole Kubernetes cluster for you. - -```sh -cd ~/kubernetes/contrib/ansible/ - -./setup.sh -``` - -## Testing and using your new cluster - -That's all there is to it. It's really that easy. At this point you should have a functioning Kubernetes cluster. - -**Show kubernets nodes** - -Run the following on the kube-master: - -```sh -kubectl get nodes -``` - -**Show services running on masters and nodes** - -```sh -systemctl | grep -i kube -``` - -**Show firewall rules on the masters and nodes** - -```sh -iptables -nvL -``` - -**Create /tmp/apache.json on the master with the following contents and deploy pod** - -```json -{ - "kind": "Pod", - "apiVersion": "v1", - "metadata": { - "name": "fedoraapache", - "labels": { - "name": "fedoraapache" - } - }, - "spec": { - "containers": [ - { - "name": "fedoraapache", - "image": "fedora/apache", - "ports": [ - { - "hostPort": 80, - "containerPort": 80 - } - ] - } - ] - } -} -``` - -```sh -kubectl create -f /tmp/apache.json -``` - -**Check where the pod was created** - -```sh -kubectl get pods -``` - -**Check Docker status on nodes** - -```sh -docker ps -docker images -``` - -**After the pod is 'Running' Check web server access on the node** - -```sh -curl http://localhost -``` - -That's it ! - - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/getting-started-guides/fedora/fedora_ansible_config.md?pixel)]() - diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/fedora/fedora_manual_config.md b/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/fedora/fedora_manual_config.md deleted file mode 100644 index 3b1e521566bf..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/fedora/fedora_manual_config.md +++ /dev/null @@ -1,242 +0,0 @@ - - - - -WARNING -WARNING -WARNING -WARNING -WARNING - -

    PLEASE NOTE: This document applies to the HEAD of the source tree

    - -If you are using a released version of Kubernetes, you should -refer to the docs that go with that version. - - -The latest 1.0.x release of this document can be found -[here](http://releases.k8s.io/release-1.0/docs/getting-started-guides/fedora/fedora_manual_config.md). - -Documentation for other releases can be found at -[releases.k8s.io](http://releases.k8s.io). - --- - - - - -Getting started on [Fedora](http://fedoraproject.org) ------------------------------------------------------ - -**Table of Contents** - -- [Prerequisites](#prerequisites) -- [Instructions](#instructions) - -## Prerequisites - -1. You need 2 or more machines with Fedora installed. - -## Instructions - -This is a getting started guide for Fedora. It is a manual configuration so you understand all the underlying packages / services / ports, etc... - -This guide will only get ONE node (previously minion) working. Multiple nodes require a functional [networking configuration](../../admin/networking.md) done outside of Kubernetes. Although the additional Kubernetes configuration requirements should be obvious. - -The Kubernetes package provides a few services: kube-apiserver, kube-scheduler, kube-controller-manager, kubelet, kube-proxy. These services are managed by systemd and the configuration resides in a central location: /etc/kubernetes. We will break the services up between the hosts. The first host, fed-master, will be the Kubernetes master. This host will run the kube-apiserver, kube-controller-manager, and kube-scheduler. In addition, the master will also run _etcd_ (not needed if _etcd_ runs on a different host but this guide assumes that _etcd_ and Kubernetes master run on the same host). The remaining host, fed-node will be the node and run kubelet, proxy and docker. - -**System Information:** - -Hosts: - -``` -fed-master = 192.168.121.9 -fed-node = 192.168.121.65 -``` - -**Prepare the hosts:** - -* Install Kubernetes on all hosts - fed-{master,node}. This will also pull in docker. Also install etcd on fed-master. This guide has been tested with kubernetes-0.18 and beyond. -* The [--enablerepo=update-testing](https://fedoraproject.org/wiki/QA:Updates_Testing) directive in the yum command below will ensure that the most recent Kubernetes version that is scheduled for pre-release will be installed. This should be a more recent version than the Fedora "stable" release for Kubernetes that you would get without adding the directive. -* If you want the very latest Kubernetes release [you can download and yum install the RPM directly from Fedora Koji](http://koji.fedoraproject.org/koji/packageinfo?packageID=19202) instead of using the yum install command below. - -```sh -yum -y install --enablerepo=updates-testing kubernetes -``` - -* Install etcd and iptables - -```sh -yum -y install etcd iptables -``` - -* Add master and node to /etc/hosts on all machines (not needed if hostnames already in DNS). Make sure that communication works between fed-master and fed-node by using a utility such as ping. - -```sh -echo "192.168.121.9 fed-master -192.168.121.65 fed-node" >> /etc/hosts -``` - -* Edit /etc/kubernetes/config which will be the same on all hosts (master and node) to contain: - -```sh -# Comma separated list of nodes in the etcd cluster -KUBE_MASTER="--master=http://fed-master:8080" - -# logging to stderr means we get it in the systemd journal -KUBE_LOGTOSTDERR="--logtostderr=true" - -# journal message level, 0 is debug -KUBE_LOG_LEVEL="--v=0" - -# Should this cluster be allowed to run privileged docker containers -KUBE_ALLOW_PRIV="--allow_privileged=false" -``` - -* Disable the firewall on both the master and node, as docker does not play well with other firewall rule managers. Please note that iptables-services does not exist on default fedora server install. - -```sh -systemctl disable iptables-services firewalld -systemctl stop iptables-services firewalld -``` - -**Configure the Kubernetes services on the master.** - -* Edit /etc/kubernetes/apiserver to appear as such. The service_cluster_ip_range IP addresses must be an unused block of addresses, not used anywhere else. They do not need to be routed or assigned to anything. - -```sh -# The address on the local server to listen to. -KUBE_API_ADDRESS="--address=0.0.0.0" - -# Comma separated list of nodes in the etcd cluster -KUBE_ETCD_SERVERS="--etcd_servers=http://127.0.0.1:4001" - -# Address range to use for services -KUBE_SERVICE_ADDRESSES="--service-cluster-ip-range=10.254.0.0/16" - -# Add your own! -KUBE_API_ARGS="" -``` - -* Edit /etc/etcd/etcd.conf,let the etcd to listen all the ip instead of 127.0.0.1, if not, you will get the error like "connection refused" - -```sh -ETCD_LISTEN_CLIENT_URLS="http://0.0.0.0:4001" -``` - -* Create /var/run/kubernetes on master: - -```sh -mkdir /var/run/kubernetes -chown kube:kube /var/run/kubernetes -chmod 750 /var/run/kubernetes -``` - -* Start the appropriate services on master: - -```sh -for SERVICES in etcd kube-apiserver kube-controller-manager kube-scheduler; do - systemctl restart $SERVICES - systemctl enable $SERVICES - systemctl status $SERVICES -done -``` - -* Addition of nodes: - -* Create following node.json file on Kubernetes master node: - -```json -{ - "apiVersion": "v1", - "kind": "Node", - "metadata": { - "name": "fed-node", - "labels":{ "name": "fed-node-label"} - }, - "spec": { - "externalID": "fed-node" - } -} -``` - -Now create a node object internally in your Kubernetes cluster by running: - -```console -$ kubectl create -f ./node.json - -$ kubectl get nodes -NAME LABELS STATUS -fed-node name=fed-node-label Unknown -``` - -Please note that in the above, it only creates a representation for the node -_fed-node_ internally. It does not provision the actual _fed-node_. Also, it -is assumed that _fed-node_ (as specified in `name`) can be resolved and is -reachable from Kubernetes master node. This guide will discuss how to provision -a Kubernetes node (fed-node) below. - -**Configure the Kubernetes services on the node.** - -***We need to configure the kubelet on the node.*** - -* Edit /etc/kubernetes/kubelet to appear as such: - -```sh -### -# Kubernetes kubelet (node) config - -# The address for the info server to serve on (set to 0.0.0.0 or "" for all interfaces) -KUBELET_ADDRESS="--address=0.0.0.0" - -# You may leave this blank to use the actual hostname -KUBELET_HOSTNAME="--hostname_override=fed-node" - -# location of the api-server -KUBELET_API_SERVER="--api_servers=http://fed-master:8080" - -# Add your own! -#KUBELET_ARGS="" -``` - -* Start the appropriate services on the node (fed-node). - -```sh -for SERVICES in kube-proxy kubelet docker; do - systemctl restart $SERVICES - systemctl enable $SERVICES - systemctl status $SERVICES -done -``` - -* Check to make sure now the cluster can see the fed-node on fed-master, and its status changes to _Ready_. - -```console -kubectl get nodes -NAME LABELS STATUS -fed-node name=fed-node-label Ready -``` - -* Deletion of nodes: - -To delete _fed-node_ from your Kubernetes cluster, one should run the following on fed-master (Please do not do it, it is just for information): - -```sh -kubectl delete -f ./node.json -``` - -*You should be finished!* - -**The cluster should be running! Launch a test pod.** - -You should have a functional cluster, check out [101](../../../docs/user-guide/walkthrough/README.md)! - - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/getting-started-guides/fedora/fedora_manual_config.md?pixel)]() - diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/fedora/flannel_multi_node_cluster.md b/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/fedora/flannel_multi_node_cluster.md deleted file mode 100644 index c23e56ff699f..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/fedora/flannel_multi_node_cluster.md +++ /dev/null @@ -1,219 +0,0 @@ - - - - -WARNING -WARNING -WARNING -WARNING -WARNING - -

    PLEASE NOTE: This document applies to the HEAD of the source tree

    - -If you are using a released version of Kubernetes, you should -refer to the docs that go with that version. - - -The latest 1.0.x release of this document can be found -[here](http://releases.k8s.io/release-1.0/docs/getting-started-guides/fedora/flannel_multi_node_cluster.md). - -Documentation for other releases can be found at -[releases.k8s.io](http://releases.k8s.io). - --- - - - - -Kubernetes multiple nodes cluster with flannel on Fedora --------------------------------------------------------- - -**Table of Contents** - -- [Introduction](#introduction) -- [Prerequisites](#prerequisites) -- [Master Setup](#master-setup) -- [Node Setup](#node-setup) -- [**Test the cluster and flannel configuration**](#test-the-cluster-and-flannel-configuration) - -## Introduction - -This document describes how to deploy Kubernetes on multiple hosts to set up a multi-node cluster and networking with flannel. Follow fedora [getting started guide](fedora_manual_config.md) to setup 1 master (fed-master) and 2 or more nodes. Make sure that all nodes have different names (fed-node1, fed-node2 and so on) and labels (fed-node1-label, fed-node2-label, and so on) to avoid any conflict. Also make sure that the Kubernetes master host is running etcd, kube-controller-manager, kube-scheduler, and kube-apiserver services, and the nodes are running docker, kube-proxy and kubelet services. Now install flannel on Kubernetes nodes. flannel on each node configures an overlay network that docker uses. flannel runs on each node to setup a unique class-C container network. - -## Prerequisites - -1. You need 2 or more machines with Fedora installed. - -## Master Setup - -**Perform following commands on the Kubernetes master** - -* Configure flannel by creating a `flannel-config.json` in your current directory on fed-master. flannel provides udp and vxlan among other overlay networking backend options. In this guide, we choose kernel based vxlan backend. The contents of the json are: - -```json -{ - "Network": "18.16.0.0/16", - "SubnetLen": 24, - "Backend": { - "Type": "vxlan", - "VNI": 1 - } -} -``` - -**NOTE:** Choose an IP range that is *NOT* part of the public IP address range. - -* Add the configuration to the etcd server on fed-master. - -```sh -etcdctl set /coreos.com/network/config < flannel-config.json -``` - -* Verify the key exists in the etcd server on fed-master. - -```sh -etcdctl get /coreos.com/network/config -``` - -## Node Setup - -**Perform following commands on all Kubernetes nodes** - -* Edit the flannel configuration file /etc/sysconfig/flanneld as follows: - -```sh -# Flanneld configuration options - -# etcd url location. Point this to the server where etcd runs -FLANNEL_ETCD="http://fed-master:4001" - -# etcd config key. This is the configuration key that flannel queries -# For address range assignment -FLANNEL_ETCD_KEY="/coreos.com/network" - -# Any additional options that you want to pass -FLANNEL_OPTIONS="" -``` - -**Note:** By default, flannel uses the interface for the default route. If you have multiple interfaces and would like to use an interface other than the default route one, you could add "-iface=" to FLANNEL_OPTIONS. For additional options, run `flanneld --help` on command line. - -* Enable the flannel service. - -```sh -systemctl enable flanneld -``` - -* If docker is not running, then starting flannel service is enough and skip the next step. - -```sh -systemctl start flanneld -``` - -* If docker is already running, then stop docker, delete docker bridge (docker0), start flanneld and restart docker as follows. Another alternative is to just reboot the system (`systemctl reboot`). - -```sh -systemctl stop docker -ip link delete docker0 -systemctl start flanneld -systemctl start docker -``` - -*** - -## **Test the cluster and flannel configuration** - -* Now check the interfaces on the nodes. Notice there is now a flannel.1 interface, and the ip addresses of docker0 and flannel.1 interfaces are in the same network. You will notice that docker0 is assigned a subnet (18.16.29.0/24 as shown below) on each Kubernetes node out of the IP range configured above. A working output should look like this: - -```console -# ip -4 a|grep inet - inet 127.0.0.1/8 scope host lo - inet 192.168.122.77/24 brd 192.168.122.255 scope global dynamic eth0 - inet 18.16.29.0/16 scope global flannel.1 - inet 18.16.29.1/24 scope global docker0 -``` - -* From any node in the cluster, check the cluster members by issuing a query to etcd server via curl (only partial output is shown using `grep -E "\{|\}|key|value"`). If you set up a 1 master and 3 nodes cluster, you should see one block for each node showing the subnets they have been assigned. You can associate those subnets to each node by the MAC address (VtepMAC) and IP address (Public IP) that is listed in the output. - -```sh -curl -s http://fed-master:4001/v2/keys/coreos.com/network/subnets | python -mjson.tool -``` - -```json -{ - "node": { - "key": "/coreos.com/network/subnets", - { - "key": "/coreos.com/network/subnets/18.16.29.0-24", - "value": "{\"PublicIP\":\"192.168.122.77\",\"BackendType\":\"vxlan\",\"BackendData\":{\"VtepMAC\":\"46:f1:d0:18:d0:65\"}}" - }, - { - "key": "/coreos.com/network/subnets/18.16.83.0-24", - "value": "{\"PublicIP\":\"192.168.122.36\",\"BackendType\":\"vxlan\",\"BackendData\":{\"VtepMAC\":\"ca:38:78:fc:72:29\"}}" - }, - { - "key": "/coreos.com/network/subnets/18.16.90.0-24", - "value": "{\"PublicIP\":\"192.168.122.127\",\"BackendType\":\"vxlan\",\"BackendData\":{\"VtepMAC\":\"92:e2:80:ba:2d:4d\"}}" - } - } -} -``` - -* From all nodes, review the `/run/flannel/subnet.env` file. This file was generated automatically by flannel. - -```console -# cat /run/flannel/subnet.env -FLANNEL_SUBNET=18.16.29.1/24 -FLANNEL_MTU=1450 -FLANNEL_IPMASQ=false -``` - -* At this point, we have etcd running on the Kubernetes master, and flannel / docker running on Kubernetes nodes. Next steps are for testing cross-host container communication which will confirm that docker and flannel are configured properly. - -* Issue the following commands on any 2 nodes: - -```console -# docker run -it fedora:latest bash -bash-4.3# -``` - -* This will place you inside the container. Install iproute and iputils packages to install ip and ping utilities. Due to a [bug](https://bugzilla.redhat.com/show_bug.cgi?id=1142311), it is required to modify capabilities of ping binary to work around "Operation not permitted" error. - -```console -bash-4.3# yum -y install iproute iputils -bash-4.3# setcap cap_net_raw-ep /usr/bin/ping -``` - -* Now note the IP address on the first node: - -```console -bash-4.3# ip -4 a l eth0 | grep inet - inet 18.16.29.4/24 scope global eth0 -``` - -* And also note the IP address on the other node: - -```console -bash-4.3# ip a l eth0 | grep inet - inet 18.16.90.4/24 scope global eth0 -``` - -* Now ping from the first node to the other node: - -```console -bash-4.3# ping 18.16.90.4 -PING 18.16.90.4 (18.16.90.4) 56(84) bytes of data. -64 bytes from 18.16.90.4: icmp_seq=1 ttl=62 time=0.275 ms -64 bytes from 18.16.90.4: icmp_seq=2 ttl=62 time=0.372 ms -``` - -* Now Kubernetes multi-node cluster is set up with overlay networking set up by flannel. - - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/getting-started-guides/fedora/flannel_multi_node_cluster.md?pixel)]() - diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/gce.md b/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/gce.md deleted file mode 100644 index 8517d3c540d6..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/gce.md +++ /dev/null @@ -1,253 +0,0 @@ - - - - -WARNING -WARNING -WARNING -WARNING -WARNING - -

    PLEASE NOTE: This document applies to the HEAD of the source tree

    - -If you are using a released version of Kubernetes, you should -refer to the docs that go with that version. - - -The latest 1.0.x release of this document can be found -[here](http://releases.k8s.io/release-1.0/docs/getting-started-guides/gce.md). - -Documentation for other releases can be found at -[releases.k8s.io](http://releases.k8s.io). - --- - - - - -Getting started on Google Compute Engine ----------------------------------------- - -**Table of Contents** - -- [Before you start](#before-you-start) -- [Prerequisites](#prerequisites) -- [Starting a cluster](#starting-a-cluster) -- [Installing the Kubernetes command line tools on your workstation](#installing-the-kubernetes-command-line-tools-on-your-workstation) -- [Getting started with your cluster](#getting-started-with-your-cluster) - - [Inspect your cluster](#inspect-your-cluster) - - [Run some examples](#run-some-examples) -- [Tearing down the cluster](#tearing-down-the-cluster) -- [Customizing](#customizing) -- [Troubleshooting](#troubleshooting) - - [Project settings](#project-settings) - - [Cluster initialization hang](#cluster-initialization-hang) - - [SSH](#ssh) - - [Networking](#networking) - - -The example below creates a Kubernetes cluster with 4 worker node Virtual Machines and a master Virtual Machine (i.e. 5 VMs in your cluster). This cluster is set up and controlled from your workstation (or wherever you find convenient). - -### Before you start - -If you want a simplified getting started experience and GUI for managing clusters, please consider trying [Google Container Engine](https://cloud.google.com/container-engine/) (GKE) for hosted cluster installation and management. - -If you want to use custom binaries or pure open source Kubernetes, please continue with the instructions below. - -### Prerequisites - -1. You need a Google Cloud Platform account with billing enabled. Visit the [Google Developers Console](http://cloud.google.com/console) for more details. -1. Install `gcloud` as necessary. `gcloud` can be installed as a part of the [Google Cloud SDK](https://cloud.google.com/sdk/). -1. Then, make sure you have the `gcloud preview` command line component installed. Run `gcloud preview` at the command line - if it asks to install any components, go ahead and install them. If it simply shows help text, you're good to go. This is required as the cluster setup script uses GCE [Instance Groups](https://cloud.google.com/compute/docs/instance-groups/), which are in the gcloud preview namespace. You will also need to **enable [`Compute Engine Instance Group Manager API`](https://developers.google.com/console/help/new/#activatingapis)** in the developers console. -1. Make sure that gcloud is set to use the Google Cloud Platform project you want. You can check the current project using `gcloud config list project` and change it via `gcloud config set project `. -1. Make sure you have credentials for GCloud by running ` gcloud auth login`. -1. Make sure you can start up a GCE VM from the command line. At least make sure you can do the [Create an instance](https://cloud.google.com/compute/docs/instances/#startinstancegcloud) part of the GCE Quickstart. -1. Make sure you can ssh into the VM without interactive prompts. See the [Log in to the instance](https://cloud.google.com/compute/docs/instances/#sshing) part of the GCE Quickstart. - -### Starting a cluster - -You can install a client and start a cluster with either one of these commands (we list both in case only one is installed on your machine): - - - ```bash - curl -sS https://get.k8s.io | bash - ``` - -or - -```bash -wget -q -O - https://get.k8s.io | bash -``` - -Once this command completes, you will have a master VM and four worker VMs, running as a Kubernetes cluster. - -By default, some containers will already be running on your cluster. Containers like `kibana` and `elasticsearch` provide [logging](logging.md), while `heapster` provides [monitoring](http://releases.k8s.io/HEAD/cluster/addons/cluster-monitoring/README.md) services. - -The script run by the commands above creates a cluster with the name/prefix "kubernetes". It defines one specific cluster config, so you can't run it more than once. - -Alternately, you can download and install the latest Kubernetes release from [this page](https://k8s.io/kubernetes/releases), then run the `/cluster/kube-up.sh` script to start the cluster: - -```bash -cd kubernetes -cluster/kube-up.sh -``` - -If you want more than one cluster running in your project, want to use a different name, or want a different number of worker nodes, see the `/cluster/gce/config-default.sh` file for more fine-grained configuration before you start up your cluster. - -If you run into trouble, please see the section on [troubleshooting](gce.md#troubleshooting), post to the -[google-containers group](https://groups.google.com/forum/#!forum/google-containers), or come ask questions on IRC at [#google-containers](http://webchat.freenode.net/?channels=google-containers) on freenode. - -The next few steps will show you: - -1. how to set up the command line client on your workstation to manage the cluster -1. examples of how to use the cluster -1. how to delete the cluster -1. how to start clusters with non-default options (like larger clusters) - -### Installing the Kubernetes command line tools on your workstation - -The cluster startup script will leave you with a running cluster and a `kubernetes` directory on your workstation. -The next step is to make sure the `kubectl` tool is in your path. - -The [kubectl](../user-guide/kubectl/kubectl.md) tool controls the Kubernetes cluster manager. It lets you inspect your cluster resources, create, delete, and update components, and much more. -You will use it to look at your new cluster and bring up example apps. - -Add the appropriate binary folder to your `PATH` to access kubectl: - -```bash -# OS X -export PATH=/platforms/darwin/amd64:$PATH - -# Linux -export PATH=/platforms/linux/amd64:$PATH -``` - -**Note**: gcloud also ships with `kubectl`, which by default is added to your path. -However the gcloud bundled kubectl version may be older than the one downloaded by the -get.k8s.io install script. We recommend you use the downloaded binary to avoid -potential issues with client/server version skew. - -### Getting started with your cluster - -#### Inspect your cluster - -Once `kubectl` is in your path, you can use it to look at your cluster. E.g., running: - -```console -$ kubectl get --all-namespaces services -``` - -should show a set of [services](../user-guide/services.md) that look something like this: - -```console -NAMESPACE NAME LABELS SELECTOR IP(S) PORT(S) -default kubernetes component=apiserver,provider=kubernetes 10.0.0.1 443/TCP -kube-system kube-dns k8s-app=kube-dns,kubernetes.io/cluster-service=true,kubernetes.io/name=KubeDNS k8s-app=kube-dns 10.0.0.10 53/UDP - 53/TCP -kube-system kube-ui k8s-app=kube-ui,kubernetes.io/cluster-service=true,kubernetes.io/name=KubeUI k8s-app=kube-ui 10.0.59.25 80/TCP -kube-system monitoring-grafana kubernetes.io/cluster-service=true,kubernetes.io/name=Grafana k8s-app=influxGrafana 10.0.41.246 80/TCP -kube-system monitoring-heapster kubernetes.io/cluster-service=true,kubernetes.io/name=Heapster k8s-app=heapster 10.0.59.48 80/TCP -kube-system monitoring-influxdb kubernetes.io/cluster-service=true,kubernetes.io/name=InfluxDB k8s-app=influxGrafana 10.0.210.156 8083/TCP - 8086/TCP -``` - -Similarly, you can take a look at the set of [pods](../user-guide/pods.md) that were created during cluster startup. -You can do this via the - -```console -$ kubectl get --all-namespaces pods -``` - -command. - -You'll see a list of pods that looks something like this (the name specifics will be different): - -```console -NAMESPACE NAME READY STATUS RESTARTS AGE -kube-system fluentd-cloud-logging-kubernetes-minion-63uo 1/1 Running 0 14m -kube-system fluentd-cloud-logging-kubernetes-minion-c1n9 1/1 Running 0 14m -kube-system fluentd-cloud-logging-kubernetes-minion-c4og 1/1 Running 0 14m -kube-system fluentd-cloud-logging-kubernetes-minion-ngua 1/1 Running 0 14m -kube-system kube-dns-v5-7ztia 3/3 Running 0 15m -kube-system kube-ui-v1-curt1 1/1 Running 0 15m -kube-system monitoring-heapster-v5-ex4u3 1/1 Running 1 15m -kube-system monitoring-influx-grafana-v1-piled 2/2 Running 0 15m -``` - -Some of the pods may take a few seconds to start up (during this time they'll show `Pending`), but check that they all show as `Running` after a short period. - -#### Run some examples - -Then, see [a simple nginx example](../../docs/user-guide/simple-nginx.md) to try out your new cluster. - -For more complete applications, please look in the [examples directory](../../examples/). The [guestbook example](../../examples/guestbook/) is a good "getting started" walkthrough. - -### Tearing down the cluster - -To remove/delete/teardown the cluster, use the `kube-down.sh` script. - -```bash -cd kubernetes -cluster/kube-down.sh -``` - -Likewise, the `kube-up.sh` in the same directory will bring it back up. You do not need to rerun the `curl` or `wget` command: everything needed to setup the Kubernetes cluster is now on your workstation. - -### Customizing - -The script above relies on Google Storage to stage the Kubernetes release. It -then will start (by default) a single master VM along with 4 worker VMs. You -can tweak some of these parameters by editing `kubernetes/cluster/gce/config-default.sh` -You can view a transcript of a successful cluster creation -[here](https://gist.github.com/satnam6502/fc689d1b46db9772adea). - -### Troubleshooting - -#### Project settings - -You need to have the Google Cloud Storage API, and the Google Cloud Storage -JSON API enabled. It is activated by default for new projects. Otherwise, it -can be done in the Google Cloud Console. See the [Google Cloud Storage JSON -API Overview](https://cloud.google.com/storage/docs/json_api/) for more -details. - -Also ensure that-- as listed in the [Prerequsites section](#prerequisites)-- you've enabled the `Compute Engine Instance Group Manager API`, and can start up a GCE VM from the command line as in the [GCE Quickstart](https://cloud.google.com/compute/docs/quickstart) instructions. - -#### Cluster initialization hang - -If the Kubernetes startup script hangs waiting for the API to be reachable, you can troubleshoot by SSHing into the master and node VMs and looking at logs such as `/var/log/startupscript.log`. - -**Once you fix the issue, you should run `kube-down.sh` to cleanup** after the partial cluster creation, before running `kube-up.sh` to try again. - -#### SSH - -If you're having trouble SSHing into your instances, ensure the GCE firewall -isn't blocking port 22 to your VMs. By default, this should work but if you -have edited firewall rules or created a new non-default network, you'll need to -expose it: `gcloud compute firewall-rules create default-ssh --network= ---description "SSH allowed from anywhere" --allow tcp:22` - -Additionally, your GCE SSH key must either have no passcode or you need to be -using `ssh-agent`. - -#### Networking - -The instances must be able to connect to each other using their private IP. The -script uses the "default" network which should have a firewall rule called -"default-allow-internal" which allows traffic on any port on the private IPs. -If this rule is missing from the default network or if you change the network -being used in `cluster/config-default.sh` create a new rule with the following -field values: - -* Source Ranges: `10.0.0.0/8` -* Allowed Protocols and Port: `tcp:1-65535;udp:1-65535;icmp` - - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/getting-started-guides/gce.md?pixel)]() - diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/juju.md b/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/juju.md deleted file mode 100644 index 1fe1bee538bd..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/juju.md +++ /dev/null @@ -1,273 +0,0 @@ - - - - -WARNING -WARNING -WARNING -WARNING -WARNING - -

    PLEASE NOTE: This document applies to the HEAD of the source tree

    - -If you are using a released version of Kubernetes, you should -refer to the docs that go with that version. - - -The latest 1.0.x release of this document can be found -[here](http://releases.k8s.io/release-1.0/docs/getting-started-guides/juju.md). - -Documentation for other releases can be found at -[releases.k8s.io](http://releases.k8s.io). - --- - - - - - -Getting started with Juju -------------------------- - -[Juju](https://jujucharms.com/docs/stable/about-juju) makes it easy to deploy -Kubernetes by provisioning, installing and configuring all the systems in -the cluster. Once deployed the cluster can easily scale up with one command -to increase the cluster size. - - -**Table of Contents** - -- [Prerequisites](#prerequisites) - - [On Ubuntu](#on-ubuntu) - - [With Docker](#with-docker) -- [Launch Kubernetes cluster](#launch-kubernetes-cluster) -- [Exploring the cluster](#exploring-the-cluster) -- [Run some containers!](#run-some-containers) -- [Scale out cluster](#scale-out-cluster) -- [Launch the "k8petstore" example app](#launch-the-k8petstore-example-app) -- [Tear down cluster](#tear-down-cluster) -- [More Info](#more-info) - - [Cloud compatibility](#cloud-compatibility) - - -## Prerequisites - -> Note: If you're running kube-up, on Ubuntu - all of the dependencies -> will be handled for you. You may safely skip to the section: -> [Launch Kubernetes Cluster](#launch-kubernetes-cluster) - -### On Ubuntu - -[Install the Juju client](https://jujucharms.com/get-started) on your -local Ubuntu system: - - sudo add-apt-repository ppa:juju/stable - sudo apt-get update - sudo apt-get install juju-core juju-quickstart - - -### With Docker - -If you are not using Ubuntu or prefer the isolation of Docker, you may -run the following: - - mkdir ~/.juju - sudo docker run -v ~/.juju:/home/ubuntu/.juju -ti jujusolutions/jujubox:latest - -At this point from either path you will have access to the `juju -quickstart` command. - -To set up the credentials for your chosen cloud run: - - juju quickstart --constraints="mem=3.75G" -i - -> The `constraints` flag is optional, it changes the size of virtual machines -> that Juju will generate when it requests a new machine. Larger machines -> will run faster but cost more money than smaller machines. - -Follow the dialogue and choose `save` and `use`. Quickstart will now -bootstrap the juju root node and setup the juju web based user -interface. - - -## Launch Kubernetes cluster - -You will need to export the `KUBERNETES_PROVIDER` environment variable before -bringing up the cluster. - - export KUBERNETES_PROVIDER=juju - cluster/kube-up.sh - -If this is your first time running the `kube-up.sh` script, it will install -the required dependencies to get started with Juju, additionally it will -launch a curses based configuration utility allowing you to select your cloud -provider and enter the proper access credentials. - -Next it will deploy the kubernetes master, etcd, 2 nodes with flannel based -Software Defined Networking (SDN) so containers on different hosts can -communicate with each other. - - -## Exploring the cluster - -The `juju status` command provides information about each unit in the cluster: - - $ juju status --format=oneline - - docker/0: 52.4.92.78 (started) - - flannel-docker/0: 52.4.92.78 (started) - - kubernetes/0: 52.4.92.78 (started) - - docker/1: 52.6.104.142 (started) - - flannel-docker/1: 52.6.104.142 (started) - - kubernetes/1: 52.6.104.142 (started) - - etcd/0: 52.5.216.210 (started) 4001/tcp - - juju-gui/0: 52.5.205.174 (started) 80/tcp, 443/tcp - - kubernetes-master/0: 52.6.19.238 (started) 8080/tcp - -You can use `juju ssh` to access any of the units: - - juju ssh kubernetes-master/0 - - -## Run some containers! - -`kubectl` is available on the Kubernetes master node. We'll ssh in to -launch some containers, but one could use `kubectl` locally by setting -`KUBERNETES_MASTER` to point at the ip address of "kubernetes-master/0". - -No pods will be available before starting a container: - - kubectl get pods - NAME READY STATUS RESTARTS AGE - - kubectl get replicationcontrollers - CONTROLLER CONTAINER(S) IMAGE(S) SELECTOR REPLICAS - -We'll follow the aws-coreos example. Create a pod manifest: `pod.json` - -```json -{ - "apiVersion": "v1", - "kind": "Pod", - "metadata": { - "name": "hello", - "labels": { - "name": "hello", - "environment": "testing" - } - }, - "spec": { - "containers": [{ - "name": "hello", - "image": "quay.io/kelseyhightower/hello", - "ports": [{ - "containerPort": 80, - "hostPort": 80 - }] - }] - } -} -``` - -Create the pod with kubectl: - - kubectl create -f pod.json - - -Get info on the pod: - - kubectl get pods - - -To test the hello app, we need to locate which node is hosting -the container. Better tooling for using Juju to introspect container -is in the works but we can use `juju run` and `juju status` to find -our hello app. - -Exit out of our ssh session and run: - - juju run --unit kubernetes/0 "docker ps -n=1" - ... - juju run --unit kubernetes/1 "docker ps -n=1" - CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES - 02beb61339d8 quay.io/kelseyhightower/hello:latest /hello About an hour ago Up About an hour k8s_hello.... - - -We see "kubernetes/1" has our container, we can open port 80: - - juju run --unit kubernetes/1 "open-port 80" - juju expose kubernetes - sudo apt-get install curl - curl $(juju status --format=oneline kubernetes/1 | cut -d' ' -f3) - -Finally delete the pod: - - juju ssh kubernetes-master/0 - kubectl delete pods hello - - -## Scale out cluster - -We can add node units like so: - - juju add-unit docker # creates unit docker/2, kubernetes/2, docker-flannel/2 - -## Launch the "k8petstore" example app - -The [k8petstore example](../../examples/k8petstore/) is available as a -[juju action](https://jujucharms.com/docs/devel/actions). - - juju action do kubernetes-master/0 - -> Note: this example includes curl statements to exercise the app, which -> automatically generates "petstore" transactions written to redis, and allows -> you to visualize the throughput in your browser. - -## Tear down cluster - - ./kube-down.sh - -or destroy your current Juju environment (using the `juju env` command): - - juju destroy-environment --force `juju env` - - -## More Info - -The Kubernetes charms and bundles can be found in the `kubernetes` project on -github.com: - - - [Bundle Repository](http://releases.k8s.io/HEAD/cluster/juju/bundles) - * [Kubernetes master charm](../../cluster/juju/charms/trusty/kubernetes-master/) - * [Kubernetes node charm](../../cluster/juju/charms/trusty/kubernetes/) - - [More about Juju](https://jujucharms.com) - - -### Cloud compatibility - -Juju runs natively against a variety of public cloud providers. Juju currently -works with [Amazon Web Service](https://jujucharms.com/docs/stable/config-aws), -[Windows Azure](https://jujucharms.com/docs/stable/config-azure), -[DigitalOcean](https://jujucharms.com/docs/stable/config-digitalocean), -[Google Compute Engine](https://jujucharms.com/docs/stable/config-gce), -[HP Public Cloud](https://jujucharms.com/docs/stable/config-hpcloud), -[Joyent](https://jujucharms.com/docs/stable/config-joyent), -[LXC](https://jujucharms.com/docs/stable/config-LXC), any -[OpenStack](https://jujucharms.com/docs/stable/config-openstack) deployment, -[Vagrant](https://jujucharms.com/docs/stable/config-vagrant), and -[Vmware vSphere](https://jujucharms.com/docs/stable/config-vmware). - -If you do not see your favorite cloud provider listed many clouds can be -configured for [manual provisioning](https://jujucharms.com/docs/stable/config-manual). - -The Kubernetes bundle has been tested on GCE and AWS and found to work with -version 1.0.0. - - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/getting-started-guides/juju.md?pixel)]() - diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/k8s-docker.png b/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/k8s-docker.png deleted file mode 100644 index 6795e35e83d5..000000000000 Binary files a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/k8s-docker.png and /dev/null differ diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/k8s-singlenode-docker.png b/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/k8s-singlenode-docker.png deleted file mode 100644 index 5ebf812682d2..000000000000 Binary files a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/k8s-singlenode-docker.png and /dev/null differ diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/kibana-logs.png b/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/kibana-logs.png deleted file mode 100644 index 15b2f6759b3e..000000000000 Binary files a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/kibana-logs.png and /dev/null differ diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/libvirt-coreos.md b/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/libvirt-coreos.md deleted file mode 100644 index c48dd9e42585..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/libvirt-coreos.md +++ /dev/null @@ -1,309 +0,0 @@ - - - - -WARNING -WARNING -WARNING -WARNING -WARNING - -

    PLEASE NOTE: This document applies to the HEAD of the source tree

    - -If you are using a released version of Kubernetes, you should -refer to the docs that go with that version. - - -The latest 1.0.x release of this document can be found -[here](http://releases.k8s.io/release-1.0/docs/getting-started-guides/libvirt-coreos.md). - -Documentation for other releases can be found at -[releases.k8s.io](http://releases.k8s.io). - --- - - - - -Getting started with libvirt CoreOS ------------------------------------ - -**Table of Contents** - -- [Highlights](#highlights) -- [Prerequisites](#prerequisites) -- [Setup](#setup) -- [Interacting with your Kubernetes cluster with the `kube-*` scripts.](#interacting-with-your-kubernetes-cluster-with-the-kube--scripts) -- [Troubleshooting](#troubleshooting) - - [!!! Cannot find kubernetes-server-linux-amd64.tar.gz](#-cannot-find-kubernetes-server-linux-amd64targz) - - [Can't find virsh in PATH, please fix and retry.](#cant-find-virsh-in-path-please-fix-and-retry) - - [error: Failed to connect socket to '/var/run/libvirt/libvirt-sock': No such file or directory](#error-failed-to-connect-socket-to-varrunlibvirtlibvirt-sock-no-such-file-or-directory) - - [error: Failed to connect socket to '/var/run/libvirt/libvirt-sock': Permission denied](#error-failed-to-connect-socket-to-varrunlibvirtlibvirt-sock-permission-denied) - - [error: Out of memory initializing network (virsh net-create...)](#error-out-of-memory-initializing-network-virsh-net-create) - -### Highlights - -* Super-fast cluster boot-up (few seconds instead of several minutes for vagrant) -* Reduced disk usage thanks to [COW](https://en.wikibooks.org/wiki/QEMU/Images#Copy_on_write) -* Reduced memory footprint thanks to [KSM](https://www.kernel.org/doc/Documentation/vm/ksm.txt) - -### Prerequisites - -1. Install [dnsmasq](http://www.thekelleys.org.uk/dnsmasq/doc.html) -2. Install [ebtables](http://ebtables.netfilter.org/) -3. Install [qemu](http://wiki.qemu.org/Main_Page) -4. Install [libvirt](http://libvirt.org/) -5. Enable and start the libvirt daemon, e.g: - * ``systemctl enable libvirtd`` - * ``systemctl start libvirtd`` -6. [Grant libvirt access to your user¹](https://libvirt.org/aclpolkit.html) -7. Check that your $HOME is accessible to the qemu user² - -#### ¹ Depending on your distribution, libvirt access may be denied by default or may require a password at each access. - -You can test it with the following command: - -```sh -virsh -c qemu:///system pool-list -``` - -If you have access error messages, please read https://libvirt.org/acl.html and https://libvirt.org/aclpolkit.html . - -In short, if your libvirt has been compiled with Polkit support (ex: Arch, Fedora 21), you can create `/etc/polkit-1/rules.d/50-org.libvirt.unix.manage.rules` as follows to grant full access to libvirt to `$USER` - -```sh -sudo /bin/sh -c "cat - > /etc/polkit-1/rules.d/50-org.libvirt.unix.manage.rules" << EOF -polkit.addRule(function(action, subject) { - if (action.id == "org.libvirt.unix.manage" && - subject.user == "$USER") { - return polkit.Result.YES; - polkit.log("action=" + action); - polkit.log("subject=" + subject); - } -}); -EOF -``` - -If your libvirt has not been compiled with Polkit (ex: Ubuntu 14.04.1 LTS), check the permissions on the libvirt unix socket: - -```console -$ ls -l /var/run/libvirt/libvirt-sock -srwxrwx--- 1 root libvirtd 0 févr. 12 16:03 /var/run/libvirt/libvirt-sock - -$ usermod -a -G libvirtd $USER -# $USER needs to logout/login to have the new group be taken into account -``` - -(Replace `$USER` with your login name) - -#### ² Qemu will run with a specific user. It must have access to the VMs drives - -All the disk drive resources needed by the VM (CoreOS disk image, Kubernetes binaries, cloud-init files, etc.) are put inside `./cluster/libvirt-coreos/libvirt_storage_pool`. - -As we’re using the `qemu:///system` instance of libvirt, qemu will run with a specific `user:group` distinct from your user. It is configured in `/etc/libvirt/qemu.conf`. That qemu user must have access to that libvirt storage pool. - -If your `$HOME` is world readable, everything is fine. If your $HOME is private, `cluster/kube-up.sh` will fail with an error message like: - -```console -error: Cannot access storage file '$HOME/.../kubernetes/cluster/libvirt-coreos/libvirt_storage_pool/kubernetes_master.img' (as uid:99, gid:78): Permission denied -``` - -In order to fix that issue, you have several possibilities: -* set `POOL_PATH` inside `cluster/libvirt-coreos/config-default.sh` to a directory: - * backed by a filesystem with a lot of free disk space - * writable by your user; - * accessible by the qemu user. -* Grant the qemu user access to the storage pool. - -On Arch: - -```sh -setfacl -m g:kvm:--x ~ -``` - -### Setup - -By default, the libvirt-coreos setup will create a single Kubernetes master and 3 Kubernetes nodes. Because the VM drives use Copy-on-Write and because of memory ballooning and KSM, there is a lot of resource over-allocation. - -To start your local cluster, open a shell and run: - -```sh -cd kubernetes - -export KUBERNETES_PROVIDER=libvirt-coreos -cluster/kube-up.sh -``` - -The `KUBERNETES_PROVIDER` environment variable tells all of the various cluster management scripts which variant to use. If you forget to set this, the assumption is you are running on Google Compute Engine. - -The `NUM_MINIONS` environment variable may be set to specify the number of nodes to start. If it is not set, the number of nodes defaults to 3. - -The `KUBE_PUSH` environment variable may be set to specify which Kubernetes binaries must be deployed on the cluster. Its possible values are: - -* `release` (default if `KUBE_PUSH` is not set) will deploy the binaries of `_output/release-tars/kubernetes-server-….tar.gz`. This is built with `make release` or `make release-skip-tests`. -* `local` will deploy the binaries of `_output/local/go/bin`. These are built with `make`. - -You can check that your machines are there and running with: - -```console -$ virsh -c qemu:///system list - Id Name State ----------------------------------------------------- - 15 kubernetes_master running - 16 kubernetes_minion-01 running - 17 kubernetes_minion-02 running - 18 kubernetes_minion-03 running - ``` - -You can check that the Kubernetes cluster is working with: - -```console -$ kubectl get nodes -NAME LABELS STATUS -192.168.10.2 Ready -192.168.10.3 Ready -192.168.10.4 Ready -``` - -The VMs are running [CoreOS](https://coreos.com/). -Your ssh keys have already been pushed to the VM. (It looks for ~/.ssh/id_*.pub) -The user to use to connect to the VM is `core`. -The IP to connect to the master is 192.168.10.1. -The IPs to connect to the nodes are 192.168.10.2 and onwards. - -Connect to `kubernetes_master`: - -```sh -ssh core@192.168.10.1 -``` - -Connect to `kubernetes_minion-01`: - -```sh -ssh core@192.168.10.2 -``` - -### Interacting with your Kubernetes cluster with the `kube-*` scripts. - -All of the following commands assume you have set `KUBERNETES_PROVIDER` appropriately: - -```sh -export KUBERNETES_PROVIDER=libvirt-coreos -``` - -Bring up a libvirt-CoreOS cluster of 5 nodes - -```sh -NUM_MINIONS=5 cluster/kube-up.sh -``` - -Destroy the libvirt-CoreOS cluster - -```sh -cluster/kube-down.sh -``` - -Update the libvirt-CoreOS cluster with a new Kubernetes release produced by `make release` or `make release-skip-tests`: - -```sh -cluster/kube-push.sh -``` - -Update the libvirt-CoreOS cluster with the locally built Kubernetes binaries produced by `make`: - -```sh -KUBE_PUSH=local cluster/kube-push.sh -``` - -Interact with the cluster - -```sh -kubectl ... -``` - -### Troubleshooting - -#### !!! Cannot find kubernetes-server-linux-amd64.tar.gz - -Build the release tarballs: - -```sh -make release -``` - -#### Can't find virsh in PATH, please fix and retry. - -Install libvirt - -On Arch: - -```sh -pacman -S qemu libvirt -``` - -On Ubuntu 14.04.1: - -```sh -aptitude install qemu-system-x86 libvirt-bin -``` - -On Fedora 21: - -```sh -yum install qemu libvirt -``` - -#### error: Failed to connect socket to '/var/run/libvirt/libvirt-sock': No such file or directory - -Start the libvirt daemon - -On Arch: - -```sh -systemctl start libvirtd -``` - -On Ubuntu 14.04.1: - -```sh -service libvirt-bin start -``` - -#### error: Failed to connect socket to '/var/run/libvirt/libvirt-sock': Permission denied - -Fix libvirt access permission (Remember to adapt `$USER`) - -On Arch and Fedora 21: - -```sh -cat > /etc/polkit-1/rules.d/50-org.libvirt.unix.manage.rules < -WARNING -WARNING -WARNING -WARNING - -

    PLEASE NOTE: This document applies to the HEAD of the source tree

    - -If you are using a released version of Kubernetes, you should -refer to the docs that go with that version. - - -The latest 1.0.x release of this document can be found -[here](http://releases.k8s.io/release-1.0/docs/getting-started-guides/locally.md). - -Documentation for other releases can be found at -[releases.k8s.io](http://releases.k8s.io). - --- - - - - -Getting started locally ------------------------ - -**Table of Contents** - -- [Requirements](#requirements) - - [Linux](#linux) - - [Docker](#docker) - - [etcd](#etcd) - - [go](#go) -- [Starting the cluster](#starting-the-cluster) -- [Running a container](#running-a-container) -- [Running a user defined pod](#running-a-user-defined-pod) -- [Troubleshooting](#troubleshooting) - - [I cannot reach service IPs on the network.](#i-cannot-reach-service-ips-on-the-network) - - [I cannot create a replication controller with replica size greater than 1! What gives?](#i-cannot-create-a-replication-controller-with-replica-size-greater-than-1--what-gives) - - [I changed Kubernetes code, how do I run it?](#i-changed-kubernetes-code-how-do-i-run-it) - - [kubectl claims to start a container but `get pods` and `docker ps` don't show it.](#kubectl-claims-to-start-a-container-but-get-pods-and-docker-ps-dont-show-it) - - [The pods fail to connect to the services by host names](#the-pods-fail-to-connect-to-the-services-by-host-names) - -### Requirements - -#### Linux - -Not running Linux? Consider running Linux in a local virtual machine with [Vagrant](vagrant.md), or on a cloud provider like [Google Compute Engine](gce.md) - -#### Docker - -At least [Docker](https://docs.docker.com/installation/#installation) -1.3+. Ensure the Docker daemon is running and can be contacted (try `docker -ps`). Some of the Kubernetes components need to run as root, which normally -works fine with docker. - -#### etcd - -You need an [etcd](https://github.com/coreos/etcd/releases) in your path, please make sure it is installed and in your ``$PATH``. - -#### go - -You need [go](https://golang.org/doc/install) at least 1.3+ in your path, please make sure it is installed and in your ``$PATH``. - -### Starting the cluster - -In a separate tab of your terminal, run the following (since one needs sudo access to start/stop Kubernetes daemons, it is easier to run the entire script as root): - -```sh -cd kubernetes -hack/local-up-cluster.sh -``` - -This will build and start a lightweight local cluster, consisting of a master -and a single node. Type Control-C to shut it down. - -You can use the cluster/kubectl.sh script to interact with the local cluster. hack/local-up-cluster.sh will -print the commands to run to point kubectl at the local cluster. - - -### Running a container - -Your cluster is running, and you want to start running containers! - -You can now use any of the cluster/kubectl.sh commands to interact with your local setup. - -```sh -cluster/kubectl.sh get pods -cluster/kubectl.sh get services -cluster/kubectl.sh get replicationcontrollers -cluster/kubectl.sh run my-nginx --image=nginx --replicas=2 --port=80 - - -## begin wait for provision to complete, you can monitor the docker pull by opening a new terminal - sudo docker images - ## you should see it pulling the nginx image, once the above command returns it - sudo docker ps - ## you should see your container running! - exit -## end wait - -## introspect Kubernetes! -cluster/kubectl.sh get pods -cluster/kubectl.sh get services -cluster/kubectl.sh get replicationcontrollers -``` - - -### Running a user defined pod - -Note the difference between a [container](../user-guide/containers.md) -and a [pod](../user-guide/pods.md). Since you only asked for the former, Kubernetes will create a wrapper pod for you. -However you cannot view the nginx start page on localhost. To verify that nginx is running you need to run `curl` within the docker container (try `docker exec`). - -You can control the specifications of a pod via a user defined manifest, and reach nginx through your browser on the port specified therein: - -```sh -cluster/kubectl.sh create -f docs/user-guide/pod.yaml -``` - -Congratulations! - -### Troubleshooting - -#### I cannot reach service IPs on the network. - -Some firewall software that uses iptables may not interact well with -kubernetes. If you have trouble around networking, try disabling any -firewall or other iptables-using systems, first. Also, you can check -if SELinux is blocking anything by running a command such as `journalctl --since yesterday | grep avc`. - -By default the IP range for service cluster IPs is 10.0.*.* - depending on your -docker installation, this may conflict with IPs for containers. If you find -containers running with IPs in this range, edit hack/local-cluster-up.sh and -change the service-cluster-ip-range flag to something else. - -#### I cannot create a replication controller with replica size greater than 1! What gives? - -You are running a single node setup. This has the limitation of only supporting a single replica of a given pod. If you are interested in running with larger replica sizes, we encourage you to try the local vagrant setup or one of the cloud providers. - -#### I changed Kubernetes code, how do I run it? - -```sh -cd kubernetes -hack/build-go.sh -hack/local-up-cluster.sh -``` - -#### kubectl claims to start a container but `get pods` and `docker ps` don't show it. - -One or more of the KUbernetes daemons might've crashed. Tail the logs of each in /tmp. - -#### The pods fail to connect to the services by host names - -The local-up-cluster.sh script doesn't start a DNS service. Similar situation can be found [here](https://k8s.io/kubernetes/issues/6667). You can start a manually. Related documents can be found [here](../../cluster/addons/dns/#how-do-i-configure-it) - - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/getting-started-guides/locally.md?pixel)]() - diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/logging-elasticsearch.md b/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/logging-elasticsearch.md deleted file mode 100644 index 8ae7f17b92e5..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/logging-elasticsearch.md +++ /dev/null @@ -1,268 +0,0 @@ - - - - -WARNING -WARNING -WARNING -WARNING -WARNING - -

    PLEASE NOTE: This document applies to the HEAD of the source tree

    - -If you are using a released version of Kubernetes, you should -refer to the docs that go with that version. - - -The latest 1.0.x release of this document can be found -[here](http://releases.k8s.io/release-1.0/docs/getting-started-guides/logging-elasticsearch.md). - -Documentation for other releases can be found at -[releases.k8s.io](http://releases.k8s.io). - --- - - - - - -# Cluster Level Logging with Elasticsearch and Kibana - -On the Google Compute Engine (GCE) platform the default cluster level logging support targets -[Google Cloud Logging](https://cloud.google.com/logging/docs/) as described at the [Logging](logging.md) getting -started page. Here we describe how to set up a cluster to ingest logs into Elasticsearch and view them using Kibana as an -alternative to Google Cloud Logging. - -To use Elasticsearch and Kibana for cluster logging you should set the following environment variable as shown below: - -```console -KUBE_LOGGING_DESTINATION=elasticsearch -``` - -You should also ensure that `KUBE_ENABLE_NODE_LOGGING=true` (which is the default for the GCE platform). - -Now when you create a cluster a message will indicate that the Fluentd node-level log collectors -will target Elasticsearch: - -```console -$ cluster/kube-up.sh -... -Project: kubernetes-satnam -Zone: us-central1-b -... calling kube-up -Project: kubernetes-satnam -Zone: us-central1-b -+++ Staging server tars to Google Storage: gs://kubernetes-staging-e6d0e81793/devel -+++ kubernetes-server-linux-amd64.tar.gz uploaded (sha1 = 6987c098277871b6d69623141276924ab687f89d) -+++ kubernetes-salt.tar.gz uploaded (sha1 = bdfc83ed6b60fa9e3bff9004b542cfc643464cd0) -Looking for already existing resources -Starting master and configuring firewalls -Created [https://www.googleapis.com/compute/v1/projects/kubernetes-satnam/zones/us-central1-b/disks/kubernetes-master-pd]. -NAME ZONE SIZE_GB TYPE STATUS -kubernetes-master-pd us-central1-b 20 pd-ssd READY -Created [https://www.googleapis.com/compute/v1/projects/kubernetes-satnam/regions/us-central1/addresses/kubernetes-master-ip]. -+++ Logging using Fluentd to elasticsearch -``` - -The node level Fluentd collector pods and the Elasticsearech pods used to ingest cluster logs and the pod for the Kibana -viewer should be running in the kube-system namespace soon after the cluster comes to life. - -```console -$ kubectl get pods --namespace=kube-system -NAME READY REASON RESTARTS AGE -elasticsearch-logging-v1-78nog 1/1 Running 0 2h -elasticsearch-logging-v1-nj2nb 1/1 Running 0 2h -fluentd-elasticsearch-kubernetes-minion-5oq0 1/1 Running 0 2h -fluentd-elasticsearch-kubernetes-minion-6896 1/1 Running 0 2h -fluentd-elasticsearch-kubernetes-minion-l1ds 1/1 Running 0 2h -fluentd-elasticsearch-kubernetes-minion-lz9j 1/1 Running 0 2h -kibana-logging-v1-bhpo8 1/1 Running 0 2h -kube-dns-v3-7r1l9 3/3 Running 0 2h -monitoring-heapster-v4-yl332 1/1 Running 1 2h -monitoring-influx-grafana-v1-o79xf 2/2 Running 0 2h -``` - -Here we see that for a four node cluster there is a `fluent-elasticsearch` pod running which gathers -the Docker container logs and sends them to Elasticsearch. The Fluentd collector communicates to -a Kubernetes service that maps requests to specific Elasticsearch pods. Similarly, Kibana can also be -accessed via a Kubernetes service definition. - - -```console -$ kubectl get services --namespace=kube-system -NAME LABELS SELECTOR IP(S) PORT(S) -elasticsearch-logging k8s-app=elasticsearch-logging,kubernetes.io/cluster-service=true,kubernetes.io/name=Elasticsearch k8s-app=elasticsearch-logging 10.0.222.57 9200/TCP -kibana-logging k8s-app=kibana-logging,kubernetes.io/cluster-service=true,kubernetes.io/name=Kibana k8s-app=kibana-logging 10.0.193.226 5601/TCP -kube-dns k8s-app=kube-dns,kubernetes.io/cluster-service=true,kubernetes.io/name=KubeDNS k8s-app=kube-dns 10.0.0.10 53/UDP - 53/TCP -kubernetes component=apiserver,provider=kubernetes 10.0.0.1 443/TCP -monitoring-grafana kubernetes.io/cluster-service=true,kubernetes.io/name=Grafana k8s-app=influxGrafana 10.0.167.139 80/TCP -monitoring-heapster kubernetes.io/cluster-service=true,kubernetes.io/name=Heapster k8s-app=heapster 10.0.208.221 80/TCP -monitoring-influxdb kubernetes.io/cluster-service=true,kubernetes.io/name=InfluxDB k8s-app=influxGrafana 10.0.188.57 8083/TCP -``` - -By default two Elasticsearch replicas are created and one Kibana replica is created. - -```console -$ kubectl get rc --namespace=kube-system -CONTROLLER CONTAINER(S) IMAGE(S) SELECTOR REPLICAS -elasticsearch-logging-v1 elasticsearch-logging gcr.io/google_containers/elasticsearch:1.4 k8s-app=elasticsearch-logging,version=v1 2 -kibana-logging-v1 kibana-logging gcr.io/google_containers/kibana:1.3 k8s-app=kibana-logging,version=v1 1 -kube-dns-v3 etcd gcr.io/google_containers/etcd:2.0.9 k8s-app=kube-dns,version=v3 1 - kube2sky gcr.io/google_containers/kube2sky:1.9 - skydns gcr.io/google_containers/skydns:2015-03-11-001 -monitoring-heapster-v4 heapster gcr.io/google_containers/heapster:v0.14.3 k8s-app=heapster,version=v4 1 -monitoring-influx-grafana-v1 influxdb gcr.io/google_containers/heapster_influxdb:v0.3 k8s-app=influxGrafana,version=v1 1 - grafana gcr.io/google_containers/heapster_grafana:v0.7 -``` - -The Elasticsearch and Kibana services are not directly exposed via a publicly reachable IP address. Instead, -they can be accessed via the service proxy running at the master. The URLs for accessing Elasticsearch -and Kibana via the service proxy can be found using the `kubectl cluster-info` command. - -```console -$ kubectl cluster-info -Kubernetes master is running at https://146.148.94.154 -Elasticsearch is running at https://146.148.94.154/api/v1/proxy/namespaces/kube-system/services/elasticsearch-logging -Kibana is running at https://146.148.94.154/api/v1/proxy/namespaces/kube-system/services/kibana-logging -KubeDNS is running at https://146.148.94.154/api/v1/proxy/namespaces/kube-system/services/kube-dns -KubeUI is running at https://146.148.94.154/api/v1/proxy/namespaces/kube-system/services/kube-ui -Grafana is running at https://146.148.94.154/api/v1/proxy/namespaces/kube-system/services/monitoring-grafana -Heapster is running at https://146.148.94.154/api/v1/proxy/namespaces/kube-system/services/monitoring-heapster -InfluxDB is running at https://146.148.94.154/api/v1/proxy/namespaces/kube-system/services/monitoring-influxdb -``` - -Before accessing the logs ingested into Elasticsearch using a browser and the service proxy URL we need to find out -the `admin` password for the cluster using `kubectl config view`. - -```console -$ kubectl config view -... -- name: kubernetes-satnam_kubernetes-basic-auth - user: - password: 7GlspJ9Q43OnGIJO - username: admin -... -``` - -The first time you try to access the cluster from a browser a dialog box appears asking for the username and password. -Use the username `admin` and provide the basic auth password reported by `kubectl config view` for the -cluster you are trying to connect to. Connecting to the Elasticsearch URL should then give the -status page for Elasticsearch. - -![Elasticsearch Status](es-browser.png) - -You can now type Elasticsearch queries directly into the browser. Alternatively you can query Elasticsearch -from your local machine using `curl` but first you need to know what your bearer token is: - -```console -$ kubectl config view --minify -apiVersion: v1 -clusters: -- cluster: - certificate-authority-data: REDACTED - server: https://146.148.94.154 - name: kubernetes-satnam_kubernetes -contexts: -- context: - cluster: kubernetes-satnam_kubernetes - user: kubernetes-satnam_kubernetes - name: kubernetes-satnam_kubernetes -current-context: kubernetes-satnam_kubernetes -kind: Config -preferences: {} -users: -- name: kubernetes-satnam_kubernetes - user: - client-certificate-data: REDACTED - client-key-data: REDACTED - token: JsUe2Z3cXqa17UQqQ8qWGGf4nOSLwSnp -``` - -Now you can issue requests to Elasticsearch: - -```console -$ curl --header "Authorization: Bearer JsUe2Z3cXqa17UQqQ8qWGGf4nOSLwSnp" --insecure https://146.148.94.154/api/v1/proxy/namespaces/kube-system/services/elasticsearch-logging/ -{ - "status" : 200, - "name" : "Vance Astrovik", - "cluster_name" : "kubernetes-logging", - "version" : { - "number" : "1.5.2", - "build_hash" : "62ff9868b4c8a0c45860bebb259e21980778ab1c", - "build_timestamp" : "2015-04-27T09:21:06Z", - "build_snapshot" : false, - "lucene_version" : "4.10.4" - }, - "tagline" : "You Know, for Search" -} -``` - -Note that you need the trailing slash at the end of the service proxy URL. Here is an example of a search: - -```console -$ curl --header "Authorization: Bearer JsUe2Z3cXqa17UQqQ8qWGGf4nOSLwSnp" --insecure https://146.148.94.154/api/v1/proxy/namespaces/kube-system/services/elasticsearch-logging/_search?pretty=true -{ - "took" : 7, - "timed_out" : false, - "_shards" : { - "total" : 6, - "successful" : 6, - "failed" : 0 - }, - "hits" : { - "total" : 123711, - "max_score" : 1.0, - "hits" : [ { - "_index" : ".kibana", - "_type" : "config", - "_id" : "4.0.2", - "_score" : 1.0, - "_source":{"buildNum":6004,"defaultIndex":"logstash-*"} - }, { -... - "_index" : "logstash-2015.06.22", - "_type" : "fluentd", - "_id" : "AU4c_GvFZL5p_gZ8dxtx", - "_score" : 1.0, - "_source":{"log":"synthetic-logger-10lps-pod: 31: 2015-06-22 20:35:33.597918073+00:00\n","stream":"stdout","tag":"kubernetes.synthetic-logger-10lps-pod_default_synth-lgr","@timestamp":"2015-06-22T20:35:33+00:00"} - }, { - "_index" : "logstash-2015.06.22", - "_type" : "fluentd", - "_id" : "AU4c_GvFZL5p_gZ8dxt2", - "_score" : 1.0, - "_source":{"log":"synthetic-logger-10lps-pod: 36: 2015-06-22 20:35:34.108780133+00:00\n","stream":"stdout","tag":"kubernetes.synthetic-logger-10lps-pod_default_synth-lgr","@timestamp":"2015-06-22T20:35:34+00:00"} - } ] - } -} -``` - -The Elasticsearch website contains information about [URI search queries](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-uri-request.html) which can be used to extract the required logs. - -Alternatively you can view the ingested logs using Kibana. The first time you visit the Kibana URL you will be -presented with a page that asks you to configure your view of the ingested logs. Select the option for -timeseries values and select `@timestamp`. On the following page select the `Discover` tab and then you -should be able to see the ingested logs. You can set the refresh interval to 5 seconds to have the logs -regulary refreshed. Here is a typical view of ingested logs from the Kibana viewer. - -![Kibana logs](kibana-logs.png) - -Another way to access Elasticsearch and Kibana in the cluster is to use `kubectl proxy` which will serve -a local proxy to the remote master: - -```console -$ kubectl proxy -Starting to serve on localhost:8001 -``` - -Now you can visit the URL [http://localhost:8001/api/v1/proxy/namespaces/kube-system/services/elasticsearch-logging](http://localhost:8001/api/v1/proxy/namespaces/kube-system/services/elasticsearch-logging) to contact Elasticsearch and [http://localhost:8001/api/v1/proxy/namespaces/kube-system/services/kibana-logging](http://localhost:8001/api/v1/proxy/namespaces/kube-system/services/kibana-logging) to access the Kibana viewer. - - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/getting-started-guides/logging-elasticsearch.md?pixel)]() - diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/logging.md b/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/logging.md deleted file mode 100644 index 646b741bdca6..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/logging.md +++ /dev/null @@ -1,253 +0,0 @@ - - - - -WARNING -WARNING -WARNING -WARNING -WARNING - -

    PLEASE NOTE: This document applies to the HEAD of the source tree

    - -If you are using a released version of Kubernetes, you should -refer to the docs that go with that version. - - -The latest 1.0.x release of this document can be found -[here](http://releases.k8s.io/release-1.0/docs/getting-started-guides/logging.md). - -Documentation for other releases can be found at -[releases.k8s.io](http://releases.k8s.io). - --- - - - - - -# Cluster Level Logging to Google Cloud Logging - -A Kubernetes cluster will typically be humming along running many system and application pods. How does the system administrator collect, manage and query the logs of the system pods? How does a user query the logs of their application which is composed of many pods which may be restarted or automatically generated by the Kubernetes system? These questions are addressed by the Kubernetes **cluster level logging** services. - -Cluster level logging for Kubernetes allows us to collect logs which persist beyond the lifetime of the pod’s container images or the lifetime of the pod or even cluster. In this article we assume that a Kubernetes cluster has been created with cluster level logging support for sending logs to Google Cloud Logging. After a cluster has been created you will have a collection of system pods running in the `kube-system` namespace that support monitoring, -logging and DNS resolution for names of Kubernetes services: - -```console -$ kubectl get pods --namespace=kube-system -NAME READY REASON RESTARTS AGE -fluentd-cloud-logging-kubernetes-minion-0f64 1/1 Running 0 32m -fluentd-cloud-logging-kubernetes-minion-27gf 1/1 Running 0 32m -fluentd-cloud-logging-kubernetes-minion-pk22 1/1 Running 0 31m -fluentd-cloud-logging-kubernetes-minion-20ej 1/1 Running 0 31m -kube-dns-v3-pk22 3/3 Running 0 32m -monitoring-heapster-v1-20ej 0/1 Running 9 32m -``` - -Here is the same information in a picture which shows how the pods might be placed on specific nodes. - -![Cluster](../../examples/blog-logging/diagrams/cloud-logging.png) - -This diagram shows four nodes created on a Google Compute Engine cluster with the name of each VM node on a purple background. The internal and public IPs of each node are shown on gray boxes and the pods running in each node are shown in green boxes. Each pod box shows the name of the pod and the namespace it runs in, the IP address of the pod and the images which are run as part of the pod’s execution. Here we see that every node is running a fluentd-cloud-logging pod which is collecting the log output of the containers running on the same node and sending them to Google Cloud Logging. A pod which provides the -[cluster DNS service](../admin/dns.md) runs on one of the nodes and a pod which provides monitoring support runs on another node. - -To help explain how cluster level logging works let’s start off with a synthetic log generator pod specification [counter-pod.yaml](../../examples/blog-logging/counter-pod.yaml): - - - -```yaml -apiVersion: v1 -kind: Pod -metadata: - name: counter -spec: - containers: - - name: count - image: ubuntu:14.04 - args: [bash, -c, - 'for ((i = 0; ; i++)); do echo "$i: $(date)"; sleep 1; done'] -``` - -[Download example](../../examples/blog-logging/counter-pod.yaml) - - -This pod specification has one container which runs a bash script when the container is born. This script simply writes out the value of a counter and the date once per second and runs indefinitely. Let’s create the pod in the default -namespace. - -```console - $ kubectl create -f examples/blog-logging/counter-pod.yaml - pods/counter -``` - -We can observe the running pod: - -```console -$ kubectl get pods -NAME READY STATUS RESTARTS AGE -counter 1/1 Running 0 5m -``` - -This step may take a few minutes to download the ubuntu:14.04 image during which the pod status will be shown as `Pending`. - -One of the nodes is now running the counter pod: - -![Counter Pod](../../examples/blog-logging/diagrams/27gf-counter.png) - -When the pod status changes to `Running` we can use the kubectl logs command to view the output of this counter pod. - -```console -$ kubectl logs counter -0: Tue Jun 2 21:37:31 UTC 2015 -1: Tue Jun 2 21:37:32 UTC 2015 -2: Tue Jun 2 21:37:33 UTC 2015 -3: Tue Jun 2 21:37:34 UTC 2015 -4: Tue Jun 2 21:37:35 UTC 2015 -5: Tue Jun 2 21:37:36 UTC 2015 -... -``` - -This command fetches the log text from the Docker log file for the image that is running in this container. We can connect to the running container and observe the running counter bash script. - -```console -$ kubectl exec -i counter bash -ps aux -USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND -root 1 0.0 0.0 17976 2888 ? Ss 00:02 0:00 bash -c for ((i = 0; ; i++)); do echo "$i: $(date)"; sleep 1; done -root 468 0.0 0.0 17968 2904 ? Ss 00:05 0:00 bash -root 479 0.0 0.0 4348 812 ? S 00:05 0:00 sleep 1 -root 480 0.0 0.0 15572 2212 ? R 00:05 0:00 ps aux -``` - -What happens if for any reason the image in this pod is killed off and then restarted by Kubernetes? Will we still see the log lines from the previous invocation of the container followed by the log lines for the started container? Or will we lose the log lines from the original container’s execution and only see the log lines for the new container? Let’s find out. First let’s stop the currently running counter. - -```console -$ kubectl stop pod counter -pods/counter -``` - -Now let’s restart the counter. - -```console -$ kubectl create -f examples/blog-logging/counter-pod.yaml -pods/counter -``` - -Let’s wait for the container to restart and get the log lines again. - -```console -$ kubectl logs counter -0: Tue Jun 2 21:51:40 UTC 2015 -1: Tue Jun 2 21:51:41 UTC 2015 -2: Tue Jun 2 21:51:42 UTC 2015 -3: Tue Jun 2 21:51:43 UTC 2015 -4: Tue Jun 2 21:51:44 UTC 2015 -5: Tue Jun 2 21:51:45 UTC 2015 -6: Tue Jun 2 21:51:46 UTC 2015 -7: Tue Jun 2 21:51:47 UTC 2015 -8: Tue Jun 2 21:51:48 UTC 2015 -``` - -We’ve lost the log lines from the first invocation of the container in this pod! Ideally, we want to preserve all the log lines from each invocation of each container in the pod. Furthermore, even if the pod is restarted we would still like to preserve all the log lines that were ever emitted by the containers in the pod. But don’t fear, this is the functionality provided by cluster level logging in Kubernetes. When a cluster is created, the standard output and standard error output of each container can be ingested using a [Fluentd](http://www.fluentd.org/) agent running on each node into either [Google Cloud Logging](https://cloud.google.com/logging/docs/) or into Elasticsearch and viewed with Kibana. - -When a Kubernetes cluster is created with logging to Google Cloud Logging enabled, the system creates a pod called `fluentd-cloud-logging` on each node of the cluster to collect Docker container logs. These pods were shown at the start of this blog article in the response to the first get pods command. - -This log collection pod has a specification which looks something like this: - - - -```yaml -apiVersion: v1 -kind: Pod -metadata: - name: fluentd-cloud-logging - namespace: kube-system -spec: - containers: - - name: fluentd-cloud-logging - image: gcr.io/google_containers/fluentd-gcp:1.10 - resources: - limits: - cpu: 100m - memory: 200Mi - env: - - name: FLUENTD_ARGS - value: -qq - volumeMounts: - - name: varlog - mountPath: /varlog - - name: containers - mountPath: /var/lib/docker/containers - volumes: - - name: varlog - hostPath: - path: /var/log - - name: containers - hostPath: - path: /var/lib/docker/containers -``` - -[Download example](../../cluster/saltbase/salt/fluentd-gcp/fluentd-gcp.yaml) - - -This pod specification maps the directory on the host containing the Docker log files, `/var/lib/docker/containers`, to a directory inside the container which has the same path. The pod runs one image, `gcr.io/google_containers/fluentd-gcp:1.6`, which is configured to collect the Docker log files from the logs directory and ingest them into Google Cloud Logging. One instance of this pod runs on each node of the cluster. Kubernetes will notice if this pod fails and automatically restart it. - -We can click on the Logs item under the Monitoring section of the Google Developer Console and select the logs for the counter container, which will be called kubernetes.counter_default_count. This identifies the name of the pod (counter), the namespace (default) and the name of the container (count) for which the log collection occurred. Using this name we can select just the logs for our counter container from the drop down menu: - -![Cloud Logging Console](cloud-logging-console.png) - -When we view the logs in the Developer Console we observe the logs for both invocations of the container. - -![Both Logs](all-lines.png) - -Note the first container counted to 108 and then it was terminated. When the next container image restarted the counting process resumed from 0. Similarly if we deleted the pod and restarted it we would capture the logs for all instances of the containers in the pod whenever the pod was running. - - Logs ingested into Google Cloud Logging may be exported to various other destinations including [Google Cloud Storage](https://cloud.google.com/storage/) buckets and [BigQuery](https://cloud.google.com/bigquery/). Use the Exports tab in the Cloud Logging console to specify where logs should be streamed to. You can also follow this link to the - [settings tab](https://pantheon.corp.google.com/project/_/logs/settings). - - We could query the ingested logs from BigQuery using the SQL query which reports the counter log lines showing the newest lines first: - - ```console - SELECT metadata.timestamp, structPayload.log - FROM [mylogs.kubernetes_counter_default_count_20150611] - ORDER BY metadata.timestamp DESC - ``` - -Here is some sample output: - -![BigQuery](bigquery-logging.png) - -We could also fetch the logs from Google Cloud Storage buckets to our desktop or laptop and then search them locally. The following command fetches logs for the counter pod running in a cluster which is itself in a Compute Engine project called `myproject`. Only logs for the date 2015-06-11 are fetched. - - -```console -$ gsutil -m cp -r gs://myproject/kubernetes.counter_default_count/2015/06/11 . -``` - -Now we can run queries over the ingested logs. The example below uses the [jq](http://stedolan.github.io/jq/) program to extract just the log lines. - -```console -$ cat 21\:00\:00_21\:59\:59_S0.json | jq '.structPayload.log' -"0: Thu Jun 11 21:39:38 UTC 2015\n" -"1: Thu Jun 11 21:39:39 UTC 2015\n" -"2: Thu Jun 11 21:39:40 UTC 2015\n" -"3: Thu Jun 11 21:39:41 UTC 2015\n" -"4: Thu Jun 11 21:39:42 UTC 2015\n" -"5: Thu Jun 11 21:39:43 UTC 2015\n" -"6: Thu Jun 11 21:39:44 UTC 2015\n" -"7: Thu Jun 11 21:39:45 UTC 2015\n" -... -``` - -This page has touched briefly on the underlying mechanisms that support gathering cluster level logs on a Kubernetes deployment. The approach here only works for gathering the standard output and standard error output of the processes running in the pod’s containers. To gather other logs that are stored in files one can use a sidecar container to gather the required files as described at the page [Collecting log files within containers with Fluentd](http://releases.k8s.io/HEAD/contrib/logging/fluentd-sidecar-gcp/README.md) and sending them to the Google Cloud Logging service. - -Some of the material in this section also appears in the blog article [Cluster Level Logging with Kubernetes](http://blog.kubernetes.io/2015/06/cluster-level-logging-with-kubernetes.html). - - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/getting-started-guides/logging.md?pixel)]() - diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/mesos.md b/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/mesos.md deleted file mode 100644 index 4570472c7ade..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/mesos.md +++ /dev/null @@ -1,376 +0,0 @@ - - - - -WARNING -WARNING -WARNING -WARNING -WARNING - -

    PLEASE NOTE: This document applies to the HEAD of the source tree

    - -If you are using a released version of Kubernetes, you should -refer to the docs that go with that version. - - -The latest 1.0.x release of this document can be found -[here](http://releases.k8s.io/release-1.0/docs/getting-started-guides/mesos.md). - -Documentation for other releases can be found at -[releases.k8s.io](http://releases.k8s.io). - --- - - - - -Getting started with Kubernetes on Mesos ----------------------------------------- - -**Table of Contents** - -- [About Kubernetes on Mesos](#about-kubernetes-on-mesos) - - [Prerequisites](#prerequisites) - - [Deploy Kubernetes-Mesos](#deploy-kubernetes-mesos) - - [Deploy etcd](#deploy-etcd) - - [Start Kubernetes-Mesos Services](#start-kubernetes-mesos-services) - - [Validate KM Services](#validate-km-services) -- [Spin up a pod](#spin-up-a-pod) -- [Run the Example Guestbook App](#run-the-example-guestbook-app) - - [Test Guestbook App](#test-guestbook-app) - -## About Kubernetes on Mesos - - - -Mesos allows dynamic sharing of cluster resources between Kubernetes and other first-class Mesos frameworks such as [Hadoop][1], [Spark][2], and [Chronos][3]. -Mesos also ensures applications from different frameworks running on your cluster are isolated and that resources are allocated fairly among them. - -Mesos clusters can be deployed on nearly every IaaS cloud provider infrastructure or in your own physical datacenter. Kubernetes on Mesos runs on-top of that and therefore allows you to easily move Kubernetes workloads from one of these environments to the other. - -This tutorial will walk you through setting up Kubernetes on a Mesos cluster. -It provides a step by step walk through of adding Kubernetes to a Mesos cluster and starting your first pod with an nginx webserver. - -**NOTE:** There are [known issues with the current implementation][7] and support for centralized logging and monitoring is not yet available. -Please [file an issue against the kubernetes-mesos project][8] if you have problems completing the steps below. - -Further information is available in the Kubernetes on Mesos [contrib directory][13]. - -### Prerequisites - -* Understanding of [Apache Mesos][6] -* A running [Mesos cluster on Google Compute Engine][5] -* A [VPN connection][10] to the cluster -* A machine in the cluster which should become the Kubernetes *master node* with: - * GoLang > 1.2 - * make (i.e. build-essential) - * Docker - -**Note**: You *can*, but you *don't have to* deploy Kubernetes-Mesos on the same machine the Mesos master is running on. - -### Deploy Kubernetes-Mesos - -Log into the future Kubernetes *master node* over SSH, replacing the placeholder below with the correct IP address. - -```bash -ssh jclouds@${ip_address_of_master_node} -``` - -Build Kubernetes-Mesos. - -```bash -git clone https://k8s.io/kubernetes -cd kubernetes -export KUBERNETES_CONTRIB=mesos -make -``` - -Set some environment variables. -The internal IP address of the master may be obtained via `hostname -i`. - -```bash -export KUBERNETES_MASTER_IP=$(hostname -i) -export KUBERNETES_MASTER=http://${KUBERNETES_MASTER_IP}:8888 -``` - -### Deploy etcd - -Start etcd and verify that it is running: - -```bash -sudo docker run -d --hostname $(uname -n) --name etcd \ - -p 4001:4001 -p 7001:7001 quay.io/coreos/etcd:v2.0.12 \ - --listen-client-urls http://0.0.0.0:4001 \ - --advertise-client-urls http://${KUBERNETES_MASTER_IP}:4001 -``` - -```console -$ sudo docker ps -CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES -fd7bac9e2301 quay.io/coreos/etcd:v2.0.12 "/etcd" 5s ago Up 3s 2379/tcp, 2380/... etcd -``` - -It's also a good idea to ensure your etcd instance is reachable by testing it - -```bash -curl -L http://${KUBERNETES_MASTER_IP}:4001/v2/keys/ -``` - -If connectivity is OK, you will see an output of the available keys in etcd (if any). - -### Start Kubernetes-Mesos Services - -Update your PATH to more easily run the Kubernetes-Mesos binaries: - -```bash -export PATH="$(pwd)/_output/local/go/bin:$PATH" -``` - -Identify your Mesos master: depending on your Mesos installation this is either a `host:port` like `mesos_master:5050` or a ZooKeeper URL like `zk://zookeeper:2181/mesos`. -In order to let Kubernetes survive Mesos master changes, the ZooKeeper URL is recommended for production environments. - -```bash -export MESOS_MASTER= -``` - -Create a cloud config file `mesos-cloud.conf` in the current directory with the following contents: - -```console -$ cat <mesos-cloud.conf -[mesos-cloud] - mesos-master = ${MESOS_MASTER} -EOF -``` - -Now start the kubernetes-mesos API server, controller manager, and scheduler on the master node: - -```console -$ km apiserver \ - --address=${KUBERNETES_MASTER_IP} \ - --etcd-servers=http://${KUBERNETES_MASTER_IP}:4001 \ - --service-cluster-ip-range=10.10.10.0/24 \ - --port=8888 \ - --cloud-provider=mesos \ - --cloud-config=mesos-cloud.conf \ - --v=1 >apiserver.log 2>&1 & - -$ km controller-manager \ - --master=${KUBERNETES_MASTER_IP}:8888 \ - --cloud-provider=mesos \ - --cloud-config=./mesos-cloud.conf \ - --v=1 >controller.log 2>&1 & - -$ km scheduler \ - --address=${KUBERNETES_MASTER_IP} \ - --mesos-master=${MESOS_MASTER} \ - --etcd-servers=http://${KUBERNETES_MASTER_IP}:4001 \ - --mesos-user=root \ - --api-servers=${KUBERNETES_MASTER_IP}:8888 \ - --cluster-dns=10.10.10.10 \ - --cluster-domain=cluster.local \ - --v=2 >scheduler.log 2>&1 & -``` - -Disown your background jobs so that they'll stay running if you log out. - -```bash -disown -a -``` - -#### Validate KM Services - -Add the appropriate binary folder to your `PATH` to access kubectl: - -```bash -export PATH=/platforms/linux/amd64:$PATH -``` - -Interact with the kubernetes-mesos framework via `kubectl`: - -```console -$ kubectl get pods -NAME READY STATUS RESTARTS AGE -``` - -```console -# NOTE: your service IPs will likely differ -$ kubectl get services -NAME LABELS SELECTOR IP(S) PORT(S) -k8sm-scheduler component=scheduler,provider=k8sm 10.10.10.113 10251/TCP -kubernetes component=apiserver,provider=kubernetes 10.10.10.1 443/TCP -``` - -Lastly, look for Kubernetes in the Mesos web GUI by pointing your browser to -`http://`. Make sure you have an active VPN connection. -Go to the Frameworks tab, and look for an active framework named "Kubernetes". - -## Spin up a pod - -Write a JSON pod description to a local file: - -```bash -$ cat <nginx.yaml -``` - -```yaml -apiVersion: v1 -kind: Pod -metadata: - name: nginx -spec: - containers: - - name: nginx - image: nginx - ports: - - containerPort: 80 -EOPOD -``` - -Send the pod description to Kubernetes using the `kubectl` CLI: - -```console -$ kubectl create -f ./nginx.yaml -pods/nginx -``` - -Wait a minute or two while `dockerd` downloads the image layers from the internet. -We can use the `kubectl` interface to monitor the status of our pod: - -```console -$ kubectl get pods -NAME READY STATUS RESTARTS AGE -nginx 1/1 Running 0 14s -``` - -Verify that the pod task is running in the Mesos web GUI. Click on the -Kubernetes framework. The next screen should show the running Mesos task that -started the Kubernetes pod. - -## Launching kube-dns - -Kube-dns is an addon for Kubernetes which adds DNS-based service discovery to the cluster. For a detailed explanation see [DNS in Kubernetes][4]. - -The kube-dns addon runs as a pod inside the cluster. The pod consists of three co-located containers: -- a local etcd instance -- the [skydns][11] DNS server -- the kube2sky process to glue skydns to the state of the Kubernetes cluster. - -The skydns container offers DNS service via port 53 to the cluster. The etcd communication works via local 127.0.0.1 communication - -We assume that kube-dns will use -- the service IP `10.10.10.10` -- and the `cluster.local` domain. - -Note that we have passed these two values already as parameter to the apiserver above. - -A template for an replication controller spinning up the pod with the 3 containers can be found at [cluster/addons/dns/skydns-rc.yaml.in][11] in the repository. The following steps are necessary in order to get a valid replication controller yaml file: - -- replace `{{ pillar['dns_replicas'] }}` with `1` -- replace `{{ pillar['dns_domain'] }}` with `cluster.local.` -- add `--kube_master_url=${KUBERNETES_MASTER}` parameter to the kube2sky container command. - -In addition the service template at [cluster/addons/dns/skydns-svc.yaml.in][12] needs the following replacement: - -- `{{ pillar['dns_server'] }}` with `10.10.10.10`. - -To do this automatically: - -```bash -sed -e "s/{{ pillar\['dns_replicas'\] }}/1/g;"\ -"s,\(command = \"/kube2sky\"\),\\1\\"$'\n'" - --kube_master_url=${KUBERNETES_MASTER},;"\ -"s/{{ pillar\['dns_domain'\] }}/cluster.local/g" \ - cluster/addons/dns/skydns-rc.yaml.in > skydns-rc.yaml -sed -e "s/{{ pillar\['dns_server'\] }}/10.10.10.10/g" \ - cluster/addons/dns/skydns-svc.yaml.in > skydns-svc.yaml -``` - -Now the kube-dns pod and service are ready to be launched: - -```bash -kubectl create -f ./skydns-rc.yaml -kubectl create -f ./skydns-svc.yaml -``` - -Check with `kubectl get pods --namespace=kube-system` that 3/3 containers of the pods are eventually up and running. Note that the kube-dns pods run in the `kube-system` namespace, not in `default`. - -To check that the new DNS service in the cluster works, we start a busybox pod and use that to do a DNS lookup. First create the `busybox.yaml` pod spec: - -```bash -cat <busybox.yaml -``` - -```yaml -apiVersion: v1 -kind: Pod -metadata: - name: busybox - namespace: default -spec: - containers: - - image: busybox - command: - - sleep - - "3600" - imagePullPolicy: IfNotPresent - name: busybox - restartPolicy: Always -EOF -``` - -Then start the pod: - -```bash -kubectl create -f ./busybox.yaml -``` - -When the pod is up and running, start a lookup for the Kubernetes master service, made available on 10.10.10.1 by default: - -```bash -kubectl exec busybox -- nslookup kubernetes -``` - -If everything works fine, you will get this output: - -```console -Server: 10.10.10.10 -Address 1: 10.10.10.10 - -Name: kubernetes -Address 1: 10.10.10.1 -``` - -## What next? - -Try out some of the standard [Kubernetes examples][9]. - -Read about Kubernetes on Mesos' architecture in the [contrib directory][13]. - -**NOTE:** Some examples require Kubernetes DNS to be installed on the cluster. -Future work will add instructions to this guide to enable support for Kubernetes DNS. - -**NOTE:** Please be aware that there are [known issues with the current Kubernetes-Mesos implementation][7]. - -[1]: http://mesosphere.com/docs/tutorials/run-hadoop-on-mesos-using-installer -[2]: http://mesosphere.com/docs/tutorials/run-spark-on-mesos -[3]: http://mesosphere.com/docs/tutorials/run-chronos-on-mesos -[4]: ../../cluster/addons/dns/README.md -[5]: http://open.mesosphere.com/getting-started/cloud/google/mesosphere/ -[6]: http://mesos.apache.org/ -[7]: ../../contrib/mesos/docs/issues.md -[8]: https://github.com/mesosphere/kubernetes-mesos/issues -[9]: ../../examples/ -[10]: http://open.mesosphere.com/getting-started/cloud/google/mesosphere/#vpn-setup -[11]: ../../cluster/addons/dns/skydns-rc.yaml.in -[12]: ../../cluster/addons/dns/skydns-svc.yaml.in -[13]: ../../contrib/mesos/README.md - - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/getting-started-guides/mesos.md?pixel)]() - diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/mesos/k8s-firewall.png b/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/mesos/k8s-firewall.png deleted file mode 100755 index ed1c57ca7d09..000000000000 Binary files a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/mesos/k8s-firewall.png and /dev/null differ diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/mesos/k8s-guestbook.png b/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/mesos/k8s-guestbook.png deleted file mode 100755 index 07d2458b3b54..000000000000 Binary files a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/mesos/k8s-guestbook.png and /dev/null differ diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/ovirt.md b/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/ovirt.md deleted file mode 100644 index 2f002a26e3e4..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/ovirt.md +++ /dev/null @@ -1,91 +0,0 @@ - - - - -WARNING -WARNING -WARNING -WARNING -WARNING - -

    PLEASE NOTE: This document applies to the HEAD of the source tree

    - -If you are using a released version of Kubernetes, you should -refer to the docs that go with that version. - - -The latest 1.0.x release of this document can be found -[here](http://releases.k8s.io/release-1.0/docs/getting-started-guides/ovirt.md). - -Documentation for other releases can be found at -[releases.k8s.io](http://releases.k8s.io). - --- - - - - -Getting started on oVirt ------------------------- - -**Table of Contents** - -- [What is oVirt](#what-is-ovirt) -- [oVirt Cloud Provider Deployment](#ovirt-cloud-provider-deployment) -- [Using the oVirt Cloud Provider](#using-the-ovirt-cloud-provider) -- [oVirt Cloud Provider Screencast](#ovirt-cloud-provider-screencast) - -## What is oVirt - -oVirt is a virtual datacenter manager that delivers powerful management of multiple virtual machines on multiple hosts. Using KVM and libvirt, oVirt can be installed on Fedora, CentOS, or Red Hat Enterprise Linux hosts to set up and manage your virtual data center. - -## oVirt Cloud Provider Deployment - -The oVirt cloud provider allows to easily discover and automatically add new VM instances as nodes to your Kubernetes cluster. -At the moment there are no community-supported or pre-loaded VM images including Kubernetes but it is possible to [import] or [install] Project Atomic (or Fedora) in a VM to [generate a template]. Any other distribution that includes Kubernetes may work as well. - -It is mandatory to [install the ovirt-guest-agent] in the guests for the VM ip address and hostname to be reported to ovirt-engine and ultimately to Kubernetes. - -Once the Kubernetes template is available it is possible to start instantiating VMs that can be discovered by the cloud provider. - -[import]: http://ovedou.blogspot.it/2014/03/importing-glance-images-as-ovirt.html -[install]: http://www.ovirt.org/Quick_Start_Guide#Create_Virtual_Machines -[generate a template]: http://www.ovirt.org/Quick_Start_Guide#Using_Templates -[install the ovirt-guest-agent]: http://www.ovirt.org/How_to_install_the_guest_agent_in_Fedora - -## Using the oVirt Cloud Provider - -The oVirt Cloud Provider requires access to the oVirt REST-API to gather the proper information, the required credential should be specified in the `ovirt-cloud.conf` file: - - [connection] - uri = https://localhost:8443/ovirt-engine/api - username = admin@internal - password = admin - -In the same file it is possible to specify (using the `filters` section) what search query to use to identify the VMs to be reported to Kubernetes: - - [filters] - # Search query used to find nodes - vms = tag=kubernetes - -In the above example all the VMs tagged with the `kubernetes` label will be reported as nodes to Kubernetes. - -The `ovirt-cloud.conf` file then must be specified in kube-controller-manager: - - kube-controller-manager ... --cloud-provider=ovirt --cloud-config=/path/to/ovirt-cloud.conf ... - -## oVirt Cloud Provider Screencast - -This short screencast demonstrates how the oVirt Cloud Provider can be used to dynamically add VMs to your Kubernetes cluster. - -[![Screencast](http://img.youtube.com/vi/JyyST4ZKne8/0.jpg)](http://www.youtube.com/watch?v=JyyST4ZKne8) - - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/getting-started-guides/ovirt.md?pixel)]() - diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/rackspace.md b/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/rackspace.md deleted file mode 100644 index 97738e7506be..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/rackspace.md +++ /dev/null @@ -1,107 +0,0 @@ - - - - -WARNING -WARNING -WARNING -WARNING -WARNING - -

    PLEASE NOTE: This document applies to the HEAD of the source tree

    - -If you are using a released version of Kubernetes, you should -refer to the docs that go with that version. - - -The latest 1.0.x release of this document can be found -[here](http://releases.k8s.io/release-1.0/docs/getting-started-guides/rackspace.md). - -Documentation for other releases can be found at -[releases.k8s.io](http://releases.k8s.io). - --- - - - - -Getting started on Rackspace ----------------------------- - -**Table of Contents** - -- [Introduction](#introduction) -- [Prerequisites](#prerequisites) -- [Provider: Rackspace](#provider-rackspace) -- [Build](#build) -- [Cluster](#cluster) -- [Some notes:](#some-notes) -- [Network Design](#network-design) - -## Introduction - -* Supported Version: v0.18.1 - -In general, the dev-build-and-up.sh workflow for Rackspace is the similar to Google Compute Engine. The specific implementation is different due to the use of CoreOS, Rackspace Cloud Files and the overall network design. - -These scripts should be used to deploy development environments for Kubernetes. If your account leverages RackConnect or non-standard networking, these scripts will most likely not work without modification. - -NOTE: The rackspace scripts do NOT rely on `saltstack` and instead rely on cloud-init for configuration. - -The current cluster design is inspired by: -- [corekube](https://github.com/metral/corekube) -- [Angus Lees](https://github.com/anguslees/kube-openstack) - -## Prerequisites - -1. Python2.7 -2. You need to have both `nova` and `swiftly` installed. It's recommended to use a python virtualenv to install these packages into. -3. Make sure you have the appropriate environment variables set to interact with the OpenStack APIs. See [Rackspace Documentation](http://docs.rackspace.com/servers/api/v2/cs-gettingstarted/content/section_gs_install_nova.html) for more details. - -## Provider: Rackspace - -- To build your own released version from source use `export KUBERNETES_PROVIDER=rackspace` and run the `bash hack/dev-build-and-up.sh` -- Note: The get.k8s.io install method is not working yet for our scripts. - * To install the latest released version of Kubernetes use `export KUBERNETES_PROVIDER=rackspace; wget -q -O - https://get.k8s.io | bash` - -## Build - -1. The Kubernetes binaries will be built via the common build scripts in `build/`. -2. If you've set the ENV `KUBERNETES_PROVIDER=rackspace`, the scripts will upload `kubernetes-server-linux-amd64.tar.gz` to Cloud Files. -2. A cloud files container will be created via the `swiftly` CLI and a temp URL will be enabled on the object. -3. The built `kubernetes-server-linux-amd64.tar.gz` will be uploaded to this container and the URL will be passed to master/nodes when booted. - -## Cluster - -There is a specific `cluster/rackspace` directory with the scripts for the following steps: -1. A cloud network will be created and all instances will be attached to this network. - - flanneld uses this network for next hop routing. These routes allow the containers running on each node to communicate with one another on this private network. -2. A SSH key will be created and uploaded if needed. This key must be used to ssh into the machines (we do not capture the password). -3. The master server and additional nodes will be created via the `nova` CLI. A `cloud-config.yaml` is generated and provided as user-data with the entire configuration for the systems. -4. We then boot as many nodes as defined via `$NUM_MINIONS`. - -## Some notes - -- The scripts expect `eth2` to be the cloud network that the containers will communicate across. -- A number of the items in `config-default.sh` are overridable via environment variables. -- For older versions please either: - * Sync back to `v0.9` with `git checkout v0.9` - * Download a [snapshot of `v0.9`](https://k8s.io/kubernetes/archive/v0.9.tar.gz) - * Sync back to `v0.3` with `git checkout v0.3` - * Download a [snapshot of `v0.3`](https://k8s.io/kubernetes/archive/v0.3.tar.gz) - -## Network Design - -- eth0 - Public Interface used for servers/containers to reach the internet -- eth1 - ServiceNet - Intra-cluster communication (k8s, etcd, etc) communicate via this interface. The `cloud-config` files use the special CoreOS identifier `$private_ipv4` to configure the services. -- eth2 - Cloud Network - Used for k8s pods to communicate with one another. The proxy service will pass traffic via this interface. - - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/getting-started-guides/rackspace.md?pixel)]() - diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/rkt/README.md b/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/rkt/README.md deleted file mode 100644 index a0af511721bc..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/rkt/README.md +++ /dev/null @@ -1,139 +0,0 @@ - - - - -WARNING -WARNING -WARNING -WARNING -WARNING - -

    PLEASE NOTE: This document applies to the HEAD of the source tree

    - -If you are using a released version of Kubernetes, you should -refer to the docs that go with that version. - - -The latest 1.0.x release of this document can be found -[here](http://releases.k8s.io/release-1.0/docs/getting-started-guides/rkt/README.md). - -Documentation for other releases can be found at -[releases.k8s.io](http://releases.k8s.io). - --- - - - - - -# Run Kubernetes with rkt - -This document describes how to run Kubernetes using [rkt](https://github.com/coreos/rkt) as a container runtime. -We still have [a bunch of work](https://k8s.io/kubernetes/issues/8262) to do to make the experience with rkt wonderful, please stay tuned! - -### **Prerequisite** - -- [systemd](http://www.freedesktop.org/wiki/Software/systemd/) should be installed on your machine and should be enabled. The minimum version required at this moment (2015/05/28) is [215](http://lists.freedesktop.org/archives/systemd-devel/2014-July/020903.html). - *(Note that systemd is not required by rkt itself, we are using it here to monitor and manage the pods launched by kubelet.)* - -- Install the latest rkt release according to the instructions [here](https://github.com/coreos/rkt). - The minimum version required for now is [v0.5.6](https://github.com/coreos/rkt/releases/tag/v0.5.6). - -- Make sure the `rkt metadata service` is running because it is necessary for running pod in private network mode. - More details about the networking of rkt can be found in the [documentation](https://github.com/coreos/rkt/blob/master/Documentation/networking.md). - - To start the `rkt metadata service`, you can simply run: - - ```console - $ sudo rkt metadata-service - ``` - - If you want the service to be running as a systemd service, then: - - ```console - $ sudo systemd-run rkt metadata-service - ``` - - Alternatively, you can use the [rkt-metadata.service](https://github.com/coreos/rkt/blob/master/dist/init/systemd/rkt-metadata.service) and [rkt-metadata.socket](https://github.com/coreos/rkt/blob/master/dist/init/systemd/rkt-metadata.socket) to start the service. - - -### Local cluster - -To use rkt as the container runtime, you just need to set the environment variable `CONTAINER_RUNTIME`: - -```console -$ export CONTAINER_RUNTIME=rkt -$ hack/local-up-cluster.sh -``` - -### CoreOS cluster on Google Compute Engine (GCE) - -To use rkt as the container runtime for your CoreOS cluster on GCE, you need to specify the OS distribution, project, image: - -```console -$ export KUBE_OS_DISTRIBUTION=coreos -$ export KUBE_GCE_MINION_IMAGE= -$ export KUBE_GCE_MINION_PROJECT=coreos-cloud -$ export KUBE_CONTAINER_RUNTIME=rkt -``` - -You can optionally choose the version of rkt used by setting `KUBE_RKT_VERSION`: - -```console -$ export KUBE_RKT_VERSION=0.5.6 -``` - -Then you can launch the cluster by: - -```console -$ kube-up.sh -``` - -Note that we are still working on making all containerized the master components run smoothly in rkt. Before that we are not able to run the master node with rkt yet. - -### CoreOS cluster on AWS - -To use rkt as the container runtime for your CoreOS cluster on AWS, you need to specify the provider and OS distribution: - -```console -$ export KUBERNETES_PROVIDER=aws -$ export KUBE_OS_DISTRIBUTION=coreos -$ export KUBE_CONTAINER_RUNTIME=rkt -``` - -You can optionally choose the version of rkt used by setting `KUBE_RKT_VERSION`: - -```console -$ export KUBE_RKT_VERSION=0.5.6 -``` - -You can optionally choose the CoreOS channel by setting `COREOS_CHANNEL`: - -```console -$ export COREOS_CHANNEL=stable -``` - -Then you can launch the cluster by: - -```console -$ kube-up.sh -``` - -Note: CoreOS is not supported as the master using the automated launch -scripts. The master node is always Ubuntu. - -### Getting started with your cluster - -See [a simple nginx example](../../../docs/user-guide/simple-nginx.md) to try out your new cluster. - -For more complete applications, please look in the [examples directory](../../../examples/). - - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/getting-started-guides/rkt/README.md?pixel)]() - diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/scratch.md b/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/scratch.md deleted file mode 100644 index 60b403a4edae..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/scratch.md +++ /dev/null @@ -1,872 +0,0 @@ - - - - -WARNING -WARNING -WARNING -WARNING -WARNING - -

    PLEASE NOTE: This document applies to the HEAD of the source tree

    - -If you are using a released version of Kubernetes, you should -refer to the docs that go with that version. - - -The latest 1.0.x release of this document can be found -[here](http://releases.k8s.io/release-1.0/docs/getting-started-guides/scratch.md). - -Documentation for other releases can be found at -[releases.k8s.io](http://releases.k8s.io). - --- - - - - -Getting started from Scratch ----------------------------- - -This guide is for people who want to craft a custom Kubernetes cluster. If you -can find an existing Getting Started Guide that meets your needs on [this -list](README.md), then we recommend using it, as you will be able to benefit -from the experience of others. However, if you have specific IaaS, networking, -configuration management, or operating system requirements not met by any of -those guides, then this guide will provide an outline of the steps you need to -take. Note that it requires considerably more effort than using one of the -pre-defined guides. - -This guide is also useful for those wanting to understand at a high level some of the -steps that existing cluster setup scripts are making. - -**Table of Contents** - - - - - [Designing and Preparing](#designing-and-preparing) - - [Learning](#learning) - - [Cloud Provider](#cloud-provider) - - [Nodes](#nodes) - - [Network](#network) - - [Cluster Naming](#cluster-naming) - - [Software Binaries](#software-binaries) - - [Downloading and Extracting Kubernetes Binaries](#downloading-and-extracting-kubernetes-binaries) - - [Selecting Images](#selecting-images) - - [Security Models](#security-models) - - [Preparing Certs](#preparing-certs) - - [Preparing Credentials](#preparing-credentials) - - [Configuring and Installing Base Software on Nodes](#configuring-and-installing-base-software-on-nodes) - - [Docker](#docker) - - [rkt](#rkt) - - [kubelet](#kubelet) - - [kube-proxy](#kube-proxy) - - [Networking](#networking) - - [Other](#other) - - [Using Configuration Management](#using-configuration-management) - - [Bootstrapping the Cluster](#bootstrapping-the-cluster) - - [etcd](#etcd) - - [Apiserver, Controller Manager, and Scheduler](#apiserver-controller-manager-and-scheduler) - - [Apiserver pod template](#apiserver-pod-template) - - [Cloud Providers](#cloud-providers) - - [Scheduler pod template](#scheduler-pod-template) - - [Controller Manager Template](#controller-manager-template) - - [Starting and Verifying Apiserver, Scheduler, and Controller Manager](#starting-and-verifying-apiserver-scheduler-and-controller-manager) - - [Logging](#logging) - - [Monitoring](#monitoring) - - [DNS](#dns) - - [Troubleshooting](#troubleshooting) - - [Running validate-cluster](#running-validate-cluster) - - [Inspect pods and services](#inspect-pods-and-services) - - [Try Examples](#try-examples) - - [Running the Conformance Test](#running-the-conformance-test) - - [Networking](#networking) - - [Getting Help](#getting-help) - - - -## Designing and Preparing - -### Learning - - 1. You should be familiar with using Kubernetes already. We suggest you set - up a temporary cluster by following one of the other Getting Started Guides. - This will help you become familiar with the CLI ([kubectl](../user-guide/kubectl/kubectl.md)) and concepts ([pods](../user-guide/pods.md), [services](../user-guide/services.md), etc.) first. - 1. You should have `kubectl` installed on your desktop. This will happen as a side - effect of completing one of the other Getting Started Guides. If not, follow the instructions - [here](../user-guide/prereqs.md). - -### Cloud Provider - -Kubernetes has the concept of a Cloud Provider, which is a module which provides -an interface for managing TCP Load Balancers, Nodes (Instances) and Networking Routes. -The interface is defined in `pkg/cloudprovider/cloud.go`. It is possible to -create a custom cluster without implementing a cloud provider (for example if using -bare-metal), and not all parts of the interface need to be implemented, depending -on how flags are set on various components. - -### Nodes - -- You can use virtual or physical machines. -- While you can build a cluster with 1 machine, in order to run all the examples and tests you - need at least 4 nodes. -- Many Getting-started-guides make a distinction between the master node and regular nodes. This - is not strictly necessary. -- Nodes will need to run some version of Linux with the x86_64 architecture. It may be possible - to run on other OSes and Architectures, but this guide does not try to assist with that. -- Apiserver and etcd together are fine on a machine with 1 core and 1GB RAM for clusters with 10s of nodes. - Larger or more active clusters may benefit from more cores. -- Other nodes can have any reasonable amount of memory and any number of cores. They need not - have identical configurations. - -### Network - -Kubernetes has a distinctive [networking model](../admin/networking.md). - -Kubernetes allocates an IP address to each pod. When creating a cluster, you -need to allocate a block of IPs for Kubernetes to use as Pod IPs. The simplest -approach is to allocate a different block of IPs to each node in the cluster as -the node is added. A process in one pod should be able to communicate with -another pod using the IP of the second pod. This connectivity can be -accomplished in two ways: -- Configure network to route Pod IPs - - Harder to setup from scratch. - - Google Compute Engine ([GCE](gce.md)) and [AWS](aws.md) guides use this approach. - - Need to make the Pod IPs routable by programming routers, switches, etc. - - Can be configured external to Kubernetes, or can implement in the "Routes" interface of a Cloud Provider module. - - Generally highest performance. -- Create an Overlay network - - Easier to setup - - Traffic is encapsulated, so per-pod IPs are routable. - - Examples: - - [Flannel](https://github.com/coreos/flannel) - - [Weave](http://weave.works/) - - [Open vSwitch (OVS)](http://openvswitch.org/) - - Does not require "Routes" portion of Cloud Provider module. - - Reduced performance (exactly how much depends on your solution). - -You need to select an address range for the Pod IPs. -- Various approaches: - - GCE: each project has its own `10.0.0.0/8`. Carve off a `/16` for each - Kubernetes cluster from that space, which leaves room for several clusters. - Each node gets a further subdivision of this space. - - AWS: use one VPC for whole organization, carve off a chunk for each - cluster, or use different VPC for different clusters. - - IPv6 is not supported yet. -- Allocate one CIDR subnet for each node's PodIPs, or a single large CIDR - from which smaller CIDRs are automatically allocated to each node (if nodes - are dynamically added). - - You need max-pods-per-node * max-number-of-nodes IPs in total. A `/24` per - node supports 254 pods per machine and is a common choice. If IPs are - scarce, a `/26` (62 pods per machine) or even a `/27` (30 pods) may be sufficient. - - e.g. use `10.10.0.0/16` as the range for the cluster, with up to 256 nodes - using `10.10.0.0/24` through `10.10.255.0/24`, respectively. - - Need to make these routable or connect with overlay. - -Kubernetes also allocates an IP to each [service](../user-guide/services.md). However, -service IPs do not necessarily need to be routable. The kube-proxy takes care -of translating Service IPs to Pod IPs before traffic leaves the node. You do -need to Allocate a block of IPs for services. Call this -`SERVICE_CLUSTER_IP_RANGE`. For example, you could set -`SERVICE_CLUSTER_IP_RANGE="10.0.0.0/16"`, allowing 65534 distinct services to -be active at once. Note that you can grow the end of this range, but you -cannot move it without disrupting the services and pods that already use it. - -Also, you need to pick a static IP for master node. -- Call this `MASTER_IP`. -- Open any firewalls to allow access to the apiserver ports 80 and/or 443. -- Enable ipv4 forwarding sysctl, `net.ipv4.ip_forward = 1` - -### Cluster Naming - -You should pick a name for your cluster. Pick a short name for each cluster -which is unique from future cluster names. This will be used in several ways: - - by kubectl to distinguish between various clusters you have access to. You will probably want a - second one sometime later, such as for testing new Kubernetes releases, running in a different -region of the world, etc. - - Kubernetes clusters can create cloud provider resources (e.g. AWS ELBs) and different clusters - need to distinguish which resources each created. Call this `CLUSTERNAME`. - -### Software Binaries - -You will need binaries for: - - etcd - - A container runner, one of: - - docker - - rkt - - Kubernetes - - kubelet - - kube-proxy - - kube-apiserver - - kube-controller-manager - - kube-scheduler - -#### Downloading and Extracting Kubernetes Binaries - -A Kubernetes binary release includes all the Kubernetes binaries as well as the supported release of etcd. -You can use a Kubernetes binary release (recommended) or build your Kubernetes binaries following the instructions in the -[Developer Documentation](../devel/README.md). Only using a binary release is covered in this guide. - -Download the [latest binary release](https://k8s.io/kubernetes/releases/latest) and unzip it. -Then locate `./kubernetes/server/kubernetes-server-linux-amd64.tar.gz` and unzip *that*. -Then, within the second set of unzipped files, locate `./kubernetes/server/bin`, which contains -all the necessary binaries. - -#### Selecting Images - -You will run docker, kubelet, and kube-proxy outside of a container, the same way you would run any system daemon, so -you just need the bare binaries. For etcd, kube-apiserver, kube-controller-manager, and kube-scheduler, -we recommend that you run these as containers, so you need an image to be built. - -You have several choices for Kubernetes images: -- Use images hosted on Google Container Registry (GCR): - - e.g `gcr.io/google_containers/kube-apiserver:$TAG`, where `TAG` is the latest - release tag, which can be found on the [latest releases page](https://k8s.io/kubernetes/releases/latest). - - Ensure $TAG is the same tag as the release tag you are using for kubelet and kube-proxy. -- Build your own images. - - Useful if you are using a private registry. - - The release contains files such as `./kubernetes/server/bin/kube-apiserver.tar` which - can be converted into docker images using a command like - `docker load -i kube-apiserver.tar` - - You can verify if the image is loaded successfully with the right reposity and tag using - command like `docker images` - -For etcd, you can: -- Use images hosted on Google Container Registry (GCR), such as `gcr.io/google_containers/etcd:2.0.12` -- Use images hosted on [Docker Hub](https://registry.hub.docker.com/u/coreos/etcd/) or [quay.io](https://registry.hub.docker.com/u/coreos/etcd/) -- Use etcd binary included in your OS distro. -- Build your own image - - You can do: `cd kubernetes/cluster/images/etcd; make` - -We recommend that you use the etcd version which is provided in the Kubernetes binary distribution. The Kubernetes binaries in the release -were tested extensively with this version of etcd and not with any other version. -The recommended version number can also be found as the value of `ETCD_VERSION` in `kubernetes/cluster/images/etcd/Makefile`. - -The remainder of the document assumes that the image identifiers have been chosen and stored in corresponding env vars. Examples (replace with latest tags and appropriate registry): - - `APISERVER_IMAGE=gcr.io/google_containers/kube-apiserver:$TAG` - - `SCHEDULER_IMAGE=gcr.io/google_containers/kube-scheduler:$TAG` - - `CNTRLMNGR_IMAGE=gcr.io/google_containers/kube-controller-manager:$TAG` - - `ETCD_IMAGE=gcr.io/google_containers/etcd:$ETCD_VERSION` - -### Security Models - -There are two main options for security: -- Access the apiserver using HTTP. - - Use a firewall for security. - - This is easier to setup. -- Access the apiserver using HTTPS - - Use https with certs, and credentials for user. - - This is the recommended approach. - - Configuring certs can be tricky. - -If following the HTTPS approach, you will need to prepare certs and credentials. - -#### Preparing Certs - -You need to prepare several certs: -- The master needs a cert to act as an HTTPS server. -- The kubelets optionally need certs to identify themselves as clients of the master, and when - serving its own API over HTTPS. - -Unless you plan to have a real CA generate your certs, you will need to generate a root cert and use that to sign the master, kubelet, and kubectl certs. -- see function `create-certs` in `cluster/gce/util.sh` -- see also `cluster/saltbase/salt/generate-cert/make-ca-cert.sh` and - `cluster/saltbase/salt/generate-cert/make-cert.sh` - -You will end up with the following files (we will use these variables later on) -- `CA_CERT` - - put in on node where apiserver runs, in e.g. `/srv/kubernetes/ca.crt`. -- `MASTER_CERT` - - signed by CA_CERT - - put in on node where apiserver runs, in e.g. `/srv/kubernetes/server.crt` -- `MASTER_KEY ` - - put in on node where apiserver runs, in e.g. `/srv/kubernetes/server.key` -- `KUBELET_CERT` - - optional -- `KUBELET_KEY` - - optional - -#### Preparing Credentials - -The admin user (and any users) need: - - a token or a password to identify them. - - tokens are just long alphanumeric strings, e.g. 32 chars. See - - `TOKEN=$(dd if=/dev/urandom bs=128 count=1 2>/dev/null | base64 | tr -d "=+/" | dd bs=32 count=1 2>/dev/null)` - -Your tokens and passwords need to be stored in a file for the apiserver -to read. This guide uses `/var/lib/kube-apiserver/known_tokens.csv`. -The format for this file is described in the [authentication documentation](../admin/authentication.md). - -For distributing credentials to clients, the convention in Kubernetes is to put the credentials -into a [kubeconfig file](../user-guide/kubeconfig-file.md). - -The kubeconfig file for the administrator can be created as follows: - - If you have already used Kubernetes with a non-custom cluster (for example, used a Getting Started - Guide), you will already have a `$HOME/.kube/config` file. - - You need to add certs, keys, and the master IP to the kubeconfig file: - - If using the firewall-only security option, set the apiserver this way: - - `kubectl config set-cluster $CLUSTER_NAME --server=http://$MASTER_IP --insecure-skip-tls-verify=true` - - Otherwise, do this to set the apiserver ip, client certs, and user credentials. - - `kubectl config set-cluster $CLUSTER_NAME --certificate-authority=$CA_CERT --embed-certs=true --server=https://$MASTER_IP` - - `kubectl config set-credentials $USER --client-certificate=$CLI_CERT --client-key=$CLI_KEY --embed-certs=true --token=$TOKEN` - - Set your cluster as the default cluster to use: - - `kubectl config set-context $CONTEXT_NAME --cluster=$CLUSTER_NAME --user=$USER` - - `kubectl config use-context $CONTEXT_NAME` - -Next, make a kubeconfig file for the kubelets and kube-proxy. There are a couple of options for how -many distinct files to make: - 1. Use the same credential as the admin - - This is simplest to setup. - 1. One token and kubeconfig file for all kubelets, one for all kube-proxy, one for admin. - - This mirrors what is done on GCE today - 1. Different credentials for every kubelet, etc. - - We are working on this but all the pieces are not ready yet. - -You can make the files by copying the `$HOME/.kube/config`, by following the code -in `cluster/gce/configure-vm.sh` or by using the following template: - -```yaml -apiVersion: v1 -kind: Config -users: -- name: kubelet - user: - token: ${KUBELET_TOKEN} -clusters: -- name: local - cluster: - certificate-authority-data: ${CA_CERT_BASE64_ENCODED} -contexts: -- context: - cluster: local - user: kubelet - name: service-account-context -current-context: service-account-context -``` - -Put the kubeconfig(s) on every node. The examples later in this -guide assume that there are kubeconfigs in `/var/lib/kube-proxy/kubeconfig` and -`/var/lib/kubelet/kubeconfig`. - -## Configuring and Installing Base Software on Nodes - -This section discusses how to configure machines to be Kubernetes nodes. - -You should run three daemons on every node: - - docker or rkt - - kubelet - - kube-proxy - -You will also need to do assorted other configuration on top of a -base OS install. - -Tip: One possible starting point is to setup a cluster using an existing Getting -Started Guide. After getting a cluster running, you can then copy the init.d scripts or systemd unit files from that -cluster, and then modify them for use on your custom cluster. - -### Docker - -The minimum required Docker version will vary as the kubelet version changes. The newest stable release is a good choice. Kubelet will log a warning and refuse to start pods if the version is too old, so pick a version and try it. - -If you previously had Docker installed on a node without setting Kubernetes-specific -options, you may have a Docker-created bridge and iptables rules. You may want to remove these -as follows before proceeding to configure Docker for Kubernetes. - -```sh -iptables -t nat -F -ifconfig docker0 down -brctl delbr docker0 -``` - -The way you configure docker will depend in whether you have chosen the routable-vip or overlay-network approaches for your network. -Some suggested docker options: - - create your own bridge for the per-node CIDR ranges, call it cbr0, and set `--bridge=cbr0` option on docker. - - set `--iptables=false` so docker will not manipulate iptables for host-ports (too coarse on older docker versions, may be fixed in newer versions) -so that kube-proxy can manage iptables instead of docker. - - `--ip-masq=false` - - if you have setup PodIPs to be routable, then you want this false, otherwise, docker will - rewrite the PodIP source-address to a NodeIP. - - some environments (e.g. GCE) still need you to masquerade out-bound traffic when it leaves the cloud environment. This is very environment specific. - - if you are using an overlay network, consult those instructions. - - `--mtu=` - - may be required when using Flannel, because of the extra packet size due to udp encapsulation - - `--insecure-registry $CLUSTER_SUBNET` - - to connect to a private registry, if you set one up, without using SSL. - -You may want to increase the number of open files for docker: - - `DOCKER_NOFILE=1000000` - -Where this config goes depends on your node OS. For example, GCE's Debian-based distro uses `/etc/default/docker`. - -Ensure docker is working correctly on your system before proceeding with the rest of the -installation, by following examples given in the Docker documentation. - -### rkt - -[rkt](https://github.com/coreos/rkt) is an alternative to Docker. You only need to install one of Docker or rkt. -The minimum version required is [v0.5.6](https://github.com/coreos/rkt/releases/tag/v0.5.6). - -[systemd](http://www.freedesktop.org/wiki/Software/systemd/) is required on your node to run rkt. The -minimum version required to match rkt v0.5.6 is -[systemd 215](http://lists.freedesktop.org/archives/systemd-devel/2014-July/020903.html). - -[rkt metadata service](https://github.com/coreos/rkt/blob/master/Documentation/networking.md) is also required -for rkt networking support. You can start rkt metadata service by using command like -`sudo systemd-run rkt metadata-service` - -Then you need to configure your kubelet with flag: - - `--container_runtime=rkt` - -### kubelet - -All nodes should run kubelet. See [Selecting Binaries](#selecting-binaries). - -Arguments to consider: - - If following the HTTPS security approach: - - `--api-servers=https://$MASTER_IP` - - `--kubeconfig=/var/lib/kubelet/kubeconfig` - - Otherwise, if taking the firewall-based security approach - - `--api-servers=http://$MASTER_IP` - - `--config=/etc/kubernetes/manifests` - - `--cluster-dns=` to the address of the DNS server you will setup (see [Starting Addons](#starting-addons).) - - `--cluster-domain=` to the dns domain prefix to use for cluster DNS addresses. - - `--docker-root=` - - `--root-dir=` - - `--configure-cbr0=` (described above) - - `--register-node` (described in [Node](../admin/node.md) documentation.) - -### kube-proxy - -All nodes should run kube-proxy. (Running kube-proxy on a "master" node is not -strictly required, but being consistent is easier.) Obtain a binary as described for -kubelet. - -Arguments to consider: - - If following the HTTPS security approach: - - `--api-servers=https://$MASTER_IP` - - `--kubeconfig=/var/lib/kube-proxy/kubeconfig` - - Otherwise, if taking the firewall-based security approach - - `--api-servers=http://$MASTER_IP` - -### Networking - -Each node needs to be allocated its own CIDR range for pod networking. -Call this `NODE_X_POD_CIDR`. - -A bridge called `cbr0` needs to be created on each node. The bridge is explained -further in the [networking documentation](../admin/networking.md). The bridge itself -needs an address from `$NODE_X_POD_CIDR` - by convention the first IP. Call -this `NODE_X_BRIDGE_ADDR`. For example, if `NODE_X_POD_CIDR` is `10.0.0.0/16`, -then `NODE_X_BRIDGE_ADDR` is `10.0.0.1/16`. NOTE: this retains the `/16` suffix -because of how this is used later. - -- Recommended, automatic approach: - 1. Set `--configure-cbr0=true` option in kubelet init script and restart kubelet service. Kubelet will configure cbr0 automatically. - It will wait to do this until the node controller has set Node.Spec.PodCIDR. Since you have not setup apiserver and node controller - yet, the bridge will not be setup immediately. -- Alternate, manual approach: - 1. Set `--configure-cbr0=false` on kubelet and restart. - 1. Create a bridge - - e.g. `brctl addbr cbr0`. - 1. Set appropriate MTU - - `ip link set dev cbr0 mtu 1460` (NOTE: the actual value of MTU will depend on your network environment) - 1. Add the clusters network to the bridge (docker will go on other side of bridge). - - e.g. `ip addr add $NODE_X_BRIDGE_ADDR dev eth0` - 1. Turn it on - - e.g. `ip link set dev cbr0 up` - -If you have turned off Docker's IP masquerading to allow pods to talk to each -other, then you may need to do masquerading just for destination IPs outside -the cluster network. For example: - -```sh -iptables -w -t nat -A POSTROUTING -o eth0 -j MASQUERADE \! -d ${CLUSTER_SUBNET} -``` - -This will rewrite the source address from -the PodIP to the Node IP for traffic bound outside the cluster, and kernel -[connection tracking](http://www.iptables.info/en/connection-state.html) -will ensure that responses destined to the node still reach -the pod. - -NOTE: This is environment specific. Some environments will not need -any masquerading at all. Others, such as GCE, will not allow pod IPs to send -traffic to the internet, but have no problem with them inside your GCE Project. - -### Other - -- Enable auto-upgrades for your OS package manager, if desired. -- Configure log rotation for all node components (e.g. using [logrotate](http://linux.die.net/man/8/logrotate)). -- Setup liveness-monitoring (e.g. using [monit](http://linux.die.net/man/1/monit)). -- Setup volume plugin support (optional) - - Install any client binaries for optional volume types, such as `glusterfs-client` for GlusterFS - volumes. - -### Using Configuration Management - -The previous steps all involved "conventional" system administration techniques for setting up -machines. You may want to use a Configuration Management system to automate the node configuration -process. There are examples of [Saltstack](../admin/salt.md), Ansible, Juju, and CoreOS Cloud Config in the -various Getting Started Guides. - -## Bootstrapping the Cluster - -While the basic node services (kubelet, kube-proxy, docker) are typically started and managed using -traditional system administration/automation approaches, the remaining *master* components of Kubernetes are -all configured and managed *by Kubernetes*: - - their options are specified in a Pod spec (yaml or json) rather than an /etc/init.d file or - systemd unit. - - they are kept running by Kubernetes rather than by init. - -### etcd - -You will need to run one or more instances of etcd. - - Recommended approach: run one etcd instance, with its log written to a directory backed - by durable storage (RAID, GCE PD) - - Alternative: run 3 or 5 etcd instances. - - Log can be written to non-durable storage because storage is replicated. - - run a single apiserver which connects to one of the etc nodes. - See [cluster-troubleshooting](../admin/cluster-troubleshooting.md) for more discussion on factors affecting cluster -availability. - -To run an etcd instance: -1. copy `cluster/saltbase/salt/etcd/etcd.manifest` -1. make any modifications needed -1. start the pod by putting it into the kubelet manifest directory - -### Apiserver, Controller Manager, and Scheduler - -The apiserver, controller manager, and scheduler will each run as a pod on the master node. - -For each of these components, the steps to start them running are similar: - -1. Start with a provided template for a pod. -1. Set the `APISERVER_IMAGE`, `CNTRLMNGR_IMAGE`, and `SCHEDULER_IMAGE to the values chosen in [Selecting Images](#selecting-images). -1. Determine which flags are needed for your cluster, using the advice below each template. -1. Set the `APISERVER_FLAGS`, `CNTRLMNGR_FLAGS, and `SCHEDULER_FLAGS` to the space-separated list of flags for that component. -1. Start the pod by putting the completed template into the kubelet manifest directory. -1. Verify that the pod is started. - -#### Apiserver pod template - -```json -{ - "kind": "Pod", - "apiVersion": "v1", - "metadata": { - "name": "kube-apiserver" - }, - "spec": { - "hostNetwork": true, - "containers": [ - { - "name": "kube-apiserver", - "image": "${APISERVER_IMAGE}", - "command": [ - "/bin/sh", - "-c", - "/usr/local/bin/kube-apiserver $APISERVER_FLAGS" - ], - "ports": [ - { - "name": "https", - "hostPort": 443, - "containerPort": 443 - }, - { - "name": "local", - "hostPort": 8080, - "containerPort": 8080 - } - ], - "volumeMounts": [ - { - "name": "srvkube", - "mountPath": "/srv/kubernetes", - "readOnly": true - }, - { - "name": "etcssl", - "mountPath": "/etc/ssl", - "readOnly": true - } - ], - "livenessProbe": { - "httpGet": { - "path": "/healthz", - "port": 8080 - }, - "initialDelaySeconds": 15, - "timeoutSeconds": 15 - } - } - ], - "volumes": [ - { - "name": "srvkube", - "hostPath": { - "path": "/srv/kubernetes" - } - }, - { - "name": "etcssl", - "hostPath": { - "path": "/etc/ssl" - } - } - ] - } -} -``` - -Here are some apiserver flags you may need to set: - -- `--cloud-provider=` see [cloud providers](#cloud-providers) -- `--cloud-config=` see [cloud providers](#cloud-providers) -- `--address=${MASTER_IP}` *or* `--bind-address=127.0.0.1` and `--address=127.0.0.1` if you want to run a proxy on the master node. -- `--cluster-name=$CLUSTER_NAME` -- `--service-cluster-ip-range=$SERVICE_CLUSTER_IP_RANGE` -- `--etcd-servers=http://127.0.0.1:4001` -- `--tls-cert-file=/srv/kubernetes/server.cert` -- `--tls-private-key-file=/srv/kubernetes/server.key` -- `--admission-control=$RECOMMENDED_LIST` - - See [admission controllers](../admin/admission-controllers.md) for recommended arguments. -- `--allow-privileged=true`, only if you trust your cluster user to run pods as root. - -If you are following the firewall-only security approach, then use these arguments: - -- `--token-auth-file=/dev/null` -- `--insecure-bind-address=$MASTER_IP` -- `--advertise-address=$MASTER_IP` - -If you are using the HTTPS approach, then set: -- `--client-ca-file=/srv/kubernetes/ca.crt` -- `--token-auth-file=/srv/kubernetes/known_tokens.csv` -- `--basic-auth-file=/srv/kubernetes/basic_auth.csv` - -This pod mounts several node file system directories using the `hostPath` volumes. Their purposes are: -- The `/etc/ssl` mount allows the apiserver to find the SSL root certs so it can - authenticate external services, such as a cloud provider. - - This is not required if you do not use a cloud provider (e.g. bare-metal). -- The `/srv/kubernetes` mount allows the apiserver to read certs and credentials stored on the - node disk. These could instead be stored on a persistend disk, such as a GCE PD, or baked into the image. -- Optionally, you may want to mount `/var/log` as well and redirect output there (not shown in template). - - Do this if you prefer your logs to be accessible from the root filesystem with tools like journalctl. - -*TODO* document proxy-ssh setup. - -##### Cloud Providers - -Apiserver supports several cloud providers. - -- options for `--cloud-provider` flag are `aws`, `gce`, `mesos`, `openshift`, `ovirt`, `rackspace`, `vagrant`, or unset. -- unset used for e.g. bare metal setups. -- support for new IaaS is added by contributing code [here](../../pkg/cloudprovider/) - -Some cloud providers require a config file. If so, you need to put config file into apiserver image or mount through hostPath. - -- `--cloud-config=` set if cloud provider requires a config file. -- Used by `aws`, `gce`, `mesos`, `openshift`, `ovirt` and `rackspace`. -- You must put config file into apiserver image or mount through hostPath. -- Cloud config file syntax is [Gcfg](https://code.google.com/p/gcfg/). -- AWS format defined by type [AWSCloudConfig](../../pkg/cloudprovider/aws/aws.go) -- There is a similar type in the corresponding file for other cloud providers. -- GCE example: search for `gce.conf` in [this file](../../cluster/gce/configure-vm.sh) - -#### Scheduler pod template - -Complete this template for the scheduler pod: - -```json - -{ - "kind": "Pod", - "apiVersion": "v1", - "metadata": { - "name": "kube-scheduler" - }, - "spec": { - "hostNetwork": true, - "containers": [ - { - "name": "kube-scheduler", - "image": "$SCHEDULER_IMAGE", - "command": [ - "/bin/sh", - "-c", - "/usr/local/bin/kube-scheduler --master=127.0.0.1:8080 $SCHEDULER_FLAGS" - ], - "livenessProbe": { - "httpGet": { - "path": "/healthz", - "port": 10251 - }, - "initialDelaySeconds": 15, - "timeoutSeconds": 15 - } - } - ] - } -} - -``` - -Typically, no additional flags are required for the scheduler. - -Optionally, you may want to mount `/var/log` as well and redirect output there. - -#### Controller Manager Template - -Template for controller manager pod: - -```json - -{ - "kind": "Pod", - "apiVersion": "v1", - "metadata": { - "name": "kube-controller-manager" - }, - "spec": { - "hostNetwork": true, - "containers": [ - { - "name": "kube-controller-manager", - "image": "$CNTRLMNGR_IMAGE", - "command": [ - "/bin/sh", - "-c", - "/usr/local/bin/kube-controller-manager $CNTRLMNGR_FLAGS" - ], - "volumeMounts": [ - { - "name": "srvkube", - "mountPath": "/srv/kubernetes", - "readOnly": true - }, - { - "name": "etcssl", - "mountPath": "/etc/ssl", - "readOnly": true - } - ], - "livenessProbe": { - "httpGet": { - "path": "/healthz", - "port": 10252 - }, - "initialDelaySeconds": 15, - "timeoutSeconds": 15 - } - } - ], - "volumes": [ - { - "name": "srvkube", - "hostPath": { - "path": "/srv/kubernetes" - } - }, - { - "name": "etcssl", - "hostPath": { - "path": "/etc/ssl" - } - } - ] - } -} - -``` - -Flags to consider using with controller manager: - - `--cluster-name=$CLUSTER_NAME` - - `--cluster-cidr=` - - *TODO*: explain this flag. - - `--allocate-node-cidrs=` - - *TODO*: explain when you want controller to do this and when you want to do it another way. - - `--cloud-provider=` and `--cloud-config` as described in apiserver section. - - `--service-account-private-key-file=/srv/kubernetes/server.key`, used by the [service account](../user-guide/service-accounts.md) feature. - - `--master=127.0.0.1:8080` - -#### Starting and Verifying Apiserver, Scheduler, and Controller Manager - -Place each completed pod template into the kubelet config dir -(whatever `--config=` argument of kubelet is set to, typically -`/etc/kubernetes/manifests`). The order does not matter: scheduler and -controller manager will retry reaching the apiserver until it is up. - -Use `ps` or `docker ps` to verify that each process has started. For example, verify that kubelet has started a container for the apiserver like this: - -```console -$ sudo docker ps | grep apiserver: -5783290746d5 gcr.io/google_containers/kube-apiserver:e36bf367342b5a80d7467fd7611ad873 "/bin/sh -c '/usr/lo'" 10 seconds ago Up 9 seconds k8s_kube-apiserver.feb145e7_kube-apiserver-kubernetes-master_default_eaebc600cf80dae59902b44225f2fc0a_225a4695 -``` - -Then try to connect to the apiserver: - -```console -$ echo $(curl -s http://localhost:8080/healthz) -ok -$ curl -s http://localhost:8080/api -{ - "versions": [ - "v1" - ] -} -``` - -If you have selected the `--register-node=true` option for kubelets, they will now begin self-registering with the apiserver. -You should soon be able to see all your nodes by running the `kubect get nodes` command. -Otherwise, you will need to manually create node objects. - -### Logging - -**TODO** talk about starting Logging. - -### Monitoring - -**TODO** talk about starting Logging. - -### DNS - -**TODO** talk about starting DNS. - -## Troubleshooting - -### Running validate-cluster - -**TODO** explain how to use `cluster/validate-cluster.sh` - -### Inspect pods and services - -Try to run through the "Inspect your cluster" section in one of the other Getting Started Guides, such as [GCE](gce.md#inspect-your-cluster). -You should see some services. You should also see "mirror pods" for the apiserver, scheduler and controller-manager, plus any add-ons you started. - -### Try Examples - -At this point you should be able to run through one of the basic examples, such as the [nginx example](../../examples/simple-nginx.md). - -### Running the Conformance Test - -You may want to try to run the [Conformance test](http://releases.k8s.io/HEAD/hack/conformance-test.sh). Any failures may give a hint as to areas that need more attention. - -### Networking - -The nodes must be able to connect to each other using their private IP. Verify this by -pinging or SSH-ing from one node to another. - -### Getting Help - -If you run into trouble, please see the section on [troubleshooting](gce.md#troubleshooting), post to the -[google-containers group](https://groups.google.com/forum/#!forum/google-containers), or come ask questions on IRC at [#google-containers](http://webchat.freenode.net/?channels=google-containers) on freenode. - - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/getting-started-guides/scratch.md?pixel)]() - diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/ubuntu-calico.md b/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/ubuntu-calico.md deleted file mode 100644 index 2019320d2976..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/ubuntu-calico.md +++ /dev/null @@ -1,290 +0,0 @@ - - - - -WARNING -WARNING -WARNING -WARNING -WARNING - -

    PLEASE NOTE: This document applies to the HEAD of the source tree

    - -If you are using a released version of Kubernetes, you should -refer to the docs that go with that version. - - -The latest 1.0.x release of this document can be found -[here](http://releases.k8s.io/release-1.0/docs/getting-started-guides/ubuntu-calico.md). - -Documentation for other releases can be found at -[releases.k8s.io](http://releases.k8s.io). - --- - - - - -Kubernetes Deployment On Bare-metal Ubuntu Nodes with Calico Networking ------------------------------------------------- - -## Introduction - -This document describes how to deploy Kubernetes on ubuntu bare metal nodes with Calico Networking plugin. See [projectcalico.org](http://projectcalico.org) for more information on what Calico is, and [the calicoctl github](https://github.com/Metaswitch/calico-docker) for more information on the command-line tool, `calicoctl`. - -This guide will set up a simple Kubernetes cluster with a master and two nodes. We will start the following processes with systemd: - -On the Master: -- `etcd` -- `kube-apiserver` -- `kube-controller-manager` -- `kube-scheduler` -- `calico-node` - -On each Node: -- `kube-proxy` -- `kube-kubelet` -- `calico-node` - -## Prerequisites - -1. This guide uses `systemd` and thus uses Ubuntu 15.04 which supports systemd natively. -2. All Kubernetes nodes should have the latest docker stable version installed. At the time of writing, that is Docker 1.7.0. -3. All hosts should be able to communicate with each other, as well as the internet, to download the necessary files. -4. This demo assumes that none of the hosts have been configured with any Kubernetes or Calico software yet. - -## Setup Master - -First, get the sample configurations for this tutorial - -``` -wget https://github.com/Metaswitch/calico-kubernetes-ubuntu-demo/archive/master.tar.gz -tar -xvf master.tar.gz -``` - -### Setup environment variables for systemd services on Master - -Many of the sample systemd services provided rely on environment variables on a per-node basis. Here we'll edit those environment variables and move them into place. - -1.) Copy the network-environment-template from the `master` directory for editing. - -``` -cp calico-kubernetes-ubuntu-demo-master/master/network-environment-template network-environment -``` - -2.) Edit `network-environment` to represent your current host's settings. - -3.) Move the `network-environment` into `/etc` - -``` -sudo mv -f network-environment /etc -``` - -### Install Kubernetes on Master - -1.) Build & Install Kubernetes binaries - -``` -# Get the Kubernetes Source -wget https://k8s.io/kubernetes/releases/download/v0.20.2/kubernetes.tar.gz - -# Untar it -tar -xf kubernetes.tar.gz -tar -xf kubernetes/server/kubernetes-server-linux-amd64.tar.gz -kubernetes/cluster/ubuntu/build.sh - -# Add binaries to /usr/bin -sudo cp -f binaries/master/* /usr/bin -sudo cp -f binaries/kubectl /usr/bin -``` - -2.) Install the sample systemd processes settings for launching kubernetes services - -``` -sudo cp -f calico-kubernetes-ubuntu-demo-master/master/*.service /etc/systemd -sudo systemctl enable /etc/systemd/etcd.service -sudo systemctl enable /etc/systemd/kube-apiserver.service -sudo systemctl enable /etc/systemd/kube-controller-manager.service -sudo systemctl enable /etc/systemd/kube-scheduler.service -``` - -3.) Launch the processes. - -``` -sudo systemctl start etcd.service -sudo systemctl start kube-apiserver.service -sudo systemctl start kube-controller-manager.service -sudo systemctl start kube-scheduler.service -``` - -> *You may want to consider checking their status after to ensure everything is running.* - -### Install Calico on Master - -In order to allow the master to route to pods on our nodes, we will launch the calico-node daemon on our master. This will allow it to learn routes over BGP from the other calico-node daemons in the cluster. The docker daemon should already be running before calico is started. - -``` -# Install the calicoctl binary, which will be used to launch calico -wget https://github.com/Metaswitch/calico-docker/releases/download/v0.5.1/calicoctl -chmod +x calicoctl -sudo cp -f calicoctl /usr/bin - -# Install and start the calico service -sudo cp -f calico-kubernetes-ubuntu-demo-master/master/calico-node.service /etc/systemd -sudo systemctl enable /etc/systemd/calico-node.service -sudo systemctl start calico-node.service -``` - ->Note: calico-node may take a few minutes on first boot while it downloads the calico-node docker image. - -## Setup Nodes - -Perform these steps **once on each node**, ensuring you appropriately set the environment variables on each node - -### Setup environment variables for systemd services on the Node - -1.) Get the sample configurations for this tutorial - -``` -wget https://github.com/Metaswitch/calico-kubernetes-ubuntu-demo/archive/master.tar.gz -tar -xvf master.tar.gz -``` - -2.) Copy the network-environment-template from the `node` directory - -``` -cp calico-kubernetes-ubuntu-demo-master/node/network-environment-template network-environment -``` - -3.) Edit `network-environment` to represent your current host's settings. - -4.) Move `netework-environment` into `/etc` - -``` -sudo mv -f network-environment /etc -``` - -### Configure Docker on the Node - -#### Create the veth - -Instead of using docker's default interface (docker0), we will configure a new one to use desired IP ranges - -``` -sudo brctl addbr cbr0 -sudo ifconfig cbr0 up -sudo ifconfig cbr0 /24 -``` - -> Replace \ with the subnet for this host's containers. Example topology: - - Node | cbr0 IP --------- | ------------- -node-1 | 192.168.1.1/24 -node-2 | 192.168.2.1/24 -node-X | 192.168.X.1/24 - -#### Start docker on cbr0 - -The Docker daemon must be started and told to use the already configured cbr0 instead of using the usual docker0, as well as disabling ip-masquerading and modification of the ip-tables. - -1.) Edit the ubuntu-15.04 docker.service for systemd at: `/lib/systemd/system/docker.service` - -2.) Find the line that reads `ExecStart=/usr/bin/docker -d -H fd://` and append the following flags: `--bridge=cbr0 --iptables=false --ip-masq=false` - -3.) Reload systemctl with `sudo systemctl daemon-reload` - -4.) Restart docker with with `sudo systemctl restart docker` - -### Install Calico on the Node - -1.) Install Calico - -``` -# Get the calicoctl binary -wget https://github.com/Metaswitch/calico-docker/releases/download/v0.5.1/calicoctl -chmod +x calicoctl -sudo cp -f calicoctl /usr/bin - -# Start calico on this node -sudo cp calico-kubernetes-ubuntu-demo-master/node/calico-node.service /etc/systemd -sudo systemctl enable /etc/systemd/calico-node.service -sudo systemctl start calico-node.service -``` - ->The calico-node service will automatically get the kubernetes-calico plugin binary and install it on the host system. - -2.) Use calicoctl to add an IP pool. We must specify the IP and port that the master's etcd is listening on. -**NOTE: This step only needs to be performed once per Kubernetes deployment, as it covers all the node's IP ranges.** - -``` -ETCD_AUTHORITY=:4001 calicoctl pool add 192.168.0.0/16 -``` - -### Install Kubernetes on the Node - -1.) Build & Install Kubernetes binaries - -``` -# Get the Kubernetes Source -wget https://k8s.io/kubernetes/releases/download/v0.20.2/kubernetes.tar.gz - -# Untar it -tar -xf kubernetes.tar.gz -tar -xf kubernetes/server/kubernetes-server-linux-amd64.tar.gz -kubernetes/cluster/ubuntu/build.sh - -# Add binaries to /usr/bin -sudo cp -f binaries/minion/* /usr/bin -``` - -2.) Install and launch the sample systemd processes settings for launching Kubernetes services - -``` -sudo cp calico-kubernetes-ubuntu-demo-master/node/kube-proxy.service /etc/systemd/ -sudo cp calico-kubernetes-ubuntu-demo-master/node/kube-kubelet.service /etc/systemd/ -sudo systemctl enable /etc/systemd/kube-proxy.service -sudo systemctl enable /etc/systemd/kube-kubelet.service -sudo systemctl start kube-proxy.service -sudo systemctl start kube-kubelet.service -``` - ->*You may want to consider checking their status after to ensure everything is running* - -## Launch other Services With Calico-Kubernetes - -At this point, you have a fully functioning cluster running on kubernetes with a master and 2 nodes networked with Calico. You can now follow any of the [standard documentation](../../examples/) to set up other services on your cluster. - -## Connectivity to outside the cluster - -With this sample configuration, because the containers have private `192.168.0.0/16` IPs, you will need NAT to allow connectivity between containers and the internet. However, in a full datacenter deployment, NAT is not always necessary, since Calico can peer with the border routers over BGP. - -### NAT on the nodes - -The simplest method for enabling connectivity from containers to the internet is to use an iptables masquerade rule. This is the standard mechanism [recommended](../../docs/admin/networking.md#google-compute-engine-gce) in the Kubernetes GCE environment. - -We need to NAT traffic that has a destination outside of the cluster. Internal traffic includes the master/nodes, and the container IP pools. Assuming that the master and nodes are in the `172.25.0.0/24` subnet, the cbr0 IP ranges are all in the `192.168.0.0/16` network, and the nodes use the interface `eth0` for external connectivity, a suitable masquerade chain would look like this: - -``` -sudo iptables -t nat -N KUBE-OUTBOUND-NAT -sudo iptables -t nat -A KUBE-OUTBOUND-NAT -d 192.168.0.0/16 -o eth0 -j RETURN -sudo iptables -t nat -A KUBE-OUTBOUND-NAT -d 172.25.0.0/24 -o eth0 -j RETURN -sudo iptables -t nat -A KUBE-OUTBOUND-NAT -j MASQUERADE -sudo iptables -t nat -A POSTROUTING -j KUBE-OUTBOUND-NAT -``` - -This chain should be applied on the master and all nodes. In production, these rules should be persisted, e.g. with `iptables-persistent`. - -### NAT at the border router - -In a datacenter environment, it is recommended to configure Calico to peer with the border routers over BGP. This means that the container IPs will be routable anywhere in the datacenter, and so NAT is not needed on the nodes (though it may be enabled at the datacenter edge to allow outbound-only internet connectivity). - - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/getting-started-guides/ubuntu-calico.md?pixel)]() - diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/ubuntu.md b/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/ubuntu.md deleted file mode 100644 index 1bd40bcae07d..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/ubuntu.md +++ /dev/null @@ -1,224 +0,0 @@ - - - - -WARNING -WARNING -WARNING -WARNING -WARNING - -

    PLEASE NOTE: This document applies to the HEAD of the source tree

    - -If you are using a released version of Kubernetes, you should -refer to the docs that go with that version. - - -The latest 1.0.x release of this document can be found -[here](http://releases.k8s.io/release-1.0/docs/getting-started-guides/ubuntu.md). - -Documentation for other releases can be found at -[releases.k8s.io](http://releases.k8s.io). - --- - - - - -Kubernetes Deployment On Bare-metal Ubuntu Nodes ------------------------------------------------- - -- [Introduction](#introduction) -- [Prerequisites](#prerequisites) - - [Starting a Cluster](#starting-a-cluster) - - [Make *kubernetes* , *etcd* and *flanneld* binaries](#make-kubernetes--etcd-and-flanneld-binaries) - - [Configure and start the Kubernetes cluster](#configure-and-start-the-kubernetes-cluster) - - [Deploy addons](#deploy-addons) - - [Trouble Shooting](#trouble-shooting) - -## Introduction - -This document describes how to deploy Kubernetes on ubuntu nodes, including 1 Kubernetes master and 3 Kubernetes nodes, and people uses this approach can scale to **any number of nodes** by changing some settings with ease. The original idea was heavily inspired by @jainvipin 's ubuntu single node work, which has been merge into this document. - -[Cloud team from Zhejiang University](https://github.com/ZJU-SEL) will maintain this work. - -## Prerequisites - -*1 The nodes have installed docker version 1.2+ and bridge-utils to manipulate linux bridge* - -*2 All machines can communicate with each other, no need to connect Internet (should use private docker registry in this case)* - -*3 These guide is tested OK on Ubuntu 14.04 LTS 64bit server, but it can not work with Ubuntu 15 which use systemd instead of upstart and we are fixing this* - -*4 Dependencies of this guide: etcd-2.0.12, flannel-0.4.0, k8s-1.0.1, but it may work with higher versions* - -*5 All the remote servers can be ssh logged in without a password by using key authentication* - - -### Starting a Cluster - -#### Make *kubernetes* , *etcd* and *flanneld* binaries - -First clone the kubernetes github repo, `$ git clone https://k8s.io/kubernetes.git` - -then `$ cd kubernetes/cluster/ubuntu`. - -Then run `$ ./build.sh`, this will download all the needed binaries into `./binaries`. - -You can customize your etcd version, flannel version, k8s version by changing variable `ETCD_VERSION` , `FLANNEL_VERSION` and `K8S_VERSION` in build.sh, default etcd version is 2.0.12, flannel version is 0.4.0 and K8s version is 1.0.1. - -Please make sure that there are `kube-apiserver`, `kube-controller-manager`, `kube-scheduler`, `kubelet`, `kube-proxy`, `etcd`, `etcdctl` and `flannel` in the binaries/master or binaries/minion directory. - -> We used flannel here because we want to use overlay network, but please remember it is not the only choice, and it is also not a k8s' necessary dependence. Actually you can just build up k8s cluster natively, or use flannel, Open vSwitch or any other SDN tool you like, we just choose flannel here as an example. - -#### Configure and start the Kubernetes cluster - -An example cluster is listed as below: - -| IP Address|Role | -|---------|------| -|10.10.103.223| node | -|10.10.103.162| node | -|10.10.103.250| both master and node| - -First configure the cluster information in cluster/ubuntu/config-default.sh, below is a simple sample. - -```sh -export nodes="vcap@10.10.103.250 vcap@10.10.103.162 vcap@10.10.103.223" - -export role="ai i i" - -export NUM_MINIONS=${NUM_MINIONS:-3} - -export SERVICE_CLUSTER_IP_RANGE=192.168.3.0/24 - -export FLANNEL_NET=172.16.0.0/16 -``` - -The first variable `nodes` defines all your cluster nodes, MASTER node comes first and separated with blank space like ` ` - -Then the `roles ` variable defines the role of above machine in the same order, "ai" stands for machine acts as both master and node, "a" stands for master, "i" stands for node. So they are just defined the k8s cluster as the table above described. - -The `NUM_MINIONS` variable defines the total number of nodes. - -The `SERVICE_CLUSTER_IP_RANGE` variable defines the Kubernetes service IP range. Please make sure that you do have a valid private ip range defined here, because some IaaS provider may reserve private ips. You can use below three private network range according to rfc1918. Besides you'd better not choose the one that conflicts with your own private network range. - - 10.0.0.0 - 10.255.255.255 (10/8 prefix) - - 172.16.0.0 - 172.31.255.255 (172.16/12 prefix) - - 192.168.0.0 - 192.168.255.255 (192.168/16 prefix) - -The `FLANNEL_NET` variable defines the IP range used for flannel overlay network, should not conflict with above `SERVICE_CLUSTER_IP_RANGE`. - -After all the above variables being set correctly, we can use following command in cluster/ directory to bring up the whole cluster. - -`$ KUBERNETES_PROVIDER=ubuntu ./kube-up.sh` - -The scripts automatically scp binaries and config files to all the machines and start the k8s service on them. The only thing you need to do is to type the sudo password when promoted. The current machine name is shown below, so you will not type in the wrong password. - -```console -Deploying minion on machine 10.10.103.223 - -... - -[sudo] password to copy files and start minion: -``` - -If all things goes right, you will see the below message from console -`Cluster validation succeeded` indicating the k8s is up. - -**All done !** - -You can also use `kubectl` command to see if the newly created k8s is working correctly. The `kubectl` binary is under the `cluster/ubuntu/binaries` directory. You can move it into your PATH. Then you can use the below command smoothly. - -For example, use `$ kubectl get nodes` to see if all your nodes are in ready status. It may take some time for the nodes ready to use like below. - -```console -NAME LABELS STATUS - -10.10.103.162 kubernetes.io/hostname=10.10.103.162 Ready - -10.10.103.223 kubernetes.io/hostname=10.10.103.223 Ready - -10.10.103.250 kubernetes.io/hostname=10.10.103.250 Ready -``` - -Also you can run Kubernetes [guest-example](../../examples/guestbook/) to build a redis backend cluster on the k8s. - - -#### Deploy addons - -After the previous parts, you will have a working k8s cluster, this part will teach you how to deploy addons like dns onto the existing cluster. - -The configuration of dns is configured in cluster/ubuntu/config-default.sh. - -```sh -ENABLE_CLUSTER_DNS="${KUBE_ENABLE_CLUSTER_DNS:-true}" - -DNS_SERVER_IP="192.168.3.10" - -DNS_DOMAIN="cluster.local" - -DNS_REPLICAS=1 -``` - -The `DNS_SERVER_IP` is defining the ip of dns server which must be in the service_cluster_ip_range. - -The `DNS_REPLICAS` describes how many dns pod running in the cluster. - -After all the above variable have been set. Just type the below command - -```console -$ cd cluster/ubuntu - -$ KUBERNETES_PROVIDER=ubuntu ./deployAddons.sh -``` - -After some time, you can use `$ kubectl get pods` to see the dns pod is running in the cluster. Done! - -#### On going - -We are working on these features which we'd like to let everybody know: - -1. Run Kubernetes binaries in Docker using [kube-in-docker](https://github.com/ZJU-SEL/kube-in-docker/tree/baremetal-kube), to eliminate OS-distro differences. - -2. Tearing Down scripts: clear and re-create the whole stack by one click. - -#### Trouble Shooting - -Generally, what this approach did is quite simple: - -1. Download and copy binaries and configuration files to proper directories on every node - -2. Configure `etcd` using IPs based on input from user - -3. Create and start flannel network - -So, if you see a problem, **check etcd configuration first** - -Please try: - -1. Check `/var/log/upstart/etcd.log` for suspicious etcd log - -2. Check `/etc/default/etcd`, as we do not have much input validation, a right config should be like: - - ```sh - ETCD_OPTS="-name infra1 -initial-advertise-peer-urls -listen-peer-urls -initial-cluster-token etcd-cluster-1 -initial-cluster infra1=,infra2=,infra3= -initial-cluster-state new" - ``` - -3. You can use below command - `$ KUBERNETES_PROVIDER=ubuntu ./kube-down.sh` to bring down the cluster and run - `$ KUBERNETES_PROVIDER=ubuntu ./kube-up.sh` again to start again. - -4. You can also customize your own settings in `/etc/default/{component_name}` after configured success. - - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/getting-started-guides/ubuntu.md?pixel)]() - diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/vagrant.md b/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/vagrant.md deleted file mode 100644 index f4a831f07b93..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/vagrant.md +++ /dev/null @@ -1,391 +0,0 @@ - - - - -WARNING -WARNING -WARNING -WARNING -WARNING - -

    PLEASE NOTE: This document applies to the HEAD of the source tree

    - -If you are using a released version of Kubernetes, you should -refer to the docs that go with that version. - - -The latest 1.0.x release of this document can be found -[here](http://releases.k8s.io/release-1.0/docs/getting-started-guides/vagrant.md). - -Documentation for other releases can be found at -[releases.k8s.io](http://releases.k8s.io). - --- - - - - - -## Getting started with Vagrant - -Running Kubernetes with Vagrant (and VirtualBox) is an easy way to run/test/develop on your local machine (Linux, Mac OS X). - -**Table of Contents** - -- [Prerequisites](#prerequisites) -- [Setup](#setup) -- [Interacting with your Kubernetes cluster with Vagrant.](#interacting-with-your-kubernetes-cluster-with-vagrant) -- [Authenticating with your master](#authenticating-with-your-master) -- [Running containers](#running-containers) -- [Troubleshooting](#troubleshooting) - - [I keep downloading the same (large) box all the time!](#i-keep-downloading-the-same-large-box-all-the-time) - - [I just created the cluster, but I am getting authorization errors!](#i-just-created-the-cluster-but-i-am-getting-authorization-errors) - - [I just created the cluster, but I do not see my container running!](#i-just-created-the-cluster-but-i-do-not-see-my-container-running) - - [I want to make changes to Kubernetes code!](#i-want-to-make-changes-to-kubernetes-code) - - [I have brought Vagrant up but the nodes cannot validate!](#i-have-brought-vagrant-up-but-the-nodes-cannot-validate) - - [I want to change the number of nodes!](#i-want-to-change-the-number-of-nodes) - - [I want my VMs to have more memory!](#i-want-my-vms-to-have-more-memory) - - [I ran vagrant suspend and nothing works!](#i-ran-vagrant-suspend-and-nothing-works) - - [I want vagrant to sync folders via nfs!](#i-want-vagrant-to-sync-folders-via-nfs) - -### Prerequisites - -1. Install latest version >= 1.6.2 of vagrant from http://www.vagrantup.com/downloads.html -2. Install one of: - 1. Version 4.3.28 of Virtual Box from https://www.virtualbox.org/wiki/Download_Old_Builds_4_3 - 2. [VMWare Fusion](https://www.vmware.com/products/fusion/) version 5 or greater as well as the appropriate [Vagrant VMWare Fusion provider](https://www.vagrantup.com/vmware) - 3. [VMWare Workstation](https://www.vmware.com/products/workstation/) version 9 or greater as well as the [Vagrant VMWare Workstation provider](https://www.vagrantup.com/vmware) - 4. [Parallels Desktop](https://www.parallels.com/products/desktop/) version 9 or greater as well as the [Vagrant Parallels provider](https://parallels.github.io/vagrant-parallels/) - 5. libvirt with KVM and enable support of hardware virtualisation. [Vagrant-libvirt](https://github.com/pradels/vagrant-libvirt). For fedora provided official rpm, and possible to use `yum install vagrant-libvirt` - -### Setup - -Setting up a cluster is as simple as running: - -```sh -export KUBERNETES_PROVIDER=vagrant -curl -sS https://get.k8s.io | bash -``` - -Alternatively, you can download [Kubernetes release](https://k8s.io/kubernetes/releases) and extract the archive. To start your local cluster, open a shell and run: - -```sh -cd kubernetes - -export KUBERNETES_PROVIDER=vagrant -./cluster/kube-up.sh -``` - -The `KUBERNETES_PROVIDER` environment variable tells all of the various cluster management scripts which variant to use. If you forget to set this, the assumption is you are running on Google Compute Engine. - -By default, the Vagrant setup will create a single master VM (called kubernetes-master) and one node (called kubernetes-minion-1). Each VM will take 1 GB, so make sure you have at least 2GB to 4GB of free memory (plus appropriate free disk space). - -Vagrant will provision each machine in the cluster with all the necessary components to run Kubernetes. The initial setup can take a few minutes to complete on each machine. - -If you installed more than one Vagrant provider, Kubernetes will usually pick the appropriate one. However, you can override which one Kubernetes will use by setting the [`VAGRANT_DEFAULT_PROVIDER`](https://docs.vagrantup.com/v2/providers/default.html) environment variable: - -```sh -export VAGRANT_DEFAULT_PROVIDER=parallels -export KUBERNETES_PROVIDER=vagrant -./cluster/kube-up.sh -``` - -By default, each VM in the cluster is running Fedora. - -To access the master or any node: - -```sh -vagrant ssh master -vagrant ssh minion-1 -``` - -If you are running more than one node, you can access the others by: - -```sh -vagrant ssh minion-2 -vagrant ssh minion-3 -``` - -Each node in the cluster installs the docker daemon and the kubelet. - -The master node instantiates the Kubernetes master components as pods on the machine. - -To view the service status and/or logs on the kubernetes-master: - -```console -[vagrant@kubernetes-master ~] $ vagrant ssh master -[vagrant@kubernetes-master ~] $ sudo su - -[root@kubernetes-master ~] $ systemctl status kubelet -[root@kubernetes-master ~] $ journalctl -ru kubelet - -[root@kubernetes-master ~] $ systemctl status docker -[root@kubernetes-master ~] $ journalctl -ru docker - -[root@kubernetes-master ~] $ tail -f /var/log/kube-apiserver.log -[root@kubernetes-master ~] $ tail -f /var/log/kube-controller-manager.log -[root@kubernetes-master ~] $ tail -f /var/log/kube-scheduler.log -``` - -To view the services on any of the nodes: - -```console -[vagrant@kubernetes-master ~] $ vagrant ssh minion-1 -[vagrant@kubernetes-master ~] $ sudo su - -[root@kubernetes-master ~] $ systemctl status kubelet -[root@kubernetes-master ~] $ journalctl -ru kubelet - -[root@kubernetes-master ~] $ systemctl status docker -[root@kubernetes-master ~] $ journalctl -ru docker -``` - -### Interacting with your Kubernetes cluster with Vagrant. - -With your Kubernetes cluster up, you can manage the nodes in your cluster with the regular Vagrant commands. - -To push updates to new Kubernetes code after making source changes: - -```sh -./cluster/kube-push.sh -``` - -To stop and then restart the cluster: - -```sh -vagrant halt -./cluster/kube-up.sh -``` - -To destroy the cluster: - -```sh -vagrant destroy -``` - -Once your Vagrant machines are up and provisioned, the first thing to do is to check that you can use the `kubectl.sh` script. - -You may need to build the binaries first, you can do this with `make` - -```console -$ ./cluster/kubectl.sh get nodes - -NAME LABELS -10.245.1.4 -10.245.1.5 -10.245.1.3 -``` - -### Authenticating with your master - -When using the vagrant provider in Kubernetes, the `cluster/kubectl.sh` script will cache your credentials in a `~/.kubernetes_vagrant_auth` file so you will not be prompted for them in the future. - -```sh -cat ~/.kubernetes_vagrant_auth -``` - -```json -{ "User": "vagrant", - "Password": "vagrant", - "CAFile": "/home/k8s_user/.kubernetes.vagrant.ca.crt", - "CertFile": "/home/k8s_user/.kubecfg.vagrant.crt", - "KeyFile": "/home/k8s_user/.kubecfg.vagrant.key" -} -``` - -You should now be set to use the `cluster/kubectl.sh` script. For example try to list the nodes that you have started with: - -```sh -./cluster/kubectl.sh get nodes -``` - -### Running containers - -Your cluster is running, you can list the nodes in your cluster: - -```console -$ ./cluster/kubectl.sh get nodes - -NAME LABELS -10.245.2.4 -10.245.2.3 -10.245.2.2 -``` - -Now start running some containers! - -You can now use any of the `cluster/kube-*.sh` commands to interact with your VM machines. -Before starting a container there will be no pods, services and replication controllers. - -```console -$ ./cluster/kubectl.sh get pods -NAME READY STATUS RESTARTS AGE - -$ ./cluster/kubectl.sh get services -NAME LABELS SELECTOR IP(S) PORT(S) - -$ ./cluster/kubectl.sh get replicationcontrollers -CONTROLLER CONTAINER(S) IMAGE(S) SELECTOR REPLICAS -``` - -Start a container running nginx with a replication controller and three replicas - -```console -$ ./cluster/kubectl.sh run my-nginx --image=nginx --replicas=3 --port=80 -``` - -When listing the pods, you will see that three containers have been started and are in Waiting state: - -```console -$ ./cluster/kubectl.sh get pods -NAME READY STATUS RESTARTS AGE -my-nginx-5kq0g 0/1 Pending 0 10s -my-nginx-gr3hh 0/1 Pending 0 10s -my-nginx-xql4j 0/1 Pending 0 10s -``` - -You need to wait for the provisioning to complete, you can monitor the nodes by doing: - -```console -$ vagrant ssh minion-1 -c 'sudo docker images' -kubernetes-minion-1: - REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE - 96864a7d2df3 26 hours ago 204.4 MB - google/cadvisor latest e0575e677c50 13 days ago 12.64 MB - kubernetes/pause latest 6c4579af347b 8 weeks ago 239.8 kB -``` - -Once the docker image for nginx has been downloaded, the container will start and you can list it: - -```console -$ vagrant ssh minion-1 -c 'sudo docker ps' -kubernetes-minion-1: - CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES - dbe79bf6e25b nginx:latest "nginx" 21 seconds ago Up 19 seconds k8s--mynginx.8c5b8a3a--7813c8bd_-_3ffe_-_11e4_-_9036_-_0800279696e1.etcd--7813c8bd_-_3ffe_-_11e4_-_9036_-_0800279696e1--fcfa837f - fa0e29c94501 kubernetes/pause:latest "/pause" 8 minutes ago Up 8 minutes 0.0.0.0:8080->80/tcp k8s--net.a90e7ce4--7813c8bd_-_3ffe_-_11e4_-_9036_-_0800279696e1.etcd--7813c8bd_-_3ffe_-_11e4_-_9036_-_0800279696e1--baf5b21b - aa2ee3ed844a google/cadvisor:latest "/usr/bin/cadvisor" 38 minutes ago Up 38 minutes k8s--cadvisor.9e90d182--cadvisor_-_agent.file--4626b3a2 - 65a3a926f357 kubernetes/pause:latest "/pause" 39 minutes ago Up 39 minutes 0.0.0.0:4194->8080/tcp k8s--net.c5ba7f0e--cadvisor_-_agent.file--342fd561 -``` - -Going back to listing the pods, services and replicationcontrollers, you now have: - -```console -$ ./cluster/kubectl.sh get pods -NAME READY STATUS RESTARTS AGE -my-nginx-5kq0g 1/1 Running 0 1m -my-nginx-gr3hh 1/1 Running 0 1m -my-nginx-xql4j 1/1 Running 0 1m - -$ ./cluster/kubectl.sh get services -NAME LABELS SELECTOR IP(S) PORT(S) - -$ ./cluster/kubectl.sh get replicationcontrollers -CONTROLLER CONTAINER(S) IMAGE(S) SELECTOR REPLICAS -my-nginx my-nginx nginx run=my-nginx 3 -``` - -We did not start any services, hence there are none listed. But we see three replicas displayed properly. -Check the [guestbook](../../examples/guestbook/README.md) application to learn how to create a service. -You can already play with scaling the replicas with: - -```console -$ ./cluster/kubectl.sh scale rc my-nginx --replicas=2 -$ ./cluster/kubectl.sh get pods -NAME READY STATUS RESTARTS AGE -my-nginx-5kq0g 1/1 Running 0 2m -my-nginx-gr3hh 1/1 Running 0 2m -``` - -Congratulations! - -### Troubleshooting - -#### I keep downloading the same (large) box all the time! - -By default the Vagrantfile will download the box from S3. You can change this (and cache the box locally) by providing a name and an alternate URL when calling `kube-up.sh` - -```sh -export KUBERNETES_BOX_NAME=choose_your_own_name_for_your_kuber_box -export KUBERNETES_BOX_URL=path_of_your_kuber_box -export KUBERNETES_PROVIDER=vagrant -./cluster/kube-up.sh -``` - -#### I just created the cluster, but I am getting authorization errors! - -You probably have an incorrect ~/.kubernetes_vagrant_auth file for the cluster you are attempting to contact. - -```sh -rm ~/.kubernetes_vagrant_auth -``` - -After using kubectl.sh make sure that the correct credentials are set: - -```sh -cat ~/.kubernetes_vagrant_auth -``` - -```json -{ - "User": "vagrant", - "Password": "vagrant" -} -``` - -#### I just created the cluster, but I do not see my container running! - -If this is your first time creating the cluster, the kubelet on each node schedules a number of docker pull requests to fetch prerequisite images. This can take some time and as a result may delay your initial pod getting provisioned. - -#### I want to make changes to Kubernetes code! - -To set up a vagrant cluster for hacking, follow the [vagrant developer guide](../devel/developer-guides/vagrant.md). - -#### I have brought Vagrant up but the nodes cannot validate! - -Log on to one of the nodes (`vagrant ssh minion-1`) and inspect the salt minion log (`sudo cat /var/log/salt/minion`). - -#### I want to change the number of nodes! - -You can control the number of nodes that are instantiated via the environment variable `NUM_MINIONS` on your host machine. If you plan to work with replicas, we strongly encourage you to work with enough nodes to satisfy your largest intended replica size. If you do not plan to work with replicas, you can save some system resources by running with a single node. You do this, by setting `NUM_MINIONS` to 1 like so: - -```sh -export NUM_MINIONS=1 -``` - -#### I want my VMs to have more memory! - -You can control the memory allotted to virtual machines with the `KUBERNETES_MEMORY` environment variable. -Just set it to the number of megabytes you would like the machines to have. For example: - -```sh -export KUBERNETES_MEMORY=2048 -``` - -If you need more granular control, you can set the amount of memory for the master and nodes independently. For example: - -```sh -export KUBERNETES_MASTER_MEMORY=1536 -export KUBERNETES_MINION_MEMORY=2048 -``` - -#### I ran vagrant suspend and nothing works! - -`vagrant suspend` seems to mess up the network. This is not supported at this time. - -#### I want vagrant to sync folders via nfs! - -You can ensure that vagrant uses nfs to sync folders with virtual machines by setting the KUBERNETES_VAGRANT_USE_NFS environment variable to 'true'. nfs is faster than virtualbox or vmware's 'shared folders' and does not require guest additions. See the [vagrant docs](http://docs.vagrantup.com/v2/synced-folders/nfs.html) for details on configuring nfs on the host. This setting will have no effect on the libvirt provider, which uses nfs by default. For example: - -```sh -export KUBERNETES_VAGRANT_USE_NFS=true -``` - - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/getting-started-guides/vagrant.md?pixel)]() - diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/vsphere.md b/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/vsphere.md deleted file mode 100644 index c409113edd31..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/getting-started-guides/vsphere.md +++ /dev/null @@ -1,125 +0,0 @@ - - - - -WARNING -WARNING -WARNING -WARNING -WARNING - -

    PLEASE NOTE: This document applies to the HEAD of the source tree

    - -If you are using a released version of Kubernetes, you should -refer to the docs that go with that version. - - -The latest 1.0.x release of this document can be found -[here](http://releases.k8s.io/release-1.0/docs/getting-started-guides/vsphere.md). - -Documentation for other releases can be found at -[releases.k8s.io](http://releases.k8s.io). - --- - - - - -Getting started with vSphere -------------------------------- - -The example below creates a Kubernetes cluster with 4 worker node Virtual -Machines and a master Virtual Machine (i.e. 5 VMs in your cluster). This -cluster is set up and controlled from your workstation (or wherever you find -convenient). - -**Table of Contents** - -- [Prerequisites](#prerequisites) -- [Setup](#setup) -- [Starting a cluster](#starting-a-cluster) -- [Extra: debugging deployment failure](#extra-debugging-deployment-failure) - -### Prerequisites - -1. You need administrator credentials to an ESXi machine or vCenter instance. -2. You must have Go (version 1.2 or later) installed: [www.golang.org](http://www.golang.org). -3. You must have your `GOPATH` set up and include `$GOPATH/bin` in your `PATH`. - - ```sh - export GOPATH=$HOME/src/go - mkdir -p $GOPATH - export PATH=$PATH:$GOPATH/bin - ``` - -4. Install the govc tool to interact with ESXi/vCenter: - - ```sh - go get github.com/vmware/govmomi/govc - ``` - -5. Get or build a [binary release](binary_release.md) - -### Setup - -Download a prebuilt Debian 7.7 VMDK that we'll use as a base image: - -```sh -curl --remote-name-all https://storage.googleapis.com/govmomi/vmdk/2014-11-11/kube.vmdk.gz{,.md5} -md5sum -c kube.vmdk.gz.md5 -gzip -d kube.vmdk.gz -``` - -Import this VMDK into your vSphere datastore: - -```sh -export GOVC_URL='user:pass@hostname' -export GOVC_INSECURE=1 # If the host above uses a self-signed cert -export GOVC_DATASTORE='target datastore' -export GOVC_RESOURCE_POOL='resource pool or cluster with access to datastore' - -govc import.vmdk kube.vmdk ./kube/ -``` - -Verify that the VMDK was correctly uploaded and expanded to ~3GiB: - -```sh -govc datastore.ls ./kube/ -``` - -Take a look at the file `cluster/vsphere/config-common.sh` fill in the required -parameters. The guest login for the image that you imported is `kube:kube`. - -### Starting a cluster - -Now, let's continue with deploying Kubernetes. -This process takes about ~10 minutes. - -```sh -cd kubernetes # Extracted binary release OR repository root -export KUBERNETES_PROVIDER=vsphere -cluster/kube-up.sh -``` - -Refer to the top level README and the getting started guide for Google Compute -Engine. Once you have successfully reached this point, your vSphere Kubernetes -deployment works just as any other one! - -**Enjoy!** - -### Extra: debugging deployment failure - -The output of `kube-up.sh` displays the IP addresses of the VMs it deploys. You -can log into any VM as the `kube` user to poke around and figure out what is -going on (find yourself authorized with your SSH key, or use the password -`kube` otherwise). - - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/getting-started-guides/vsphere.md?pixel)]() - diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/man/man1/.files_generated b/Godeps/_workspace/src/k8s.io/kubernetes/docs/man/man1/.files_generated deleted file mode 100644 index 76219f564803..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/man/man1/.files_generated +++ /dev/null @@ -1,30 +0,0 @@ -kubectl-api-versions.1 -kubectl-attach.1 -kubectl-cluster-info.1 -kubectl-config-set-cluster.1 -kubectl-config-set-context.1 -kubectl-config-set-credentials.1 -kubectl-config-set.1 -kubectl-config-unset.1 -kubectl-config-use-context.1 -kubectl-config-view.1 -kubectl-config.1 -kubectl-create.1 -kubectl-delete.1 -kubectl-describe.1 -kubectl-exec.1 -kubectl-expose.1 -kubectl-get.1 -kubectl-label.1 -kubectl-logs.1 -kubectl-namespace.1 -kubectl-patch.1 -kubectl-port-forward.1 -kubectl-proxy.1 -kubectl-replace.1 -kubectl-rolling-update.1 -kubectl-run.1 -kubectl-scale.1 -kubectl-stop.1 -kubectl-version.1 -kubectl.1 diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/man/man1/kubectl-api-versions.1 b/Godeps/_workspace/src/k8s.io/kubernetes/docs/man/man1/kubectl-api-versions.1 deleted file mode 100644 index c4212fd1d464..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/man/man1/kubectl-api-versions.1 +++ /dev/null @@ -1,130 +0,0 @@ -.TH "KUBERNETES" "1" " kubernetes User Manuals" "Eric Paris" "Jan 2015" "" - - -.SH NAME -.PP -kubectl api\-versions \- Print available API versions. - - -.SH SYNOPSIS -.PP -\fBkubectl api\-versions\fP [OPTIONS] - - -.SH DESCRIPTION -.PP -Print available API versions. - - -.SH OPTIONS -.PP -\fB\-h\fP, \fB\-\-help\fP=false - help for api\-versions - - -.SH OPTIONS INHERITED FROM PARENT COMMANDS -.PP -\fB\-\-alsologtostderr\fP=false - log to standard error as well as files - -.PP -\fB\-\-api\-version\fP="" - The API version to use when talking to the server - -.PP -\fB\-\-certificate\-authority\fP="" - Path to a cert. file for the certificate authority. - -.PP -\fB\-\-client\-certificate\fP="" - Path to a client key file for TLS. - -.PP -\fB\-\-client\-key\fP="" - Path to a client key file for TLS. - -.PP -\fB\-\-cluster\fP="" - The name of the kubeconfig cluster to use - -.PP -\fB\-\-context\fP="" - The name of the kubeconfig context to use - -.PP -\fB\-\-insecure\-skip\-tls\-verify\fP=false - If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure. - -.PP -\fB\-\-kubeconfig\fP="" - Path to the kubeconfig file to use for CLI requests. - -.PP -\fB\-\-log\-backtrace\-at\fP=:0 - when logging hits line file:N, emit a stack trace - -.PP -\fB\-\-log\-dir\fP="" - If non\-empty, write log files in this directory - -.PP -\fB\-\-log\-flush\-frequency\fP=5s - Maximum number of seconds between log flushes - -.PP -\fB\-\-logtostderr\fP=true - log to standard error instead of files - -.PP -\fB\-\-match\-server\-version\fP=false - Require server version to match client version - -.PP -\fB\-\-namespace\fP="" - If present, the namespace scope for this CLI request. - -.PP -\fB\-\-password\fP="" - Password for basic authentication to the API server. - -.PP -\fB\-s\fP, \fB\-\-server\fP="" - The address and port of the Kubernetes API server - -.PP -\fB\-\-stderrthreshold\fP=2 - logs at or above this threshold go to stderr - -.PP -\fB\-\-token\fP="" - Bearer token for authentication to the API server. - -.PP -\fB\-\-user\fP="" - The name of the kubeconfig user to use - -.PP -\fB\-\-username\fP="" - Username for basic authentication to the API server. - -.PP -\fB\-\-v\fP=0 - log level for V logs - -.PP -\fB\-\-validate\fP=false - If true, use a schema to validate the input before sending it - -.PP -\fB\-\-vmodule\fP= - comma\-separated list of pattern=N settings for file\-filtered logging - - -.SH SEE ALSO -.PP -\fBkubectl(1)\fP, - - -.SH HISTORY -.PP -January 2015, Originally compiled by Eric Paris (eparis at redhat dot com) based on the kubernetes source material, but hopefully they have been automatically generated since! diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/man/man1/kubectl-attach.1 b/Godeps/_workspace/src/k8s.io/kubernetes/docs/man/man1/kubectl-attach.1 deleted file mode 100644 index 861cfb8b2a73..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/man/man1/kubectl-attach.1 +++ /dev/null @@ -1,161 +0,0 @@ -.TH "KUBERNETES" "1" " kubernetes User Manuals" "Eric Paris" "Jan 2015" "" - - -.SH NAME -.PP -kubectl attach \- Attach to a running container. - - -.SH SYNOPSIS -.PP -\fBkubectl attach\fP [OPTIONS] - - -.SH DESCRIPTION -.PP -Attach to a a process that is already running inside an existing container. - - -.SH OPTIONS -.PP -\fB\-c\fP, \fB\-\-container\fP="" - Container name - -.PP -\fB\-h\fP, \fB\-\-help\fP=false - help for attach - -.PP -\fB\-i\fP, \fB\-\-stdin\fP=false - Pass stdin to the container - -.PP -\fB\-t\fP, \fB\-\-tty\fP=false - Stdin is a TTY - - -.SH OPTIONS INHERITED FROM PARENT COMMANDS -.PP -\fB\-\-alsologtostderr\fP=false - log to standard error as well as files - -.PP -\fB\-\-api\-version\fP="" - The API version to use when talking to the server - -.PP -\fB\-\-certificate\-authority\fP="" - Path to a cert. file for the certificate authority. - -.PP -\fB\-\-client\-certificate\fP="" - Path to a client key file for TLS. - -.PP -\fB\-\-client\-key\fP="" - Path to a client key file for TLS. - -.PP -\fB\-\-cluster\fP="" - The name of the kubeconfig cluster to use - -.PP -\fB\-\-context\fP="" - The name of the kubeconfig context to use - -.PP -\fB\-\-insecure\-skip\-tls\-verify\fP=false - If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure. - -.PP -\fB\-\-kubeconfig\fP="" - Path to the kubeconfig file to use for CLI requests. - -.PP -\fB\-\-log\-backtrace\-at\fP=:0 - when logging hits line file:N, emit a stack trace - -.PP -\fB\-\-log\-dir\fP="" - If non\-empty, write log files in this directory - -.PP -\fB\-\-log\-flush\-frequency\fP=5s - Maximum number of seconds between log flushes - -.PP -\fB\-\-logtostderr\fP=true - log to standard error instead of files - -.PP -\fB\-\-match\-server\-version\fP=false - Require server version to match client version - -.PP -\fB\-\-namespace\fP="" - If present, the namespace scope for this CLI request. - -.PP -\fB\-\-password\fP="" - Password for basic authentication to the API server. - -.PP -\fB\-s\fP, \fB\-\-server\fP="" - The address and port of the Kubernetes API server - -.PP -\fB\-\-stderrthreshold\fP=2 - logs at or above this threshold go to stderr - -.PP -\fB\-\-token\fP="" - Bearer token for authentication to the API server. - -.PP -\fB\-\-user\fP="" - The name of the kubeconfig user to use - -.PP -\fB\-\-username\fP="" - Username for basic authentication to the API server. - -.PP -\fB\-\-v\fP=0 - log level for V logs - -.PP -\fB\-\-validate\fP=false - If true, use a schema to validate the input before sending it - -.PP -\fB\-\-vmodule\fP= - comma\-separated list of pattern=N settings for file\-filtered logging - - -.SH EXAMPLE -.PP -.RS - -.nf -// get output from running pod 123456\-7890, using the first container by default -$ kubectl attach 123456\-7890 - -// get output from ruby\-container from pod 123456\-7890 -$ kubectl attach 123456\-7890 \-c ruby\-container date - -// switch to raw terminal mode, sends stdin to 'bash' in ruby\-container from pod 123456\-780 -// and sends stdout/stderr from 'bash' back to the client -$ kubectl attach 123456\-7890 \-c ruby\-container \-i \-t - -.fi -.RE - - -.SH SEE ALSO -.PP -\fBkubectl(1)\fP, - - -.SH HISTORY -.PP -January 2015, Originally compiled by Eric Paris (eparis at redhat dot com) based on the kubernetes source material, but hopefully they have been automatically generated since! diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/man/man1/kubectl-cluster-info.1 b/Godeps/_workspace/src/k8s.io/kubernetes/docs/man/man1/kubectl-cluster-info.1 deleted file mode 100644 index 3f64ae37ab10..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/man/man1/kubectl-cluster-info.1 +++ /dev/null @@ -1,130 +0,0 @@ -.TH "KUBERNETES" "1" " kubernetes User Manuals" "Eric Paris" "Jan 2015" "" - - -.SH NAME -.PP -kubectl cluster\-info \- Display cluster info - - -.SH SYNOPSIS -.PP -\fBkubectl cluster\-info\fP [OPTIONS] - - -.SH DESCRIPTION -.PP -Display addresses of the master and services with label kubernetes.io/cluster\-service=true - - -.SH OPTIONS -.PP -\fB\-h\fP, \fB\-\-help\fP=false - help for cluster\-info - - -.SH OPTIONS INHERITED FROM PARENT COMMANDS -.PP -\fB\-\-alsologtostderr\fP=false - log to standard error as well as files - -.PP -\fB\-\-api\-version\fP="" - The API version to use when talking to the server - -.PP -\fB\-\-certificate\-authority\fP="" - Path to a cert. file for the certificate authority. - -.PP -\fB\-\-client\-certificate\fP="" - Path to a client key file for TLS. - -.PP -\fB\-\-client\-key\fP="" - Path to a client key file for TLS. - -.PP -\fB\-\-cluster\fP="" - The name of the kubeconfig cluster to use - -.PP -\fB\-\-context\fP="" - The name of the kubeconfig context to use - -.PP -\fB\-\-insecure\-skip\-tls\-verify\fP=false - If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure. - -.PP -\fB\-\-kubeconfig\fP="" - Path to the kubeconfig file to use for CLI requests. - -.PP -\fB\-\-log\-backtrace\-at\fP=:0 - when logging hits line file:N, emit a stack trace - -.PP -\fB\-\-log\-dir\fP="" - If non\-empty, write log files in this directory - -.PP -\fB\-\-log\-flush\-frequency\fP=5s - Maximum number of seconds between log flushes - -.PP -\fB\-\-logtostderr\fP=true - log to standard error instead of files - -.PP -\fB\-\-match\-server\-version\fP=false - Require server version to match client version - -.PP -\fB\-\-namespace\fP="" - If present, the namespace scope for this CLI request. - -.PP -\fB\-\-password\fP="" - Password for basic authentication to the API server. - -.PP -\fB\-s\fP, \fB\-\-server\fP="" - The address and port of the Kubernetes API server - -.PP -\fB\-\-stderrthreshold\fP=2 - logs at or above this threshold go to stderr - -.PP -\fB\-\-token\fP="" - Bearer token for authentication to the API server. - -.PP -\fB\-\-user\fP="" - The name of the kubeconfig user to use - -.PP -\fB\-\-username\fP="" - Username for basic authentication to the API server. - -.PP -\fB\-\-v\fP=0 - log level for V logs - -.PP -\fB\-\-validate\fP=false - If true, use a schema to validate the input before sending it - -.PP -\fB\-\-vmodule\fP= - comma\-separated list of pattern=N settings for file\-filtered logging - - -.SH SEE ALSO -.PP -\fBkubectl(1)\fP, - - -.SH HISTORY -.PP -January 2015, Originally compiled by Eric Paris (eparis at redhat dot com) based on the kubernetes source material, but hopefully they have been automatically generated since! diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/man/man1/kubectl-config-set-cluster.1 b/Godeps/_workspace/src/k8s.io/kubernetes/docs/man/man1/kubectl-config-set-cluster.1 deleted file mode 100644 index 374e37bbad7c..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/man/man1/kubectl-config-set-cluster.1 +++ /dev/null @@ -1,153 +0,0 @@ -.TH "KUBERNETES" "1" " kubernetes User Manuals" "Eric Paris" "Jan 2015" "" - - -.SH NAME -.PP -kubectl config set\-cluster \- Sets a cluster entry in kubeconfig - - -.SH SYNOPSIS -.PP -\fBkubectl config set\-cluster\fP [OPTIONS] - - -.SH DESCRIPTION -.PP -Sets a cluster entry in kubeconfig. -Specifying a name that already exists will merge new fields on top of existing values for those fields. - - -.SH OPTIONS -.PP -\fB\-\-api\-version\fP="" - api\-version for the cluster entry in kubeconfig - -.PP -\fB\-\-certificate\-authority\fP="" - path to certificate\-authority for the cluster entry in kubeconfig - -.PP -\fB\-\-embed\-certs\fP=false - embed\-certs for the cluster entry in kubeconfig - -.PP -\fB\-h\fP, \fB\-\-help\fP=false - help for set\-cluster - -.PP -\fB\-\-insecure\-skip\-tls\-verify\fP=false - insecure\-skip\-tls\-verify for the cluster entry in kubeconfig - -.PP -\fB\-\-server\fP="" - server for the cluster entry in kubeconfig - - -.SH OPTIONS INHERITED FROM PARENT COMMANDS -.PP -\fB\-\-alsologtostderr\fP=false - log to standard error as well as files - -.PP -\fB\-\-client\-certificate\fP="" - Path to a client key file for TLS. - -.PP -\fB\-\-client\-key\fP="" - Path to a client key file for TLS. - -.PP -\fB\-\-cluster\fP="" - The name of the kubeconfig cluster to use - -.PP -\fB\-\-context\fP="" - The name of the kubeconfig context to use - -.PP -\fB\-\-kubeconfig\fP="" - use a particular kubeconfig file - -.PP -\fB\-\-log\-backtrace\-at\fP=:0 - when logging hits line file:N, emit a stack trace - -.PP -\fB\-\-log\-dir\fP="" - If non\-empty, write log files in this directory - -.PP -\fB\-\-log\-flush\-frequency\fP=5s - Maximum number of seconds between log flushes - -.PP -\fB\-\-logtostderr\fP=true - log to standard error instead of files - -.PP -\fB\-\-match\-server\-version\fP=false - Require server version to match client version - -.PP -\fB\-\-namespace\fP="" - If present, the namespace scope for this CLI request. - -.PP -\fB\-\-password\fP="" - Password for basic authentication to the API server. - -.PP -\fB\-\-stderrthreshold\fP=2 - logs at or above this threshold go to stderr - -.PP -\fB\-\-token\fP="" - Bearer token for authentication to the API server. - -.PP -\fB\-\-user\fP="" - The name of the kubeconfig user to use - -.PP -\fB\-\-username\fP="" - Username for basic authentication to the API server. - -.PP -\fB\-\-v\fP=0 - log level for V logs - -.PP -\fB\-\-validate\fP=false - If true, use a schema to validate the input before sending it - -.PP -\fB\-\-vmodule\fP= - comma\-separated list of pattern=N settings for file\-filtered logging - - -.SH EXAMPLE -.PP -.RS - -.nf -// Set only the server field on the e2e cluster entry without touching other values. -$ kubectl config set\-cluster e2e \-\-server=https://1.2.3.4 - -// Embed certificate authority data for the e2e cluster entry -$ kubectl config set\-cluster e2e \-\-certificate\-authority=\~/.kube/e2e/kubernetes.ca.crt - -// Disable cert checking for the dev cluster entry -$ kubectl config set\-cluster e2e \-\-insecure\-skip\-tls\-verify=true - -.fi -.RE - - -.SH SEE ALSO -.PP -\fBkubectl\-config(1)\fP, - - -.SH HISTORY -.PP -January 2015, Originally compiled by Eric Paris (eparis at redhat dot com) based on the kubernetes source material, but hopefully they have been automatically generated since! diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/man/man1/kubectl-config-set-context.1 b/Godeps/_workspace/src/k8s.io/kubernetes/docs/man/man1/kubectl-config-set-context.1 deleted file mode 100644 index 4e7928418ed8..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/man/man1/kubectl-config-set-context.1 +++ /dev/null @@ -1,143 +0,0 @@ -.TH "KUBERNETES" "1" " kubernetes User Manuals" "Eric Paris" "Jan 2015" "" - - -.SH NAME -.PP -kubectl config set\-context \- Sets a context entry in kubeconfig - - -.SH SYNOPSIS -.PP -\fBkubectl config set\-context\fP [OPTIONS] - - -.SH DESCRIPTION -.PP -Sets a context entry in kubeconfig -Specifying a name that already exists will merge new fields on top of existing values for those fields. - - -.SH OPTIONS -.PP -\fB\-\-cluster\fP="" - cluster for the context entry in kubeconfig - -.PP -\fB\-h\fP, \fB\-\-help\fP=false - help for set\-context - -.PP -\fB\-\-namespace\fP="" - namespace for the context entry in kubeconfig - -.PP -\fB\-\-user\fP="" - user for the context entry in kubeconfig - - -.SH OPTIONS INHERITED FROM PARENT COMMANDS -.PP -\fB\-\-alsologtostderr\fP=false - log to standard error as well as files - -.PP -\fB\-\-api\-version\fP="" - The API version to use when talking to the server - -.PP -\fB\-\-certificate\-authority\fP="" - Path to a cert. file for the certificate authority. - -.PP -\fB\-\-client\-certificate\fP="" - Path to a client key file for TLS. - -.PP -\fB\-\-client\-key\fP="" - Path to a client key file for TLS. - -.PP -\fB\-\-context\fP="" - The name of the kubeconfig context to use - -.PP -\fB\-\-insecure\-skip\-tls\-verify\fP=false - If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure. - -.PP -\fB\-\-kubeconfig\fP="" - use a particular kubeconfig file - -.PP -\fB\-\-log\-backtrace\-at\fP=:0 - when logging hits line file:N, emit a stack trace - -.PP -\fB\-\-log\-dir\fP="" - If non\-empty, write log files in this directory - -.PP -\fB\-\-log\-flush\-frequency\fP=5s - Maximum number of seconds between log flushes - -.PP -\fB\-\-logtostderr\fP=true - log to standard error instead of files - -.PP -\fB\-\-match\-server\-version\fP=false - Require server version to match client version - -.PP -\fB\-\-password\fP="" - Password for basic authentication to the API server. - -.PP -\fB\-s\fP, \fB\-\-server\fP="" - The address and port of the Kubernetes API server - -.PP -\fB\-\-stderrthreshold\fP=2 - logs at or above this threshold go to stderr - -.PP -\fB\-\-token\fP="" - Bearer token for authentication to the API server. - -.PP -\fB\-\-username\fP="" - Username for basic authentication to the API server. - -.PP -\fB\-\-v\fP=0 - log level for V logs - -.PP -\fB\-\-validate\fP=false - If true, use a schema to validate the input before sending it - -.PP -\fB\-\-vmodule\fP= - comma\-separated list of pattern=N settings for file\-filtered logging - - -.SH EXAMPLE -.PP -.RS - -.nf -// Set the user field on the gce context entry without touching other values -$ kubectl config set\-context gce \-\-user=cluster\-admin - -.fi -.RE - - -.SH SEE ALSO -.PP -\fBkubectl\-config(1)\fP, - - -.SH HISTORY -.PP -January 2015, Originally compiled by Eric Paris (eparis at redhat dot com) based on the kubernetes source material, but hopefully they have been automatically generated since! diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/man/man1/kubectl-config-set-credentials.1 b/Godeps/_workspace/src/k8s.io/kubernetes/docs/man/man1/kubectl-config-set-credentials.1 deleted file mode 100644 index d025d9119d96..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/man/man1/kubectl-config-set-credentials.1 +++ /dev/null @@ -1,169 +0,0 @@ -.TH "KUBERNETES" "1" " kubernetes User Manuals" "Eric Paris" "Jan 2015" "" - - -.SH NAME -.PP -kubectl config set\-credentials \- Sets a user entry in kubeconfig - - -.SH SYNOPSIS -.PP -\fBkubectl config set\-credentials\fP [OPTIONS] - - -.SH DESCRIPTION -.PP -Sets a user entry in kubeconfig -Specifying a name that already exists will merge new fields on top of existing values. - -.PP -Client\-certificate flags: - \-\-client\-certificate=certfile \-\-client\-key=keyfile - -.PP -Bearer token flags: - \-\-token=bearer\_token - -.PP -Basic auth flags: - \-\-username=basic\_user \-\-password=basic\_password - -.PP -Bearer token and basic auth are mutually exclusive. - - -.SH OPTIONS -.PP -\fB\-\-client\-certificate\fP="" - path to client\-certificate for the user entry in kubeconfig - -.PP -\fB\-\-client\-key\fP="" - path to client\-key for the user entry in kubeconfig - -.PP -\fB\-\-embed\-certs\fP=false - embed client cert/key for the user entry in kubeconfig - -.PP -\fB\-h\fP, \fB\-\-help\fP=false - help for set\-credentials - -.PP -\fB\-\-password\fP="" - password for the user entry in kubeconfig - -.PP -\fB\-\-token\fP="" - token for the user entry in kubeconfig - -.PP -\fB\-\-username\fP="" - username for the user entry in kubeconfig - - -.SH OPTIONS INHERITED FROM PARENT COMMANDS -.PP -\fB\-\-alsologtostderr\fP=false - log to standard error as well as files - -.PP -\fB\-\-api\-version\fP="" - The API version to use when talking to the server - -.PP -\fB\-\-certificate\-authority\fP="" - Path to a cert. file for the certificate authority. - -.PP -\fB\-\-cluster\fP="" - The name of the kubeconfig cluster to use - -.PP -\fB\-\-context\fP="" - The name of the kubeconfig context to use - -.PP -\fB\-\-insecure\-skip\-tls\-verify\fP=false - If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure. - -.PP -\fB\-\-kubeconfig\fP="" - use a particular kubeconfig file - -.PP -\fB\-\-log\-backtrace\-at\fP=:0 - when logging hits line file:N, emit a stack trace - -.PP -\fB\-\-log\-dir\fP="" - If non\-empty, write log files in this directory - -.PP -\fB\-\-log\-flush\-frequency\fP=5s - Maximum number of seconds between log flushes - -.PP -\fB\-\-logtostderr\fP=true - log to standard error instead of files - -.PP -\fB\-\-match\-server\-version\fP=false - Require server version to match client version - -.PP -\fB\-\-namespace\fP="" - If present, the namespace scope for this CLI request. - -.PP -\fB\-s\fP, \fB\-\-server\fP="" - The address and port of the Kubernetes API server - -.PP -\fB\-\-stderrthreshold\fP=2 - logs at or above this threshold go to stderr - -.PP -\fB\-\-user\fP="" - The name of the kubeconfig user to use - -.PP -\fB\-\-v\fP=0 - log level for V logs - -.PP -\fB\-\-validate\fP=false - If true, use a schema to validate the input before sending it - -.PP -\fB\-\-vmodule\fP= - comma\-separated list of pattern=N settings for file\-filtered logging - - -.SH EXAMPLE -.PP -.RS - -.nf -// Set only the "client\-key" field on the "cluster\-admin" -// entry, without touching other values: -$ kubectl config set\-credentials cluster\-admin \-\-client\-key=\~/.kube/admin.key - -// Set basic auth for the "cluster\-admin" entry -$ kubectl config set\-credentials cluster\-admin \-\-username=admin \-\-password=uXFGweU9l35qcif - -// Embed client certificate data in the "cluster\-admin" entry -$ kubectl config set\-credentials cluster\-admin \-\-client\-certificate=\~/.kube/admin.crt \-\-embed\-certs=true - -.fi -.RE - - -.SH SEE ALSO -.PP -\fBkubectl\-config(1)\fP, - - -.SH HISTORY -.PP -January 2015, Originally compiled by Eric Paris (eparis at redhat dot com) based on the kubernetes source material, but hopefully they have been automatically generated since! diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/man/man1/kubectl-config-set.1 b/Godeps/_workspace/src/k8s.io/kubernetes/docs/man/man1/kubectl-config-set.1 deleted file mode 100644 index f83ea2edaa26..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/man/man1/kubectl-config-set.1 +++ /dev/null @@ -1,132 +0,0 @@ -.TH "KUBERNETES" "1" " kubernetes User Manuals" "Eric Paris" "Jan 2015" "" - - -.SH NAME -.PP -kubectl config set \- Sets an individual value in a kubeconfig file - - -.SH SYNOPSIS -.PP -\fBkubectl config set\fP [OPTIONS] - - -.SH DESCRIPTION -.PP -Sets an individual value in a kubeconfig file -PROPERTY\_NAME is a dot delimited name where each token represents either a attribute name or a map key. Map keys may not contain dots. -PROPERTY\_VALUE is the new value you wish to set. - - -.SH OPTIONS -.PP -\fB\-h\fP, \fB\-\-help\fP=false - help for set - - -.SH OPTIONS INHERITED FROM PARENT COMMANDS -.PP -\fB\-\-alsologtostderr\fP=false - log to standard error as well as files - -.PP -\fB\-\-api\-version\fP="" - The API version to use when talking to the server - -.PP -\fB\-\-certificate\-authority\fP="" - Path to a cert. file for the certificate authority. - -.PP -\fB\-\-client\-certificate\fP="" - Path to a client key file for TLS. - -.PP -\fB\-\-client\-key\fP="" - Path to a client key file for TLS. - -.PP -\fB\-\-cluster\fP="" - The name of the kubeconfig cluster to use - -.PP -\fB\-\-context\fP="" - The name of the kubeconfig context to use - -.PP -\fB\-\-insecure\-skip\-tls\-verify\fP=false - If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure. - -.PP -\fB\-\-kubeconfig\fP="" - use a particular kubeconfig file - -.PP -\fB\-\-log\-backtrace\-at\fP=:0 - when logging hits line file:N, emit a stack trace - -.PP -\fB\-\-log\-dir\fP="" - If non\-empty, write log files in this directory - -.PP -\fB\-\-log\-flush\-frequency\fP=5s - Maximum number of seconds between log flushes - -.PP -\fB\-\-logtostderr\fP=true - log to standard error instead of files - -.PP -\fB\-\-match\-server\-version\fP=false - Require server version to match client version - -.PP -\fB\-\-namespace\fP="" - If present, the namespace scope for this CLI request. - -.PP -\fB\-\-password\fP="" - Password for basic authentication to the API server. - -.PP -\fB\-s\fP, \fB\-\-server\fP="" - The address and port of the Kubernetes API server - -.PP -\fB\-\-stderrthreshold\fP=2 - logs at or above this threshold go to stderr - -.PP -\fB\-\-token\fP="" - Bearer token for authentication to the API server. - -.PP -\fB\-\-user\fP="" - The name of the kubeconfig user to use - -.PP -\fB\-\-username\fP="" - Username for basic authentication to the API server. - -.PP -\fB\-\-v\fP=0 - log level for V logs - -.PP -\fB\-\-validate\fP=false - If true, use a schema to validate the input before sending it - -.PP -\fB\-\-vmodule\fP= - comma\-separated list of pattern=N settings for file\-filtered logging - - -.SH SEE ALSO -.PP -\fBkubectl\-config(1)\fP, - - -.SH HISTORY -.PP -January 2015, Originally compiled by Eric Paris (eparis at redhat dot com) based on the kubernetes source material, but hopefully they have been automatically generated since! diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/man/man1/kubectl-config-unset.1 b/Godeps/_workspace/src/k8s.io/kubernetes/docs/man/man1/kubectl-config-unset.1 deleted file mode 100644 index cea12d2e81ab..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/man/man1/kubectl-config-unset.1 +++ /dev/null @@ -1,131 +0,0 @@ -.TH "KUBERNETES" "1" " kubernetes User Manuals" "Eric Paris" "Jan 2015" "" - - -.SH NAME -.PP -kubectl config unset \- Unsets an individual value in a kubeconfig file - - -.SH SYNOPSIS -.PP -\fBkubectl config unset\fP [OPTIONS] - - -.SH DESCRIPTION -.PP -Unsets an individual value in a kubeconfig file -PROPERTY\_NAME is a dot delimited name where each token represents either a attribute name or a map key. Map keys may not contain dots. - - -.SH OPTIONS -.PP -\fB\-h\fP, \fB\-\-help\fP=false - help for unset - - -.SH OPTIONS INHERITED FROM PARENT COMMANDS -.PP -\fB\-\-alsologtostderr\fP=false - log to standard error as well as files - -.PP -\fB\-\-api\-version\fP="" - The API version to use when talking to the server - -.PP -\fB\-\-certificate\-authority\fP="" - Path to a cert. file for the certificate authority. - -.PP -\fB\-\-client\-certificate\fP="" - Path to a client key file for TLS. - -.PP -\fB\-\-client\-key\fP="" - Path to a client key file for TLS. - -.PP -\fB\-\-cluster\fP="" - The name of the kubeconfig cluster to use - -.PP -\fB\-\-context\fP="" - The name of the kubeconfig context to use - -.PP -\fB\-\-insecure\-skip\-tls\-verify\fP=false - If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure. - -.PP -\fB\-\-kubeconfig\fP="" - use a particular kubeconfig file - -.PP -\fB\-\-log\-backtrace\-at\fP=:0 - when logging hits line file:N, emit a stack trace - -.PP -\fB\-\-log\-dir\fP="" - If non\-empty, write log files in this directory - -.PP -\fB\-\-log\-flush\-frequency\fP=5s - Maximum number of seconds between log flushes - -.PP -\fB\-\-logtostderr\fP=true - log to standard error instead of files - -.PP -\fB\-\-match\-server\-version\fP=false - Require server version to match client version - -.PP -\fB\-\-namespace\fP="" - If present, the namespace scope for this CLI request. - -.PP -\fB\-\-password\fP="" - Password for basic authentication to the API server. - -.PP -\fB\-s\fP, \fB\-\-server\fP="" - The address and port of the Kubernetes API server - -.PP -\fB\-\-stderrthreshold\fP=2 - logs at or above this threshold go to stderr - -.PP -\fB\-\-token\fP="" - Bearer token for authentication to the API server. - -.PP -\fB\-\-user\fP="" - The name of the kubeconfig user to use - -.PP -\fB\-\-username\fP="" - Username for basic authentication to the API server. - -.PP -\fB\-\-v\fP=0 - log level for V logs - -.PP -\fB\-\-validate\fP=false - If true, use a schema to validate the input before sending it - -.PP -\fB\-\-vmodule\fP= - comma\-separated list of pattern=N settings for file\-filtered logging - - -.SH SEE ALSO -.PP -\fBkubectl\-config(1)\fP, - - -.SH HISTORY -.PP -January 2015, Originally compiled by Eric Paris (eparis at redhat dot com) based on the kubernetes source material, but hopefully they have been automatically generated since! diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/man/man1/kubectl-config-use-context.1 b/Godeps/_workspace/src/k8s.io/kubernetes/docs/man/man1/kubectl-config-use-context.1 deleted file mode 100644 index 4ae194bd2a6c..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/man/man1/kubectl-config-use-context.1 +++ /dev/null @@ -1,130 +0,0 @@ -.TH "KUBERNETES" "1" " kubernetes User Manuals" "Eric Paris" "Jan 2015" "" - - -.SH NAME -.PP -kubectl config use\-context \- Sets the current\-context in a kubeconfig file - - -.SH SYNOPSIS -.PP -\fBkubectl config use\-context\fP [OPTIONS] - - -.SH DESCRIPTION -.PP -Sets the current\-context in a kubeconfig file - - -.SH OPTIONS -.PP -\fB\-h\fP, \fB\-\-help\fP=false - help for use\-context - - -.SH OPTIONS INHERITED FROM PARENT COMMANDS -.PP -\fB\-\-alsologtostderr\fP=false - log to standard error as well as files - -.PP -\fB\-\-api\-version\fP="" - The API version to use when talking to the server - -.PP -\fB\-\-certificate\-authority\fP="" - Path to a cert. file for the certificate authority. - -.PP -\fB\-\-client\-certificate\fP="" - Path to a client key file for TLS. - -.PP -\fB\-\-client\-key\fP="" - Path to a client key file for TLS. - -.PP -\fB\-\-cluster\fP="" - The name of the kubeconfig cluster to use - -.PP -\fB\-\-context\fP="" - The name of the kubeconfig context to use - -.PP -\fB\-\-insecure\-skip\-tls\-verify\fP=false - If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure. - -.PP -\fB\-\-kubeconfig\fP="" - use a particular kubeconfig file - -.PP -\fB\-\-log\-backtrace\-at\fP=:0 - when logging hits line file:N, emit a stack trace - -.PP -\fB\-\-log\-dir\fP="" - If non\-empty, write log files in this directory - -.PP -\fB\-\-log\-flush\-frequency\fP=5s - Maximum number of seconds between log flushes - -.PP -\fB\-\-logtostderr\fP=true - log to standard error instead of files - -.PP -\fB\-\-match\-server\-version\fP=false - Require server version to match client version - -.PP -\fB\-\-namespace\fP="" - If present, the namespace scope for this CLI request. - -.PP -\fB\-\-password\fP="" - Password for basic authentication to the API server. - -.PP -\fB\-s\fP, \fB\-\-server\fP="" - The address and port of the Kubernetes API server - -.PP -\fB\-\-stderrthreshold\fP=2 - logs at or above this threshold go to stderr - -.PP -\fB\-\-token\fP="" - Bearer token for authentication to the API server. - -.PP -\fB\-\-user\fP="" - The name of the kubeconfig user to use - -.PP -\fB\-\-username\fP="" - Username for basic authentication to the API server. - -.PP -\fB\-\-v\fP=0 - log level for V logs - -.PP -\fB\-\-validate\fP=false - If true, use a schema to validate the input before sending it - -.PP -\fB\-\-vmodule\fP= - comma\-separated list of pattern=N settings for file\-filtered logging - - -.SH SEE ALSO -.PP -\fBkubectl\-config(1)\fP, - - -.SH HISTORY -.PP -January 2015, Originally compiled by Eric Paris (eparis at redhat dot com) based on the kubernetes source material, but hopefully they have been automatically generated since! diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/man/man1/kubectl-config-view.1 b/Godeps/_workspace/src/k8s.io/kubernetes/docs/man/man1/kubectl-config-view.1 deleted file mode 100644 index 7d3f21e43ab1..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/man/man1/kubectl-config-view.1 +++ /dev/null @@ -1,181 +0,0 @@ -.TH "KUBERNETES" "1" " kubernetes User Manuals" "Eric Paris" "Jan 2015" "" - - -.SH NAME -.PP -kubectl config view \- displays Merged kubeconfig settings or a specified kubeconfig file. - - -.SH SYNOPSIS -.PP -\fBkubectl config view\fP [OPTIONS] - - -.SH DESCRIPTION -.PP -displays Merged kubeconfig settings or a specified kubeconfig file. - -.PP -You can use \-\-output=template \-\-template=TEMPLATE to extract specific values. - - -.SH OPTIONS -.PP -\fB\-\-flatten\fP=false - flatten the resulting kubeconfig file into self contained output (useful for creating portable kubeconfig files) - -.PP -\fB\-h\fP, \fB\-\-help\fP=false - help for view - -.PP -\fB\-\-merge\fP=true - merge together the full hierarchy of kubeconfig files - -.PP -\fB\-\-minify\fP=false - remove all information not used by current\-context from the output - -.PP -\fB\-\-no\-headers\fP=false - When using the default output, don't print headers. - -.PP -\fB\-o\fP, \fB\-\-output\fP="" - Output format. One of: json|yaml|template|templatefile|wide. - -.PP -\fB\-\-output\-version\fP="" - Output the formatted object with the given version (default api\-version). - -.PP -\fB\-\-raw\fP=false - display raw byte data - -.PP -\fB\-t\fP, \fB\-\-template\fP="" - Template string or path to template file to use when \-o=template or \-o=templatefile. The template format is golang templates [ -\[la]http://golang.org/pkg/text/template/#pkg-overview\[ra]] - - -.SH OPTIONS INHERITED FROM PARENT COMMANDS -.PP -\fB\-\-alsologtostderr\fP=false - log to standard error as well as files - -.PP -\fB\-\-api\-version\fP="" - The API version to use when talking to the server - -.PP -\fB\-\-certificate\-authority\fP="" - Path to a cert. file for the certificate authority. - -.PP -\fB\-\-client\-certificate\fP="" - Path to a client key file for TLS. - -.PP -\fB\-\-client\-key\fP="" - Path to a client key file for TLS. - -.PP -\fB\-\-cluster\fP="" - The name of the kubeconfig cluster to use - -.PP -\fB\-\-context\fP="" - The name of the kubeconfig context to use - -.PP -\fB\-\-insecure\-skip\-tls\-verify\fP=false - If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure. - -.PP -\fB\-\-kubeconfig\fP="" - use a particular kubeconfig file - -.PP -\fB\-\-log\-backtrace\-at\fP=:0 - when logging hits line file:N, emit a stack trace - -.PP -\fB\-\-log\-dir\fP="" - If non\-empty, write log files in this directory - -.PP -\fB\-\-log\-flush\-frequency\fP=5s - Maximum number of seconds between log flushes - -.PP -\fB\-\-logtostderr\fP=true - log to standard error instead of files - -.PP -\fB\-\-match\-server\-version\fP=false - Require server version to match client version - -.PP -\fB\-\-namespace\fP="" - If present, the namespace scope for this CLI request. - -.PP -\fB\-\-password\fP="" - Password for basic authentication to the API server. - -.PP -\fB\-s\fP, \fB\-\-server\fP="" - The address and port of the Kubernetes API server - -.PP -\fB\-\-stderrthreshold\fP=2 - logs at or above this threshold go to stderr - -.PP -\fB\-\-token\fP="" - Bearer token for authentication to the API server. - -.PP -\fB\-\-user\fP="" - The name of the kubeconfig user to use - -.PP -\fB\-\-username\fP="" - Username for basic authentication to the API server. - -.PP -\fB\-\-v\fP=0 - log level for V logs - -.PP -\fB\-\-validate\fP=false - If true, use a schema to validate the input before sending it - -.PP -\fB\-\-vmodule\fP= - comma\-separated list of pattern=N settings for file\-filtered logging - - -.SH EXAMPLE -.PP -.RS - -.nf -// Show Merged kubeconfig settings. -$ kubectl config view - -// Get the password for the e2e user -$ kubectl config view \-o template \-\-template='\{\{range .users\}\}\{\{ if eq .name "e2e" \}\}\{\{ index .user.password \}\}\{\{end\}\}\{\{end\}\}' - -.fi -.RE - - -.SH SEE ALSO -.PP -\fBkubectl\-config(1)\fP, - - -.SH HISTORY -.PP -January 2015, Originally compiled by Eric Paris (eparis at redhat dot com) based on the kubernetes source material, but hopefully they have been automatically generated since! diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/man/man1/kubectl-config.1 b/Godeps/_workspace/src/k8s.io/kubernetes/docs/man/man1/kubectl-config.1 deleted file mode 100644 index 66eb5e8a1a2e..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/man/man1/kubectl-config.1 +++ /dev/null @@ -1,136 +0,0 @@ -.TH "KUBERNETES" "1" " kubernetes User Manuals" "Eric Paris" "Jan 2015" "" - - -.SH NAME -.PP -kubectl config \- config modifies kubeconfig files - - -.SH SYNOPSIS -.PP -\fBkubectl config\fP [OPTIONS] - - -.SH DESCRIPTION -.PP -config modifies kubeconfig files using subcommands like "kubectl config set current\-context my\-context" - -.PP -The loading order follows these rules: - 1. If the \-\-kubeconfig flag is set, then only that file is loaded. The flag may only be set once and no merging takes place. - 2. If $KUBECONFIG environment variable is set, then it is used a list of paths (normal path delimitting rules for your system). These paths are merged together. When a value is modified, it is modified in the file that defines the stanza. When a value is created, it is created in the first file that exists. If no files in the chain exist, then it creates the last file in the list. - 3. Otherwise, $\{HOME\}/.kube/config is used and no merging takes place. - - -.SH OPTIONS -.PP -\fB\-h\fP, \fB\-\-help\fP=false - help for config - -.PP -\fB\-\-kubeconfig\fP="" - use a particular kubeconfig file - - -.SH OPTIONS INHERITED FROM PARENT COMMANDS -.PP -\fB\-\-alsologtostderr\fP=false - log to standard error as well as files - -.PP -\fB\-\-api\-version\fP="" - The API version to use when talking to the server - -.PP -\fB\-\-certificate\-authority\fP="" - Path to a cert. file for the certificate authority. - -.PP -\fB\-\-client\-certificate\fP="" - Path to a client key file for TLS. - -.PP -\fB\-\-client\-key\fP="" - Path to a client key file for TLS. - -.PP -\fB\-\-cluster\fP="" - The name of the kubeconfig cluster to use - -.PP -\fB\-\-context\fP="" - The name of the kubeconfig context to use - -.PP -\fB\-\-insecure\-skip\-tls\-verify\fP=false - If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure. - -.PP -\fB\-\-log\-backtrace\-at\fP=:0 - when logging hits line file:N, emit a stack trace - -.PP -\fB\-\-log\-dir\fP="" - If non\-empty, write log files in this directory - -.PP -\fB\-\-log\-flush\-frequency\fP=5s - Maximum number of seconds between log flushes - -.PP -\fB\-\-logtostderr\fP=true - log to standard error instead of files - -.PP -\fB\-\-match\-server\-version\fP=false - Require server version to match client version - -.PP -\fB\-\-namespace\fP="" - If present, the namespace scope for this CLI request. - -.PP -\fB\-\-password\fP="" - Password for basic authentication to the API server. - -.PP -\fB\-s\fP, \fB\-\-server\fP="" - The address and port of the Kubernetes API server - -.PP -\fB\-\-stderrthreshold\fP=2 - logs at or above this threshold go to stderr - -.PP -\fB\-\-token\fP="" - Bearer token for authentication to the API server. - -.PP -\fB\-\-user\fP="" - The name of the kubeconfig user to use - -.PP -\fB\-\-username\fP="" - Username for basic authentication to the API server. - -.PP -\fB\-\-v\fP=0 - log level for V logs - -.PP -\fB\-\-validate\fP=false - If true, use a schema to validate the input before sending it - -.PP -\fB\-\-vmodule\fP= - comma\-separated list of pattern=N settings for file\-filtered logging - - -.SH SEE ALSO -.PP -\fBkubectl(1)\fP, \fBkubectl\-config\-view(1)\fP, \fBkubectl\-config\-set\-cluster(1)\fP, \fBkubectl\-config\-set\-credentials(1)\fP, \fBkubectl\-config\-set\-context(1)\fP, \fBkubectl\-config\-set(1)\fP, \fBkubectl\-config\-unset(1)\fP, \fBkubectl\-config\-use\-context(1)\fP, - - -.SH HISTORY -.PP -January 2015, Originally compiled by Eric Paris (eparis at redhat dot com) based on the kubernetes source material, but hopefully they have been automatically generated since! diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/man/man1/kubectl-create.1 b/Godeps/_workspace/src/k8s.io/kubernetes/docs/man/man1/kubectl-create.1 deleted file mode 100644 index f1eeae6551b3..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/man/man1/kubectl-create.1 +++ /dev/null @@ -1,156 +0,0 @@ -.TH "KUBERNETES" "1" " kubernetes User Manuals" "Eric Paris" "Jan 2015" "" - - -.SH NAME -.PP -kubectl create \- Create a resource by filename or stdin - - -.SH SYNOPSIS -.PP -\fBkubectl create\fP [OPTIONS] - - -.SH DESCRIPTION -.PP -Create a resource by filename or stdin. - -.PP -JSON and YAML formats are accepted. - - -.SH OPTIONS -.PP -\fB\-f\fP, \fB\-\-filename\fP=[] - Filename, directory, or URL to file to use to create the resource - -.PP -\fB\-h\fP, \fB\-\-help\fP=false - help for create - -.PP -\fB\-o\fP, \fB\-\-output\fP="" - Output mode. Use "\-o name" for shorter output (resource/name). - - -.SH OPTIONS INHERITED FROM PARENT COMMANDS -.PP -\fB\-\-alsologtostderr\fP=false - log to standard error as well as files - -.PP -\fB\-\-api\-version\fP="" - The API version to use when talking to the server - -.PP -\fB\-\-certificate\-authority\fP="" - Path to a cert. file for the certificate authority. - -.PP -\fB\-\-client\-certificate\fP="" - Path to a client key file for TLS. - -.PP -\fB\-\-client\-key\fP="" - Path to a client key file for TLS. - -.PP -\fB\-\-cluster\fP="" - The name of the kubeconfig cluster to use - -.PP -\fB\-\-context\fP="" - The name of the kubeconfig context to use - -.PP -\fB\-\-insecure\-skip\-tls\-verify\fP=false - If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure. - -.PP -\fB\-\-kubeconfig\fP="" - Path to the kubeconfig file to use for CLI requests. - -.PP -\fB\-\-log\-backtrace\-at\fP=:0 - when logging hits line file:N, emit a stack trace - -.PP -\fB\-\-log\-dir\fP="" - If non\-empty, write log files in this directory - -.PP -\fB\-\-log\-flush\-frequency\fP=5s - Maximum number of seconds between log flushes - -.PP -\fB\-\-logtostderr\fP=true - log to standard error instead of files - -.PP -\fB\-\-match\-server\-version\fP=false - Require server version to match client version - -.PP -\fB\-\-namespace\fP="" - If present, the namespace scope for this CLI request. - -.PP -\fB\-\-password\fP="" - Password for basic authentication to the API server. - -.PP -\fB\-s\fP, \fB\-\-server\fP="" - The address and port of the Kubernetes API server - -.PP -\fB\-\-stderrthreshold\fP=2 - logs at or above this threshold go to stderr - -.PP -\fB\-\-token\fP="" - Bearer token for authentication to the API server. - -.PP -\fB\-\-user\fP="" - The name of the kubeconfig user to use - -.PP -\fB\-\-username\fP="" - Username for basic authentication to the API server. - -.PP -\fB\-\-v\fP=0 - log level for V logs - -.PP -\fB\-\-validate\fP=false - If true, use a schema to validate the input before sending it - -.PP -\fB\-\-vmodule\fP= - comma\-separated list of pattern=N settings for file\-filtered logging - - -.SH EXAMPLE -.PP -.RS - -.nf -// Create a pod using the data in pod.json. -$ kubectl create \-f ./pod.json - -// Create a pod based on the JSON passed into stdin. -$ cat pod.json | kubectl create \-f \- - -.fi -.RE - - -.SH SEE ALSO -.PP -\fBkubectl(1)\fP, - - -.SH HISTORY -.PP -January 2015, Originally compiled by Eric Paris (eparis at redhat dot com) based on the kubernetes source material, but hopefully they have been automatically generated since! diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/man/man1/kubectl-delete.1 b/Godeps/_workspace/src/k8s.io/kubernetes/docs/man/man1/kubectl-delete.1 deleted file mode 100644 index 84da9a2572a9..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/man/man1/kubectl-delete.1 +++ /dev/null @@ -1,197 +0,0 @@ -.TH "KUBERNETES" "1" " kubernetes User Manuals" "Eric Paris" "Jan 2015" "" - - -.SH NAME -.PP -kubectl delete \- Delete resources by filenames, stdin, resources and names, or by resources and label selector. - - -.SH SYNOPSIS -.PP -\fBkubectl delete\fP [OPTIONS] - - -.SH DESCRIPTION -.PP -Delete resources by filenames, stdin, resources and names, or by resources and label selector. - -.PP -JSON and YAML formats are accepted. - -.PP -Only one type of the arguments may be specified: filenames, resources and names, or resources and label selector - -.PP -Note that the delete command does NOT do resource version checks, so if someone -submits an update to a resource right when you submit a delete, their update -will be lost along with the rest of the resource. - - -.SH OPTIONS -.PP -\fB\-\-all\fP=false - [\-all] to select all the specified resources. - -.PP -\fB\-\-cascade\fP=true - If true, cascade the deletion of the resources managed by this resource (e.g. Pods created by a ReplicationController). Default true. - -.PP -\fB\-f\fP, \fB\-\-filename\fP=[] - Filename, directory, or URL to a file containing the resource to delete. - -.PP -\fB\-\-grace\-period\fP=\-1 - Period of time in seconds given to the resource to terminate gracefully. Ignored if negative. - -.PP -\fB\-h\fP, \fB\-\-help\fP=false - help for delete - -.PP -\fB\-\-ignore\-not\-found\fP=false - Treat "resource not found" as a successful delete. Defaults to "true" when \-\-all is specified. - -.PP -\fB\-o\fP, \fB\-\-output\fP="" - Output mode. Use "\-o name" for shorter output (resource/name). - -.PP -\fB\-l\fP, \fB\-\-selector\fP="" - Selector (label query) to filter on. - -.PP -\fB\-\-timeout\fP=0 - The length of time to wait before giving up on a delete, zero means determine a timeout from the size of the object - - -.SH OPTIONS INHERITED FROM PARENT COMMANDS -.PP -\fB\-\-alsologtostderr\fP=false - log to standard error as well as files - -.PP -\fB\-\-api\-version\fP="" - The API version to use when talking to the server - -.PP -\fB\-\-certificate\-authority\fP="" - Path to a cert. file for the certificate authority. - -.PP -\fB\-\-client\-certificate\fP="" - Path to a client key file for TLS. - -.PP -\fB\-\-client\-key\fP="" - Path to a client key file for TLS. - -.PP -\fB\-\-cluster\fP="" - The name of the kubeconfig cluster to use - -.PP -\fB\-\-context\fP="" - The name of the kubeconfig context to use - -.PP -\fB\-\-insecure\-skip\-tls\-verify\fP=false - If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure. - -.PP -\fB\-\-kubeconfig\fP="" - Path to the kubeconfig file to use for CLI requests. - -.PP -\fB\-\-log\-backtrace\-at\fP=:0 - when logging hits line file:N, emit a stack trace - -.PP -\fB\-\-log\-dir\fP="" - If non\-empty, write log files in this directory - -.PP -\fB\-\-log\-flush\-frequency\fP=5s - Maximum number of seconds between log flushes - -.PP -\fB\-\-logtostderr\fP=true - log to standard error instead of files - -.PP -\fB\-\-match\-server\-version\fP=false - Require server version to match client version - -.PP -\fB\-\-namespace\fP="" - If present, the namespace scope for this CLI request. - -.PP -\fB\-\-password\fP="" - Password for basic authentication to the API server. - -.PP -\fB\-s\fP, \fB\-\-server\fP="" - The address and port of the Kubernetes API server - -.PP -\fB\-\-stderrthreshold\fP=2 - logs at or above this threshold go to stderr - -.PP -\fB\-\-token\fP="" - Bearer token for authentication to the API server. - -.PP -\fB\-\-user\fP="" - The name of the kubeconfig user to use - -.PP -\fB\-\-username\fP="" - Username for basic authentication to the API server. - -.PP -\fB\-\-v\fP=0 - log level for V logs - -.PP -\fB\-\-validate\fP=false - If true, use a schema to validate the input before sending it - -.PP -\fB\-\-vmodule\fP= - comma\-separated list of pattern=N settings for file\-filtered logging - - -.SH EXAMPLE -.PP -.RS - -.nf -// Delete a pod using the type and name specified in pod.json. -$ kubectl delete \-f ./pod.json - -// Delete a pod based on the type and name in the JSON passed into stdin. -$ cat pod.json | kubectl delete \-f \- - -// Delete pods and services with label name=myLabel. -$ kubectl delete pods,services \-l name=myLabel - -// Delete a pod with UID 1234\-56\-7890\-234234\-456456. -$ kubectl delete pod 1234\-56\-7890\-234234\-456456 - -// Delete all pods -$ kubectl delete pods \-\-all - -.fi -.RE - - -.SH SEE ALSO -.PP -\fBkubectl(1)\fP, - - -.SH HISTORY -.PP -January 2015, Originally compiled by Eric Paris (eparis at redhat dot com) based on the kubernetes source material, but hopefully they have been automatically generated since! diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/man/man1/kubectl-describe.1 b/Godeps/_workspace/src/k8s.io/kubernetes/docs/man/man1/kubectl-describe.1 deleted file mode 100644 index 5a4766103de5..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/man/man1/kubectl-describe.1 +++ /dev/null @@ -1,173 +0,0 @@ -.TH "KUBERNETES" "1" " kubernetes User Manuals" "Eric Paris" "Jan 2015" "" - - -.SH NAME -.PP -kubectl describe \- Show details of a specific resource or group of resources - - -.SH SYNOPSIS -.PP -\fBkubectl describe\fP [OPTIONS] - - -.SH DESCRIPTION -.PP -Show details of a specific resource or group of resources. - -.PP -This command joins many API calls together to form a detailed description of a -given resource or group of resources. - -.PP -$ kubectl describe RESOURCE NAME\_PREFIX - -.PP -will first check for an exact match on RESOURCE and NAME\_PREFIX. If no such resource -exists, it will output details for every resource that has a name prefixed with NAME\_PREFIX - -.PP -Possible resources include (case insensitive): pods (po), services (svc), -replicationcontrollers (rc), nodes (no), events (ev), limitranges (limits), -persistentvolumes (pv), persistentvolumeclaims (pvc), resourcequotas (quota), -namespaces (ns) or secrets. - - -.SH OPTIONS -.PP -\fB\-h\fP, \fB\-\-help\fP=false - help for describe - -.PP -\fB\-l\fP, \fB\-\-selector\fP="" - Selector (label query) to filter on - - -.SH OPTIONS INHERITED FROM PARENT COMMANDS -.PP -\fB\-\-alsologtostderr\fP=false - log to standard error as well as files - -.PP -\fB\-\-api\-version\fP="" - The API version to use when talking to the server - -.PP -\fB\-\-certificate\-authority\fP="" - Path to a cert. file for the certificate authority. - -.PP -\fB\-\-client\-certificate\fP="" - Path to a client key file for TLS. - -.PP -\fB\-\-client\-key\fP="" - Path to a client key file for TLS. - -.PP -\fB\-\-cluster\fP="" - The name of the kubeconfig cluster to use - -.PP -\fB\-\-context\fP="" - The name of the kubeconfig context to use - -.PP -\fB\-\-insecure\-skip\-tls\-verify\fP=false - If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure. - -.PP -\fB\-\-kubeconfig\fP="" - Path to the kubeconfig file to use for CLI requests. - -.PP -\fB\-\-log\-backtrace\-at\fP=:0 - when logging hits line file:N, emit a stack trace - -.PP -\fB\-\-log\-dir\fP="" - If non\-empty, write log files in this directory - -.PP -\fB\-\-log\-flush\-frequency\fP=5s - Maximum number of seconds between log flushes - -.PP -\fB\-\-logtostderr\fP=true - log to standard error instead of files - -.PP -\fB\-\-match\-server\-version\fP=false - Require server version to match client version - -.PP -\fB\-\-namespace\fP="" - If present, the namespace scope for this CLI request. - -.PP -\fB\-\-password\fP="" - Password for basic authentication to the API server. - -.PP -\fB\-s\fP, \fB\-\-server\fP="" - The address and port of the Kubernetes API server - -.PP -\fB\-\-stderrthreshold\fP=2 - logs at or above this threshold go to stderr - -.PP -\fB\-\-token\fP="" - Bearer token for authentication to the API server. - -.PP -\fB\-\-user\fP="" - The name of the kubeconfig user to use - -.PP -\fB\-\-username\fP="" - Username for basic authentication to the API server. - -.PP -\fB\-\-v\fP=0 - log level for V logs - -.PP -\fB\-\-validate\fP=false - If true, use a schema to validate the input before sending it - -.PP -\fB\-\-vmodule\fP= - comma\-separated list of pattern=N settings for file\-filtered logging - - -.SH EXAMPLE -.PP -.RS - -.nf -// Describe a node -$ kubectl describe nodes kubernetes\-minion\-emt8.c.myproject.internal - -// Describe a pod -$ kubectl describe pods/nginx - -// Describe pods by label name=myLabel -$ kubectl describe po \-l name=myLabel - -// Describe all pods managed by the 'frontend' replication controller (rc\-created pods -// get the name of the rc as a prefix in the pod the name). -$ kubectl describe pods frontend - -.fi -.RE - - -.SH SEE ALSO -.PP -\fBkubectl(1)\fP, - - -.SH HISTORY -.PP -January 2015, Originally compiled by Eric Paris (eparis at redhat dot com) based on the kubernetes source material, but hopefully they have been automatically generated since! diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/man/man1/kubectl-exec.1 b/Godeps/_workspace/src/k8s.io/kubernetes/docs/man/man1/kubectl-exec.1 deleted file mode 100644 index d6cf8dafbfdb..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/man/man1/kubectl-exec.1 +++ /dev/null @@ -1,165 +0,0 @@ -.TH "KUBERNETES" "1" " kubernetes User Manuals" "Eric Paris" "Jan 2015" "" - - -.SH NAME -.PP -kubectl exec \- Execute a command in a container. - - -.SH SYNOPSIS -.PP -\fBkubectl exec\fP [OPTIONS] - - -.SH DESCRIPTION -.PP -Execute a command in a container. - - -.SH OPTIONS -.PP -\fB\-c\fP, \fB\-\-container\fP="" - Container name - -.PP -\fB\-h\fP, \fB\-\-help\fP=false - help for exec - -.PP -\fB\-p\fP, \fB\-\-pod\fP="" - Pod name - -.PP -\fB\-i\fP, \fB\-\-stdin\fP=false - Pass stdin to the container - -.PP -\fB\-t\fP, \fB\-\-tty\fP=false - Stdin is a TTY - - -.SH OPTIONS INHERITED FROM PARENT COMMANDS -.PP -\fB\-\-alsologtostderr\fP=false - log to standard error as well as files - -.PP -\fB\-\-api\-version\fP="" - The API version to use when talking to the server - -.PP -\fB\-\-certificate\-authority\fP="" - Path to a cert. file for the certificate authority. - -.PP -\fB\-\-client\-certificate\fP="" - Path to a client key file for TLS. - -.PP -\fB\-\-client\-key\fP="" - Path to a client key file for TLS. - -.PP -\fB\-\-cluster\fP="" - The name of the kubeconfig cluster to use - -.PP -\fB\-\-context\fP="" - The name of the kubeconfig context to use - -.PP -\fB\-\-insecure\-skip\-tls\-verify\fP=false - If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure. - -.PP -\fB\-\-kubeconfig\fP="" - Path to the kubeconfig file to use for CLI requests. - -.PP -\fB\-\-log\-backtrace\-at\fP=:0 - when logging hits line file:N, emit a stack trace - -.PP -\fB\-\-log\-dir\fP="" - If non\-empty, write log files in this directory - -.PP -\fB\-\-log\-flush\-frequency\fP=5s - Maximum number of seconds between log flushes - -.PP -\fB\-\-logtostderr\fP=true - log to standard error instead of files - -.PP -\fB\-\-match\-server\-version\fP=false - Require server version to match client version - -.PP -\fB\-\-namespace\fP="" - If present, the namespace scope for this CLI request. - -.PP -\fB\-\-password\fP="" - Password for basic authentication to the API server. - -.PP -\fB\-s\fP, \fB\-\-server\fP="" - The address and port of the Kubernetes API server - -.PP -\fB\-\-stderrthreshold\fP=2 - logs at or above this threshold go to stderr - -.PP -\fB\-\-token\fP="" - Bearer token for authentication to the API server. - -.PP -\fB\-\-user\fP="" - The name of the kubeconfig user to use - -.PP -\fB\-\-username\fP="" - Username for basic authentication to the API server. - -.PP -\fB\-\-v\fP=0 - log level for V logs - -.PP -\fB\-\-validate\fP=false - If true, use a schema to validate the input before sending it - -.PP -\fB\-\-vmodule\fP= - comma\-separated list of pattern=N settings for file\-filtered logging - - -.SH EXAMPLE -.PP -.RS - -.nf -// get output from running 'date' from pod 123456\-7890, using the first container by default -$ kubectl exec 123456\-7890 date - -// get output from running 'date' in ruby\-container from pod 123456\-7890 -$ kubectl exec 123456\-7890 \-c ruby\-container date - -// switch to raw terminal mode, sends stdin to 'bash' in ruby\-container from pod 123456\-780 -// and sends stdout/stderr from 'bash' back to the client -$ kubectl exec 123456\-7890 \-c ruby\-container \-i \-t \-\- bash \-il - -.fi -.RE - - -.SH SEE ALSO -.PP -\fBkubectl(1)\fP, - - -.SH HISTORY -.PP -January 2015, Originally compiled by Eric Paris (eparis at redhat dot com) based on the kubernetes source material, but hopefully they have been automatically generated since! diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/man/man1/kubectl-expose.1 b/Godeps/_workspace/src/k8s.io/kubernetes/docs/man/man1/kubectl-expose.1 deleted file mode 100644 index 6b288d38fa70..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/man/man1/kubectl-expose.1 +++ /dev/null @@ -1,222 +0,0 @@ -.TH "KUBERNETES" "1" " kubernetes User Manuals" "Eric Paris" "Jan 2015" "" - - -.SH NAME -.PP -kubectl expose \- Take a replicated application and expose it as Kubernetes Service - - -.SH SYNOPSIS -.PP -\fBkubectl expose\fP [OPTIONS] - - -.SH DESCRIPTION -.PP -Take a replicated application and expose it as Kubernetes Service. - -.PP -Looks up a replication controller or service by name and uses the selector for that resource as the -selector for a new Service on the specified port. If no labels are specified, the new service will -re\-use the labels from the resource it exposes. - - -.SH OPTIONS -.PP -\fB\-\-container\-port\fP="" - Synonym for \-\-target\-port - -.PP -\fB\-\-create\-external\-load\-balancer\fP=false - If true, create an external load balancer for this service (trumped by \-\-type). Implementation is cloud provider dependent. Default is 'false'. - -.PP -\fB\-\-dry\-run\fP=false - If true, only print the object that would be sent, without creating it. - -.PP -\fB\-\-generator\fP="service/v2" - The name of the API generator to use. There are 2 generators: 'service/v1' and 'service/v2'. The only difference between them is that service port in v1 is named 'default', while it is left unnamed in v2. Default is 'service/v2'. - -.PP -\fB\-h\fP, \fB\-\-help\fP=false - help for expose - -.PP -\fB\-l\fP, \fB\-\-labels\fP="" - Labels to apply to the service created by this call. - -.PP -\fB\-\-name\fP="" - The name for the newly created object. - -.PP -\fB\-\-no\-headers\fP=false - When using the default output, don't print headers. - -.PP -\fB\-o\fP, \fB\-\-output\fP="" - Output format. One of: json|yaml|template|templatefile|wide. - -.PP -\fB\-\-output\-version\fP="" - Output the formatted object with the given version (default api\-version). - -.PP -\fB\-\-overrides\fP="" - An inline JSON override for the generated object. If this is non\-empty, it is used to override the generated object. Requires that the object supply a valid apiVersion field. - -.PP -\fB\-\-port\fP=\-1 - The port that the service should serve on. Copied from the resource being exposed, if unspecified - -.PP -\fB\-\-protocol\fP="TCP" - The network protocol for the service to be created. Default is 'tcp'. - -.PP -\fB\-\-public\-ip\fP="" - Name of a public IP address to set for the service. The service will be assigned this IP in addition to its generated service IP. - -.PP -\fB\-\-selector\fP="" - A label selector to use for this service. If empty (the default) infer the selector from the replication controller. - -.PP -\fB\-\-target\-port\fP="" - Name or number for the port on the container that the service should direct traffic to. Optional. - -.PP -\fB\-t\fP, \fB\-\-template\fP="" - Template string or path to template file to use when \-o=template or \-o=templatefile. The template format is golang templates [ -\[la]http://golang.org/pkg/text/template/#pkg-overview\[ra]] - -.PP -\fB\-\-type\fP="" - Type for this service: ClusterIP, NodePort, or LoadBalancer. Default is 'ClusterIP' unless \-\-create\-external\-load\-balancer is specified. - - -.SH OPTIONS INHERITED FROM PARENT COMMANDS -.PP -\fB\-\-alsologtostderr\fP=false - log to standard error as well as files - -.PP -\fB\-\-api\-version\fP="" - The API version to use when talking to the server - -.PP -\fB\-\-certificate\-authority\fP="" - Path to a cert. file for the certificate authority. - -.PP -\fB\-\-client\-certificate\fP="" - Path to a client key file for TLS. - -.PP -\fB\-\-client\-key\fP="" - Path to a client key file for TLS. - -.PP -\fB\-\-cluster\fP="" - The name of the kubeconfig cluster to use - -.PP -\fB\-\-context\fP="" - The name of the kubeconfig context to use - -.PP -\fB\-\-insecure\-skip\-tls\-verify\fP=false - If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure. - -.PP -\fB\-\-kubeconfig\fP="" - Path to the kubeconfig file to use for CLI requests. - -.PP -\fB\-\-log\-backtrace\-at\fP=:0 - when logging hits line file:N, emit a stack trace - -.PP -\fB\-\-log\-dir\fP="" - If non\-empty, write log files in this directory - -.PP -\fB\-\-log\-flush\-frequency\fP=5s - Maximum number of seconds between log flushes - -.PP -\fB\-\-logtostderr\fP=true - log to standard error instead of files - -.PP -\fB\-\-match\-server\-version\fP=false - Require server version to match client version - -.PP -\fB\-\-namespace\fP="" - If present, the namespace scope for this CLI request. - -.PP -\fB\-\-password\fP="" - Password for basic authentication to the API server. - -.PP -\fB\-s\fP, \fB\-\-server\fP="" - The address and port of the Kubernetes API server - -.PP -\fB\-\-stderrthreshold\fP=2 - logs at or above this threshold go to stderr - -.PP -\fB\-\-token\fP="" - Bearer token for authentication to the API server. - -.PP -\fB\-\-user\fP="" - The name of the kubeconfig user to use - -.PP -\fB\-\-username\fP="" - Username for basic authentication to the API server. - -.PP -\fB\-\-v\fP=0 - log level for V logs - -.PP -\fB\-\-validate\fP=false - If true, use a schema to validate the input before sending it - -.PP -\fB\-\-vmodule\fP= - comma\-separated list of pattern=N settings for file\-filtered logging - - -.SH EXAMPLE -.PP -.RS - -.nf -// Creates a service for a replicated nginx, which serves on port 80 and connects to the containers on port 8000. -$ kubectl expose rc nginx \-\-port=80 \-\-target\-port=8000 - -// Creates a second service based on the above service, exposing the container port 8443 as port 443 with the name "nginx\-https" -$ kubectl expose service nginx \-\-port=443 \-\-target\-port=8443 \-\-name=nginx\-https - -// Create a service for a replicated streaming application on port 4100 balancing UDP traffic and named 'video\-stream'. -$ kubectl expose rc streamer \-\-port=4100 \-\-protocol=udp \-\-name=video\-stream - -.fi -.RE - - -.SH SEE ALSO -.PP -\fBkubectl(1)\fP, - - -.SH HISTORY -.PP -January 2015, Originally compiled by Eric Paris (eparis at redhat dot com) based on the kubernetes source material, but hopefully they have been automatically generated since! diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/man/man1/kubectl-get.1 b/Godeps/_workspace/src/k8s.io/kubernetes/docs/man/man1/kubectl-get.1 deleted file mode 100644 index 7bbe6ac2cf6c..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/man/man1/kubectl-get.1 +++ /dev/null @@ -1,207 +0,0 @@ -.TH "KUBERNETES" "1" " kubernetes User Manuals" "Eric Paris" "Jan 2015" "" - - -.SH NAME -.PP -kubectl get \- Display one or many resources - - -.SH SYNOPSIS -.PP -\fBkubectl get\fP [OPTIONS] - - -.SH DESCRIPTION -.PP -Display one or many resources. - -.PP -Possible resources include (case insensitive): pods (po), services (svc), -replicationcontrollers (rc), nodes (no), events (ev), componentstatuses (cs), -limitranges (limits), persistentvolumes (pv), persistentvolumeclaims (pvc), -resourcequotas (quota), namespaces (ns), endpoints (ep) or secrets. - -.PP -By specifying the output as 'template' and providing a Go template as the value -of the \-\-template flag, you can filter the attributes of the fetched resource(s). - - -.SH OPTIONS -.PP -\fB\-\-all\-namespaces\fP=false - If present, list the requested object(s) across all namespaces. Namespace in current context is ignored even if specified with \-\-namespace. - -.PP -\fB\-h\fP, \fB\-\-help\fP=false - help for get - -.PP -\fB\-L\fP, \fB\-\-label\-columns\fP=[] - Accepts a comma separated list of labels that are going to be presented as columns. Names are case\-sensitive. You can also use multiple flag statements like \-L label1 \-L label2... - -.PP -\fB\-\-no\-headers\fP=false - When using the default output, don't print headers. - -.PP -\fB\-o\fP, \fB\-\-output\fP="" - Output format. One of: json|yaml|template|templatefile|wide. - -.PP -\fB\-\-output\-version\fP="" - Output the formatted object with the given version (default api\-version). - -.PP -\fB\-l\fP, \fB\-\-selector\fP="" - Selector (label query) to filter on - -.PP -\fB\-t\fP, \fB\-\-template\fP="" - Template string or path to template file to use when \-o=template or \-o=templatefile. The template format is golang templates [ -\[la]http://golang.org/pkg/text/template/#pkg-overview\[ra]] - -.PP -\fB\-w\fP, \fB\-\-watch\fP=false - After listing/getting the requested object, watch for changes. - -.PP -\fB\-\-watch\-only\fP=false - Watch for changes to the requested object(s), without listing/getting first. - - -.SH OPTIONS INHERITED FROM PARENT COMMANDS -.PP -\fB\-\-alsologtostderr\fP=false - log to standard error as well as files - -.PP -\fB\-\-api\-version\fP="" - The API version to use when talking to the server - -.PP -\fB\-\-certificate\-authority\fP="" - Path to a cert. file for the certificate authority. - -.PP -\fB\-\-client\-certificate\fP="" - Path to a client key file for TLS. - -.PP -\fB\-\-client\-key\fP="" - Path to a client key file for TLS. - -.PP -\fB\-\-cluster\fP="" - The name of the kubeconfig cluster to use - -.PP -\fB\-\-context\fP="" - The name of the kubeconfig context to use - -.PP -\fB\-\-insecure\-skip\-tls\-verify\fP=false - If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure. - -.PP -\fB\-\-kubeconfig\fP="" - Path to the kubeconfig file to use for CLI requests. - -.PP -\fB\-\-log\-backtrace\-at\fP=:0 - when logging hits line file:N, emit a stack trace - -.PP -\fB\-\-log\-dir\fP="" - If non\-empty, write log files in this directory - -.PP -\fB\-\-log\-flush\-frequency\fP=5s - Maximum number of seconds between log flushes - -.PP -\fB\-\-logtostderr\fP=true - log to standard error instead of files - -.PP -\fB\-\-match\-server\-version\fP=false - Require server version to match client version - -.PP -\fB\-\-namespace\fP="" - If present, the namespace scope for this CLI request. - -.PP -\fB\-\-password\fP="" - Password for basic authentication to the API server. - -.PP -\fB\-s\fP, \fB\-\-server\fP="" - The address and port of the Kubernetes API server - -.PP -\fB\-\-stderrthreshold\fP=2 - logs at or above this threshold go to stderr - -.PP -\fB\-\-token\fP="" - Bearer token for authentication to the API server. - -.PP -\fB\-\-user\fP="" - The name of the kubeconfig user to use - -.PP -\fB\-\-username\fP="" - Username for basic authentication to the API server. - -.PP -\fB\-\-v\fP=0 - log level for V logs - -.PP -\fB\-\-validate\fP=false - If true, use a schema to validate the input before sending it - -.PP -\fB\-\-vmodule\fP= - comma\-separated list of pattern=N settings for file\-filtered logging - - -.SH EXAMPLE -.PP -.RS - -.nf -// List all pods in ps output format. -$ kubectl get pods - -// List all pods in ps output format with more information (such as node name). -$ kubectl get pods \-o wide - -// List a single replication controller with specified NAME in ps output format. -$ kubectl get replicationcontroller web - -// List a single pod in JSON output format. -$ kubectl get \-o json pod web\-pod\-13je7 - -// Return only the phase value of the specified pod. -$ kubectl get \-o template web\-pod\-13je7 \-\-template=\{\{.status.phase\}\} \-\-api\-version=v1 - -// List all replication controllers and services together in ps output format. -$ kubectl get rc,services - -// List one or more resources by their type and names. -$ kubectl get rc/web service/frontend pods/web\-pod\-13je7 - -.fi -.RE - - -.SH SEE ALSO -.PP -\fBkubectl(1)\fP, - - -.SH HISTORY -.PP -January 2015, Originally compiled by Eric Paris (eparis at redhat dot com) based on the kubernetes source material, but hopefully they have been automatically generated since! diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/man/man1/kubectl-label.1 b/Godeps/_workspace/src/k8s.io/kubernetes/docs/man/man1/kubectl-label.1 deleted file mode 100644 index a74ab28140ad..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/man/man1/kubectl-label.1 +++ /dev/null @@ -1,193 +0,0 @@ -.TH "KUBERNETES" "1" " kubernetes User Manuals" "Eric Paris" "Jan 2015" "" - - -.SH NAME -.PP -kubectl label \- Update the labels on a resource - - -.SH SYNOPSIS -.PP -\fBkubectl label\fP [OPTIONS] - - -.SH DESCRIPTION -.PP -Update the labels on a resource. - -.PP -A label must begin with a letter or number, and may contain letters, numbers, hyphens, dots, and underscores, up to 63 characters. -If \-\-overwrite is true, then existing labels can be overwritten, otherwise attempting to overwrite a label will result in an error. -If \-\-resource\-version is specified, then updates will use this resource version, otherwise the existing resource\-version will be used. - - -.SH OPTIONS -.PP -\fB\-\-all\fP=false - select all resources in the namespace of the specified resource types - -.PP -\fB\-h\fP, \fB\-\-help\fP=false - help for label - -.PP -\fB\-\-no\-headers\fP=false - When using the default output, don't print headers. - -.PP -\fB\-o\fP, \fB\-\-output\fP="" - Output format. One of: json|yaml|template|templatefile|wide. - -.PP -\fB\-\-output\-version\fP="" - Output the formatted object with the given version (default api\-version). - -.PP -\fB\-\-overwrite\fP=false - If true, allow labels to be overwritten, otherwise reject label updates that overwrite existing labels. - -.PP -\fB\-\-resource\-version\fP="" - If non\-empty, the labels update will only succeed if this is the current resource\-version for the object. Only valid when specifying a single resource. - -.PP -\fB\-l\fP, \fB\-\-selector\fP="" - Selector (label query) to filter on - -.PP -\fB\-t\fP, \fB\-\-template\fP="" - Template string or path to template file to use when \-o=template or \-o=templatefile. The template format is golang templates [ -\[la]http://golang.org/pkg/text/template/#pkg-overview\[ra]] - - -.SH OPTIONS INHERITED FROM PARENT COMMANDS -.PP -\fB\-\-alsologtostderr\fP=false - log to standard error as well as files - -.PP -\fB\-\-api\-version\fP="" - The API version to use when talking to the server - -.PP -\fB\-\-certificate\-authority\fP="" - Path to a cert. file for the certificate authority. - -.PP -\fB\-\-client\-certificate\fP="" - Path to a client key file for TLS. - -.PP -\fB\-\-client\-key\fP="" - Path to a client key file for TLS. - -.PP -\fB\-\-cluster\fP="" - The name of the kubeconfig cluster to use - -.PP -\fB\-\-context\fP="" - The name of the kubeconfig context to use - -.PP -\fB\-\-insecure\-skip\-tls\-verify\fP=false - If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure. - -.PP -\fB\-\-kubeconfig\fP="" - Path to the kubeconfig file to use for CLI requests. - -.PP -\fB\-\-log\-backtrace\-at\fP=:0 - when logging hits line file:N, emit a stack trace - -.PP -\fB\-\-log\-dir\fP="" - If non\-empty, write log files in this directory - -.PP -\fB\-\-log\-flush\-frequency\fP=5s - Maximum number of seconds between log flushes - -.PP -\fB\-\-logtostderr\fP=true - log to standard error instead of files - -.PP -\fB\-\-match\-server\-version\fP=false - Require server version to match client version - -.PP -\fB\-\-namespace\fP="" - If present, the namespace scope for this CLI request. - -.PP -\fB\-\-password\fP="" - Password for basic authentication to the API server. - -.PP -\fB\-s\fP, \fB\-\-server\fP="" - The address and port of the Kubernetes API server - -.PP -\fB\-\-stderrthreshold\fP=2 - logs at or above this threshold go to stderr - -.PP -\fB\-\-token\fP="" - Bearer token for authentication to the API server. - -.PP -\fB\-\-user\fP="" - The name of the kubeconfig user to use - -.PP -\fB\-\-username\fP="" - Username for basic authentication to the API server. - -.PP -\fB\-\-v\fP=0 - log level for V logs - -.PP -\fB\-\-validate\fP=false - If true, use a schema to validate the input before sending it - -.PP -\fB\-\-vmodule\fP= - comma\-separated list of pattern=N settings for file\-filtered logging - - -.SH EXAMPLE -.PP -.RS - -.nf -// Update pod 'foo' with the label 'unhealthy' and the value 'true'. -$ kubectl label pods foo unhealthy=true - -// Update pod 'foo' with the label 'status' and the value 'unhealthy', overwriting any existing value. -$ kubectl label \-\-overwrite pods foo status=unhealthy - -// Update all pods in the namespace -$ kubectl label pods \-\-all status=unhealthy - -// Update pod 'foo' only if the resource is unchanged from version 1. -$ kubectl label pods foo status=unhealthy \-\-resource\-version=1 - -// Update pod 'foo' by removing a label named 'bar' if it exists. -// Does not require the \-\-overwrite flag. -$ kubectl label pods foo bar\- - -.fi -.RE - - -.SH SEE ALSO -.PP -\fBkubectl(1)\fP, - - -.SH HISTORY -.PP -January 2015, Originally compiled by Eric Paris (eparis at redhat dot com) based on the kubernetes source material, but hopefully they have been automatically generated since! diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/man/man1/kubectl-logs.1 b/Godeps/_workspace/src/k8s.io/kubernetes/docs/man/man1/kubectl-logs.1 deleted file mode 100644 index 657afc01273f..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/man/man1/kubectl-logs.1 +++ /dev/null @@ -1,164 +0,0 @@ -.TH "KUBERNETES" "1" " kubernetes User Manuals" "Eric Paris" "Jan 2015" "" - - -.SH NAME -.PP -kubectl logs \- Print the logs for a container in a pod. - - -.SH SYNOPSIS -.PP -\fBkubectl logs\fP [OPTIONS] - - -.SH DESCRIPTION -.PP -Print the logs for a container in a pod. If the pod has only one container, the container name is optional. - - -.SH OPTIONS -.PP -\fB\-c\fP, \fB\-\-container\fP="" - Container name - -.PP -\fB\-f\fP, \fB\-\-follow\fP=false - Specify if the logs should be streamed. - -.PP -\fB\-h\fP, \fB\-\-help\fP=false - help for logs - -.PP -\fB\-\-interactive\fP=true - If true, prompt the user for input when required. Default true. - -.PP -\fB\-p\fP, \fB\-\-previous\fP=false - If true, print the logs for the previous instance of the container in a pod if it exists. - - -.SH OPTIONS INHERITED FROM PARENT COMMANDS -.PP -\fB\-\-alsologtostderr\fP=false - log to standard error as well as files - -.PP -\fB\-\-api\-version\fP="" - The API version to use when talking to the server - -.PP -\fB\-\-certificate\-authority\fP="" - Path to a cert. file for the certificate authority. - -.PP -\fB\-\-client\-certificate\fP="" - Path to a client key file for TLS. - -.PP -\fB\-\-client\-key\fP="" - Path to a client key file for TLS. - -.PP -\fB\-\-cluster\fP="" - The name of the kubeconfig cluster to use - -.PP -\fB\-\-context\fP="" - The name of the kubeconfig context to use - -.PP -\fB\-\-insecure\-skip\-tls\-verify\fP=false - If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure. - -.PP -\fB\-\-kubeconfig\fP="" - Path to the kubeconfig file to use for CLI requests. - -.PP -\fB\-\-log\-backtrace\-at\fP=:0 - when logging hits line file:N, emit a stack trace - -.PP -\fB\-\-log\-dir\fP="" - If non\-empty, write log files in this directory - -.PP -\fB\-\-log\-flush\-frequency\fP=5s - Maximum number of seconds between log flushes - -.PP -\fB\-\-logtostderr\fP=true - log to standard error instead of files - -.PP -\fB\-\-match\-server\-version\fP=false - Require server version to match client version - -.PP -\fB\-\-namespace\fP="" - If present, the namespace scope for this CLI request. - -.PP -\fB\-\-password\fP="" - Password for basic authentication to the API server. - -.PP -\fB\-s\fP, \fB\-\-server\fP="" - The address and port of the Kubernetes API server - -.PP -\fB\-\-stderrthreshold\fP=2 - logs at or above this threshold go to stderr - -.PP -\fB\-\-token\fP="" - Bearer token for authentication to the API server. - -.PP -\fB\-\-user\fP="" - The name of the kubeconfig user to use - -.PP -\fB\-\-username\fP="" - Username for basic authentication to the API server. - -.PP -\fB\-\-v\fP=0 - log level for V logs - -.PP -\fB\-\-validate\fP=false - If true, use a schema to validate the input before sending it - -.PP -\fB\-\-vmodule\fP= - comma\-separated list of pattern=N settings for file\-filtered logging - - -.SH EXAMPLE -.PP -.RS - -.nf -// Returns snapshot of ruby\-container logs from pod 123456\-7890. -$ kubectl logs 123456\-7890 ruby\-container - -// Returns snapshot of previous terminated ruby\-container logs from pod 123456\-7890. -$ kubectl logs \-p 123456\-7890 ruby\-container - -// Starts streaming of ruby\-container logs from pod 123456\-7890. -$ kubectl logs \-f 123456\-7890 ruby\-container - -.fi -.RE - - -.SH SEE ALSO -.PP -\fBkubectl(1)\fP, - - -.SH HISTORY -.PP -January 2015, Originally compiled by Eric Paris (eparis at redhat dot com) based on the kubernetes source material, but hopefully they have been automatically generated since! diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/man/man1/kubectl-namespace.1 b/Godeps/_workspace/src/k8s.io/kubernetes/docs/man/man1/kubectl-namespace.1 deleted file mode 100644 index 94b04c52a9e8..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/man/man1/kubectl-namespace.1 +++ /dev/null @@ -1,133 +0,0 @@ -.TH "KUBERNETES" "1" " kubernetes User Manuals" "Eric Paris" "Jan 2015" "" - - -.SH NAME -.PP -kubectl namespace \- SUPERCEDED: Set and view the current Kubernetes namespace - - -.SH SYNOPSIS -.PP -\fBkubectl namespace\fP [OPTIONS] - - -.SH DESCRIPTION -.PP -SUPERCEDED: Set and view the current Kubernetes namespace scope for command line requests. - -.PP -namespace has been superceded by the context.namespace field of .kubeconfig files. See 'kubectl config set\-context \-\-help' for more details. - - -.SH OPTIONS -.PP -\fB\-h\fP, \fB\-\-help\fP=false - help for namespace - - -.SH OPTIONS INHERITED FROM PARENT COMMANDS -.PP -\fB\-\-alsologtostderr\fP=false - log to standard error as well as files - -.PP -\fB\-\-api\-version\fP="" - The API version to use when talking to the server - -.PP -\fB\-\-certificate\-authority\fP="" - Path to a cert. file for the certificate authority. - -.PP -\fB\-\-client\-certificate\fP="" - Path to a client key file for TLS. - -.PP -\fB\-\-client\-key\fP="" - Path to a client key file for TLS. - -.PP -\fB\-\-cluster\fP="" - The name of the kubeconfig cluster to use - -.PP -\fB\-\-context\fP="" - The name of the kubeconfig context to use - -.PP -\fB\-\-insecure\-skip\-tls\-verify\fP=false - If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure. - -.PP -\fB\-\-kubeconfig\fP="" - Path to the kubeconfig file to use for CLI requests. - -.PP -\fB\-\-log\-backtrace\-at\fP=:0 - when logging hits line file:N, emit a stack trace - -.PP -\fB\-\-log\-dir\fP="" - If non\-empty, write log files in this directory - -.PP -\fB\-\-log\-flush\-frequency\fP=5s - Maximum number of seconds between log flushes - -.PP -\fB\-\-logtostderr\fP=true - log to standard error instead of files - -.PP -\fB\-\-match\-server\-version\fP=false - Require server version to match client version - -.PP -\fB\-\-namespace\fP="" - If present, the namespace scope for this CLI request. - -.PP -\fB\-\-password\fP="" - Password for basic authentication to the API server. - -.PP -\fB\-s\fP, \fB\-\-server\fP="" - The address and port of the Kubernetes API server - -.PP -\fB\-\-stderrthreshold\fP=2 - logs at or above this threshold go to stderr - -.PP -\fB\-\-token\fP="" - Bearer token for authentication to the API server. - -.PP -\fB\-\-user\fP="" - The name of the kubeconfig user to use - -.PP -\fB\-\-username\fP="" - Username for basic authentication to the API server. - -.PP -\fB\-\-v\fP=0 - log level for V logs - -.PP -\fB\-\-validate\fP=false - If true, use a schema to validate the input before sending it - -.PP -\fB\-\-vmodule\fP= - comma\-separated list of pattern=N settings for file\-filtered logging - - -.SH SEE ALSO -.PP -\fBkubectl(1)\fP, - - -.SH HISTORY -.PP -January 2015, Originally compiled by Eric Paris (eparis at redhat dot com) based on the kubernetes source material, but hopefully they have been automatically generated since! diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/man/man1/kubectl-patch.1 b/Godeps/_workspace/src/k8s.io/kubernetes/docs/man/man1/kubectl-patch.1 deleted file mode 100644 index 7d79280e97ec..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/man/man1/kubectl-patch.1 +++ /dev/null @@ -1,154 +0,0 @@ -.TH "KUBERNETES" "1" " kubernetes User Manuals" "Eric Paris" "Jan 2015" "" - - -.SH NAME -.PP -kubectl patch \- Update field(s) of a resource by stdin. - - -.SH SYNOPSIS -.PP -\fBkubectl patch\fP [OPTIONS] - - -.SH DESCRIPTION -.PP -Update field(s) of a resource using strategic merge patch - -.PP -JSON and YAML formats are accepted. - - -.SH OPTIONS -.PP -\fB\-h\fP, \fB\-\-help\fP=false - help for patch - -.PP -\fB\-o\fP, \fB\-\-output\fP="" - Output mode. Use "\-o name" for shorter output (resource/name). - -.PP -\fB\-p\fP, \fB\-\-patch\fP="" - The patch to be applied to the resource JSON file. - - -.SH OPTIONS INHERITED FROM PARENT COMMANDS -.PP -\fB\-\-alsologtostderr\fP=false - log to standard error as well as files - -.PP -\fB\-\-api\-version\fP="" - The API version to use when talking to the server - -.PP -\fB\-\-certificate\-authority\fP="" - Path to a cert. file for the certificate authority. - -.PP -\fB\-\-client\-certificate\fP="" - Path to a client key file for TLS. - -.PP -\fB\-\-client\-key\fP="" - Path to a client key file for TLS. - -.PP -\fB\-\-cluster\fP="" - The name of the kubeconfig cluster to use - -.PP -\fB\-\-context\fP="" - The name of the kubeconfig context to use - -.PP -\fB\-\-insecure\-skip\-tls\-verify\fP=false - If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure. - -.PP -\fB\-\-kubeconfig\fP="" - Path to the kubeconfig file to use for CLI requests. - -.PP -\fB\-\-log\-backtrace\-at\fP=:0 - when logging hits line file:N, emit a stack trace - -.PP -\fB\-\-log\-dir\fP="" - If non\-empty, write log files in this directory - -.PP -\fB\-\-log\-flush\-frequency\fP=5s - Maximum number of seconds between log flushes - -.PP -\fB\-\-logtostderr\fP=true - log to standard error instead of files - -.PP -\fB\-\-match\-server\-version\fP=false - Require server version to match client version - -.PP -\fB\-\-namespace\fP="" - If present, the namespace scope for this CLI request. - -.PP -\fB\-\-password\fP="" - Password for basic authentication to the API server. - -.PP -\fB\-s\fP, \fB\-\-server\fP="" - The address and port of the Kubernetes API server - -.PP -\fB\-\-stderrthreshold\fP=2 - logs at or above this threshold go to stderr - -.PP -\fB\-\-token\fP="" - Bearer token for authentication to the API server. - -.PP -\fB\-\-user\fP="" - The name of the kubeconfig user to use - -.PP -\fB\-\-username\fP="" - Username for basic authentication to the API server. - -.PP -\fB\-\-v\fP=0 - log level for V logs - -.PP -\fB\-\-validate\fP=false - If true, use a schema to validate the input before sending it - -.PP -\fB\-\-vmodule\fP= - comma\-separated list of pattern=N settings for file\-filtered logging - - -.SH EXAMPLE -.PP -.RS - -.nf - -// Partially update a node using strategic merge patch -kubectl patch node k8s\-node\-1 \-p '\{"spec":\{"unschedulable":true\}\}' - -.fi -.RE - - -.SH SEE ALSO -.PP -\fBkubectl(1)\fP, - - -.SH HISTORY -.PP -January 2015, Originally compiled by Eric Paris (eparis at redhat dot com) based on the kubernetes source material, but hopefully they have been automatically generated since! diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/man/man1/kubectl-port-forward.1 b/Godeps/_workspace/src/k8s.io/kubernetes/docs/man/man1/kubectl-port-forward.1 deleted file mode 100644 index 6d52308dd3e0..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/man/man1/kubectl-port-forward.1 +++ /dev/null @@ -1,156 +0,0 @@ -.TH "KUBERNETES" "1" " kubernetes User Manuals" "Eric Paris" "Jan 2015" "" - - -.SH NAME -.PP -kubectl port\-forward \- Forward one or more local ports to a pod. - - -.SH SYNOPSIS -.PP -\fBkubectl port\-forward\fP [OPTIONS] - - -.SH DESCRIPTION -.PP -Forward one or more local ports to a pod. - - -.SH OPTIONS -.PP -\fB\-h\fP, \fB\-\-help\fP=false - help for port\-forward - -.PP -\fB\-p\fP, \fB\-\-pod\fP="" - Pod name - - -.SH OPTIONS INHERITED FROM PARENT COMMANDS -.PP -\fB\-\-alsologtostderr\fP=false - log to standard error as well as files - -.PP -\fB\-\-api\-version\fP="" - The API version to use when talking to the server - -.PP -\fB\-\-certificate\-authority\fP="" - Path to a cert. file for the certificate authority. - -.PP -\fB\-\-client\-certificate\fP="" - Path to a client key file for TLS. - -.PP -\fB\-\-client\-key\fP="" - Path to a client key file for TLS. - -.PP -\fB\-\-cluster\fP="" - The name of the kubeconfig cluster to use - -.PP -\fB\-\-context\fP="" - The name of the kubeconfig context to use - -.PP -\fB\-\-insecure\-skip\-tls\-verify\fP=false - If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure. - -.PP -\fB\-\-kubeconfig\fP="" - Path to the kubeconfig file to use for CLI requests. - -.PP -\fB\-\-log\-backtrace\-at\fP=:0 - when logging hits line file:N, emit a stack trace - -.PP -\fB\-\-log\-dir\fP="" - If non\-empty, write log files in this directory - -.PP -\fB\-\-log\-flush\-frequency\fP=5s - Maximum number of seconds between log flushes - -.PP -\fB\-\-logtostderr\fP=true - log to standard error instead of files - -.PP -\fB\-\-match\-server\-version\fP=false - Require server version to match client version - -.PP -\fB\-\-namespace\fP="" - If present, the namespace scope for this CLI request. - -.PP -\fB\-\-password\fP="" - Password for basic authentication to the API server. - -.PP -\fB\-s\fP, \fB\-\-server\fP="" - The address and port of the Kubernetes API server - -.PP -\fB\-\-stderrthreshold\fP=2 - logs at or above this threshold go to stderr - -.PP -\fB\-\-token\fP="" - Bearer token for authentication to the API server. - -.PP -\fB\-\-user\fP="" - The name of the kubeconfig user to use - -.PP -\fB\-\-username\fP="" - Username for basic authentication to the API server. - -.PP -\fB\-\-v\fP=0 - log level for V logs - -.PP -\fB\-\-validate\fP=false - If true, use a schema to validate the input before sending it - -.PP -\fB\-\-vmodule\fP= - comma\-separated list of pattern=N settings for file\-filtered logging - - -.SH EXAMPLE -.PP -.RS - -.nf - -// listens on ports 5000 and 6000 locally, forwarding data to/from ports 5000 and 6000 in the pod -$ kubectl port\-forward \-p mypod 5000 6000 - -// listens on port 8888 locally, forwarding to 5000 in the pod -$ kubectl port\-forward \-p mypod 8888:5000 - -// listens on a random port locally, forwarding to 5000 in the pod -$ kubectl port\-forward \-p mypod :5000 - -// listens on a random port locally, forwarding to 5000 in the pod -$ kubectl port\-forward \-p mypod 0:5000 - -.fi -.RE - - -.SH SEE ALSO -.PP -\fBkubectl(1)\fP, - - -.SH HISTORY -.PP -January 2015, Originally compiled by Eric Paris (eparis at redhat dot com) based on the kubernetes source material, but hopefully they have been automatically generated since! diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/man/man1/kubectl-proxy.1 b/Godeps/_workspace/src/k8s.io/kubernetes/docs/man/man1/kubectl-proxy.1 deleted file mode 100644 index 3200c91c1311..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/man/man1/kubectl-proxy.1 +++ /dev/null @@ -1,207 +0,0 @@ -.TH "KUBERNETES" "1" " kubernetes User Manuals" "Eric Paris" "Jan 2015" "" - - -.SH NAME -.PP -kubectl proxy \- Run a proxy to the Kubernetes API server - - -.SH SYNOPSIS -.PP -\fBkubectl proxy\fP [OPTIONS] - - -.SH DESCRIPTION -.PP -To proxy all of the kubernetes api and nothing else, use: - -.PP -kubectl proxy \-\-api\-prefix=/ - -.PP -To proxy only part of the kubernetes api and also some static files: - -.PP -kubectl proxy \-\-www=/my/files \-\-www\-prefix=/static/ \-\-api\-prefix=/api/ - -.PP -The above lets you 'curl localhost:8001/api/v1/pods'. - -.PP -To proxy the entire kubernetes api at a different root, use: - -.PP -kubectl proxy \-\-api\-prefix=/custom/ - -.PP -The above lets you 'curl localhost:8001/custom/api/v1/pods' - - -.SH OPTIONS -.PP -\fB\-\-accept\-hosts\fP="^localhost$,^127\\.0\\.0\\.1$,^\\[::1\\]$" - Regular expression for hosts that the proxy should accept. - -.PP -\fB\-\-accept\-paths\fP="^/.*" - Regular expression for paths that the proxy should accept. - -.PP -\fB\-\-api\-prefix\fP="/api/" - Prefix to serve the proxied API under. - -.PP -\fB\-\-disable\-filter\fP=false - If true, disable request filtering in the proxy. This is dangerous, and can leave you vulnerable to XSRF attacks. Use with caution. - -.PP -\fB\-h\fP, \fB\-\-help\fP=false - help for proxy - -.PP -\fB\-p\fP, \fB\-\-port\fP=8001 - The port on which to run the proxy. Set to 0 to pick a random port. - -.PP -\fB\-\-reject\-methods\fP="POST,PUT,PATCH" - Regular expression for HTTP methods that the proxy should reject. - -.PP -\fB\-\-reject\-paths\fP="^/api/.\fI/exec,^/api/.\fP/run" - Regular expression for paths that the proxy should reject. - -.PP -\fB\-w\fP, \fB\-\-www\fP="" - Also serve static files from the given directory under the specified prefix. - -.PP -\fB\-P\fP, \fB\-\-www\-prefix\fP="/static/" - Prefix to serve static files under, if static file directory is specified. - - -.SH OPTIONS INHERITED FROM PARENT COMMANDS -.PP -\fB\-\-alsologtostderr\fP=false - log to standard error as well as files - -.PP -\fB\-\-api\-version\fP="" - The API version to use when talking to the server - -.PP -\fB\-\-certificate\-authority\fP="" - Path to a cert. file for the certificate authority. - -.PP -\fB\-\-client\-certificate\fP="" - Path to a client key file for TLS. - -.PP -\fB\-\-client\-key\fP="" - Path to a client key file for TLS. - -.PP -\fB\-\-cluster\fP="" - The name of the kubeconfig cluster to use - -.PP -\fB\-\-context\fP="" - The name of the kubeconfig context to use - -.PP -\fB\-\-insecure\-skip\-tls\-verify\fP=false - If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure. - -.PP -\fB\-\-kubeconfig\fP="" - Path to the kubeconfig file to use for CLI requests. - -.PP -\fB\-\-log\-backtrace\-at\fP=:0 - when logging hits line file:N, emit a stack trace - -.PP -\fB\-\-log\-dir\fP="" - If non\-empty, write log files in this directory - -.PP -\fB\-\-log\-flush\-frequency\fP=5s - Maximum number of seconds between log flushes - -.PP -\fB\-\-logtostderr\fP=true - log to standard error instead of files - -.PP -\fB\-\-match\-server\-version\fP=false - Require server version to match client version - -.PP -\fB\-\-namespace\fP="" - If present, the namespace scope for this CLI request. - -.PP -\fB\-\-password\fP="" - Password for basic authentication to the API server. - -.PP -\fB\-s\fP, \fB\-\-server\fP="" - The address and port of the Kubernetes API server - -.PP -\fB\-\-stderrthreshold\fP=2 - logs at or above this threshold go to stderr - -.PP -\fB\-\-token\fP="" - Bearer token for authentication to the API server. - -.PP -\fB\-\-user\fP="" - The name of the kubeconfig user to use - -.PP -\fB\-\-username\fP="" - Username for basic authentication to the API server. - -.PP -\fB\-\-v\fP=0 - log level for V logs - -.PP -\fB\-\-validate\fP=false - If true, use a schema to validate the input before sending it - -.PP -\fB\-\-vmodule\fP= - comma\-separated list of pattern=N settings for file\-filtered logging - - -.SH EXAMPLE -.PP -.RS - -.nf -// Run a proxy to kubernetes apiserver on port 8011, serving static content from ./local/www/ -$ kubectl proxy \-\-port=8011 \-\-www=./local/www/ - -// Run a proxy to kubernetes apiserver on an arbitrary local port. -// The chosen port for the server will be output to stdout. -$ kubectl proxy \-\-port=0 - -// Run a proxy to kubernetes apiserver, changing the api prefix to k8s\-api -// This makes e.g. the pods api available at localhost:8011/k8s\-api/v1/pods/ -$ kubectl proxy \-\-api\-prefix=/k8s\-api - -.fi -.RE - - -.SH SEE ALSO -.PP -\fBkubectl(1)\fP, - - -.SH HISTORY -.PP -January 2015, Originally compiled by Eric Paris (eparis at redhat dot com) based on the kubernetes source material, but hopefully they have been automatically generated since! diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/man/man1/kubectl-replace.1 b/Godeps/_workspace/src/k8s.io/kubernetes/docs/man/man1/kubectl-replace.1 deleted file mode 100644 index 9825fd6efd6f..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/man/man1/kubectl-replace.1 +++ /dev/null @@ -1,175 +0,0 @@ -.TH "KUBERNETES" "1" " kubernetes User Manuals" "Eric Paris" "Jan 2015" "" - - -.SH NAME -.PP -kubectl replace \- Replace a resource by filename or stdin. - - -.SH SYNOPSIS -.PP -\fBkubectl replace\fP [OPTIONS] - - -.SH DESCRIPTION -.PP -Replace a resource by filename or stdin. - -.PP -JSON and YAML formats are accepted. - - -.SH OPTIONS -.PP -\fB\-\-cascade\fP=false - Only relevant during a force replace. If true, cascade the deletion of the resources managed by this resource (e.g. Pods created by a ReplicationController). Default true. - -.PP -\fB\-f\fP, \fB\-\-filename\fP=[] - Filename, directory, or URL to file to use to replace the resource. - -.PP -\fB\-\-force\fP=false - Delete and re\-create the specified resource - -.PP -\fB\-\-grace\-period\fP=\-1 - Only relevant during a force replace. Period of time in seconds given to the old resource to terminate gracefully. Ignored if negative. - -.PP -\fB\-h\fP, \fB\-\-help\fP=false - help for replace - -.PP -\fB\-o\fP, \fB\-\-output\fP="" - Output mode. Use "\-o name" for shorter output (resource/name). - -.PP -\fB\-\-timeout\fP=0 - Only relevant during a force replace. The length of time to wait before giving up on a delete of the old resource, zero means determine a timeout from the size of the object - - -.SH OPTIONS INHERITED FROM PARENT COMMANDS -.PP -\fB\-\-alsologtostderr\fP=false - log to standard error as well as files - -.PP -\fB\-\-api\-version\fP="" - The API version to use when talking to the server - -.PP -\fB\-\-certificate\-authority\fP="" - Path to a cert. file for the certificate authority. - -.PP -\fB\-\-client\-certificate\fP="" - Path to a client key file for TLS. - -.PP -\fB\-\-client\-key\fP="" - Path to a client key file for TLS. - -.PP -\fB\-\-cluster\fP="" - The name of the kubeconfig cluster to use - -.PP -\fB\-\-context\fP="" - The name of the kubeconfig context to use - -.PP -\fB\-\-insecure\-skip\-tls\-verify\fP=false - If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure. - -.PP -\fB\-\-kubeconfig\fP="" - Path to the kubeconfig file to use for CLI requests. - -.PP -\fB\-\-log\-backtrace\-at\fP=:0 - when logging hits line file:N, emit a stack trace - -.PP -\fB\-\-log\-dir\fP="" - If non\-empty, write log files in this directory - -.PP -\fB\-\-log\-flush\-frequency\fP=5s - Maximum number of seconds between log flushes - -.PP -\fB\-\-logtostderr\fP=true - log to standard error instead of files - -.PP -\fB\-\-match\-server\-version\fP=false - Require server version to match client version - -.PP -\fB\-\-namespace\fP="" - If present, the namespace scope for this CLI request. - -.PP -\fB\-\-password\fP="" - Password for basic authentication to the API server. - -.PP -\fB\-s\fP, \fB\-\-server\fP="" - The address and port of the Kubernetes API server - -.PP -\fB\-\-stderrthreshold\fP=2 - logs at or above this threshold go to stderr - -.PP -\fB\-\-token\fP="" - Bearer token for authentication to the API server. - -.PP -\fB\-\-user\fP="" - The name of the kubeconfig user to use - -.PP -\fB\-\-username\fP="" - Username for basic authentication to the API server. - -.PP -\fB\-\-v\fP=0 - log level for V logs - -.PP -\fB\-\-validate\fP=false - If true, use a schema to validate the input before sending it - -.PP -\fB\-\-vmodule\fP= - comma\-separated list of pattern=N settings for file\-filtered logging - - -.SH EXAMPLE -.PP -.RS - -.nf -// Replace a pod using the data in pod.json. -$ kubectl replace \-f ./pod.json - -// Replace a pod based on the JSON passed into stdin. -$ cat pod.json | kubectl replace \-f \- - -// Force replace, delete and then re\-create the resource -kubectl replace \-\-force \-f ./pod.json - -.fi -.RE - - -.SH SEE ALSO -.PP -\fBkubectl(1)\fP, - - -.SH HISTORY -.PP -January 2015, Originally compiled by Eric Paris (eparis at redhat dot com) based on the kubernetes source material, but hopefully they have been automatically generated since! diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/man/man1/kubectl-rolling-update.1 b/Godeps/_workspace/src/k8s.io/kubernetes/docs/man/man1/kubectl-rolling-update.1 deleted file mode 100644 index caf05d027c83..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/man/man1/kubectl-rolling-update.1 +++ /dev/null @@ -1,207 +0,0 @@ -.TH "KUBERNETES" "1" " kubernetes User Manuals" "Eric Paris" "Jan 2015" "" - - -.SH NAME -.PP -kubectl rolling\-update \- Perform a rolling update of the given ReplicationController. - - -.SH SYNOPSIS -.PP -\fBkubectl rolling\-update\fP [OPTIONS] - - -.SH DESCRIPTION -.PP -Perform a rolling update of the given ReplicationController. - -.PP -Replaces the specified replication controller with a new replication controller by updating one pod at a time to use the -new PodTemplate. The new\-controller.json must specify the same namespace as the -existing replication controller and overwrite at least one (common) label in its replicaSelector. - - -.SH OPTIONS -.PP -\fB\-\-deployment\-label\-key\fP="deployment" - The key to use to differentiate between two different controllers, default 'deployment'. Only relevant when \-\-image is specified, ignored otherwise - -.PP -\fB\-\-dry\-run\fP=false - If true, print out the changes that would be made, but don't actually make them. - -.PP -\fB\-f\fP, \fB\-\-filename\fP="" - Filename or URL to file to use to create the new replication controller. - -.PP -\fB\-h\fP, \fB\-\-help\fP=false - help for rolling\-update - -.PP -\fB\-\-image\fP="" - Image to use for upgrading the replication controller. Can not be used with \-\-filename/\-f - -.PP -\fB\-\-no\-headers\fP=false - When using the default output, don't print headers. - -.PP -\fB\-o\fP, \fB\-\-output\fP="" - Output format. One of: json|yaml|template|templatefile|wide. - -.PP -\fB\-\-output\-version\fP="" - Output the formatted object with the given version (default api\-version). - -.PP -\fB\-\-poll\-interval\fP="3s" - Time delay between polling for replication controller status after the update. Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h". - -.PP -\fB\-\-rollback\fP=false - If true, this is a request to abort an existing rollout that is partially rolled out. It effectively reverses current and next and runs a rollout - -.PP -\fB\-t\fP, \fB\-\-template\fP="" - Template string or path to template file to use when \-o=template or \-o=templatefile. The template format is golang templates [ -\[la]http://golang.org/pkg/text/template/#pkg-overview\[ra]] - -.PP -\fB\-\-timeout\fP="5m0s" - Max time to wait for a replication controller to update before giving up. Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h". - -.PP -\fB\-\-update\-period\fP="1m0s" - Time to wait between updating pods. Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h". - - -.SH OPTIONS INHERITED FROM PARENT COMMANDS -.PP -\fB\-\-alsologtostderr\fP=false - log to standard error as well as files - -.PP -\fB\-\-api\-version\fP="" - The API version to use when talking to the server - -.PP -\fB\-\-certificate\-authority\fP="" - Path to a cert. file for the certificate authority. - -.PP -\fB\-\-client\-certificate\fP="" - Path to a client key file for TLS. - -.PP -\fB\-\-client\-key\fP="" - Path to a client key file for TLS. - -.PP -\fB\-\-cluster\fP="" - The name of the kubeconfig cluster to use - -.PP -\fB\-\-context\fP="" - The name of the kubeconfig context to use - -.PP -\fB\-\-insecure\-skip\-tls\-verify\fP=false - If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure. - -.PP -\fB\-\-kubeconfig\fP="" - Path to the kubeconfig file to use for CLI requests. - -.PP -\fB\-\-log\-backtrace\-at\fP=:0 - when logging hits line file:N, emit a stack trace - -.PP -\fB\-\-log\-dir\fP="" - If non\-empty, write log files in this directory - -.PP -\fB\-\-log\-flush\-frequency\fP=5s - Maximum number of seconds between log flushes - -.PP -\fB\-\-logtostderr\fP=true - log to standard error instead of files - -.PP -\fB\-\-match\-server\-version\fP=false - Require server version to match client version - -.PP -\fB\-\-namespace\fP="" - If present, the namespace scope for this CLI request. - -.PP -\fB\-\-password\fP="" - Password for basic authentication to the API server. - -.PP -\fB\-s\fP, \fB\-\-server\fP="" - The address and port of the Kubernetes API server - -.PP -\fB\-\-stderrthreshold\fP=2 - logs at or above this threshold go to stderr - -.PP -\fB\-\-token\fP="" - Bearer token for authentication to the API server. - -.PP -\fB\-\-user\fP="" - The name of the kubeconfig user to use - -.PP -\fB\-\-username\fP="" - Username for basic authentication to the API server. - -.PP -\fB\-\-v\fP=0 - log level for V logs - -.PP -\fB\-\-validate\fP=false - If true, use a schema to validate the input before sending it - -.PP -\fB\-\-vmodule\fP= - comma\-separated list of pattern=N settings for file\-filtered logging - - -.SH EXAMPLE -.PP -.RS - -.nf -// Update pods of frontend\-v1 using new replication controller data in frontend\-v2.json. -$ kubectl rolling\-update frontend\-v1 \-f frontend\-v2.json - -// Update pods of frontend\-v1 using JSON data passed into stdin. -$ cat frontend\-v2.json | kubectl rolling\-update frontend\-v1 \-f \- - -// Update the pods of frontend\-v1 to frontend\-v2 by just changing the image, and switching the -// name of the replication controller. -$ kubectl rolling\-update frontend\-v1 frontend\-v2 \-\-image=image:v2 - -// Update the pods of frontend by just changing the image, and keeping the old name -$ kubectl rolling\-update frontend \-\-image=image:v2 - - -.fi -.RE - - -.SH SEE ALSO -.PP -\fBkubectl(1)\fP, - - -.SH HISTORY -.PP -January 2015, Originally compiled by Eric Paris (eparis at redhat dot com) based on the kubernetes source material, but hopefully they have been automatically generated since! diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/man/man1/kubectl-run.1 b/Godeps/_workspace/src/k8s.io/kubernetes/docs/man/man1/kubectl-run.1 deleted file mode 100644 index d193eacf20ba..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/man/man1/kubectl-run.1 +++ /dev/null @@ -1,201 +0,0 @@ -.TH "KUBERNETES" "1" " kubernetes User Manuals" "Eric Paris" "Jan 2015" "" - - -.SH NAME -.PP -kubectl run \- Run a particular image on the cluster. - - -.SH SYNOPSIS -.PP -\fBkubectl run\fP [OPTIONS] - - -.SH DESCRIPTION -.PP -Create and run a particular image, possibly replicated. -Creates a replication controller to manage the created container(s). - - -.SH OPTIONS -.PP -\fB\-\-dry\-run\fP=false - If true, only print the object that would be sent, without sending it. - -.PP -\fB\-\-generator\fP="run/v1" - The name of the API generator to use. Default is 'run\-controller/v1'. - -.PP -\fB\-h\fP, \fB\-\-help\fP=false - help for run - -.PP -\fB\-\-hostport\fP=\-1 - The host port mapping for the container port. To demonstrate a single\-machine container. - -.PP -\fB\-\-image\fP="" - The image for the container to run. - -.PP -\fB\-l\fP, \fB\-\-labels\fP="" - Labels to apply to the pod(s). - -.PP -\fB\-\-no\-headers\fP=false - When using the default output, don't print headers. - -.PP -\fB\-o\fP, \fB\-\-output\fP="" - Output format. One of: json|yaml|template|templatefile|wide. - -.PP -\fB\-\-output\-version\fP="" - Output the formatted object with the given version (default api\-version). - -.PP -\fB\-\-overrides\fP="" - An inline JSON override for the generated object. If this is non\-empty, it is used to override the generated object. Requires that the object supply a valid apiVersion field. - -.PP -\fB\-\-port\fP=\-1 - The port that this container exposes. - -.PP -\fB\-r\fP, \fB\-\-replicas\fP=1 - Number of replicas to create for this container. Default is 1. - -.PP -\fB\-t\fP, \fB\-\-template\fP="" - Template string or path to template file to use when \-o=template or \-o=templatefile. The template format is golang templates [ -\[la]http://golang.org/pkg/text/template/#pkg-overview\[ra]] - - -.SH OPTIONS INHERITED FROM PARENT COMMANDS -.PP -\fB\-\-alsologtostderr\fP=false - log to standard error as well as files - -.PP -\fB\-\-api\-version\fP="" - The API version to use when talking to the server - -.PP -\fB\-\-certificate\-authority\fP="" - Path to a cert. file for the certificate authority. - -.PP -\fB\-\-client\-certificate\fP="" - Path to a client key file for TLS. - -.PP -\fB\-\-client\-key\fP="" - Path to a client key file for TLS. - -.PP -\fB\-\-cluster\fP="" - The name of the kubeconfig cluster to use - -.PP -\fB\-\-context\fP="" - The name of the kubeconfig context to use - -.PP -\fB\-\-insecure\-skip\-tls\-verify\fP=false - If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure. - -.PP -\fB\-\-kubeconfig\fP="" - Path to the kubeconfig file to use for CLI requests. - -.PP -\fB\-\-log\-backtrace\-at\fP=:0 - when logging hits line file:N, emit a stack trace - -.PP -\fB\-\-log\-dir\fP="" - If non\-empty, write log files in this directory - -.PP -\fB\-\-log\-flush\-frequency\fP=5s - Maximum number of seconds between log flushes - -.PP -\fB\-\-logtostderr\fP=true - log to standard error instead of files - -.PP -\fB\-\-match\-server\-version\fP=false - Require server version to match client version - -.PP -\fB\-\-namespace\fP="" - If present, the namespace scope for this CLI request. - -.PP -\fB\-\-password\fP="" - Password for basic authentication to the API server. - -.PP -\fB\-s\fP, \fB\-\-server\fP="" - The address and port of the Kubernetes API server - -.PP -\fB\-\-stderrthreshold\fP=2 - logs at or above this threshold go to stderr - -.PP -\fB\-\-token\fP="" - Bearer token for authentication to the API server. - -.PP -\fB\-\-user\fP="" - The name of the kubeconfig user to use - -.PP -\fB\-\-username\fP="" - Username for basic authentication to the API server. - -.PP -\fB\-\-v\fP=0 - log level for V logs - -.PP -\fB\-\-validate\fP=false - If true, use a schema to validate the input before sending it - -.PP -\fB\-\-vmodule\fP= - comma\-separated list of pattern=N settings for file\-filtered logging - - -.SH EXAMPLE -.PP -.RS - -.nf -// Starts a single instance of nginx. -$ kubectl run nginx \-\-image=nginx - -// Starts a replicated instance of nginx. -$ kubectl run nginx \-\-image=nginx \-\-replicas=5 - -// Dry run. Print the corresponding API objects without creating them. -$ kubectl run nginx \-\-image=nginx \-\-dry\-run - -// Start a single instance of nginx, but overload the spec of the replication controller with a partial set of values parsed from JSON. -$ kubectl run nginx \-\-image=nginx \-\-overrides='\{ "apiVersion": "v1", "spec": \{ ... \} \}' - -.fi -.RE - - -.SH SEE ALSO -.PP -\fBkubectl(1)\fP, - - -.SH HISTORY -.PP -January 2015, Originally compiled by Eric Paris (eparis at redhat dot com) based on the kubernetes source material, but hopefully they have been automatically generated since! diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/man/man1/kubectl-scale.1 b/Godeps/_workspace/src/k8s.io/kubernetes/docs/man/man1/kubectl-scale.1 deleted file mode 100644 index 81d0ea236f6c..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/man/man1/kubectl-scale.1 +++ /dev/null @@ -1,174 +0,0 @@ -.TH "KUBERNETES" "1" " kubernetes User Manuals" "Eric Paris" "Jan 2015" "" - - -.SH NAME -.PP -kubectl scale \- Set a new size for a Replication Controller. - - -.SH SYNOPSIS -.PP -\fBkubectl scale\fP [OPTIONS] - - -.SH DESCRIPTION -.PP -Set a new size for a Replication Controller. - -.PP -Scale also allows users to specify one or more preconditions for the scale action. -If \-\-current\-replicas or \-\-resource\-version is specified, it is validated before the -scale is attempted, and it is guaranteed that the precondition holds true when the -scale is sent to the server. - - -.SH OPTIONS -.PP -\fB\-\-current\-replicas\fP=\-1 - Precondition for current size. Requires that the current size of the replication controller match this value in order to scale. - -.PP -\fB\-h\fP, \fB\-\-help\fP=false - help for scale - -.PP -\fB\-o\fP, \fB\-\-output\fP="" - Output mode. Use "\-o name" for shorter output (resource/name). - -.PP -\fB\-\-replicas\fP=\-1 - The new desired number of replicas. Required. - -.PP -\fB\-\-resource\-version\fP="" - Precondition for resource version. Requires that the current resource version match this value in order to scale. - -.PP -\fB\-\-timeout\fP=0 - The length of time to wait before giving up on a scale operation, zero means don't wait. - - -.SH OPTIONS INHERITED FROM PARENT COMMANDS -.PP -\fB\-\-alsologtostderr\fP=false - log to standard error as well as files - -.PP -\fB\-\-api\-version\fP="" - The API version to use when talking to the server - -.PP -\fB\-\-certificate\-authority\fP="" - Path to a cert. file for the certificate authority. - -.PP -\fB\-\-client\-certificate\fP="" - Path to a client key file for TLS. - -.PP -\fB\-\-client\-key\fP="" - Path to a client key file for TLS. - -.PP -\fB\-\-cluster\fP="" - The name of the kubeconfig cluster to use - -.PP -\fB\-\-context\fP="" - The name of the kubeconfig context to use - -.PP -\fB\-\-insecure\-skip\-tls\-verify\fP=false - If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure. - -.PP -\fB\-\-kubeconfig\fP="" - Path to the kubeconfig file to use for CLI requests. - -.PP -\fB\-\-log\-backtrace\-at\fP=:0 - when logging hits line file:N, emit a stack trace - -.PP -\fB\-\-log\-dir\fP="" - If non\-empty, write log files in this directory - -.PP -\fB\-\-log\-flush\-frequency\fP=5s - Maximum number of seconds between log flushes - -.PP -\fB\-\-logtostderr\fP=true - log to standard error instead of files - -.PP -\fB\-\-match\-server\-version\fP=false - Require server version to match client version - -.PP -\fB\-\-namespace\fP="" - If present, the namespace scope for this CLI request. - -.PP -\fB\-\-password\fP="" - Password for basic authentication to the API server. - -.PP -\fB\-s\fP, \fB\-\-server\fP="" - The address and port of the Kubernetes API server - -.PP -\fB\-\-stderrthreshold\fP=2 - logs at or above this threshold go to stderr - -.PP -\fB\-\-token\fP="" - Bearer token for authentication to the API server. - -.PP -\fB\-\-user\fP="" - The name of the kubeconfig user to use - -.PP -\fB\-\-username\fP="" - Username for basic authentication to the API server. - -.PP -\fB\-\-v\fP=0 - log level for V logs - -.PP -\fB\-\-validate\fP=false - If true, use a schema to validate the input before sending it - -.PP -\fB\-\-vmodule\fP= - comma\-separated list of pattern=N settings for file\-filtered logging - - -.SH EXAMPLE -.PP -.RS - -.nf -// Scale replication controller named 'foo' to 3. -$ kubectl scale \-\-replicas=3 replicationcontrollers foo - -// If the replication controller named foo's current size is 2, scale foo to 3. -$ kubectl scale \-\-current\-replicas=2 \-\-replicas=3 replicationcontrollers foo - -// Scale multiple replication controllers. -$ kubectl scale \-\-replicas=5 rc/foo rc/bar - -.fi -.RE - - -.SH SEE ALSO -.PP -\fBkubectl(1)\fP, - - -.SH HISTORY -.PP -January 2015, Originally compiled by Eric Paris (eparis at redhat dot com) based on the kubernetes source material, but hopefully they have been automatically generated since! diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/man/man1/kubectl-stop.1 b/Godeps/_workspace/src/k8s.io/kubernetes/docs/man/man1/kubectl-stop.1 deleted file mode 100644 index 6620c91d6ed6..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/man/man1/kubectl-stop.1 +++ /dev/null @@ -1,187 +0,0 @@ -.TH "KUBERNETES" "1" " kubernetes User Manuals" "Eric Paris" "Jan 2015" "" - - -.SH NAME -.PP -kubectl stop \- Deprecated: Gracefully shut down a resource by name or filename. - - -.SH SYNOPSIS -.PP -\fBkubectl stop\fP [OPTIONS] - - -.SH DESCRIPTION -.PP -Deprecated: Gracefully shut down a resource by name or filename. - -.PP -stop command is deprecated, all its functionalities are covered by delete command. -See 'kubectl delete \-\-help' for more details. - -.PP -Attempts to shut down and delete a resource that supports graceful termination. -If the resource is scalable it will be scaled to 0 before deletion. - - -.SH OPTIONS -.PP -\fB\-\-all\fP=false - [\-all] to select all the specified resources. - -.PP -\fB\-f\fP, \fB\-\-filename\fP=[] - Filename, directory, or URL to file of resource(s) to be stopped. - -.PP -\fB\-\-grace\-period\fP=\-1 - Period of time in seconds given to the resource to terminate gracefully. Ignored if negative. - -.PP -\fB\-h\fP, \fB\-\-help\fP=false - help for stop - -.PP -\fB\-\-ignore\-not\-found\fP=false - Treat "resource not found" as a successful stop. - -.PP -\fB\-o\fP, \fB\-\-output\fP="" - Output mode. Use "\-o name" for shorter output (resource/name). - -.PP -\fB\-l\fP, \fB\-\-selector\fP="" - Selector (label query) to filter on. - -.PP -\fB\-\-timeout\fP=0 - The length of time to wait before giving up on a delete, zero means determine a timeout from the size of the object - - -.SH OPTIONS INHERITED FROM PARENT COMMANDS -.PP -\fB\-\-alsologtostderr\fP=false - log to standard error as well as files - -.PP -\fB\-\-api\-version\fP="" - The API version to use when talking to the server - -.PP -\fB\-\-certificate\-authority\fP="" - Path to a cert. file for the certificate authority. - -.PP -\fB\-\-client\-certificate\fP="" - Path to a client key file for TLS. - -.PP -\fB\-\-client\-key\fP="" - Path to a client key file for TLS. - -.PP -\fB\-\-cluster\fP="" - The name of the kubeconfig cluster to use - -.PP -\fB\-\-context\fP="" - The name of the kubeconfig context to use - -.PP -\fB\-\-insecure\-skip\-tls\-verify\fP=false - If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure. - -.PP -\fB\-\-kubeconfig\fP="" - Path to the kubeconfig file to use for CLI requests. - -.PP -\fB\-\-log\-backtrace\-at\fP=:0 - when logging hits line file:N, emit a stack trace - -.PP -\fB\-\-log\-dir\fP="" - If non\-empty, write log files in this directory - -.PP -\fB\-\-log\-flush\-frequency\fP=5s - Maximum number of seconds between log flushes - -.PP -\fB\-\-logtostderr\fP=true - log to standard error instead of files - -.PP -\fB\-\-match\-server\-version\fP=false - Require server version to match client version - -.PP -\fB\-\-namespace\fP="" - If present, the namespace scope for this CLI request. - -.PP -\fB\-\-password\fP="" - Password for basic authentication to the API server. - -.PP -\fB\-s\fP, \fB\-\-server\fP="" - The address and port of the Kubernetes API server - -.PP -\fB\-\-stderrthreshold\fP=2 - logs at or above this threshold go to stderr - -.PP -\fB\-\-token\fP="" - Bearer token for authentication to the API server. - -.PP -\fB\-\-user\fP="" - The name of the kubeconfig user to use - -.PP -\fB\-\-username\fP="" - Username for basic authentication to the API server. - -.PP -\fB\-\-v\fP=0 - log level for V logs - -.PP -\fB\-\-validate\fP=false - If true, use a schema to validate the input before sending it - -.PP -\fB\-\-vmodule\fP= - comma\-separated list of pattern=N settings for file\-filtered logging - - -.SH EXAMPLE -.PP -.RS - -.nf -// Shut down foo. -$ kubectl stop replicationcontroller foo - -// Stop pods and services with label name=myLabel. -$ kubectl stop pods,services \-l name=myLabel - -// Shut down the service defined in service.json -$ kubectl stop \-f service.json - -// Shut down all resources in the path/to/resources directory -$ kubectl stop \-f path/to/resources - -.fi -.RE - - -.SH SEE ALSO -.PP -\fBkubectl(1)\fP, - - -.SH HISTORY -.PP -January 2015, Originally compiled by Eric Paris (eparis at redhat dot com) based on the kubernetes source material, but hopefully they have been automatically generated since! diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/man/man1/kubectl-version.1 b/Godeps/_workspace/src/k8s.io/kubernetes/docs/man/man1/kubectl-version.1 deleted file mode 100644 index d91fca6c10f0..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/man/man1/kubectl-version.1 +++ /dev/null @@ -1,134 +0,0 @@ -.TH "KUBERNETES" "1" " kubernetes User Manuals" "Eric Paris" "Jan 2015" "" - - -.SH NAME -.PP -kubectl version \- Print the client and server version information. - - -.SH SYNOPSIS -.PP -\fBkubectl version\fP [OPTIONS] - - -.SH DESCRIPTION -.PP -Print the client and server version information. - - -.SH OPTIONS -.PP -\fB\-c\fP, \fB\-\-client\fP=false - Client version only (no server required). - -.PP -\fB\-h\fP, \fB\-\-help\fP=false - help for version - - -.SH OPTIONS INHERITED FROM PARENT COMMANDS -.PP -\fB\-\-alsologtostderr\fP=false - log to standard error as well as files - -.PP -\fB\-\-api\-version\fP="" - The API version to use when talking to the server - -.PP -\fB\-\-certificate\-authority\fP="" - Path to a cert. file for the certificate authority. - -.PP -\fB\-\-client\-certificate\fP="" - Path to a client key file for TLS. - -.PP -\fB\-\-client\-key\fP="" - Path to a client key file for TLS. - -.PP -\fB\-\-cluster\fP="" - The name of the kubeconfig cluster to use - -.PP -\fB\-\-context\fP="" - The name of the kubeconfig context to use - -.PP -\fB\-\-insecure\-skip\-tls\-verify\fP=false - If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure. - -.PP -\fB\-\-kubeconfig\fP="" - Path to the kubeconfig file to use for CLI requests. - -.PP -\fB\-\-log\-backtrace\-at\fP=:0 - when logging hits line file:N, emit a stack trace - -.PP -\fB\-\-log\-dir\fP="" - If non\-empty, write log files in this directory - -.PP -\fB\-\-log\-flush\-frequency\fP=5s - Maximum number of seconds between log flushes - -.PP -\fB\-\-logtostderr\fP=true - log to standard error instead of files - -.PP -\fB\-\-match\-server\-version\fP=false - Require server version to match client version - -.PP -\fB\-\-namespace\fP="" - If present, the namespace scope for this CLI request. - -.PP -\fB\-\-password\fP="" - Password for basic authentication to the API server. - -.PP -\fB\-s\fP, \fB\-\-server\fP="" - The address and port of the Kubernetes API server - -.PP -\fB\-\-stderrthreshold\fP=2 - logs at or above this threshold go to stderr - -.PP -\fB\-\-token\fP="" - Bearer token for authentication to the API server. - -.PP -\fB\-\-user\fP="" - The name of the kubeconfig user to use - -.PP -\fB\-\-username\fP="" - Username for basic authentication to the API server. - -.PP -\fB\-\-v\fP=0 - log level for V logs - -.PP -\fB\-\-validate\fP=false - If true, use a schema to validate the input before sending it - -.PP -\fB\-\-vmodule\fP= - comma\-separated list of pattern=N settings for file\-filtered logging - - -.SH SEE ALSO -.PP -\fBkubectl(1)\fP, - - -.SH HISTORY -.PP -January 2015, Originally compiled by Eric Paris (eparis at redhat dot com) based on the kubernetes source material, but hopefully they have been automatically generated since! diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/man/man1/kubectl.1 b/Godeps/_workspace/src/k8s.io/kubernetes/docs/man/man1/kubectl.1 deleted file mode 100644 index f1d091bb9736..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/man/man1/kubectl.1 +++ /dev/null @@ -1,132 +0,0 @@ -.TH "KUBERNETES" "1" " kubernetes User Manuals" "Eric Paris" "Jan 2015" "" - - -.SH NAME -.PP -kubectl \- kubectl controls the Kubernetes cluster manager - - -.SH SYNOPSIS -.PP -\fBkubectl\fP [OPTIONS] - - -.SH DESCRIPTION -.PP -kubectl controls the Kubernetes cluster manager. - -.PP -Find more information at -\[la]https://k8s.io/kubernetes\[ra]. - - -.SH OPTIONS -.PP -\fB\-\-alsologtostderr\fP=false - log to standard error as well as files - -.PP -\fB\-\-api\-version\fP="" - The API version to use when talking to the server - -.PP -\fB\-\-certificate\-authority\fP="" - Path to a cert. file for the certificate authority. - -.PP -\fB\-\-client\-certificate\fP="" - Path to a client key file for TLS. - -.PP -\fB\-\-client\-key\fP="" - Path to a client key file for TLS. - -.PP -\fB\-\-cluster\fP="" - The name of the kubeconfig cluster to use - -.PP -\fB\-\-context\fP="" - The name of the kubeconfig context to use - -.PP -\fB\-h\fP, \fB\-\-help\fP=false - help for kubectl - -.PP -\fB\-\-insecure\-skip\-tls\-verify\fP=false - If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure. - -.PP -\fB\-\-kubeconfig\fP="" - Path to the kubeconfig file to use for CLI requests. - -.PP -\fB\-\-log\-backtrace\-at\fP=:0 - when logging hits line file:N, emit a stack trace - -.PP -\fB\-\-log\-dir\fP="" - If non\-empty, write log files in this directory - -.PP -\fB\-\-log\-flush\-frequency\fP=5s - Maximum number of seconds between log flushes - -.PP -\fB\-\-logtostderr\fP=true - log to standard error instead of files - -.PP -\fB\-\-match\-server\-version\fP=false - Require server version to match client version - -.PP -\fB\-\-namespace\fP="" - If present, the namespace scope for this CLI request. - -.PP -\fB\-\-password\fP="" - Password for basic authentication to the API server. - -.PP -\fB\-s\fP, \fB\-\-server\fP="" - The address and port of the Kubernetes API server - -.PP -\fB\-\-stderrthreshold\fP=2 - logs at or above this threshold go to stderr - -.PP -\fB\-\-token\fP="" - Bearer token for authentication to the API server. - -.PP -\fB\-\-user\fP="" - The name of the kubeconfig user to use - -.PP -\fB\-\-username\fP="" - Username for basic authentication to the API server. - -.PP -\fB\-\-v\fP=0 - log level for V logs - -.PP -\fB\-\-validate\fP=false - If true, use a schema to validate the input before sending it - -.PP -\fB\-\-vmodule\fP= - comma\-separated list of pattern=N settings for file\-filtered logging - - -.SH SEE ALSO -.PP -\fBkubectl\-get(1)\fP, \fBkubectl\-describe(1)\fP, \fBkubectl\-create(1)\fP, \fBkubectl\-replace(1)\fP, \fBkubectl\-patch(1)\fP, \fBkubectl\-delete(1)\fP, \fBkubectl\-namespace(1)\fP, \fBkubectl\-logs(1)\fP, \fBkubectl\-rolling\-update(1)\fP, \fBkubectl\-scale(1)\fP, \fBkubectl\-attach(1)\fP, \fBkubectl\-exec(1)\fP, \fBkubectl\-port\-forward(1)\fP, \fBkubectl\-proxy(1)\fP, \fBkubectl\-run(1)\fP, \fBkubectl\-stop(1)\fP, \fBkubectl\-expose(1)\fP, \fBkubectl\-label(1)\fP, \fBkubectl\-config(1)\fP, \fBkubectl\-cluster\-info(1)\fP, \fBkubectl\-api\-versions(1)\fP, \fBkubectl\-version(1)\fP, - - -.SH HISTORY -.PP -January 2015, Originally compiled by Eric Paris (eparis at redhat dot com) based on the kubernetes source material, but hopefully they have been automatically generated since! diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/reporting-security-issues.md b/Godeps/_workspace/src/k8s.io/kubernetes/docs/reporting-security-issues.md deleted file mode 100644 index d2948c759125..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/reporting-security-issues.md +++ /dev/null @@ -1,57 +0,0 @@ - - - - -WARNING -WARNING -WARNING -WARNING -WARNING - -

    PLEASE NOTE: This document applies to the HEAD of the source tree

    - -If you are using a released version of Kubernetes, you should -refer to the docs that go with that version. - - -The latest 1.0.x release of this document can be found -[here](http://releases.k8s.io/release-1.0/docs/reporting-security-issues.md). - -Documentation for other releases can be found at -[releases.k8s.io](http://releases.k8s.io). - --- - - - - - -# Security - -If you believe you have discovered a vulnerability or a have a security incident to report, please follow the steps below. This applies to Kubernetes releases v1.0 or later. - -To watch for security and major API announcements, please join our [kubernetes-announce](https://groups.google.com/forum/#!forum/kubernetes-announce) group. - -## Reporting a security issue - -To report an issue, please: -- Submit a bug report [here](http://goo.gl/vulnz). - - Select “I want to report a technical security bug in a Google product (SQLi, XSS, etc.).” - - Select “Other” as the Application Type. -- Under reproduction steps, please additionally include - - the words "Kubernetes Security issue" - - Description of the issue - - Kubernetes release (e.g. output of `kubectl version` command, which includes server version.) - - Environment setup (e.g. which "Getting Started Guide" you followed, if any; what node operating system used; what service or software creates your virtual machines, if any) - -An online submission will have the fastest response; however, if you prefer email, please send mail to security@google.com. If you feel the need, please use the [PGP public key](https://services.google.com/corporate/publickey.txt) to encrypt communications. - - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/reporting-security-issues.md?pixel)]() - diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/roadmap.md b/Godeps/_workspace/src/k8s.io/kubernetes/docs/roadmap.md deleted file mode 100644 index 705fd181224a..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/roadmap.md +++ /dev/null @@ -1,43 +0,0 @@ - - - - -WARNING -WARNING -WARNING -WARNING -WARNING - -

    PLEASE NOTE: This document applies to the HEAD of the source tree

    - -If you are using a released version of Kubernetes, you should -refer to the docs that go with that version. - - -The latest 1.0.x release of this document can be found -[here](http://releases.k8s.io/release-1.0/docs/roadmap.md). - -Documentation for other releases can be found at -[releases.k8s.io](http://releases.k8s.io). - --- - - - - - -# Kubernetes Roadmap - -We're in the process of prioritizing changes to be made after 1.0. - -Please watch the [Github milestones] (https://k8s.io/kubernetes/milestones) for our future plans. - - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/roadmap.md?pixel)]() - diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/troubleshooting.md b/Godeps/_workspace/src/k8s.io/kubernetes/docs/troubleshooting.md deleted file mode 100644 index ed5a6feab1a6..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/troubleshooting.md +++ /dev/null @@ -1,76 +0,0 @@ - - - - -WARNING -WARNING -WARNING -WARNING -WARNING - -

    PLEASE NOTE: This document applies to the HEAD of the source tree

    - -If you are using a released version of Kubernetes, you should -refer to the docs that go with that version. - - -The latest 1.0.x release of this document can be found -[here](http://releases.k8s.io/release-1.0/docs/troubleshooting.md). - -Documentation for other releases can be found at -[releases.k8s.io](http://releases.k8s.io). - --- - - - - - -# Troubleshooting - -Sometimes things go wrong. This guide is aimed at making them right. It has two sections: - * [Troubleshooting your application](user-guide/application-troubleshooting.md) - Useful for users who are deploying code into Kubernetes and wondering why it is not working. - * [Troubleshooting your cluster](admin/cluster-troubleshooting.md) - Useful for cluster administrators and people whose Kubernetes cluster is unhappy. - -You should also check the [known issues](user-guide/known-issues.md) for the release you're using. - -# Getting help - -If your problem isn't answered by any of the guides above, there are variety of ways for you to get help from the Kubernetes team. - -## Questions - -We have a number of FAQ pages - * [User FAQ](https://k8s.io/kubernetes/wiki/User-FAQ) - * [Debugging FAQ](https://k8s.io/kubernetes/wiki/Debugging-FAQ) - * [Services FAQ](https://k8s.io/kubernetes/wiki/Services-FAQ) - -You may also find the StackOverflow topics relevant - * [Kubernetes](http://stackoverflow.com/questions/tagged/kubernetes) - * [Google Container Engine - GKE](http://stackoverflow.com/questions/tagged/google-container-engine) - -## Bugs and Feature requests - -If you have what looks like a bug, or you would like to make a feature request, please use the [Github issue tracking system](https://k8s.io/kubernetes/issues). - -Before you file an issue, please search existing issues to see if your issue is already covered. - -# Help! My question isn't covered! I need help now! - -## IRC - -The Kubernetes team hangs out on IRC at [`#google-containers`](https://botbot.me/freenode/google-containers/) on freenode. Feel free to come and ask any and all questions there. - -## Mailing List - -The Kubernetes mailing list is [google-containers@googlegroups.com](https://groups.google.com/forum/#!forum/google-containers) - - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/troubleshooting.md?pixel)]() - diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/user-guide/README.md b/Godeps/_workspace/src/k8s.io/kubernetes/docs/user-guide/README.md deleted file mode 100644 index 27b713b6fea3..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/user-guide/README.md +++ /dev/null @@ -1,135 +0,0 @@ - - - - -WARNING -WARNING -WARNING -WARNING -WARNING - -

    PLEASE NOTE: This document applies to the HEAD of the source tree

    - -If you are using a released version of Kubernetes, you should -refer to the docs that go with that version. - - -The latest 1.0.x release of this document can be found -[here](http://releases.k8s.io/release-1.0/docs/user-guide/README.md). - -Documentation for other releases can be found at -[releases.k8s.io](http://releases.k8s.io). - --- - - - - - -# Kubernetes User Guide: Managing Applications - -**Table of Contents** - - -- [Kubernetes User Guide: Managing Applications](#kubernetes-user-guide-managing-applications) - - [Quick walkthrough](#quick-walkthrough) - - [Thorough walkthrough](#thorough-walkthrough) - - [Concept guide](#concept-guide) - - [Further reading](#further-reading) - - - -The user guide is intended for anyone who wants to run programs and services on an existing Kubernetes cluster. Setup and administration of a Kubernetes cluster is described in the [Cluster Admin Guide](../../docs/admin/README.md). The [Developer Guide](../../docs/devel/README.md) is for anyone wanting to either write code which directly accesses the Kubernetes API, or to contribute directly to the Kubernetes project. - -Please ensure you have completed the [prerequisites for running examples from the user guide](prereqs.md). - -## Quick walkthrough - -1. [Kubernetes 101](walkthrough/README.md) -1. [Kubernetes 201](walkthrough/k8s201.md) - -## Thorough walkthrough - -If you don't have much familiarity with Kubernetes, we recommend you read the following sections in order: - -1. [Quick start: launch and expose an application](quick-start.md) -1. [Configuring and launching containers: configuring common container parameters](configuring-containers.md) -1. [Deploying continuously running applications](deploying-applications.md) -1. [Connecting applications: exposing applications to clients and users](connecting-applications.md) -1. [Working with containers in production](production-pods.md) -1. [Managing deployments](managing-deployments.md) -1. [Application introspection and debugging](introspection-and-debugging.md) - 1. [Using the Kubernetes web user interface](ui.md) - 1. [Logging](logging.md) - 1. [Monitoring](monitoring.md) - 1. [Getting into containers via `exec`](getting-into-containers.md) - 1. [Connecting to containers via proxies](connecting-to-applications-proxy.md) - 1. [Connecting to containers via port forwarding](connecting-to-applications-port-forward.md) - -## Concept guide - -[**Overview**](overview.md) -: A brief overview of Kubernetes concepts. - -[**Cluster**](../admin/README.md) -: A cluster is a set of physical or virtual machines and other infrastructure resources used by Kubernetes to run your applications. - -[**Node**](../admin/node.md) -: A node is a physical or virtual machine running Kubernetes, onto which pods can be scheduled. - -[**Pod**](pods.md) -: A pod is a co-located group of containers and volumes. - -[**Label**](labels.md) -: A label is a key/value pair that is attached to a resource, such as a pod, to convey a user-defined identifying attribute. Labels can be used to organize and to select subsets of resources. - -[**Selector**](labels.md#label-selectors) -: A selector is an expression that matches labels in order to identify related resources, such as which pods are targeted by a load-balanced service. - -[**Replication Controller**](replication-controller.md) -: A replication controller ensures that a specified number of pod replicas are running at any one time. It both allows for easy scaling of replicated systems and handles re-creation of a pod when the machine it is on reboots or otherwise fails. - -[**Service**](services.md) -: A service defines a set of pods and a means by which to access them, such as single stable IP address and corresponding DNS name. - -[**Volume**](volumes.md) -: A volume is a directory, possibly with some data in it, which is accessible to a Container as part of its filesystem. Kubernetes volumes build upon [Docker Volumes](https://docs.docker.com/userguide/dockervolumes/), adding provisioning of the volume directory and/or device. - -[**Secret**](secrets.md) -: A secret stores sensitive data, such as authentication tokens, which can be made available to containers upon request. - -[**Name**](identifiers.md) -: A user- or client-provided name for a resource. - -[**Namespace**](namespaces.md) -: A namespace is like a prefix to the name of a resource. Namespaces help different projects, teams, or customers to share a cluster, such as by preventing name collisions between unrelated teams. - -[**Annotation**](annotations.md) -: A key/value pair that can hold larger (compared to a label), and possibly not human-readable, data, intended to store non-identifying auxiliary data, especially data manipulated by tools and system extensions. Efficient filtering by annotation values is not supported. - -## Further reading - -* API resources - * [Working with resources](working-with-resources.md) - -* Pods and containers - * [Pod lifecycle and restart policies](pod-states.md) - * [Lifecycle hooks](container-environment.md) - * [Compute resources, such as cpu and memory](compute-resources.md) - * [Specifying commands and requesting capabilities](containers.md) - * [Downward API: accessing system configuration from a pod](downward-api.md) - * [Images and registries](images.md) - * [Migrating from docker-cli to kubectl](docker-cli-to-kubectl.md) - * [Tips and tricks when working with config](config-best-practices.md) - * [Assign pods to selected nodes](node-selection/) - * [Perform a rolling update on a running group of pods](update-demo/) - - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/README.md?pixel)]() - diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/user-guide/accessing-the-cluster.md b/Godeps/_workspace/src/k8s.io/kubernetes/docs/user-guide/accessing-the-cluster.md deleted file mode 100644 index 83709c6bc96e..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/user-guide/accessing-the-cluster.md +++ /dev/null @@ -1,323 +0,0 @@ - - - - -WARNING -WARNING -WARNING -WARNING -WARNING - -

    PLEASE NOTE: This document applies to the HEAD of the source tree

    - -If you are using a released version of Kubernetes, you should -refer to the docs that go with that version. - - -The latest 1.0.x release of this document can be found -[here](http://releases.k8s.io/release-1.0/docs/user-guide/accessing-the-cluster.md). - -Documentation for other releases can be found at -[releases.k8s.io](http://releases.k8s.io). - --- - - - - - -# User Guide to Accessing the Cluster - -**Table of Contents** - - -- [User Guide to Accessing the Cluster](#user-guide-to-accessing-the-cluster) - - [Accessing the cluster API](#accessing-the-cluster-api) - - [Accessing for the first time with kubectl](#accessing-for-the-first-time-with-kubectl) - - [Directly accessing the REST API](#directly-accessing-the-rest-api) - - [Using kubectl proxy](#using-kubectl-proxy) - - [Without kubectl proxy](#without-kubectl-proxy) - - [Programmatic access to the API](#programmatic-access-to-the-api) - - [Accessing the API from a Pod](#accessing-the-api-from-a-pod) - - [Accessing services running on the cluster](#accessing-services-running-on-the-cluster) - - [Ways to connect](#ways-to-connect) - - [Discovering builtin services](#discovering-builtin-services) - - [Manually constructing apiserver proxy URLs](#manually-constructing-apiserver-proxy-urls) - - [Examples](#examples) - - [Using web browsers to access services running on the cluster](#using-web-browsers-to-access-services-running-on-the-cluster) - - [Requesting redirects](#requesting-redirects) - - [So Many Proxies](#so-many-proxies) - - - -## Accessing the cluster API - -### Accessing for the first time with kubectl - -When accessing the Kubernetes API for the first time, we suggest using the -Kubernetes CLI, `kubectl`. - -To access a cluster, you need to know the location of the cluster and have credentials -to access it. Typically, this is automatically set-up when you work through -though a [Getting started guide](../getting-started-guides/README.md), -or someone else setup the cluster and provided you with credentials and a location. - -Check the location and credentials that kubectl knows about with this command: - -```console -$ kubectl config view -``` - -Many of the [examples](../../examples/) provide an introduction to using -kubectl and complete documentation is found in the [kubectl manual](kubectl/kubectl.md). - -### Directly accessing the REST API - -Kubectl handles locating and authenticating to the apiserver. -If you want to directly access the REST API with an http client like -curl or wget, or a browser, there are several ways to locate and authenticate: - - Run kubectl in proxy mode. - - Recommended approach. - - Uses stored apiserver location. - - Verifies identity of apiserver using self-signed cert. No MITM possible. - - Authenticates to apiserver. - - In future, may do intelligent client-side load-balancing and failover. - - Provide the location and credentials directly to the http client. - - Alternate approach. - - Works with some types of client code that are confused by using a proxy. - - Need to import a root cert into your browser to protect against MITM. - -#### Using kubectl proxy - -The following command runs kubectl in a mode where it acts as a reverse proxy. It handles -locating the apiserver and authenticating. -Run it like this: - -```console -$ kubectl proxy --port=8080 & -``` - -See [kubectl proxy](kubectl/kubectl_proxy.md) for more details. - -Then you can explore the API with curl, wget, or a browser, like so: - -```console -$ curl http://localhost:8080/api/ -{ - "versions": [ - "v1" - ] -} -``` - -#### Without kubectl proxy - -It is also possible to avoid using kubectl proxy by passing an authentication token -directly to the apiserver, like this: - -```console -$ APISERVER=$(kubectl config view | grep server | cut -f 2- -d ":" | tr -d " ") -$ TOKEN=$(kubectl config view | grep token | cut -f 2 -d ":" | tr -d " ") -$ curl $APISERVER/api --header "Authorization: Bearer $TOKEN" --insecure -{ - "versions": [ - "v1" - ] -} -``` - -The above example uses the `--insecure` flag. This leaves it subject to MITM -attacks. When kubectl accesses the cluster it uses a stored root certificate -and client certificates to access the server. (These are installed in the -`~/.kube` directory). Since cluster certificates are typically self-signed, it -make take special configuration to get your http client to use root -certificate. - -On some clusters, the apiserver does not require authentication; it may serve -on localhost, or be protected by a firewall. There is not a standard -for this. [Configuring Access to the API](../admin/accessing-the-api.md) -describes how a cluster admin can configure this. Such approaches may conflict -with future high-availability support. - -### Programmatic access to the API - -There are [client libraries](../devel/client-libraries.md) for accessing the API -from several languages. The Kubernetes project-supported -[Go](http://releases.k8s.io/HEAD/pkg/client/) -client library can use the same [kubeconfig file](kubeconfig-file.md) -as the kubectl CLI does to locate and authenticate to the apiserver. - -See documentation for other libraries for how they authenticate. - -### Accessing the API from a Pod - -When accessing the API from a pod, locating and authenticating -to the api server are somewhat different. - -The recommended way to locate the apiserver within the pod is with -the `kubernetes` DNS name, which resolves to a Service IP which in turn -will be routed to an apiserver. - -The recommended way to authenticate to the apiserver is with a -[service account](service-accounts.md) credential. By kube-system, a pod -is associated with a service account, and a credential (token) for that -service account is placed into the filesystem tree of each container in that pod, -at `/var/run/secrets/kubernetes.io/serviceaccount/token`. - -From within a pod the recommended ways to connect to API are: - - run a kubectl proxy as one of the containers in the pod, or as a background - process within a container. This proxies the - Kubernetes API to the localhost interface of the pod, so that other processes - in any container of the pod can access it. See this [example of using kubectl proxy - in a pod](../../examples/kubectl-container/). - - use the Go client library, and create a client using the `client.NewInCluster()` factory. - This handles locating and authenticating to the apiserver. -In each case, the credentials of the pod are used to communicate securely with the apiserver. - - -## Accessing services running on the cluster - -The previous section was about connecting the Kubernetes API server. This section is about -connecting to other services running on Kubernetes cluster. In Kubernetes, the -[nodes](../admin/node.md), [pods](pods.md) and [services](services.md) all have -their own IPs. In many cases, the node IPs, pod IPs, and some service IPs on a cluster will not be -routable, so they will not be reachable from a machine outside the cluster, -such as your desktop machine. - -### Ways to connect - -You have several options for connecting to nodes, pods and services from outside the cluster: - - Access services through public IPs. - - Use a service with type `NodePort` or `LoadBalancer` to make the service reachable outside - the cluster. See the [services](services.md) and - [kubectl expose](kubectl/kubectl_expose.md) documentation. - - Depending on your cluster environment, this may just expose the service to your corporate network, - or it may expose it to the internet. Think about whether the service being exposed is secure. - Does it do its own authentication? - - Place pods behind services. To access one specific pod from a set of replicas, such as for debugging, - place a unique label on the pod it and create a new service which selects this label. - - In most cases, it should not be necessary for application developer to directly access - nodes via their nodeIPs. - - Access services, nodes, or pods using the Proxy Verb. - - Does apiserver authentication and authorization prior to accessing the remote service. - Use this if the services are not secure enough to expose to the internet, or to gain - access to ports on the node IP, or for debugging. - - Proxies may cause problems for some web applications. - - Only works for HTTP/HTTPS. - - Described [here](#discovering-builtin-services). - - Access from a node or pod in the cluster. - - Run a pod, and then connect to a shell in it using [kubectl exec](kubectl/kubectl_exec.md). - Connect to other nodes, pods, and services from that shell. - - Some clusters may allow you to ssh to a node in the cluster. From there you may be able to - access cluster services. This is a non-standard method, and will work on some clusters but - not others. Browsers and other tools may or may not be installed. Cluster DNS may not work. - -### Discovering builtin services - -Typically, there are several services which are started on a cluster by kube-system. Get a list of these -with the `kubectl cluster-info` command: - -```console -$ kubectl cluster-info - - Kubernetes master is running at https://104.197.5.247 - elasticsearch-logging is running at https://104.197.5.247/api/v1/proxy/namespaces/kube-system/services/elasticsearch-logging - kibana-logging is running at https://104.197.5.247/api/v1/proxy/namespaces/kube-system/services/kibana-logging - kube-dns is running at https://104.197.5.247/api/v1/proxy/namespaces/kube-system/services/kube-dns - grafana is running at https://104.197.5.247/api/v1/proxy/namespaces/kube-system/services/monitoring-grafana - heapster is running at https://104.197.5.247/api/v1/proxy/namespaces/kube-system/services/monitoring-heapster -``` - -This shows the proxy-verb URL for accessing each service. -For example, this cluster has cluster-level logging enabled (using Elasticsearch), which can be reached -at `https://104.197.5.247/api/v1/proxy/namespaces/kube-system/services/elasticsearch-logging/` if suitable credentials are passed, or through a kubectl proxy at, for example: -`http://localhost:8080/api/v1/proxy/namespaces/kube-system/services/elasticsearch-logging/`. -(See [above](#accessing-the-cluster-api) for how to pass credentials or use kubectl proxy.) - -#### Manually constructing apiserver proxy URLs - -As mentioned above, you use the `kubectl cluster-info` command to retrieve the service's proxy URL. To create proxy URLs that include service endpoints, suffixes, and parameters, you simply append to the service's proxy URL: -`http://`*`kubernetes_master_address`*`/`*`service_path`*`/`*`service_name`*`/`*`service_endpoint-suffix-parameter`* - - -##### Examples - - * To access the Elasticsearch service endpoint `_search?q=user:kimchy`, you would use: `http://104.197.5.247/api/v1/proxy/namespaces/kube-system/services/elasticsearch-logging/_search?q=user:kimchy` - * To access the Elasticsearch cluster health information `_cluster/health?pretty=true`, you would use: `https://104.197.5.247/api/v1/proxy/namespaces/kube-system/services/elasticsearch-logging/_cluster/health?pretty=true` - - ```json - { - "cluster_name" : "kubernetes_logging", - "status" : "yellow", - "timed_out" : false, - "number_of_nodes" : 1, - "number_of_data_nodes" : 1, - "active_primary_shards" : 5, - "active_shards" : 5, - "relocating_shards" : 0, - "initializing_shards" : 0, - "unassigned_shards" : 5 - } - ``` - -#### Using web browsers to access services running on the cluster - -You may be able to put an apiserver proxy url into the address bar of a browser. However: - - Web browsers cannot usually pass tokens, so you may need to use basic (password) auth. Apiserver can be configured to accept basic auth, - but your cluster may not be configured to accept basic auth. - - Some web apps may not work, particularly those with client side javascript that construct urls in a - way that is unaware of the proxy path prefix. - -## Requesting redirects - -The redirect capabilities have been deprecated and removed. Please use a proxy (see below) instead. - -## So Many Proxies - -There are several different proxies you may encounter when using Kubernetes: - 1. The [kubectl proxy](#directly-accessing-the-rest-api): - - runs on a user's desktop or in a pod - - proxies from a localhost address to the Kubernetes apiserver - - client to proxy uses HTTP - - proxy to apiserver uses HTTPS - - locates apiserver - - adds authentication headers - 1. The [apiserver proxy](#discovering-builtin-services): - - is a bastion built into the apiserver - - connects a user outside of the cluster to cluster IPs which otherwise might not be reachable - - runs in the apiserver processes - - client to proxy uses HTTPS (or http if apiserver so configured) - - proxy to target may use HTTP or HTTPS as chosen by proxy using available information - - can be used to reach a Node, Pod, or Service - - does load balancing when used to reach a Service - 1. The [kube proxy](services.md#ips-and-vips): - - runs on each node - - proxies UDP and TCP - - does not understand HTTP - - provides load balancing - - is just used to reach services - 1. A Proxy/Load-balancer in front of apiserver(s): - - existence and implementation varies from cluster to cluster (e.g. nginx) - - sits between all clients and one or more apiservers - - acts as load balancer if there are several apiservers. - 1. Cloud Load Balancers on external services: - - are provided by some cloud providers (e.g. AWS ELB, Google Cloud Load Balancer) - - are created automatically when the Kubernetes service has type `LoadBalancer` - - use UDP/TCP only - - implementation varies by cloud provider. - - - -Kubernetes users will typically not need to worry about anything other than the first two types. The cluster admin -will typically ensure that the latter types are setup correctly. - - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/accessing-the-cluster.md?pixel)]() - diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/user-guide/annotations.md b/Godeps/_workspace/src/k8s.io/kubernetes/docs/user-guide/annotations.md deleted file mode 100644 index 11acfadf2d64..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/user-guide/annotations.md +++ /dev/null @@ -1,64 +0,0 @@ - - - - -WARNING -WARNING -WARNING -WARNING -WARNING - -

    PLEASE NOTE: This document applies to the HEAD of the source tree

    - -If you are using a released version of Kubernetes, you should -refer to the docs that go with that version. - - -The latest 1.0.x release of this document can be found -[here](http://releases.k8s.io/release-1.0/docs/user-guide/annotations.md). - -Documentation for other releases can be found at -[releases.k8s.io](http://releases.k8s.io). - --- - - - - - -# Annotations - -We have [labels](labels.md) for identifying metadata. - -It is also useful to be able to attach arbitrary non-identifying metadata, for retrieval by API clients such as tools, libraries, etc. This information may be large, may be structured or unstructured, may include characters not permitted by labels, etc. Such information would not be used for object selection and therefore doesn't belong in labels. - -Like labels, annotations are key-value maps. - -```json -"annotations": { - "key1" : "value1", - "key2" : "value2" -} -``` - -Possible information that could be recorded in annotations: - -* fields managed by a declarative configuration layer, to distinguish them from client- and/or server-set default values and other auto-generated fields, fields set by auto-sizing/auto-scaling systems, etc., in order to facilitate merging -* build/release/image information (timestamps, release ids, git branch, PR numbers, image hashes, registry address, etc.) -* pointers to logging/monitoring/analytics/audit repos -* client library/tool information (e.g. for debugging purposes -- name, version, build info) -* other user and/or tool/system provenance info, such as URLs of related objects from other ecosystem components -* lightweight rollout tool metadata (config and/or checkpoints) -* phone/pager number(s) of person(s) responsible, or directory entry where that info could be found, such as a team website - -Yes, this information could be stored in an external database or directory, but that would make it much harder to produce shared client libraries and tools for deployment, management, introspection, etc. - - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/annotations.md?pixel)]() - diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/user-guide/application-troubleshooting.md b/Godeps/_workspace/src/k8s.io/kubernetes/docs/user-guide/application-troubleshooting.md deleted file mode 100644 index 5121693006d2..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/user-guide/application-troubleshooting.md +++ /dev/null @@ -1,211 +0,0 @@ - - - - -WARNING -WARNING -WARNING -WARNING -WARNING - -

    PLEASE NOTE: This document applies to the HEAD of the source tree

    - -If you are using a released version of Kubernetes, you should -refer to the docs that go with that version. - - -The latest 1.0.x release of this document can be found -[here](http://releases.k8s.io/release-1.0/docs/user-guide/application-troubleshooting.md). - -Documentation for other releases can be found at -[releases.k8s.io](http://releases.k8s.io). - --- - - - - - -# Application Troubleshooting - -This guide is to help users debug applications that are deployed into Kubernetes and not behaving correctly. -This is *not* a guide for people who want to debug their cluster. For that you should check out -[this guide](../admin/cluster-troubleshooting.md) - -**Table of Contents** - - -- [Application Troubleshooting](#application-troubleshooting) - - [FAQ](#faq) - - [Diagnosing the problem](#diagnosing-the-problem) - - [Debugging Pods](#debugging-pods) - - [My pod stays pending](#my-pod-stays-pending) - - [My pod stays waiting](#my-pod-stays-waiting) - - [My pod is crashing or otherwise unhealthy](#my-pod-is-crashing-or-otherwise-unhealthy) - - [Debugging Replication Controllers](#debugging-replication-controllers) - - [Debugging Services](#debugging-services) - - [My service is missing endpoints](#my-service-is-missing-endpoints) - - [Network traffic is not forwarded](#network-traffic-is-not-forwarded) - - [More information](#more-information) - - - -## FAQ - -Users are highly encouraged to check out our [FAQ](https://k8s.io/kubernetes/wiki/User-FAQ) - -## Diagnosing the problem - -The first step in troubleshooting is triage. What is the problem? Is it your Pods, your Replication Controller or -your Service? - * [Debugging Pods](#debugging-pods) - * [Debugging Replication Controllers](#debugging-replication-controllers) - * [Debugging Services](#debugging-services) - -### Debugging Pods - -The first step in debugging a Pod is taking a look at it. Check the current state of the Pod and recent events with the following command: - -```console -$ kubectl describe pods ${POD_NAME} -``` - -Look at the state of the containers in the pod. Are they all `Running`? Have there been recent restarts? - -Continue debugging depending on the state of the pods. - -#### My pod stays pending - -If a Pod is stuck in `Pending` it means that it can not be scheduled onto a node. Generally this is because -there are insufficient resources of one type or another that prevent scheduling. Look at the output of the -`kubectl describe ...` command above. There should be messages from the scheduler about why it can not schedule -your pod. Reasons include: - -* **You don't have enough resources**: You may have exhausted the supply of CPU or Memory in your cluster, in this case -you need to delete Pods, adjust resource requests, or add new nodes to your cluster. See [Compute Resources document](compute-resources.md#my-pods-are-pending-with-event-message-failedscheduling) for more information. - -* **You are using `hostPort`**: When you bind a Pod to a `hostPort` there are a limited number of places that pod can be -scheduled. In most cases, `hostPort` is unnecessary, try using a Service object to expose your Pod. If you do require -`hostPort` then you can only schedule as many Pods as there are nodes in your Kubernetes cluster. - - -#### My pod stays waiting - -If a Pod is stuck in the `Waiting` state, then it has been scheduled to a worker node, but it can't run on that machine. -Again, the information from `kubectl describe ...` should be informative. The most common cause of `Waiting` pods is a failure to pull the image. There are three things to check: -* Make sure that you have the name of the image correct -* Have you pushed the image to the repository? -* Run a manual `docker pull ` on your machine to see if the image can be pulled. - -#### My pod is crashing or otherwise unhealthy - -First, take a look at the logs of -the current container: - -```console -$ kubectl logs ${POD_NAME} ${CONTAINER_NAME} -``` - -If your container has previously crashed, you can access the previous container's crash log with: - -```console -$ kubectl logs --previous ${POD_NAME} ${CONTAINER_NAME} -``` - -Alternately, you can run commands inside that container with `exec`: - -```console -$ kubectl exec ${POD_NAME} -c ${CONTAINER_NAME} -- ${CMD} ${ARG1} ${ARG2} ... ${ARGN} -``` - -Note that `-c ${CONTAINER_NAME}` is optional and can be omitted for Pods that only contain a single container. - -As an example, to look at the logs from a running Cassandra pod, you might run - -```console -$ kubectl exec cassandra -- cat /var/log/cassandra/system.log -``` - - -If none of these approaches work, you can find the host machine that the pod is running on and SSH into that host, -but this should generally not be necessary given tools in the Kubernetes API. Therefore, if you find yourself needing to ssh into a machine, please file a -feature request on GitHub describing your use case and why these tools are insufficient. - -### Debugging Replication Controllers - -Replication controllers are fairly straightforward. They can either create Pods or they can't. If they can't -create pods, then please refer to the [instructions above](#debugging-pods) to debug your pods. - -You can also use `kubectl describe rc ${CONTROLLER_NAME}` to introspect events related to the replication -controller. - -### Debugging Services - -Services provide load balancing across a set of pods. There are several common problems that can make Services -not work properly. The following instructions should help debug Service problems. - -First, verify that there are endpoints for the service. For every Service object, the apiserver makes an `endpoints` resource available. - -You can view this resource with: - -```console -$ kubectl get endpoints ${SERVICE_NAME} -``` - -Make sure that the endpoints match up with the number of containers that you expect to be a member of your service. -For example, if your Service is for an nginx container with 3 replicas, you would expect to see three different -IP addresses in the Service's endpoints. - -#### My service is missing endpoints - -If you are missing endpoints, try listing pods using the labels that Service uses. Imagine that you have -a Service where the labels are: - -```yaml -... -spec: - - selector: - name: nginx - type: frontend -``` - -You can use: - -```console -$ kubectl get pods --selector=name=nginx,type=frontend -``` - -to list pods that match this selector. Verify that the list matches the Pods that you expect to provide your Service. - -If the list of pods matches expectations, but your endpoints are still empty, it's possible that you don't -have the right ports exposed. If your service has a `containerPort` specified, but the Pods that are -selected don't have that port listed, then they won't be added to the endpoints list. - -Verify that the pod's `containerPort` matches up with the Service's `containerPort` - -#### Network traffic is not forwarded - -If you can connect to the service, but the connection is immediately dropped, and there are endpoints -in the endpoints list, it's likely that the proxy can't contact your pods. - -There are three things to -check: - * Are your pods working correctly? Look for restart count, and [debug pods](#debugging-pods) - * Can you connect to your pods directly? Get the IP address for the Pod, and try to connect directly to that IP - * Is your application serving on the port that you configured? Kubernetes doesn't do port remapping, so if your application serves on 8080, the `containerPort` field needs to be 8080. - -#### More information - -If none of the above solves your problem, follow the instructions in [Debugging Service document](debugging-services.md) to make sure that your `Service` is running, has `Endpoints`, and your `Pods` are actually serving; you have DNS working, iptables rules installed, and kube-proxy does not seem to be misbehaving. - -You may also visit [troubleshooting document](../troubleshooting.md) for more information. - - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/application-troubleshooting.md?pixel)]() - diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/user-guide/cadvisor.png b/Godeps/_workspace/src/k8s.io/kubernetes/docs/user-guide/cadvisor.png deleted file mode 100644 index 4a5d863db1b7..000000000000 Binary files a/Godeps/_workspace/src/k8s.io/kubernetes/docs/user-guide/cadvisor.png and /dev/null differ diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/user-guide/compute-resources.md b/Godeps/_workspace/src/k8s.io/kubernetes/docs/user-guide/compute-resources.md deleted file mode 100644 index f84e02aac660..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/user-guide/compute-resources.md +++ /dev/null @@ -1,257 +0,0 @@ - - - - -WARNING -WARNING -WARNING -WARNING -WARNING - -

    PLEASE NOTE: This document applies to the HEAD of the source tree

    - -If you are using a released version of Kubernetes, you should -refer to the docs that go with that version. - - -The latest 1.0.x release of this document can be found -[here](http://releases.k8s.io/release-1.0/docs/user-guide/compute-resources.md). - -Documentation for other releases can be found at -[releases.k8s.io](http://releases.k8s.io). - --- - - - - - -# Compute Resources - -**Table of Contents** - - -- [Compute Resources](#compute-resources) - - [Container and Pod Resource Limits](#container-and-pod-resource-limits) - - [How Pods with Resource Limits are Scheduled](#how-pods-with-resource-limits-are-scheduled) - - [How Pods with Resource Limits are Run](#how-pods-with-resource-limits-are-run) - - [Monitoring Compute Resource Usage](#monitoring-compute-resource-usage) - - [Troubleshooting](#troubleshooting) - - [My pods are pending with event message failedScheduling](#my-pods-are-pending-with-event-message-failedscheduling) - - [My container is terminated](#my-container-is-terminated) - - [Planned Improvements](#planned-improvements) - - - -When specifying a [pod](pods.md), you can optionally specify how much CPU and memory (RAM) each -container needs. When containers have resource limits, the scheduler is able to make better -decisions about which nodes to place pods on, and contention for resources can be handled in a -consistent manner. - -*CPU* and *memory* are each a *resource type*. A resource type has a base unit. CPU is specified -in units of cores. Memory is specified in units of bytes. - -CPU and RAM are collectively referred to as *compute resources*, or just *resources*. Compute -resources are measureable quantities which can be requested, allocated, and consumed. They are -distinct from [API resources](working-with-resources.md). API resources, such as pods and -[services](services.md) are objects that can be written to and retrieved from the Kubernetes API -server. - -## Container and Pod Resource Limits - -Each container of a Pod can optionally specify `spec.container[].resources.limits.cpu` and/or -`spec.container[].resources.limits.memory`. The `spec.container[].resources.requests` field is not -currently used and need not be set. - -Specifying resource limits is optional. In some clusters, an unset value may be replaced with a -default value when a pod is created or updated. The default value depends on how the cluster is -configured. - -Although limits can only be specified on individual containers, it is convenient to talk about pod -resource limits. A *pod resource limit* for a particular resource type is the sum of the resource -limits of that type for each container in the pod, with unset values treated as zero. - -The following pod has two containers. Each has a limit of 0.5 core of cpu and 128MiB -(220 bytes) of memory. The pod can be said to have a limit of 1 core and 256MiB of -memory. - -```yaml -apiVersion: v1 -kind: Pod -metadata: - name: frontend -spec: - containers: - - name: db - image: mysql - resources: - limits: - memory: "128Mi" - cpu: "500m" - - name: wp - image: wordpress - resources: - limits: - memory: "128Mi" - cpu: "500m" -``` - -## How Pods with Resource Limits are Scheduled - -When a pod is created, the Kubernetes scheduler selects a node for the pod to -run on. Each node has a maximum capacity for each of the resource types: the -amount of CPU and memory it can provide for pods. The scheduler ensures that, -for each resource type (CPU and memory), the sum of the resource limits of the -containers scheduled to the node is less than the capacity of the node. Note -that although actual memory or CPU resource usage on nodes is very low, the -scheduler will still refuse to place pods onto nodes if the capacity check -fails. This protects against a resource shortage on a node when resource usage -later increases, such as due to a daily peak in request rate. - -Note: Although the scheduler normally spreads pods out across nodes, there are currently some cases -where pods with no limits (unset values) might all land on the same node. - -## How Pods with Resource Limits are Run - -When kubelet starts a container of a pod, it passes the CPU and memory limits to the container -runner (Docker or rkt). - -When using Docker: -- The `spec.container[].resources.limits.cpu` is multiplied by 1024, converted to an integer, and - used as the value of the [`--cpu-shares`]( - https://docs.docker.com/reference/run/#runtime-constraints-on-resources) flag to the `docker run` - command. -- The `spec.container[].resources.limits.memory` is converted to an integer, and used as the value - of the [`--memory`](https://docs.docker.com/reference/run/#runtime-constraints-on-resources) flag - to the `docker run` command. - -**TODO: document behavior for rkt** - -If a container exceeds its memory limit, it may be terminated. If it is restartable, it will be -restarted by kubelet, as will any other type of runtime failure. - -A container may or may not be allowed to exceed its CPU limit for extended periods of time. -However, it will not be killed for excessive CPU usage. - -To determine if a container cannot be scheduled or is being killed due to resource limits, see the -"Troubleshooting" section below. - -## Monitoring Compute Resource Usage - -The resource usage of a pod is reported as part of the Pod status. - -If [optional monitoring](http://releases.k8s.io/HEAD/cluster/addons/cluster-monitoring/README.md) is configured for your cluster, -then pod resource usage can be retrieved from the monitoring system. - -## Troubleshooting - -### My pods are pending with event message failedScheduling - -If the scheduler cannot find any node where a pod can fit, then the pod will remain unscheduled -until a place can be found. An event will be produced each time the scheduler fails to find a -place for the pod, like this: - -```console -$ kubectl describe pods/frontend | grep -A 3 Events -Events: - FirstSeen LastSeen Count From SubobjectPath Reason Message - Tue, 30 Jun 2015 09:01:41 -0700 Tue, 30 Jun 2015 09:39:27 -0700 128 {scheduler } failedScheduling Error scheduling: For each of these fitness predicates, pod frontend failed on at least one node: PodFitsResources. -``` - -If a pod or pods are pending with this message, then there are several things to try: -- Add more nodes to the cluster. -- Terminate unneeded pods to make room for pending pods. -- Check that the pod is not larger than all the nodes. For example, if all the nodes -have a capacity of `cpu: 1`, then a pod with a limit of `cpu: 1.1` will never be scheduled. - -You can check node capacities with the `kubectl get nodes -o ` command. -Here are some example command lines that extract just the necessary information: -- `kubectl get nodes -o yaml | grep '\sname\|cpu\|memory'` -- `kubectl get nodes -o json | jq '.items[] | {name: .metadata.name, cap: .status.capacity}'` - -The [resource quota](../admin/resource-quota.md) feature can be configured -to limit the total amount of resources that can be consumed. If used in conjunction -with namespaces, it can prevent one team from hogging all the resources. - -### My container is terminated - -Your container may be terminated because it's resource-starved. To check if a container is being killed because it is hitting a resource limit, call `kubectl describe pod` -on the pod you are interested in: - -```console -[12:54:41] $ ./cluster/kubectl.sh describe pod simmemleak-hra99 -Name: simmemleak-hra99 -Namespace: default -Image(s): saadali/simmemleak -Node: kubernetes-minion-tf0f/10.240.216.66 -Labels: name=simmemleak -Status: Running -Reason: -Message: -IP: 10.244.2.75 -Replication Controllers: simmemleak (1/1 replicas created) -Containers: - simmemleak: - Image: saadali/simmemleak - Limits: - cpu: 100m - memory: 50Mi - State: Running - Started: Tue, 07 Jul 2015 12:54:41 -0700 - Ready: False - Restart Count: 5 -Conditions: - Type Status - Ready False -Events: - FirstSeen LastSeen Count From SubobjectPath Reason Message - Tue, 07 Jul 2015 12:53:51 -0700 Tue, 07 Jul 2015 12:53:51 -0700 1 {scheduler } scheduled Successfully assigned simmemleak-hra99 to kubernetes-minion-tf0f - Tue, 07 Jul 2015 12:53:51 -0700 Tue, 07 Jul 2015 12:53:51 -0700 1 {kubelet kubernetes-minion-tf0f} implicitly required container POD pulled Pod container image "gcr.io/google_containers/pause:0.8.0" already present on machine - Tue, 07 Jul 2015 12:53:51 -0700 Tue, 07 Jul 2015 12:53:51 -0700 1 {kubelet kubernetes-minion-tf0f} implicitly required container POD created Created with docker id 6a41280f516d - Tue, 07 Jul 2015 12:53:51 -0700 Tue, 07 Jul 2015 12:53:51 -0700 1 {kubelet kubernetes-minion-tf0f} implicitly required container POD started Started with docker id 6a41280f516d - Tue, 07 Jul 2015 12:53:51 -0700 Tue, 07 Jul 2015 12:53:51 -0700 1 {kubelet kubernetes-minion-tf0f} spec.containers{simmemleak} created Created with docker id 87348f12526a -``` - -The `Restart Count: 5` indicates that the `simmemleak` container in this pod was terminated and restarted 5 times. - -Once [#10861](https://k8s.io/kubernetes/issues/10861) is resolved the reason for the termination of the last container will also be printed in this output. - -Until then you can call `get pod` with the `-o template -t ...` option to fetch the status of previously terminated containers: - -```console -[13:59:01] $ ./cluster/kubectl.sh get pod -o template -t '{{range.status.containerStatuses}}{{"Container Name: "}}{{.name}}{{"\r\nLastState: "}}{{.lastState}}{{end}}' simmemleak-60xbc -Container Name: simmemleak -LastState: map[terminated:map[exitCode:137 reason:OOM Killed startedAt:2015-07-07T20:58:43Z finishedAt:2015-07-07T20:58:43Z containerID:docker://0e4095bba1feccdfe7ef9fb6ebffe972b4b14285d5acdec6f0d3ae8a22fad8b2]][13:59:03] clusterScaleDoc ~/go/src/k8s.io/kubernetes $ -``` - -We can see that this container was terminated because `reason:OOM Killed`, where *OOM* stands for Out Of Memory. - -## Planned Improvements - -The current system only allows resource quantities to be specified on a container. -It is planned to improve accounting for resources which are shared by all containers in a pod, -such as [EmptyDir volumes](volumes.md#emptydir). - -The current system only supports container limits for CPU and Memory. -It is planned to add new resource types, including a node disk space -resource, and a framework for adding custom [resource types](../design/resources.md#resource-types). - -The current system does not facilitate overcommitment of resources because resources reserved -with container limits are assured. It is planned to support multiple levels of [Quality of -Service](https://k8s.io/kubernetes/issues/168). - -Currently, one unit of CPU means different things on different cloud providers, and on different -machine types within the same cloud providers. For example, on AWS, the capacity of a node -is reported in [ECUs](http://aws.amazon.com/ec2/faqs/), while in GCE it is reported in logical -cores. We plan to revise the definition of the cpu resource to allow for more consistency -across providers and platforms. - - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/compute-resources.md?pixel)]() - diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/user-guide/config-best-practices.md b/Godeps/_workspace/src/k8s.io/kubernetes/docs/user-guide/config-best-practices.md deleted file mode 100644 index fa9016047701..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/user-guide/config-best-practices.md +++ /dev/null @@ -1,59 +0,0 @@ - - - - -WARNING -WARNING -WARNING -WARNING -WARNING - -

    PLEASE NOTE: This document applies to the HEAD of the source tree

    - -If you are using a released version of Kubernetes, you should -refer to the docs that go with that version. - - -The latest 1.0.x release of this document can be found -[here](http://releases.k8s.io/release-1.0/docs/user-guide/config-best-practices.md). - -Documentation for other releases can be found at -[releases.k8s.io](http://releases.k8s.io). - --- - - - - - -# Tips and tricks when working with config - -This document is meant to highlight and consolidate in one place configuration best practices that are introduced throughout the user-guide and getting-started documentation and examples. This is a living document so if you think of something that is not on this list but might be useful to others, please don't hesitate to file an issue or submit a PR. - -1. When writing configuration, use the latest stable API version (currently v1). -1. Configuration should be stored in version control before being pushed to the cluster. This allows configuration to be quickly rolled back if needed and will aid with cluster re-creation and restoration if the worst were to happen. -1. Use YAML rather than JSON. They can be used interchangeably in almost all scenarios but YAML tends to be more user-friendly for config. -1. Group related objects together in a single file. This is often better than separate files. -1. Use `kubectl create -f ` where possible. This looks for config objects in all `.yaml`, `.yml`, and `.json` files in `` and passes them to create. -1. Create a service before corresponding replication controllers so that the scheduler can spread the pods comprising the service. You can also create the replication controller without specifying replicas, create the service, then scale up the replication controller, which may work better in an example using progressive disclosure and may have benefits in real scenarios also, such as ensuring one replica works before creating lots of them) -1. Don't use `hostPort` unless absolutely necessary (e.g., for a node daemon) as it will prevent certain scheduling configurations due to port conflicts. Use the apiserver proxying or port forwarding for debug/admin access, or a service for external service access. If you need to expose a pod's port on the host machine, consider using a [NodePort](services.md#type--loadbalancer) service before resorting to `hostPort`. If you only need access to the port for debugging purposes, you can also use the [kubectl proxy and apiserver proxy](connecting-to-applications-proxy.md) or [kubectl port-forward](connecting-to-applications-port-forward.md). -1. Don't use `hostNetwork` for the same reasons as `hostPort`. -1. Don't specify default values unnecessarily, to simplify and minimize configs. For example, omit the selector and labels in ReplicationController if you want them to be the same as the labels in its podTemplate, since those fields are populated from the podTemplate labels by default. -1. Instead of attaching one label to a set of pods to represent a service (e.g., `service: myservice`) and another to represent the replication controller managing the pods (e.g., `controller: mycontroller`), attach labels that identify semantic attributes of your application or deployment and select the appropriate subsets in your service and replication controller, such as `{ app: myapp, tier: frontend, deployment: v3 }`. A service can be made to span multiple deployments, such as across rolling updates, by simply omitting release-specific labels from its selector, rather than updating a service's selector to match the replication controller's selector fully. -1. Use kubectl bulk operations (via files and/or labels) for get and delete. See [label selectors](labels.md#label-selectors) and [using labels effectively](managing-deployments.md#using-labels-effectively). -1. Use kubectl run and expose to quickly create and expose single container replication controllers. See the [quick start guide](quick-start.md) for an example. -1. Use headless services for easy service discovery when you don't need kube-proxy load balancing. See [headless services](services.md#headless-services). -1. Use kubectl delete rather than stop. Delete has a superset of the functionality of stop and stop is deprecated. -1. If there is a viable alternative to naked pods (i.e. pods not bound to a controller), go with the alternative. Controllers are almost always preferable to creating pods (except for some `restartPolicy: Never` scenarios). A minimal Job is coming. See [#1624](https://k8s.io/kubernetes/issues/1624). Naked pods will not be rescheduled in the event of node failure. -1. Put a version number or hash as a suffix to the name and in a label on a replication controller to facilitate rolling update, as we do for [--image](kubectl/kubectl_rolling-update.md). This is necessary because rolling-update actually creates a new controller as opposed to modifying the existing controller. This does not play well with version agnostic controller names. -1. Put an object description in an annotation to allow better introspection. - - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/config-best-practices.md?pixel)]() - diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/user-guide/configuring-containers.md b/Godeps/_workspace/src/k8s.io/kubernetes/docs/user-guide/configuring-containers.md deleted file mode 100644 index 5028ca940b73..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/user-guide/configuring-containers.md +++ /dev/null @@ -1,213 +0,0 @@ - - - - -WARNING -WARNING -WARNING -WARNING -WARNING - -

    PLEASE NOTE: This document applies to the HEAD of the source tree

    - -If you are using a released version of Kubernetes, you should -refer to the docs that go with that version. - - -The latest 1.0.x release of this document can be found -[here](http://releases.k8s.io/release-1.0/docs/user-guide/configuring-containers.md). - -Documentation for other releases can be found at -[releases.k8s.io](http://releases.k8s.io). - --- - - - - - -# Kubernetes User Guide: Managing Applications: Configuring and launching containers - -**Table of Contents** - - -- [Kubernetes User Guide: Managing Applications: Configuring and launching containers](#kubernetes-user-guide-managing-applications-configuring-and-launching-containers) - - [Configuration in Kubernetes](#configuration-in-kubernetes) - - [Launching a container using a configuration file](#launching-a-container-using-a-configuration-file) - - [Validating configuration](#validating-configuration) - - [Environment variables and variable expansion](#environment-variables-and-variable-expansion) - - [Viewing pod status](#viewing-pod-status) - - [Viewing pod output](#viewing-pod-output) - - [Deleting pods](#deleting-pods) - - [What's next?](#whats-next) - - - -## Configuration in Kubernetes - -In addition to the imperative-style commands, such as `kubectl run` and `kubectl expose`, described [elsewhere](quick-start.md), Kubernetes supports declarative configuration. Often times, configuration files are preferable to imperative commands, since they can be checked into version control and changes to the files can be code reviewed, which is especially important for more complex configurations, producing a more robust, reliable and archival system. - -In the declarative style, all configuration is stored in YAML or JSON configuration files using Kubernetes's API resource schemas as the configuration schemas. `kubectl` can create, update, delete, and get API resources. The `apiVersion` (currently “v1”), resource `kind`, and resource `name` are used by `kubectl` to construct the appropriate API path to invoke for the specified operation. - -## Launching a container using a configuration file - -Kubernetes executes containers in [*Pods*](pods.md). A pod containing a simple Hello World container can be specified in YAML as follows: - -```yaml -apiVersion: v1 -kind: Pod -metadata: - name: hello-world -spec: # specification of the pod’s contents - restartPolicy: Never - containers: - - name: hello - image: "ubuntu:14.04" - command: ["/bin/echo","hello”,”world"] -``` - -The value of `metadata.name`, `hello-world`, will be the name of the pod resource created, and must be unique within the cluster, whereas `containers[0].name` is just a nickname for the container within that pod. `image` is the name of the Docker image, which Kubernetes expects to be able to pull from a registry, the [Docker Hub](https://registry.hub.docker.com/) by default. - -`restartPolicy: Never` indicates that we just want to run the container once and then terminate the pod. - -The [`command`](containers.md#containers-and-commands) overrides the Docker container’s `Entrypoint`. Command arguments (corresponding to Docker’s `Cmd`) may be specified using `args`, as follows: - -```yaml - command: ["/bin/echo"] - args: ["hello","world"] -``` - -This pod can be created using the `create` command: - -```console -$ kubectl create -f ./hello-world.yaml -pods/hello-world -``` - -`kubectl` prints the resource type and name of the resource created when successful. - -## Validating configuration - -If you’re not sure you specified the resource correctly, you can ask `kubectl` to validate it for you: - -```console -$ kubectl create -f ./hello-world.yaml --validate -``` - -Let’s say you specified `entrypoint` instead of `command`. You’d see output as follows: - -```console -I0709 06:33:05.600829 14160 schema.go:126] unknown field: entrypoint -I0709 06:33:05.600988 14160 schema.go:129] this may be a false alarm, see https://k8s.io/kubernetes/issues/6842 -pods/hello-world -``` - -`kubectl create --validate` currently warns about problems it detects, but creates the resource anyway, unless a required field is absent or a field value is invalid. Unknown API fields are ignored, so be careful. This pod was created, but with no `command`, which is an optional field, since the image may specify an `Entrypoint`. -View the [Pod API -object](https://htmlpreview.github.io/?https://k8s.io/kubernetes/HEAD/docs/api-reference/definitions.html#_v1_pod) -to see the list of valid fields. - -## Environment variables and variable expansion - -Kubernetes [does not automatically run commands in a shell](https://k8s.io/kubernetes/wiki/User-FAQ#use-of-environment-variables-on-the-command-line) (not all images contain shells). If you would like to run your command in a shell, such as to expand environment variables (specified using `env`), you could do the following: - -```yaml -apiVersion: v1 -kind: Pod -metadata: - name: hello-world -spec: # specification of the pod’s contents - restartPolicy: Never - containers: - - name: hello - image: "ubuntu:14.04" - env: - - name: MESSAGE - value: "hello world" - command: ["/bin/sh","-c"] - args: ["/bin/echo \"${MESSAGE}\""] -``` - -However, a shell isn’t necessary just to expand environment variables. Kubernetes will do it for you if you use [`$(ENVVAR)` syntax](../../docs/design/expansion.md): - -```yaml - command: ["/bin/echo"] - args: ["$(MESSAGE)"] -``` - -## Viewing pod status - -You can see the pod you created (actually all of your cluster's pods) using the `get` command. - -If you’re quick, it will look as follows: - -```console -$ kubectl get pods -NAME READY STATUS RESTARTS AGE -hello-world 0/1 Pending 0 0s -``` - -Initially, a newly created pod is unscheduled -- no node has been selected to run it. Scheduling happens after creation, but is fast, so you normally shouldn’t see pods in an unscheduled state unless there’s a problem. - -After the pod has been scheduled, the image may need to be pulled to the node on which it was scheduled, if it hadn’t been pulled already. After a few seconds, you should see the container running: - -```console -$ kubectl get pods -NAME READY STATUS RESTARTS AGE -hello-world 1/1 Running 0 5s -``` - -The `READY` column shows how many containers in the pod are running. - -Almost immediately after it starts running, this command will terminate. `kubectl` shows that the container is no longer running and displays the exit status: - -```console -$ kubectl get pods -NAME READY STATUS RESTARTS AGE -hello-world 0/1 ExitCode:0 0 15s -``` - -## Viewing pod output - -You probably want to see the output of the command you ran. As with [`docker logs`](https://docs.docker.com/userguide/usingdocker/), `kubectl logs` will show you the output: - -```console -$ kubectl logs hello-world -hello world -``` - -## Deleting pods - -When you’re done looking at the output, you should delete the pod: - -```console -$ kubectl delete pod hello-world -pods/hello-world -``` - -As with `create`, `kubectl` prints the resource type and name of the resource deleted when successful. - -You can also use the resource/name format to specify the pod: - -```console -$ kubectl delete pods/hello-world -pods/hello-world -``` - -Terminated pods aren’t currently automatically deleted, so that you can observe their final status, so be sure to clean up your dead pods. - -On the other hand, containers and their logs are eventually deleted automatically in order to free up disk space on the nodes. - -## What's next? - -[Learn about deploying continuously running applications.](deploying-applications.md) - - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/configuring-containers.md?pixel)]() - diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/user-guide/connecting-applications.md b/Godeps/_workspace/src/k8s.io/kubernetes/docs/user-guide/connecting-applications.md deleted file mode 100644 index abf2ae4fa69a..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/user-guide/connecting-applications.md +++ /dev/null @@ -1,434 +0,0 @@ - - - - -WARNING -WARNING -WARNING -WARNING -WARNING - -

    PLEASE NOTE: This document applies to the HEAD of the source tree

    - -If you are using a released version of Kubernetes, you should -refer to the docs that go with that version. - - -The latest 1.0.x release of this document can be found -[here](http://releases.k8s.io/release-1.0/docs/user-guide/connecting-applications.md). - -Documentation for other releases can be found at -[releases.k8s.io](http://releases.k8s.io). - --- - - - - - -# Kubernetes User Guide: Managing Applications: Connecting applications - -**Table of Contents** - - -- [Kubernetes User Guide: Managing Applications: Connecting applications](#kubernetes-user-guide-managing-applications-connecting-applications) -- [The Kubernetes model for connecting containers](#the-kubernetes-model-for-connecting-containers) - - [Exposing pods to the cluster](#exposing-pods-to-the-cluster) - - [Creating a Service](#creating-a-service) - - [Accessing the Service](#accessing-the-service) - - [Environment Variables](#environment-variables) - - [DNS](#dns) - - [Securing the Service](#securing-the-service) - - [Exposing the Service](#exposing-the-service) - - [What's next?](#whats-next) - - - -# The Kubernetes model for connecting containers - -Now that you have a continuously running, replicated application you can expose it on a network. Before discussing the Kubernetes approach to networking, it is worthwhile to contrast it with the "normal" way networking works with Docker. - -By default, Docker uses host-private networking, so containers can talk to other containers only if they are on the same machine. In order for Docker containers to communicate across nodes, they must be allocated ports on the machine's own IP address, which are then forwarded or proxied to the containers. This obviously means that containers must either coordinate which ports they use very carefully or else be allocated ports dynamically. - -Coordinating ports across multiple developers is very difficult to do at scale and exposes users to cluster-level issues outside of their control. Kubernetes assumes that pods can communicate with other pods, regardless of which host they land on. We give every pod its own cluster-private-IP address so you do not need to explicitly create links between pods or mapping container ports to host ports. This means that containers within a Pod can all reach each other’s ports on localhost, and all pods in a cluster can see each other without NAT. The rest of this document will elaborate on how you can run reliable services on such a networking model. - -This guide uses a simple nginx server to demonstrate proof of concept. The same principles are embodied in a more complete [Jenkins CI application](http://blog.kubernetes.io/2015/07/strong-simple-ssl-for-kubernetes.html). - -## Exposing pods to the cluster - -We did this in a previous example, but lets do it once again and focus on the networking perspective. Create an nginx pod, and note that it has a container port specification: - -```yaml -$ cat nginxrc.yaml -apiVersion: v1 -kind: ReplicationController -metadata: - name: my-nginx -spec: - replicas: 2 - template: - metadata: - labels: - app: nginx - spec: - containers: - - name: nginx - image: nginx - ports: - - containerPort: 80 -``` - -This makes it accessible from any node in your cluster. Check the nodes the pod is running on: - -```console -$ kubectl create -f ./nginxrc.yaml -$ kubectl get pods -l app=nginx -o wide -my-nginx-6isf4 1/1 Running 0 2h e2e-test-beeps-minion-93ly -my-nginx-t26zt 1/1 Running 0 2h e2e-test-beeps-minion-93ly -``` - -Check your pods' IPs: - -```console -$ kubectl get pods -l app=nginx -o json | grep podIP - "podIP": "10.245.0.15", - "podIP": "10.245.0.14", -``` - -You should be able to ssh into any node in your cluster and curl both IPs. Note that the containers are *not* using port 80 on the node, nor are there any special NAT rules to route traffic to the pod. This means you can run multiple nginx pods on the same node all using the same containerPort and access them from any other pod or node in your cluster using IP. Like Docker, ports can still be published to the host node's interface(s), but the need for this is radically diminished because of the networking model. - -You can read more about [how we achieve this](../admin/networking.md#how-to-achieve-this) if you’re curious. - -## Creating a Service - -So we have pods running nginx in a flat, cluster wide, address space. In theory, you could talk to these pods directly, but what happens when a node dies? The pods die with it, and the replication controller will create new ones, with different IPs. This is the problem a Service solves. - -A Kubernetes Service is an abstraction which defines a logical set of Pods running somewhere in your cluster, that all provide the same functionality. When created, each Service is assigned a unique IP address (also called clusterIP). This address is tied to the lifespan of the Service, and will not change while the Service is alive. Pods can be configured to talk to the Service, and know that communication to the Service will be automatically load-balanced out to some pod that is a member of the Service. - -You can create a Service for your 2 nginx replicas with the following yaml: - -```yaml -$ cat nginxsvc.yaml -apiVersion: v1 -kind: Service -metadata: - name: nginxsvc - labels: - app: nginx -spec: - ports: - - port: 80 - protocol: TCP - selector: - app: nginx -``` - -This specification will create a Service which targets TCP port 80 on any Pod with the `app=nginx` label, and expose it on an abstracted Service port (`targetPort`: is the port the container accepts traffic on, `port`: is the abstracted Service port, which can be any port other pods use to access the Service). View [service API object](https://htmlpreview.github.io/?https://k8s.io/kubernetes/HEAD/docs/api-reference/definitions.html#_v1_service) to see the list of supported fields in service definition. -Check your Service: - -```console -$ kubectl get svc -NAME LABELS SELECTOR IP(S) PORT(S) -nginxsvc app=nginx app=nginx 10.0.116.146 80/TCP -``` - -As mentioned previously, a Service is backed by a group of pods. These pods are exposed through `endpoints`. The Service's selector will be evaluated continuously and the results will be POSTed to an Endpoints object also named `nginxsvc`. When a pod dies, it is automatically removed from the endpoints, and new pods matching the Service’s selector will automatically get added to the endpoints. Check the endpoints, and note that the IPs are the same as the pods created in the first step: - -```console -$ kubectl describe svc nginxsvc -Name: nginxsvc -Namespace: default -Labels: app=nginx -Selector: app=nginx -Type: ClusterIP -IP: 10.0.116.146 -Port: 80/TCP -Endpoints: 10.245.0.14:80,10.245.0.15:80 -Session Affinity: None -No events. - -$ kubectl get ep -NAME ENDPOINTS -nginxsvc 10.245.0.14:80,10.245.0.15:80 -``` - -You should now be able to curl the nginx Service on `10.0.116.146:80` from any node in your cluster. Note that the Service IP is completely virtual, it never hits the wire, if you’re curious about how this works you can read more about the [service proxy](services.md#virtual-ips-and-service-proxies). - -## Accessing the Service - -Kubernetes supports 2 primary modes of finding a Service - environment variables and DNS. The former works out of the box while the latter requires the [kube-dns cluster addon](http://releases.k8s.io/HEAD/cluster/addons/dns/README.md). - -### Environment Variables - -When a Pod is run on a Node, the kubelet adds a set of environment variables for each active Service. This introduces an ordering problem. To see why, inspect the environment of your running nginx pods: - -```console -$ kubectl exec my-nginx-6isf4 -- printenv | grep SERVICE -KUBERNETES_SERVICE_HOST=10.0.0.1 -KUBERNETES_SERVICE_PORT=443 -``` - -Note there’s no mention of your Service. This is because you created the replicas before the Service. Another disadvantage of doing this is that the scheduler might put both pods on the same machine, which will take your entire Service down if it dies. We can do this the right way by killing the 2 pods and waiting for the replication controller to recreate them. This time around the Service exists *before* the replicas. This will given you scheduler level Service spreading of your pods (provided all your nodes have equal capacity), as well as the right environment variables: - -```console -$ kubectl scale rc my-nginx --replicas=0; kubectl scale rc my-nginx --replicas=2; -$ kubectl get pods -l app=nginx -o wide -NAME READY STATUS RESTARTS AGE NODE -my-nginx-5j8ok 1/1 Running 0 2m node1 -my-nginx-90vaf 1/1 Running 0 2m node2 - -$ kubectl exec my-nginx-5j8ok -- printenv | grep SERVICE -KUBERNETES_SERVICE_PORT=443 -NGINXSVC_SERVICE_HOST=10.0.116.146 -KUBERNETES_SERVICE_HOST=10.0.0.1 -NGINXSVC_SERVICE_PORT=80 -``` - -### DNS - -Kubernetes offers a DNS cluster addon Service that uses skydns to automatically assign dns names to other Services. You can check if it’s running on your cluster: - -```console -$ kubectl get services kube-dns --namespace=kube-system -NAME LABELS SELECTOR IP(S) PORT(S) -kube-dns k8s-app=kube-dns 10.0.0.10 53/UDP - 53/TCP -``` - -If it isn’t running, you can [enable it](http://releases.k8s.io/HEAD/cluster/addons/dns/README.md#how-do-i-configure-it). The rest of this section will assume you have a Service with a long lived IP (nginxsvc), and a dns server that has assigned a name to that IP (the kube-dns cluster addon), so you can talk to the Service from any pod in your cluster using standard methods (e.g. gethostbyname). Let’s create another pod to test this: - -```yaml -$ cat curlpod.yaml -apiVersion: v1 -kind: Pod -metadata: - name: curlpod -spec: - containers: - - image: radial/busyboxplus:curl - command: - - sleep - - "3600" - imagePullPolicy: IfNotPresent - name: curlcontainer - restartPolicy: Always -``` - -And perform a lookup of the nginx Service - -```console -$ kubectl create -f ./curlpod.yaml -default/curlpod -$ kubectl get pods curlpod -NAME READY STATUS RESTARTS AGE -curlpod 1/1 Running 0 18s - -$ kubectl exec curlpod -- nslookup nginxsvc -Server: 10.0.0.10 -Address 1: 10.0.0.10 -Name: nginxsvc -Address 1: 10.0.116.146 -``` - -## Securing the Service - -Till now we have only accessed the nginx server from within the cluster. Before exposing the Service to the internet, you want to make sure the communication channel is secure. For this, you will need: -* Self signed certificates for https (unless you already have an identitiy certificate) -* An nginx server configured to use the cretificates -* A [secret](secrets.md) that makes the certificates accessible to pods - -You can acquire all these from the [nginx https example](../../examples/https-nginx/README.md), in short: - -```console -$ make keys secret KEY=/tmp/nginx.key CERT=/tmp/nginx.crt SECRET=/tmp/secret.json -$ kubectl create -f /tmp/secret.json -secrets/nginxsecret -$ kubectl get secrets -NAME TYPE DATA -default-token-il9rc kubernetes.io/service-account-token 1 -nginxsecret Opaque 2 -``` - -Now modify your nginx replicas to start a https server using the certificate in the secret, and the Service, to expose both ports (80 and 443): - -```yaml -$ cat nginx-app.yaml -apiVersion: v1 -kind: Service -metadata: - name: nginxsvc - labels: - app: nginx -spec: - type: NodePort - ports: - - port: 8080 - targetPort: 80 - protocol: TCP - name: http - - port: 443 - protocol: TCP - name: https - selector: - app: nginx ---- -apiVersion: v1 -kind: ReplicationController -metadata: - name: my-nginx -spec: - replicas: 1 - template: - metadata: - labels: - app: nginx - spec: - volumes: - - name: secret-volume - secret: - secretName: nginxsecret - containers: - - name: nginxhttps - image: bprashanth/nginxhttps:1.0 - ports: - - containerPort: 443 - - containerPort: 80 - volumeMounts: - - mountPath: /etc/nginx/ssl - name: secret-volume -``` - -Noteworthy points about the nginx-app manifest: -- It contains both rc and service specification in the same file -- The [nginx server](../../examples/https-nginx/default.conf) serves http traffic on port 80 and https traffic on 443, and nginx Service exposes both ports. -- Each container has access to the keys through a volume mounted at /etc/nginx/ssl. This is setup *before* the nginx server is started. - -```console -$ kubectl delete rc,svc -l app=nginx; kubectl create -f ./nginx-app.yaml -replicationcontrollers/my-nginx -services/nginxsvc -services/nginxsvc -replicationcontrollers/my-nginx -``` - -At this point you can reach the nginx server from any node. - -```console -$ kubectl get pods -o json | grep -i podip - "podIP": "10.1.0.80", -node $ curl -k https://10.1.0.80 -... -

    Welcome to nginx!

    -``` - -Note how we supplied the `-k` parameter to curl in the last step, this is because we don't know anything about the pods running nginx at certificate generation time, -so we have to tell curl to ignore the CName mismatch. By creating a Service we linked the CName used in the certificate with the actual DNS name used by pods during Service lookup. -Lets test this from a pod (the same secret is being reused for simplicity, the pod only needs nginx.crt to access the Service): - -```console -$ cat curlpod.yaml -vapiVersion: v1 -kind: ReplicationController -metadata: - name: curlrc -spec: - replicas: 1 - template: - metadata: - labels: - app: curlpod - spec: - volumes: - - name: secret-volume - secret: - secretName: nginxsecret - containers: - - name: curlpod - command: - - sh - - -c - - while true; do sleep 1; done - image: radial/busyboxplus:curl - volumeMounts: - - mountPath: /etc/nginx/ssl - name: secret-volume - -$ kubectl create -f ./curlpod.yaml -$ kubectl get pods -NAME READY STATUS RESTARTS AGE -curlpod 1/1 Running 0 2m -my-nginx-7006w 1/1 Running 0 24m - -$ kubectl exec curlpod -- curl https://nginxsvc --cacert /etc/nginx/ssl/nginx.crt -... -Welcome to nginx! -... -``` - -## Exposing the Service - -For some parts of your applications you may want to expose a Service onto an external IP address. Kubernetes supports two ways of doing this: NodePorts and LoadBalancers. The Service created in the last section already used `NodePort`, so your nginx https replica is ready to serve traffic on the internet if your node has a public IP. - -```console -$ kubectl get svc nginxsvc -o json | grep -i nodeport -C 5 - { - "name": "http", - "protocol": "TCP", - "port": 80, - "targetPort": 80, - "nodePort": 32188 - }, - { - "name": "https", - "protocol": "TCP", - "port": 443, - "targetPort": 443, - "nodePort": 30645 - } - -$ kubectl get nodes -o json | grep ExternalIP -C 2 - { - "type": "ExternalIP", - "address": "104.197.63.17" - } --- - }, - { - "type": "ExternalIP", - "address": "104.154.89.170" - } -$ curl https://104.197.63.17:30645 -k -... -

    Welcome to nginx!

    -``` - -Lets now recreate the Service to use a cloud load balancer, just change the `Type` of Service in the nginx-app.yaml from `NodePort` to `LoadBalancer`: - -```console -$ kubectl delete rc, svc -l app=nginx -$ kubectl create -f ./nginx-app.yaml -$ kubectl get svc -o json | grep -i ingress -A 5 - "ingress": [ - { - "ip": "104.197.68.43" - } - ] - } -$ curl https://104.197.68.43 -k -... -Welcome to nginx! -``` - -## What's next? - -[Learn about more Kubernetes features that will help you run containers reliably in production.](production-pods.md) - - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/connecting-applications.md?pixel)]() - diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/user-guide/connecting-to-applications-port-forward.md b/Godeps/_workspace/src/k8s.io/kubernetes/docs/user-guide/connecting-to-applications-port-forward.md deleted file mode 100644 index a4c19f659abb..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/user-guide/connecting-to-applications-port-forward.md +++ /dev/null @@ -1,85 +0,0 @@ - - - - -WARNING -WARNING -WARNING -WARNING -WARNING - -

    PLEASE NOTE: This document applies to the HEAD of the source tree

    - -If you are using a released version of Kubernetes, you should -refer to the docs that go with that version. - - -The latest 1.0.x release of this document can be found -[here](http://releases.k8s.io/release-1.0/docs/user-guide/connecting-to-applications-port-forward.md). - -Documentation for other releases can be found at -[releases.k8s.io](http://releases.k8s.io). - --- - - - - - -# Connecting to applications: kubectl port-forward - -kubectl port-forward forwards connections to a local port to a port on a pod. Its man page is available [here](kubectl/kubectl_port-forward.md). Compared to [kubectl proxy](accessing-the-cluster.md#using-kubectl-proxy), `kubectl port-forward` is more generic as it can forward TCP traffic while `kubectl proxy` can only forward HTTP traffic. This guide demonstrates how to use `kubectl port-forward` to connect to a Redis database, which may be useful for database debugging. - -## Creating a Redis master - -```console -$ kubectl create examples/redis/redis-master.yaml -pods/redis-master -``` - -wait until the Redis master pod is Running and Ready, - -```console -$ kubectl get pods -NAME READY STATUS RESTARTS AGE -redis-master 2/2 Running 0 41s -``` - - -## Connecting to the Redis master[a] - -The Redis master is listening on port 6397, to verify this, - -```console -$ kubectl get pods redis-master -t='{{(index (index .spec.containers 0).ports 0).containerPort}}{{"\n"}}' -6379 -``` - - -then we forward the port 6379 on the local workstation to the port 6379 of pod redis-master, - -```console -$ kubectl port-forward -p redis-master 6379:6379 -I0710 14:43:38.274550 3655 portforward.go:225] Forwarding from 127.0.0.1:6379 -> 6379 -I0710 14:43:38.274797 3655 portforward.go:225] Forwarding from [::1]:6379 -> 6379 -``` - -To verify the connection is successful, we run a redis-cli on the local workstation, - -```console -$ redis-cli -127.0.0.1:6379> ping -PONG -``` - -Now one can debug the database from the local workstation. - - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/connecting-to-applications-port-forward.md?pixel)]() - diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/user-guide/connecting-to-applications-proxy.md b/Godeps/_workspace/src/k8s.io/kubernetes/docs/user-guide/connecting-to-applications-proxy.md deleted file mode 100644 index a71a0b18f426..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/user-guide/connecting-to-applications-proxy.md +++ /dev/null @@ -1,65 +0,0 @@ - - - - -WARNING -WARNING -WARNING -WARNING -WARNING - -

    PLEASE NOTE: This document applies to the HEAD of the source tree

    - -If you are using a released version of Kubernetes, you should -refer to the docs that go with that version. - - -The latest 1.0.x release of this document can be found -[here](http://releases.k8s.io/release-1.0/docs/user-guide/connecting-to-applications-proxy.md). - -Documentation for other releases can be found at -[releases.k8s.io](http://releases.k8s.io). - --- - - - - - -# Connecting to applications: kubectl proxy and apiserver proxy - -You have seen the [basics](accessing-the-cluster.md) about `kubectl proxy` and `apiserver proxy`. This guide shows how to use them together to access a service([kube-ui](ui.md)) running on the Kubernetes cluster from your workstation. - - -## Getting the apiserver proxy URL of kube-ui - -kube-ui is deployed as a cluster add-on. To find its apiserver proxy URL, - -```console -$ kubectl cluster-info | grep "KubeUI" -KubeUI is running at https://173.255.119.104/api/v1/proxy/namespaces/kube-system/services/kube-ui -``` - -if this command does not find the URL, try the steps [here](ui.md#accessing-the-ui). - - -## Connecting to the kube-ui service from your local workstation - -The above proxy URL is an access to the kube-ui service provided by the apiserver. To access it, you still need to authenticate to the apiserver. `kubectl proxy` can handle the authentication. - -```console -$ kubectl proxy --port=8001 -Starting to serve on localhost:8001 -``` - -Now you can access the kube-ui service on your local workstation at [http://localhost:8001/api/v1/proxy/namespaces/kube-system/services/kube-ui](http://localhost:8001/api/v1/proxy/namespaces/kube-system/services/kube-ui) - - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/connecting-to-applications-proxy.md?pixel)]() - diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/user-guide/container-environment.md b/Godeps/_workspace/src/k8s.io/kubernetes/docs/user-guide/container-environment.md deleted file mode 100644 index 3cb4152a3d37..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/user-guide/container-environment.md +++ /dev/null @@ -1,153 +0,0 @@ - - - - -WARNING -WARNING -WARNING -WARNING -WARNING - -

    PLEASE NOTE: This document applies to the HEAD of the source tree

    - -If you are using a released version of Kubernetes, you should -refer to the docs that go with that version. - - -The latest 1.0.x release of this document can be found -[here](http://releases.k8s.io/release-1.0/docs/user-guide/container-environment.md). - -Documentation for other releases can be found at -[releases.k8s.io](http://releases.k8s.io). - --- - - - - - -# Kubernetes Container Environment - -**Table of Contents** - - -- [Kubernetes Container Environment](#kubernetes-container-environment) - - [Overview](#overview) - - [Cluster Information](#cluster-information) - - [Container Information](#container-information) - - [Cluster Information](#cluster-information) - - [Container Hooks](#container-hooks) - - [Hook Details](#hook-details) - - [Hook Handler Execution](#hook-handler-execution) - - [Hook delivery guarantees](#hook-delivery-guarantees) - - [Hook Handler Implementations](#hook-handler-implementations) - - - - -## Overview - -This document describes the environment for Kubelet managed containers on a Kubernetes node (kNode).  In contrast to the Kubernetes cluster API, which provides an API for creating and managing containers, the Kubernetes container environment provides the container access to information about what else is going on in the cluster. - -This cluster information makes it possible to build applications that are *cluster aware*. -Additionally, the Kubernetes container environment defines a series of hooks that are surfaced to optional hook handlers defined as part of individual containers.  Container hooks are somewhat analogous to operating system signals in a traditional process model.   However these hooks are designed to make it easier to build reliable, scalable cloud applications in the Kubernetes cluster.  Containers that participate in this cluster lifecycle become *cluster native*. - -Another important part of the container environment is the file system that is available to the container. In Kubernetes, the filesystem is a combination of an [image](images.md) and one or more [volumes](volumes.md). - - -The following sections describe both the cluster information provided to containers, as well as the hooks and life-cycle that allows containers to interact with the management system. - -## Cluster Information - -There are two types of information that are available within the container environment.  There is information about the container itself, and there is information about other objects in the system. - -### Container Information - -Currently, the Pod name for the pod in which the container is running is set as the hostname of the container, and is accessible through all calls to access the hostname within the container (e.g. the hostname command, or the [gethostname][1] function call in libc), but this is planned to change in the future and should not be used. - -The Pod name and namespace are also available as environment variables via the [downward API](downward-api.md). Additionally, user-defined environment variables from the pod definition, are also available to the container, as are any environment variables specified statically in the Docker image. - -In the future, we anticipate expanding this information with richer information about the container.  Examples include available memory, number of restarts, and in general any state that you could get from the call to GET /pods on the API server. - -### Cluster Information - -Currently the list of all services that are running at the time when the container was created via the Kubernetes Cluster API are available to the container as environment variables.  The set of environment variables matches the syntax of Docker links. - -For a service named **foo** that maps to a container port named **bar**, the following variables are defined: - -```sh -FOO_SERVICE_HOST= -FOO_SERVICE_PORT= -``` - -Services have dedicated IP address, and are also surfaced to the container via DNS (If [DNS addon](http://releases.k8s.io/HEAD/cluster/addons/dns/) is enabled).  Of course DNS is still not an enumerable protocol, so we will continue to provide environment variables so that containers can do discovery. - -## Container Hooks - -*NB*: Container hooks are under active development, we anticipate adding additional hooks as the Kubernetes container management system evolves.* - -Container hooks provide information to the container about events in its management lifecycle.  For example, immediately after a container is started, it receives a *PostStart* hook.  These hooks are broadcast *into* the container with information about the life-cycle of the container.  They are different from the events provided by Docker and other systems which are *output* from the container.  Output events provide a log of what has already happened.  Input hooks provide real-time notification about things that are happening, but no historical log. - -### Hook Details - -There are currently two container hooks that are surfaced to containers, and two proposed hooks: - -*PreStart - ****Proposed*** - -This hook is sent immediately before a container is created.  It notifies that the container will be created immediately after the call completes.  No parameters are passed. *Note - *Some event handlers (namely ‘exec’ are incompatible with this event) - -*PostStart* - -This hook is sent immediately after a container is created.  It notifies the container that it has been created.  No parameters are passed to the handler. - -*PostRestart - ****Proposed*** - -This hook is called before the PostStart handler, when a container has been restarted, rather than started for the first time.  No parameters are passed to the handler. - -*PreStop* - -This hook is called immediately before a container is terminated.  This event handler is blocking, and must complete before the call to delete the container is sent to the Docker daemon. The SIGTERM notification sent by Docker is also still sent. - -A single parameter named reason is passed to the handler which contains the reason for termination.  Currently the valid values for reason are: - -* `Delete` - indicating an API call to delete the pod containing this container. -* `Health` - indicating that a health check of the container failed. -* `Dependency` - indicating that a dependency for the container or the pod is missing, and thus, the container needs to be restarted.  Examples include, the pod infra container crashing, or persistent disk failing for a container that mounts PD. - -Eventually, user specified reasons may be [added to the API](https://k8s.io/kubernetes/issues/137). - - -### Hook Handler Execution - -When a management hook occurs, the management system calls into any registered hook handlers in the container for that hook.  These hook handler calls are synchronous in the context of the pod containing the container. Note:this means that hook handler execution blocks any further management of the pod.  If your hook handler blocks, no other management (including [health checks](production-pods.md#liveness-and-readiness-probes-aka-health-checks)) will occur until the hook handler completes.  Blocking hook handlers do *not* affect management of other Pods.  Typically we expect that users will make their hook handlers as lightweight as possible, but there are cases where long running commands make sense (e.g. saving state prior to container stop) - -For hooks which have parameters, these parameters are passed to the event handler as a set of key/value pairs.  The details of this parameter passing is handler implementation dependent (see below). - -### Hook delivery guarantees - -Hook delivery is "at least one", which means that a hook may be called multiple times for any given event (e.g. "start" or "stop") and it is up to the hook implementer to be able to handle this -correctly. - -We expect double delivery to be rare, but in some cases if the `kubelet` restarts in the middle of sending a hook, the hook may be resent after the kubelet comes back up. - -Likewise, we only make a single delivery attempt. If (for example) an http hook receiver is down, and unable to take traffic, we do not make any attempts to resend. - -### Hook Handler Implementations - -Hook handlers are the way that hooks are surfaced to containers.  Containers can select the type of hook handler they would like to implement.  Kubernetes currently supports two different hook handler types: - - * Exec - Executes a specific command (e.g. pre-stop.sh) inside the cgroup and namespaces of the container.  Resources consumed by the command are counted against the container.  Commands which print "ok" to standard out (stdout) are treated as healthy, any other output is treated as container failures (and will cause kubelet to forcibly restart the container).  Parameters are passed to the command as traditional linux command line flags (e.g. pre-stop.sh --reason=HEALTH) - - * HTTP - Executes an HTTP request against a specific endpoint on the container.  HTTP error codes (5xx) and non-response/failure to connect are treated as container failures. Parameters are passed to the http endpoint as query args (e.g. http://some.server.com/some/path?reason=HEALTH) - -[1]: http://man7.org/linux/man-pages/man2/gethostname.2.html - - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/container-environment.md?pixel)]() - diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/user-guide/containers.md b/Godeps/_workspace/src/k8s.io/kubernetes/docs/user-guide/containers.md deleted file mode 100644 index 4156ff9fc120..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/user-guide/containers.md +++ /dev/null @@ -1,127 +0,0 @@ - - - - -WARNING -WARNING -WARNING -WARNING -WARNING - -

    PLEASE NOTE: This document applies to the HEAD of the source tree

    - -If you are using a released version of Kubernetes, you should -refer to the docs that go with that version. - - -The latest 1.0.x release of this document can be found -[here](http://releases.k8s.io/release-1.0/docs/user-guide/containers.md). - -Documentation for other releases can be found at -[releases.k8s.io](http://releases.k8s.io). - --- - - - - - -# Containers with Kubernetes - -## Containers and commands - -So far the Pods we've seen have all used the `image` field to indicate what process Kubernetes -should run in a container. In this case, Kubernetes runs the image's default command. If we want -to run a particular command or override the image's defaults, there are two additional fields that -we can use: - -1. `Command`: Controls the actual command run by the image -2. `Args`: Controls the arguments passed to the command - -### How docker handles command and arguments - -Docker images have metadata associated with them that is used to store information about the image. -The image author may use this to define defaults for the command and arguments to run a container -when the user does not supply values. Docker calls the fields for commands and arguments -`Entrypoint` and `Cmd` respectively. The full details for this feature are too complicated to -describe here, mostly due to the fact that the docker API allows users to specify both of these -fields as either a string array or a string and there are subtle differences in how those cases are -handled. We encourage the curious to check out [docker's documentation]() for this feature. - -Kubernetes allows you to override both the image's default command (docker `Entrypoint`) and args -(docker `Cmd`) with the `Command` and `Args` fields of `Container`. The rules are: - -1. If you do not supply a `Command` or `Args` for a container, the defaults defined by the image - will be used -2. If you supply a `Command` but no `Args` for a container, only the supplied `Command` will be - used; the image's default arguments are ignored -3. If you supply only `Args`, the image's default command will be used with the arguments you - supply -4. If you supply a `Command` **and** `Args`, the image's defaults will be ignored and the values - you supply will be used - -Here are examples for these rules in table format - -| Image `Entrypoint` | Image `Cmd` | Container `Command` | Container `Args` | Command Run | -|--------------------|------------------|---------------------|--------------------|------------------| -| `[/ep-1]` | `[foo bar]` | <not set> | <not set> | `[ep-1 foo bar]` | -| `[/ep-1]` | `[foo bar]` | `[/ep-2]` | <not set> | `[ep-2]` | -| `[/ep-1]` | `[foo bar]` | <not set> | `[zoo boo]` | `[ep-1 zoo boo]` | -| `[/ep-1]` | `[foo bar]` | `[/ep-2]` | `[zoo boo]` | `[ep-2 zoo boo]` | - - -## Capabilities - -By default, Docker containers are "unprivileged" and cannot, for example, run a Docker daemon inside a Docker container. We can have fine grain control over the capabilities using cap-add and cap-drop.More details [here](https://docs.docker.com/reference/run/#runtime-privilege-linux-capabilities-and-lxc-configuration). - -The relationship between Docker's capabilities and [Linux capabilities](http://man7.org/linux/man-pages/man7/capabilities.7.html) - -| Docker's capabilities | Linux capabilities | -| ---- | ---- | -| SETPCAP | CAP_SETPCAP | -| SYS_MODULE | CAP_SYS_MODULE | -| SYS_RAWIO | CAP_SYS_RAWIO | -| SYS_PACCT | CAP_SYS_PACCT | -| SYS_ADMIN | CAP_SYS_ADMIN | -| SYS_NICE | CAP_SYS_NICE | -| SYS_RESOURCE | CAP_SYS_RESOURCE | -| SYS_TIME | CAP_SYS_TIME | -| SYS_TTY_CONFIG | CAP_SYS_TTY_CONFIG | -| MKNOD | CAP_MKNOD | -| AUDIT_WRITE | CAP_AUDIT_WRITE | -| AUDIT_CONTROL | CAP_AUDIT_CONTROL | -| MAC_OVERRIDE | CAP_MAC_OVERRIDE | -| MAC_ADMIN | CAP_MAC_ADMIN | -| NET_ADMIN | CAP_NET_ADMIN | -| SYSLOG | CAP_SYSLOG | -| CHOWN | CAP_CHOWN | -| NET_RAW | CAP_NET_RAW | -| DAC_OVERRIDE | CAP_DAC_OVERRIDE | -| FOWNER | CAP_FOWNER | -| DAC_READ_SEARCH | CAP_DAC_READ_SEARCH | -| FSETID | CAP_FSETID | -| KILL | CAP_KILL | -| SETGID | CAP_SETGID | -| SETUID | CAP_SETUID | -| LINUX_IMMUTABLE | CAP_LINUX_IMMUTABLE | -| NET_BIND_SERVICE | CAP_NET_BIND_SERVICE | -| NET_BROADCAST | CAP_NET_BROADCAST | -| IPC_LOCK | CAP_IPC_LOCK | -| IPC_OWNER | CAP_IPC_OWNER | -| SYS_CHROOT | CAP_SYS_CHROOT | -| SYS_PTRACE | CAP_SYS_PTRACE | -| SYS_BOOT | CAP_SYS_BOOT | -| LEASE | CAP_LEASE | -| SETFCAP | CAP_SETFCAP | -| WAKE_ALARM | CAP_WAKE_ALARM | -| BLOCK_SUSPEND | CAP_BLOCK_SUSPEND | - - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/containers.md?pixel)]() - diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/user-guide/debugging-services.md b/Godeps/_workspace/src/k8s.io/kubernetes/docs/user-guide/debugging-services.md deleted file mode 100644 index 610dff3ae989..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/user-guide/debugging-services.md +++ /dev/null @@ -1,560 +0,0 @@ - - - - -WARNING -WARNING -WARNING -WARNING -WARNING - -

    PLEASE NOTE: This document applies to the HEAD of the source tree

    - -If you are using a released version of Kubernetes, you should -refer to the docs that go with that version. - - -The latest 1.0.x release of this document can be found -[here](http://releases.k8s.io/release-1.0/docs/user-guide/debugging-services.md). - -Documentation for other releases can be found at -[releases.k8s.io](http://releases.k8s.io). - --- - - - - - -# My Service is not working - how to debug - -An issue that comes up rather frequently for new installations of Kubernetes is -that `Services` are not working properly. You've run all your `Pod`s and -`ReplicationController`s, but you get no response when you try to access them. -This document will hopefully help you to figure out what's going wrong. - -**Table of Contents** - - -- [My Service is not working - how to debug](#my-service-is-not-working---how-to-debug) - - [Conventions](#conventions) - - [Running commands in a Pod](#running-commands-in-a-pod) - - [Setup](#setup) - - [Does the Service exist?](#does-the-service-exist) - - [Does the Service work by DNS?](#does-the-service-work-by-dns) - - [Does any Service exist in DNS?](#does-any-service-exist-in-dns) - - [Does the Service work by IP?](#does-the-service-work-by-ip) - - [Is the Service correct?](#is-the-service-correct) - - [Does the Service have any Endpoints?](#does-the-service-have-any-endpoints) - - [Are the Pods working?](#are-the-pods-working) - - [Is the kube-proxy working?](#is-the-kube-proxy-working) - - [Is kube-proxy running?](#is-kube-proxy-running) - - [Is kube-proxy writing iptables rules?](#is-kube-proxy-writing-iptables-rules) - - [Is kube-proxy proxying?](#is-kube-proxy-proxying) - - [Seek help](#seek-help) - - [More information](#more-information) - - - -## Conventions - -Throughout this doc you will see various commands that you can run. Some -commands need to be run within `Pod`, others on a Kubernetes `Node`, and others -can run anywhere you have `kubectl` and credentials for the cluster. To make it -clear what is expected, this document will use the following conventions. - -If the command "COMMAND" is expected to run in a `Pod` and produce "OUTPUT": - -```console -u@pod$ COMMAND -OUTPUT -``` - -If the command "COMMAND" is expected to run on a `Node` and produce "OUTPUT": - -```console -u@node$ COMMAND -OUTPUT -``` - -If the command is "kubectl ARGS": - -```console -$ kubectl ARGS -OUTPUT -``` - -## Running commands in a Pod - -For many steps here you will want to see what a `Pod` running in the cluster -sees. Kubernetes does not directly support interactive `Pod`s (yet), but you can -approximate it: - -```console -$ cat < -``` - -or - -```console -$ kubectl exec -ti busybox-sleep sh -/ # -``` - -## Setup - -For the purposes of this walk-through, let's run some `Pod`s. Since you're -probably debugging your own `Service` you can substitute your own details, or you -can follow along and get a second data point. - -```console -$ kubectl run hostnames --image=gcr.io/google_containers/serve_hostname \ - --labels=app=hostnames \ - --port=9376 \ - --replicas=3 -CONTROLLER CONTAINER(S) IMAGE(S) SELECTOR REPLICAS -hostnames hostnames gcr.io/google_containers/serve_hostname app=hostnames 3 -``` - -Note that this is the same as if you had started the `ReplicationController` with -the following YAML: - -```yaml -apiVersion: v1 -kind: ReplicationController -metadata: - name: hostnames -spec: - selector: - app: hostnames - replicas: 3 - template: - metadata: - labels: - app: hostnames - spec: - containers: - - name: hostnames - image: gcr.io/google_containers/serve_hostname - ports: - - containerPort: 9376 - protocol: TCP -``` - -Confirm your `Pod`s are running: - -```console -$ kubectl get pods -l app=hostnames -NAME READY STATUS RESTARTS AGE -hostnames-0uton 1/1 Running 0 12s -hostnames-bvc05 1/1 Running 0 12s -hostnames-yp2kp 1/1 Running 0 12s -``` - -## Does the Service exist? - -The astute reader will have noticed that we did not actually create a `Service` -yet - that is intentional. This is a step that sometimes gets forgotten, and -is the first thing to check. - -So what would happen if I tried to access a non-existent `Service`? Assuming you -have another `Pod` that consumes this `Service` by name you would get something -like: - -```console -u@pod$ wget -qO- hostnames -wget: bad address 'hostname' -``` - -or: - -```console -u@pod$ echo $HOSTNAMES_SERVICE_HOST -``` - -So the first thing to check is whether that `Service` actually exists: - -```console -$ kubectl get svc hostnames -Error from server: service "hostnames" not found -``` - -So we have a culprit, let's create the `Service`. As before, this is for the -walk-through - you can use your own `Service`'s details here. - -```console -$ kubectl expose rc hostnames --port=80 --target-port=9376 -NAME LABELS SELECTOR IP(S) PORT(S) -hostnames app=hostnames app=hostnames 80/TCP -``` - -And read it back, just to be sure: - -```console -$ kubectl get svc hostnames -NAME LABELS SELECTOR IP(S) PORT(S) -hostnames app=hostnames app=hostnames 10.0.1.175 80/TCP -``` - -As before, this is the same as if you had started the `Service` with YAML: - -```yaml -apiVersion: v1 -kind: Service -metadata: - name: hostnames -spec: - selector: - app: hostnames - ports: - - name: default - protocol: TCP - port: 80 - targetPort: 9376 -``` - -Now you can confirm that the `Service` exists. - -## Does the Service work by DNS? - -From a `Pod` in the same `Namespace`: - -```console -u@pod$ nslookup hostnames -Server: 10.0.0.10 -Address: 10.0.0.10#53 - -Name: hostnames -Address: 10.0.1.175 -``` - -If this fails, perhaps your `Pod` and `Service` are in different -`Namespace`s, try a namespace-qualified name: - -```console -u@pod$ nslookup hostnames.default -Server: 10.0.0.10 -Address: 10.0.0.10#53 - -Name: hostnames.default -Address: 10.0.1.175 -``` - -If this works, you'll need to ensure that `Pod`s and `Service`s run in the same -`Namespace`. If this still fails, try a fully-qualified name: - -```console -u@pod$ nslookup hostnames.default.svc.cluster.local -Server: 10.0.0.10 -Address: 10.0.0.10#53 - -Name: hostnames.default.svc.cluster.local -Address: 10.0.1.175 -``` - -Note the suffix here: "default.svc.cluster.local". The "default" is the -`Namespace` we're operating in. The "svc" denotes that this is a `Service`. -The "cluster.local" is your cluster domain. - -You can also try this from a `Node` in the cluster (note: 10.0.0.10 is my DNS -`Service`): - -```console -u@node$ nslookup hostnames.default.svc.cluster.local 10.0.0.10 -Server: 10.0.0.10 -Address: 10.0.0.10#53 - -Name: hostnames.default.svc.cluster.local -Address: 10.0.1.175 -``` - -If you are able to do a fully-qualified name lookup but not a relative one, you -need to check that your `kubelet` is running with the right flags. -The `--cluster_dns` flag needs to point to your DNS `Service`'s IP and the -`--cluster_domain` flag needs to be your cluster's domain - we assumed -"cluster.local" in this document, but yours might be different, in which case -you should change that in all of the commands above. - -### Does any Service exist in DNS? - -If the above still fails - DNS lookups are not working for your `Service` - we -can take a step back and see what else is not working. The Kubernetes master -`Service` should always work: - -```console -u@pod$ nslookup kubernetes.default -Server: 10.0.0.10 -Address 1: 10.0.0.10 - -Name: kubernetes -Address 1: 10.0.0.1 -``` - -If this fails, you might need to go to the kube-proxy section of this doc, or -even go back to the top of this document and start over, but instead of -debugging your own `Service`, debug DNS. - -## Does the Service work by IP? - -The next thing to test is whether your `Service` works at all. From a -`Node` in your cluster, access the `Service`'s IP (from `kubectl get` above). - -```console -u@node$ curl 10.0.1.175:80 -hostnames-0uton - -u@node$ curl 10.0.1.175:80 -hostnames-yp2kp - -u@node$ curl 10.0.1.175:80 -hostnames-bvc05 -``` - -If your `Service` is working, you should get correct responses. If not, there -are a number of things that could be going wrong. Read on. - -## Is the Service correct? - -It might sound silly, but you should really double and triple check that your -`Service` is correct and matches your `Pods`. Read back your `Service` and -verify it: - -```console -$ kubectl get service hostnames -o json -{ - "kind": "Service", - "apiVersion": "v1", - "metadata": { - "name": "hostnames", - "namespace": "default", - "selfLink": "/api/v1/namespaces/default/services/hostnames", - "uid": "428c8b6c-24bc-11e5-936d-42010af0a9bc", - "resourceVersion": "347189", - "creationTimestamp": "2015-07-07T15:24:29Z", - "labels": { - "app": "hostnames" - } - }, - "spec": { - "ports": [ - { - "name": "default", - "protocol": "TCP", - "port": 80, - "targetPort": 9376, - "nodePort": 0 - } - ], - "selector": { - "app": "hostnames" - }, - "clusterIP": "10.0.1.175", - "type": "ClusterIP", - "sessionAffinity": "None" - }, - "status": { - "loadBalancer": {} - } -} -``` - -Is the port you are trying to access in `spec.ports[]`? Is the `targetPort` -correct for your `Pod`s? If you meant it to be a numeric port, is it a number -(9376) or a string "9376"? If you meant it to be a named port, do your `Pod`s -expose a port with the same name? Is the port's `protocol` the same as the -`Pod`'s? - -## Does the Service have any Endpoints? - -If you got this far, we assume that you have confirmed that your `Service` -exists and resolves by DNS. Now let's check that the `Pod`s you ran are -actually being selected by the `Service`. - -Earlier we saw that the `Pod`s were running. We can re-check that: - -```console -$ kubectl get pods -l app=hostnames -NAME READY STATUS RESTARTS AGE -hostnames-0uton 1/1 Running 0 1h -hostnames-bvc05 1/1 Running 0 1h -hostnames-yp2kp 1/1 Running 0 1h -``` - -The "AGE" column says that these `Pod`s are about an hour old, which implies that -they are running fine and not crashing. - -The `-l app=hostnames` argument is a label selector - just like our `Service` -has. Inside the Kubernetes system is a control loop which evaluates the -selector of every `Service` and save the results into an `Endpoints` object. - -```console -$ kubectl get endpoints hostnames -NAME ENDPOINTS -hostnames 10.244.0.5:9376,10.244.0.6:9376,10.244.0.7:9376 -``` - -This confirms that the control loop has found the correct `Pod`s for your -`Service`. If the `hostnames` row is blank, you should check that the -`spec.selector` field of your `Service` actually selects for `metadata.labels` -values on your `Pod`s. - -## Are the Pods working? - -At this point, we know that your `Service` exists and has selected your `Pod`s. -Let's check that the `Pod`s are actually working - we can bypass the `Service` -mechanism and go straight to the `Pod`s. - -```console -u@pod$ wget -qO- 10.244.0.5:9376 -hostnames-0uton - -pod $ wget -qO- 10.244.0.6:9376 -hostnames-bvc05 - -u@pod$ wget -qO- 10.244.0.7:9376 -hostnames-yp2kp -``` - -We expect each `Pod` in the `Endpoints` list to return its own hostname. If -this is not what happens (or whatever the correct behavior is for your own -`Pod`s), you should investigate what's happening there. You might find -`kubectl logs` to be useful or `kubectl exec` directly to your `Pod`s and check -service from there. - -## Is the kube-proxy working? - -If you get here, your `Service` is running, has `Endpoints`, and your `Pod`s -are actually serving. At this point, the whole `Service` proxy mechanism is -suspect. Let's confirm it, piece by piece. - -### Is kube-proxy running? - -Confirm that `kube-proxy` is running on your `Node`s. You should get something -like the below: - -```console -u@node$ ps auxw | grep kube-proxy -root 4194 0.4 0.1 101864 17696 ? Sl Jul04 25:43 /usr/local/bin/kube-proxy --master=https://kubernetes-master --kubeconfig=/var/lib/kube-proxy/kubeconfig --v=2 -``` - -Next, confirm that it is not failing something obvious, like contacting the -master. To do this, you'll have to look at the logs. Accessing the logs -depends on your `Node` OS. On some OSes it is a file, such as -/var/log/kube-proxy.log, while other OSes use `journalctl` to access logs. You -should see something like: - -```console -I0707 17:34:53.945651 30031 server.go:88] Running in resource-only container "/kube-proxy" -I0707 17:34:53.945921 30031 proxier.go:121] Setting proxy IP to 10.240.115.247 and initializing iptables -I0707 17:34:54.053023 30031 roundrobin.go:262] LoadBalancerRR: Setting endpoints for default/kubernetes: to [10.240.169.188:443] -I0707 17:34:54.053175 30031 roundrobin.go:262] LoadBalancerRR: Setting endpoints for default/hostnames:default to [10.244.0.5:9376 10.244.0.6:9376 10.244.0.7:9376] -I0707 17:34:54.053284 30031 roundrobin.go:262] LoadBalancerRR: Setting endpoints for default/kube-dns:dns to [10.244.3.3:53] -I0707 17:34:54.053310 30031 roundrobin.go:262] LoadBalancerRR: Setting endpoints for default/kube-dns:dns-tcp to [10.244.3.3:53] -I0707 17:34:54.054780 30031 proxier.go:306] Adding new service "default/kubernetes:" at 10.0.0.1:443/TCP -I0707 17:34:54.054903 30031 proxier.go:247] Proxying for service "default/kubernetes:" on TCP port 40074 -I0707 17:34:54.079181 30031 proxier.go:306] Adding new service "default/hostnames:default" at 10.0.1.175:80/TCP -I0707 17:34:54.079273 30031 proxier.go:247] Proxying for service "default/hostnames:default" on TCP port 48577 -I0707 17:34:54.113665 30031 proxier.go:306] Adding new service "default/kube-dns:dns" at 10.0.0.10:53/UDP -I0707 17:34:54.113776 30031 proxier.go:247] Proxying for service "default/kube-dns:dns" on UDP port 34149 -I0707 17:34:54.120224 30031 proxier.go:306] Adding new service "default/kube-dns:dns-tcp" at 10.0.0.10:53/TCP -I0707 17:34:54.120297 30031 proxier.go:247] Proxying for service "default/kube-dns:dns-tcp" on TCP port 53476 -I0707 17:34:54.902313 30031 proxysocket.go:130] Accepted TCP connection from 10.244.3.3:42670 to 10.244.3.1:40074 -I0707 17:34:54.903107 30031 proxysocket.go:130] Accepted TCP connection from 10.244.3.3:42671 to 10.244.3.1:40074 -I0707 17:35:46.015868 30031 proxysocket.go:246] New UDP connection from 10.244.3.2:57493 -I0707 17:35:46.017061 30031 proxysocket.go:246] New UDP connection from 10.244.3.2:55471 -``` - -If you see error messages about not being able to contact the master, you -should double-check your `Node` configuration and installation steps. - -### Is kube-proxy writing iptables rules? - -One of the main responsibilities of `kube-proxy` is to write the `iptables` -rules which implement `Service`s. Let's check that those rules are getting -written. - -```console -u@node$ iptables-save | grep hostnames --A KUBE-PORTALS-CONTAINER -d 10.0.1.175/32 -p tcp -m comment --comment "default/hostnames:default" -m tcp --dport 80 -j REDIRECT --to-ports 48577 --A KUBE-PORTALS-HOST -d 10.0.1.175/32 -p tcp -m comment --comment "default/hostnames:default" -m tcp --dport 80 -j DNAT --to-destination 10.240.115.247:48577 -``` - -There should be 2 rules for each port on your `Service` (just one in this -example) - a "KUBE-PORTALS-CONTAINER" and a "KUBE-PORTALS-HOST". If you do -not see these, try restarting `kube-proxy` with the `-V` flag set to 4, and -then look at the logs again. - -### Is kube-proxy proxying? - -Assuming you do see the above rules, try again to access your `Service` by IP: - -```console -u@node$ curl 10.0.1.175:80 -hostnames-0uton -``` - -If this fails, we can try accessing the proxy directly. Look back at the -`iptables-save` output above, and extract the port number that `kube-proxy` is -using for your `Service`. In the above examples it is "48577". Now connect to -that: - -```console -u@node$ curl localhost:48577 -hostnames-yp2kp -``` - -If this still fails, look at the `kube-proxy` logs for specific lines like: - -```console -Setting endpoints for default/hostnames:default to [10.244.0.5:9376 10.244.0.6:9376 10.244.0.7:9376] -``` - -If you don't see those, try restarting `kube-proxy` with the `-V` flag set to 4, and -then look at the logs again. - -## Seek help - -If you get this far, something very strange is happening. Your `Service` is -running, has `Endpoints`, and your `Pod`s are actually serving. You have DNS -working, `iptables` rules installed, and `kube-proxy` does not seem to be -misbehaving. And yet your `Service` is not working. You should probably let -us know, so we can help investigate! - -Contact us on -[IRC](http://webchat.freenode.net/?channels=google-containers) or -[email](https://groups.google.com/forum/#!forum/google-containers) or -[GitHub](https://k8s.io/kubernetes). - -## More information - -Visit [troubleshooting document](../troubleshooting.md) for more information. - - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/debugging-services.md?pixel)]() - diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/user-guide/deploying-applications.md b/Godeps/_workspace/src/k8s.io/kubernetes/docs/user-guide/deploying-applications.md deleted file mode 100644 index ca92dd571f1f..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/user-guide/deploying-applications.md +++ /dev/null @@ -1,160 +0,0 @@ - - - - -WARNING -WARNING -WARNING -WARNING -WARNING - -

    PLEASE NOTE: This document applies to the HEAD of the source tree

    - -If you are using a released version of Kubernetes, you should -refer to the docs that go with that version. - - -The latest 1.0.x release of this document can be found -[here](http://releases.k8s.io/release-1.0/docs/user-guide/deploying-applications.md). - -Documentation for other releases can be found at -[releases.k8s.io](http://releases.k8s.io). - --- - - - - - -# Kubernetes User Guide: Managing Applications: Deploying continuously running applications - -**Table of Contents** - - -- [Kubernetes User Guide: Managing Applications: Deploying continuously running applications](#kubernetes-user-guide-managing-applications-deploying-continuously-running-applications) - - [Launching a set of replicas using a configuration file](#launching-a-set-of-replicas-using-a-configuration-file) - - [Viewing replication controller status](#viewing-replication-controller-status) - - [Deleting replication controllers](#deleting-replication-controllers) - - [Labels](#labels) - - [What's next?](#whats-next) - - - -You previously read about how to quickly deploy a simple replicated application using [`kubectl run`](quick-start.md) and how to configure and launch single-run containers using pods ([Configuring containers](configuring-containers.md)). Here you’ll use the configuration-based approach to deploy a continuously running, replicated application. - -## Launching a set of replicas using a configuration file - -Kubernetes creates and manages sets of replicated containers (actually, replicated [Pods](pods.md)) using [*Replication Controllers*](replication-controller.md). - -A replication controller simply ensures that a specified number of pod "replicas" are running at any one time. If there are too many, it will kill some. If there are too few, it will start more. It’s analogous to Google Compute Engine’s [Instance Group Manager](https://cloud.google.com/compute/docs/instance-groups/manager/) or AWS’s [Auto-scaling Group](http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/AutoScalingGroup.html) (with no scaling policies). - -The replication controller created to run nginx by `kubctl run` in the [Quick start](quick-start.md) could be specified using YAML as follows: - -```yaml -apiVersion: v1 -kind: ReplicationController -metadata: - name: my-nginx -spec: - replicas: 2 - template: - metadata: - labels: - app: nginx - spec: - containers: - - name: nginx - image: nginx - ports: - - containerPort: 80 -``` - -Some differences compared to specifying just a pod are that the `kind` is `ReplicationController`, the number of `replicas` desired is specified, and the pod specification is under the `template` field. The names of the pods don’t need to be specified explicitly because they are generated from the name of the replication controller. -View the [replication controller API -object](https://htmlpreview.github.io/?https://k8s.io/kubernetes/HEAD/docs/api-reference/definitions.html#_v1_replicationcontroller) -to view the list of supported fields. - -This replication controller can be created using `create`, just as with pods: - -```console -$ kubectl create -f ./nginx-rc.yaml -replicationcontrollers/my-nginx -``` - -Unlike in the case where you directly create pods, a replication controller replaces pods that are deleted or terminated for any reason, such as in the case of node failure. For this reason, we recommend that you use a replication controller for a continuously running application even if your application requires only a single pod, in which case you can omit `replicas` and it will default to a single replica. - -## Viewing replication controller status - -You can view the replication controller you created using `get`: - -```console -$ kubectl get rc -CONTROLLER CONTAINER(S) IMAGE(S) SELECTOR REPLICAS -my-nginx nginx nginx app=nginx 2 -``` - -This tells you that your controller will ensure that you have two nginx replicas. - -You can see those replicas using `get`, just as with pods you created directly: - -```console -$ kubectl get pods -NAME READY STATUS RESTARTS AGE -my-nginx-065jq 1/1 Running 0 51s -my-nginx-buaiq 1/1 Running 0 51s -``` - -## Deleting replication controllers - -When you want to kill your application, delete your replication controller, as in the [Quick start](quick-start.md): - -```console -$ kubectl delete rc my-nginx -replicationcontrollers/my-nginx -``` - -By default, this will also cause the pods managed by the replication controller to be deleted. If there were a large number of pods, this may take a while to complete. If you want to leave the pods running, specify `--cascade=false`. - -If you try to delete the pods before deleting the replication controller, it will just replace them, as it is supposed to do. - -## Labels - -Kubernetes uses user-defined key-value attributes called [*labels*](labels.md) to categorize and identify sets of resources, such as pods and replication controllers. The example above specified a single label in the pod template, with key `app` and value `nginx`. All pods created carry that label, which can be viewed using `-L`: - -```console -$ kubectl get pods -L app -NAME READY STATUS RESTARTS AGE APP -my-nginx-afv12 0/1 Running 0 3s nginx -my-nginx-lg99z 0/1 Running 0 3s nginx -``` - -The labels from the pod template are copied to the replication controller’s labels by default, as well -- all resources in Kubernetes support labels: - -```console -$ kubectl get rc my-nginx -L app -CONTROLLER CONTAINER(S) IMAGE(S) SELECTOR REPLICAS APP -my-nginx nginx nginx app=nginx 2 nginx -``` - -More importantly, the pod template’s labels are used to create a [`selector`](labels.md#label-selectors) that will match pods carrying those labels. You can see this field by requesting it using the [Go template output format of `kubectl get`](kubectl/kubectl_get.md): - -```console -$ kubectl get rc my-nginx -o template --template="{{.spec.selector}}" -map[app:nginx] -``` - -You could also specify the `selector` explicitly, such as if you wanted to specify labels in the pod template that you didn’t want to select on, but you should ensure that the selector will match the labels of the pods created from the pod template, and that it won’t match pods created by other replication controllers. The most straightforward way to ensure the latter is to create a unique label value for the replication controller, and to specify it in both the pod template’s labels and in the selector. - -## What's next? - -[Learn about exposing applications to users and clients, and connecting tiers of your application together.](connecting-applications.md) - - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/deploying-applications.md?pixel)]() - diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/user-guide/docker-cli-to-kubectl.md b/Godeps/_workspace/src/k8s.io/kubernetes/docs/user-guide/docker-cli-to-kubectl.md deleted file mode 100644 index ebdae76c7078..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/user-guide/docker-cli-to-kubectl.md +++ /dev/null @@ -1,337 +0,0 @@ - - - - -WARNING -WARNING -WARNING -WARNING -WARNING - -

    PLEASE NOTE: This document applies to the HEAD of the source tree

    - -If you are using a released version of Kubernetes, you should -refer to the docs that go with that version. - - -The latest 1.0.x release of this document can be found -[here](http://releases.k8s.io/release-1.0/docs/user-guide/docker-cli-to-kubectl.md). - -Documentation for other releases can be found at -[releases.k8s.io](http://releases.k8s.io). - --- - - - - - -# kubectl for docker users - -In this doc, we introduce the Kubernetes command line to for interacting with the api to docker-cli users. The tool, kubectl, is designed to be familiar to docker-cli users but there are a few necessary differences. Each section of this doc highlights a docker subcommand explains the kubectl equivalent. - -**Table of Contents** - - -- [kubectl for docker users](#kubectl-for-docker-users) - - [docker run](#docker-run) - - [docker ps](#docker-ps) - - [docker attach](#docker-attach) - - [docker exec](#docker-exec) - - [docker logs](#docker-logs) - - [docker stop and docker rm](#docker-stop-and-docker-rm) - - [docker login](#docker-login) - - [docker version](#docker-version) - - [docker info](#docker-info) - - - -#### docker run - -How do I run an nginx container and expose it to the world? Checkout [kubectl run](kubectl/kubectl_run.md). - -With docker: - -```console -$ docker run -d --restart=always --name nginx-app -p 80:80 nginx -a9ec34d9878748d2f33dc20cb25c714ff21da8d40558b45bfaec9955859075d0 -$ docker ps -CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES -a9ec34d98787 nginx "nginx -g 'daemon of 2 seconds ago Up 2 seconds 0.0.0.0:80->80/tcp, 443/tcp nginx-app -``` - -With kubectl: - -```console -# start the pod running nginx -$ kubectl run --image=nginx nginx-app -CONTROLLER CONTAINER(S) IMAGE(S) SELECTOR REPLICAS -nginx-app nginx-app nginx run=nginx-app 1 -# expose a port through with a service -$ kubectl expose rc nginx-app --port=80 --name=nginx-http -NAME LABELS SELECTOR IP(S) PORT(S) -nginx-http run=nginx-app run=nginx-app 80/TCP -``` - -With kubectl, we create a [replication controller](replication-controller.md) which will make sure that N pods are running nginx (where N is the number of replicas stated in the spec, which defaults to 1). We also create a [service](services.md) with a selector that matches the replication controller's selector. See the [Quick start](quick-start.md) for more information. - -#### docker ps - -How do I list what is currently running? Checkout [kubectl get](kubectl/kubectl_get.md). - -With docker: - -```console -$ docker ps -CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES -a9ec34d98787 nginx "nginx -g 'daemon of About an hour ago Up About an hour 0.0.0.0:80->80/tcp, 443/tcp nginx-app -``` - -With kubectl: - -```console -$ kubectl get po -NAME READY STATUS RESTARTS AGE -nginx-app-5jyvm 1/1 Running 0 1h -``` - -#### docker attach - -How do I attach to a process that is already running in a container? Checkout [kubectl attach](kubectl/kubectl_attach.md) - -With docker: - -```console -$ docker ps -CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES -a9ec34d98787 nginx "nginx -g 'daemon of 8 minutes ago Up 8 minutes 0.0.0.0:80->80/tcp, 443/tcp nginx-app -$ docker attach -it a9ec34d98787 -... -``` - -With kubectl: - -```console -$ kubectl get pods -NAME READY STATUS RESTARTS AGE -nginx-app-5jyvm 1/1 Running 0 10m -$ kubectl attach -it nginx-app-5jyvm -... - -``` - -#### docker exec - -How do I execute a command in a container? Checkout [kubectl exec](kubectl/kubectl_exec.md). - -With docker: - -```console - -$ docker ps -CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES -a9ec34d98787 nginx "nginx -g 'daemon of 8 minutes ago Up 8 minutes 0.0.0.0:80->80/tcp, 443/tcp nginx-app -$ docker exec a9ec34d98787 cat /etc/hostname -a9ec34d98787 - -``` - -With kubectl: - -```console - -$ kubectl get po -NAME READY STATUS RESTARTS AGE -nginx-app-5jyvm 1/1 Running 0 10m -$ kubectl exec nginx-app-5jyvm -- cat /etc/hostname -nginx-app-5jyvm - -``` - -What about interactive commands? - - -With docker: - -```console - -$ docker exec -ti a9ec34d98787 /bin/sh - -# exit - -``` - -With kubectl: - -```console - -$ kubectl exec -ti nginx-app-5jyvm -- /bin/sh - -# exit - -``` - -For more information see [Getting into containers](getting-into-containers.md). - -#### docker logs - -How do I follow stdout/stderr of a running process? Checkout [kubectl logs](kubectl/kubectl_logs.md). - - -With docker: - -```console - -$ docker logs -f a9e -192.168.9.1 - - [14/Jul/2015:01:04:02 +0000] "GET / HTTP/1.1" 200 612 "-" "curl/7.35.0" "-" -192.168.9.1 - - [14/Jul/2015:01:04:03 +0000] "GET / HTTP/1.1" 200 612 "-" "curl/7.35.0" "-" - -``` - -With kubectl: - -```console - -$ kubectl logs -f nginx-app-zibvs -10.240.63.110 - - [14/Jul/2015:01:09:01 +0000] "GET / HTTP/1.1" 200 612 "-" "curl/7.26.0" "-" -10.240.63.110 - - [14/Jul/2015:01:09:02 +0000] "GET / HTTP/1.1" 200 612 "-" "curl/7.26.0" "-" - -``` - -Now's a good time to mention slight difference between pods and containers; by default pods will not terminate if their processes exit. Instead it will restart the process. This is similar to the docker run option `--restart=always` with one major difference. In docker, the output for each invocation of the process is concatenated but for Kubernetes, each invokation is separate. To see the output from a prevoius run in Kubernetes, do this: - -```console - -$ kubectl logs --previous nginx-app-zibvs -10.240.63.110 - - [14/Jul/2015:01:09:01 +0000] "GET / HTTP/1.1" 200 612 "-" "curl/7.26.0" "-" -10.240.63.110 - - [14/Jul/2015:01:09:02 +0000] "GET / HTTP/1.1" 200 612 "-" "curl/7.26.0" "-" - -``` - -See [Logging](logging.md) for more information. - -#### docker stop and docker rm - -How do I stop and delete a running process? Checkout [kubectl delete](kubectl/kubectl_delete.md). - -With docker - -```console - -$ docker ps -CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES -a9ec34d98787 nginx "nginx -g 'daemon of 22 hours ago Up 22 hours 0.0.0.0:80->80/tcp, 443/tcp nginx-app -$ docker stop a9ec34d98787 -a9ec34d98787 -$ docker rm a9ec34d98787 -a9ec34d98787 - -``` - -With kubectl: - -```console - -$ kubectl get rc nginx-app -CONTROLLER CONTAINER(S) IMAGE(S) SELECTOR REPLICAS -nginx-app nginx-app nginx run=nginx-app 1 -$ kubectl get po -NAME READY STATUS RESTARTS AGE -nginx-app-aualv 1/1 Running 0 16s -$ kubectl delete rc nginx-app -NAME READY STATUS RESTARTS AGE -nginx-app-aualv 1/1 Running 0 16s -$ kubectl get po -NAME READY STATUS RESTARTS AGE - -``` - -Notice that we don't delete the pod directly. With kubectl we want to delete the replication controller that owns the pod. If we delete the pod directly, the replication controller will recreate the pod. - -#### docker login - -There is no direct analog of `docker login` in kubectl. If you are interested in using Kubernetes with a private registry, see [Using a Private Registry](images.md#using-a-private-registry). - -#### docker version - -How do I get the version of my client and server? Checkout [kubectl version](kubectl/kubectl_version.md). - -With docker: - -```console - -$ docker version -Client version: 1.7.0 -Client API version: 1.19 -Go version (client): go1.4.2 -Git commit (client): 0baf609 -OS/Arch (client): linux/amd64 -Server version: 1.7.0 -Server API version: 1.19 -Go version (server): go1.4.2 -Git commit (server): 0baf609 -OS/Arch (server): linux/amd64 - -``` - -With kubectl: - -```console - -$ kubectl version -Client Version: version.Info{Major:"0", Minor:"20.1", GitVersion:"v0.20.1", GitCommit:"", GitTreeState:"not a git tree"} -Server Version: version.Info{Major:"0", Minor:"21+", GitVersion:"v0.21.1-411-g32699e873ae1ca-dirty", GitCommit:"32699e873ae1caa01812e41de7eab28df4358ee4", GitTreeState:"dirty"} - -``` - -#### docker info - -How do I get miscellaneous info about my environment and configuration? Checkout [kubectl cluster-info](kubectl/kubectl_cluster-info.md). - -With docker: - -```console - -$ docker info -Containers: 40 -Images: 168 -Storage Driver: aufs - Root Dir: /usr/local/google/docker/aufs - Backing Filesystem: extfs - Dirs: 248 - Dirperm1 Supported: false -Execution Driver: native-0.2 -Logging Driver: json-file -Kernel Version: 3.13.0-53-generic -Operating System: Ubuntu 14.04.2 LTS -CPUs: 12 -Total Memory: 31.32 GiB -Name: k8s-is-fun.mtv.corp.google.com -ID: ADUV:GCYR:B3VJ:HMPO:LNPQ:KD5S:YKFQ:76VN:IANZ:7TFV:ZBF4:BYJO -WARNING: No swap limit support - -``` - -With kubectl: - -```console - -$ kubectl cluster-info -Kubernetes master is running at https://108.59.85.141 -KubeDNS is running at https://108.59.85.141/api/v1/proxy/namespaces/kube-system/services/kube-dns -KubeUI is running at https://108.59.85.141/api/v1/proxy/namespaces/kube-system/services/kube-ui -Grafana is running at https://108.59.85.141/api/v1/proxy/namespaces/kube-system/services/monitoring-grafana -Heapster is running at https://108.59.85.141/api/v1/proxy/namespaces/kube-system/services/monitoring-heapster -InfluxDB is running at https://108.59.85.141/api/v1/proxy/namespaces/kube-system/services/monitoring-influxdb - -``` - - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/docker-cli-to-kubectl.md?pixel)]() - diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/user-guide/downward-api.md b/Godeps/_workspace/src/k8s.io/kubernetes/docs/user-guide/downward-api.md deleted file mode 100644 index 36bc3769ed25..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/user-guide/downward-api.md +++ /dev/null @@ -1,117 +0,0 @@ - - - - -WARNING -WARNING -WARNING -WARNING -WARNING - -

    PLEASE NOTE: This document applies to the HEAD of the source tree

    - -If you are using a released version of Kubernetes, you should -refer to the docs that go with that version. - - -The latest 1.0.x release of this document can be found -[here](http://releases.k8s.io/release-1.0/docs/user-guide/downward-api.md). - -Documentation for other releases can be found at -[releases.k8s.io](http://releases.k8s.io). - --- - - - - - -# Downward API - -It is sometimes useful for a container to have information about itself, but we -want to be careful not to over-couple containers to Kubernetes. The downward -API allows containers to consume information about themselves or the system and -expose that information how they want it, without necessarily coupling to the -Kubernetes client or REST API. - -An example of this is a "legacy" app that is already written assuming -that a particular environment variable will hold a unique identifier. While it -is often possible to "wrap" such applications, this is tedious and error prone, -and violates the goal of low coupling. Instead, the user should be able to use -the Pod's name, for example, and inject it into this well-known variable. - -## Capabilities - -The following information is available to a `Pod` through the downward API: - -* The pod's name -* The pod's namespace - -More information will be exposed through this same API over time. - -## Exposing pod information into a container - -Containers consume information from the downward API using environment -variables. In the future, containers will also be able to consume the downward -API via a volume plugin. - -### Environment variables - -Most environment variables in the Kubernetes API use the `value` field to carry -simple values. However, the alternate `valueFrom` field allows you to specify -a `fieldRef` to select fields from the pod's definition. The `fieldRef` field -is a structure that has an `apiVersion` field and a `fieldPath` field. The -`fieldPath` field is an expression designating a field of the pod. The -`apiVersion` field is the version of the API schema that the `fieldPath` is -written in terms of. If the `apiVersion` field is not specified it is -defaulted to the API version of the enclosing object. - -The `fieldRef` is evaluated and the resulting value is used as the value for -the environment variable. This allows users to publish their pod's name in any -environment variable they want. - -## Example - -This is an example of a pod that consumes its name and namespace via the -downward API: - - - -```yaml -apiVersion: v1 -kind: Pod -metadata: - name: dapi-test-pod -spec: - containers: - - name: test-container - image: gcr.io/google_containers/busybox - command: [ "/bin/sh", "-c", "env" ] - env: - - name: MY_POD_NAME - valueFrom: - fieldRef: - fieldPath: metadata.name - - name: MY_POD_NAMESPACE - valueFrom: - fieldRef: - fieldPath: metadata.namespace - restartPolicy: Never -``` - -[Download example](downward-api/dapi-pod.yaml) - - -Some more thorough examples: - * [environment variables](environment-guide/) - * [downward API](downward-api/) - - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/downward-api.md?pixel)]() - diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/user-guide/downward-api/README.md b/Godeps/_workspace/src/k8s.io/kubernetes/docs/user-guide/downward-api/README.md deleted file mode 100644 index ef2619ecbc1c..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/user-guide/downward-api/README.md +++ /dev/null @@ -1,72 +0,0 @@ - - - - -WARNING -WARNING -WARNING -WARNING -WARNING - -

    PLEASE NOTE: This document applies to the HEAD of the source tree

    - -If you are using a released version of Kubernetes, you should -refer to the docs that go with that version. - - -The latest 1.0.x release of this document can be found -[here](http://releases.k8s.io/release-1.0/docs/user-guide/downward-api/README.md). - -Documentation for other releases can be found at -[releases.k8s.io](http://releases.k8s.io). - --- - - - - - -# Downward API example - -Following this example, you will create a pod with a container that consumes the pod's name and -namespace using the [downward API](../downward-api.md). - -## Step Zero: Prerequisites - -This example assumes you have a Kubernetes cluster installed and running, and that you have -installed the `kubectl` command line tool somewhere in your path. Please see the [getting -started](../../../docs/getting-started-guides/) for installation instructions for your platform. - -## Step One: Create the pod - -Containers consume the downward API using environment variables. The downward API allows -containers to be injected with the name and namespace of the pod the container is in. - -Use the [`examples/downward-api/dapi-pod.yaml`](dapi-pod.yaml) file to create a Pod with a container that consumes the -downward API. - -```console -$ kubectl create -f docs/user-guide/downward-api/dapi-pod.yaml -``` - -### Examine the logs - -This pod runs the `env` command in a container that consumes the downward API. You can grep -through the pod logs to see that the pod was injected with the correct values: - -```console -$ kubectl logs dapi-test-pod | grep POD_ -2015-04-30T20:22:18.568024817Z MY_POD_NAME=dapi-test-pod -2015-04-30T20:22:18.568087688Z MY_POD_NAMESPACE=default -2015-04-30T20:22:18.568092435Z MY_POD_IP=10.0.1.6 -``` - - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/downward-api/README.md?pixel)]() - diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/user-guide/downward-api/volume/README.md b/Godeps/_workspace/src/k8s.io/kubernetes/docs/user-guide/downward-api/volume/README.md deleted file mode 100644 index aa87b6a261fd..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/user-guide/downward-api/volume/README.md +++ /dev/null @@ -1,105 +0,0 @@ - - - - -WARNING -WARNING -WARNING -WARNING -WARNING - -

    PLEASE NOTE: This document applies to the HEAD of the source tree

    - -If you are using a released version of Kubernetes, you should -refer to the docs that go with that version. - - -The latest 1.0.x release of this document can be found -[here](http://releases.k8s.io/release-1.0/docs/user-guide/downward-api/volume/README.md). - -Documentation for other releases can be found at -[releases.k8s.io](http://releases.k8s.io). - --- - - - - - -# Downward API volume plugin - -Following this example, you will create a pod with a downward API volume. -A downward API volume is a k8s volume plugin with the ability to save some pod information in a plain text file. The pod information can be for example some [metadata](../../../../docs/devel/api-conventions.md#metadata). - -Supported metadata fields: - -1. `metadata.annotations` -2. `metadata.namespace` -3. `metadata.name` -4. `metadata.labels` - -### Step Zero: Prerequisites - -This example assumes you have a Kubernetes cluster installed and running, and the ```kubectl``` command line tool somewhere in your path. Please see the [gettingstarted](../../../../docs/getting-started-guides/) for installation instructions for your platform. - -### Step One: Create the pod - -Use the `docs/user-guide/downward-api/dapi-volume.yaml` file to create a Pod with a  downward API volume which stores pod labels and pod annotations to `/etc/labels` and  `/etc/annotations` respectively. - -```shell -$ kubectl create -f docs/user-guide/downward-api/volume/dapi-volume.yaml -``` - -### Step Two: Examine pod/container output - -The pod displays (every 5 seconds) the content of the dump files which can be executed via the usual `kubectl log` command - -```shell -$ kubectl logs kubernetes-downwardapi-volume-example -cluster="test-cluster1" -rack="rack-22" -zone="us-est-coast" -build="two" -builder="john-doe" -kubernetes.io/config.seen="2015-08-24T13:47:23.432459138Z" -kubernetes.io/config.source="api" -``` - -### Internals - -In pod's `/etc` directory one may find the file created by the plugin (system files elided): - -```shell -$ kubectl exec kubernetes-downwardapi-volume-example -i -t -- sh -/ # ls -laR /etc -/etc: -total 32 -drwxrwxrwt 3 0 0 180 Aug 24 13:03 . -drwxr-xr-x 1 0 0 4096 Aug 24 13:05 .. -drwx------ 2 0 0 80 Aug 24 13:03 ..2015_08_24_13_03_44259413923 -lrwxrwxrwx 1 0 0 30 Aug 24 13:03 ..downwardapi -> ..2015_08_24_13_03_44259413923 -lrwxrwxrwx 1 0 0 25 Aug 24 13:03 annotations -> ..downwardapi/annotations -lrwxrwxrwx 1 0 0 20 Aug 24 13:03 labels -> ..downwardapi/labels - -/etc/..2015_08_24_13_03_44259413923: -total 8 -drwx------ 2 0 0 80 Aug 24 13:03 . -drwxrwxrwt 3 0 0 180 Aug 24 13:03 .. --rw-r--r-- 1 0 0 115 Aug 24 13:03 annotations --rw-r--r-- 1 0 0 53 Aug 24 13:03 labels -/ # -``` - -The file `labels` is stored in a temporary directory (`..2015_08_24_13_03_44259413923` in the example above) which is symlinked to by `..downwardapi`. Symlinks for annotations and labels in `/etc` point to files containing the actual metadata through the `..downwardapi` indirection.  This structure allows for dynamic atomic refresh of the metadata: updates are written to a new temporary directory, and the `..downwardapi` symlink is updated atomically using `rename(2)`. - - - - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/downward-api/volume/README.md?pixel)]() - diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/user-guide/environment-guide/README.md b/Godeps/_workspace/src/k8s.io/kubernetes/docs/user-guide/environment-guide/README.md deleted file mode 100644 index b382f3353480..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/user-guide/environment-guide/README.md +++ /dev/null @@ -1,126 +0,0 @@ - - - - -WARNING -WARNING -WARNING -WARNING -WARNING - -

    PLEASE NOTE: This document applies to the HEAD of the source tree

    - -If you are using a released version of Kubernetes, you should -refer to the docs that go with that version. - - -The latest 1.0.x release of this document can be found -[here](http://releases.k8s.io/release-1.0/docs/user-guide/environment-guide/README.md). - -Documentation for other releases can be found at -[releases.k8s.io](http://releases.k8s.io). - --- - - - - -Environment Guide Example -========================= -This example demonstrates running pods, replication controllers, and -services. It shows two types of pods: frontend and backend, with -services on top of both. Accessing the frontend pod will return -environment information about itself, and a backend pod that it has -accessed through the service. The goal is to illuminate the -environment metadata available to running containers inside the -Kubernetes cluster. The documentation for the Kubernetes environment -is [here](../../../docs/user-guide/container-environment.md). - -![Diagram](diagram.png) - -Prerequisites -------------- -This example assumes that you have a Kubernetes cluster installed and -running, and that you have installed the `kubectl` command line tool -somewhere in your path. Please see the [getting -started](../../../docs/getting-started-guides/) for installation instructions -for your platform. - -Optional: Build your own containers ------------------------------------ -The code for the containers is under -[containers/](containers/) - -Get everything running ----------------------- - - kubectl create -f ./backend-rc.yaml - kubectl create -f ./backend-srv.yaml - kubectl create -f ./show-rc.yaml - kubectl create -f ./show-srv.yaml - -Query the service ------------------ -Use `kubectl describe service show-srv` to determine the public IP of -your service. - -> Note: If your platform does not support external load balancers, - you'll need to open the proper port and direct traffic to the - internal IP shown for the frontend service with the above command - -Run `curl :80` to query the service. You should get -something like this back: - -``` -Pod Name: show-rc-xxu6i -Pod Namespace: default -USER_VAR: important information - -Kubenertes environment variables -BACKEND_SRV_SERVICE_HOST = 10.147.252.185 -BACKEND_SRV_SERVICE_PORT = 5000 -KUBERNETES_RO_SERVICE_HOST = 10.147.240.1 -KUBERNETES_RO_SERVICE_PORT = 80 -KUBERNETES_SERVICE_HOST = 10.147.240.2 -KUBERNETES_SERVICE_PORT = 443 -KUBE_DNS_SERVICE_HOST = 10.147.240.10 -KUBE_DNS_SERVICE_PORT = 53 - -Found backend ip: 10.147.252.185 port: 5000 -Response from backend -Backend Container -Backend Pod Name: backend-rc-6qiya -Backend Namespace: default -``` - -First the frontend pod's information is printed. The pod name and -[namespace](../../../docs/design/namespaces.md) are retreived from the -[Downward API](../../../docs/user-guide/downward-api.md). Next, `USER_VAR` is the name of -an environment variable set in the [pod -definition](show-rc.yaml). Then, the dynamic Kubernetes environment -variables are scanned and printed. These are used to find the backend -service, named `backend-srv`. Finally, the frontend pod queries the -backend service and prints the information returned. Again the backend -pod returns its own pod name and namespace. - -Try running the `curl` command a few times, and notice what -changes. Ex: `watch -n 1 curl -s ` Firstly, the frontend service -is directing your request to different frontend pods each time. The -frontend pods are always contacting the backend through the backend -service. This results in a different backend pod servicing each -request as well. - -Cleanup -------- - kubectl delete rc,service -l type=show-type - kubectl delete rc,service -l type=backend-type - - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/environment-guide/README.md?pixel)]() - diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/user-guide/environment-guide/backend-rc.yaml b/Godeps/_workspace/src/k8s.io/kubernetes/docs/user-guide/environment-guide/backend-rc.yaml deleted file mode 100644 index 6c57b95dac91..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/user-guide/environment-guide/backend-rc.yaml +++ /dev/null @@ -1,30 +0,0 @@ ---- -apiVersion: v1 -kind: ReplicationController -metadata: - name: backend-rc - labels: - type: backend-type -spec: - replicas: 3 - template: - metadata: - labels: - type: backend-type - spec: - containers: - - name: backend-container - image: gcr.io/google-samples/env-backend:1.1 - imagePullPolicy: Always - ports: - - containerPort: 5000 - protocol: TCP - env: - - name: POD_NAME - valueFrom: - fieldRef: - fieldPath: metadata.name - - name: POD_NAMESPACE - valueFrom: - fieldRef: - fieldPath: metadata.namespace diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/user-guide/environment-guide/backend-srv.yaml b/Godeps/_workspace/src/k8s.io/kubernetes/docs/user-guide/environment-guide/backend-srv.yaml deleted file mode 100644 index 7083b37bf88e..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/user-guide/environment-guide/backend-srv.yaml +++ /dev/null @@ -1,13 +0,0 @@ ---- -apiVersion: v1 -kind: Service -metadata: - name: backend-srv - labels: - type: backend-type -spec: - ports: - - port: 5000 - protocol: TCP - selector: - type: backend-type diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/user-guide/environment-guide/containers/README.md b/Godeps/_workspace/src/k8s.io/kubernetes/docs/user-guide/environment-guide/containers/README.md deleted file mode 100644 index 92d708e15f5f..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/user-guide/environment-guide/containers/README.md +++ /dev/null @@ -1,57 +0,0 @@ - - - - -WARNING -WARNING -WARNING -WARNING -WARNING - -

    PLEASE NOTE: This document applies to the HEAD of the source tree

    - -If you are using a released version of Kubernetes, you should -refer to the docs that go with that version. - - -The latest 1.0.x release of this document can be found -[here](http://releases.k8s.io/release-1.0/docs/user-guide/environment-guide/containers/README.md). - -Documentation for other releases can be found at -[releases.k8s.io](http://releases.k8s.io). - --- - - - - -Building --------- -For each container, the build steps are the same. The examples below -are for the `show` container. Replace `show` with `backend` for the -backend container. - -Google Container Registry ([GCR](https://cloud.google.com/tools/container-registry/)) ---- - docker build -t gcr.io//show . - gcloud docker push gcr.io//show - -Docker Hub ----------- - docker build -t /show . - docker push /show - -Change Pod Definitions ----------------------- -Edit both `show-rc.yaml` and `backend-rc.yaml` and replace the -specified `image:` with the one that you built. - - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/environment-guide/containers/README.md?pixel)]() - diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/user-guide/environment-guide/containers/backend/Dockerfile b/Godeps/_workspace/src/k8s.io/kubernetes/docs/user-guide/environment-guide/containers/backend/Dockerfile deleted file mode 100644 index 3fa58ff7abe4..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/user-guide/environment-guide/containers/backend/Dockerfile +++ /dev/null @@ -1,2 +0,0 @@ -FROM golang:onbuild -EXPOSE 8080 diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/user-guide/environment-guide/containers/backend/backend.go b/Godeps/_workspace/src/k8s.io/kubernetes/docs/user-guide/environment-guide/containers/backend/backend.go deleted file mode 100644 index b4edf75ff5dd..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/user-guide/environment-guide/containers/backend/backend.go +++ /dev/null @@ -1,37 +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 main - -import ( - "fmt" - "log" - "net/http" - "os" -) - -func printInfo(resp http.ResponseWriter, req *http.Request) { - name := os.Getenv("POD_NAME") - namespace := os.Getenv("POD_NAMESPACE") - fmt.Fprintf(resp, "Backend Container\n") - fmt.Fprintf(resp, "Backend Pod Name: %v\n", name) - fmt.Fprintf(resp, "Backend Namespace: %v\n", namespace) -} - -func main() { - http.HandleFunc("/", printInfo) - log.Fatal(http.ListenAndServe(":5000", nil)) -} diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/user-guide/environment-guide/containers/show/Dockerfile b/Godeps/_workspace/src/k8s.io/kubernetes/docs/user-guide/environment-guide/containers/show/Dockerfile deleted file mode 100644 index 3fa58ff7abe4..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/user-guide/environment-guide/containers/show/Dockerfile +++ /dev/null @@ -1,2 +0,0 @@ -FROM golang:onbuild -EXPOSE 8080 diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/user-guide/environment-guide/containers/show/show.go b/Godeps/_workspace/src/k8s.io/kubernetes/docs/user-guide/environment-guide/containers/show/show.go deleted file mode 100644 index 56bd988b4000..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/user-guide/environment-guide/containers/show/show.go +++ /dev/null @@ -1,95 +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 main - -import ( - "fmt" - "io" - "log" - "net/http" - "os" - "sort" - "strings" -) - -func getKubeEnv() (map[string]string, error) { - environS := os.Environ() - environ := make(map[string]string) - for _, val := range environS { - split := strings.Split(val, "=") - if len(split) != 2 { - return environ, fmt.Errorf("Some weird env vars") - } - environ[split[0]] = split[1] - } - for key := range environ { - if !(strings.HasSuffix(key, "_SERVICE_HOST") || - strings.HasSuffix(key, "_SERVICE_PORT")) { - delete(environ, key) - } - } - return environ, nil -} - -func printInfo(resp http.ResponseWriter, req *http.Request) { - kubeVars, err := getKubeEnv() - if err != nil { - http.Error(resp, err.Error(), http.StatusInternalServerError) - return - } - - backendHost := os.Getenv("BACKEND_SRV_SERVICE_HOST") - backendPort := os.Getenv("BACKEND_SRV_SERVICE_PORT") - backendRsp, backendErr := http.Get(fmt.Sprintf( - "http://%v:%v/", - backendHost, - backendPort)) - if backendErr == nil { - defer backendRsp.Body.Close() - } - - name := os.Getenv("POD_NAME") - namespace := os.Getenv("POD_NAMESPACE") - fmt.Fprintf(resp, "Pod Name: %v \n", name) - fmt.Fprintf(resp, "Pod Namespace: %v \n", namespace) - - envvar := os.Getenv("USER_VAR") - fmt.Fprintf(resp, "USER_VAR: %v \n", envvar) - - fmt.Fprintf(resp, "\nKubenertes environment variables\n") - var keys []string - for key := range kubeVars { - keys = append(keys, key) - } - sort.Strings(keys) - for _, key := range keys { - fmt.Fprintf(resp, "%v = %v \n", key, kubeVars[key]) - } - - fmt.Fprintf(resp, "\nFound backend ip: %v port: %v\n", backendHost, backendPort) - if backendErr == nil { - fmt.Fprintf(resp, "Response from backend\n") - io.Copy(resp, backendRsp.Body) - } else { - fmt.Fprintf(resp, "Error from backend: %v", backendErr.Error()) - } -} - -func main() { - http.HandleFunc("/", printInfo) - log.Fatal(http.ListenAndServe(":8080", nil)) -} diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/user-guide/environment-guide/diagram.png b/Godeps/_workspace/src/k8s.io/kubernetes/docs/user-guide/environment-guide/diagram.png deleted file mode 100644 index dd5d1551631f..000000000000 Binary files a/Godeps/_workspace/src/k8s.io/kubernetes/docs/user-guide/environment-guide/diagram.png and /dev/null differ diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/user-guide/environment-guide/show-rc.yaml b/Godeps/_workspace/src/k8s.io/kubernetes/docs/user-guide/environment-guide/show-rc.yaml deleted file mode 100644 index 4de94c06ca30..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/user-guide/environment-guide/show-rc.yaml +++ /dev/null @@ -1,32 +0,0 @@ ---- -apiVersion: v1 -kind: ReplicationController -metadata: - name: show-rc - labels: - type: show-type -spec: - replicas: 3 - template: - metadata: - labels: - type: show-type - spec: - containers: - - name: show-container - image: gcr.io/google-samples/env-show:1.1 - imagePullPolicy: Always - ports: - - containerPort: 8080 - protocol: TCP - env: - - name: USER_VAR - value: important information - - name: POD_NAME - valueFrom: - fieldRef: - fieldPath: metadata.name - - name: POD_NAMESPACE - valueFrom: - fieldRef: - fieldPath: metadata.namespace diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/user-guide/environment-guide/show-srv.yaml b/Godeps/_workspace/src/k8s.io/kubernetes/docs/user-guide/environment-guide/show-srv.yaml deleted file mode 100644 index 25a2d7473e02..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/user-guide/environment-guide/show-srv.yaml +++ /dev/null @@ -1,15 +0,0 @@ ---- -apiVersion: v1 -kind: Service -metadata: - name: show-srv - labels: - type: show-type -spec: - type: LoadBalancer - ports: - - port: 80 - protocol: TCP - targetPort: 8080 - selector: - type: show-type diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/user-guide/gcm.png b/Godeps/_workspace/src/k8s.io/kubernetes/docs/user-guide/gcm.png deleted file mode 100644 index c2832c1d9826..000000000000 Binary files a/Godeps/_workspace/src/k8s.io/kubernetes/docs/user-guide/gcm.png and /dev/null differ diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/user-guide/getting-into-containers.md b/Godeps/_workspace/src/k8s.io/kubernetes/docs/user-guide/getting-into-containers.md deleted file mode 100644 index 5007880f4455..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/user-guide/getting-into-containers.md +++ /dev/null @@ -1,107 +0,0 @@ - - - - -WARNING -WARNING -WARNING -WARNING -WARNING - -

    PLEASE NOTE: This document applies to the HEAD of the source tree

    - -If you are using a released version of Kubernetes, you should -refer to the docs that go with that version. - - -The latest 1.0.x release of this document can be found -[here](http://releases.k8s.io/release-1.0/docs/user-guide/getting-into-containers.md). - -Documentation for other releases can be found at -[releases.k8s.io](http://releases.k8s.io). - --- - - - - -#Getting into containers: kubectl exec -Developers can use `kubectl exec` to run commands in a container. This guide demonstrates two use cases. - -## Using kubectl exec to check the environment variables of a container - -Kubernetes exposes [services](services.md#environment-variables) through environment variables. It is convenient to check these environment variables using `kubectl exec`. - - -We first create a pod and a service, - -```console -$ kubectl create -f examples/guestbook/redis-master-controller.yaml -$ kubectl create -f examples/guestbook/redis-master-service.yaml -``` - -wait until the pod is Running and Ready, - -```console -$ kubectl get pod -NAME READY REASON RESTARTS AGE -redis-master-ft9ex 1/1 Running 0 12s -``` - -then we can check the environment variables of the pod, - -```console -$ kubectl exec redis-master-ft9ex env -... -REDIS_MASTER_SERVICE_PORT=6379 -REDIS_MASTER_SERVICE_HOST=10.0.0.219 -... -``` - -We can use these environment variables in applications to find the service. - - -## Using kubectl exec to check the mounted volumes - -It is convenient to use `kubectl exec` to check if the volumes are mounted as expected. -We first create a Pod with a volume mounted at /data/redis, - -```console -kubectl create -f docs/user-guide/walkthrough/pod-redis.yaml -``` - -wait until the pod is Running and Ready, - -```console -$ kubectl get pods -NAME READY REASON RESTARTS AGE -storage 1/1 Running 0 1m -``` - -we then use `kubectl exec` to verify that the volume is mounted at /data/redis, - -```console -$ kubectl exec storage ls /data -redis -``` - -## Using kubectl exec to open a bash terminal in a pod - -After all, open a terminal in a pod is the most direct way to introspect the pod. Assuming the pod/storage is still running, run - -```console -$ kubectl exec -ti storage -- bash -root@storage:/data# -``` - -This gets you a terminal. - - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/getting-into-containers.md?pixel)]() - diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/user-guide/identifiers.md b/Godeps/_workspace/src/k8s.io/kubernetes/docs/user-guide/identifiers.md deleted file mode 100644 index 9f5427142562..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/user-guide/identifiers.md +++ /dev/null @@ -1,51 +0,0 @@ - - - - -WARNING -WARNING -WARNING -WARNING -WARNING - -

    PLEASE NOTE: This document applies to the HEAD of the source tree

    - -If you are using a released version of Kubernetes, you should -refer to the docs that go with that version. - - -The latest 1.0.x release of this document can be found -[here](http://releases.k8s.io/release-1.0/docs/user-guide/identifiers.md). - -Documentation for other releases can be found at -[releases.k8s.io](http://releases.k8s.io). - --- - - - - - -# Identifiers - -All objects in the Kubernetes REST API are unambiguously identified by a Name and a UID. - -For non-unique user-provided attributes, Kubernetes provides [labels](labels.md) and [annotations](annotations.md). - -## Names - -Names are generally client-provided. Only one object of a given kind can have a given name at a time (i.e., they are spatially unique). But if you delete an object, you can make a new object with the same name. Names are the used to refer to an object in a resource URL, such as `/api/v1/pods/some-name`. By convention, the names of Kubernetes resources should be up to maximum length of 253 characters and consist of lower case alphanumeric characters, `-`, and `.`, but certain resources have more specific restrictions. See the [identifiers design doc](../design/identifiers.md) for the precise syntax rules for names. - -## UIDs - -UID are generated by Kubernetes. Every object created over the whole lifetime of a Kubernetes cluster has a distinct UID (i.e., they are spatially and temporally unique). - - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/identifiers.md?pixel)]() - diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/docs/user-guide/images.md b/Godeps/_workspace/src/k8s.io/kubernetes/docs/user-guide/images.md deleted file mode 100644 index 4e59462d2764..000000000000 --- a/Godeps/_workspace/src/k8s.io/kubernetes/docs/user-guide/images.md +++ /dev/null @@ -1,283 +0,0 @@ - - - - -WARNING -WARNING -WARNING -WARNING -WARNING - -

    PLEASE NOTE: This document applies to the HEAD of the source tree

    - -If you are using a released version of Kubernetes, you should -refer to the docs that go with that version. - - -The latest 1.0.x release of this document can be found -[here](http://releases.k8s.io/release-1.0/docs/user-guide/images.md). - -Documentation for other releases can be found at -[releases.k8s.io](http://releases.k8s.io). - --- - - - - - -# Images - -Each container in a pod has its own image. Currently, the only type of image supported is a [Docker Image](https://docs.docker.com/userguide/dockerimages/). - -You create your Docker image and push it to a registry before referring to it in a Kubernetes pod. - -The `image` property of a container supports the same syntax as the `docker` command does, including private registries and tags. - -**Table of Contents** - - -- [Images](#images) - - [Updating Images](#updating-images) - - [Using a Private Registry](#using-a-private-registry) - - [Using Google Container Registry](#using-google-container-registry) - - [Configuring Nodes to Authenticate to a Private Repository](#configuring-nodes-to-authenticate-to-a-private-repository) - - [Pre-pulling Images](#pre-pulling-images) - - [Specifying ImagePullSecrets on a Pod](#specifying-imagepullsecrets-on-a-pod) - - [Use Cases](#use-cases) - - - -## Updating Images - -The default pull policy is `PullIfNotPresent` which causes the Kubelet to not -pull an image if it already exists. If you would like to always force a pull -you must set a pull image policy of `PullAlways` or specify a `:latest` tag on -your image. - -## Using a Private Registry - -Private registries may require keys to read images from them. -Credentials can be provided in several ways: - - Using Google Container Registry - - Per-cluster - - automatically configured on Google Compute Engine or Google Container Engine - - all pods can read the project's private registry - - Configuring Nodes to Authenticate to a Private Registry - - all pods can read any configured private registries - - requires node configuration by cluster administrator - - Pre-pulling Images - - all pods can use any images cached on a node - - requires root access to all nodes to setup - - Specifying ImagePullSecrets on a Pod - - only pods which provide own keys can access the private registry -Each option is described in more detail below. - - -### Using Google Container Registry - -Kubernetes has native support for the [Google Container -Registry (GCR)](https://cloud.google.com/tools/container-registry/), when running on Google Compute -Engine (GCE). If you are running your cluster on GCE or Google Container Engine (GKE), simply -use the full image name (e.g. gcr.io/my_project/image:tag). - -All pods in a cluster will have read access to images in this registry. - -The kubelet kubelet will authenticate to GCR using the instance's -Google service account. The service account on the instance -will have a `https://www.googleapis.com/auth/devstorage.read_only`, -so it can pull from the project's GCR, but not push. - -### Configuring Nodes to Authenticate to a Private Repository - -**Note:** if you are running on Google Container Engine (GKE), there will already be a `.dockercfg` on each node -with credentials for Google Container Registry. You cannot use this approach. - -**Note:** this approach is suitable if you can control node configuration. It -will not work reliably on GCE, and any other cloud provider that does automatic -node replacement. - -Docker stores keys for private registries in the `$HOME/.dockercfg` file. If you put this -in the `$HOME` of `root` on a kubelet, then docker will use it. - -Here are the recommended steps to configuring your nodes to use a private registry. In this -example, run these on your desktop/laptop: - 1. run `docker login [server]` for each set of credentials you want to use. - 1. view `$HOME/.dockercfg` in an editor to ensure it contains just the credentials you want to use. - 1. get a list of your nodes - - for example: `nodes=$(kubectl get nodes -o template --template='{{range.items}}{{.metadata.name}} {{end}}')` - 1. copy your local `.dockercfg` to the home directory of root on each node. - - for example: `for n in $nodes; do scp ~/.dockercfg root@$n:/root/.dockercfg; done` - -Verify by creating a pod that uses a private image, e.g.: - -```yaml -$ cat < /tmp/private-image-test-1.yaml -apiVersion: v1 -kind: Pod -metadata: - name: private-image-test-1 -spec: - containers: - - name: uses-private-image - image: $PRIVATE_IMAGE_NAME - command: [ "echo", "SUCCESS" ] - imagePullPolicy: Always -EOF -$ kubectl create -f /tmp/private-image-test-1.yaml -pods/private-image-test-1 -$ -``` - -If everything is working, then, after a few moments, you should see: - -```console -$ kubectl logs private-image-test-1 -SUCCESS -``` - -If it failed, then you will see: - -```console -$ kubectl describe pods/private-image-test-1 | grep "Failed" - Fri, 26 Jun 2015 15:36:13 -0700 Fri, 26 Jun 2015 15:39:13 -0700 19 {kubelet node-i2hq} spec.containers{uses-private-image} failed Failed to pull image "user/privaterepo:v1": Error: image user/privaterepo:v1 not found -``` - - -You must ensure all nodes in the cluster have the same `.dockercfg`. Otherwise, pods will run on -some nodes and fail to run on others. For example, if you use node autoscaling, then each instance -template needs to include the `.dockercfg` or mount a drive that contains it. - -All pods will have read access to images in any private registry once private -registry keys are added to the `.dockercfg`. - -**This was tested with a private docker repository as of 26 June with Kubernetes version v0.19.3. -It should also work for a private registry such as quay.io, but that has not been tested.** - -### Pre-pulling Images - -**Note:** if you are running on Google Container Engine (GKE), there will already be a `.dockercfg` on each node -with credentials for Google Container Registry. You cannot use this approach. - -**Note:** this approach is suitable if you can control node configuration. It -will not work reliably on GCE, and any other cloud provider that does automatic -node replacement. - -Be default, the kubelet will try to pull each image from the specified registry. -However, if the `imagePullPolicy` property of the container is set to `IfNotPresent` or `Never`, -then a local image is used (preferentially or exclusively, respectively). - -If you want to rely on pre-pulled images as a substitute for registry authentication, -you must ensure all nodes in the cluster have the same pre-pulled images. - -This can be used to preload certain images for speed or as an alternative to authenticating to a private registry. - -All pods will have read access to any pre-pulled images. - -### Specifying ImagePullSecrets on a Pod - -**Note:** This approach is currently the recommended approach for GKE, GCE, and any cloud-providers -where node creation is automated. - -Kubernetes supports specifying registry keys on a pod. - -First, create a `.dockercfg`, such as running `docker login `. -Then put the resulting `.dockercfg` file into a [secret resource](secrets.md). For example: - -```console -$ docker login -Username: janedoe -Password: ●●●●●●●●●●● -Email: jdoe@example.com -WARNING: login credentials saved in /Users/jdoe/.dockercfg. -Login Succeeded - -$ echo $(cat ~/.dockercfg) -{ "https://index.docker.io/v1/": { "auth": "ZmFrZXBhc3N3b3JkMTIK", "email": "jdoe@example.com" } } - -$ cat ~/.dockercfg | base64 -eyAiaHR0cHM6Ly9pbmRleC5kb2NrZXIuaW8vdjEvIjogeyAiYXV0aCI6ICJabUZyWlhCaGMzTjNiM0prTVRJSyIsICJlbWFpbCI6ICJqZG9lQGV4YW1wbGUuY29tIiB9IH0K - -$ cat > /tmp/image-pull-secret.yaml <